Posts

Showing posts from April, 2015

apache - Curl in PHP returns null on AWS EC2 instance -

i have aws ec2 , apache server setup. website pages working except 2 places whereever sued curl. following pointers per issue search online, working expected: curl showing in phpinfo(). curl command accessible , running accross. apache2 have curl installed. curl command cli working fine. (curl http://localhost , curl www.google.com) both working. when ran following function, url when run in browser $url, returns data expected. when run php, none of echo commands ever returned values. further, values seem null. function get_patients(){ $hostname = file_get_contents(' http://169.254.169.254/latest/meta-data/public-hostname '); $url = $hostname.'/folder1/app1.php?all'; //echo $url; ///$url .= urlencode($query);//.'&key='.$key; $curl = curl_init(); curl_setopt($curl, curlopt_url, $url); //echo $curl; curl_setopt($curl, curlopt_returntransfer, 1); curl_setopt($curl, curlopt_binarytransfer, 1); curl_setopt($curl, curlopt_connecttimeou...

csv - Using str_getcsv in php -

whenever try use str_getcsv in php code returns no arrays , opens page 500 error. doing wrong? $csvfile = "master1.csv"; $input = file_get_contents($csvfile); echo $input; array str_getcsv ( string $input [, string $delimiter = "," [, string $enclosure = '"' [, string $escape = "\\" ]]] ) the string word telling next variable enter has string, , [ , ] telling argument optional. this should work; $csvfile = "master1.csv"; $input = file_get_contents($csvfile); echo $input; $myarray = str_getcsv($input); to result: print_r($myarray);

c# - Embedded resource in nuget package -

i'm building c# library packaged nuget. contains error code translations in .resx file in resources directory called errors.en.resx . file has "build action" set "embedded resource" (which i've confirmed in .csproj file), when project built resource ends in separate dll in "en" folder. this works fine is, when packaging nuget "en" folder missed, means attempts use resourcemanager fetch messages fail. ideally i'd resource embedded in main .dll, failing i'll settle adding resource dll nuget package. various changes settings , nuget spec changes have not succeeded far. in end simplest solution explicitly add resource file in nuget spec: <files> <file src="bin\$configuration$\en\*.dll" target="lib\net45\en" /> </files> reference: specifying files include in package

jquery - Javascript functions not being called -

my website uses nav bar toggles divs on , off go different "pages". buttons have stopped responding (nothing happens when clicked, , nothing appears in console), , have not been able figure out why. my nav bar formatted so: <a href="#" id="videosbutton">videos</a><br> <a href="#" id="graphicbutton">graphic design</a><br> <a href="#" id="webbutton">web design</a><br> my pages formatted so: <div id="videos" class="page">videos page</div> the js is: $('#videosbutton').click(function () { document.body.style.backgroundcolor="rgb(192,57,43)" $(".page").hide(); $('#videos').show(); }); for each button. js file being loaded, , can view in console, it's not issue that. have been struggling hours , @ loss. can me understand why nav bar not behaving expected? edit: have moved ex...

android - NavigationDrawer Items view -

i having problem navigation menu. when click on item opens entire contents of layout, when click new item , click former, layout not charge listview not appear how make,when return item,reload listview ? code: http://pastebin.com/h9r97k72 short video of problem : https://youtu.be/okgfot_091c

kubernetes - no object named "pod" is registered -

what mean? -bash-4.2# kubectl create -f ./pod.yaml error: unable recognize "./pod.yaml": no object named "pod" registered pod.yaml, capitalizing or not capitalizing 'pod' makes no difference. validates proper yaml. apiversion: v1 kind: pod metadata: name: nginx spec: containers: - name: nginx image: nginx ports: - containerport: 80 hostport: 8080 can please run kubectl version , report results? expect either apisver or kubectl version outdated, , doesn't know v1 api. for it's worth, pod spec works me both kubectl , apiserver @ version 1.0.3.

Require dependant secondary excel workbook to be saved and closed before primary may close using VBA -

i novice vba , looking help. have dashboard accesses secondary file users enter in information. wondering if there way require secondary workbook closed before close original dashboard has been launched. as example: on close of fpa_opportunities_v6.xlsm if ccc_error_tracker.xlsm active require ccc_error_tracker.xlsm closed before fpa_opportunities_v6.xlsm can shut down. the file required closed located @ "supporting_files\ccc_error_tracker.xlsm primary dashboard users launch located at:\\\opportunities_dashboard\fpa_opportunities_v6.xlsm. right have set detect if fpa_opportunities_v6.xlsm dashboard read because team leaders should able make changes this. response provides user "no changes have been made authorized captain. if changes have been made ccs_error_tracker , prompted changes have been saved, you're go. please close window save settings." i rather not confuse end user if possible. simple solution have require close. thoughts? feel beneficial ot...

Android plugin for SpriteBuilder crashes Xcode 6.4 -

after installing latest android community plugin , xcode 6.4 project created spritebuilder crashes following: no xcode.dvtfoundation.extendedplatforminfo extension provided for platform 'com.apportable.platform.android' if remove sbandroid folder /library, no longer crashes. build project android looking fix. thanks. update: i've since downloaded xcode 6.1 (for doesn't crash) , work on now

javascript - How to add a button to a partial which closes the partial? -

i have partial _reply.haml .reply-form = form_for comment, :remote => true |f| = f.text_area :body, :input_html => { :rows => "2" }, :label => false = f.text_field :commentable_id, :as => :hidden, :value => comment.commentable_id = f.text_field :commentable_type, :as => :hidden, :value => comment.commentable_type = f.text_field :p_comment, :as => :hidden, :value => parent_comment.id = f.submit "reply!", :class => "btn btn-primary", :disable_with => "submitting…" i need add 'cancel' button remove partial page (hide , remove). _reply.haml partial not loaded when page loads. loads when clicks "reply" on comment. i tried adding = button_tag 'cancel', :id => "cancel_button", :remote => true end of _reply.haml ended going through create action of comments controller reason. (if click reply, go create action of comments ...

language agnostic - Is there a standard function signature for the digital signature "verify" function? -

is 1 of these (or else) more standard alternatives? verify(message, signature, publickey) vs verify(signature, message, publickey) i go for: verify(publickey, message, signature) and there objective reasoning behind it. first have provide public key (e.g. in init method in case of java, data (e.g. in update method) , verify actual signature. note publickey static; prefer @ start of method. likewise, signature generation be: sign(privatekey, message): signature as can see, nicely symmetric. and since asking standard: rsassa-pss-verify ((n, e), m, s) where (n, e) public key. straight out of rfc 3447 describing rsa cryptography specifications.

spring - AngularJs watch angular.element -

i'm trying integrate angularjs legacy spring mvc application because there lots of spaghetti javascript code (a huge mess!) hide / show html elements based on conditions etc. it uses jsp , lots of custom jsp tags , because way written i'm hesitant mess jsp tags themselves. i'm trying read values of spring input angular scope , once have can use angular hide / show stuff. assume html <div ng-app ng-controller="fooctrl"> backbone <input type="radio" name="yes" value="backbone"/> angular <input type="radio" name="yes" value="angular" /> </div> i'm able read these elements angular's scope this $scope.elements = angular.element("input[name='yes']"); but change value of these elements not getting triggered or watched angular. ideally when radio button gets checked model change. how can this? thank in advance. here plnkr basic setu...

vb.net - Smooth Curves when drawing ellipse -

Image
i trying paint picture box circle , code: private withevents pparent thumbcontrol sub new(byval pnparent thumbcontrol, byval path string, optional byval datastring string = "") pparent = pnparent strpath = path strdata = datastring me.sizemode = windows.forms.pictureboxsizemode.stretchimage me.size = new size(100, 100) dim gp new system.drawing.drawing2d.graphicspath() gp.addellipse(0, 0, me.width - 3, me.height - 3) dim rg new region(gp) me.region = rg end sub paint method: protected overrides sub onpaint(byval pe system.windows.forms.painteventargs) mybase.onpaint(pe) if not bselected if pparent.highlightmode = ihighlitemode.glassandforeground if bover dim rc new rectangle(0, 0, 100, 100) dim rc1 new rectangle(0, 0, 100, 50) pe.graphics.fillellipse(new solidbrush(color.fromargb(100, pparent.highlight.r, pparent.h...

html - PHP mail function doesn't complete sending of e-mail -

<?php $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $from = 'from: yoursite.com'; $to = 'contact@yoursite.com'; $subject = 'customer inquiry'; $body = "from: $name\n e-mail: $email\n message:\n $message"; if ($_post['submit']) { if (mail ($to, $subject, $body, $from)) { echo '<p>your message has been sent!</p>'; } else { echo '<p>something went wrong, go , try again!</p>'; } } ?> i've tried creating simple mail form. form on index.html page, submits separate "thank submission" page, thankyou.php , above php code embedded. code submits perfectly, never sends email. please help. although there portions of answer apply usage of the mail() function itself, many of these troubleshooting steps can applied php mailing system. th...

java - Why is spring boot using threads from different packages to handle requests? -

so, followed tutorial myself setup basic authentication. in looking @ logs, had question whats going on. here log snippet: 2015-08-24 23:08:22.690 info 9732 --- [nio-8080-exec-3] o.s.b.a.audit.listener.auditlistener : auditevent [timestamp=mon aug 24 23:08:22 edt 2015, principal=user, type=authentication_success, data={details=org.springframework.security.web.authentication.webauthenticationdetails@ffff4c9c: remoteipaddress: 0:0:0:0:0:0:0:1; sessionid: 408b23d5ed14118abbc514260b915f5d}] 2015-08-24 23:08:22.691 info 9732 --- [nio-8080-exec-3] o.s.b.a.audit.listener.auditlistener : auditevent [timestamp=mon aug 24 23:08:22 edt 2015, principal=user, type=authentication_success, data={details=org.springframework.security.web.authentication.webauthenticationdetails@ffff4c9c: remoteipaddress: 0:0:0:0:0:0:0:1; sessionid: 408b23d5ed14118abbc514260b915f5d}] 2015-08-24 23:08:22.693 info 9732 --- [nio-8080-exec-3] o.s.b.a.audit.listener.auditlistener : auditevent [timesta...

javascript - Converting JSON to HTML in an angular.js app -

i have app supposed display book data (although have interactive content such quizzes). storing pages xml, like <page> <image>http://someimage</image> <text>bla bla bla </text> <text>hello there </text> <image></image> <quiz type="multichoice"> <question>what first letter of alphabet</question> <answer>a</answer> <answer>b</answer> <answer>c</answer> </quiz> </page> and there no restriction on order or amount of elements on given page. on web server, converting these javascript object (and caching it). until point. but want client able request page, , have logic convert javascript object html. cannot figure out how write logic angular.js. cannot see obvious way of doing - ng-repeat work if wanted same html every element. in case want display image image, text paragraph, , quiz more complex. jade templating, trivial. i ...

algorithm - How to delete in a heap data structure? -

i understand how delete root node max heap procedure deleting node middle remove , replace root repeatedly until desired node deleted? is o(log n) optimal complexity procedure? does affect big o complexity since other nodes must deleted in order delete specific node? actually, can remove item middle of heap without trouble. the idea take last item in heap and, starting current position (i.e. position held item deleted), sift if new item greater parent of old item. if it's not greater parent, sift down. that's procedure max heap. min heap, of course, you'd reverse greater , less cases. finding item in heap o(n) operation, if know in heap, removing o(log n). i published heap-based priority queue devsource few years back. see a priority queue implementation in c# . has removeat method described. full source @ http://www.mischel.com/pubs/priqueue.zip

html - How to add a close button to a newly opened window in ionic for an android device? -

i have code this: $scope.vieworderdetails = function vieworderdetails(detail) { var newwin = open('orderdetails.html','windowname','height=300,width=300'); newwin.document.write('html write...'); newwin.document.write(detail); //<input type="button" value="close window" onclick="self.close()"> } i want add close button newwin. how can achieve that? thanks. updated: newwin.document.write('<input type="button" value="close window" onclick="window.close()">'); it works in ionic serve , when running in pad device, when click "close window", window can not closed. the answer in question itself...you can try this... newwin.document.write('<input type="button" value="close window" onclick="window.close()">');

android - Where is the location of the sqlite to be used in the monaca? -

use monaca, developing mobile app. application uses sqlite using on windows (visual studio). while confirming contents of database, develop, in trouble , not know bottom line of created location of database. index.html var db = window.opendatabase('database', '1.0', 'sampletable', 200000); db.transaction(executequery, errorcb, successcb); where 'databese' file? understand?

Why does NaN - NaN == 0.0 with the Intel C++ Compiler? -

it well-known nans propagate in arithmetic, couldn't find demonstrations, wrote small test: #include <limits> #include <cstdio> int main(int argc, char* argv[]) { float qnan = std::numeric_limits<float>::quiet_nan(); float neg = -qnan; float sub1 = 6.0f - qnan; float sub2 = qnan - 6.0f; float sub3 = qnan - qnan; float add1 = 6.0f + qnan; float add2 = qnan + qnan; float div1 = 6.0f / qnan; float div2 = qnan / 6.0f; float div3 = qnan / qnan; float mul1 = 6.0f * qnan; float mul2 = qnan * qnan; printf( "neg: %f\nsub: %f %f %f\nadd: %f %f\ndiv: %f %f %f\nmul: %f %f\n", neg, sub1,sub2,sub3, add1,add2, div1,div2,div3, mul1,mul2 ); return 0; } the example ( running live here ) produces expect (the negative little weird, kind of makes sense): neg: -nan sub: nan nan nan add: nan nan div: nan nan nan mul: nan nan msvc 2015 produces similar. however, intel c++ 15 produces...

javascript - Filtering in nested array -

i have nested data structure mapped array in knockout js: class departments{ string departmentname; list<group> groups } class group{ string groupname; list<person> persons; } class person{ string firsname; string lastname; } i fetched data server , show them in ui successfully. want convert array computed 1 in knockoutjs , filter firstname , lastname . it's worthy mention have bound self.search_firstname , self.search_lastname 2 different inputs. html code binding data follow: <div class="form-group"> <input type="text" class="text-right text-success input-lg" placeholder="name" data-bind="value:search_firstname, valueupdate: 'afterkeydown'" /> </div> <div class="panel-group" id="accordion" data-bind="foreach: profiles" role="tablist" aria-multiselectable="true"> <div class="...

ruby on rails - send mail every 5 minutes using delayed job -

this question has answer here: rails 3/delayed_job - wanted: basic example of delayed mail 3 answers class testmailer < actionmailer::base def test_mail mail(:to => '(myemailaddress@removedforprivacy.com', :from => '(removedforprivacy)@gmail.com', :subject => 'testing delayed job', :content_type => 'text/plain').deliver end handle_asynchronously :test_mail, :run_at => proc.new { 2.minutes.from_now } end i think want send email every 5 minutes using delayed_job cron task. can use delayed_cron_job gem accomplish purpose. you can add: delayed_cron_job gemfile , run: bundle install . then, run: rails generate delayed_job:cron bundle exec rake db:migrate then, can use this: delayed::job.enqueue(delayedemailjob.new(@user.email), cron: '0,5,10,15,20,25,30,35,40,45,50,55 * * * *') ...

PUT method in Node.js/MongoDB -

i'm having issues simple put method in node.js (mongodb collection.update). appreciated. @ point, i'm not getting error, empty response. index.js: app.put('/updatevalues/:collection/:entity', function(req, res) { var params = req.params; var entity = params.entity; var collection = params.collection; var value1 = req.body.value1; var value2 = req.body.value2; if (entity) { collectiondriver.updatevalues(collection, entity, value1, value2, function(error, objs) { if (error) { res.status(400).send(error); } else { res.status(200).send(objs); } }); } else { res.send(400, {error: 'bad url', url: req.url}); } }); collectiondriver.js: collectiondriver.prototype.updatevalues = function(collectionname, namedoc, value1new, value2new, callback) { this.getcollection(collectionname, function(error, the_collection) { if (error) callback(error); else { the_collection...

python - Django CharField primary key doesn't work, creating rowid primary key automatically -

i using django models sqlite database. i defined charfield primary key (for example name of attribute a ) physical database synced django shows primary key rowid instead of a . i tried dropping table , re-sync couple of time still same. why? class testtable(models.model): = models.charfield(max_length=10, primary_key=true, db_column='a') ----------------------edit------------------------ django version 1.8.3

sqlite - SQL Determining the length of a unique visit from access log -

i have table has access log records , want know average time of visit. i'm using sqlite jdbc populate table. table potentially few 100 million rows large. don't have sql experience. the table similar this: id name time(s) 1 apricot 100 2 apricot 101 3 banana 102 4 banana 102 5 banana 105 6 apricot 106 7 apricot 300 8 cake 300 9 banana 310 10 banana 320 i want see duration of each visit. 1 visit when entry appears , continues appear (with same name) until time has passed (say 100 seconds). after that, session ends - if same name appears again new session. ultimately want graph number of visits , durations. i'm not sure kind of output easiest, here possible output useful: name time banana 3 (row5 - row3) apricot 6 (row6 - row1) apricot 0 (row7 - last visit >100s , no more subsequent visits) cake 0 (row8 - last visit >100s , no more subsequent visits) ban...

Nginx infinte redirection for kibana on centOS 7 -

i have no experience reverse proxying, let alone nginx , struggling. versions: kibana: 5.6 nginx: 1.10.2 when go elk.mydomain.com/kibana , redirected in loop until firefox stops me after massively long link this: http://elk.mydomain.com/kibana/login?next=%2fkibana%2fkibana%2flogin%3fnext%3d%252fkibana%252fkibana%252flogin%253fnext%253d%25252fkibana%25252fkibana%25252flogin%25253fnext%25253d%2525252fkibana%2525252fkibana%2525252flogin%2525253fnext%2525253d%252525252fkibana........ i have been trying small adjustments every little thing no luck. cat /etc/nginx/conf.d/kibana.conf : server { listen 80; server_name elk.mydomain.com; auth_basic "restricted access"; auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd; location /kibana/ { proxy_pass http://localhost:5601; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection 'upgrade'; proxy_set_header host $host; proxy_cache_bypass $http_upgrade; } } ...

multithreading - Java ThreadPoolExecutor Hangs while processing -

i having custom thread pool executor public class customtpexecutor extends threadpoolexecutor { /* constructor called processor */ public customtpexecutor (int corepoolsize, int maxpoolsize, long keepalivetime, timeunit timeunit, blockingqueue<runnable> blockingqueue, threadfactory threadfactory,processor processor) { super(corepoolsize, maxpoolsize, keepalivetime, timeunit, blockingqueue,threadfactory); this.processor = processor; } @override protected void afterexecute(runnable paramrunnable, throwable paramthrowable) { super.afterexecute(paramrunnable, paramthrowable); /* notify processor more records */ } } in processor, creating instances customtpexecutor , submit more 1000+ tasks it. maximum pool size 5. for submitting executor use this. while(iterating map events containing 1000+records) { customthread tt = new txntcustomthread(eventmap.get(key), key,maxdate,connpool,connpool.getconnecti...

Error in using system() in Perl -

i passing command windows command prompt using perl code. struggling long time , not figure out. can please help? here command line using: cleartool find . -version "version(\main\latest)" -exec "cleartool co -nc \"%clearcase_pn%\"" and here error when write using system("") : system(" cleartool find . -version "version(\main\latest)" -exec "cleartool co -nc \"%clearcase_pn%\\"" "); bareword found operator expected @ test.pl line 9, near "" cleartool find . -version "version" (missing operator before version?) backslash found operator expected @ test.pl line 9, near "main\" string found operator expected @ test.pl line 9, near ")" -exec "" (missing operator before " -exec "?) bareword found operator expected @ test.pl line 9, near "" -exec "cleartool" (missing operator before cleartool?) backslash found...

cluster analysis - Change scatterplot labels in ELKI result visualization -

Image
is possible change scatterplot labels in elki result visualization, maybe using parameters? the default axes labeled column 0 , column 1 2-dimensional data. nice change latitude , longitude case. i'm running dbscan elki version 0.6.5. there no parameter this. elki has way many parameters, doesn't it? but (i believe there bug in 0.6.5 there, may need build current git version yourself) if there column label available, elki use column label instead of enumerating axes. if first row of file not contain numbers, default parser interpret column labels. this visualization of clustering 1 day of coordinates in 1% twitter sample hdbscan*: or export graph svg , use svg editor , change label desired. recommend inkscape . ability fine-tune graphics inkscape key reason why chose use svg.

android - how to give equal width to all tabs? -

Image
hello please tell me why on landscape not acquiring equal width in portrait mode ?? there way provide equal width tabs in portrait mode. i landscape potrait here code ..in portrait taking equal width on landscape not taking equal width why ? here code import android.app.actionbar; import android.app.fragmenttransaction; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.support.v4.view.viewpager; public class mainactivity extends fragmentactivity implements actionbar.tablistener { actionbar actionbar; viewpager viewpager; pageadapter pageadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); viewpager = (viewpager) findviewbyid(r.id.pager); pageadapter =new pageadapter(getsupportfragmentmanager()); viewpager.setadapter(pageadapter); actionbar = getactionbar(); ...

Fetch user email with C# Facebook SDK -

i fetch user's email using c# facebook sdk. how can so? i've tried code below, empty email. because somehow need ask more rights? if so, how do that? facebook.facebookclient fbc = new facebook.facebookclient(user.mobileserviceauthenticationtoken); dynamic clientcredentials = await fbc.gettaskasync("oauth/access_token", new{client_id = facebookclientid,client_secret = facebookclientsecret, grant_type = "client_credentials",redirect_uri = "https://xxx.azure-mobile.net/signin-facebook"}); fbc.accesstoken = clientcredentials.access_token; fbc.appid = facebookclientid; fbc.appsecret = facebookclientsecret; string id = user.userid.replace("facebook:", string.empty); dynamic result = await fbc.gettaskasync(id + "?fields=id,name,picture,last_name,first_name,gender"); best regards tj78 you need gather email permission in login url's scope parameter, otherwise not able receive email field.

Java Class Object Sorting and Group -

i want sort list of classvo object follows, classvo parameters -> id, code sample data: id code a1 a1,aa1 b1 b1,bb1 c1 c1,cc1 d1 d1,dd1 b1 b2,bb2 a1 a2,aa2 c1 c2,cc2 d1 d2,dd2 in classvo list objects above sample data added in unsorted way. forexample, list-1 contains b1, list-1 contains d1, list-1 contains a1, list-1 contains c1. order vary each time. now want sort classvo list objects above. ie, before sorting records, want group in such order (first want group a1's code, b1's code, c1's code , d1's code - while grouping code should in ascending order). after grouping want classvo list object a1,b1,c1,d1. edit: i pasting code here public static void main(string[] args) { list<testvo> vos = new arraylist<testvo>(); testvo testvo1 = new testvo(); testvo1.setcode("b"); testvo1.setid("b_nit_dept"); vos.add(testvo1); testvo testvo2 = new testvo(); testvo2.setid("c_nit_func...

java - How to improve speed of parsing in Jsoup -

public static void main(string[] args) throws malformedurlexception, ioexception{ document doc = jsoup.connect("my_url").useragent("mozilla/5.0 applewebkit/537.36 (khtml, gecko) chrome/45.0.2454.4 safari/537.36").get(); int = 1; for(element table : doc.select("tbody")){ (element row : table.select("tr")) { (element sale1 : row.select("td.sale_type.bottomline div.inner.pl4")){ system.out.print(i + " : " + sale1.text() + " / "); } (element sale2 : row.select("td.sale_type2.bottomline div.inner")){ system.out.print(sale2.text() + " / "); } (element date : row.select("td.bottomline div.inner.inner_mark span.mark4")){ system.out.print(date.text() + " / "); } ...

linux - Convert String from AS400 to Java -

to communicate as400 use java web service jt400 library, web service running under linux. text result after calling as400 program contains accented character é à è … in xhtml page text isn't displayed correctly, example é replaced { . the as400 configured this: ccsid : 65535 , encoding : 297 . when same web service run under windows, can display correctly accented characters thank help. you seem have ran in mojibake caused interpreting bytes of text in incorrect encoding. mention é being replaced { ; code point é in ccsid 297 0xc0 in ccsid 37 { , makes sense. i'm not sure data coming from, if you're using as400text convert data in java string object, you'll need specify correct ccsid or pick ccsid based on current locale. can either specify ccsid as400.getccsid or associated encoding string value as400.getjobccsidencoding .

messagebox - Excel - Countdown Message box until Macro is Complete -

i have macro takes 45 seconds complete. when macro starts want countdown timer pop message box countdown until macro completion. have searched far cant find answers this. possible? as @thrum correctly mentioned in comment not possible message box. a msgbox modal , therefore blocks entire excel application. nothing else can happen / done while message box window open , waits close it. actually, can make message boxes system-wide modal. in case no other windows application respond unless close little message box in excel (check option vbsystemmodal within vba regarding msgbox ). however, forms on other hand have choice. can make form not modal. userform1.show (false) in case code continues run in background while form shown user , permits running vba code make changes form while shown user.

ruby - Big task or multiple small tasks with Sidekiq -

i'm writting worker add lot's of users group. i'm wondering if it's better run big task had users, or batch 100 users or 1 one per task. for moment here code class adduserstogroupworker include sidekiq::worker sidekiq_options :queue => :group_utility def perform(store_id, group_id, user_ids_to_add) begin store = store.find store_id group = group.find group_id rescue activerecord::recordnotfound => e airbrake.notify e return end users_to_process = store.users.where(id: user_ids_to_add) .where.not(id: group.user_ids) group.users += users_to_process users_to_process.map(&:id).each |user_to_process_id| updatelastupdatesforuserworker.perform_async store.id, user_to_process_id end end end maybe it's better have in method : def add_users users_to_process = store.users.where(id: user_ids_to_add) .where.not(id: gr...

git branch - Git divide commits between branches -

currently have remote develop branch commits like: c1 -> c2 -> c3 -> c4 -> c5 -> c6 (cx commit x) i need divide these commits new branches, this: develop branch: c1 c2 c6 newbranchtwo: c3 c5 newbranchthree: c4 ( newbranchtwo , newbranchthree not need become remote) how can achieve this? git rebase friend. one easy way accomplish use git branch produce 3 identical branches (develop, newbranchtwo, newbranchthree), edit down using git rebase --interactive c1 ...replacing c1 commit's hash or other ref. in interactive mode, git first pop open text editor shows entire history, , commits wil applied in order top bottom according deletions or reorderings make in editor. remove c3 through c5 develop, , make corresponding edits other branches. you can skip interactive mode , use git reset , git rebase --onto move c6 onto c2 , name develop, , same c3 onto upstream head , c5 onto (etc). without knowing actual hashes or parent of...

Send JSON object to MVC 6 WebApi controller using jQuery -

i'm having trouble sending json object mvc 6 webapi controller. when @ raw data in fiddler, i'm sending, this: username=brugernavn&password=adgangskode&documentid=document.dotx what think controller expecting recieve, this: {"username":"brugernavn","password":"adgangskode","documentid":"document.dotx"} my controller code: namespace demoapp.controllers { [route("api/[controller]")] public class documentcontroller : controller { // post: api/documentcontroller/getdocumentinformation [httppost] [route("[action]")] public string getdocumentinformation([frombody] getdocumentinformationrequest documentinformationrequest) if (documentinformationrequest == null) { return "null"; } else { return "ok"; } } } my getdocumentinformationrequest model class: publi...

c# - Gridview Get Cells ID -

i want select gridview id. code below. can achieve this? protected void gridview1_selectedindexchanged(object sender, eventargs e) { int id = convert.toint32(gridview1.selectedrow.cells[0].tostring()); textbox2.text = id.tostring(); } check , may work u ,call cell id directly. this.gridview1.cellclick += new system.windows.forms.gridviewcelleventhandler(this.gridview1_cellclick); private void gridview1_cellclick(object sender, datagridviewcelleventargs e) { try { string id = gridview1.rows[gridview1.currentrow.index].cells["id"].value.tostring(); textbox1.text = id; } catch (exception) { } } or change in ur code.. string id = gridview1.rows[gridview1.currentrow.index].cells[0].value.tostring(); textbox1.text = id; add this... <asp:templatefield> <itemtemplate> <asp:checkbox id="chksec" runat="server" autopostback="true" oncheckedchanged="chksec_checkedchange...

ios - How to disable caching in Alamofire -

when send request twice alamofire same response i'm expecting different one. wondering if because of cache, , if i'd know how disable it. swift 3, alamofire 4 my solution was: creating extension alamofire: extension alamofire.sessionmanager{ @discardableresult open func requestwithoutcache( _ url: urlconvertible, method: httpmethod = .get, parameters: parameters? = nil, encoding: parameterencoding = urlencoding.default, headers: httpheaders? = nil)//you can pass urlrequest.cachepolicy parameter -> datarequest { { var urlrequest = try urlrequest(url: url, method: method, headers: headers) urlrequest.cachepolicy = .reloadignoringcachedata // <<== cache disabled let encodedurlrequest = try encoding.encode(urlrequest, with: parameters) return request(encodedurlrequest) } catch { // todo: find better way handle error ...

javascript - How to place close button to the end of popup box -

i have designed popup box placing popup button end of popup box when contents has been updated dynamically box,the close button moving out of box. look code once #overlay{ width: 100%; height: 100%; position: fixed; top: 0; left: 0; } #box_frame{ width: 100%; position: fixed; top: 30%; } #box{ width: 400px; padding: 40px; height: 200px; margin: auto; font-size: 14px; background:#e8e8e8; border: 1px solid #dadada; font-family:sans-serif; } #box button{ margin-top: 45%; } guys @ javascript code function open_box(){ var cont = '<div id="overlay"><div id="box_frame"><div id="box"> '+ 'select reviewer:<input type="text" name="name" onkeyup="load(this.value);" autocomplete="off"/>' + '<div id="demo"></div>'+ ...

Swift: Block mainThread until function finished loading data / NSURLSession with completionHandler -

i want create function loads data url , returns responsedata nsdata. want block mainthread until data finished. here have far: function: typealias completionblock = (nsdata!, nsurlresponse!, nserror!) -> nsdata func requesturl(targeturl: string, httpmethod: string, httpbody: string, completion: completionblock){ // request let target = nsurl(string: targeturl) // url let request = nsmutableurlrequest(url: target!) // request // http-method var method = httpmethod if method != "post" { method = "get" } // standard: request.httpmethod = method // http-body let body = httpbody if body != "" { request.httpbody = body.datausingencoding(nsutf8stringencoding) } // nsurlsession let session = nsurlsession.sharedsession() let task = session.datataskwithrequest(request, completionhandler: completion) // compiler error! task.resume() } call: requesturl(targeturl, "get", "", { (responsedata: nsdata!, response: nsurlrespon...

sql - count hours in same column -

i'm trying query table contains employee records of presence. records employee id , datetime of chipping follows: id datetime 3 2015-07-01 06:58:00.000 3 2015-07-01 12:01:00.000 3 2015-07-01 12:57:00.000 3 2015-07-01 19:17:00.000 3 2015-07-02 06:55:00.000 3 2015-07-02 14:05:00.000 15 2015-07-01 07:50:00.000 15 2015-07-01 12:01:00.000 15 2015-07-01 12:50:00.000 15 2015-07-01 18:04:00.000 i trying produce query gets id date entrance exit 2entrance 2exit 3 2015-07-01 06:58 12:01 12:57 19:17 3 2015-07-02 06:55 14:05 00:00 00:00 15 2015-07-01 07:50 12:01 12:50 18:04 but final result i'm looking is id d1, d2, d3.. d31 3 11 7 12 6 15 9 0 6 12 (this number of worked hours, day day, full month) to table thinking use excel previous results, i'd apreciate if pointed me in right direction. any appreciated. may bit direction take date strings, split them (as have fixed ...

Facebook Marketing API connections: exclude people -

Image
so on ads manager under connections, gives choice exclude people used app way avoid showing ads current users. the marketing api in doc says can set targeting spec: 'app_install_state' can set 'installed' or 'not_installed' , quote facebook must used in conjunction promoted_object @ adset level i have tried adding $targeting object adding on adset level. when go view ad set in ad manager on facebook connections part still unchanged. 'name' => 'test ad set', 'billing_event' => 'app_installs', 'optimization_goal' => 'app_installs', 'campaign_status' => "paused", 'daily_budget' => 5000, 'bid_amount' => 10, 'campaign_group_id' => $id, 'targeting' => json_encode($targeting), $targeting = array( 'geo_locations' => array( 'countries' => array('us'), ), 'page_types' => arra...

python - Serving static files on Apache with Django (404 error) -

i've been trying setup apache (2.2.15) proxy gunicorn , django (1.6.11) on centos server (6.7), i'm stuck on problem regarding static files. (i'm new django) i have looked @ great documentation django provides, few other stackoverflow's posts, no avail. what check : the problem doesn't seem come django or templates, running development server 'debug = false' , option '--insecure' works fine. it problem alias , directory block added in virtualhost, can't make sense of why doesn't work. gunicorn shouldn't have word in it, doesn't serve static files. what configuration looks : 1) got project's static files '/var/www/myproject/static' 'collectstatic' command. 2) then, created virtualhosts (where think problem is) : (first 1 redirection https) <virtualhost *:80> serveradmin user@domain.com servername localhost serversignature off rewriteengine on rewritecond %{server_p...