Posts

Showing posts from January, 2011

Command Line to open ReadMe file when opening project in Visual Studio -

i want open readme.html file located in project/solution visual studio opened. there command line switch open readme.html file of project? for example, devenv myproj.csproj /f:readme.html note: want automate through program, not looking manual solution open visual studio , click on readme file :) please help! found it!!! i able open readme html file in browser window inside vs solution/project opened. below command: devenv.exe webapplication1.sln /command "navigate [filepath]\project_readme.html" fyi, visual studio has number of command line switches, 1 useful here " /command " switch. starts vs ide , executes command specified after /command switch. the commands in question not dos commands, visual studio commands can execute inside vs. here reference visual studio commands arguments . hope helps else too!

java - Swing start simulation from Swing interface and write from thread. How? -

the problem lost myself in code. first of all, project supposed simulate shop queue. now, made swing interface data. when simulate button pressed, want start simulation. trick i'm not sure how write in fields without creating new interface. my interface code (i left thought important): public class interfata extends jframe { public void updatetextfield(string name, int i) { switch(i){ case 0: this.txtfield8.settext(name); break; case 1: this.txtfield9.settext(name); break; case 2: this.txtfield10.settext(name); break; case 3: this.txtfield11.settext(name); break; case 4: this.txtfield12.settext(name); break; case 5: this.txtfield7.settext(name); break; default : this.txtfield7.settext(name); break; } } private interfata() { mybutton = new jbutton("simulate"); mybutton.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { magazin shop =

Getting Errors when I tried to import Facebook SDK 4.0 for Android into Eclipse IDE -

i have downloaded , unzipped facebook latest sdk-4.0. have imported eclipse workspace but, there it's showing error in project packages. you haven't added additional information errors, facing. but, if have understood right, same problem, many other users facing too, include me. wrote short instruction, how have fixed in eclipse. can find here .

robotframework - How to write a variable into a file? -

i store ${username} value in output file: e.g. if ${username} equals 0401190926729000 , value stored in file. here proposal: *** settings *** library operatingsystem library string *** test cases *** write_variable_in_file ${username} = generate random string 1 abc log console ${username} run keyword if '${username}' == 'a' write_variable_in_file ${username} *** keywords *** write_variable_in_file [arguments] ${variable} create file ${execdir}/file_with_variable.txt ${variable}

html - Styling issue with Datalist formatted as Div Table -

Image
i creating datalist formatted table using divs formatting. problem header of table not lining rest of table. if remove headertemplate, lines properly. suggestions on how can fix this? my datalist aspx <asp:datalist id="table1" runat="server" repeatcolumns="1" cellspacing="1" repeatlayout="table"> <headertemplate> <div class="table"> <div class="heading"> <div class="cell"> <p>heading 1</p> </div> <div class="cell"> <p>heading 2</p> </div> <div class="cell"> <p>heading 3</p> </div> <div class="cell"> <p>heading 4</p> </div> <div class="cell"> <p>heading 5</p>

java - Failed having default tenant to connect to a Multi-tenant application -

i want migrate existing single-tenant application multi-tenant application. first step create default tenant , connect application, code following: the model : @entity @multitenant(multitenanttype.table_per_tenant) @tenanttablediscriminator(type = schema, contextproperty = multitenant_property_default) @table(name = "utilisateur") public class user implements serializable { @sequencegenerator(name = "user_seq", sequencename = "user_seq", allocationsize = 1) @generatedvalue(strategy = generationtype.sequence, generator = "user_seq") @column(name = "id", nullable = false) private integer id; private string username; private string password; @manytomany @jointable(name = "user_roles", joincolumns = { @joincolumn(name = "user_userid")}, inversejoincolumns = { @joincolumn(name = "role_roleid")}) private lis

When should one use the Javascript conditional operator? -

righto, have come across in lot of code have read , understand functional role of conditional operator in javascript; not understand when 1 should use it. i have read ecmascript specification 5.1 on it, doesn't me great deal in deciding when impliment it. for example, can quite see benefit of replacing code: if (istrue == true) { dosomething(); } else { dosomethingelse(); } with next: istrue ? dosomething() : dosomethingelse() where fall down when either code inside if... else... statement lengthy or conditional operator nested inside (an)other conditional operator(s). obvious candidate deciding when use version of conditional statement "does replacing conditional operator make code easier follow?". unfortunately rather inexperienced writing code , unsure of when , i'm biased understanding own code well, no matter how poorly written may be. can more experience me give me less subjective test when you use it, can attempt follow suit? related:

javascript - Mailchimp inline form validation not working for JS loaded HTML -

i'm trying create custom mailchimp popup. i'm using embeddable form code loading form html onto page on button click using js (or jquery) separate file. don't want user redirected mailchimp's thank page on completion of form. when don't try load form html separately, , have on main page, inline validation working , you're not redirected mailchimp page. when load same form code file either js or jquery, inline validation not work , you're redirected mailchimp page. there way load form html file , avoid redirect? i using jquery , found lot of articles suggesting issue conflict between mailchimp , jquery, recommended fixes didn't seem work, , switching js not fix it. i've tried lot of different things new js & jquery missing obvious - apologies in advance! here's html i'm using jquery version: <!-- form loaded here on button click --> <div id="mailchimp-popup-outer"></div> <div class="mailchimp-

javascript - PHP/Ajax/jquery/JSON - Take a part from echo text back as a variable after Ajax Post -

i'm working on simple ajax post method , here code: <script type="text/javascript"> jquery(document).ready(function($) { $(window).scroll(function() { if($(window).scrolltop() + $(window).height() == $(document).height()) { var nexturl = "<?php echo $nexturl;?>"; $('#loading').show(); $.ajax({ url: 'ajax.php', type: 'post', datatype: 'html', data: { next_url: nexturl }, }).done(function ( html ) { $('#loadedresults').html( html ); $('#loading').hide(); }); } }); }); </script> this code sending post data ajax.php: <?php function callinstagram($url) { $ch = curl_init(); curl_setopt_array($ch, array

html - Bullets not appearing in wordpress site -

when creating unordered lists bullet points not appear unless manually apply css html. style="padding-left: 30px; list-style: disc;" what can update no longer happens? example site @ following url. remove in style.css 1008 /*tabs*/ 1009 .tab-shortcode ul { /* list-style: none */}

sql - Why is Data Not Saved to the Database in my Guestbook Application? -

i creating application requires guestbook.. data database appears on website data enter website doesn't automatically put database. here code have.. protected sub butsign_click(sender object, e eventargs) handles butsign.click dim strdsn string = "provider=microsoft.jet.oledb.4.0;" & " data source=c:\users\shauna watson\desktop\project copies\final\app_data\factory.mdf" dim strsql string = (((("insert guestbook " & "( name,address,email,comments)" & "values ('") + txtname.text.tostring() & " ',' ") + txtaddress.text.tostring() & " ', '") + txtemail.text.tostring() & " ',' ") + txtcomments.text.tostring() & " ')" ' set access connection , select strings ' create oledbdataadapter dim myconn new oledbconnection(strdsn) 'create ole db command , call executenonquery execute ' sql st

How can PHP see client side cookies? -

how can php see client side cookies? to elaborate: when working php & javascript, understand php gets processed on server side. while javascript happens on client side. in javascript can check , set these client cookies. makes sense. however, php, if check client cookie value part of conditional statement sets , how php able see clients cookie value while php happening on server side? here's example of php conditional lives in php file: <?php if ($_cookie["name"] == “mickey”) { setcookie(“fulsome”, “mickey mouse”, time()+3600); } ?> there no such thing client side cookie. a cookie piece of data associated set of urls in browser. every time browser makes http request 1 of urls, cookie included in request headers. they designed set via http response headers. an api added browsers allows them created , set javascript. these still regular cookies though , included in every request associated urls. it possible mark cookie http_onl

node.js - Serialize query parameters to a filename -

i'd map api request 1::1 file name. this means, among other things, serializing query params safe filename, ideally on both windows , *nix. if api request this: api/eggs/fresh?search=brown&order=asc then filename might be: api/eggs/fresh?search=brown&order=asc.json but ? char , maybe & unsafe, have encode them think. the serialization must bi-directionally deterministic. have able data out. converting illegal characters _ , example, wouldn't meet criteria. is right method querystring.encode ? encoding urls might work if % file system safe. how url encode in node.js? ? or there better suited file system? i'm following process: get folder + resource name get array of params in request alphabetize params (so order doesn't matter) join params & (i think safe in modern file systems) concat folder/resource + __&__ + paramstring + .json this fails if uses __&__ part of actual query, think that's unlikel

MySQL Query with PHP and Send Data to JavaScript -

edit: i have number input id on it. in mysql database, have table ids , list of options separated commas id. i'll take 1 of database records example: id "ham_and_cheese" , options "mayonnaise, salad cream, chutney, no dressing". person selects 1 on number input id "ham_and_cheese". then, 1 drop down appear options: "mayonnaise, salad cream, chutney, no dressing" (each own option). if choose 2, 2 dropdowns appear, 3 3 appear, etc. i new ajax great if me out. my new code: ... <td><input type='number' min='0' max='5' name='ham_and_cheese_amount' /></td> ... <td id='ham_and_cheese_dressing'></td> ... function changedropdown(name, amount){ //gets id. var newname = name.replace("_amount", ""); //gets div drop down go in. var el2 = document.getelementbyid(newname + "_dressing"); //if number 0 selected in num

amazon rds - Create a rds instance using python: having status always = creating -

im trying create rds instance using python. i have code below create instance , want show print "instance running" when instance have status available. the problem that, when appears available status in aws managment console, in console application still appears status = creating , code dont out of while loop: the result im having: .... creating 233 creating 234 ... the code: instance = conn.create_dbinstance(...) print "waiting instance , running" status = instance.status inc = 0 while status != 'available': sleep(5) status = instance.status print status inc=inc +1 print inc if status == 'available': print "instance running" do see why can happening? the boto docs aren't clear when results such dbinstance.status fetched on-demand via api vs. being returned earlier, cached lookup. i'm betting here, instance.status call using returning same (cached) resu

php - Install script on non wordpress subdirectory folder -

im trying install script "moodle" in subdirectory of wordpress website if keep in first level folder wordpress 404 page not available or if go deeper "2 level folders" show me blog post! however url changing moodle/install.php ! how can tell wordpress ignore specific subdirectory , inside it? did search , tried of .htaccess hits non worked!

How to get own $UID in ant? -

$ echo $uid # return user id i want use information within ant-buildfile. solution set variable explicitly: ant some-target -downer_uid=$uid this way, in buildfile "${owner_id}" available usage. is there way information within buildfile in "internal" way, without need pass $uid parameter? not cross-platform solution, following work in unix-like environments: <exec executable="id" failonerror="true" outputproperty="uid"> <arg value="--user"/> </exec> <echo>uid: ${uid}</echo>

html - How can I make a Input with a span with :before pseudo class? -

it's firts question in stackoverflow ... have input type button, , want add pseudo:class before animation ( http://codepen.io/anon/pen/emodkg ). know it's impossible because input can't contain something. try add span input, span give class "btn" codepen ... the problem span on input, have animation it's not clickable. <span class="btn"><input type="button"></span> try one, think :) .btn { position: relative; display: block; margin: 30px auto; padding: 20px; overflow: hidden; border-width: 0; outline: none; border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, .6); background-color: #2ecc71; color: #ecf0f1; transition: background-color .8s; text-align: center; } .btn:hover, .btn:focus { background-color: #27ae60; } .btn:before { content: ""; position: absolute; top: 50%; left: 50%; display: block; width: 0; padding-top: 0

memory management - emulating a variable size struct in C; allignment, performance issues -

it possible put arrays custom length anywhere in struct in c, in case additional malloc calls required. compilers allow having vlas anywhere in struct, not standard compliant. decided emulate vlas within struct standard c. i in situation have maximum performance. code in c automatically generated, readability or style not important in case. there structs many custom size array members in between static size members. below simple form of such structs. struct old_a { int n_refs; void **refs; int count; }; struct old_a *old_a_new(int n_refs, int count) { struct old_a *p_a = malloc(sizeof(struct old_a)); p_a->n_refs = n_refs; p_a->refs = malloc(n_refs * sizeof(void *)); p_a->count = count; return p_a; } #define old_a_delete(p_a) {\ free(p_a->refs);\ free(p_a);\ } while (0) the additional malloc call refs can avoided follows. #define a_get_n_refs(p_a) *(int *)p_a #define a_set_n_refs(p_a, rval) *(int *)p_a = rval #define

iphone - Swift can't show back button after hiding it -

i have uitableviewcontroller static cell has custom button. hide button in viewdidload code: var cancelbtn = uibarbuttonitem(title: "cancel", style: uibarbuttonitemstyle.plain, target: self, action: "closesettings") self.navigationitem.hidesbackbutton = true self.navigationitem.leftbarbuttonitem = cancelbtn if don't have self.navigationitem.hidesbackbutton = true line in place, button arrow still appears. line in code, button hidden , cancel button appears how want. problem coming when open view controller cell, button not present. instantiate view controller when cell clicked, , use navigation controller push view controller. have attempted put self.navigationitem.hidesbackbutton = false in code right before pushviewcontroller(). when see button appear, when new view controller pushed on navigation controller, button disappears. i have attempted putting hidesbackbutton = false line in target view controller's viewdidload , viewdidappear, not a

html - Jquery dialog not working on mouseover -

i have div that, when hovered supposed transform div jquery ui dialog. <a href="#"><div class="btn button" id="btn button" value="">click here dialog!</></a><br><span class="tooltip">rgba(66, 222, 57, .8);</span> <div id="are-you-sure" title="dialog">here is!<br><br></div> <script> $('#btn').mouseover(function(){ $('#are-you-sure').dialog(); }); </script> i have of necessary stylesheets , scripts linked page, dialog still doesn't work. ideas? from mdn: https://developer.mozilla.org/en-us/docs/web/html/global_attributes/id this attribute's value must not contain white spaces . browsers treat non-conforming ids contains white spaces if white space part of id. in contrast class attribute, allows space-separated values, elements can have 1 single id defined through

javascript - SVG implementation of Monotone cubic interpolation without a Library like d3 -

i'm trying draw path in svg draws smoothed curve between series of points. for example - see (where "interpolations" set "monotone"): http://bl.ocks.org/mbostock/4342190 i've found excellent implementation of algorithm in javascript here: http://blog.mackerron.com/2011/01/01/javascript-cubic-splines/ i can use function create many points on curve want, , use points create polyline follow curve. huge number of points, i'd have relatively smooth curve. but i'd able create path uses cubic bezier curves, d3 does. i found svg implementation of catmull rom splines: https://gist.github.com/njvack/6925609 this works great, unlike monotone cubic interpolation, tends "overshoot" given points, isn't acceptable i'm doing. obviously - use d3, i'd able without library, if @ possible. thanks in advance. you extract d3's implementation, in function called d3_svg_linemonotonetangents in src/svg/line.js : /

.net - Windows 8 application works on computer but not on windows tablet -

i having weird problem windows 8 application, coded in vb.net, works fine on computer when install on tablet not work. here did in visual studio : project -> windows store -> create application packages. here did on tablet : transfered files created tablet ran powershell , installed application successfully. tried run white square "x" inside of (default application icon) shows , brought start menu. the application seems running open in task bar . however, does not show in task manager . i tried running powershell install application on computer , works fine . to make sure tablet wasn't problem created empty application , worked fine on tablet i tried proposed here , still doesn't work : http://answers.microsoft.com/en-us/windows/forum/windows8_1-windows_store/all-modern-apps-fail-to-start-after-windows-81/a80793c7-c214-43ec-9ca9-5c758f9ad840 any ideas causing problem ? can't seem find fix it this windows tablet : dell venue 11 pro (5

groovy - How do I log the request and response in soapUI? -

Image
i calling rest based service soapui. have created load test service , test works. wrote following code in setup script load test. log.info("this setup script") def request = context.expand('${#request}') log.info(request) def response = context.expand('${#response}') log.info(response); the item getting in log "this setup script". added following lines of code in teardown script. log.info("teardown script") def response = context.expand('${#response}') log.info(response); i not seeing "teardown script" text in log. @ point bit puzzled behavior. load test: test suite test case options. have unchecked discard ok results test box. what changes need scripts in order log requests , responses? when create setup and/or teardown script, remember run once per run, not per test! intended not going work. in setup, since no tests have run yet, context going empty ... can see log message. in tea

c# - Create and Show a WinForm -

i´m trying create , show forms in vs 2013 generic method method: void showorupdateform<t>(ref form form) t : form { if (form == null) { form = activator.createinstance(typeof(t)) t; form.show(); } else form.windowstate = formwindowstate.normal; form.focus(); } this code got here. when try call method told that: myform1 form; showorupdateform<myform1>(ref form); it give me error: error 1 best overloaded method match 'gestioneas.gestioneas.showorupdateform(ref system.windows.forms.form)' has invalid arguments error 2 argument 1: cannot convert 'ref package.views.form' 'ref system.windows.forms.form' how can fix this? seems, want that: // i'd rather return potentially created form directly (not via "ref") // need "this" in method? that's why "static" static t showorupdateform<t>(t form = null) t: form, new() { if (null ==

generator - Understand the producer and receiver using coroutine in python -

i want use coroutine implement producer , receiver. idea using 2 coroutines , 1 producer , 1 recevier. understand coroutine's send , running mode wrong. here code : def coroutine(func): def start(*args,**kwargs): cr = func(*args,**kwargs) cr.next() return cr return start class producer(object): def __init__(self, recevier): self.count=1 self.producer_coroutine = self._producer() self.receiver = receiver @coroutine def _producer(self): print "waiting" yield while true: self.send("yeah, no, yeah, no") get_feedback = (yield ) print ("get feedback %s"%get_feedback) self.send("a series of tubes") break def send(self,arg): self.receiver.receive_coroutine.send(arg) def init_producer(self): self.producer_coroutine.send("begin send , receive") class rece

linux - Use ldap for auth (via pam) but /etc/passwd for uid and guid -

i newbie on pam , nss please gentle. i have following scenario: i have access ldap database have no control on administration (so please not proper fix fix database, know not happen). however, in database users registred , authenticate against not have maintian own user database. the main problem there no uid or gid information in database , ldap admins refuse add information. my idea: configure pam can authenticate against ldap. if user sucessfully authenticates, pam (via pam-script?) creates local user (in /etc/passwd) local unique uid. local user later used nss find uid , guid. what have done far , question: i can authenticate against ldap , have idea on how create user @ login failing make nss use "local users" getting uid , gid. how can split login use ldap authentication , uses local files finding uid , guid, shell etc ?

Git - Unlink of file .idx and .pack failed (The only process owned handle to this file is git.exe) -

Image
please, @ picture! git stupid? git couldn't unlink file, git.exe holding handle file. (permissions ok - full control) please, there safe solution problem? git version 1.9.5-preview20141217 i had issue , solved command : git gc above command remove temp , unnecessary files (garbage collector): https://stackoverflow.com/a/26229658/532575

objective c - Where are identifiers like NSControlKeyMask defined -

where identifiers nscontrolkeymask , nsalternatekeymask , nsshiftkeymask defined? need compile swift project using objective-c library named ddhotkey contains following code: if (modifiers & nscontrolkeymask) { [final appendstring:[charactermap objectforkey:@(kvk_control)]]; } if (modifiers & nsalternatekeymask) { [final appendstring:[charactermap objectforkey:@(kvk_option)]]; } if (modifiers & nsshiftkeymask) { [final appendstring:[charactermap objectforkey:@(kvk_shift)]]; } this code gives me following errors: use of undeclared identifier 'nscontrolkeymask' use of undeclared identifier 'nsalternatekeymask' use of undeclared identifier 'nsshiftkeymask' why? doing wrong? how can fix it? thanks in advance. the "ddhotkey" sample project uses precompiled header file "ddhotkey_prefix.pch" contents #ifdef __objc__ #import <cocoa/cocoa.h> #endif so <cocoa/cocoa.h>

Azure CDN vs Direct access from blob -

i have couple of videos want end user view on web site. these videos transcoded deliver hls style streaming. 1) putting these videos in azure blob, make videos "progressive download" or streamed? 2) clients based in india / singapore. means blob location of azure in singapore closest. cdn give me specific advantage? 3) pointing single cdn blob make accessible cdn across world, or should configure 1 each geography (say 1 if customers come visit portal). i know questions not connected sure can see different varieties of addressing same problem thanks in advance vj azure blob supports standard http downloads, work standard file download web server. @ specific streaming scenarios, should take @ azure media services cdn should make better. first, cdn may have points of presence in more places there azure datacenters (depending on cdn provider use). secondly, if lot of concurrent users, cdn provides level of caching prevents azure blob download bandwidth be

javascript - issues w/ centering google map in bootstrap3 modal... keeps changing -

hi , help. have bootstrap 3 page put google map modal. after tweaking , research, reading able map show, correctly in desktop , mobile formats (map fill modal no grey, not break out of modal in responsive etc.) last issue find center marker not center inside frame after render time. after page reload map appear correctly, sometimes, not. in chrome, firefox, mozilla , opera test browsers. hours , hours spent on please. here's code: html <!-- google map in modal --> <!-- button trigger modal --> <p><a href="#mapmodals" data-toggle="modal" role="button" data-target="#mapmodal" class="btn btn-primary"><b>map satori spa</b></a></p> <!-- maps --> <div class="modal fade" id="mapmodal" tabindex="-1" role="dialog" aria-labelledby="#mapmodal" aria-hidden="true">

r - How to calculate accuracy from table matrix -

Image
i'm using table show results kmeans cluster vs. actual class values. how can calculate % accuracy based on table. know how manually. iris-setosa had 50 in cluster 2 while iris-versicolor had 2 in other cluster. is there way calculate % incorrectly classified instances: 52% i print confusion matrix classes , clusters. lke this: 0 1 <-- assigned cluster 380 120 | 1 135 133 | 0 cluster 0 <-- 1 cluster 1 <-- 0 incorrectly clustered instances : 255.0 33.2031 % you can use diag() select cases on diagonal , use calculate (in)accuracy shown below: sum(diag(d))/sum(d) #overall accuracy 1-sum(diag(d))/sum(d) #incorrect classification you can use calculate number of cases (in)correctly classified: sum(diag(d)) #n cases correctly classified sum(d)-sum(diag(d)) #n cases incorrectly classified where d confusion matrix

ios - Swift : Checking if 2 NSDates are the same -

really simple one, sure bug in swift. trying check if 2 nsdates same. statement never passes thought printout below println("\(statistics.startdate) \(healthobject.date)") if healthobject.date.isequaltodate(statistics.startdate) { healthobject.flights = int(quantity.doublevalueforunit(hkunit.countunit())) println(int(quantity.doublevalueforunit(hkunit.countunit()))) } 2015-03-30 13:56:50 +0000 2015-03-30 13:56:50 +0000 2015-03-30 13:56:50 +0000 2015-03-31 13:56:50 +0000 2015-03-31 13:56:50 +0000 2015-03-30 13:56:50 +0000 2015-03-31 13:56:50 +0000 2015-03-31 13:56:50 +0000 solution pointed out 1 awesome people replied, dates same until sub second level. odd part is, these values coming healthkit what works me in ios8 is: if let dif = calender?.comparedate(statistics.startdate, todate: healthobject.date, tounitgranularity: nscalendarunit.secondcalendarunit) { println(int(quantity.doublevalueforunit(hkunit.countunit()))) p

c++ - Inline member initializer containing pointer to member -

at work, i'm experimenting bit bring reflection our codebase. want achieve, capture pointer data-member inside type of data-member's initializer: template<class class, int class::*datamember> struct reflect { operator int() {return 0;} }; class foo { public: int bar = reflect<foo, &foo::bar>{}; }; although clang 3.4.1 ( http://gcc.godbolt.org/ ) , intel c++ xe 14.0 able compile piece of code, when using msvc12 following error message: error c2065: 'bar' : undeclared identifier error c2975: 'datamember' : invalid template argument 'reflect', expected compile-time constant expression furthermore, gcc 4.9.2 seems have trouble it: http://ideone.com/zuvomo . so questions are: is above piece of code valid c++11? if yes, there work arounds failing compilers? what vc++ complains not problem; [basic.scope.pdecl]/1,6: the point of declaration name after complete declarator (clause 8) and before

php - String to DateTime conversion substracts 1 hour from initial time -

$initialtime = "31.03.2015 17:59"; $timestamp = (new intldateformatter('en_us', intldateformatter::short, intldateformatter::short, 'europe/moscow', intldateformatter::gregorian,'dd.mm.yyyy hh:mm'))->parse($initialtime); $dt = new datetime('@'.$timestamp.' utc'); $dt->settimezone(new datetimezone('europe/moscow')); var_dump($dt); so, $initialtime i'm getting $timestamp using intldateformatter::parse() (timezone 'europe/moscow' ) then parse $timestamp datetime , set timezone same, outputs: class datetime#1 (3) { public $date => string(19) "2015-03-31 16:59:00" public $timezone_type => int(3) public $timezone => string(13) "europe/moscow" } why initial time different output time 1 hour? looks wrond intldateformatter . timestamp datetime object differs parsed one. $initialdate = new datetime(); $initialdate->settimezone(new datetimezone(

java - How to detect multiple faces using opencv in order to generate an output of flickering LED lights -

i new @ using processing , opencv, please bear me. have posted question on both stackoverflow , on processing forum reach wider audience , find solution -- apologies if looks if carelessly cross posting, not intentions. i have been working on light installation using arduino , processing. capturing people using face detection webcam , opencv, , translating light installation working off 16x32 led matrix panel. light installation response of amount of spectators viewing lights , being recorded @ same time - idea more people being recorded generate greater display of flickering lights, , when no 1 viewing/being recorded, lights not flicker. i have managed opencv detect faces , output arduino display on lights, can lights flash more intensely when people not being detected, rather when being detected. therefore, lights working in reverse, , flicker more when no-one being detected, , less when there people being detected. i have attached both processing , arduino code reference,

javascript - Difference between callback hell and nested promises -

i started working nodejs , mongodb(using monk). when came across term "callback hell". in code doing same thing. example- dbcall(d1, function(e, docs){ if(docs.length!=0) dbcall(d2, function(e, docs1){ if(docs1.length!=0) dbcall(d3, function(e, docs2){ //doing docs,docs1,docs2 }) }) }) this when started reading on "promises", , came across article - https://strongloop.com/strongblog/promises-in-node-js-with-q-an-alternative-to-callbacks/ since needed both docs , docs1 inside third callback used nested promises. dbcall(d1) .then(function(docs){ if(docs.length!=0) return dbcall(d2) .then(function(docs1){ if(docs1.length!=0) return dbcall(d3) .then(function(docs2){ //doing docs,docs1,docs2 }) }) }) from above code snippet have following questions(/doubts) : apart making code more readable, promises have performance benefits? nesting promises , callback hell looks similar me. there d

c - Why doesn't my for loop exit? -

c program. trying make multiple choice quiz. have used loop run question 1 2 3 etc. after running program never exits loop when have specified count <=3. why? can see have done wrong? #include <stdio.h> int main (void) { char s; char response[]={'a','b','c','d'}; int ,x; int count,result; printf (" listo para empezar?\n\n please type 's' si or 'n' no.\n"); scanf ("%c",&s); if (s='s'){ printf ("bueno. ya empezamos!\n"); } (count=0;count<=3;count++){ printf ("1.que significa la palabra 'conocer'\n"); printf ("1.\t 2.\t know\t 3. do\t 4. eat\n"); scanf ("%d",&x); if (x=response[1]) { printf ("equivocado!\n 'conocer'significa: know\n"); } else { printf ("cor

javascript - Generating content from jQuery -

i working on jquery tooltip module personal use. in code i'm using jquery's mousemove , mouseout functions in order generate tooltip. however, when move mouse on element hits if statement in build function , says tooltip should there though can see in firebug , in chrome dev tools it's not. $.fn.tooltip = function(useroptions) { var defaultoptions = { position: '', follow: true }; var options = $.extend(defaultoptions, useroptions); $(this).mouseenter(function() { var title = $(this).data('title'); build(title, options.position, options.follow); var top, left; var tooltip = $('#tooltip'); if (tooltip.hasclass('top')) { top = $(this).offset().top - ($(this).height() * 2) - 10; left = $(this).offset().left; } else if (tooltip.hasclass(&

plsql - oracle - write package output results to a file on client side -

so have this: create or replace package my_first_package procedure employee_analysis (p_id in number := 100, /*default formal parameter no arguments invokation */ p_percent in number := 0.01); /* -||- */ end my_first_package; create or replace package body my_first_package procedure employee_analysis (p_id in number := 100, p_percent in number := 0.01) cursor c_city (select l.city employees e inner join departments d on (e.department_id = d.department_id) inner join locations l on (l.location_id = d.location_id) e.employee_id = p_id); cursor c_manager (select e1.last_name employees e1 inner join employees e2 on (e1.employee_id = e2.manager_id) e2.employee_id = p_id); cursor c_department_name (select department_name employees e inner join departments d on (e.department_id = d.department_id) e.employee_id = p_id); /*---------------------------------