Posts

Showing posts from August, 2010

java - Auto Login To a Site -

i'm trying create kind of script login , click on link on site. i've included login script main site , wondering if of tell me how enter username , password code way when load site, automatically loads. or if make script work click link amazing. <table width="100%" cellpadding="0" cellspacing="0" border="0" class="skin-customlogintable"> <tr> <td class="skin-customloginleftside"> </td> <td class="skin-customloginrightside"> <div class="skin-customloginwrapper"> <div class="skin-customlogininnerwrapper"> <table cellpadding="0" cellspacing="0" class="skin-customloginformtable"> <tr> <td><label>user name</label></td> <td><label>password</la

objective c - how to make an object move by touching it in iOS -

i newbie in objective-c , trying make simple app in when touch object move randomly while , stops. need touch again move again , stop after while. i have searched touch method , tutorials, problem don't know how start. need function move object , 1 touch it, don't know how connect them , use them. here tutorial helped me lot view of functionality , function in opposite way of app. still can not start programming on own. http://xcodenoobies.blogspot.se/2010/11/under-construction.html any appreciated, regarding how program logic , how find right methods , how find type of variables need. step 1: put code in viewdidload method, in have created uiimageview , add view randomly [self.view settag:1]; for(int i=0;i<4;i++) { int x = arc4random()%300; int y = arc4random()%400; #warning set image here uiimageview *imgview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"someimage.png"]]; [imgview setframe:cgrectmake(x, y, 2

javascript - Why I can't detect Media Queries in IE9 using modernizr -

i searched support of css3 media queries in browsers, , ie9+ support it, http://caniuse.com/css-mediaqueries , when use modernizr detect it, turns out, ie7-ie9 not support it, ie10 support it. : generate custom modernizr js: http://modernizr.com/download/#-mq-teststyles-load html code: below code in html head, want detect if browser support min-width media query use, if support, add support.js, if not, include nosupport.js <script src="modernizr.custom.03829.js" type="text/javascript"></script> <script> modernizr.load({ test: modernizr.mq('(min-width: 0px)'), yep: 'support.js', nope: 'nosupport.js' }); </script> in support.js: alert("support"); in nonosupport.js: alert("not support"); result: ie7-ie9 alert "not support", in ie10, alert "support". think ie9 should alert "support", right? there wrong code? another weird th

javascript - if last li then set click event on it -

this xslt file:- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" indent="yes" omit-xml-declaration="yes"/> <xsl:template match="*" mode="item"> <li onclick="final()"> <xsl:value-of select="@value" /> <xsl:apply-templates select="current()[*]" /> </li> </xsl:template> <xsl:template match="*/*/*"> <ul> <xsl:apply-templates select="*[1] | node()[current()/ancestor::*[3]]" mode="item" /> </ul> </xsl:template> </xsl:stylesheet> this xml file:- <?xml-stylesheet type="text/xsl" href="a.xsl"?> <root> <child_1 entity_id = "1" value="game" parent_id="0"> <child_2 enti

alertdialog - In Android multiple checkboxes, checkbox Remain checked that I have selected even when close my app -

i have 3 checkboxes in alertdialog. want when click on sencond checkbox remain checked until user desn't click on other checkbox per his/her convince. here code please provide sugestions. edit: means 1 checkbox remain clicked application closed user. my code: case sync_alert: alertdialog.builder alertbuilder = new alertdialog.builder(this); alertbuilder.setmessage("synchronization"); alertbuilder.setcancelable(false); layoutinflater buildinflater = this.getlayoutinflater(); view syncview= buildinflater.inflate(r.layout.sync_layout, null); alertbuilder.setview(syncview); defaultchkbox = (checkbox)syncview.findviewbyid(r.id.defaultchkbox); after15mint = (checkbox)syncview.findviewbyid(r.id.after15mint); afternmint = (checkbox)syncview.findviewbyid(r.id.afternmint); alarms = (alarmmanager) getapplicationcontext().getsystemservice(context.alarm_service); alertbuilder.setpo

java - How to cancel call to oracle stored procedure? -

i have java application, searches records in oracle on click of search button. calls stored procedures search data in oracle tables. search output large , takes lot of time process, want implement cancel button operation can cancelled @ time. thought of implementing separate thread in java wont solve problem because stored procedure called. how can achieve this? you should create stored procedure contains kill command cancel running store procedure , call new sp cancel button. for killing running sp refer this: how terminate oracle procedures running

karma runner - Angularjs e2e testing past/future comparisons -

i'm trying figure out if there way simple future/past comparison ex. 1) check state of list getting list length 2) perform action if success increments list 3) compare current list length past. but concepts of futures seems in way. 1 think pretty normal use case. q: how go handling past/future comparisons in angularjs scenario? it's kind of longwinded, can define custom matchers understand futures. example: angular.scenario.matcher('tobegreaterthanfuture', function(future) { return +this.actual > +future.value; }); use like: listlengthbefore = repeater('.td').count(); // stuff. listlengthafter = repeater('.td').count(); expect(listlengthafter).tobegreaterthanfuture(listlengthbefore);

actionscript 3 - FLASH/AS3: Getting error on removing child. Parameter child must be non-null -

i'm trying remove movieclip says parameter child must non-null. this script: to make in stage, use: function sayam (e:mouseevent):void{ nilai = 8; if(nilai == temp) { var ssayam:ayam_mc = new ayam_mc stage.addchild(ssayam); ssayam.x = 350.0; ssayam.y = 330.0; ssayam.width = 170.0; ssayam.height = 170.0; ssayam.instancename = "ayam"; arnam.push("ayam"); trace("arnam" +arnam); trace(ssayam.instancename); jual = jual + 4000; temp = val[len-(len-len2)] len2 = len2 + 1; } else { money = money - 4000; } } so, made 8 functions make 8 movieclips display in stage , push them array. array "arnam". and remove code: function deleteburger() { for(var i:number=arnam.length; >= 0; i--){ removechild(arnam[i]); arnam.splice(i,1); } } i've traced array , is

c# - Entity Framework IDENTITY_INSERT ON doesn't work -

i have code supposed insert record identity insert on using (mct_db_archiveentities ent = new mct_db_archiveentities()) { ent.executestorecommand("set identity_insert [clicks] on"); ent.clicks.attach(ck); ent.clicks.context.objectstatemanager.changeobjectstate(ck, system.data.entitystate.added); ent.savechanges(); } i error. cannot insert explicit value identity column in table 'clicks' when identity_insert set off. it not supposed work. works if identity insert turned on on same connection real insert. in case 2 different connections can used. make work have maintain own db connection , pass objectcontext's constructor.

msvcrt - Why does this CMake project not set the appropriate MSVC runtime? -

Image
i'm trying understand why libmysql cmake project configured /md , /mdd flags not generate appropriate visual studio 10 project files. appropriate cmake_ macros have been configured, shown: yet generated projects still showing unexpected runtime library settings: is cmake gui reason unreliable, or possible option overriding crt settings? i found cmake project libmysql has os-specific cmake file windows forces static runtimes used when generating visual studio solution: 75 # force static runtime libraries 83 foreach(flag 84 cmake_c_flags_release cmake_c_flags_relwithdebinfo 85 cmake_c_flags_debug cmake_c_flags_debug_init 86 cmake_cxx_flags_release cmake_cxx_flags_relwithdebinfo 87 cmake_cxx_flags_debug cmake_cxx_flags_debug_init) 88 string(replace "/md" "/mt" "${flag}" "${${flag}}") 89 set("${flag}" "${${flag}} /ehsc") 98 endforeach()

ios - How to call Magento API Login Method in Iphone -

can body tell how call login method of megnto api in iphone have done in andriod using xmlrpc library // ... string sessionid = ""; //hashmap<string , string> params = new hashmap</string><string , string>(); //params.put("apiuser", "developer"); //params.put("apikey", "magento123"); xmlrpcclient client = new xmlrpcclient("http://some-site.com/index.php/api/xmlrpc/"); try { /* sessionid = (string)client.callex("login", new object[]{params}); cause debug/my_xmlrpcexception_msg(196): xmlrpc fault: calling parameters not match signature 1 */ sessionid = (string)client.call("login", "developer", "magento123"); log.d("my_xmlrpc_success_session_id", sessionid); } catch (xmlrpcexception e) { log.d("my_xmlrpcexception_msg", e.getmessage()); } i newbie iphone how can in iphone plz body can tell , library or

AngularJS: Deleting from scope without hardociding -

i have array of items bound <li> elements in <ul> angularjs. want able click "remove item" next each of them , have item removed. this answer on stackoverflow allows that, because name of array elements being deleted hardcoded not usable across lists. you can see example here on jsfiddle set up , if try clicking "remove" next game, student removed, not game. passing this button gives me access angular $scope @ point, don't know how cleanly remove item parent array. i have button defined ng-click="remove('games',this)" , have function this: $scope.remove = function (arrayname, scope) { scope.$parent[arrayname].splice(scope.$index,1); } ( like jsfiddle ) naming parent array while i'm inside seems way break functionality when edit code in year. any ideas? i did not why trying pass this .. never need deal this in angular. ( , think 1 of strengths! ). here fiddle solves problem in different way.

javascript - How to get a textarea element in jquery when the name is in a variable -

i trying populate multiple text areas single select button . application cant use else (esp id's) textareas dynamically created , named in order tx1 , tx2 ... txn. my code .... var count = 13; for(var i=1;i<count;i++ ) { var txtname = 'tx' + i; var txt1 = $('textarea[name=txtname]'); var seltxt1 = $(this).find("option:selected").attr('text'); ..... ..... but var txt1 = $('textarea[name=txtname]'); not work !!! how provide dynamically created name of txtaarea var txt1 . like - $("textarea[name="+txtname+"]");

command line - when i am installing perl in ubuntu systems the systems replying as permission denied -

i want install asterisk software. need install perl cmd , more. when try install perl in ubuntu, system replies: permission denied. here command used: php05@linux05:~$ cd /usr/local php05@linux05:/usr/local$ php05@linux05:/usr/local$ wget http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz --2013-04-25 16:56:59-- http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz resolving asterisk.gnuinter.net (asterisk.gnuinter.net)... 69.54.200.117 connecting asterisk.gnuinter.net (asterisk.gnuinter.net)|69.54.200.117|:80... connected. http request sent, awaiting response... 200 ok length: 13217 (13k) [application/x-tar] asterisk-perl-0.08.tar.gz: permission denied cannot write `asterisk-perl-0.08.tar.gz' (permission denied). php05@linux05:/usr/local$ how can proper permissions this? try command using " sudo wget http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz ", since trying download file in /usr/local folder, , type password onc

c# - how to dynamical pass generic-type same as type of parameter? -

i trying this: public static void showtaskpane(usercontrol type) { var item = set.oftype<typeof(type)>().firstordefault(); } but not working, want select object of type or passed parameter. method signature, if required, can change it, suggest me how it? you can define method as: public static void showtaskpane<t>() { var item = set.oftype<t>().firstordefault(); } and call like: showtaskpane<usercontrol>(); or if method suppose return control then: public t showtaskpane<t>() { return set.oftype<t>().firstordefault(); } call like: var item = showtaskpane<usercontrol>(); for comment: there anyway can restrict th type of t subtype of usercontrol? you can specify constraint like: public t showtaskpane<t>() t : usercontrol { return set.oftype<t>().firstordefault(); }

java - assertTrue statement requires static import in intelliJ IDEA? -

i shifted project form netbeans intellij idea, junit based test project. in netbeans using statments asserttrue("message", conditioncustom()); and working without import. when using same above command in intellij have import file import static org.junit.assert.asserttrue; is there way dont need write above line in code file? otherwise have edit files working asserttrue statement. you either have add static import or make clear class static call associated with: assert.asserttrue("message", conditioncustom()); i use latter because think it's clearer. java won't compile unless can figure out class associate static method with. i'd guess perhaps use inheritance associate static method test.

CUDA compute and copy engine queue limits -

i seem encounter limit number of asynchronous kernel launches can queued in compute engine queue. after limit host blocked , gpu-cpu concurrency lost. not mentioned in cuda programming guide. what maximum number of asynchronous kernel launches can queued in compute engine queue? does maximum number depend in way on kernel being launched? does time takes cpu put kernel launch in compute engine queue depend on kernel being launched? what maximum number of asynchronous memcpy's can queued in copy engine queue? i not sure there universal answer question, degree platform , cuda version specific afaik. answer bullet points the limit queue size, believe, there maximum number of queue operations rather kernel launches. same total limit should apply combination of kernels, copy operations , stream events. total number of operations depends on platform , cuda version no no, once driver queue filled, time taken submit asynchronous operation considerably increased se

javascript - How do you do web animation of objects to come in,where their place becomes visible? -

i need make "entrance" animation lot of objects. should fly sides of pages places meant be. you can use jquery .animate() .

Dispatching and handling an event from an ANE (Air Native Extension) to a flex mobile application -

the explanation of problem requires background info making question little long, bear me. an ane (air native extension) consists of 3 parts, native code allows use device specific features (i'm using android), actionscript library accesses native code functions , makes them available flex mobile application, , flex mobile application. for ane, i'm getting internet info in onreceive() method extend broadcast receiver. method doesn't return anything, when it's done store in global variable , dispatch event saying info ready. the actionscript interface listens event , when receives it, updates global variable , dispatches event telling flex mobile app info ready. so when flex mobile app learns info needs ready goes in , gets it. here's example of how coded if explanation wasn't clear enough: native code: public myclass(anotherclass v,frecontext c){ this.v = v; this.c = c; //will use c dispatch event } onreceive(){ ....code....

c - What is there to be gained by deterministic field ordering in the memory layout? -

members of structure allocated within structure in order of appearance in declaration , have ascending addresses. i faced following dilemma : when need declare structure, (1) group fields logically, or (2) in decreasing size order, save ram , rom size? here example, largest data member should @ top, should grouped logically-connected colour : struct pixel{ int posx; int posy; tlargetype colourspacesecretformula; char colourrgb[3]; } the padding of structure non-deterministic (that is, implementation-dependent), cannot reliably pointer arithmetic on structure elements (and shouldn't: imagine reordering fields liking: boom, whole code stops working). -fpack-structs solves in gcc, bears other limitations, let's leave compiler options out of question. on other hand, code should be, above all, readable . micro optimizations avoided @ cost. so, wonder, why structures' members ordered standard, making me worry micro-optimization of ordering

google glass - Playing video in the mirror API -

i'm little confused playing videos in mirror api are there restrictions using html tags in "html" field? ... alain says blocked html elements : these elements, , contents, removed html payloads. document headers : head, title embeds : audio, embed, object, source, video however looking @ documentation ... https://developers.google.com/glass/v1/reference/timeline/insert accepted media mime types : image/* , audio/* , video/* so ... i'm guessing can attach video not embed video? seems subtle distinction, app have have main html card , sub menu choice view video. correct? correct. html video elements stripped inserted timeline cards, can attach video. video attached timeline cards played in full screen native player on glass. if you'd include video other rich content, bundling way go. can accomplish specifying html cover card , many video cards same timelineitem.bundleid .

vb.net - Use the shadowed property of the derived class in the base class -

i have 2 class, customerservice class , cellphonecustomerservice class. cellphonecustomerservic class derived customerservice class. cellphonecustomerservice class shadows customerrepository property of customerservice class. public class customerservice <microsoft.practices.unity.dependency()> _ public property customerrepository isqlrepository set (byval value sqlrepository) _customerrepository = value end set return _customerrepository end end property public sub save(byval cust customer) me.customerrepository.save(object) end sub public function getallcustomers(byval query string) customer me.customerrepository.getallcustomer(byval query string) end sub public function getcustomer(byval id integer) me.customerrepository.getcustomer(object) end sub end

environment variables - How is saveenv implemented inside u-boot? -

i trying figure out part of code inside u-boot responsible writing device ram, when saveenv after setenv . find printenv , setenv , not saveenv . can please shed light on it? that depends on nonvolatile storage platform configured for. in case common/nv_edit.c built. (for example) if env lives in spi flash, saveenv() in common/env_sf.c built , linked. "grep saveenv common/*.c" , you'll see other storage options (eeprom, flash, mmc, nand etc). config_ options platform in appropriate .h under include/configs/. compare env-related options storage options, should lead right part of code platform.

python - Feincms ApplicationContent overwrite context -

if add applicationcontent region on feincms page, how update feincms_page's context? use case changing feincms_page's title application content's title use fragment templatetag app template: {% fragment request "frag_title" %} title {% endfragment %} inherited template: {% if request|has_fragment:"frag_title" %} <title>{% get_fragment request "frag_title" %}</title> {% else %} <title>{{ feincms_page.title }}</title> {% endif %}

node.js - Download multiple files from NodeJS Server -

i trying download multiple files node js server. can download single file using following code res.download('group_documents/sample1.pdf','sample1.pdf', function(err){ if (err) { console.log(err); } else { // decrement download credit etc } }); how can download files using single request client. if target clients web browsers, can't, http protocol not allow multiple downloads single request. if need this, you'd need either write custom client application, or (more simply) zip files archive before transmitting them.

javascript - what is the alternative to offsetLeft in internet-explorer (not work with me in ie) -

my question obvious, doesn't need clarify. my code document.onkeypress = function(evt) { var elem = document.getelementbyid('box'); evt = evt || window.event; var charcode = evt.charcode || evt.keycode; switch (charcode) { case 37: elem.style.position = 'absolute'; elem.style.left = parseint(elem.offsetleft - 10) + 'px'; elem.innerhtml = elem.offsetleft; break; case 38: elem.style.position = 'absolute'; elem.style.top = parseint(elem.offsettop - 10) + 'px'; elem.innerhtml = elem.offsettop; break; case 39: elem.style.position = 'absolute'; elem.style.left = parseint(elem

Names for different Javascript Object Notation -

is there name describing different ways can define object in javascript? there method more 'class-like' : function myobject() { this.amethod= new function(){ }; this.anothermethod = new function(){ }; } and other technique more 'dynamic'. myobject = new object(); myobject.amethod= new function(){ }; myobject.anothermethod = new function(){ }; i have been using both of these techniques in various ways, , understand benefits of each, life of me, don't have idea how call these 2 techniques when discussing colleauges. do these techniques have names? in first case myobject constructor function , since supposed called new : var obj = new myobject(); in second case, myobject object , assign properties it. not have special name. note in both cases myobject has different values. myobject in second case equivalent obj . a third way use object initilizer or "object literal": var obj = { amethod: function(){

C# Console.Write print out in text file? -

can make code print out in text file using console.write ? console.write(" enter id: "); int id = int.parse(console.readline()); console.write(" enter name: "); string name = console.readline(); console.writeline(" thank you! logged in as" +name+ +id); please help! thanks in advance. i don't know why need write in file in particular case if want console.writeline write in file may use console.setout(sw); console.writeline("hello world"); filestream fs = new filestream("test.txt", filemode.create); streamwriter sw = new streamwriter(fs); console.setout(sw); console.writeline("hello file"); sw.close();

wsh - SendKeys not working in Windows 7 -

i using code in windows 7 ultimate , not working allow me sign in site. see wrong it? set wshshell = wscript.createobject("wscript.shell") call wshshell.run("http://www.gmail.com", 1, false) wscript.sleep 2000 wshshell.sendkeys "username" wscript.sleep 1000 wshshell.sendkeys "{tab}" wscript.sleep 1000 wshshell.sendkeys "password" wshshell.sendkeys "{tab}" wscript.sleep 1000 wshshell.sendkeys "{enter}" wscript.quit()

python - if-statement depending on input -

i trying create "simple" way ask person shape find area of. find area of shape based on input. using python 2.7.3. here have far: from math import pi c = "" r = "" x = (input("do have [r]ectangle or [c]ircle? ")) # answer r or c if x == "r": l = (int(input("what length of rectangle? "))) w = (int(input("what width of rectangle? "))) print( l * w ) elif x == "c": r = (int(input("what radius of circle? "))) print( r ** 2 * pi) else: print("please enter request in lower case. ") from math import pi # use raw input (raw_input()) inputs... input() eval(input()) # how ask input simple problem x = (raw_input("do have [r]ectangle or [c]ircle? ")) # answer r or c # use .lower() allow upper or lowercase if x.lower() == "r": l = (int(raw_input("what length of rectangle? "))) w = (int(raw_input("what width of rectangle

scope - C Local variable has same name as function - how does it work? -

i teach c absolute beginners , have noticed of students notion use same name function , local variable in function. think it's goofy , prevent recursion. here's example: int add2numbers (int a, int b) { /* tested on mac os x gcc */ int add2numbers = + b; return add2numbers; } the way understand how works variable in local scope of function, , function in global scope. so, questions... am understanding correctly? where h*** getting idea from? thanks you correct in assuming function global , variable local. reason why there no conflict in program. now consider program given below, #include<stdio.h> int x=10; void x() { printf("\n%d",x); } int main() { x(); return 0; } you error because in program both function x() , variable x global.

winforms - VS2010 C# cant see non overridden methods of controls -

Image
i new c# , wrote simple winform list box manually added items. want add code listbox mouse double click method cannot locate anywhere - not sure called mousedoubleclick . during edit if double click on list box puts me selectedindexchanged method other default methods not show in drop down box on top right. how other methods? manually coded not run @ runtime. in other visual studio , vb used/unused methods visible control/object. there mousedoubleclick event listbox . mousedoubleclick event on control , controls must inherit event. you can either locate list of possible events in designer add event handler: or through code in form's load event: listbox1.mousedoubleclick += mydoubleclickeventhandler; visual studio can auto-generate method stub proper signature when type out.

c++ - Strange behavior of null pointer -

this question has answer here: accessing class members on null pointer 8 answers calling class method through null class pointer [duplicate] 10 answers i created null pointer of class app , somehow method of null object(of app) working. here code: #include "app.h" #include <iostream> using namespace std; int main() { app* pointer = null; pointer->print(); system("pause"); } attached header file #pragma once #include <iostream> using namespace std; class app { private: int x; int y; public: app(void); ~app(void); app(int a, int b) { x=a; y=b; } void print() { cout<<"hello world"<<endl; } }; the running result screen in : hello world . wh

Android Google Maps application showing grey background instead of the map -

ok, i'm having weirdest bug right : android application i'm working on displaying grey background instead of map, such below : wtf http://img4.hostingpics.net/pics/572343screenshot20130425161918.jpg here's logcat : 04-25 15:08:42.082: e/google maps android api(19139): failed load map. not contact google servers. 04-25 15:08:42.082: w/google maps android api(19139): please add <uses-permission android:name="android.permission.access_network_state"/> androidmanifest.xml ensure correct behavior under poor connectivity conditions. i have no idea might have caused this. changed small part of code unrelated map. , besides, tried reverting changes made, , still didn't work. tried adding line logcat gave me, changing api key, re-installing google play library, deleting previous versions of app on tablet, pretty read on internet. still doesn't work. if has idea problem might be, great. this problem caused when there problem key or prob

java - Converting ArrayList into TreeSet -

i have arraylist<card> cards = new arraylist<card> need convert treeset<card> . purpose do: new treeset<card>(cards) after have size of treeset equal 1. card class implements comparable interface. i'm doing wrong or not doing? if of card s in arraylist evaluate equal using provided comparable interface (i.e. compare returns 0 ) end 1 entry in treeset .

ios - How to remove or disable language preferences key from iPad keyboard for specific text field -

Image
1 needs remove or disable key ipad keyboard specific text field, shown in image you cannot remove specific button keyboard unless create custom keyboard. but, there different kinds of keyboard defined already. can manage keyboard behaviour. [yourtextfield setkeyboardtype: uikeyboardtype ] ;

angularJs $http. cannot revice params from request -

angularjs code: $http({ method: 'post', url:'/hello/rest/user/test', data: {user: 'aaaaa'} }); server code: @post @path("/test") public response merge(@context httpservletrequest request) { system.out.println(request.getparameter("user")); if (request.getparameter("user") == null) { return response.status(status.bad_request).build(); } return response.ok().build(); } request.getparameter("user") null. cannot revice parameter way. if want use request parameter, need pass data $http.post('/hello/rest/user/test', { user : 'aaaaa' }, { headers : { "content-type" : 'application/x-www-form-urlencoded;charset=utf-8' }, transformrequest : [function(data) { return angular.isobject(data) ? jquery.param(data) : data; }] }); also read

javascript - Two DataTables in one page - how to scroll just one of the tables? -

i have 2 datatables in 1 page initialized follows: //first table slisttable = $('#sublisttable').datatable({ "sscrolly": "265px", "sdom": "frtis", "bdeferrender": true, "aasorting": [[ 1, "desc" ]], "aocolumndefs": [ {"stype": "date", "atargets": [1]} ] }); //second table plisttable = $('#projlisttable').datatable({ "sscrolly": "265px", "sdom": "frtis", "bdeferrender": true, "aasorting": [[ 1, "desc" ]], "aocolumndefs": [ {"stype": "date", "atargets": [1]} ] }); as can see, i'm using se

Laravel 3.x Assets: how to include an external url -

i'm trying include google cdn jquery link laravel assets container link being concatenated site address, this: <script src="http://mybeautifulsite.com/<script src=" http:="" ajax.googleapis.com="" ajax="" libs="" jquery="" 1.8.3="" jquery.min.js"=""></script> is there way include external links assets container? edit here's code i'm using include asset: asset::add('jquery', '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>'); should be: asset::add('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'); whilst the documentation not explicitly talk absolute urls, code written in such way handle them.

Parsing values from JSON using php -

i'm new php , json, hoping can me. i have php 3rd party performs post against, delivering json data. example of data sent be: > { "created": 1326853478, "livemode": false, "id": > "evt_00000000000000", "type": "charge.succeeded", "object": > "event", "data": { > "object": { > "id": "ch_00000000000000", > "object": "charge", > "created": 1366838716, > "livemode": false, > "paid": true, > "amount": 1000, > "currency": "gbp", > "refunded": false, > "fee": 59, > "fee_details": [ > { > "amount": 59, > "currency": "usd", > "type": "stripe_fee&qu

php - printing table with div to create delete section -

the code posting below, iterates through result set , prints elements (paths images on database) images display in order. 3 images per row. want able have same concept (i.e. 3 images or cells per row) want have div underneath have word delete photo. $n = 3; echo "<table style='margin-right: 100px;'>"; echo "<tr>"; for($i=1; $i<=count($gallery);$i++){ $temp = array(); $temp = $gallery[$i-1]; echo "<td><div id='gallery_pic'><img id='single_pic' src='". $temp->path . "' /></div></td>"; if($i % $n ==0){ echo "</tr><tr>"; } } echo '</tr>'; echo '</table>'; echo "</table>"; the idea owner of profile should able delete photo clicking it. handle not sure how handle printing table same order adding row per row delete word. simple. add new div right after div#gallery_

php - From Real stdClass Object to Mock -

i have soap webservice returns stdclass object different properties. want create mock object simulates stdclass returned webservice. dont want create mock object manually. dont want serialize, unserialize object because want maybe edit propertie values inside vcs. so need turn this: stdclass object ( [parama] => 1 [paramb] => 2 [paramc] => 3 [paramd] => array ( [0] => stdclass object ( [paramd1] => 'blabla' [paramd2] => 'blabla' into this: $object = new stdclass; $object -> parama = 1; $object -> paramb = 2; $object -> paramc = 3; $object -> paramd -> paramd1 = "blabla"; $object -> paramd -> paramd2 = "blabla"; how it? a way build stdclass objects cast array object (outlined in type juggling ): $object = (object) array('prop' => 'value'); and shows, keys become property names , values values:

java - input Mat used in goodFeatureToTrack -

i'm trying detect feature in face goodfeaturetotrack function in java. crashes there. code: mat eyeregion = detectcascade();//i used here cascadeclassifier detect eye region if(eyeregion.empty()) log.i("face_calibrated","eye region empty"); i make sure region not empty. if(eyeregion.channels()==1) { //i convert mat rgb detectfeatures imgproc.cvtcolor(eyeregion, eyeregion, imgproc.color_gray2rgb); log.i("face_calibrated","eyeregion channel1"); } here problem: imgproc.goodfeaturestotrack(eyeregion,cornersa,4,0.01,5.0,null,3,false,0.04); i have declared cornersa global matofpoint public matofpoint cornersa = new matofpoint(); what type of input mat (rgb or gray) should used in function?

javascript - jqPlot - Insert Date (yyyy-mm-dd) to (dd/mm/yyyy) -

the input in example (jqplot) code yyyy-mm-dd. var line1=[['2008-08-12',4], ['2008-08-13',6.5], ['2008-08-14',5.7], ['2008-08-15',9], ['2008-08-16',8.2], ['2008-08-17',7.2], ['2008-08-18',3.2]]; but work here format dd/mm/yyyy hh:mm. should better transform input yyyy/mm/dd or easy change? thanks time. input date formatted : var line2=[['30/09/2008 4:00pm',4],['30/10/2008 4:00pm',6.5], ['30/11/2008 4:00pm',5.7], ['30/12/2008 4:00pm',9], ['30/01/2009 4:00pm',8.2]]; are understandable jqplot. can therefore use dd/mm/yyyy hh:mm format. see working example here add new variable : var line2 display date in dd/mm/yyyy format. note can specify date ticks rendering using axes:{xaxis:{ renderer:$.jqplot.dateaxisrenderer, tickoptions: { formatstring: '%d/%m/%y %h:%m' }, }}, see more dateaxisrenderer in jqplot documentation here .

Load dynamic css in javascript -

i have javascript file other people use on site. creates button , loads css file hosted on our server: style.setattribute('href', 'http://mysite.com/assets/some.css'); the user can call in site so: <script type="text/javascript" src="http://mysite.com/global.js"></script> i want give user ability upload own css file on web app replace 1 setting in global.js . currently, added custom_css:binary column in users table hold css file, requires user stay signed in on site. i'm not sure if right way approach or if there better way it. also, security risks approach? i'm using ror backend. any great! update 1 i'm able store uploaded js file , load custom css, it's checking current_user - means stylesheet not rendered users. how can work around this? i able find solution myself. there several ways approach this: add query string js src scrape page element gets generated script i opted opt

java - Generics implementation using interface with generics -

i have interface value , class record public interface value<t> { t getrawvalue(); } public class record<value<t>> { private value<t> value; t getrecordrawvalue() { return value.getrawvalue(); } } java not compile , complains generics declaration > . enlighten me why invalid syntax? you need bound generic type indicate requirement of being value<t> , , need preserve type value value<t> providing, therefore record class requires 2 generic types: t: type of values returned , u: type represents value<t> public class record<t, u extends value<t>> here have full example of this: public interface value<t> { t getrawvalue(); } public class record<t, u extends value<t>> { public record(u value) { this.value = value; } private u value; t getrecordrawvalue() { return value.getrawvalue(); } } public class stringvalue i

javascript - Show partly one layer and partly another layer in OpenLayers? -

i need show let's on half page topmost layer, , on other half layer below. being able change how visible of each layer great if possible (by dragging border between them example). right have no other idea besides implementing clunky frames , 2 separate maps. better ideas? watch control written cédric moullet presented in dev list in post: http://osgeo-org.1560.x6.nabble.com/openlayers-control-swipe-td5032741.html

c# - Read CheckBox Values in ASP.Net from a SQL db? -

i have table of checkboxes inserted sql db '1' , '0'. however, retrieve values again load event, i'm not able them. code: private void getauditchecklist() { sqlcommand cmd = null; string conn = configurationmanager.connectionstrings["connectionstring"].connectionstring; string querystring = @"select mount, braker, access, conn_net, log_book, pictures, floor, cb_lenght, channel auditor_checklist " + "where site_id = @siteid"; using (sqlconnection connection = new sqlconnection(conn)) { sqlcommand command = new sqlcommand(querystring, connection); connection.open(); cmd = new sqlcommand(querystring); cmd.connection = connection; cmd.parameters.add(new sqlparameter("@siteid", //the name of parameter map system.data.sqldbtype.nvarchar, //sqldbtype value 20, //the width of parameter

database design - Conditionally add a column to a mysql table -

i have project want able manage several instances of same database on several people's localhosts. want each developer able reset db canonical origin no matter state db into. end maintain standard database file. holds schema using create table table_name if not exists { however, want able add starting table structures needed project moves along. this, love able following alter table table_name add column if not exists column_name not seem exist. did notice stored procedure floating around internet solves this, wanted know if simpler able achieve goal have in mind. thank time , help. it won't possible plain sql. stored procedure should work best: read information_schema , check if column present. if not - execute alter statement.

jquery - popup menu in header gets pushed back behind page content -

i have menu button in header. page gets populated ajax request. clicking on menu button, appears second on screen , gets pushed behind listview. coudldn't find solution anywhere. <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"> <script type="text/javascript" charset="utf-8" src="js/cordova-2.6.0.js"></script> <link rel="stylesheet" href="./style/jquery.mobile-1.3.1.min.css" /> <script src="./js/jquery-2.0.0.min.js"></script> <script src="./js/jquery.mobile-1.3.1.min.js"></script> </head> <body> <div data-role="page" id="home"> <div data-theme="b" data-role="header"> <a data-inline="true" data-transition="pop"

php - fullCalendar displaying everything as allDay -

Image
i have created calendar saves mysql. i have allday value set false time frame events calendar displays day. this gets events.. $sql = mysql_query('select * `companies`.`calendar`'); ${'events'} = array(); while(${'event'} = mysql_fetch_assoc($sql)){ ${'events'}[] = ${'event'}; } snapshot of table: here jquery $(document).ready(function() { $('#eventtoadd').dialog({ autoopen: false, height: '300', width: '550', modal: true, resizable: false, position: 'center', }); var date = new date(); var d = date.getdate(); var m = date.getmonth(); var y = date.getfullyear(); var calendar = $('#calendar').fullcalendar({ theme: true, header: { left: 'prev,next today', center: 'title', right: 'month,agendaweek,agendaday' }, loading

javascript - Load selected values in dropdown on selecting value from another dropdown -

i have 2 dropdowns. when select value 1 dropdown load values in dropdown depending upon selected. here html code <select data-bind="options: filters, value: filter"></select> <select data-bind="options: filtereditems, optionstext: 'name'"></select> here knockout code var viewmodel = function(data) { var self = this; self.filters = ko.observablearray(data.filters); self.filter = ko.observable(''); self.items = ko.observablearray(data.items); self.filtereditems = ko.computed(function() { var filter = self.filter(); if (!filter || filter == "none") { return self.items.slice(0, 6); } else { return self.items.slice(2); } }); }; var initialdata = { filters: ["none", "old", "new", "super"], items: [{ name: "corvette", type: "old"}, { name: "charger", type: "old"}, { nam

javascript - Any tricks for running large (heavy memory-using) Mocha test suites in Internet Explorer? -

my company has built wonderful large (472 , growing) mocha test suite our app, , it's incredibly useful ... in chrome , firefox. in ie tests break down after 30 or tests, "error: out of stack space". so, question ... have 2 questions, main 1 , back-up: 1) there way ie run whole suite, perhaps tweaking config option somewhere give more memory? know ie sucks @ sort of thing, if firefox , chrome can have hope there's way make ie ... 2) failing that, there way in mocha "run tests 1-25, run tests 26-50, etc.", or have use grep option try limit number of tests run? guess should have spent bit more time googling before came here. found ticket: https://github.com/visionmedia/mocha/issues/502 which explains that: this bug in mocha: they're using sort of mechanism clear stack, mechanism doesn't work in ie need switch other mechanism (and haven't yet, of 4/25/2013). a (very dirty/hacky, functional) workaround add following befo

android - setPositiveButton in AlertDialog, using strings? -

i'm trying add string following alert box's positive button, keeps spamming out error messages. alertdialog.builder builder = new alertdialog.builder(this); builder.setmessage(r.string.checknetwork).settitle( r.string.checknetworktitle); builder.seticon(r.drawable.ic_warning); builder.setpositivebutton(android.r.string.continue, new warningcontinue()); alertdialog dialog = builder.create(); dialog.show(); any help? seem work title , message, not button... thanks in advance. edit: error says: the method setpositivebutton(int, dialoginterface.onclicklistener) in type alertdialog.builder not applicable arguments (class, warningcontinue) so seems expect integer, wondering if there's way use strings localization-purposes? edit2: ok hell. problem lied in string name; won't let me name string continue reason. o_o you don't want use "android.r.string.continue". "package name".r.string.continue want. thats usua

c# - Can't see complete stackpanel in printout -

i've been trying print out data column headers using stackpanels working , printout. problem stackpanel gets cut off after fixed width , i'm not sure property responsible it. it's printer sees rectangular limit on stackpanel has width shorter stackpanel , prints in rectangle. can't explain without picture don't have scanner. heres code it: private void btnprint_click(object sender, routedeventargs e) { printdialog dialog = new printdialog(); if (dialog.showdialog().getvalueordefault()) { list<result> results = vm.obsresults.orderbydescending(r => convert.todouble(r.schedulingrate)).tolist(); var proplist = typeof(result).getproperties().tolist(); int maxrowsperpage = 42; var pgcnt = results.count / maxrowsperpage; xpsdocumentwriter docwriter = printqueue.createxpsdocumentwriter(dialog.printqueue); printticket ticket = new printticket();