Posts

Showing posts from February, 2013

c# - Asynchronous function call inside tree loader extension function -

c# - Asynchronous function call inside tree loader extension function - i have function load children of node. internally calls wcf async service load. signature follows. public void addchildelements(node parentelement, action<ienumerable<node>> callback) { } this can used like _nodebuilder.addchildelements(parentelement, (elements) => { //do elements }); now want write function expand hierarchy based on condition. write extension function this public static t loadhierarchyuntilitemfound<t>( ienumerable<t> sequence, func<t, list<t>> loadaction, func<t, string> searchstring) { //... } the loadaction parameter expects loading function node.the usage follows elements.loadhierarchyuntilitemfound(loadchildren, "root.uk.england.london"); ...

javascript - hide the overlay using media queries -

javascript - hide the overlay using media queries - when cut down browser size iphone screen menu button appears..... when click button overlay appears.......... overlay appears when increment browser size.... how hide on lay.... rajdq0383@gmail.com http://jsfiddle.net/qyvrt/17/ http://jsfiddle.net/qyvrt/17/embedded/result/ @media (max-width: 767px) { #rightslider{ border: 1px solid red; } #rightslider{ display:none !important; } #rightslider{ display:inherit !important; } } #slidenav{ display:none !important; } #slidenav{ display:inherit !important; } } make media query when width bigger x width go display none @media , (max-width:300){show overlay} @media , (max-width:1024){hide overlay} javascript jquery html css extjs

Django - How to add admin.py in my app folder? -

Django - How to add admin.py in my app folder? - i need add together admin.py in app folder. currently app folder contains next files: __init__.py models.py test.py views.py any help :-) the tutorial edit admin.py in polls directory. however, if you're starting new project admin.py not exist. you can create blank admin.py file , add together contents suggested tutorial. django automatically notice admin settings file when admin app enabled. django django-admin

html - Background positions -

html - Background positions - this image i'm using making 3 direction animation. need show first character of image. using background position- background-position:0px 200px; but showing total image here. styles position:absolute; top: 40px;left: 40px; background-position: 0px 200px; image- please guide me through js fiddle. fiddle see link hope help jsfiddle.net/9ryph/7/ html css background-image background-position

php - Days between two dates and time -

php - Days between two dates and time - $dday = mktime(13, 00,00, 02, 07, 2013); $today = mktime(12,30,00, 02, 08, 2018); $difference = $today - $dday; $datecalculation = floor($difference / 84600); echo $datecalculation; the day 1. not 1. day 1 when time 13.00.can reply me please? the datetime class makes working dates , times much easier them mktime() $datetime1 = new datetime('2013-02-07 13:00:00'); $datetime2 = new datetime('2013-02-08 12:30:00'); $interval = $datetime1->diff($datetime2); $elapsed = $interval->format('%a days %h hours'); echo $elapsed . php_eol; echo "days: " . $interval->format('%a') . php_eol; // output 0 days 23 hours days: 0 see in action php date days date-math

java - Convert string representing key-value pairs to Map -

java - Convert string representing key-value pairs to Map - how can convert string map: map m = convert("a=4 h=x po=87"); // what's convert? system.err.println(m.getclass().getsimplename()+m); expected output: hashmap{a=4, h=x, po=87} there no need reinvent wheel. google guava library provides splitter class. here's how can utilize along test code: package com.sandbox; import com.google.common.base.splitter; import org.junit.test; import java.util.map; import static org.junit.assert.assertequals; public class sandboxtest { @test public void testquestioninput() { map<string, string> map = splittomap("a=4 h=x po=87"); assertequals("4", map.get("a")); assertequals("x", map.get("h")); assertequals("87", map.get("po")); } private map<string, string> splittomap(string in) { homecoming splitter.on("...

c++ - How can a reference require no storage? -

c++ - How can a reference require no storage? - from this question, , consequently, standard (iso c++-03): it unspecified whether or not reference requires storage (3.7). in answers in thread, it's said references have, internally, same construction of pointer, thus, having same size of (32/64 bits). what i'm struggling grasp is: how reference come not require storage? any sample code exemplifying appreciated. edit: @johannesschaub-litb comment, there like, if i'm not using const & , or if i'm using const & default value, requires allocation? seems me, somehow, there should no allocations references @ -- except, of course, when there explicit allocations involved, like: a& new_reference(*(new a())); // a() instance allocated, // not new_reference is there case this? take simple: int foo() { int x = 5; int& r = x; r = 10; homecoming x; } the implementation may utilize pointer...

Manage python version in different virtualenv with pythonbrew -

Manage python version in different virtualenv with pythonbrew - my main scheme python version 2.7.3. i'm trying create virtualenv uses version 3.3.0. installed pythonbrew, virtualenv , virtualenvwrapper. i followed tutorial: http://technomilk.wordpress.com/2011/07/27/setting-up-our-django-site-environment-with-pythonbrew-and-virtualenv/ which runs pythonbrew utilize 3.3.0 , , create virtualenv. tutorial says virtualenv utilize version pythonbrew uses. doesn't. virtualenv uses 2.7.3 when start it. when pythonbrew utilize 3.3.0 , leaves virtualenv , applies scheme instead of environment. apparently, pythonbrew has own virtualenv wrapper, has tutorial at: http://suvashthapaliya.com/blog/2012/01/sandboxed-python-virtual-environments/ i hate doing though. possible utilize virtualenvwrapper along pythonbrew (and not pythonbrew's venv wrapper) able take python version utilize each venv, , maintain them separate scheme python version? also, not want utili...

postgresql - Can't I get to Postgres with plain psql -

postgresql - Can't I get to Postgres with plain psql - i have give command sudo -u postgres psql in order login postgres console. have in order login postgres sudo psql or psql the environment working on ubuntu linux 12.04 thanks in advance. it's normal after installation, postgres user able database server. installer can't assume we'd want open access else. to give access casual user, assuming illustration login name joe (your normal, non-priviledged user), need create corresponding user , database: inside psql postgres administrator (with sudo -u postgres psql ), issue: create user joe; create database joe owner joe; after that, when issuing psql @ shell prompt, connect default own database username. no longer have sudo postgres until need issue other administrator commands. postgresql ubuntu-12.04 postgresql-9.2 postgresql-8.4

.net - Printing A Simple Bitmap -

.net - Printing A Simple Bitmap - i hitting should simple problem, seems solutions seeing pretty complex, figure should inquire here. all need print premade bitmap image (5 inches x 5 inches) inject printer (which cd printer, looks inkjet windows) in vb.net. no dialog needed, want start printing bitmap programme calls it. i made class 4 years ago having hard time replicating did then, , backups missing reason. driving me insane inquire help on simple problem, more crazy maintain banging head against wall. .net vb.net printing bitmap

matlab - dlmwrite appends to the end -

matlab - dlmwrite appends to the end - i writing several lines text file, among matrix. decided utilize fprintf normal text messages , utilize dlmwrite writing matrix file. however, action done in while loop. here outline: k=0; while (k<10): fprintf(file,'%s', 'hello'); dlmwrite(file,m ,'-append', 'newline', 'pc'); fprintf(file, '%s' , 'goodbye'); k= k+1; however, when open file, matrices appended end of text file instead of each beingness between hello , goodbye. there way prepare issue? it may have -append option, according help appends result end of file. you accessing same file 2 functions, fprintf , dlmwrite . this not efficient, closing file after every write fprintf work: clear close file_name = 'aa.txt'; file = fopen(file_name, 'w'); fclose(file); file = fopen(file_name, 'a'); m = randn(5); kk = 1:10 file = fopen(file_name, 'a...

sql - In SMSS what's the difference between NULL and nothing, in a query result? -

sql - In SMSS what's the difference between NULL and nothing, in a query result? - i know maybe newbie question, i'm wondering why null in result, , it's totally blank - shouldn't null? as can see, remarks column has no background color of yellow indicates not null. (null values has.) it contains empty string '' (or maybe spaces) different null because empty string set empty while null not set (nothing). sql ssms sql-server-2008

PHP Curl download PDF files -

PHP Curl download PDF files - what proper way download 50+ pdf files using php curl? below code using: $fp = fopen("test.pdf", 'w'); $ch = curl_init(); curl_setopt($ch,curlopt_proxy,"http://test:123"); curl_setopt($ch,curlopt_proxyport,123); curl_setopt ($ch, curlopt_connecttimeout, 0); curl_setopt ($ch, curlopt_timeout, 500); curl_setopt($ch,curlopt_url,"http://download/test.pdf"); curl_setopt($ch, curlopt_file, $fp); curl_exec($ch); curl_close($ch); fclose($fp); the problem sometimes, 2-3 pdf files not downloaded (0-1 bytes in size). thought why unstable? must include else in code above? thanks in advance web requests in general can pretty dodgy browser , connection. there few things going wrong here remote site refusing connection, simultaneous execution of php file multiple locations. have at: http://www.php.net/manual/en/function.curl-error.php to seek print out error messages somewhere analysis on curl_ex...

ios - How do I add a UITextView to this UITableViewCell? -

ios - How do I add a UITextView to this UITableViewCell? - i have uitableviewcell dynamically sized based on content in it. in heightforrowatindexpath follows: - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { if (indexpath.section == 1 && indexpath.row == 1) { nsdictionary *fields = self.messagedetailsdictionary[@"fields"]; nsstring *celltext = fields[@"message_detail"]; uifont *cellfont = [uifont systemfontofsize:14.0]; cgsize constraintsize = cgsizemake(self.tableview.frame.size.width - 50.0f, maxfloat); cgsize labelsize = [celltext sizewithfont:cellfont constrainedtosize:constraintsize linebreakmode:nslinebreakbywordwrapping]; homecoming labelsize.height + 20.0f; } else { homecoming tableview.rowheight; } } in cellforrowatindexpath customise cell follows: case 1:{ uitableviewcell *cell = [[uitableviewcell new] initwithstyle:uitableviewcellstyledefault...

io - How to compress entire directory keeping it's structure after uncompress? -

io - How to compress entire directory keeping it's structure after uncompress? - i understand how files specified entire directory, don't understand how compress entire directory keeping it's inner construction (i mean inner folders). i utilize zipstorer i'll happy see examples. directory construction separate entity. have acquire directory tree construction , store/compress separately. upon decompression have recreate directory tree , explicitly place files corresponding original positions. io compression archive zipfile

How I display photo from google place api using geturl()? -

How I display photo from google place api using geturl()? - function createphotomarker(place) { var photos = place.photos; if (!photos) { return; } var marker = new google.maps.marker({ map: map, position: place.geometry.location, title: place.name, icon: photos[0].geturl({'maxwidth': 35, 'maxheight': 35}) }); } i utilize above function nil been worked... google-maps google-maps-api-3 google-places-api

scroll view disable only in portrait mode in android -

scroll view disable only in portrait mode in android - i had scrollview in xml scroll view should work in landscape mode of phone not in portrait mode of phone.can possible , if possible should go xml file or through programmatically.if code require please inquire me.thanks here xml file(portrait mode): <scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/scrollview1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#1e90ff" tools:context=".homeactivity" android:scrollbars="none" > <linearlayout android:id="@+id/layout01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#a9a9a9" android:orientation="vertical" > ...

routes - How to send post variables in HttpRedirect or HttpFound in webob in python ? -

routes - How to send post variables in HttpRedirect or HttpFound in webob in python ? - i want send variable in post when doing redirecting in application. scenario this def redirect_with_post(): post_variable = "i post variable" homecoming httpredirect(location="/confirm?id=23&user=user1") # want send post_variable i want send variable in post instead of querystring post request while redirecting. tools , software used:- python, webob, route redirect performed client (your browser). , back upwards single location header. can't send post info through redirect. see https://en.wikipedia.org/wiki/http_302 python routes webob

coldfusion - How to detect if a script is running via a scheduled task -

coldfusion - How to detect if a script is running via a scheduled task - is there way observe if script runned scheduled task. i have script gives throws clientabortexception because using cfflush . need observe if script running via scheduled task script can run successfully. it seems can check via cgi.http_user_agent: <cfif cgi.http_user_agent neq "cfschedule"> <cfflush> </cfif> coldfusion scheduled-tasks railo cfml

actionscript 3 - AS3: Merge multiple 2d Arrays - indexOf not working -

actionscript 3 - AS3: Merge multiple 2d Arrays - indexOf not working - i want merge multiple 2dim arrays of type [unique number][a prepare number] since merge them (and have unique results) i'm searching within "retarr" if array[unique number] present. array1: retarr array2: arg (multiple 2dim arrays) // before here additional "for each"-loop gives me in every iteration "new" arg-array. (var p:uint = 0; p<arg.length; p++){ if(retarr.length ==0){ var tmp:array = new array(); tmp.push(arg[p][0]); tmp.push(arg[p][1]); retarr.push(tmp); } else{ for(var i:uint = 0; i<retarr.length; i++){ if (retarr[i].indexof(arg[p][0]) == -1){ var tmp:array = new array(); tmp.push(arg[p][0]); tmp.push(arg[p][1]); retarr.push(tmp); break; } } } } i think line if (retarr[i].indexof(arg[p][0]) == -1) is problem, since i'm getting double-results in retarr. c...

python - reportlab save location -

python - reportlab save location - i trying save pdf file generated reportlab specific location. possible? code creates pdf own directory. def myfirstpage(canvas, doc): canvas.savestate() canvas.setfont('times-bold',16) canvas.drawcentredstring(page_width/2.0, page_height-108, title) canvas.setfont('times-roman',9) canvas.restorestate() def create_pdf(sometext): doc = simpledoctemplate("myfile.pdf") story = [spacer(1,2*inch)] style = styles["normal"] bogustext = ("there something: %s. " % sometext) p = paragraph(bogustext, style) story.append(p) story.append(spacer(1,0.2*inch)) doc.build(story, onfirstpage=myfirstpage) yes, possible. recommend using os.path.join build path. example: import os def create_pdf(sometext): outfilename = "myfile.pdf" outfiledir = '/somedir' outfilepath = os.path.join( outfiledir, outfilename ) doc = simpled...

templates - Assign to object being created in c++ -

templates - Assign to object being created in c++ - i'm writing functions operate on vector data. i defined objects non-copyable (private re-create constructor , assignment operator). then defined templated operator = template <typename g> inline const tmatrix &operator=(const g &gen) { ir_mat::copy<g, dimension>::start(m_data, gen); homecoming *this; } and operators, '+', '*', described in article. now can assign result of look object: vector3f v1, v2, v3; v1 = v2 + v3; why can't declare variable , assign in single statement? vector3f v1, v2; vector3f v3 = v1 + v2; is because assignment tries create temporary object before instantiating variable, , re-create new object? can utilize operator '=' instantiating new objects, without temporary storage? have define special constructor that? update i defined templated re-create constructor (in simplest form, probably): template <typename ...

jquery - How to connect two ajax request? -

jquery - How to connect two ajax request? - i have next code: <script> $(function () { $('#admincreatenewusersubmit').on('click',function(){ $("#admincreatenewuserform").ajaxform( { target: '#admincreatenewuserformcenter', url: 'update.php', success: function(data) { $("#admincreatenewuserformcenter").html(data); } }); }); }); </script> this code works, need add together request when given data. so have tried following: <script> $(function () { $('#admincreatenewusersubmit').on('click',function(){ $("#admincreatenewuserform").ajaxform( { target: '#admincreatenewuserformcenter', url: 'update.php', success: function(data) { $("#admincreatenewuserfor...

c# - how can i programmatically reposition the ExpandableSplitter -

c# - how can i programmatically reposition the ExpandableSplitter - anyone know how programmatically move devcomponents expandablesplitter? i have tried location change, doesnt anything. , expanded, want opposite effect of expanded action. i have panel expanded via splitter, stored in expandablecontrol of splitter. , want set splitter show expandablecontrol on available space. i seem have found works, there still minimul gap @ bottom cannot rid of. expandablesplitter2.expanded = true; paneltohide.visible = false; expandablesplitter2.visible = false; //to hide much of reply panel possible expandablesplitter2.minextra = 0; expandablesplitter2.maximumsize = new size(1, 1); expandablesplitter2.height = 0; expandablesplitter2.splitposition = this.height; but there still little gap @ bottom. in reply paul ruane, hidepanel dock.fill toppanel dock.top expandablesplitter dock.top c# .net dotnetbar

javascript - Ember.js : How to find records that do NOT have a property set? -

javascript - Ember.js : How to find records that do NOT have a property set? - i have bunch of records "belongsto" other records. (different models, typical 1-n relationship.) how can phone call find on model find have no belongs-to association? something like: app.thing = ds.model.extend({ other: ds.belongsto( 'app.other' ), someattr: ds.attr('string') }); app.thing.find({ other: null }); edit: louiscoquio's solution didn't work me. thought filter in controller. here's how seek it: app.thingsasidecontroller = ember.arraycontroller.extend({ unassigned: function() { homecoming this.filterproperty('other'); }.property('content.@each') }); this works fine if filter someattr cannot filter relationship. i guess question is: property name belongsto association? edit, works: this works, i'm unhappy it: app.thingsasidecontroller = ember.arraycontroller.extend({ unassigned: function() { ...

Arranging values of an arrayList in a specifed order using java -

Arranging values of an arrayList in a specifed order using java - i trying find improve , optimized solution next scenario have arraylist arraylist<order> orders = new arraylist<order>(); and sorted result values in orders follows { medicine, medicine, milk, milk, pillow, soap, toy } and have enum these items is public enum items{ pillow("pillow"), harddisk("harddisk"), milk("milk"), soap("soap"), medicine("medicine"), toy("toy") } my output order should follows { milk, milk, harddisk, medicine, medicine, toy, soap, pillow } in order accomplish trying arraylist<order> resultlist = new arraylist<order>(); for(order order: orders){ if(order.getitemname.equals(items.milk){ resultlist.add(order); } for(order order: orders){ if(order.get...

sql - Update employees table -

sql - Update employees table - guys have next problem: increase salary 15% employees salary less 50% of manager's salary. write pl/sql procedure using cursor, loop , update. procedure header create or replace procedure inc_salary is: . exception if salary after increment more 50% of manager's salary. actually, can straight this: update emp e set e.salary+=e.salary*0.15 e.salary<(select e.mgr emp e, grouping e.mgr) here image of table: but don't understand how utilize procedure. if declare this, create or replace procedure inc_salary , should parameters? can utilize of course of study loop, like declare r in (select * emp e) loop update emp e set r.salary+=r.salary*0.15; r.salary<r.mgr exception if r.salary >r.mgr*1.15 dbms.output_putline(' can't increase'); end loop; end; but how combine together? why need pl/sql procedure? simple query job! update emp set salary = salary * 1.15 empno in ( select e...

c# - Issue with dictionary items -

c# - Issue with dictionary items - i running issue , not sure going on, can help! i gathering entries database , placing them in list collection, using list collection populate dictionary of "active" things, using list template , "active" entry items manipulated until "active" thing removed , new instance of "active" thing inserted dictionary list collection. issue seeing items in list collection beingness updated dictionary items. this problem me @ at least. doing horribly wrong can provide improve solution. for example: public class dataentry { public string dataone { get; set; } public int datatwo { get; set; } } public static list<dataentry> datacollection = new list<dataentry>(); public static dictionary<int, dataentry> activelist = new dictionary<int, dataentry>(); private static int activeindex = 0; public static void loadlistfromdb() { datacollection.add(new dataent...

jquery - What is the event called when a text inside textbox changes? -

jquery - What is the event called when a text inside textbox changes? - $(document).delegate("input#search-champions", "change", function(e) whenever alter value within search-champions , have click outside of textbox create work. want function run whenever value within textbox changes. i forgot called, it's same scheme google uses it's searches. write a, , it'll show results a. try binding keyup event instead: $(document).delegate("#search-champions", 'keyup', function(e) by way, there should no need prepend selector input - ids should unique anyway! jquery

parallel processing - Finding the amount of execution time spent on each processor in a Beowulf cluster -

parallel processing - Finding the amount of execution time spent on each processor in a Beowulf cluster - i have downloaded lu decomposition programme next link http://www.cs.nyu.edu/wanghua/course...el/h3/mpi_lu.c , programming running well...the reason me writing thread can 1 help me getting time of execution spent on processors of nodes connected in cluster aid me in getting statistical value cluster. kindly, help me don't know much mpi programming, want amount of time spent on each processor of nodes in cluster above program. there @ to the lowest degree 2 ways of getting times seek, or @ to the lowest degree close approximation them. if have job management scheme installed on cluster (if don't should have) expect log time spent on each node each process involved in computation. grid engine keeps info in accounting file , provides utility qacct inspecting file. i'd surprised larn other used job management systems don't offer similar inf...

mod rewrite - Is HTTP 301 the best way to integrate an existing website with AWS CloudFront? -

mod rewrite - Is HTTP 301 the best way to integrate an existing website with AWS CloudFront? - we have existing web product uses lot of static images, css files, js libs , other static content. whenever page loaded, browser has create dozens of additional http requests retrieve content doubles load time. wanted set content amazon's cloudfront improve load times , trying take between 2 possible ways of implementing this. 1). going through every single reference such content , replacing request cloudfront. e.g. images/image.jpg become qwerty.cloudfront.net/images/image.jpg. result in "true" integration practically impossible me implement this. different js libs come own images take dynamically. 2). leave images/image.jpg , tell server 301 cloudfront such requests. problem implementation requests have routed way server before server can redirect them cloudfront. so not sure if 301 idea. work if time route request our server negligible compared time takes serve...

c# - Creating thumbnail of image on Windows Phone 8 in threadpool -

c# - Creating thumbnail of image on Windows Phone 8 in threadpool - i need create thumbnail of image on wp8, , i'm facing difficulties. in nutshell, know 1 way of doing this, using classes system.windows.controls.image , system.windows.media.imaging.bitmapimage , system.windows.media.imaging.writablebitmap . i'm trying perform thumbnail creation on threadpool, because it's part of other bigger operation, running on threadpool. as have understood, i'm failing invalid cross-thread access, when i'm trying create instance of above classes. that's shame, really, because thumbnail not going used in ui, saved file, , displayed file later on. work has nil ui thread, , i'm still facing limitations. so there other way of creating thumbnail image stream (i'm getting photochooser task)? maybe other api, doesn't require ui-bound classes? tried bing it, google it, no luck. okay, think i'll set own reply here well, since shows things bit of ...

javascript - Convert an xml node to string -

javascript - Convert an xml node to string - i'm getting xml reply server using jquery , need have 1 of kid nodes string farther work it. here code: class="lang-js prettyprint-override"> function pollserver(dataobject) { $.ajax({ type: "post", url: '/server.php', data: dataobject, success: function (data) { $xmldoc = $(data); $listen = $xmldoc.find('listen'); console.log($listen); }, datatype: 'xml' }); } i tried using (new xmlserializer()).serializetostring(listen) gives me empty string. the next should work fine xml: var hear = $("listen", data)[0].outerhtml; javascript xml

I need help formatting output with PowerShell's Out-File cmdlet -

I need help formatting output with PowerShell's Out-File cmdlet - i have series of documents going through next function designed count word occurrences in each document. function works fine outputting console, want generate text file containting information, file name appended each word in list. my current console output is: "processing document1 x unique words occuring follows" "word1 12" "word2 8" "word3 3" "word4 4" "word5 1" i want delimited file in format: document1;word1;12 document1;word2;8 document1;word3;3 document1;word4;4 document1;word1;1 document2;word1;16 document2;word2;11 document2;word3;9 document2;word4;9 document2;word1;13 while function below gets me lists of words , occurences, i'm having hard time figuring out or how insert filename variable prints @ head of each line. msdn has been less-than helpful, , of places seek insert variable result in erro...

How do I execute an SSIS 2008 package from .NET 4.0 Windows Service? -

How do I execute an SSIS 2008 package from .NET 4.0 Windows Service? - i have .net 4.0 windows service application (vs2010), need phone call ssis 2008 package. i know easier create web service , phone call service ssis, not @ liberty that. so, figured next best alternative phone call ssis bundle windows service. know in .net 2.0 can phone call dts package, , if have sql server 2012 installed. but not able find solution specific combination. .net 4 , sql server 2008 ssis. or there way using same combination can start , stop windows service using ssis 2008. , figure out when windows service finished running. refer section using web service or remote component run remote bundle programmatically in below msdn documentation. loading , running remote bundle programmatically sql-server-2008 .net-4.0 ssis

robotics - Pioneer 3d sonar sensor model parameter -

robotics - Pioneer 3d sonar sensor model parameter - did worked sonar in pioneer 3dx robot. i wanted know sonar sensor model parameters,which work well. i searched , got laser model parameter ros didnt sonar :( robotics mobile-robots

eclipse - Android emulator: changing soft keyboard language -

eclipse - Android emulator: changing soft keyboard language - i want alter android emulator soft keyboard language. far, have japanese layout , tried lot of things unsuccessfully. want have english language (or whatsoever western latin) layout. can help me? long press on key shown below it show next menu select appropriate keyboard type , language show keyboard android eclipse android-emulator

tdd - How to do a smoke Test and Acceptance test in a Javascript Aplication? -

tdd - How to do a smoke Test and Acceptance test in a Javascript Aplication? - i want smoke test in order test connection between web app , server itself. know how it? in add-on want acceptance tests test whole application. tool recommend? my technology stack is: backbone , require.js , jquery mobile , jasmine bdd test. regards when doing bdd should mock collaborators. tests should run , not depend on external resources such servers, apis, databases etc. the way want create in f.e. jasmine declare spy pretends server. move on defining response of spy in particular scenario or example. this best aproach if want application environment undependent. needed when running jenkins jobs - building whole infrastructure around job hard reproduce. make spy/mock objects represent server , in specs define how external sources behave - way can focus on behavior application delivers under specified circumstances. javascript tdd bdd acceptance-testing smoke-testing

css - LESS Mixin for Line-height -

css - LESS Mixin for Line-height - i using mixin generate rem font-size fallback pixel sizes, generate line-height 1.5 times font-size. .font(@size: 16px, @line: @size) { @remfont: (@size / 10); @remline: (@size / 10) * 1.5; font-size: @size * 1px; font-size: ~"@{remfont}rem"; line-height: @size * 1.5px; line-height: ~"@{remline}rem"; } the negative is requires me come in value line-height, although not needed 1 time compiled. less using mixin such: .font (13, 10); and results in outpu: font-size: 13px; font-size: 1.3rem; line-height: 19.5px; line-height: 1.9500000000000002rem; is there way rework mixin output line-height 1.5 times font-size, without needing come in value? found solution. seems using @string value works without requiring more value singular. mixin: .font(@string) { @remfont: (@string / 10); @remline: (@string / 10) * 1.5; font-size: @string * 1px; font-size: ~"@{remfont}em"; line-height: @string * 1.5px;...

php - preg_replace with style format issue -

php - preg_replace with style format issue - i have text stored in databse: <div style=\"font-family:arial black;font-size:20px;text-align:center;color:#3333ff;font-weight:700;\">testing editor</div> now when trying process website editor i'm using function: function striplen($text) { // strip slashes $text = stripslashes($text); // find errors quote $errors = array("#\r\n#", '#"#'); // find right self content $corrected = array('\r\n', ''); homecoming preg_replace($errors, $corrected, $text); } this out set text this: <div style=font-family:arial black;font-size:20px;text-align:center;color:#3333ff;font-weight:700;>testing editor</div> as can see double quotes style tag disappeared? any suggestions? many thanks, php

osx - how to solve javax.servlet.ServletException: java.lang.UnsupportedClassVersionError? -

osx - how to solve javax.servlet.ServletException: java.lang.UnsupportedClassVersionError? - i download project svn in mac osx 10.8.2 and utilize ant compiled. error javax.servlet.servletexception: java.lang.unsupportedclassversionerror unsupported major.minor version 51.0 when run jsp.. i search problem in google, seems problem cause compiled version different running version..and solution set complied in eclipse.. work without eclipse.. i run java-version, show me java version "1.7.0_05" java(tm) se runtime environment (build 1.7.0_05-b06) java hotspot(tm) 64-bit server vm (build 23.1-b03, mixed mode) so how can check ant compiled version in mac , how solve problem?? give thanks help , sorry bad english.. unsupportedclassversionerror because of java version mismatch between running , compile versions . both versions should match in order avoid error go through below link more details ant version change. why ant giving me unsupported major.minor v...

iphone - Getting string from NSManagedObject -

iphone - Getting string from NSManagedObject - when seek string value nsmanagedobject, this <entity: 0x1e043140> (entity: entity; id: 0x1e041c30 <x-coredata://8f48c331-b879-47b4-b257-4802a13ed12c/entity/p4> ; data: { number = "<uitextfield: 0x1d8b7cc0; frame = (159 183; 161 30); text = 'test'; clipstobounds = yes; opaque = no; autoresize = rm+bm; gesturerecognizers = <nsarray: 0x1d8b3c10>; layer = <calayer: 0x1d892a30>> : "; }) how string (it's text = 'test';) i object using this nsstring *rowvalue = [self.fetchedresultscontroller objectatindexpath:indexpath]; ok, nsmanaged object , sets uitableview cell string nsmanagedobject *object = [self.fetchedresultscontroller objectatindexpath:indexpath]; cell.textlabel.text = [[object valueforkey:@"number"] description]; the reason it's showing because, can see, getting it's description. can't find property homecoming text value, know ...

javascript - Date toLocaleDateString in node -

javascript - Date toLocaleDateString in node - when utilize tolocaledatestring in browser returns n = new date() n.tolocaledatestring() "2/10/2013" but in node.js format different n = new date() > n.tolocaledatestring() 'sunday, feb 10, 2013' how browser's format ( mm/dd/yy ) in node.js? date.prototype.tolocaledatestring = function () { var d = new date(); homecoming (d.getmonth() + 1) + "/" + d.getdate() + "/" + d.getfullyear(); }; javascript node.js

Javascript 'arguments' Keyword -

Javascript 'arguments' Keyword - my understanding can phone call array.prototype.slice.call(arguments, 1) homecoming tail of array. why won't code homecoming [2,3,4,5] ? function foo() { homecoming array.prototype.slice.call(arguments,1); } alert(foo([1,2,3,4,5])); because you're passing one argument — array. try alert(foo(1,2,3,4,5)); arguments numbered 0 in javascript, when start piece @ 1 , pass 1 argument, nothing. note can hamper optimization allow arguments object "leak" out of function. because of aliasing between arguments , formal parameters, optimizer can't static analysis of function if arguments object gets sent somewhere else, because has no thought might happen parameter variables. javascript

java - Disabling other action while a JFrame is open -

java - Disabling other action while a JFrame is open - this question has reply here: disable jframe when new jframe opened 2 answers i wondering if possible disable other action when jframe opened in java. just this? is there easy code this? this has been asked many times , reply same: utilize modal jdialog or joptionpane (which version of modal jdialog), not jframe. for example, please check out mkorbel's reply here. java swing jframe modal-dialog jdialog

arrays - descending order is not working properly c programming -

arrays - descending order is not working properly c programming - the ascending order doing great job. when come in number different one, should phone call descending order, think defined. yet have random sorting.. #include<stdio.h> void sort(int b[], int size, int (*upordown)(int a, int b)); void swap(int *elt1, int *elt2); int ascending(int a, int b); int descending(int a, int b); main() { int size =8; int order,a[size],i; fprintf(stdout, "please come in sequence of numbers wish sort:\n"); for(i =0; i<size; i++) { scanf("%d", &a[i]); } printf("\n please come in 1 ascending order or 2 descending order"); scanf("%d", &order); if(order == 1) { sort(a, size, ascending); } else { sort(a, size, descending); } printf("here new re arranged array: \n"); for(i =0; i<size; i++) { printf("%d\t", a[i]); } printf("\n"); homecoming 0; } void sort(int b[], int size, int (*upord...

How to execute some javascript without modifying the global scope? -

How to execute some javascript without modifying the global scope? - i want phone call javascript code own purposes needs define variables, want isolate doesn't pollute global scope. wrap in anonymous function object, phone call immediately, , don't assign or result anything: function() { var myinnerhelperfunction = function(object) { //do work }; var anobject = ...; myinnerhelperfunction(anobject); }(); but syntax error: syntaxerror: unexpected token ( you can't invoke function declaration. need create look instead. commonly seen technique accomplish wrap function in parentheses: (function() { var myinnerhelperfunction = function(object) { //do work }; var anobject = ...; myinnerhelperfunction(anobject); }()); however, note unary operator work (anything causes build parsed expression, rather declaration): ~function example() { console.log("example"); }(); to expand upon fu...

tcp - Sending binary file data through sockets -

tcp - Sending binary file data through sockets - i trying write socket programme in c using tcp sends binary file info server client, don't know how it. in other words, need download binary file server client. any ideas? for sockets there no difference what info within packet. it's called payload in terms of networking , structure, format of import applications send/receive it. question of "sending binary info through sockets" transforms "how send info through sockets" answered multiple times in , there plenty of tutorials on internet. did not mention platform using, start here linux , here windows or google around socket programming. tcp serversocket

nested json parsing for android with jackson -

nested json parsing for android with jackson - i started android prograamming , found nice tutorial using imdb api. instead of using xml in tutorial utilize json , recevied json have problem. person.json: [ { "score":1, "popularity":3, "name":"brad pitt", "id":287, "biography":"test", "url":"http://www.themoviedb.org/person/287", "profile":[ { "image":{ "type":"profile", "size":"thumb", "height":68, "width":45, "url":"http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w45/w8zjqun7tzlm6fy9mfgkihxp3cb.jpg", "id":"4ea5cb8c2c0588394800006f" } }, { "image":{ "typ...

c# - Async programming against non-async services -

c# - Async programming against non-async services - this past year we've been working on new web app calls our company's existing service layer. we made decision wrap of our service oriented calls our own service layer (which i'll refer our web-service layer) details of services utilize (we'll move new api @ point in future) hidden web layer itself. we decided of our web-service layer methods homecoming task<t> . as stands, underlying services phone call not async , there concerns our web-service layer max out available threads , cause problems when have big volume of users. i'm looking information, 1 way or other, farther understand how our decision homecoming task<t> impact our site , whether or not need consider changing our homecoming types. we'll moving vs2012 @ point right we're using vs2010 , not using async , await . as stands, underlying services phone call not async , there concerns our web-service l...

asp.net - Jquery Assign label text which is in gridivew -

asp.net - Jquery Assign label text which is in gridivew - how label within gridview , assign text label using jquery. in general utilize next assigning text in jquery ("[id$='label1']").val('value') or $('#<%=label1.clientid%>').val('value') but command within gridview how can assign text this listview <tr> <td style="width: 50px; text-align: center;" rowspan="2"> <asp:label id="lblid" runat="server" text=""></asp:label> </td> <td style="width: 50px; text-align: center;" rowspan="2"> <asp:label id="lblfirstname1" runat="server" text='<%# bind("firstname") %>'></asp:label> </td> </tr> and in script file write per below $("[id$='lblid']").text('value'); didn't worked $('<%="#"+gridviewdat...

eval - Chrome Extension sandbox and message passing -

eval - Chrome Extension sandbox and message passing - i have old chrome extension want update manifest version 2. noticed have eval function phone call cannot rid of. i'm trying understand new chrome sandbox feature lets me eval phone call within of it. question is: loading sandbox page in background, can pass string containing execute, have executing script, outputting result on popup page? at first thought possible looking @ examples apparently script evaluated has in sandbox page. thanks google-chrome-extension eval sandbox

vb.net - Visual Basic 2010 crashes when clicking in specific subroutine -

vb.net - Visual Basic 2010 crashes when clicking in specific subroutine - when clicking in specific subroutine in visual basic 2010, application crashes giving error message "microsoft visual basic 2010 [express] has encountered problem , needs close." nothing appears in log , safe mode doesn't help. when had problem, found due line continuation on 400 lines. for example: dim somestring string somestring = "some text , line continuation " & _ "and more text 400 lines " & _ ... & _ "and finish string" to prepare it, had create code little sloppier combining multiple "lines" on 1 line. hope helps else! vb.net vb.net-2010

ruby on rails - How to test mongoid scopes? -

ruby on rails - How to test mongoid scopes? - i defined next user class scopes : class user include mongoid::document include mongoid::timestamps include mongoid::search # scopes scope :all_admins, where( role: :admin) scope :recents, order_by(created_at: :desc) scope :olders, order_by(created_at: :asc) field :role, type: symbol end if utilize next rspec test : describe 'scopes' let(:admin1) { fabricate(:admin) } let(:admin2) { fabricate(:admin) } describe 'recents' 'should homecoming admins recent older' user.all_admins.recents.should eq([admin1, admin2]) end end end i next fail message : got: #<mongoid::criteria selector: {"role"=>:admin}, options: {:sort=>{"created_at"=>-1}}, class: user, embedded: false> so how test scope ? mongoid lazy loads, do: user.all_admins.recents.to_a.should eq([admin1, admin2]) sid...

windows - Deploying rails app Capistrano plenty ERRORS -

windows - Deploying rails app Capistrano plenty ERRORS - i trying deploy rails application first time on vexxhost. using github source code management , capistrano. here deploy file require 'bundler/capistrano' require 'capistrano' require 'bundler' require 'capistrano-vexxhost' # business relationship settings ssh_options[:forward_agent] = true set :scm_command, "/home/user/opt/bin/git" set :local_scm_command,"git" set :user, "xxxxxxxx" set :password, "xxxxxxxxx" set :domain, "domain.com" set :mount_path,"/home/xxxxxxxx/xxxxxxx" set :application,"app name" set :scm, :git set :deploy_via, :copy set :repository, "git@github.com:xxxxx/xxxxxxx.git" default_run_options[:pty] = true problem no 1) as installed gem 'capistrano' gem 'capistrano-vexxhost' got next error when trying run application lo...

cordova - Reusing server code in a GWT+phonegap app avoiding RPC -

cordova - Reusing server code in a GWT+phonegap app avoiding RPC - we create mobile version of our web page. in page have used rpc services in service way, not totally entity oriented. going have 2 clients (web , mobile) calling 1 server. now want reuse server code supporting several client versions , avoiding "dto version hell" rpc calls have. i have seen need create wrapper, layer in server, exposing methods mobile versions (gwt+phonegap , in future: ios, android...). later layer reuse server code (model, repositories... etc), in server access bigtable done through objectify. which technology utilize new layer? for mobile apps utilize autobeans + requestbuilder on client , autobeans , restful api (also) produces json on server side. with autobeans define construction of info java interfaces. (which gives programme against) , autobeans handles conversion object json , json object on server , on client well. in combination can build fast , architec...

cocoa - How to detect the language of NSString -

cocoa - How to detect the language of NSString - this question has reply here: detect language of nsstring 3 answers is there away observe language text in nsstring. need know language text display differently. you can't of course. read app internationalization guidelines. cocoa nsstring nlp

drupal 6 - Limit available panes in the Views UI -

drupal 6 - Limit available panes in the Views UI - i'm trying configure views ui users can see specific panes (i.e. fields, filters , style settings panes). tested simpleviews , views ui: edit basic settings modules, wasn't useful. hiding panes jquery not way. does have solution? drupal-6 drupal-views

zend framework2 - Extending ZfcUser Authorization -

zend framework2 - Extending ZfcUser Authorization - i looking kind of direction and/or guidance on how best extend zfcuser include 3rd property authentication beyond username/email & password. i looking add together "domain" field include in authentication. i have figured out how utilize custom entity add together property user object (and orm mapping) , adding login form, need authenticate utilize 3rd field along username/email & password , available in identity set. any guidance on appreciated. zend-framework2 zfcuser

php - How do I get the complete string of a BLOB using PDO? -

php - How do I get the complete string of a BLOB using PDO? - i'm creating c# php info connector allow standardized connection web server host info database c# winform application. working 1 little exception. the basic of utilize this. c# sends aes encrypted command server. server parses command , performs sql query , returns aes encrypted string. string converted datatable in c#. when sql contains column blob i'm getting little part of total data. seems field beingness limited first 2792 bytes. is there setting preventing total contents of blob returned? i'm not sure if helpful, here code work. $dataconnection = new pdo('mysql:host=10.10.100.102;dbname=jmadata', "root", "nbtis01"); $dataconnection->setattribute(pdo::attr_errmode, pdo::errmode_exception); if (isset($parameters['sqlquery'])) { // default list $sqlquery = $parameters['sqlquery']; unset($parameters['sqlquery']); } if (...

validation - Sencha Touch 2 How to restrict datepicker showing future dates -

validation - Sencha Touch 2 How to restrict datepicker showing future dates - could 1 please help me restrict sencha touch datepicker not displaying / allowing future dates in desired datepicker field. please it can implemented follows, { xtype : 'datepickerfield', label : 'date', picker : { yearfrom : 2000 } } validation extjs datepicker sencha-touch-2

drop down menu - C# DropDown List default value -

drop down menu - C# DropDown List default value - i using code input values database table dropdown list: <div class="editor-field"> @html.dropdownlistfor(model => model.tourimageid, new selectlist(model.images, "imageid", "filename", model.tourimageid)) </div> what trying add together item top of list, not nowadays in database table. something dropdown list values = (default-item) + (database-table-items) is possible? if so, how? if model.images of type selectlist , can in controller: var query = unitofwork.globalimagelibraryrepository.images.select(x => new { x.imageid, x.filename }); viewmodel.images = new selectlist(query.asenumerable(), "imageid", "filename"); viewmodel.images.insert(0, new selectlistitem { value = "0", text = "--select--" }); i've assumed have method in globalimagelibraryrepository class returns iqueryable<images> this: pub...

java - Want to update or refresh listview -

java - Want to update or refresh listview - i have listview looking below it 1 kind of radio based application in when user tap on image asynctask called , music played , getting info replaced amit siddhpura text below code holder.imgplay.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { new metadatatask2().execute(holder.txtmetadata); } class streamholder { textview txtstreamname; textview txtstream; textview txtmetadata; imageview imgplay; } and metadatatask2 class code below class metadatatask2 extends asynctask<textview, void, icystreammeta> { string title_artist; textview txtview; @override protected com.example.xmlparsingex.icystreammeta doinbackground(textview... arg0) { txtview = arg0[0]; homecoming streammeta; } @override protected v...

python - Unable to import Java classes from Jython module -

python - Unable to import Java classes from Jython module - note: found solution , answered myself. though, have no thought why setting wrong , caused problem. i'm still interested in having explanation how jython import scheme works; if cares gain bounty please reply that. i'm working on existing java ee project need computations in python. i'm @ first stages of integration tests i'm facing issue. read chapter 10 of jython book still can't find solution. read chapter 8 (modules , packages code reuse) me it'is unclear. an explanation of how jython import scheme works , how configure appreciated. the problem: $ jython -v import: 'exceptions' org.python.core.exceptions in builtin modules jython 2.5.3 (2.5:c56500f08d34+, aug 13 2012, 14:54:35) [java hotspot(tm) server vm (oracle corporation)] on java1.7.0_10 import: import site # precompiled /home/me/jython/2.5.3/lib/site$py.class import: 'sys' sys in builtin modules import: imp...

java - Retrieving JSON in HTML javascript -

java - Retrieving JSON in HTML javascript - i using struts 1.2 in application. what trying achieve: 1) sending ajax request using javascript action 2) returning json object response action 3) retrieving , parsing json response in javascript 4) using value. i done first 2 steps struck 3rd 1 (retrieving json): javascript code: function gettransactionid(transactionid){ var xhr = new xmlhttprequest(); xhr.onreadystatechange = function(){ if(xhr.readystate == 4){ if(xhr.status == 200){ alert(xhr.responsetext); //var p = json.parse(xhr.responsetext); //alert(p); } } }; xhr.open("post", "returnmedia.do?transactionid=" + transactionid, true); xhr.send(null); } action code: string actualreturndatejson = new gson().tojson(actualreturndatemap); system.out.println(actualreturnd...

arrays - JSON to String Javascript -

arrays - JSON to String Javascript - this question has reply here: how homecoming response asynchronous call? 11 answers the code below not seem able concatenate json result string, have thought why? function wordcloud(filename) { var file = filename; var text = " "; $.getjson(file, function(data) { $.each(data, function(key, val) { text = text.concat(val.tostring()); }); }); console.log(text); } thanks it execute fine, have add together console.log within statement because otherwise, getjson code runs asynchronously , in meantime when command reaches console.log statement, text yet empty. have modify code in next way: $.getjson(file, function(data) { $.each(data, function(key, val) { text = text.concat(val.tostring()); }); console.log(text); }); javascript array...