Posts

Showing posts from August, 2011

c# - How to convert my datetime into 'DD-MM-YYYY' -

c# - How to convert my datetime into 'DD-MM-YYYY' - how convert date time format '30-10-2014 00:00:00' '30-10-2014' want remove timing. have tried update table set fromtime='3:00pm',totime='3:00pm',bookingdate= (datetime,'30-10-2014 00:00:00' ,105 how write query this. try method: private string convertfromepoch(long epoch, string timezone) { timezone tz = datetime.gettimezone(timezone, null); datetime dt = new datetime(epoch); string dtfmt = dt.format("dd-mm-yyyy", tz); homecoming dtfmt; } c# date datetime

create dictionary in python using two sets -

create dictionary in python using two sets - i have merge 2 sets: colors={'green','yellow','purple','blue','red'} and children={'uri','ron','sigalit','ruti','alon'} into single dictionary using children keys. i'm not allowed utilize loops, , not allowed utilize indexing. clues how this? you can utilize dict comprehension. children = {'uri','ron','sigalit','ruti','alon'} colors = {'green','yellow','purple','blue','red'} >>> {x:y x,y in zip(children,colors)} {'uri': 'green', 'ruti': 'blue', 'ron': 'yellow', 'alon': 'red', 'sigalit': 'purple'} python python-2.7 set

coldfusion - Dump Session Into SQL Database -

coldfusion - Dump Session Into SQL Database - is possible dump coldfusion session sql database? have many session values , want dump of them database. didn't know if had write each value database or if have huge session dumps values or variables used database.. have checkout form, fill out many questions , confirm on lastly page. when nail confirm want they've entered in entire session dump database. know can find illustration of or can provide one? to want, this: <cfsavecontent variable="sessiondata"> <cfdump var="#session#" format="text"> </cfsavecontent> <cfquery> insert table (sessiondata) values (<cfqueryparam cfsqltype="cf_sql_varchar" value=#sessiondata#">) it's quick , simple , leaves info that's hard with. if me, i'd this: <cfoutput> <cfloop collection="#session#" item="x"> key #x# value #session[x]# <br /> </cfl

c++ - How to draw a rectangle in SDL 2 and what exactly is a renderer -

c++ - How to draw a rectangle in SDL 2 and what exactly is a renderer - my questions focuses on sdl 2 i dont understand renderer is. can have multiple renderers or there one? for example, how can draw rectangle color on background different color using renderer? believe reply lies in functions: sdl_renderdrawrect() , sdl_renderfillrect() right? said problem dont understands renders. know how surfaces , bliting works dont know renderer symbolizes. if show me how think understand how renders works. far have this: #include <sdl.h> int main(int argc, char* argv[]) { //initialization sdl_init(sdl_init_everything); //window sdl_window *mainwindow = sdl_createwindow("my game window", sdl_windowpos_centered, sdl_windowpos_centered, 640, 480, sdl_window_shown ); //rend

java - how can I verify a mock was called with a param with specific fields' values? -

java - how can I verify a mock was called with a param with specific fields' values? - i write ut using mockito mock. i want verify mock called param: myobject obj obj = { name =... , value = 9} i want verify mock called param has value 9. how this? i don't want override equals(..) in myobject mockito has argumentmatcher interface: class islistoftwoelements extends argumentmatcher<list> { public boolean matches(object list) { homecoming ((list) list).size() == 2; } } list mock = mock(list.class); when(mock.addall(argthat(new islistoftwoelements()))).thenreturn(true); java unit-testing mocking mockito

PHP : Initialized vs static registry class in performance -

PHP : Initialized vs static registry class in performance - is there big difference between initializing registry class , using static methods in performance ? for example class registry { private static $data; public static function set($key,$value) { self::$data[$key] = $value; } public static function get($key) { homecoming isset(self::$data[$key]) ? self::$data[$key] : false; } } on other hand class registry { private $data = array(); public function set($key,$value) { $this->data[$key] = $value; } public function get($key) { homecoming isset($this->data[$key]) ? $this->data[$key] : false; } } is there big difference [...] in performance no. main concern imminent violations of dependency inversion first approach. sec approach allow injection of registry object, improving testability , extensibility. php class design-patterns design registry

How does this query work to split csv into rows in sql server? -

How does this query work to split csv into rows in sql server? - i using sql-server 2012 here query drop table #t create table #t(id int,name varchar(10)) insert #t values(1,'a,b,c'),(2,'d,e') select a.id,split.a.value('.','varchar(10)') string (select id,cast('<m>'+replace([name],',','</m><m>')+'</m>' xml) string #t) cross apply string.nodes('/m') split(a) i trying logic of query used here,but unable understand how working? can body guide me in making understand the logic in cast() clause , split.a.value() the cast clause converts string xml fragment consumed later 'nodes' method. if run subquery: select id,cast('<m>'+replace([name],',','</m><m>')+'</m>' xml) string #t you results below: id string 1 <m>a</m><m>b</m><m>c</m> 2 <m>d</m>

internet explorer - Sharepoint 2013 With IE 11 - 401 UNAUTHORIZED -

internet explorer - Sharepoint 2013 With IE 11 - 401 UNAUTHORIZED - i have authentication problem when used ie access sharepoint site. when come in address of site, don't receive prompt come in username , password , error message "401 unauthorized". have no such problem when using firefox or chrome. searched problem , solution changing authentication type in iis "windows authentication" "basic authentication". solution worked me, basic authentication not secure , don't want utilize it. there solution else solve problem? can seek 1 more solution if helps ? to configure ie prompt credentials trusted sites: open net explorer. tools menu, click net options. select security tab. click trusted sites web content zone. click custom level button. list of settings, scroll end , select button beside prompt user name , password. click ok. click ok close net options window. let me know if helps thanks internet-explorer authent

Particle effect with libgdx - box2d -

Particle effect with libgdx - box2d - i'm developing game involves lot of collisions , explosions. now, whenever have collision between 2 bodies, want draw particle effect explosion @ collision position, i'm not sure how do that. know how draw particles because i'm using box2d , i'm not using pixels meters(every pixel 32 meters), i'm not sure size should particle effect be. if guys help me out here appreaciate that. libgdx box2d collision particle-system particle

multithreading - Scheduling Windows threads to run with high accuracy timing? -

multithreading - Scheduling Windows threads to run with high accuracy timing? - i'm asking in general sense without specific language in mind. what want able have thread run every 100ms high accuracy. seems highest accuracy i'm able using normal threads (in quick test application) 5ms or so. thread takes 10ms perform task. basically, there way inquire windows schedule thread @ delays? (to best of ability, i'm aware it's not realtime operating system) on windows, best can utilize multimedia timer. these platform's high resolution timers. windows multithreading winapi scheduled-tasks

sql - Mysql group_concat() re-orders resultset -

sql - Mysql group_concat() re-orders resultset - consider mysql schema this: create table `translations` ( group_id int(11), lang varchar(2), text varchar(9), unique index `group_id_lang` (`group_id`, `lang`) ) it should quite obvious going on here - have many translations 1 group_id. now if i'll run next query, groups preferred language 'en', fallback 'ru', , if neither of these translations exists, fallback available language, works charm select * ( select * translations order lang = 'en' desc, lang = 'ru' desc ) translations grouping group_id +----------+------+---------+ | group_id | lang | text | +----------+------+---------+ | 1 | en | republic of estonia | | 2 | en | england | | 3 | ru | Швеция | +----------+------+---------+ as see i'll 3 rows lastly 1 fallen 'ru' because 'en' wasn't nowadays on group. far good.. now if want select av

java - Receive UDP packets fast -

java - Receive UDP packets fast - i have udp listener thread, looped , calls method 1 time packet received. works fine, method not beingness called when more 1 packet arrives after first one. two packets send 1 time after another, first 2 bytes long, sec 3 bytes long. receive() method tends fired when sec packet arrives. here udp listener class: public class udplistener extends thread{ private boolean running = true; byte[] info = new byte[1500]; datagrampacket packet = new datagrampacket(data, data.length); public void run() { log.v("mr", "runs"); seek { while(running) { log.v("mr", "listening... "); socket.receive(packet); log.v("mr", "received data: " + packet.getdata()[0] + "; length: " + packet.getlength()); device.post(new runnable() { public void run() {

java - SortedVector from Vector -

java - SortedVector from Vector - (learning task - got stuck) need create class ( sortedvector ) extends vector sorting elements. can't figure out how overload addelement method. must utilize collections.sort . public class sortedvector extends vector { public void addelement(object o){ super.add(o); collections.sort(); //what do here? } } you want sort current collection - pass this collections.sort : public class sortedvector extends vector { public void addelement(object o){ super.add(o); collections.sort(this); // note usage of } } java inheritance vector overloading method-overloading

c# - How to change UIRoot scale? -

c# - How to change UIRoot scale? - i'm using unity3d c#. also, i'm using ngui 2.7.0 ui. when create new ui ui root (2d)'s scaling 0.005633803 on axis. can't alter it's scaling in inspector. how do that? the problem is, it's children, menu items, scaled smallest value. when utilize popupmenu, subitems scaled 1, , not visible. firstly, update latest ngui. 3.x.x changes quite lot , makes much more powerful tool. the scale of uiroot based off of resolution set too. children should have scale of (1, 1, 1). c# unity3d ngui

javascript - Three.js - Transparent object gets refracted so far over -

javascript - Three.js - Transparent object gets refracted so far over - i had created scene walls , objects , objects door had created transparent object object height , width, transparent hides wall long too.i had attached images image 1 : when see through door objects ( models loaded using json loader ) visible , other objects ( wall - created using box geometry , , surface- plane geometry ) gets transparent. image 2: wall nowadays there image 3: while looking through door wall @ left gets hide , sky , floor beyond displayed i had user below code material box geometry material = new three.meshbasicmaterial({ color: 0xd6d6d6, transparent: true, opacity: 1.5, overdraw: 0.5 }); and material used transparent object var materialright = new three.meshbasicmaterial({ color: 0xcc49c3,//violet opacity :-0.1, transparent : true, side: three.doubleside, ambient: 0xea6767, //

python - How do I preempt an actionlib server from a client -

python - How do I preempt an actionlib server from a client - i want stop server period of time. how can send preempt request server client in ros using python? got it! 1 has phone call cancel_goal(). client.cancel_goal() python ros

Publishing HTML5 advert using Adobe Edge Animate -

Publishing HTML5 advert using Adobe Edge Animate - background i interested in learning how create html5 web adverts might delivered website using advertisement server. i capable of writing js using library such move.js animate banners have been experimenting adobe border animate in order speed creation. question what best settings utilize publish web adverts border animate? is wise utilize adobe cdn alternative if submitting advertisement server? if cdn alternative not used, edge.js file included locally , takes additional 100kb, much. in addition, have seen in iab. guidelines html5 advertisement may 100kb in size - realistic sizes designers achieve? thanks. i can't reply animation questions run advertisement server big publisher. recently i've had adobe border zips sent me. should've been simple process became tricky due of advertisement server's limitations.. re: including mutual files locally, please don't! ads serv

windows - Why windows7 cannot access resource on network by IP address? -

windows - Why windows7 cannot access resource on network by IP address? - i using windows 7 until yesterday ok when set \\192.168.1.1 in explorer opens shared resources in these 2 days inquire username , password utilize network administrator , password. did not open , asking 1 time again username , password when utilize hostname or computer name e.g \\dc-aqua or ** \\mailserver** it opens shared folders printers. one more thing utilize \\mailserver\d$ permanently asking username , password. an expert scheme administrator guided alter control panel -> administrative tools -> local security policy -> local policies -> security options -> network security: lan manager authentication level >set send lm & ntlm - utilize ntlmv2 session security if negotiated this solved problem windows authentication networking dns

android - Force thread to update ImageView immediately -

android - Force thread to update ImageView immediately - problem: attempting display image within of imageview , perform computation while image displayed. supposed loop through multiple times. instead, imageview not update until computation done, , logcat displayed "skipped xxxx amount of frames! application may doing much work on main thread." question: how forcefulness thread pause computation such updates imageview , doesn't skip frames? things have tried: `myimageview.setimagebitmap(mybitmap);` `myimageview.invalidate();` `myimageview.setvisibility(imageview.invisible);` `myimageview.setvisibility(imageview.visible);` any help or guidance appreciated! computation takes more 16ms has run in different thread ui/main thread. not need forcefulness show image, right. android android-layout

html - Div not centered in Firefox -

html - Div not centered in Firefox - i trying center div , works in safari , chrome, not firefox. div socicon show linked social media icons. div below total background image using css3. html { height: 100%; background: url(images/logolandingpage.jpg) no-repeat center center; background-size:cover; } #socicon { margin: 0 auto; position:absolute; padding: 10px 0px; bottom:0px; width:100%; /* firefox */ display:-mox-box; -moz-box-pack:center; -moz-box-align:center; /* safari , chrome */ display:-webkit-box; -webkit-box-pack:center; -webkit-box-align:center; /* w3c */ display:box; box-pack:center; box-align:center } text-align:center; might help, not sure , if post html can create sure work! #socicon { margin: 0 auto; position:absolute; padding: 10px 0px; bottom:0px; width:100%; text-align:center; } html css3 firefox

Trying to register a package with bower - "EMALFORMED failed to read \path to file\bower.json" "Unexpected string" -

Trying to register a package with bower - "EMALFORMED failed to read \path to file\bower.json" "Unexpected string" - i have never used bower before , trying register bundle it. have read including similar problems on so, can't tell i've gone wrong. additional error details "unexpected string". here bower.json file: { "name":"one-nexus", "description":"a sensible , intuitive front end end solution.", "version":"1.1.0", "keywords":[ "css", "sass", "js", "responsive", "mobile-first", "front-end", "framework", "web", "development" ], "homepage":"http://www.onenexusproject.com/", "ignore":[ "/assets/js/jquery.min.js", "/assets/js/modern

php - Edit Success message and link in Opencart / Mijoshop -

php - Edit Success message and link in Opencart / Mijoshop - im trying remove link product in success bar when adding product cart category page life of me cant find edit link! i've searched entire site , found message , link in opencart > catalog > language > english language > checkout > cart.php editing doesnt work , cant found anywhere else except wishlish , compare! any ideas on getting great. im trying remove link product page in message, nil else. much appreciated. imho, need alter translation $_['text_success'] = 'success: have added <a href="%s">%s</a> <a href="%s">shopping cart</a>!'; to this $_['text_success'] = 'success: have added %2$s <a href="%3$s">shopping cart</a>!'; that should work. take @ sprintf. php mysql opencart

Can't solve Coulomb Force differential equation in Mathematica -

Can't solve Coulomb Force differential equation in Mathematica - i'm trying solve problem: have find trajectory of electron in graphene lattice using mathematica. i've tried solve coulomb forcefulness equation ndsolve , plot result each direction, obtain white plot. help me please? give thanks in advance. here's code x direction: coordx = {0.6327, 1.88058, 3.03927, 4.28716, 5.44584, 6.69373, 7.85241, 9.10029, 1.9728, 3.22069, 4.37937, 5.62726, 6.78594, 8.03382, 9.19251, 10.4404, 3.3129, 4.56079, 5.71947, 6.96736, 8.12604, 9.37393, 10.53261, 11.7805, 4.653, 5.90089, 7.05956, 8.30746, 9.46614, 10.71403, 11.87271, 13.1206}; me = 9.01*10^-31; pi = 3.14159; epsilon0 = 8.854*10^-12; q = -1.6*10^-19; q = 1.6*10^-19; step = 0.01; forzax[p_, r_] := sum[(q*q)/(4 pi*epsilon0*norm[r - p[[i]]]^2), {i, length[p]}] forzax[coordx, {x[t]}]; ndsolve[{x''[t] == forzax[coordx, {x[t]}]/me , x[0] == 0, x'[0] == 0}, {x[t]}, {t, 0, 1500}] show[paramet

binary - Why doesn't my bit-counting function work for negative numbers? (Python) -

binary - Why doesn't my bit-counting function work for negative numbers? (Python) - i'm trying implement function counts 1's in binary representation of integer. why not work negative integers? def bit_count(n): bits = 0 while n != 0: bits += (n&1) n = n >> 1 homecoming bits i've done investigation , found using bin(n) , counting 1's in resulting string work instead, i'd find out why version isn't working. thank you! edit: clarify, solves big + integers instantly, runs indefinitely - integer. follow-up question: task impossible in python, given representation of negative numbers? resolution: prepare problem, used counter while loop ran maximum of 32 times, i.e. getting 32-bit representation of negative numbers. help. python binary bitwise-operators

RJDBC limiting rows from Netezza -

RJDBC limiting rows from Netezza - i have rjdbc connection netezza. queries should homecoming more 256 rows getting truncated 256 rows. have tested queries in squirrel , work fine (return right number of rows - 600+). i have tried following: dbfetch(res, n=-1) dbfetch(res, n=1000) dbsendquery(conn, "select ...", believenrows=false) all of these homecoming first 256 rows. on mac odbc not option. upgrading jdbc driver version 5 version 7 resolved issue. netezza rjdbc

Using paypal IPN sample code but it doesnt work -

Using paypal IPN sample code but it doesnt work - i'm trying setup paypal ipn skype bot can't work. using paypal sample code found here: https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php maintain on getting we not send ipn due http error: 500: internal server error paypal's ipn simulator. i need help this. i'm not php. paypal paypal-ipn

date - boost::gregorian::date_period representing all time -

date - boost::gregorian::date_period representing all time - is there way build such object? works, in practice: date_period(date(1,jan,1), pos_infin) assuming can assume year 1 negative infinity. seems there must way express infinite time period. oh, can this: date_period(date(neg_infin), pos_infin) date boost

asp.net mvc - Jquery Accordion Closes during mvc.Pagelist next page event -

asp.net mvc - Jquery Accordion Closes during mvc.Pagelist next page event - i have jquery accordion, works fine, within mvc.pagedlist, happens when nail next button within it, page reloads , accordion window close.. tried adding next codes create workaround seem cant create work.. controller // method if (page != null) { viewbag.paneltoopen = 0; } view @section scripts { <script> var searchinputs = $("#searchcriteria1").find("input[type=text], select"); var emptyfields = 0; searchinputs.each(function () { if (!$(this).val()) { emptyfields++; } }); if (emptyfields == searchinputs.length) { $("#searchcriteria1").accordion({ active: false, collapsible: true }); } else { $("#searchcriteria1").accordion({ //active:

sql server - SQL where 1 column contains in two columns certain data -

sql server - SQL where 1 column contains in two columns certain data - i have query like select * datatable in (select from(subselect q) , b in (select b from(subselect q) but won't want. in result , b have in same row, can't figure out how this. edit: datatable: kundeversionid, zeitpunkt, kundeid 16, 2014-08-05 18:31:10.317, 10; 17, 2013-11-27 16:26:53.980, 11 select * datatable (zeitpunkt in (select zeitpunkt (select kundeid, max(zeitpunkt) zeitpunkt kundeversion grouping kundeid)as q) , kundeid in(select kundeid (select kundeid,max(zeitpunkt) zeitpunkt kundeversion grouping kundeid)as q)) order kundeid hope helps you can create subquery table in from clause: select * --todo - proper column list datatable dt inner bring together (select kundeid, max(zeitpunkt) zeitpunkt kundeversion grouping kundeid) q on

java - Submit data to MySQL database from android app -

java - Submit data to MySQL database from android app - i'm trying write form create reservation , save mysql. there 4-5 field in form name, phone, email, comment, time, date, table, people . must tell i'm new in java , android , don't know how i'm trying. think code mess right need help. here code far of reservation.java public class reservation extends activity implements onclicklistener { string name; string email; string phone; string comment; string datetime; string time; string table; string numberofpeople; private edittext edittext1, edittext3, edittext2, edittext4, txtdate, txttime; private button btncalendar, btntimepicker, btnmenues; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.reservation); edittext1 = (edittext) findviewbyid(r.id.edittext1); edittext3 = (edittext) findviewbyid(r.id.edittext3); edittext2 = (edittext) fin

character - Who Teaches the CPU 'A..B..C'? -

character - Who Teaches the CPU 'A..B..C'? - excuse idiotic question, can't seem find 1 satisfying reply internet. mean can see character 'x' displayed on screen right pc's start screen. how computer know bit patterns translated 'x'? gives such definitions? bios, os, cpu or display driver or apps? it depends @ moment, , operating system, , on hardware. linux on current x86 pc desktop: at boot time, uses vga driver (and bios has limited display functions). iirc, original vga cards had rom containing fixed width font, , still used (in compatibility mode). iirc, graphics cards have rom bios , initial vga font. used @ bios time or during boot process. but of time, linux desktop uses x11 server xorg. server manages fonts, , display them using graphics video card (which has gpu), copying appropriate bitmaps. x11 protocol knows fonts, today applications utilize client side xft. the future wayland architecture have fonts on client side. y

How to convert unsigned to signed char (and back) while preserving range in C? -

How to convert unsigned to signed char (and back) while preserving range in C? - i have situation need convert unsigned char (0-255) signed char (-128-127). want have 0 converted -128, 127 converted 0 , 255 converted 127. i using code (even though won't preserve range entirely): unsigned char convertunsigned(char n) { homecoming n + 127; } char convertsigned(unsigned char n) { homecoming n - 127; } this code appears taking values , converting them 255, can't verify (see below). i writing vex pic microcontroller (which has microchip picmicro pic18f8520) using mplab c18 compiler. can't tell code doing because have no debugger or other way communicate code on chip. the compiler supports c89 , not automatically promote operands ints (see the manual, section 2.7.1) normal c compilers, might part of problem. update the application writing works this: get unsigned char represents joystick axis (255 = total forward, 0 = total backward, center = ~

Antlr4 channels behavior -

Antlr4 channels behavior - i have next construct: mode pass_through; end_literal: pass_through_char* '{/literal}' -> popmode; pass_through_char: .+ -> channel( text ); when mode gets executed end_literal pass_through_chars pre-appended it. have though pass_through_char have been on text channel , end_literal have been '{/literal} is behavior correct? hard why behaved say, compound/conflicting utilize of * , + on , in pass_through_char root cause. below think trying accomplish. start_literal: '{/literal}' -> pushmode(pass_through); mode pass_through; end_literal: '{/literal}' -> popmode; pass_through_char: . -> more, channel( text ); updated: have not tried exactly, utilize of 'more' alternative may (should) collapse each string of pass_through_char single token. antlr4 behavior channels

actionscript 3 - Expecting Identifer Before Leftbrace -

actionscript 3 - Expecting Identifer Before Leftbrace - import flash.events.mouseevent; import flash.net.urlrequest; import flash.net.navigatetourl; var emailflashvariable = "aa@aa.com"; var adfurlnavigator; var adfflashvarsutil; mcbutton.addeventlistener(mouseevent.mouse_up, onclick); function onclick(e:mouseevent):void { adfurlnavigator.navigatetourl(adfflashvarsutil.getparameter("clicktag") + ";cppar=1&emailurlvariable=" + emailflashvariable); var click_url:string = root.loaderinfo.parameters.clicktag; if(click_url) { navigatetourl(new urlrequest(click_url), '_blank'); } i have updated script above , cleared error messages, not show parameter in url instead got - typeerror: error #1010: term undefined , has no properties. @ _10792mb_fla::maintimeline/onclick() you getting >>> : either function adfclicked(event:mouseevent) or function adfclicked(event:mouseevent):some_return_type actionscript-3

android - Why is WebView blocking my ExpandableListView's expansion? -

android - Why is WebView blocking my ExpandableListView's expansion? - i've been working expandablelistviews before , know checkboxes, buttons, etc. it essential setfocusable false of these widgets found on xml serve groupview of our list, othervise, clicking on grouping cell not expand group, since these widgets steal focus it. but, if set webview in groupview, , setfocusable & setfocusableintouchmode false, still not able expand group. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="91dp" android:background="#ffffff"> <imageview android:layout_width="30dp" android:layout_height="91dp" android:id="@+id/sth_cell_img_correct" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:src="@draw

django - using form clean(self) method to do validation -

django - using form clean(self) method to do validation - this forms.py what wish accomplish is: before form gets saved- if there admin_time nowadays execution_time should replaced admin_time. def clean(self): cleaned_data = super(taskform, self).clean() start_date = cleaned_data.get('start_date') end_date = cleaned_data.get('end_date') if start_date , end_date: if start_date >= end_date: raise forms.validationerror(_("'end date' must after 'start date'")) homecoming cleaned_data execution_time = self.cleaned_data['execution_time'] admin_time = self.cleaned_data['admin_time'] if admin_time: execution_time=admin_time cleaned_data.update(execution_time) cleaned_data.update(execution_time) homecoming cleaned_data i'd write mixin views takes care of , can used in multiple places: class foomixin(object): def form_valid(sel

javascript - Jquery doesn't change div's width on smaller screen after auto adjusting on regular screen -

javascript - Jquery doesn't change div's width on smaller screen after auto adjusting on regular screen - got script auto adjusts width of children divs depending on number of children. , on smaller screen need them 100% wide. i've tried inserting script right script adjusts width on regular screen. doesn't work. tried inserting in bottom of page. didn't work too. here code $(".basecollections").each(function(){ var child_width = 100 / $(this).children().length; child_width = math.floor(child_width); $(this).children().css("width", child_width + "%"); if ( screen.width < 1000 ) { $(this).children().css('width','100%'); } }) http://jsfiddle.net/3x466nb1/ instead of screen.width need utilize $(window).width() : demo $(".basecollections").each(function(){ var child_width = 100 / $(this).children().length; child_width = math.floor(child_width); $(this).childre

json - Django - Query models where id equals attribute on python list -

json - Django - Query models where id equals attribute on python list - i need query models id matches 'id' attribute of json array, that: i have 3 saved model objects respective id's: id 1 id 3 id 4 i have json array that: [{'id' : 1}, {'id' : 2}, {'id' : 5}] i want filter in way: model.objects.filter('objects id not listed in json array') the result of filter should list models objects id not in json: result = [model_pk=3, model_pk=4] any ideas? you can utilize exclude method accomplish that: ids = [i['id'] in json_array] qs = model.objects.exclude(id__in=ids) python json django django-models django-filter

c++ call private function in container class -

c++ call private function in container class - if have 2 classes: class worker { top *mp_parent; worker(top *parent) : mp_parent(parent) {}; int dosomework() { int = mp_parent->privatefunction(); // function want phone call } } class top { private: worker m_worker; int privatefunction() {return 1;} } where top class contains instance of worker class. when worker instantiated, pointer parent class passed in. later, function dosomework() called needs value parent, calls mp_parent->privatefunction(). what best way accomplish this? - don't want create privatefunction() public function if can avoid it, not work because private :o are there other options? maybe can utilize 'friend' keyword: class worker { top *mp_parent; worker(top *parent) : mp_parent(parent) {}; int dosomework() { int = mp_parent->privatefunction(); // function want phone call } } class top { friend class worker

java - XStream and scientific notation issue -

java - XStream and scientific notation issue - i have object convert xml using xstream. encountering errors (not time) on fields both of type integer , double. java error java.lang.numberformatexception: input string: ".12625e312625" because xstream seems converting number scientific notation. cannot figure out how occurring , how should right it. see if double numbers big numbers never exceed 100,000.00 , don't understand why doing on integer field. help appreciated. thanks. java xstream

datetime - php timezone returns empty array -

datetime - php timezone returns empty array - i have server , local development machine. on locale machine, if want create new datetimezone utc, it's ok, response: php -r '$a = new \datetimezone("utc"); var_dump($a);' class datetimezone#1 (2) { public $timezone_type => int(3) public $timezone => string(3) "utc" } but on other , on server, if type in same command this: php -r '$a = new \datetimezone("utc"); var_dump($a);' object(datetimezone)#1 (0) { } in both cases date.timezone set europe/berlin in apache2 , in cli config file. any idea? ok, found problem since. server had php 5.4 local php 5.5, in 5.5 there __tostring() method, in 5.4 it's not there yet. datetime php-5.4

javascript - navigator.geolocation in webview of android 4.4.2 returning undefined -

javascript - navigator.geolocation in webview of android 4.4.2 returning undefined - i trying load current location in webview. but navigator.geolocation returning undefined? same navigator.online? is navigator object not supported in webview of android? how current device location? i using window.navigator.online giving me true when connect net else gives false; and dont forget add together config.xml <feature name="networkstatus" > <param name="android-package" value="org.apache.cordova.networkmanager" /> </feature> androidmanifest.xml <uses-permission android:name="android.permission.access_network_state" /> to currentlocation: <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"></script> <script type="text/javascript" charset="utf-8&q

Cannot launch SSMS (SQL Server 2014 Express) - Invalid license data. Reinstall is required -

Cannot launch SSMS (SQL Server 2014 Express) - Invalid license data. Reinstall is required - i've got new server running windows server 2012 rs , iis 8.5. i've installed sql server 2014 express , having problems getting sites under iis connect (initially placeholder) databases. in effort visual studio 2010 shell display debug information, ran subinacl per question (how prepare "invalid license data. reinstall required." error in visual c# 2010 express?) ssms no longer launches! when seek launch box saying: invalid license data. reinstall required. the underlying visual studio 2010 shell reporting when trying debug original issue ssms saying right on launch. i've uninstalled , reinstalled ssms problem still exists. i've installed visual studio 2012 express see if fixes license issue, didn't. advise appreciated. i found solution issue here: technet - sql 2012 - invalid license data basically involves these 2 steps: uninsta

xpages - How do I access the column names of a view datasource in sortColumn? -

xpages - How do I access the column names of a view datasource in sortColumn? - i have custom command displays view based off configuration documents. had been storing sortcolumn in sessionscope variable, user retain sort when leave , homecoming xpage. unfortunately, if leave xpage has same custom control, view doesn't have column same name, throws error. so, thought check columnnames of view don't seek using sortcolumn doesn't exist. have been unable handle view info source while applying sortcolumn. <xp:dominoview var="inputview" sortorder="#javascript:sessionscope.sortedcolumndirection}"> <xp:this.sortcolumn><![cdata[#{javascript:var namevector:java.util.vector = inputview.getcolumnnames(); var namearray = sessionscope.curdynamicviewsettings.columntitles; if ( @ismember(viewscope.sortedcolumnname,namearray)) { homecoming viewscope.sortedcolumnname; } return;}]]&

javascript - I want to create a widget which will render an application on sites who add that Widget to their webpage -

javascript - I want to create a widget which will render an application on sites who add that Widget to their webpage - i want create widget or javascript code render html form on webpage code embedded. eg. www.example.com wants show bmi calculator hosted on www.example2.com example2 wants share bmi example.com not giving actual code. share js code ( how include google analytics or google ads ). whats best way accomplish this? in calculator asking multiple details user saved in database on www.example2.com in db . i don't want go java applet or flash way. have share html code of bmi calculator not ideal. what possibilities here. thanks there 2 ways this: iframe , javascript. the more mutual way utilize iframe, simple webpage on have total control. more, best advantage iframe loaded asynchronously loading of page isn't affected loading of widget. this approach facebook uses , does, other major sites utilize same approach. as pointed out in commen

unit testing - '2 of 3 tests passed' when only 2 test methods were exported -

unit testing - '2 of 3 tests passed' when only 2 test methods were exported - this test-main.js , default after running cfx init .. var main = require("./main"); exports["test main"] = function(assert) { assert.pass("unit test running!"); }; exports["test main async"] = function(assert, done) { assert.pass("async unit test running!"); done(); }; require("sdk/test").run(exports); and output, why 2 of 3 tests passed ? when there 2 test methods exported. [rob@laptop addon]$ ~/apps/addon-sdk-1.17/bin/cfx test using binary @ '/usr/bin/firefox'. using profile @ '/tmp/tmpdrqavv.mozrunner'. running tests on firefox 31.1.0/gecko 31.1.0 ({ec8030f7-c20a-464f-9b0e-13a3a9e97384}) under linux/x86_64. console.warn: addon: plural form unknown locale "null" scheme js : error chrome://browser/content/browser.js:14338 - typeerror: value not non-null object scheme js : error chrome://bro

php - Edges appear in image after resizing -

php - Edges appear in image after resizing - i have implemented next function: private static function generatepicture($sizekey, $src, $initialwidth, $initialheight, $imagetype) { $destination = adimage::addsizekey($sizekey, $src); if (file_exists($destination)) { return; } $finalsize = adimage::$sizes[$sizekey]; $initialratio = $initialwidth / $initialheight; $finalratio = $finalsize["w"] / $finalsize["h"]; $newimage = imagecreatetruecolor($finalsize["w"], $finalsize["h"]); imagealphablending( $newimage, false ); imagesavealpha( $newimage, true ); $oldimage = imagecreatefromstring(file_get_contents($src)); if ($initialratio >= $finalratio) { $scale = $finalsize["h"] / $initialheight; $surpluss = abs($initialwidth - ($initialheight * $finalratio)); imagecopyresized($newimage, $oldimage, 0, 0, $surpluss / 2, 0, $finalsize["w"], $finalsize[&q

ios - kGAIUserId shows Undefined USER-ID on google Analytics, -

ios - kGAIUserId shows Undefined USER-ID on google Analytics, - i want ga userid, bellow code. when check on google analytic. showing userid, shows undefined user-id. don't have much thought google analytic. id<gaitracker> tracker = [[gai sharedinstance] defaulttracker]; [tracker set:kgaiuserid value:[shareddata getuserid]]; // [shareddata getuserid] homecoming user id [tracker send:[[gaidictionarybuilder createappview] build]]; ios iphone google-analytics

ios - CLRegion or CLCircularRegion cannot be inherited -

ios - CLRegion or CLCircularRegion cannot be inherited - while building app based on part monitoring, find clregion have 1 attribute .identifier, need nsstring type attribute modify part created class: #import <corelocation/corelocation.h> @interface clcircularregionobject : clcircularregion @property nsstring *soundidentifier; @end in part setting class create new class , pass part , add together attribute, problem regionwithsound not recognized subclass of clcircluar region. clcircularregion *region = [[clcircularregion alloc] initwithcenter:self.annotationview.annotation.coordinate radius:self.radius identifier:self.mysearch.text]; clcircularregionobject *regionwithsound; if ([regionwithsound iskindofclass:[clcircularregion class]]) { regionwithsound = region; regionwithsound.soundidentifier = self.alarmsound; } ios objective-c

regex - Regular Expression for Automata for Strings that do not end in 01 -

regex - Regular Expression for Automata for Strings that do not end in 01 - automata strings not end 01. i cannot obtain regular look automata alphabet={0,1} generates strings not end 01. here state diagram: state diagram i state diagram visual automata simulator tool matthew mcclintock, tested strings empty string e, "0","1","00","10","11" , ones not end 01, , seems work. can help me obtain regular expression?. didn't have formal introduction computer automata theory, barely understand concepts of dfa,nfa , nomenclature kind of unusual me. i tried obtained regexp, 1 was: (0+1)*(00+10+11) but no sure if correct. then according diagram have tried things like: 1*(00*1+0+0*1)*+1(00*1+0*1)* or things that. know can test regular expressions? as said in comments, pretty close in first attempt. should work: (0+1)*(00+10+11)+0+1+ε or, in programmer dialect, ^([01]*(00|10|11)|0|1|)$ edit: give

Google Cloud DNS or Google Public DNS -

Google Cloud DNS or Google Public DNS - why want utilize "google cloud dns" when "google public dns" free? how setup dns/nameserver point compute engine: 1. set domain registrator(godaddy.com in case) settings/"nameserver" point dsn server provider using. 2. login dns server provider(any suggestions?) , set static ip address mapped domain name. is above, right process setup dns web server? regards chris google cloud dns provides authoritative name servers can configure dns records. google public dns name resolver looks info authoritative name server. see http://en.wikipedia.org/wiki/name_server more detailed info authoritative name servers , caching resolvers. and yes, process should work. google cloud dns 1 illustration of provider looking for. dns google-compute-engine google-cloud-dns

Where the heck do I put reCaptcha php on MY existing form? -

Where the heck do I put reCaptcha php on MY existing form? - i'm trying implement recaptcha existing contact form, , have nail snag (notice used word exactly) place server side php code within page. i've added required php within form right public key (and added private key server side php). i have validation php form @ top of same page form on. existing validation code follows: <?php // set email variables $email_to = 'myemailishere'; $email_subject = 'my enquiry title here'; // set required fields $required_fields = array('fullname','email','comment'); // set error messages $error_messages = array( 'fullname' => 'please come in name.', 'email' => 'please come in valid email.', 'comment' => 'please come in message.' ); // set form status $form_complete = false; // configure validation array $validation = array(); // check form submittal if(

postgresql - postmaster caused kernel hung issue -

postgresql - postmaster caused kernel hung issue - i have 1 server has below kernel logs in /var/log/messages, looks postgres db process postmaster caused kernel hung issue, clues confirm that? , actions can prevent issue happen? 2014-10-22t05:35:29.140-05:00 localhost kernel: bug: bad page state in process postmaster pfn:42bfbd 2014-10-22t05:35:29.140-05:00 localhost kernel: page:ffffea000e99f158 flags:00c0000000000000 count:-1 mapcount:0 mapping:(null) index:20c53e (not tainted) 2014-10-22t05:35:29.140-05:00 localhost kernel: pid: 9543, comm: postmaster not tainted 2.6.32-358.23.2.el6.x86_64 #1 2014-10-22t05:35:29.140-05:00 localhost kernel: phone call trace: 2014-10-22t05:35:29.140-05:00 localhost kernel: [<ffffffff81128f37>] ? bad_page+0x107/0x160 2014-10-22t05:35:29.140-05:00 localhost kernel: [<ffffffff8112a73c>] ? get_page_from_freelist+0x72c/0x830 2014-10-22t05:35:29.140-05:00 localhost kernel: [<ffffffff8112bc43>] ? __alloc_pages_nodemask+0x113/0x8d

javascript - Fadein callback not working properly with ajax-loaded json data -

javascript - Fadein callback not working properly with ajax-loaded json data - this design portfolio page. on load, json info retrieved via ajax, , 1 of keys used generate list of '.project-links' (no project displayed on load, , project images loaded when project selected (see showproj function)). question regards fadein/fadeout: images still painting onto screen after fade in completes, despite project content beingness defined/loaded within fadeout callback; can please enlighten me how can tweak fadein won't run until projimages loaded? thank you, svs. function ajaxreq() { var request = new xmlhttprequest(); homecoming request; } function makelinks(projects) { // result = getjsondata > request.responsetext var projectlist = document.getelementbyid("project-list"); (var project in projects) { if (projects[project].status !== "dnu") { var projectid = projects[project].id; var listitem =

java - Setting counter value back to initial in class -

java - Setting counter value back to initial in class - public class decreasingcounter { private int value; // instance variable remembers value of counter int valueinitial; public decreasingcounter(int valueatstart) { this.value = valueatstart; } public void reset(){ this.value = 0; } public void setinitial(){ this.valueinitial = 0; } } i need alter value in decreasingcounter(x); setinitial(); using object variable, don't know how. it seems valueinitial : public decreasingcounter(int valueatstart) { this.valueinitial = valueatstart; this.value = valueatstart; } public void setinitial(){ this.value = this.valueinitial; } you store initial value in constructor (assigning this.valueinitial ) , restore in setinitial() . you don't want set this.valueinitial 0 , since cause lose initial value set in constructor. java class

mvvm - ReactiveCommand CanExecute reacting to changes in a collection -

mvvm - ReactiveCommand CanExecute reacting to changes in a collection - i have reactivecollection filled items (that reactiveobjects well). i want create reactivecommand should enabled when any of items in collection has property set true, like: mycommand = reactivecommand.create( watch items in collection see if item.myprop == true ) so anytime there 1 of items property set true, command should enabled. edit: thanks, paul. resulting code this: public mainviewmodel() { items = new reactivelist<itemviewmodel> { new itemviewmodel("engine"), new itemviewmodel("turbine"), new itemviewmodel("landing gear"), new itemviewmodel("wings"), }; items.changetrackingenabled = true; var shouldbeenabled = items.createderivedcollection

Python multiprocessing apply_async never returns result on Windows 7 -

Python multiprocessing apply_async never returns result on Windows 7 - i trying follow simple multiprocessing example: import multiprocessing mp def cube(x): homecoming x**3 pool = mp.pool(processes=2) results = [pool.apply_async(cube, args=x) x in range(1,7)] however, on windows machine, not able result (on ubuntu 12.04lts runs perfectly). if inspect results , see following: [<multiprocessing.pool.applyresult object @ 0x01ff0910>, <multiprocessing.pool.applyresult object @ 0x01ff0950>, <multiprocessing.pool.applyresult object @ 0x01ff0990>, <multiprocessing.pool.applyresult object @ 0x01ff09d0>, <multiprocessing.pool.applyresult object @ 0x01ff0a10>, <multiprocessing.pool.applyresult object @ 0x01ff0a50>] if run results[0].ready() false . if run results[0].get() python interpreter freezes, waiting result never comes. the illustration simple gets, thinking low level bug relating os (i on windows 7). perhaps el

r - apply using multi-column data to produce a single numeric output -

r - apply using multi-column data to produce a single numeric output - is possible utilize form of array , send apply on row-by-row basis? i've tried far results in error "incorrect number of dimensions" mutual error others have had here cannot find , illustration of how i'm attempting in testfunc2 below. require(quantmod) getsymbols("spy",src="yahoo") ndata = 10 info = clcl(spy)[1:ndata,] testfunc1 = function(d1, x1, y1){ res1 = (d1 + 2*x1)^2 + y1 } #x1 constant - works x1 = .2 y1 = 1 tmp1 = apply(data, 1, testfunc1, x1, y1) result1 = cbind(data, x1, y1, tmp2) testfunc2 = function(z1, y1){ d1 = z1[,1] x1 = z1[,2] res2 = (d1 + 2*x1)^2 + y1 } x2 = xts(1:ndata, order.by=index(data)) z1 = cbind(data, x2) tmp2 = apply(z1, 1, testfunc2, y1) result2 = cbind(data, x2, y1, tmp2) i believe problem way treat z1 in testfunc2 . apply passes each row of z1 z1 of testfunc2 vector, not data.frame. prepare define testf

amazon web services - AWS S3 error with PFFiles after importing the exported Parse data -

amazon web services - AWS S3 error with PFFiles after importing the exported Parse data - looks parse.com stores pffile objects on aws s3 , stores reference actual files on s3 in parse pffile object types. so problem here link aws s3 link pffile if export info using out of box parse.com export functionality. after import same info parse application, reason security setting on pffiles on s3 changed in way pffiles won't accessible me after import due security error. my question is, know how security beingness set on pffiles? here's link pffile https://parse.com/docs/osx/api/classes/pffile.html guess rather advanced topic , wasn't revealed on page. also looking solution this, found forum: in case, pffiles stored in different app. might need download these files , upload them 1 time again new app , update pointers. know not great reply we're working on making process more straightforward. https://www.parse.com/questions/import-pffile-ob

android - Set background row when click row in listview error -

android - Set background row when click row in listview error - at moment,this code. want create listview ,when click row in listview,background of row alter red.when row's color red,click row's color alter white. run app,click row,then scroll listview,don't color of row clicked alter red,some below row alter red. adapter public class itembaseadapter extends baseadapter { private string[] marrayitems; private context context; public itembaseadapter(context context, string[] arrays) { this.context = context; this.marrayitems = arrays; } @override public int getcount() { // todo auto-generated method stub homecoming marrayitems.length; } @override public object getitem(int arg0) { // todo auto-generated method stub homecoming null; } @override public long getitemid(int arg0) { // todo auto-generated method stub homecoming 0; } @override public view getview(int position, view convertview, viewgroup arg2) { // todo aut

angularjs - contact list in angular js working in older version not in new version -

angularjs - contact list in angular js working in older version not in new version - i new angular js , learning site. here trying same contact list it working fine older version angular js ver 1.1.1. when trying using 1.3.1 not working here fiddle link <div ng-app="" ng-controller="contactcontroller"> <p>enter email address in below textbox , press add together button:</p> <input type="text" ng-model="newcontact" placeholder="email" /> <button ng-click="add()">add</button> <h2>contacts</h2> <ul> <li ng-repeat="contact in contacts">{{ contact }} </li> </ul> </div> <script> function contactcontroller($scope) { $scope.contacts = ["maha@gmail.com", "hello@email.com"]; $scope.add = function () { $scope.contacts.push($scope.newcontact);

Data decorating and Symfony2 -

Data decorating and Symfony2 - abstract question. there "data decorator" bundle symfony2? or how solve elegantly info localization/formatting problems? for example: float - decimals formatting, monetary info needs monetary formatting integers - formatting - 1'000'000 vs 1.000.000 dates, times etc i know symfony1 had kind decorating going on in templates suit exactly. wasn't perfect, though , arised other problems. anybody knows, there something? or "correct" way solving problem? your question stands vague , answers can considered opinion-based, you're aware native php functions you're asking for, right? float, integer formatting: number_format date/time formatting: datetime class , subsequent format functions twig uses equivalent functions accomplish you're asking for: number_format , date filters. this right standard - , although have literally no experience symfony1, haven't had issue deploying doz