Posts

Showing posts from February, 2014

jquery - Load website when progress finishs -

i have created div, name of website. when enter in website, see name getting filled (like progress bar ). it's supposed when name completely filled, div dissapears ; dissapears when it's not totally filled. more or less in 50% ... can please me? **you can check out in next link: ** tapehd here's code... jquery code $(document).ready(function () { /* loading */ $(window).load(function () { $('body').addclass('loading'); }); settimeout(function() { if($('body').hasclass('loading')) { $('#loading').fadeout(); $('body').removeclass('loading'); $('body').addclass('loaded'); } }, 2000); if($.cookie('showonlyonce')){ $('#loading').hide(); } else { $.cookie('showonlyonce', 'showonlyonce', { expires: 1 }); $('#loading').show(); } /* end loading */ }

java - Simple switch in "for" loop and toLowerCase() method -

i beginner in java. making simple switch, in user entering number in words. training added "for" loop. package javaexc; import java.util.scanner; public class javastart { public static void main(string[] args) { scanner sck = new scanner(system.in); system.out.println("type loop counter "); int counter = sck.nextint(); system.out.println("counter is: " + counter ); (int = 0; <= counter; i++) { system.out.println("type number in words"); string ch = sck.nextline(); switch (ch.tolowercase()) { case "one": system.out.println("choice 1"); break; case "two": system.out.println("choice 2"); break; case "three": system.out.println("choice 3"); break; case "four": s

sockets - How can a single-threaded NGINX handle so many connections? -

ngnix uses epoll notification know if there data on socket read. let assume: there 2 requests server. nginx notificated 2 requests , starts to: receive first request parse ist headers check boudary (body size) send first request upstream server etc. nginx singe-threaded , can 1 operation @ same time. but happens second request? does nginx receive second request during parsing first one? or begins handle second request after getting first done? or else don't understand. if 1. correct don't understand how possible within single thread. if 2. correct how can nginx fast? because nginx handles incoming requests sequentially. @ given time 1 request handling possible. please me understand. thanks nginx not single threaded application. not start thread each connection starts several worker threads during start. nginx architecture described in http://www.aosabook.org/en/nginx.html . actually single threaded non-blocking application efficient desi

html - Style tab-selected element? -

i have menu bar drop-down sub menus i've created css. works fine when i'm using mouse, if use tab key select menu items, sub menu won't open , i'm unable go of sub pages without using mouse. is there way open sub menus tab key without using js? here's js fiddle html <span id="main_menu"> <span> <a href="#">page 1</a> </span> <span> <a href="#">page 2</a> <span> <span> <a href="#-history">sub page 1</a> </span> <span> <a href="#">order savings</a> </span> </span> </span> <span> <a href="#">page 3</a> </span> </span> css #main_menu{ background: #000; display: inline-block; padding: 10px; } #mai

Why does if then return break end not work in Lua inside for loop -

i have following function checks if given parameter found key in key-value table. if case should return true , break out of loop. if nothing found nothing. function checkid(id) k,v in pairs(info) if id == tostring(k) return true break -- break out of loop. mission accomplished. end end end i 'end' expected (to close 'do' @ line 192) near 'break' when try run script. missing? logically can't return and break that. return exits function (so don't need break ). that specific error because in lua return has last statement in block.

sql server - First and last day of this month last year -

i'm declaring months , dates , need on getting first , last date of month last year. so far have following. declare @today date set @today = cast (getdate() date) declare @firstdaylastmonth date set @firstdaylastmonth = dateadd(month, datediff(month, 0, @today)-1, 0) declare @lastdaylastmonth date set @lastdaylastmonth = dateadd(s,-1,dateadd(mm, datediff(m,0,@today),0)) declare @lastdaythismonth date set @lastdaythismonth = dateadd(s,-1,dateadd(mm, datediff(m,0,@today)+1,0)) -- declare @firstdaythismonthlastyear set -- declare @lastdaythismonthlastyear set select @today, @firstdaylastmonth, @lastdaylastmonth, @lastdaythismonth -- @firstdaythismonthlastyear -- @lastdaythismonthlastyear but having trouble finding last 2 declarations. appreciated. you can use eomonth ( start_date [, month_to_add ] ) function sql server 2012 , above.

objective c - How to get the new iOS 8 keyboard show up on my app -

i have ios phone app wrote ios 7. noticed when run app on ios 8 devices iphone 6 , click on text field, keyboard appears stretched. want update code use new ios 8 default keyboard,but not sure how. set xcode project use size classes, still uses old keyboard. how tell xcode use new keyboard? thanks! edit changed icon launch image file in below answer. pointing @rmaddy. add launch screen file iphone 6(retina hd 4.7 & 5.5) selecting ios8 , later in attributes inspector of images.xcassets. app installed app developed/compatible iphone6 screen size.

excel - Macro to sort and align data in columns -

i want build off macro, aligns data in 2 separate columns. sub macro1() dim rng1 range set rng1 = range([a1], cells(rows.count, "a").end(xlup)) rng1.offset(0, 1).columns.insert rng1.offset(0, 1) .formular1c1 = _ "=if(isna(match(rc[-1],c[1],0)),"""",index(c[1],match(rc[-1],c[1],0)))" .value = .value end end sub this want add: if item in column c not found in column a, copy values in column b below other values match, starting in cell right of first blank cell in column a. also, items in column not in column b, leave "-" in column b. below. cola colb colc b b c c d d e e f - g s g s b d c e

javascript - Using node-inspector with Grunt tasks -

does used node-inspector grunt application debugging? if not, can recommend debugging tool grunt based apps? i'm working nodejs server side app , have grunt use separated tasks (this because users can execute tasks separately). thanks in advance to run grunt in debug, need pass grunt script node explicitly: node-debug $(which grunt) task and put debugger; line in task. node-inspector open browser debugging tools. edit 28 feb 2014 node-inspector has added command node-debug , launches node in --debug state , opens browser node-inspector page, stopping when hits first debugger line or set breakpoint. edit 30 january 2015 on windows, things touch more complicated. see answer @e.gluhotorenko instructions.

ide - Weird PhpStorm quotes behavior -

i've updated phpstorm version 8.0.3 , i've noticed weird , rather annoying behavior when placing single or double quotes. when place quote gets underlined (img: http://i.imgur.com/qqop4gc.png ) , when try write further skips 1 letter, example: write quote , try write word:hello, gets written - 'ello, when should have been - 'hello. how can disable/fix feature/bug? thank in advance.

java - Turn off Compatibility Mode inside of Page Viewer Web Part (SharePoint 2010) -

we have web site created uses java in sorting tables. when go directly page works find (i had turn of compatibility mode site). when take site , try put in page viewer web part breaks , not show java. how turn off compatibility mode inside of page viewer web part? p.s. works fine in chrome. have issue in ie.

Install Intel graphic driver and run genymotion -

Image
i want install intel graphic driver on win 8.1 64bit os when install give error: this computer not meet minimum requirements installing software. and when want run genymotin give me error: i searched on internet work not have result. please me , give me solutions! i install update of microsoft , solved above problems: intel corporation driver update intel(r) hd graphics 3000

c# - Is it possible to have a make a generic method which can take the place of three methods with a System.Data.Linq.Mapping.FunctionAttribute? -

i have 3 methods in datacontext class call different stored procedures having different behaviours; append, update, overwrite. 3 methods have in essence same code. difference "name" property of system.data.linq.mapping.functionattribute decorates methods. [function(name = "import.usp_mydata_processimportappend", iscomposable = false)] or [function(name = "import.usp_mydata_processimportupdate", iscomposable = false)] or [function(name = "import.usp_mydata_processimportoverwrite", iscomposable = false)] in essence similar this /// <summary> /// processes import. /// </summary> /// <param name="loadid">the load id.</param> /// <exception cref="system.argumentnullexception">loadid</exception> [function(name = "import.usp_mydata_processimportappend", iscomposable = false)] public int32 processgradingimport(string loadid) { // validate parameter if (string.isn

java - Reusing instances of objects vs creating new ones with every update -

what differences , pitfalls between reusing instances of objects vs creating new ones, every time swap buffers ? background: this game engine project of mine. i writing triplebuffer have 3 versions of every object: old version , current version , , future version . changes on these objects made reading state current version of , applying changes future version. after changes have been made objects (resp. applicable), buffers swapped : future objects become current objects, current objects become old objects, , old objects? either discarded , new objects allocated iterating on now current objects or become now future objects , values updated (resp. overridden) iterating on now current objects. explanations: "reusing": overwriting values of old instance new values, changing state of instance "new ones/cloning": creating new instance using data of old instance, , applying changes it use case: say 1000 objects swapped @ 30hz, meaning nee

.net - Check for event listener(vb) for an event raised in C# -

for c# collectionchanged event, how 1 define vb event handler? for c# code snippet, expression collectionchanged != null evaluates false indicating vb event handler has not being defined correctly or might missing basic. public event collectionchangeeventhandler collectionchanged; protected virtual void oncollectionchanged(collectionchangeaction action, expression element) { if (collectionchanged != null) //always null { collectionchangeeventargs e = new collectionchangeeventargs(action, element); collectionchanged(this, e); } } // usage: oncollectionchanged(collectionchangeaction.refresh, item); the vb event handler defined below: addhandler expression.expressionscollection.collectionchanged, addressof expressionscollectionupdated

html - Javascript reloading iframe -

hi can me here have code works fine reloading iframe id cant seem work class reload more 1 iframe or failing more 1 iframe id. <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl"> <head> <title>javascript iframe reload</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript"><!-- // set interval in milliseconds var reloadinterval = 3000; // run when document loaded function init() { settimeout('reload()',reloadinterval); } // reloads iframe, , triggers next reload interval function reload() { var iframe = document.getelementbyid('reloader'); if (!iframe) return false; iframe.src = iframe.src; settimeout('reload()',reloadinterval); } // load init() functio

c++ - k-nn algorithm does not detect digits correctly/perfectly -

i have learned coding, image processing, opencv, c++ , visual studio 1 month, , in trouble solving problem. need , shed light. i have tried code website detect digits opencv library, 7 digits detected, 3 digits corrects. parameters should changed? in addition, detection start right bottom left up, shouldn't detected upper left right? should change? if use code , ressources, should alright if test code on image different numbers , typo, give try image used in sample (python). you need replace train data these one: // loading digit models hogdescriptor h(size(20, 20), size(10, 10), size(5, 5), size(5, 5), 9); std::vector<float> hdata; mat data(size(324, 5000), cv_32fc1); mat responses(size(1, 5000), cv_32fc1); (int = 0; < 50; i++) { (int j = 0; j < 100; j++) { h.compute(digits(rect(j * 20, * 20, 20, 20)), hdata); (unsigned int k = 0; k < hdata.size(); k++) { data.at<float>(i * 100 + j, k) = hdata[k]; }

dataframe - Looking to transpose a data frame on multiple columns in R -

here sample dataframe have mydataf.tickersymbol mydataf.yr_qtr mydataf.act_mean 1 abc 20084 bb 2 abc 20091 bb 3 abc 20092 bb 4 abc 20093 bb 5 def 20084 bb 6 def 20091 bb 7 def 20092 bb 8 def 20093 bb 9 def 20094 bb 10 gef 20092 bb 11 gef 20093 bb 12 gef 20094 m trying output of joining on yr_qtr each ticker , caring missing data valued. can go through , loop , create logic checks seems through data frames should able using r dataframe capabilities? 20084 20091 20092 20093 20094 abc aa

Sharing texture between OpenGL and CUDA -

i sharing data between opengl , cuda follows: gluint buffer; glgenbuffers(1, &buffer); // image bound texture buffer @ point. ... cudagraphicsresource_t cgr; checkcudaerrors(cudagraphicsglregisterbuffer(&cgr, buffer, cudagraphicsregisterflagsnone)); checkcudaerrors(cudagraphicsmapresources(1, &cgr, 0)); uchar4 * device_ptr = 0; size_t num_bytes; checkcudaerrors(cudagraphicsresourcegetmappedpointer( (void **)&device_ptr, &num_bytes, cgr)); this works fine , device_ptr not pointer cuda memory. now, @ point want resample image using bilinear interpolation. seems preferred way in cuda map device data cuda texture memory , perform interpolation using tex2d calls. now, question imaging data exists in opengl texture memory , wonder if there way avoid calling cudabindtexture2d again , somehow use opengl texture within cuda interpolation? yes can directly read/write opengl texture tex2d. initialize graphic ressource str

javascript - jQuery DOM manipulation from Knockout ViewModel - use bindingHandlers? -

i've got knockout viewmodel looks this: function myviewmodel() { this.update = function() { ... } ... } and bindinghandler looks this: ko.bindinghandlers.mybindinghandler = { init: function(element, valueaccessor, allbindings, viewmodel) { function manipulatedom(element) { ... } } } i want myviewmodel call manipulatedom whenever update method called. i using callback set in bindinghandler: function myviewmodel() { this.update = function() { ... this.mybindinghandlercallback(); } ... } ko.bindinghandlers.mybindinghandler = { init: function(element, valueaccessor, allbindings, viewmodel) { viewmodel.mybindinghandlercallback = manipulatedom.bind(null, element); } } <div data-bind="mybindinghandler: null"></div> another idea had use 'updatecount' observable , subscribing in bindinghandler: function myviewmodel() { this.updatecount =

spring security - Upgrade to Grails 2.4: ClassNotFoundException: org.springframework.web.filter.GenericFilterBean -

i trying upgrade application grails 2.4.5 2.3.11. not seem able work. use spring security core , spring security rest plugin. trying run app, exception thrown indicating spring security core source: 2015-04-29 16:20:24,497 [localhost-startstop-1] error context.grailscontextloaderlistener - error initializing application: org/springframework/web/filter/genericfilterbean message: org/springframework/web/filter/genericfilterbean [...] | 212 | docall in springsecuritycoregrailsplugin$_closure2 [...] caused classnotfoundexception: org.springframework.web.filter.genericfilterbean why doesn't find genericfilterbean class? spring security plugin indicates compatible grails 2.4. the plugins included in buildconfig.groovy this: compile (":spring-security-rest:1.5.0.rc4") compile (":spring-security-core:2.0-rc4") have looked @ reference documentation ? (grails 2.4.x: upgrading grails 2.3) http://grails.github.io/grails-doc/2

android - Calabash error. Could not list certificates in keystore. Probably because the pass was incorrect. (RuntimeError) -

i've got problem when type calabash-android run binary\app-debug.apk features\my_first.feature on command line in windows on project. this problem: c:/ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.9.pre2/lib/calabash-android/java_keystore.rb:32:in 'initialize': not list certificates in keystore. because password incorrect. (runtimeerror) i don't know it's happening because set before password android , keystore androiddebugkey. anyone knows it? thanks! ps: i'm using windows os 8. update 04/30. here debug information: jdk fount at: c:\program files (x86)\java\jdk1.7.0_79 android sdk found at: c:\users\myuser\android-sdk no test server found combination of app , calabash version. recreating test server. signature files: c:/users/myuser/appdata/local/temp/d20150430-8916-1taiq7r/meta-inf/cert.rsa "c:\program files (x86)\java\jdk1.7.0_79/bin/keytool.exe" -v -printcert -j"-dfile.encoding=utf-8&quo

apache - How to convert configure apache2 to handle https -

i have site running in http. want enable https full website. i followed tutorial on this site this /etc/apache2/sites-available/default-ssl.conf file ifmodule mod_ssl.c> <virtualhost _default_:443> serveradmin webmaster@localhost websitename websitename.com:443 documentroot /var/www/html # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn now when try restart apache following error. * starting web server apache2 * * apache2 configtest failed. output of config test was: ah00526: syntax error on line 4 of /etc/apache2/sites-enabled/default-ssl.conf: invalid command 'websitename', perhaps misspelled or defined mod

Pass json and deserialize form in django -

the issue next: send post data ajax server. data looks like: data = { form : $(this).serialize(), some_array: [2,3,4,1] } how form object in django? request.post['form'] returns string form. i'm trying use import json library. but, when run value = json.load(request.post['some_array']) or form = json.load(request.post['form']) doesn't work. printing request.post['form'] returns following: u'csrfmiddlewaretoken=i3lwajfhzrgyd5ns3m9xcjkfklxnhxor& address_city=%d0%9a%d0%b8%d1%97%d0%b2& address_street=2& address_building=3& delivery_time=2015-05-15' the form data not encoded in json query string. can use urlparse.parse_qs standard library parse query string. example: from urlparse import parse_qs form_data = parse_qs(request.post['form'].encode('ascii')) # query strings use ascii code points safe. # access address_city: address_city = form_data['address_city'][

regex - Mongodb use aggregate to iterate through collection -

i have collection of summaries called collectioname , , list of key words called keywords . used below code filter out summaries in collectioname contains first key word in list, , worked great. db.collectioname.aggregate([ { $match: { summary: {$regex: keywords[1], $options:"i"} } }, { $out: "subsetfinal" } ]); but when started loop it, gave me aggregation error. can't figure out why. for (var = 0; < 79; i++) {db.collectioname.aggregate([ { $match: { summary: {$regex: keywords[i], $options:"i"} } }, { $out: "subsetfinal" } ])}; it gives me error: $regex has string code 16810 can help? you use pipe-delimited regex pattern keywords this: test documents: db.collectioname.insert([ { summary: "a b c" }, { summary: "d e f" }, { summary: "g h i" }, { summary: "j k l" }, { summary: "m n o" } ]); the magic: var keywords = ["a", &quo

node.js - Express redirect based off URL -

i'm using express & node.js . router.get('/:year?/:month?/:day?', function(req, res) { var date = moment(); if (req.params.year && req.params.month && req.params.day) { var datestring = req.params.year + " " + req.params.month + " " + req.params.day; var tempdate = moment(datestring, "dd mm yyyy"); if (tempdate.isvalid()) { date = tempdate; } } .catch(function (err) { console.error(err); res.send("error"); }); }); the above isn't full code route. need pointers. i'm using moment.js( http://momentjs.com/ ) grab current date, format , pass through url in route.get request. however, don't want user able go past date. if date has been , user tries navigate want redirect them current date. .then (function(){ var pastdate = function(req, res) { if (req.query.[pastdate]) { res.redirect('/'); } else {} } }) i don't thi

android - Phonegap Eclipse missing cordova.jar -

Image
i followed tutorial exception installed current versions of listed tools. after installed node.js executed npm install -g phonegap not find cordova.jar. should download archive phonegap1.5 , copy files downloaded folder? because not in administrator mode. can is windows right click cmd , choose run administrator . run npm install -g phonegap . mac sudo npm install -g phonegap

angularjs - How to check if Firebase updated remotely? -

i have app uses angularjs , firebase (with angularfire api), i'm getting problems $bindto service. users loosing data because there no connection in city, our internet slow. thinking create icon in app shows user if data updated or not. how thinking it? - watch object - on data changed, icon becomes red - when data saved on firebase, returns event change icon color green how can it? there better way deal it? check out https://www.firebase.com/docs/web/guide/offline-capabilities.html gives example of how check out connection status , event handlers deal such situations .

image - File upload in Cakephp 3.3 -

i trying store image in cakephp 3.0. able save filename in db, however, unable store actual file on server. need help form: echo $this->form->create('user', array('url' => array('action' => 'create'), 'enctype' => 'multipart/form-data')); echo $this->form->input('upload', array('type' => 'file')); images controller: */ public function add() { $image = $this->images->newentity(); //check if image has been uploaded if(!empty($this->request->data['images']['upload']['name'])) { $file = $this->request->data['images']['upload']; //put data var easy use $ext = substr(strtolower(strrchr($file['name'], '.')), 1); //get extension $arr_ext = array('jpg', 'jpeg', 'gif'); //set allowed extensions //only process if extension valid

c# - Autofac integration with Mobile Azure Service -

i have created mobile azure service project , integrated autofac. here iocconfig.cs in have registered apicontrollers , libs. var containerbuilder = new containerbuilder(); //register api controllers containerbuilder.registerapicontrollers(typeof(usercontroller).assembly); /*register libs*/ containerbuilder.registertype<userlib>().as<iuserlib>(); /*register objectcontexts*/ containerbuilder.registertype<mobileservicecontext>() .as<dbcontext>().instanceperdependency(); var container = containerbuilder.build(); // var resolver = new autofacdependencyresolver(container); dependencyresolver.setresolver(new autofacdependencyresolver(container)); //for web api dependency resolver var resolver = new autofacwebapidependencyresolver(container); globalconfiguration.configuration.dependencyresolver = resolver; return container; but api not calling due issue , throws error controller not registered . if put below code, work fine, simple dep

java - Strange behavior in Nebula CDateTime -

Image
i trying cdatetime cell editor swt table control. when run standalone cdatetime sample (from here ), looks like: the cdatetime created this: final cdatetime cdt = new cdatetime(shell, cdt.drop_down | cdt.date_short | cdt.compact); cdt.setselection(new date()); notice icon causing drop down - looks calendar. can see month/year, , there 2 arrow buttons , "today" button in left corner of header. date written textbox correctly when select date. however, when try add cell editor, looks like: notice icon different , header parts different. notice how selected date , weird number - month of 32! - in text box. when popup goes away, date correct, strange behavior looks odd , worrying. i created cdatetime this: final int style = getstyle() | cdt.date_short | cdt.drop_down | cdt.compact ; this.datetime = new cdatetime(parent, style); this.datetime.setpattern("mm/dd/yyyy"); what doing wrong? i know old question, here answer: pattern

java - Not able to find the elements when the page is loaded -

while clicking url, new page loaded . after page loaded , not able find out elements in page. have used below code . getting no such element exception only. please on issue? webelement element7 = driver.findelement(by.id("linkid")); if (element7.isenabled()) { element7.click(); system.out.println(" report selected"); } testclass.waitforpageloaded(driver); // using method have been waiting page new page load. //find elements in new page . webelement element8 = driver.findelement(by.id("cbperiodtype")); if(element8.isdisplayed()) { select periodtype = new select(driver.findelement(by.id("cbperiodtype`enter code here`"))); periodtype.selectbyvalue("1"); system.out.println("periodtypeselected"); } looks element lookup fast. use explicit wait when finding element. see full list of expectedconditions here // find elements in new page . //webelement element8 = driver.findelement(by

c# - HTML hex to polish characters -

i'm downloading html file polish characters, , parsing string by: public static string hextostring(string hex) { var sb = new stringbuilder(); (int = 0; < hex.length; += 2) { string hexdec = hex.substring(i, 2); int number = int.parse(hexdec, numberstyles.hexnumber); char chartoadd = (char)number; sb.append(chartoadd); } return sb.tostring(); } so when found %21 i'm sending 21 hextostring() , in return there !, ok, char ą represented %c4%85 (Ä) , whant ą char the problem here treating hex codes if utf16 (which native format char ), in fact utf8. this easy resolve using utf8 encoding. first, let's write handy stringtobytearray() method: public static byte[] stringtobytearray(string hex) { return enumerable.range(0, hex.length) .where(x => x%2 == 0) .select(x => convert.tobyte(hex.substring(x, 2), 16)) .toarray(); } now can convert hex string text so: string h

java - Consume Web Service XML - NullPointerException -

i'm trying consume xml i'm getting nullpointerexception in line: inputstream = res.getentity().getcontent(); there's consume method , can check xml in url public class xmldownloader { defaulthttpclient client = new defaulthttpclient(); httpget method = new httpget("http://proapaplicativos.com.br/jccuritiba/listareventos.php"); httpresponse res = null; nodelist result = null; // thread t = new thread(); public nodelist getnodelist() throws interruptedexception{ //string url = "http://fiscalartesp.cloudapp.net/service1.svc/login?"; new thread(new runnable() { public void run() { try { res = client.execute(method); } catch (clientprotocolexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (ioexception e) { // todo auto-generated catch bl

Android Facebook SDK 4.0 login with LoginManager -

i trying migrate login code of old application sdk 3.0 sdk 4.0. have implemented login using loginmanager , have custom login buttons. the problem no response facebook api. no success, no error, no exception thrown whatsoever. code below: //global refs //callbacks private callbackmanager mcallbackmanager; private facebookcallback<loginresult> mfacebookcallback; private list<string> mpermissions = arrays.aslist("email"); private loginmanager mloginmgr; private activity mactivity; //........ //code inside method facebooksdk.sdkinitialize(getapplicationcontext()); //perhaps bit excessive facebooksdk.addloggingbehavior(loggingbehavior.graph_api_debug_info); facebooksdk.addloggingbehavior(loggingbehavior.developer_errors); facebooksdk.addloggingbehavior(loggingbehavior.include_access_tokens); facebooksdk.addloggingbehavior(loggingbehavior.include_raw_responses); facebooksdk.setapplicationid(mac

Check if CDT is installed in Eclipse -

i have eclipse android development, , need know if cdt plugin installed. have both sdk , ndk installed ( adt-bundle-windows-x86-20140702 , android-ndk-r10d ), intellisense c++ source code not working @ all, makes me suspect cdt not installed. but have no idea how check if installed or not. in menus go? for? click 'help > eclipse' , click 'installation details' button @ bottom of dialog. resulting dialog shows features have installed on 'installed software' tab. on newer versions of eclipse can go directly dialog 'help > installation details' on macs dialog in eclipse menu

java - how to read file in hex format -

i have file have read java code. can open file in hex editor, content '00 01 00 00' in opened file hex editor. i want following operation java code:- 1. read content. 2. print it. (it should print 00 01 00 00). can perform operation on data. but problem is, when doing above operation on file using "fileinputstream" instead of printing '00 01 00 00' printing '0 1 0 0' every byte converted decimal value. so there way can perform desired operation?

powershell command Line arguments get lost if directly running from CMD -

need help example working : c:\sdk>powershell testps1.ps1 a1 a2 a3 not working : c:\sdk>.\testps1.ps1 a1 a2 a3 in above examples both command runs script 2nd command running script without powershell prefix not capture argument in args . powershell default app launcher ps1 extension . script : testps1.ps1 -------------------------------------------- write-host "running script " write-host $args write-host "script completed!!" -------------------------------------------- .\file open in default application. default supposed notepad.exe .ps1 files. class mapping .ps1 files has not been setup pass arguments. enabling potential security risk , not enabled default reason. for how manually need in setting custom registry class .ps1 %1

jQuery Grouping Elements -

say have 10 elements , want create groups of 5, how can wrap x elements in jquery? here markup: <div class="mainwrap"> <!-- wrap div --> <div class="item">item</div> <div class="item">item</div> <div class="item">item</div> <div class="item">item</div> <div class="item">item</div> <!-- close wrap --><!-- open new wrap --> <div class="item">item</div> <div class="item">item</div> <div class="item">item</div> <!-- close wrap --> </div><!-- mainwrap --> dynamically? maybe like. var grouping = []; var $newwrapping = $('<div class="mainwrap"></div>"); $('.mainwrap .item').each(function(index, value){ grouping.push($(value)); if (grouping.length > 4) { $newwrapping.append(grouping);

php - Soap fail function response -

i have soap client code auto parts elit company have strange result. object(stdclass)[225] public 'return' => object(stdclass)[226] public 'unitprice' => float 0 public 'vat' => int 0 my php code: getitem function must have array parameters: 7 => string 'struct getitem { string company; string login; string password; string activeitemno; } public function demo($piesa) { $wsdl = 'http://icelit02.elit.cz:7606/intercompany-1.10.0/buyerservice?wsdl'; $opts = array('http' => array('protocol_version' => '1.0')); $context = stream_context_create($opts); $client = new soapclient($wsdl, array('stream_context' => $context)); var_dump($client->__getfunctions()); var_dump($client->__gettypes()); $response=$client->__call('getitem', array(array('company'=>'elit_ro', 'login'=>&#

php - mysql query from 2 tables with conditions -

i have 2 tables orderitems +--------+------------+------------------+---------+ | item_id| item_name | item_type | trans | +--------+------------+------------------+---------+ | 1 | devon | line_item | 0 | | 2 | 100 | coupon | 0 | | 3 | contin | line_item | 1 | +--------+------------+------------------+---------+ orderitems_data 1+--------+------------+------------------+-----------+ | id | item_id | item_key | key_val | +--------+------------+------------------+------------+ | 1 | 1 | delivery | 2015/04/03 | | 2 | 1 | attrib | pick_up | | 3 | 1 | qty | 1 | | 4 | 2 | discount | 0 | | 5 | 3 | delivery | 2015/04/15 | | 5 | 3 | attrib | doorstep | +--------+------------+------------------+------------+ i need sele

html - How to hide the overflow of photos in canvas? -

Image
i trying making photo frame pattern on canvas. in want put two, 3 or maybe more photos under overlay frame. few parts of overlay frame transparent. if upload photo1 first section of frame visible second section , uploading photo2 section 2 visible first section. depending on photo uploaded first or edited @ last overlapping other photo. i want know how hide overflow of photo should not visible other sections. how can achieve this? i have done far: canvas.on({ 'object:moving': onchange, 'object:scaling': onchange, 'object:rotating': onchange, }); function onchange(options) { options.target.setcoords(); canvas.foreachobject(function (obj) { if (obj === options.target) return; if (obj.id != 'cover1' && obj.id != 'cover2') return; if (options.target.intersectswithobject(obj)) { // hide portion canvas.renderall(); } });

javascript - How to create a html collection of elements located in separate divs -

i need create html collection containing 5 input-elements, type = text. the html: <div class="outerdiv"> <label><input type="checkbox" align="middle"> <img src="lorem.jpg" alt="img 1" class="image"> </label> <div class="innerdiv"> <label>lorem<input type="text" value="lorem"></label> </div> </div> when this, collection input-elements, want ones has value = text. innerdivtag = document.getelementsbytagname("input"); and when this, 5 separate collections , not aim. for (i = 0; < outerdiv.length; i++) { innerdivtag = innerbox[i].getelementsbytagname("input"); } you can use queryselectorall document.queryselectorall("input[type='text']");

wsdl - Wrap function parameters complexType in an element -

i trying implement existing webservice spyne. have function takes 2 parameters, wsdl should this: <wsdl:types> <xs:schema targetnamespace="http://example.com/" elementformdefault="qualified" > <s:element name="getdata"> <s:complextype> <s:sequence> <s:element minoccurs="0" maxoccurs="1" name="login" type="s:string"/> <s:element minoccurs="0" maxoccurs="1" name="password" type="s:string"/> </s:sequence> </s:complextype> </s:element> [...] my code contains following decorator function: @rpc(string(min_occurs=0, max_occurs=1, nillable=false), string(min_occurs=0, max_occurs=1, nillable=false), _returns=unicode) def getdata(self, login, password): return 'data' which produces wsdl: <wsdl:types> <xs:schema elementfor

excel - If statement returning #NAME error -

Image
basically have 2 different columns; column g , h i make if column h greater today's date coloumn g equals "g" , if column h less today's date column g equal "r" not on track =if(h84<today,"r","g") my return #name? you missing (). change: =if(h84<today,"r","g") to =if(h84<today(),"r","g")

Trying to connect Android app with SQLite to SQL Db via webservice (php) -

to clarify on problem; i'm following old tutorial try , learn basic sync functionality android app ( here ). have php webservice in place, believe permissions set right, post in android code set correct server ip. when try synch app sql getting asynchttpclient statuscode of 0. far can tell, means request timing out? if i'm looking how extend timeout limit, if not stuck , appreciate input idea of i'm going wrong. code below relevant part android studio. public void syncsqlitemysqldb(){ //create asychttpclient object asynchttpclient client = new asynchttpclient(); requestparams params = new requestparams(); arraylist<hashmap<string, string>> userlist = controller.getallusers(); if(userlist.size()!=0){ if(controller.dbsynccount() != 0){ prgdialog.show(); params.put("usersjson", controller.composejsonfromsqlite()); client.post("http://46.105.118.169:9000/sqlitemysqlsync/insertuse

bash - WGET ignoring --content-disposition? -

i trying run command download 3000 files in parallel. using cygwin + windows. downloading single file via wget in terminal : wget --no-check-certificate --content-disposition --load-cookies cookies.txt \ -p https://username:password@website.webpage.com/folder/document/download/1?type=file allows me download file id 1 singularly, in correct format (as long --content-disposition in command). i iterate on rest api call download entire folder (3000 files). works ok, quite slow. for /l %i in (0,1,3000) wget --no-check-certificate --content-disposition --load-cookies cookies.txt \ -p https://username:password@website.webpage.com/folder/document/download/%i?type=file now trying run program in cygwin, in parallel. seq 3000 | parallel -j 200 wget --no-check-certificate --content-disposition --load-cookies cookies.txt -p https://username:password@website.webpage.com/folder/document/download/{}?type=file it runs, file-name , format lost (instead of "index.html" ,

indexing - Alter Non Clustered Index in SQL Server to Add more included columns -

is possible alter existing non clustered index include more columns part of covered columns. e.g. alter index ix_nc_tablename_columnname tablename(columnname) include(col1, col2, col3) want include col4 in above index. what impact of adding column? there fragmentation or else? the cost of additional included column increased storage , potentially fragmentation. fragmentation increase compared old index due increased leaf node size (assuming keys not incremental) , if updates new included column increases length. consider using create index...with drop existing task. avoid dropping old index , avoid sort, leverage existing index key sequence rebuild: create index ix_nc_tablename_columnname on tablename(columnname) include(col1, col2, col3, col4) with(drop_existing = on);

Javascript Jasmine Testing: Prevent tested function to call function from object that was created within tested function -

i want test javascript function jasmine has structure this: showedituser: function (...) { // more code here... var edituserview = new edituserview(); // more code here... edituserview.generate(...); } edituserview.generate() causes error. not matter because don't want test it. how can prevent being called? edituserview requirejs module extends module called baseview . function generate() defined in baseview . there other modules extend baseview , want of them not call generate while testing. how can jasmine? seems not possible spyon(...).and.callfake() because don't have edituserview object when calling function. there kind of static way tell jasmine callfake() function generate in baseview ? there no "nice" way solve jasmine. think, take baseview viewobj parameter nicer coding style. reduce dependencies of method. don't have know specific baseview -class, need viewobj has generate -method. showedituser: function(...

c# - I got points on a map.Getting all independent inner polygons that are formed? -

i got points on map , lines connecting points. how independent inner polygons formed? the linked picture describes problem. http://i.imgur.com/0lda3ji.jpg i'm supposing need tree search algorithm enumerates points , connecting lines in tree structure , searches cycles job kinda on head. in perfect world example in c#.) i found: finding cycles in undirected graphs but not mark independent polygons. finds possible polygons overlapping ones. i'm using google maps. use case is: detect clicks on map , draw points. detect click on points , lines between points. need automaticaly generate polygons lines , points. sure can draw polygons. dont know ones (what coordinates - or rather: points choose polygon) i have no experience in graphics , how colour polygon once you've found it, assuming: you have polygons themselves. they not patialy overlap or other weird behaviour. then colouring pseudo code go this: while listofpolygons not empty

linux - Can any one help me in writing a script for the following scenario -

can 1 me in writing script following scenario!! usera belongs groupa , usera has access "groupa" filesystem userb belongs groupb , userb has access "groupb" filesystem userc belongs groupc , userc has access "groupc" filesystem userd belongs groupd , userd has access "groupd" filesystem note:- group name , filesystem identical. help me in writing script, when user logs in, group name identified , execute df -h */group_name* for example:- if usera logs in, need o/p of "df -h /groupa" [root@server5 ~]# df -h /groupa filesystem size used avail use% mounted on /dev/groupa 601t 477t 125t 80% /groupa [root@server5 ~]# need write write putting logic, everytime user login system, script need run , produce output on his/her terminal. trying provide information user filesystem utilization. can done putting script inside /etc/profile.d/ directory. user information can taken $user variable , group i

Get a PHP var with other PHP var -

i know title not describing problem well, explain here: have multiple $_post similar names, question1,question2,question3... i have loop $i. want vars ($question1, $question2), in $i. example: $question.$i = $_post['question' . $i]; i want because number of questions variable, have button add questions , answers page , submit it. first, need make explicitly $question array. build $_post index concatenating string , $i . . so, before loop: $question = array(); and in loop: $question[$i] = $_post['question'.$i];

mysql - Using SQL joins to determine order of a post -

i trying fetch forum topics based on amount of replies has been submitted topic. new understanding how sql joins work, though have been using sql awhile in general, though feel on right track. have query: select * `topics` inner join ( select count(tid) countedreplies,`tid` `replies` group `tid` ) on topics.id = replies.tid order replies.countedreplies desc table structures this: topics id topic name 1 filler topic name 2 exciting posts excellence 3 random name example replies id tid post 1 3 hooray! wonderful! 2 3 post topic id 3 well! 3 1 topic 1 better topic 1. my expected result i getting nothing in return, though trying this: 1. random name example 2. filler topic name 3. exciting posts excellence you can use left join without involving sub select select t.* `topics` t left join `replies` r on t.id = r.tid group t.id order count(r.tid) desc demo

Validate polymer input on data observation -

i'm trying make dynamic validation on polymer app want make #login-button button attribute disabled when inputs empty , remove attribute when imputs filled id , password. tried make html5 required attribute solution doesn't work. created button-click function hit api , want add validate function. <form id="form_login"> <paper-input aria-required="true" name="name" floatinglabel label="id*" value="{{name}}"></paper-input> <br> <paper-input-decorator floatinglabel label="password"> <input aria-required="true" id="password" is="core-input" name="password" type="password" value="{{password}}"/> </paper-input-decorator> <br> <div class="page-holder" horiz