Posts

Showing posts from September, 2013

delphi dataset clear datetime field -

though can set current date : dataset['my_date'] := now; it's unclear me how clear field. tried: dataset['my_date'] :='' but wont work. suggestion ? db sqlite. the entire code how used : procedure tdatamodule1.sal_twitterbeforepost(dataset: tdataset); begin if sal_twitter.fieldbyname('managed').asboolean = true begin dataset['uredil'] := uniquery4.fieldbyname('sotrpin').asstring; dataset['urejeno_kdaj'] :=now; end else dataset['uredil'] := ''; //dataset.fieldbyname('urejeno_kdaj').clear; <----- not work end; the problem is, empty string doesn't represent date field can set. in particular, tdatasets not treat equivalent setting database field null, people mean when refer "clearing" field. instead do: dataset.fieldbyname('my_date').clear;

python - NTLM authentication with Scrapy for web scraping -

i attempting scrape data website requires authentication. have been able login using requests , httpntlmauth following: s = requests.session() url = "https://website.com/things" response = s.get(url, auth=httpntlmauth('domain\\username','password')) i explore capabilities of scrapy, have not been able authenticate. i came across following middleware seems work not think have been implementing properly: https://github.com/reimund/ntlm-middleware/blob/master/ntlmauth.py in settings.py have spider_middlewares = { 'test.ntlmauth.ntlmauthmiddleware': 400, } and in spider class have http_user = 'domain\\user' http_pass = 'pass' i have not been able work. if has been able scrape website ntlm authentication can point me in right direction, appreciate it. i able figure out going on. 1: considered "downloader_middleware" not "spider_mi

html - What's the best data structure for output that's processed by Python? -

my client has text files output tab delimited data , html table chunks. system takes these html table chunks , sticks them in html template file. looking @ outputting data json or xml, , separating out views functions. i've done bunch front-end processes. difference me here i'm processing data on server-side , outputting simple html, instead of populating via javascript. tendency towards json, since outputting few other files in system way. json best bet. python has excellent json library can provide native python objects 1 function call. docs: >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', none, 1.0, 2]}] just save output of json.loads variable , you're off , running.

android - Java - Drawing bitmaps is laggy -

Image
i drawing bitmaps screen using canvas , view. when open screen series of lags on positioning of image (almost if watching computer think place points). first this: then: and finally: i understand it's kind of hard description have given if has idea please tell me! edit: public class losescreen extends view { @override protected void ondraw(canvas canvas) { paint.setcolor(color.green); canvas.drawbitmap(box, null, menubox, null); menubox.set(screenwidth / 2 - menuwidth / 2, screenheight / 2 - menuheight / 2, menubox.left + menuwidth, menubox.top + menuheight); tryagainbounds.set(screenwidth / 2 - tryagainwidth / 2, menuheight / 2, tryagainbounds.left + tryagainwidth, tryagainbounds.top + tryagainheight); canvas.drawtext(" score:", 100 * density, menubox.top + 150 * density, finalscorepaint); canvas.drawtext(finalscorestring, 225 * density, menubox.top + 150 * density, finalscorepaint); canvas.drawtext("hi

mysql - SQL CAST(int as varchar) throws error -

good evening, i'm trying convert int varchar using cast() function gives me following error: syntax error, unexpected varchar and code cast(p2v varchar) and tried cast(p2v varchar(max)) i got same problem when try using convert() it must char , not varchar the type result can 1 of following values: binary[(n)] char[(n)] date datetime decimal[(m[,d])] signed [integer] time unsigned [integer] from http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html#function_cast

javascript - FLOT Chart xAxis time -

i using flot chart charts. please find following... js array data_visits = [ [new date('06/02/2014 01:00').gettime(), 100], [new date('06/05/2014 10:00').gettime(), 200], [new date('06/10/2014 13:00').gettime(), 300], [new date('06/15/2014 15:00').gettime(), 400], ]; chart code if($('#flot_overview').length) { var chart_placeholder = $('#flot_overview'); var options = { grid: { clickable: true, hoverable: true, autohighlight: true, backgroundcolor: null, borderwidth: 0, color: "#666", labelmargin: 10, axismargin: 0, mouseactiveradius: 10, minbordermargin: 5 }, series: {

Freebase MQL Query for Movie title in german Language -

i trying find way how query freebase movie title in other english language, know freebase has data, found query return german title mql, how can other stuff starring, imdv id etc.. i played around mql console , tried various settings, either properties unknown or freebase doesn't understand sheme anymore "film/film due wrong settings, "lang":"de" doesn't make changes, or returns empty result, idea use allies section couldn't figure out how filter out... thx help

ruby - Recursion and order of statements execution -

this question deals how statements , involving recursion executed, , in order ruby handle the,. specifically, i've been learning online, have found ruby not follow last in first out convention in stack form of memory-management, rather has garbage collector. have numbered questions @ bottom after code. hope have made clear, please let me know parts of question may need improvement. thank you. def append(array, n) return array if n < 0 #base case, how end thing array << n*2 #line no. 1 append(array, n - 1) #line no. 2 array << n*2 #line no. 3 end append( [], 3) #output [6,4,2,0,0,2,4,6] the 2 lines below give output of [6,4,2,0] array << n*2 #line no. 1 append(array, n - 1) #line no. 2 when order of 2 statements reversed output [0,2,4,6] append(array, n - 1) #line no. 2 array << n*2 #line no. 3 in original append method (top section of code), why ruby stop compute @ first recursive call, contin

C# compiler does not limit the number of digits of fractional part of a floating-point literal -

this academic purpose. i noticed integral literals, can declare 18446744073709551615 2^64-1 or ulong.maxvalue . defining greater value produces compile-time error. and floating-point literals, can declare them integral part 999...999 ( 9 repeated 308 times). declaring integral part more digits again produces compile-time error. 1 thing interests me compiler seems allow specify fractional part unlimited number of digits. practically, unlimited number of digits fractional part not make sense. questions: is there constant representing max number of digits internally defined c# compiler fractional part of floating-point number? if such constant exists, why not c# compiler throw compile-time error when users specify fractional parts beyond limit? minimal working example 1 namespace floatingpoint { class program { static void main(string[] args) { const ulong @ulong = 18446744073709551615; const double @double = 99999999

frontend - Magento configurable product not showing all posible combinations -

i using attribute set jeans products have waist size, inseam , color. managed add products configurable product options don't show in front end. add options attributes , linked single products configurable product. first product created shows correct attributes second 1 doesnt, instead shows same options first product when options added single products. this product in question: http://geveysim.net/valleybigandtall/index.php/copper-cove-big-and-tall-stonewashed-denim-jeans.html this product showing correctly: http://geveysim.net/valleybigandtall/index.php/casual-wear/jeans/greystone-big-and-tall-570-cargo-jeans.html 01) check quantity in simple products , make in stock 02) after changed go configuration , re-index

java - how to go through a List of Object -

i'm not novice java , today sucked problem 1 hour, don't know why . my code looksas follows: my arraylist: private arraylist<theme> selectedthemes; my loop: for (theme selectedtheme : selectedthemes) { system.out.println(selectedtheme.getnom()); } when try execute code below , receive exception : java.lang.classcastexception: java.lang.string cannot cast com.mycompany.ecommerce.modele.catalogue.theme what understand exception selectedtheme string , werd me. note when execute code : system.out.println(selectedthemes); it show object of list normally. edit i'm not sure if code have relation issues:it's selectmanymenu has relation arraylist <p:selectmanymenu id="advanced" value="#{jsfclient.selectedthemes}" var="t" showcheckbox="true"> <f:selectitems value="#{jsfclient.themes}" var="theme&quo

multithreading - Rails engine creates circular dependency fault -

i have app rails engine use. i've stripped them down pretty bone, fault when start engine multi-threading enabled. faults out missing constant model name i'm calling controller. i've reduced down calling model.all.pluck(:id). , still fault. models being invoked via ajax call controller. the app runs correctly if refresh page , continue, never faulting out again, can see. i think it's multi-treading issue, i'm using rails 4.1, ruby 2.12 , puma 2.8.2 , postgress. this happening on development system macbook. don't see in heroku logs when deploy, ?? now curious. i've made issue go away, forcing app load each model in engine, 1 @ time. things seem run smoothly after that. any suggestions on how dubug this this directly linked config.eager_load settings of app. in production set true not have circular dependency problem, in development set false , that's rails auto loading systems may trigger kind of error. i believe (though

Can't execute a specific program via PHP to digitally sign a file -

i'm using iis 6.0 , php , i'm trying write php script automates process 1) create installer , 2) digitally sign installer. i've created batch file each individually. if go server , manually run batch files, both work perfectly. if run them via php, installer created never digitally signed. have confirmed that: all files referenced in batch files have full rights iusr_[computer-name] user. it not issue file not being created yet first batch file. can put created setup.exe file in folder , run second batch file via php same results. the batch file getting run. i've put mkdir command in same batch file after digital signing command , folder created. the code use via php run batch files is: system('cmd /c c:\\inetpub\\createinstallers\\step1.bat'); the create installer batch file looks this: "c:\program files\inno setup 5\iscc.exe" c:\inetpub\createinstallers\createinstaller.iss i'm using inno setup found here: http://www.jrsoftware

winforms - Specified cast is not valid -

i tried best cast value how keep getting exception. hope 1 guide me in right path. here code this type service public enum channelcodetype { /// <remarks/> a1, /// <remarks/> a2, /// <remarks/> a3, /// <remarks/> a4, } in winform have list box generate these channels ,i try cast selected channels in list box , pass channel type gives me hard time. channelcodetype[] channelcodes; channelcodes=lbsearch.selecteditems.tostring().cast<channelcodetype>().toarray(); then tried below failed string[] destination = new string[lbsearch.items.count]; lbsearch.items.copyto(destination, 0); channelcodes = destination.cast<channelcodetype>().toarray(); in both way keeps complaining cast not valid. channelcodes = destination.select(e => (channelcodetype)enum.parse(typeof(channelcodetype),e)).toarray(); try above. the problem current approach can't cast string enum directly.

How to use char in C -

i'm struggling char work. keeps returning error. #include <stdio.h> #include <cs50.h> int main (void) { int tower_height; char #; // inputs { printf("let's build! give me number between 0 , 23 'inclusive'.\n"); tower_height = getint(); } while (tower_height < 0 || tower_height > 23); // outputs (tower_height = 0; tower_height <= 23; tower_height++) printf ("%c = tower_height - 2\n"); } as pointed out, # not valid variable name. can see how # used in first line of code: #include <stdio.h> instead, call char variable uses letters , numbers eg: char c;

php - Xpath: Use a variable in an Xpath string -

i new xpath sorry if silly question, it's been driving me nuts. have xml file looks this: <itemlist> <item id="01"> <color>red</color> <type>box</type> <material>metal</material> </item> <item id="02"> <color>blue</color> <type>cone</type> <material>wood</material> </item> </itemlist> when run following, error "notice: trying property of non-object " $id = $_get['code']; $doc = new domdocument; $doc->validateonparse = true; $doc->load('file.xml'); $xpath = new domxpath($doc); $color = $xpath->query("//itemlist/item[@id='" . $id . "']/color"); echo $color->item(0)->nodevalue; as far can tell, syntax wrong i'm trying insert variable. tried '" + $id + "' same error. appreciated.

javascript - Adding .animate that changes backgroundColor of a span inside link tag doesn't work -

i trying make span class="term-name" animated in way in changes backgroundcolor randomly set predefined colors/hex here html tag. <ul id="filter" class="group"> <li> <a class="art-direction" href="#" title="view items filed under art direction"> <span class="term-name">art direction</span> <!-- start .term-count --> <span class="term-count">4<span class="triangle-down"></span></span> <!-- end .term-count --> </a> </li> <li> <a class="brand-strategy" href="#" title="view items filed under brand strategy"> <span class="

Amazon Web Services GPU G2 -

today got setup aws gpu g2 instance (g2.2xlarge). wanted test out 3d hardware capability offered mentioned here http://aws.amazon.com/ec2/instance-types/ features: high frequency intel xeon e5-2670 (sandy bridge) processors high-performance nvidia gpu 1,536 cuda cores , 4gb of video memory on-board hardware video encoder designed support 8 real-time hd video streams (720p@30fps) or 4 real-time fhd video streams (1080p @ 30 fps). support low-latency frame capture , encoding either full operating system or select render targets, enabling high-quality interactive streaming experiences. but when tried running 3dmark 2011 try things out. got exception "no dxgi adapters found" noticed, dxdiag says no hardware acceleration available. so im bit puzzled why dont see nvidia gpu 1500+ cuda cores. also, great if azure offered 3d compute capabilities. to answer own question, there setup required before gpu can used. 1 needs install nvidia g

Semaphores in C Linux Programming -

i'm taking on c code running in linux (centos) extensive use of semaphores. way code written : ./program1 this program launches bunch of processes makes use of mutexes , semaphores. ./program2 this program launches bunch of processes makes use of mutexes , semaphores. i've realised program1 , program2, make use of semaphores same names. in linux c programming, can different programs use same semaphores? guess no, same naming confusing hell out of me. using same source code launch , handle semaphores. the semaphores invoked using following commands: semget semctl semop i've read these called processes semaphores.. if program1 creates semaphore1, can program2 access semaphore1? appreciate here, thanks! assuming mean named semaphores (or unnamed semaphores stored in shared memory, both can created sem_open ), are shared amongst processes. semaphores using semget , related calls use id key rather name usage patterns similar. semaphores 1

momentjs - Moment js not working as expected -

i have date object: sun apr 20 2014 11:48:33 gmt-0400 (edt) i want able render 3 letter month , date, such "apr 20" i trying use moment.js accomplish task, so: moment(date_var).format('mmm d'); which spits out: "jun 25" instead of expected "apr 20". running: json.stringify(date_var) produces: 2014-04-20t15:48:33.000z thanks demo: http://jsfiddle.net/nfmns/3/ html: <strong>javascript </strong><span></span> <br/> <strong>moment </strong> <p></p> code: $(function(){ var day = new date(2014, 4, 20,11,48,33); moment().format(); var mome=moment(day); $('span').text(day); $('p').text(mome.format("mmm d")); });

python - multiprocessing.Event.wait hangs when interrupted by a signal -

i use following code handle sigint event. code sets multiprocessing.event "wakeup" main thread waiting. import multiprocessing import signal class class1(object): _stop_event = multiprocessing.event() @staticmethod def interrupt(): class1._stop_event.set() def wait(self): print("waiting _stop_event") if class1._stop_event.wait(5): print("_stop_event set.") else: print("timed out.") def stop(signum, frame): print("received sig") class1.interrupt() signal.signal(signal.sigint, stop) c = class1() c.wait() without signal, wait method times out after 10 seconds , process exits following output expected: waiting _stop_event timed out. when sending sigint signals, signal gets handled event.wait method not return, neither nor after timeout. process never exits. output is: waiting _stop_event ^creceived sig i can continue send sigints. process

java - How to build a custom connector using mulesoft that takes and gives out an argument? -

i trying build connector using mulesoft anypoint studio , have created sample connector project , build it. my question how build connector takes 1 parameter , gives out parameter result? link or idea helpful. you should use @processor annotattion, , create desired input , output through java method signature

javascript - How to inserting a document with field referencing document in another collection -

i attempting create .post function schema document reference. however, not sure how can retrieve objectid of document reference collection. board.js var mongoose = require('mongoose'); var schema = mongoose.schema; var boardschema = new schema({ boardname: string, userid: {type: schema.objectid, ref: 'userschema'} }); module.exports = mongoose.model('board', boardschema); user.js var mongoose = require('mongoose'); var schema = mongoose.schema; var userschema = new schema({ username: string }); module.exports = mongoose.model('user', userschema); routes.js router.route('/boards') .get(function(req, res) { board.find(function(err, boards) { if(err) res.send(err); res.json(boards); }); }) .post(function(req, res) { var board = new board(); board.boardname = req.body.boardname; user.find({username: req.body.username}, function(err, user) {

core data - Convert NSArray to Swift Array<T> -

in coredata have defined ordered to-many relationship. relationship defined in swift this: @nsmanaged var types : nsmutablearray however, use swift @ it's best, want use normal swift array type[] . however, coredata forces me use ns(mutable)array . how can type-cast / convert nsarray array<type>[] ? apparently confusion arises following error: let array = obj.types t[] // cannot convert expression's type 'node[]' type '$t2' while accepted editor: let array = obj.types anyobject[] t[] // no complaint i'm using obj.types.allobjects type[] , feels hack/workaround. then revise feelings. you're doing how do "type-cast / convert nsarray array<type>[] ." an nsarray arrives swift containing anyobject (i.e. array<anyobject> , aka anyobject[] ). casting down specific type, if know contains 1 type, you, , how doing supposed do. edit in swift 2.0 , new ios 9 apis, nsarray arrive correctly typed, ,

Excel - formula for two workbooks -

i have sheet 1 in workbook 2 has numbers in column , locations numbers in column b. type number in column in workbook 1 sheet 1 , find number on workbook 2 sheet 1 column automatically put location in corresponding column b cell on workbook 1. want type number in column , tell me location in column b master list (workbook 2). possible? know both workbooks have open. you can use vlookup formula in wb 1 sheet 1 cell b1 (assuming number in a1) this: =vlookup(a1,'[workbook 2.xlsx]sheet1'!$a$1:$b$50,2,false) if range not fixed number of rows, can swap $a$1:$b$50 a:b. this assumes each number exists once in column of workbook 2, sheet 1. create cell reference both workbooks open, won't need workbook 2 open reference work after (the full file path referenced). hope helps

node.js - NodeJS process disconnects on SSH session logout -

i doing ssh on server, ubuntu 14.04 server. tried various things keep node server running. type exit , disconnect server ubuntu desktop node server disconnected. though running on server. when ssh server can access it. i have tried these : nohup node server.js & nohup node server.js > /dev/null 2> error.log < /dev/null & sudo nohup supervisor server.js & forever start server.js also tried using tmux , screen. same problem of these. disconnect ssh node server not available. when login server, available again. what missing? though running on server seems contradict as disconnect ssh, terminates are doing special ssh session? ( forwarding server port client ) how check if server running? possible reasons: 1) test using server's localhost when on server , server ip client: check binding server "0.0.0.0" address , not 127.0.0.1 2) have kind of port forwarding , connect server vi client localhost:forvarded_port

listview - What is the first Listitem being shown on screen in android. -

Image
i have listview having many of list items . when app launches, first item item becomes top/first element see on screen. when scroll-down , of lower list-item becomes first see on screen. there anyway find element on top of screen @ moment. may should try use getfirstvisibleposition() method of listview. returns number of first visible item. number can first. note considers partially hidden items visible.

jaspersoft studio - How to up and run java code in JasersoftStudio? -

i know if possible. used jaspersoftstudio, noticed when creating new project folder came jre library. see java editor in there well. possible write , run java code in jaspersoftstudio gui? please share ideas on here. regard, sakura as may have noticed, jaspersoft studio repackaged eclipse. , yes possible run java code in it, it's bit more cumbersome in vanilla eclipse. in of jasper projects (the project icon in explorer should have little j ), right click , open properties. in java build path , add new source folder. in new folder, create new file, , put main class in it. you can run keyboard shortcut alt-shift-x j . don't know if there's menu too. additionally if have existing eclipse project, can import directly jaspersoft studio using import... existing projects workspace .

php - How to access all table data in many many relationship laravel -

i have 3 tables. 1.posts 2.categories 3.category_post. my posts tables here : +------------+------------------+------+-----+---------------------+----------------+ | field | type | null | key | default | | +------------+------------------+------+-----+---------------------+----------------+ | id | int(10) unsigned | no | pri | null | auto_increment | | title | varchar(255) | no | | null | | | slug | varchar(255) | no | | null | | | reporter | varchar(255) | no | | null | | | meta | varchar(255) | no | | 0 | | | body | text | no | | null | | | image | varchar(255) | no | | 0 | | | top | tinyint(1) | no | | 0

performance - What is the fastest available color quantization algorithm for Android? -

i'm using neuquant quantization algorithm ( https://code.google.com/p/android-gif-project/source/browse/trunk/gifproject1/src/com/ui/neuquant.java?r=5 ) reduce jpeg 256-color image it's slow (~1 second 320x240 image, ~3 seconds 640x480). multiple threads can't processing time decent level (ideally in 100ms per image range). does know faster algorithm reduce color palette of image 256 colors? extracting 256 colors of edge case, should have @ median cut quantization. here implementation : github link option octree . should bench both solutions though , ways improve them. additionally, running algorithm through renderscript might allow speed lot.

luabind - c++ to lua to c++ -

i have problem luabind, or @ least expect problem i have entity class ive registered lua, ideally want subclass , override functions, there want send c++ , store it additionally want able call new functions c++ stored object/pointer however im struggling c++ take object of type centity* back? in lua script can load class, call variables , functions, try , send takeclass or takeboject comes out blank class nothing set on it for example foo->name "" rather "entity1" , id 0 rather 1 anyideas im doing wrong? ive searched on google @ least week no luck of understanding problem , halting progress on project? //####################################################################### // test function //####################################################################### void luatest::takeclass(centity* foo) { cout << foo->name << endl; } void luatest::takeobject(luabind::object foo) { centity* foobar = luabind::object_cast<

user input - PHP if and else statement -

i have form shows users results based on location. when page loads, php shows results based on userip location comes geoip script works fine. ip location gets stored in $location variable. but, want allow user change location based on zip code provides in input text field , clicks submit. here php: $geo = geocheckip($_server['remote_addr']); if (isset($geo) && ($geo != "not found, not found")) { $location = $geo; } else { $location = (isset($_post['location']) ? $_post['location'] : ''); } the form: <form action="/" method="post"> <div class="postal"><input name="location" id="postal" type="text" value="<?php echo $location; ?>" placeholder="postal code or city, state"></div><div id="example">ex.: san francisco, ca</div><div class="search"><input na

c# - Check if string contains string from an array then use that in LastIndexOf method -

i want check if input string contains 1 of 3 strings , use later on. here's have far: // example of 1 out of 3 possible variations string titleid = "document period ended 31 march 2014"; // array values represent 3 possible variations might encounter string s1 = "ended "; string s2 = "ended "; string s3 = "ending "; string[] sarray = new [] { s1, s2, s3}; if(sarray.any(titleid.contains)) { takeendperiod = titleid.substring(titleid.lastindexof(string)); } i want check string array has contains method found , use 1 in lastindexof method. on right track here? edit: sorry confusion here. titleid.lastindexof(string) <- string dummy , represents i'd achieve here. using contains method check 1 of values f.eg. if(titleid.contains"ended ") , i'd titleid.lastindexof("ended "). have 3 separate blocks each based on "ended", "ended" or "ending" using each 1 in lastindexof met

cakephp 2.5.1: catching misspelled function calls -

i have api wirtten , gave out instructions how it. example test login can call /api/login now see in logs, keeps calling /api/login , gets error 500. is there somehow way, catch such errors when calling /api/ controller functions? in case, send response error. wrong function call . not want send in general when error 500 happens. when /api/ related. the error gets reported belongs fact calling in appcontroller::beforefilter() function $this->api->check($username) and error when debug=2 call member function check() on non-object when call /api/login/ functions works perfect. i forward tips! thanks! the problem facing isn't casing of action (in php method names case insensitive), casing of controller. won't find apicontroller , therefore throw missing controller exception. appcontroller being invoked being extended cakeerrorcontroller used on errors. i can assume $this->api refers model, , since actual controller cakeerrorcontroll

android - How to open a URL natively in an app without using webview -

is there way open url in application without using webview? right i'm opening url in webview using code below: startwebview("https://maps.google.com/maps?saddr=" +mgps.getlatitude() + "," +mgps.getlongitude() + "&daddr= 28.878444,77.133497&spn=1&t=m"); private void startwebview(string url) { //create new webview client show progress dialog //when opening url or click on link wv.setwebviewclient(new webviewclient() { //progressdialog progressdialog; //if not use method url links opeen in new brower not in webview public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); return true; } //show loader on url load public void onloadresource (webview view, string url) { } public void onpagefinished(webview view, string url) { } }); wv.getsettings().set

android - Why multiple apks created wth Adobe air 14 in flash professional having issues? -

i having multiple apks created wth adobe air 14 in flash professional having issues when submitting play store. my research http://developer.android.com/training/multiple-apks/screensize.html here says, version code needs modified in air-android manifest version code not shown, if add forcefully shall put tag? anyone has faced same issues before? you can't modify manifest version code in app descriptor file. it's 1 of manifest's attributes air doesn't let modify. http://help.adobe.com/en_us/air/build/wsfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffc.html you should try supporting different screen sizes within same apk. can refer article more info http://www.adobe.com/devnet/air/articles/multiple-screen-sizes.html

jquery - Populate a dropdown list based on the another dropdown list using AJAX JSON -

i know question has been asked many before not exact solution resembles question. i have dropdown list called category , dropdown rather sub 1 called grade. select category(lets select tv out of radio,washing machines,dvd players etc.), corresponding grades category(lets tv - sony, hitachi, samsung, philips..) should populate on grade dropdown. both categories , grades being fetched database , queries working perfectly. ajax:- <script> function getgradedetails(category){ if(category!==""){ var request = $.ajax({ url: "../controller/sales.php", type: "post", data: {category:category,action:'get_grade_details'}, datatype: "json" }); request.done(function(json_return){ //alert(json_return['grade_desc']); $( "#grade" )

javascript - Using Jquery fadeout for page transition -

hello , thank in advance solutions. i've been trying add fade in , fade out function when users switching through pages. have tried many solutions found here , on other forums none of seems work fade out. fade in works fine had add .ghostly body tag. nothing have done has worked fadeout. appreciated i'm new coding. <script src="http://code.jquery.com/jquery-latest.js"></script> <style> .ghostly { opacity: 0; } </style> <script> $(document).ready(function() { $('.ghostly').animate({ opacity: '1' }, 3000); }); $("a").click(function(event) { event.preventdefault(); linklocation = this.href; $("body").fadeout(1000, redirectpage(linklocation)); }); function redirectpage(link) { document.location.href = link; } </script> 1. fadeout firing immediately! when click anchor, next page start l

jquery - How to clear cookies in javascript without keeping any expiry time -

this question has answer here: how delete cookie? 6 answers how clear cookies out keeping expiry time. i have created cookie this document.cookie = "visited=yes"; i need remove cookie. how can that..? thanks in advance usually update cookies expiry time delete it. document.cookie = "expires=thu, 01 jan 1970 00:00:00 gmt"; you can write empty cookie reset it's values: document.cookie = "key="; http://www.w3schools.com/js/js_cookies.asp

android - updpacket.send throws exception -

here code dont know why udp_packet.send(outgoing); throws exception int serverport = 9876; inetaddress server_ip = inetaddress.getbyname("127.0.0.1"); // send udp packet datagramsocket udp_packet = new datagramsocket(serverport); udp_packet.setbroadcast(true); string fxx = latcrd.gettext().tostring(); string fyy = longcrd.gettext().tostring(); string str = fxx + "," + fyy; byte[] b = str.getbytes(); datagrampacket outgoing = new datagrampacket(b, b.length, server_ip, serverport); try{ udp_packet.send(outgoing); } catch(exception e) { e.printstacktrace(); } prevoiusly ok stop working , dont knw whats problem okay got answer of own question. sending ud

java - First time making a REST service, calling from android -

i've started learning android programming , how create restful web service. made simple yahtzee game android , expand knowledge on both platforms wanted implement 2 player system using restful service. i made service in asp.net mvc code below request url/games/2 return: <game> <id>2</id> <p1>100</p1> <p2>99</p2> <turn>1</turn> </game> all want able create new game calling post , use check if turn yet , when finish turn using put update game, changing score , turn other players request let client know turn. know basic 2 player functionality it's i'm trying learn process. have game object in android i'm not sure how proceed. direction i'm working on @ moment httpclient post looking like: httppost httppost = new httppost("url/games") but don't see how pass parameter. post method in service takes game object parameter. if give me advice appreciate it. model, game.cs:

three.js - how to apply shadow on full object in threejs -

i want apply shadow on full object using threejs, if rotate object shadow must object, meaning want apply shadow hole object, tried spotlight , no luck doesn't changes on object, here below code light = new three.spotlight( 0xffffff ); light.position.set( 200, 200, -200 ); light.castshadow = true; light.shadowmapwidth = 1024; // power of 2 light.shadowmapheight = 1024; light.shadowcameranear = 200; // keep near , far planes tight possible light.shadowcamerafar = 500; // shadows not cast past far plane light.shadowcamerafov = 20; light.shadowbias = -0.00022; // parameter can tweak if there artifacts light.shadowdarkness = 0.5; light.shadowcameravisible = true; scene.add( light ); did tried set object.receiveshadow = true; on object on shadows should rendered ?

Trying to transpose the matrix from a 3x4 to a 4x3 in python -

i have read file command line, , set matrix rows , cols. when run program(below): python3 transpose.py matrix 3 4 (current code below) (file numbers 1 2 3 4 5 6 7 8 9 10 11 12 13) (matrix row,cols) printed should return: the empty matrix is:[[0,0,0,0],[0,0,0,0],[0,0,0,0]] original matrix is: 1 2 3 4 5 6 7 8 9 10 11 12 transposed matrix is: 1 5 9 2 6 10 3 7 11 4 8 12 here transpose.py ive spent around 10 hours on , can't work, can't figure out else do! import sys scanner import * def main(): readinput(sys.argv[1],[2]) size = 3 rows = size cols = rows makelist(size) matrix(rows,cols) manipulatematrix(matrix(rows,cols)) print(manipulatematrix(matrix(rows,cols))) print("the original matrix is: ") displaymatrix(manipulatematrix(matrix(rows,cols))) transposesquare(manipulatematrix(matrix(rows,cols)),size) print (transposesquare(manipulatem

c# - Couchbase custom deserialization -

i have class need serialize json in couchbase in custom manner. like: var converters = new[] { new customconverter() }; var json = jsonconvert.serializeobject(myobject, jsonconverters.toarray()); var result = _couchbaseclient.executestore(storemode.add, id, json); but how can deserialize again, using customconverter ? want retrieve json , deserializing myself. realize there's executeget method, i'd work via view. is possible? i've tried add converter jsonconvert.defaultsettings doesn't seem use it. keep getting jsonserializationexception . i'm guessing couchbase resets settings, or uses own. digging couchbase code, found it. couchbase has extension methods use own settings. can see on github : public static class couchbaseclientextensions { public static jsonserializersettings jsonserializersettings; static couchbaseclientextensions() { jsonserializersettings = new jsonserializersettings { co