Posts

Showing posts from August, 2015

javascript - visualize streamed jpg frames and (sync'ed) text on html using Flask -

i stream data rpi (server) laptop (client): data includes jpg images , short text (made of numbers). each image saved on client, , telemetry.dat file records text each image. want visualize in browser, images , text streamed. use flask , followed this tutorial . tutorial shows how visualize in browser, streamed images only, have not found on how visualize images , (sync) text data together. below have tried. generator ( gen_frames() ) yields alternatively images , text, , data_feed() (in app.py ) returns response "that is" image or text. in index.html , how can make sure right element updated, i.e when response image, <img src="{{ url_for('video_feed') }}" id="vid"> updated, , if it's text: xhr.open('get', '{{ url_for('video_feed') }}'); 1. create generator alternatively yields img , associated text def gen_frames(): cnt = 1 while true: #get streamed image , streamed telemetry (text)

javascript - How to fadeIn and fadeOut individual Div elements created with foreach? -

i have foreach loop , creates multiple div elements. i added onclick event when user clicks on div doing fadein or fadeout . the problem is, of div's obvouisly have same id , when click on 1 of div's fade in , fade out first div element. i don't know how fade in , fade out them individually. i have added code in fiddle function showitems() { var x = document.getelementbyid('showitemdiv'); if (x.style.display === 'none') { x.style.display = 'block'; } else { x.style.display = 'none'; } } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="row rounded-top" style="margin-top:5px;background-color:lightblue;padding:5px;" onclick="showitems()"> <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12"> <div class="row"> <span class=&

c++ - How to elegantly emplace optional with const values -

i trying use std::optional late instantiate object (which not valid before). found annoying situation, not know how elegantly solve this. i have following data structure: struct foo { int foo1; float foo2; }; as member std::optional<foo> foo_ . in function void bar::bar(int const value1, float const value2) { foo_.emplace(value1, value2); } to surprise, fails compile (in gcc 7.1) because tries call constructor of foo int const&, float const& . naive me tried specialize emplace as: foo_.emplace<int, float>(value1, value2); which did not work either because tries use initializer_list then. so question how 1 call emplace elegantly? you have add constructor emplace use () constructor , not {} (which allow aggregate initialization). struct foo { foo(int i, float f) : foo1(i), foo2(f) {} int foo1; float foo2; }; or explicit on constructor used: foo_.emplace(foo{value1, value2});

html - How can I make the CSS attribut of a Div to change when there is a text overflow on another Div? -

i'm building div column-count = 2, column-fill = auto, , height = 100%. this div contain other div text inside. however, want page fluid , adapt automatically when window shorter in order overflowing text read on 2 columns using browser scrollbar. so need div remove height = 100% , replace min-height = 100% in order scrollbar appear on browser allow read below overflowing text on 2 column instead of having overflowing text appearing on third column (despite column-count = 2). is there way achieve css or should need javascript, , how ? many thanks

python - Why is __repr__ called in the code below? -

can please me why __repr__ method called q.pop() method in code below? >>> class item: ... def __init__(self, name): ... self.name = name ... def __repr__(self): ... return 'item({!r})'.format(self.name) ... >>> q = priorityqueue() >>> q.push(item('foo'), 1) >>> q.push(item('bar'), 5) >>> q.push(item('spam'), 4) >>> q.push(item('grok'), 1) >>> q.pop() item('bar') >>> q.pop() item('spam') >>> q.pop() item('foo') >>> q.pop() item('grok') >>> the built-in __repr__ function used return printable format of object. in case, because item custom object/class, override in __repr__ allows instance of item displayed in terminal. see when call q.pop() , item printed screen, , printing done through override of __repr__ function. q.pop() prints item('bar') because overridden

laravel - Eloquent Model with dynamic table..? -

i've got generic model called item , related model called itemproperties . item -> hasone -> itemproperties itemproperties -> belongsto -> item the item model has property called 'itemtype_id' tells model table store to. ex: itemtype = 1, table itemproperties_1 itemtype = 2, table itemproperties_2. so changed gettable() method on itemproperties model: function gettable(){ return 'item_properties_' . $this->itemtype_id; } so, when creating new item , properties, i've been setting itemproperties this: // create & save item $item = new item(['itemtype_id' => $itemtype_id]); $item->save(); // save properties $itemproperties = new itemproperties($properties); $itemproperties->itemtype_id = $item->itemtype_id; $item->properties()->save($itemproperties); this seems work fine... when saving itemproperties. however, when try retrieve them, doing $item->properties , don't have way tell itemty

Greasemonkey script bypass timer count down -

here part of code got html <div style="background:#efefef;margin:2px auto;color:#171717;width:280px;padding:4px;border-radius:3px"><span id="countdown">70</span> <a href="https://youtu.be/a7iozsndxzm" target="_blank" style="color:#171717"><b>the 1 love (official video</b></a> <a href="javascript:void(0);" onclick="report_page('4588','ahr0chm6ly95b3v0ds5izs9hn2lpelnuzhh6tq==','surf');"><img src="img/report.png" alt="report" title="report" border="0"></a><br>you receive 9 credits</div> were se id="countdown">70</span> 70 count down number counting down , wondering if make grease monkey script this. the link site https://www.viewgrip.net/ytviews.php?p=surf

javascript - Error is thrown but error response object is empty in Mongoose -

i trying send request api. my code this app.post('/api/create', (req, res, next) => { if (!req.headers || !req.headers.authorization) { return res.status(500).json({ status: 'error', err: 'no authorization header' }); } const bits = req.headers.authorization.split(' '); const scheme = bits[0]; const token = bits[1]; jwt.verify(token, 'secret', function(err, decoded) { if (!!err) { return res.status(400).json({ status: 'error', err: 'invalid credentials.' }); } // const userid = decoded.id; // if (!userid) { return res.status(400).json({ status: 'error', err: 'user id missing', }); } // const { postid } = req.params; // user.findbyid(userid).then(user => { // if (!user) { return res.status(400).json({ status: 'error', e

zeromq - zmq.error.ZMQError: Socket operation on non-socket: How to find alive sockets before closing? -

in application, i'm creating 2 sockets , have try/except this: try: socketa.connect("tcp://localhost:5557") socketb.bind("tcp://localhost:5558") except zmq.zmqerror e: if e.errno == zmq.einval: logger.error("endpoint supplied invalid") else: logger.error("the zeromq error error number {0}".format(e.errno)) raise zmqerror(e) cleanup() if reason, 1 of sockets cannot .connect() / .bind() , want close both sockets , terminate context in cleanup() function, how know sockets alive before closing them? does zeromq provide information active sockets before closing them nicely? given logic above, let use approach: case a: both sockets did .connect() + .bind() respectively case b: of sockets did fail in doing so. try: socketa.connect( "tcp://localhost:5557" ) socketa.setsockopt( zmq.linger, 0 ) try: socketb.bind( "tcp://loc

elasticsearch - How to split and parse in Scripted Metric Aggregation? -

i'm using scripted metric aggregation , like, in map_script part, use field of type string , split 2 parts, convert parts floats , average them. is there way this?

reactjs - Value of i parameter in props ind is not changing -

code snippet: function button(props) { var ans = [ ["56","30","11","20"],["1","-2","2","-1"], ["odd","even","none","both"] ]; var button = [], i; for(i = 0; <= 3; i++) { button.push(<button key={i} onclick={()=>props.ind(i)}> {ans[props.q-1][i]} </button>) } return (<div>{button}</div>) } i newbie @ using fatarrows , react.i making quizzing interface.here each of 4 buttons (i=0 3) holds choice specific question no.(q) on checking web devs found each of 4 buttons,value of passed in props.ind method 4,i.e value of after final increment. finally fixed it.so var variable. each of 4 buttons stored in button array, value of wasn't copied in prop.ind(i) method parameter instead reference stored.hence last value of @ end of loop i.e 4 each of html button,props.ind(4).

android - Is it possible to hold a ScrollView to be always scrollable? -

i want make scrollview scrollable though has no element in it. i tried extend linearlayout out of screen, not work. csv=(scrollview) findviewbyid(r.id.scrview); csv.getviewtreeobserver().addonscrollchangedlistener(new viewtreeobserver.onscrollchangedlistener() { @override public void onscrollchanged() { int scrolly= csv.getscrolly(); txtview.settext(string.valueof(scrolly)); } i want because want see image position 1 element in scrollview. this, can move image , see y position. it can thought vertical viewpager.

Netlogo: Set specific setxy patern with set number of turtles? -

Image
is possible create set number of turtles, file, have own patches? in same location? i've got 106 turtles i'm reading in file , hoping have them created on own patches, square latice kind of thing. want able @ model world , identify turtle. file-open "turtledata_a.txt" show file-read-line while [not file-at-end?] [ set param read-from-string (word "[" file-read-line "]") create-turtles 1 [setxy ??] ] file-close ] probably easiest use csv extension , add xy data file you're reading in. example, if have turtle_data.csv file looks like: param-to-read,x,y john,-10,10 billy,-5,5 bob,0,0 simon,5,-5 michael,10,-10 you can do: extensions [ csv ] turtles-own [ param ] setup ca reset-ticks file-close-all file-open "turtle_data.csv" ;; read headings line in skip data extraction let headings csv:from-row file-read-line while [ not file-at-end? ] [ let data csv:from-row file-read-line create-tu

linux - Get memory high water mark for a time interval -

i'm trying max amount of memory used during brief intervals, long-running linux process. example, like: resetmaxrss(); // hypothetical new command void* foo = malloc(4096); free(foo); getrusage(...); // 'ru_maxrss' reports 4096 plus whatever else alive resetmaxrss(); void* bar = malloc(2048); free(bar); getrusage(...); // 'ru_maxrss' reports 2048 + whatever, *not* 4096 options i've found , ruled out: getrusage 's max rss can't reset. cgmemtime seem use wait4 under hood, isn't viable query process while it's running. tstime reports exiting processes, not viable query process while it's running. other options, none of good: polling. prone miss our brief allocations. instrumenting our code. don't have access of memory allocators being used, wouldn't elegant or straightforward. i'd rather use values reported os accuracy. is there way this, short of proposing patch linux kernel? it turns out since li

turboc++ - Program compiles and executes without header files turbo c++ -

i'm noob in programming. teacher compiled program without pre-processor directive @ , executed , displayed output. hello world program. i'm confused without directives how able carry out "printf" function. in "classic" ansi c (c89/90) can call non-variadic functions without pre-declaring them, long careful supplying arguments of proper type. so, if 1 properly, 1 can write formally valid c89/90 program not include standard headers. e.g. int main() { puts("hello world"); return 0; } in modern c not possible, since starting c99 functions have declared before being called. now, calling printf without pre-declaring (with prototype) caused undefined behavior in c89/90, since printf variadic function. so, if teacher did int main() { printf("hello world\n"); return 0; } then he/she still has lot learn c. c89/90 program not valid, if compiled, executed , displayed output "looked fine" you. however, ca

c# - "TFTP: can't read from local file.." error seen for windows impersonated admin account.. -

here info may in finding root cause mentioned issue. pc setup: set workgroup setting. contains both local standard user , local admin accounts. case: 1. run software application under standard user account admin impersonation. 2. contains restricted folder accessible local admin accounts , not standard user security reasons. 3. application code written in c#. problem: when system32 tftp.exe invoked through application process.start(), getting error "tftp: can't read local file..", local file in restricted folder. observation: when following statement used impersonation: (logonusera(username, domain, password, logon32_logon_new_credentials, logon32_provider_default, ref token) != 0) the application cannot access restricted folder (why? impersonation admin account.) but, when (logonusera(username, domain, password, logon32_logon_interactive, logon32_provider_default, ref token) != 0) used, application can access folder, but, tftp.exe throws above me

ios - What Rate of Push Notifications Triggers TooManyRequests Error? -

this question has answer here: apple push notification limitation 4 answers pretty simple... for example, if send 5 in loop, trigger failure? just wondering if experience can ballpark this. there's no specific limit in docs ( communicating apns ). there no caps or batch size limits using apns. ios 6.1 press release stated apns has sent on 4 trillion push notifications since established. announced @ wwdc 2012 apns sending 7 billion notifications daily. if you're seeing throughput lower 9,000 notifications per second, server might benefit improved error handling logic. error 429 indicates the server received many requests same device token . if having issues, might want check technical note tn2265 - troubleshooting push notifications

How to properly serve an object detection model from Tensorflow Object Detection API? -

i using tensorflow object detection api(github.com/tensorflow/models/tree/master/object_detection) 1 object detection task. right having problem on serving detection model trained tensorflow serving(tensorflow.github.io/serving/). 1. first issue encountering exporting model servable files. object detection api kindly included export script able convert ckpt files pb files variables. however, output files not have content in 'variables' folder. though bug , reported on github, seems interned convert variables constants there no variables. detail can found here . the flags using when exporting saved model follows: cuda_visible_devices=0 python export_inference_graph.py \ --input_type image_tensor \ --pipeline_config_path configs/rfcn_resnet50_car_jul_20.config \ --checkpoint_path resnet_ckpt/model.ckpt-17586 \ --inference_graph_path serving_model/1 \ --export_as_saved_model true it runs

sql - Never use Cascade Delete becasue we want to keep all logic inside application code -

i'm working on project , sql server database use on delete no action regardless, order-orderitem scenarios. i recall school professors ask set cascade delete. senior developers it's because want keep logic inside application code, meaning if want delete order , our code has first delete orderitem . is valid argument? when should on delete no action used? yes, it's not preference handling data integrity @ application or business layer known technique. needs tested ensure application doesn't create orphans. i've worked systems developers used business layer handle foreign key constraints , cascade deletes. it's difficult understand relationships , behavior if you're working in backend. needs documented.

Is it possible to install SQL Server Express edition side by side with SQL Server Developer edition? -

i have looked @ microsoft documentation didn't find answer, have sql server 2016 express edition on machine , wonder if it's possible install sql server 2016 developer edition side side express edition? yes can, machine has sql server 2008r2 express, sql server 2012 express, , sql server 2016 developer edition

java - Android - swipe/onLongClick conflict -

i have textview swipe listener on it. wanted add long click listener well. both work when swipe, long click listener triggered well, not want. need them independent. i've found very old code detecting long press it's not clear what's best approach. here's have in mainactivity tvita.setontouchlistener(new onswipetouchlistener(mainactivity.this) { @override public void onswiperight() {changesays(); } @override public void onswipeleft() { changesays(); } }); tvita.setonlongclicklistener(new view.onlongclicklistener() { @override public boolean onlongclick(view v) { string label = "label_ita"; string text = tvita.gettext().tostring(); clipboardmanager clipboard = (clipboardmanager) getsystemservice(mainactivity.this.clipboard_service); clipdata clip = clipdata.newplaintext(label, text);

c# - ArcObjects: How to enable associating levels to masked layers? -

in advanced drawing options layers there checkbox 'enable associate levels masked layers'. i'm trying figure out how enable via arcobjects. can cast imap or igrouplayer ilevelmasking retrieve levels string, nothing in interface allows me enable option. ideas? figured out. seems it's derived if have few things set properly: make sure draw using masking options specified below enabled (cast imap ilayermasking , set usemasking true.) ensure layer you're trying add masked level checked masking layer (cast imap or igrouplayer ilayer belongs to ilayermasking object, , use ilayermasking.set_maskinglayers set list of masking layers. note list esri.arcgis.esrisystem.iset). set level masking casting imap igrouplayer layer belongs using ilevelmasking , using ilevelmasking.set_levelmasking(maskedlayer, maskinglayer, "1234") "1234" strong level masking value.)

Overriding static properties in F# with extension methods -

f# extension methods can defined on types same name , type signature existing instance , static methods override default implementation of these methods, can't work on static properties. in particular, i'm trying create extension method datetime returns more precise time follows: #nowarn "51" open system module datetimeextensions = open system.runtime.interopservices [<dllimport("kernel32.dll", callingconvention = callingconvention.winapi)>] extern void private getsystemtimepreciseasfiletime(int64*) type system.datetime // example showing static methods can overridden static member isleapyear(_: datetime) = printfn "using overridden isleapyear!" true // more accurate utcnow method (note: not supported older os versions) static member utcnow = printfn "using overridden utcnow!" let mutable filetime = 0l getsystem

sql - Oracle Database Rownum Between -

there 25 records in sql query want between 5 , 10. how can ? use 11g select ( select count(*) sayfasayisi konular t t.kategori not null ) sayfasayisi, t.id, t.uye, t.baslik,t.mesaj,t.kategori,t.tarih, t.edittarih,t.aktif,t.indirimpuani,t.altkategori,t.link, nvl( (select case when t.id = f.konuid , f.uye = 'test' '1' else '0' end takipkonu f t.id = f.konuid , f.uye = 'test'), '0') takip konular t t.kategori not null you can use row_number() assign row number based on ordering logic contained in current query, e.g. column. then, retain 5th 10th records: select t.* ( select ( select count(*) sayfasayisi konular t t.kategori not null ) sayfasayisi, row_number() on (order some_col) rn, t.id, t.uye, ... ) t t.rn between 5 , 10;

How to execute java class in jar file from Jmeter -

i fresher in jmeter have created 2 class as *package test; public class urlmap { static string turl=null; public string display(){ string url="/xyz"; test2 t=new test2(url); turl=t.x; return "/xyz"; } } package test; public class test2 { static string x=null; test2(string x){ this.x=x; } }* i have imported jar trying execute class in beanshell sampler of jmeter import test.urlmap; urlmap u =new urlmap(); log.info("xxxxxxxxxxxx :----"+u.display()); log.info("turl :----"+u.turl); it giving me error -- error invoking bsh method: eval sourced file: inline evaluation of: import test.urlmap; urlmap u =new urlmap(); log.info("xxxxxxxxxxxx :----"+u.di . . . '' : cannot access field: turl, on object: test.urlmap@16ec122a 2017/07/28 06:44:56 warn - jmeter.protocol.java.sampler.beanshellsampler: org.apache.jorphan.util.jmeterexception: error invoking bsh method: eval so

vb.net controls chrome for automation -

i want use vb.net revoke chrome browser, need use chrome object automation. steps: 1, loin userid , password in chrome 2, click 1 url directs me page "export" button, if click on button, expxorts either .zip file or .csv file based on different url's logged in, , in "on click" event button, there's 1 dynamic javascrip link downloading mentioned file 3, after downloaded file, need go other url , repeat same "download" step could kindly me if completed via vb.net? , share codes ? much!

install - When I double-click the postgresql installed, can't run, and display the error -

i've been trying install 64bit version of postgresql 9.2 windows on machine (windows 7 64bit) , error environment variable compspec not seem point cmd.exe or there trailing semicolon present. your environment variables have been modified incorrectly other program or installer. need fix it, setting system environment variable comspec "%systemroot%\system32\cmd.exe" , deleting user environment variable ntry comspec might present. search control panel "environment variable" find place set them. you may need check setting in adminstrator user.

json - IOS app crash - but not in simulator - hardcoding URL works -

after successful build through xcode, app runs in simulator , iphone - when distribute testing, crashes when test users try preform search. if hardcode url elements - works in both simulation mode , functions in users test trials. i have crashlytics operating , says crash result of line of code let allcontactsdata = try data(contentsof: urlresults!) i check in previous vc fields contain value - , "print" confirms same company : accountant suburb : southport state : qld getting results from: http://www.myawsmurl.com.au/api/get_details.php?no=accountant&state=qld&suburb=southport var's set @ top of class via following: var tosearchfor: string = "" var tosearchforsuburb: string = "" var tosearchforstate: string = "" and func causes issue: func getresults() { tosearchfor = searchingfor.trimmingcharacters(in: .whitespacesandnewlines) tosearchforsuburb = searchingsuburb.trimmingcharacters(in: .whitespacesand

android - How to add loading progress at bottom of recyclerview? -

i have app contain recyclerview ads in between recyclerview , losing progress footer @ bottom of recyclerview when scroll @ bottom of recyclerview adding more data in dataset working fine problem adding loading progress @ bottom. code of main activity: contacts = new arraylist<>(); random = new random(); (int = 0; < 5; i++) { contact contact = new contact(); contact.setphone(phonenumbergenerating()); contact.setemail("contact" + + "@gmail.com"); contact.setviewtype(1); contacts.add(contact); } //place 2 admob ads in recyclerview contact mystring1 = new contact(); mystring1.setviewtype(2); contacts.add(3,mystring1); recyclerview.setlayoutmanager(new linearlayoutmanager(this)); contactadapter = new contactadapter(recyclerview, contacts, this); recyclerview.setadapter(contactadapter); //set load more listener recyclerview adapter contactadapter.setonloadmoreliste

c++ - Using QpushButton to switch the images displaying in a QLabel -

i beginner. 1 part of project using qpushbutton switch images displaying in qlabel, first step open folder , set filter .jpg , save path in qstring list. here code: void data_labeling::on_next_clicked() { int = 0; qstring filename1 = "/home/jin/test/test.jpg"; qfileinfo fileinfo1(filename1); qstring foldername1 = fileinfo1.path(); qdir dir(foldername1); dir.setnamefilters(qstringlist()<< "*.jpeg" << "*.jpg"); qstringlist images = dir.entrylist(); qimage image(images[i]); qpixmap::fromimage(image); int w = ui->face_pic->width(); int h = ui->face_pic->height(); ui->face_pic->setpixmap(qpixmap::fromimage(image).scaled(h,w,qt::keepaspectratio)); } there many images in folder,i know why failed, since every time press button using function, integer equal 0. can give me suggestion? in order select folder recommend using qfiledialog class through getexistingdirector

vsto - How to programmatically control Slide Orientation change in PowerPoint 2016 -

i have code changes orientation of powerpoint slide: presentation.pagesetup.slideorientation = msoorientation.msoorientationhorizontal when manually changing slide orientation, dialog pops allowing user select "maximize" or "ensure fit". what chosen affects whether text font size shrinks or enlarges. how can programmatically choose maximize or ensure fit when changing slide orientation?

c++ - VTK 7.1.1: vtkX3DExporter exception -

i using vtkx3dexporter export string, there exception when i'm calling getoutputstring(). writing file successful writing string not. i using vs2017 , building target x64 dll . exe imports dll , tests this: // ... codes ... exporter->setfilename("d:\\testfolder\\cccccccc.x3d"); exporter->write(); // writes file exporter->writetooutputstringon(); // turns on "writetooutputstring" exporter->getwritetooutputstring(); // returns 1 exporter->getoutputstringlength(); // returns 0 exporter->getoutputstring(); // exception here. i can't catch exception (i don't know why. used try , catch blocks exe crashes) don't know details. ok, find answer. should call exporter->update() before trying output string.

c++ - How do I declare and use an array of struct in a for loop? -

i working on native winapi application using cpp , sqlite http://github.com/jacksiro/vsongbook-cpp using falcon c++ ide. database: void createdatabase() { sqlite3 * db = null; int db_qry; const char * sqlcreatetables = "create table my_friends(friend_name varchar(20), " "friend_job varchar(20), friend_job integer(11));"; db_qry = sqlite3_open("friends.db", &db); db_qry = sqlite3_exec(db, sqlcreatetables, null, null, null); sqlite3_close(db); } and database insert this: void inserttodatabase() { int db_qry; char *error; sqlite3 *db; const char *sqlinsert = "insert my_friends(friend_name, friend_job, friend_age) " "values('ngunjiri james', 'teacher', 25);" "insert my_friends(friend_name, friend_job, friend_age) " "values('wafula shem', 'capernter', 30);" "insert my_

python - Django input as hour and minutes, saved as minutes -

in django webapp, i'm creating form user inputs time taken complete activity in hours , minutes (eg. 2 hours, 33 minutes). i want input appear client side hours , minutes, save model minutes (eg. 153) currently, input given in minutes. worry ugly/unreadable: models.py: class activity(models.model): time_taken = models.positiveintegerfield(default=0) add_activity.html: <form id="add_session_form" method="post" action="" enctype="multipart/form-data"> {% csrf_token %} {{ add_activity_form.as_p }} <input type="submit" name="submit" value="add activity" /> </form> forms.py: class activity(forms.modelform): class meta: model = activity fields = ('time_taken', 'subject') could please assist me in altering form's input users individually enter hours , minutes, whilst storing time in

Basic PHP if logic for multiple statements -

i want include addtohomescreen.php in page following conditions: $ua !== 'sattamatka.pro' -> true $ua !== 'sattamatka.android' -> true stripos($ua,'android') == true) -> true i using following logic: <?php if($ua !== 'sattamatka.pro' || $ua !== 'sattamatka.android' && stripos($ua,'android') == true) { include "addtohomescreen.php"; } ?> note: want of them true. if use && in place of || both of statements - $ua !== 'sattamatka.pro' , $ua !== 'sattamatka.android' becomes false , addtohomescreen.php included in both $ua . edit : possible vales of $ua are: sattamatka.pro sattamatka.android mozilla/5.0 (linux; u; android 6.0.1; en-us; redmi note 3 build/mmb29m) applewebkit/534.30 (khtml, gecko) version/4.0 ucbrowser/11.2.5.932 u3/0.8.0 mobile safari/534.30 update : problem $ua = 'sattamatka.pro' , $ua = 'sattamatka.android' stateme

Excel Macro Process Bar -

i have consolidation summary have struggled through , have made work (though takes time) , wanted add in progress bar users know excel working. finding difficult 1.) add in needed vba bar run correctly , 2.) not able figure out how keep form window open while background macro running see progression. a little background: summary sheet updated matching headers 50+ worksheets same workbook. there around 700k lines being consolidated (i assumed that's why takes long) changed .copy transferring data. my rows both text , numbers , having hardest time figuring out how make progress bar work. examples see reference numbers (ie. 1 - 1000). i have attempted both form progress bar (framing & labels) , status bar. take either if can work!! here current(non-working) code. without progress bar code, macro runs fine. i including associated models/forms flow not correct either. this button command excel sheet: sub openform() main.show end sub this brings "main"

c# - Reading assembly attribute from other file -

Image
i have project in [assembly: assemblyproduct("meteor viewer")] [assembly: assemblyversion("2.1.0.0")] [assembly: assemblyfileversion("2.1.0.0")] exist not in assembly.info, in xyz.cs file. how can assembly attribute xyz.cs @ other page of product? the attributes mentioned valid @ code file long part of project , compiled. if have multiple projects in solution should share e.g. version information assemblies can use 1 file , link in projects instead of copying infos. right click on project --> add existing item --> select file --> add link when included file in project(s) can see answer how values out of it: https://stackoverflow.com/a/909583/254797

postgresql - in postgres, get name & schema of relations on which materialized view depends -

i'm looking print schema & name of relations materialized views in schema depend on: select c.relname, d.classid, d.objid, pg_describe_object( d.classid, d.objid, d.objsubid) pg_class c join pg_namespace n on c.relnamespace = n.oid left join pg_depend d on c.oid = d.objid n.nspname = 'direct' , d.deptype = 'n' this gives like: relname | relname | classid | objid | pg_describe_object ------------------------+---------+---------+-------+--------------------------------------------------- cases | | 2618 | 33736 | rule _return on materialized view case_categories benefit_investigations | | 2618 | 33928 | rule _return on materialized view bi_intervals the description returned gives hint, doesn't contain schema of relation. how actual dependency schema , name? [nb i'm using postgres 9.6] here go: select distinct view_cs.nspname, view_c.reln

amazonads - How to set up an Amazon advertising API? -

we have client account of amazon seller central. need pull campaign performance data account. amazon advertising api can pull report. here documentation links: https://images-na.ssl-images-amazon.com/images/g/01/adproductswebsite/downloads/amazon_advertising_api_getting_started_guide. tth .pdf https://images-na.ssl-images-amazon.com/images/g/01/adproductswebsite/downloads/amazon_advertising_api_reference. tth .pdf i followed procedure in getting started guide 1) created developer account(login amazon) 2) completed sign form specified in second step. i not sure next did not receive reply amazon regarding this. faced similar issue before? thanks. it takes 2 or 3 days amazon reply in case , getting high volume of application might possible have rejected try more once. , try give information use in comment section. in addition, business registration in either na or eu required before can grant permission advertising api. after verification can allow access. ho

wpfdatagrid - DataTemplate.Triggers Set Xaml Content inSetter -

<datagrid margin="5" autogeneratecolumns="false" headersvisibility="all" itemssource="{binding path=testtubelist,mode=twoway}" rowheaderwidth="20" canuseraddrows="false" selectionunit="fullrow" > <datagrid.columns> <datagridcheckboxcolumn binding="{binding relativesource={relativesource ancestortype=datagridrow}, path=isselected, mode=oneway}" editingelementstyle="{dynamicresource metrodatagridcheckbox}" elementstyle="{dynamicresource metrodatagridcheckbox}" header="选择行" /> <datagridtextcolumn binding="{binding testno}" width="110" header="试管号" /> <datagridtextcolumn binding="{binding examno}&quo

Unable to monitor Amazon Linux memory with buffers and cache using Amazon CloudWatch Monitoring Scripts -

i followed steps in article, http://docs.aws.amazon.com/awsec2/latest/userguide/mon-scripts.html#mon-scripts-systems monitor server's memory usage , submit data cloudwatch. one of metrics can used --mem-used-incl-cache-buff collects , sends memoryused metrics, reported in megabytes. option reports used in cache , buffers, memory allocated applications , operating system. memory metric important compare other memory metrics because metric collects memory used in cache , buffers well. other memory metrics collect free , used memory determine whether or not server running out of memory. unfortunately output when tried run script: [root@ip-172-31-10-167 ~]# ~/aws-scripts-mon/mon-put-instance-data.pl --mem-used-incl-cache-buff --verify --verbose error: no metrics specified collection , submission cloudwatch. more information, run 'mon-put-instance-data.pl --help' i've followed prerequisite in documentation ensure required tools installed first. did miss?

Angular 4 dynamic reactive form on Drop down form API [add and remove] -

i'm facing issue in angular 4 projects grateful if find time resolve issue. objective on change of dropdown value need call api on basis of returned value need populate form data. [api follow same object structure] the loop have mentioned in block not running empty form controls array. i have gone through formgroup , formarray classes there no method remove controls. may approach not correct, due incomplete knowledge of angular4. fragments of source code : availabletoolsfornewevnlist: array<toolsfornewevn>; selectedtoolsfornewevnlist: array<toolsfornewevn>; getprojects() { //working fine this.devopstoolservice.getprojects() .subscribe( projectlist => { this.projectlist = projectlist project[]; this.projectlist.slice(0, 1).map(p => { this.selectedproject = p; this.onchange(p); }); }, error =>