Posts

Showing posts from August, 2011

Do I need to use src:local("?") to use webfonts in css -

i had used code web-font, tutorial.not sure src:local(), means.is necessary include local()?or fine use font-family:... , src:url()? @font-face { font-family:"f25"; src:url("f25_executive-webfont.eot"); src:local("f25"), url("f25_executive-webfont.ttf")format("truetype"); } #quote { font-family:"f25",georgia; text-align:center; } many in advance.

subquery - Improving this MySQL Query - Select as sub-query -

i have query select shot.hole hole, shot.id id, (select s.id shot s s.hole = shot.hole , s.shot_number > shot.shot_number , shot.round_id = s.round_id order s.shot_number asc limit 1) next_shot_id, shot.distance distance_remaining, shot.type hit_type, shot.area onto shot join course on shot.course_id = course.id join round on shot.round_id = round.id round.uid = 78 this returns 900~ rows in around 0.7 seconds. ok-ish, there more lines required (select s.id shot s s.hole = shot.hole , s.shot_number > shot.shot_number , shot.round_id = s.round_id order s.shot_number asc limit 1) next_shot_id, for example (select s.id shot s s.hole = shot.hole , s.shot_number < shot.shot_number , shot.round_id = s.round_id order s.shot_number asc limit 1) past_shot_id, adding increases load time 10s of seconds far long , page doesn't load @ or mysql locks , using show processlist shows query sat there sending data...

jquery - How to search/filter by image source? -

i'm trying make page can filter source name of image. i found script it's working on text: http://kilianvalkhof.com/2010/javascript/how-to-build-a-fast-simple-list-filter-with-jquery/ fiddle: jsfi ddle.net/svjrk/ what need filter image source? see: jsfi ddle.net/svjrk/1/ any advice great! in answer question asked in title, attribute contains selector you're looking for: $('img[src*="sport"]') which select images , src property contains sport . as question specifically, there number of issues: you're passing $('#list') listfilter function, don't have element id . you're calling $(list) within function body, you've passed list jquery object, there's no need wrap again. you're looking anchors contain given string, don't have anchors within list (you have images ). there's no need custom :contains selector if need check if string contained within src of image (you can use at...

javascript - Ajax method is not working in FF -

i using following js code call web handler. code calls handler in ie , not ff. $.ajax({ type: "get", url: "../masterpages/ahmhandler.ashx?t=1", datatype: "html", success: function (msg) { document.getelementsbyname('cartid')[0].value = msg; } , error: function (e) { return false; } }); sleep(2000); what problem code? having seen sleep() call in code, , comment alert() , problem lack of understanding of how ajax code works. when mak ajax call, called asynchronously . means call made, , rest of current function carries on running without stopping wait ajax code run. the ajax success function called eventually, when http request complete. in meanwhile, current function carry on running . the point here cannot rely on given sequence of events if have code in same function runs after ajax call m...

Caching in Codeigniter -

please provide me example caching webpage in codeigniter. view page going same always., i.e., static view page. takes long time load webpage used. please put htaccess file in folder , write : header set cache-control "max-age=29030400, public" now please put htaccess file in folder file want make cache.

c++ - Inheriting classes and namespaces -

what want make changements in func.cpp , func.h inherit main.cpp , then, generate diagram class @ end in states func inherited. i want make changements in code, namespace classes, allow inheritance process. i ' m having follow: in func.h: namespace func { void f1(...); void f2(...); } in func.cpp namespace func { void f1(...) { } void f2(...) { } } in test.cpp (which meantime class having test.h) , it's possible call f1 , f2 follow: func::f1(...); func::f2(...); if change namespace class, still want call func1 , func2 using same syntax (e.g. func::func1() ), have make functions static : struct func { static void func1(); static void func2(); }; if want override func1 in inherited class it's simple: struct func2 : public func { static void func1(); }; there problems static member functions, in can't access non-static members easily.

windows - How to change look and feel of console? -

Image
i know if there library responsible changing , feel of console. found interesting program displays coloured text , has gray bar overhead. how it's possible? there thread here asking console libraries portability perspective. mentions rlutil seem start. a quick google brings few results. consolelibrary looks ok.

jquery - Keep H1 On Single Line -

i have several divs <div class="left"> <h1>title</h1> <p>content</p> </div> ... <div class="left"> <h1>title</h1> <p>content</p> </div> some of titles long. css behind class is .left { width: 32%; float: left; margin: 5px; } the issue if user resizes browser, long titles, pushed content down if had 2 or more divs side side 1 having short title , 1 having long title, wouldn't line up is there way around either resizing h1 tag or else containers thanks, jj try changing css this... .left { width: 32%; float: left; margin: 5px; white-space: nowrap; } the nowrap property should stop text wrapping onto next line, regardless of if can fit or not.

android - How to set a background using an image and color to be used in theme style? -

so i've tried using list-layer(window_background.xml) , theme: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="@color/background_grey" /> </shape> </item> <item android:top="60dp"> <bitmap android:src="@drawable/logo_home_white_agora" android:gravity="center"/> </item> theme: <style name="theme.customtheme" parent="android:theme"> <item name="android:windowbackground">@drawable/window_background</item> <item name="android:windowtitlebackgroundstyle">@style/customwindowtitlebackground</item> the problem using list-layer doesn't seem redraw background on configuration changes use specific size image. there way this?

Amazon ec2 instance creation issue -

i have created amazon ec2 instance. while trying login using key(.ppk) file, giving error, saying: server refusing key file and no supported authentication methods available i using username as, ec2-user. can me asap. you trying login via ssh without key. need generate key pair, send public key instance (via web interface), , connect ssh using private key.

java - Rotate surfaceview according to display orientation -

i facing problem while writing camera application. layout this. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:id="@+id/mainlayout" > <surfaceview android:id="@+id/surface" android:layout_width="240px" android:layout_height="160px" /> <!-- horizontal blue line --> <view android:layout_width="match_parent" android:layout_height="1px" android:background="@color/blue"/> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <scrollview android:layout_width="wrap_content" android:layou...

c - What i = 1, 23 ;means. -

this question has answer here: uses of c comma operator [duplicate] 20 answers how comma operator work during assignment? 5 answers this funny thing happened when make mistake . i write : int i; i = 1; but is int ;i = 1 ,23; (i guess sometime click middle button of mouse) . then compiled program gcc , went through without warning or error! and after notice . try int = 1,23; , , compile give error: error: expected identifier or ‘(’ before numeric constant so ,why first time compile suceessful ? and why give me error second time? what ", 23" means? thanks in advance.

excel - Copying specific condition meeting data from one worksheet to another -

Image
i have 3 worksheets, 1 list of cheques write, 1 list of cheques personal account , 1 list of cheques business account. i dont know how make cheques name "business" go worksheet 3 , ones name "personal" go worksheet 2. example : worksheet 1 name cheque no. date amount currency personal 1234567 10/8/13 10000 hkd business 1234567 9/8/13 10000 usd worksheet 2 name cheque no. date amount currency personal 1234567 10/8/13 10000 hkd worksheet 3 name cheque no. date amount currency business 1234567 9/8/13 10000 usd step 1: in 'worksheet 1' include 1 more column 'count' , following; drag formula down step 2: in 'worksheet 2' this; ie each column; 'name' ="personal"&row(p1) 'cheque no' =iferror(vlookup(a2,sheet1!$b$2:$f$9,2,false),"") 'date' =iferror(vlookup(a2,sheet1!$b$2:$f$9,3,false),"") ...

partitioning - SQL "over" partition WHERE date between two values -

i have query partitions , ranks "note" records, grouping them id_task (users add notes each task). want rank notes date, want restrict they're ranked between 2 dates. i'm using sql server 2008. far select looks this: select note.id, note.id_task, note.[days], note.[date], row_number() on (partition id_task order cast([date] date), edited asc) rank note note.locked = 1 , note.deleted = 0 now, assume if put clause @ bottom, although they'll still have ranks, might or might not item rank 1, might filtered out. there way can partition records , ignoring of others? partition sub-query guess. the intention use rank number find recent note each task, in query. in query i'll join result rank = 1. row_number() operates after where . you'll row 1. for example: declare @t table (id int) insert @t values (3), (1), (4) select row_number() on (order id) @t id ...

python - how to execute commands on remote machine using pysphere -

have vmware vm on wanted execute commands example shutdown /r or dir /o:d etc... remote machine. using module pysphere module communicating vm. i tried start_process creating process cmd.exe code creating process vm_object.start_process('cmd.exe', args=["shutdown /r"]) when run command cmd.exe need add /c: cmd.exe /c shutdown /r as explained here , need tell cmd.exe run parameter passed string. command running cmd.exe without issuing command passed parameter. /c flag instructs cmd.exe execute parameter passed.

sql - Violation of primary key constraint error when no duplicate exists in target -

i violation of primary key constraint error on single record when try insert existing table. the first time issue appeared within merge statement, can reproduce issue trying insert record alone through . the primary key on varbinary(20) value generated hashbytes function on concatenation of values of approximately 20 column values. varbinary(20) value i'm trying insert not present in target table , present once in source table. when filter on actual column values, result same; 1 record in source , 0 records in target. the target table has 101 178 878 rows. primary key not clustered index on table, there bigint identity column serving clustered index. there no triggers on target or source. collations same on (danish_norwegian_ci_as). instance sql server 2008 r2, standard edition. i'm totally stuck, , hope has offer. thank reading :-) this value fails: 0x0571f5f713cf220bb0db057bbce7e158ca6f89c0 in target, following values closest 1 failing. there no value equal...

java - Remote Breakpoint without local jars -

can set breakpoint in remote debuggee without having local jars? i have exception in thread "main" java.lang.nullpointerexception @ org.jboss.as.security.service.simplesecuritymanager.authenticate(simplesecuritymanager.java:436) now i'd have create java project, add jboss jars , create method entry breakpoint. can skip this? shouldn't possible eclipse, add method entry breakpoint @ method of exception? jvm ti support this? you can't. need class file atleast set break point.

perl - Why this code produces warning: Use of uninitialized value -

this code: my $url = 'http://172.27.1.250:8080/x/services/xsoap'; $soap = soap::lite->new( service=> 'http://172.27.1.250:8080/x/services/xsoap?wsdl', proxy => $url ); $soap->autotype(0)->readable(1); $soap->ns('http://www.example.org/x/'); $som = $soap->call('servicex', soap::data->name('servicexrequest')->value($value)); generates following warning use of uninitialized value $ns in string eq @ /home/user/perl5/lib/perl5/soap/lite.pm line 3396. what should rid of without supressing warnings? probably because soap::lite expecting $ns variable (an xml namespace identifier) have value, have not set. your best course of action @ line 3396 , see going on there. maybe it's bug in version soap::lite. have check rt queue module?

ios - MonoTouch - Set Code Signing Identity to Don't Code Sign -

how set code signing identity don't code sign using monotouch. dont want code sign app. made necessary changes in sdksettings.plist file in xcode can select don't code sign rather provisioning profile. couldn't find such option using monotouch. there isn't way avoid code signing app bundles in xamarin.

Convert SQL query / loop into PDO -

i trying pdo results displayed in table via loop. presently displaying white page. suggestions missing? or why page blank? <?php try { $conn = new pdo("pgsql:host=localhost port=5432 dbname=riverflies_gis", "opengeo", "opengeo"); echo "pdo connection object created"; echo "<br>"; } catch(pdoexception $e) { echo $e->getmessage(); } $sql = "select admin_name, adminuser_id, group_id adminuser_tbl"; $stmt = $conn->prepare($sql); $stmt->execute(); $data = $stmt->fetchall(); ?> <table border='1' cellpadding='10'> <tr> <th>id</th> <th>adminuser</th> <th>group_id</th> <th></th> </tr> <?php foreach ($data $row): ?> <tr> <td><?=$row['adminuser_id']?></td> <td><?=$row['admin_name']?></td> <...

.net - How to reference Microsoft.Web.Administration? -

Image
the microsoft.web.administration assembly found in c:\windows\system32\inetsrv on machine. believe installed part of iis. assembly in gac. how should reference assembly project, given want commit project svn others checkout. microsoft.web.administration not appear in visual studio 'add references' list. can add reference c:\windows\system32\inetsrv\microsoft.web.administration , seems bad idea other developers might have installed on different path or drive. or copy project folder, have commit binary svn. the following steps working me: copy microsoft.web.administration.dll located in c:\windows\system32\inetsrv in folder *.csproj located, add folder /lib , paste microsoft.web.administration.dll /lib folder now add relative path .dll in *.csproj : open *.csproj , search tag <itemgroup> , add following xml-definition: <reference include="microsoft.web.administration, version=7.9.0.0, culture=neutral, publickeytoken=31bf3856ad364e35...

Compare two CSV files in vbscript -

i have write vbscript compare 2 csv files, the both csv files contains following data format, file1.csv dbnane usergroup path access db_1 dev_ii db/source/projects read/write db_2 test_i db/source/doc read file2.csv dbnane usergroup path access db_1 dev_ii db/source/projects read db_2 test_i db/source/doc read i need compare these files, output format like, file3.csv dbnane usergroup path access db_1 dev_ii db/source/projects read/write i'm new vbscript. sample script ? thanks. in powershell differing lines 2 text files this: $f1 = get-content 'c.\path\to\file1.csv' $f2 = get-content 'c.\path\to\file2.csv' compare-object $f1 $f2 if need show what's different in first file ( $f1 ), filter result this: compare-object $f1 $f2 | ? { $_.sideindicator -eq '<=' } | % { $_.inputobject }

Javascript shorthand an if statement -

this question has answer here: shorthand if/else statement javascript 5 answers what shorthand equivalent of following? if (windowwidth >= 960){ widthofwindow = 1; } else { widthofwindow = 0; } you use ternary operator: widthofwindow = windowwidth >= 960 ? 1 : 0 you read as condition ? value_if_true : value_if_false

jQuery animation queue with common easing -

i have jquery animations queued single element: var el = $('.elem'); el.animate({ width: 120 }, 600, 'easeinoutquint' ).animate({ width: 90 }, 300, 'easeinoutquint' ).animate({ width: 100 }, 100, 'easeinoutquint' ); the 3 animation counts 1 main animation, chained. takes 1000ms run , use in example first animation first 60% of easing, easing next 30% used in second animation , finished last 10% of easing. is there way make easing global value these queued animations? if understand question correctly, maybe can wrap logic in function can pass in duration , reuse chained animation this: var el = $('.elem'); var ease = function(elem, duration) { elem .animate({width: 120}, 0.6 * duration, 'easeinoutquint') .animate({width: 90}, 0.3 * duration, 'easeinoutquint') .animate({width: 100}, 0.1 * duration, 'easeinoutquint'); } ease(e...

Converting HTML with Mathematical Symbols to PDF with Javascript support PHP -

i have web page has mathematical symbols in rendered using javascript. have used ascii math plugin , asciisvg plugin create , display mathematical expressions in web page. have requirement convert web page pdf. have tried dompdf , fpdf, both failed since these convertors not support javascript. is there way achieve this? if rely on javascript have 2 options: render on client , capture generated document content. can send content server rendering pdf. dompdf not support svg, method have use output format or library (i'm not sure ones support svg). main drawback require user interaction. use headless browser. these full browser engines compiled command line client. these support full web stack (html, css, javascript, svg). web content rendered in memory after can export pdf , image formats. best i've seen far phantomjs . drawback have able install binaries on system , execute them.

php - multiple combinations in an Array -

i have array, amount of items in array can change. trying find different combinations values inside array, example array has these values; array ( [0] => 60.0 [1] => 56.8 [2] => 42.08 [3] => 52.16 [4] => 52.8 ) is possible count number of values (in case 5) this; 60.0 + 56.8 60.0 + 56.8 + 42.08 60.0 + 56.8 + 42.08 + 52.16 60.0 + 56.8 + 42.08 + 52.16 + 52.8 but show combinations such as; 56.8 + 42.08 42.08 + 52.16 etc i have tried using multi dimensional arrays, array shifting , other array related code. simple sum up, pop last element. will produce expected output, reversed. (you can add result array , resort, if required) //untestet while (count($myarray) > 1)){ $current = 0; foreach ($myarray $e){ $current += $e; } echo "a result : " . $current; //remove last entry array_pop($myarray); } this modify array. do $myarray = array(1,2,3); ($i=0; $i<count($myarray); $i++){ $sums_unti...

mysql - SQL Query / find percentile based on rank -

i have created following tables ranks data set: position index indexl indexh amount rank 1 2.5 2 3 2000 1 1 2.5 2 3 3000 2 1 2.5 2 3 4000 3 1 2.5 2 3 5000 4 1 2.5 2 3 6000 5 2 1.5 1 2 2500 1 2 1.5 1 2 4500 2 2 1.5 1 2 6700 3 2 1.5 1 2 8900 4 2 1.5 1 2 9900 5 now want find percentile based on ranks created using indices such following output : position amount 1 3000+(4000-3000)*(2.5-2) 2 2500+(4500-2500)*(1.5-1) can me this. kinda new sql world. thanks, monica i think can want percentile_cont() aggregation function. looks want median: select position, percentile_cont(0.5) within group (order amount) median t group position; you can read more here .

c# - String to dictionary, and back again -

i working string this: norway, true; sweden, false; england, null; denmark, false; i'm trying dictionary<string, bool?> can work it, remove items, compare against other stuff. when i'm done, want convert dictionary similar string , save it. any ideas? you can convert dictionary using split method , linq: var dict = str.split(';') .select(s => s.split(',')) .todictionary( p => p[0].trim() , p => p[1].trim().equals("null") ? null : (bool?)(bool.parse(p[1].trim())) ); converting easier: var res = string.join("; ", dict.select( p => string.format( "{0}, {1}" , p.key , p.value.hasvalue ? p.value.tostring().tolowercase() : "null" ) ));

fft - Matlab: Remove noisy peaks -

i have transformed image of method fft2 want locate noisy peaks , erase them shown in following image link: image noisy peaks kindly suggest matlab functionality achieving this this did far f = fft2(myimage); f = fftshift(f); % center fft f = abs(f); % magnitude f = log(f+1); % use log, perceptual scaling, , +1 since log(0) undefined f = mat2gray(f); % use mat2gray scale image between 0 , 1 imshow(f,[]); % display result you can try create mask of shows/represents points exceed threshold , position. let's create arrays of position. [x y] = meshgrid(1:size(a, 2), 1:size(a, 1)); % x-y coordinate of data ft = 0.5; % try different values case. mask = f > ft && y < 0.4*size(a, 1) && y > 0.6*size(a, 1); f(mask) = 0; you should able check mask see if have located right positions. imagesc(mask) helpful during trial-and-error step. note don't have x rules in example potentially add...

parameters - Powershell - unable to print value of hash -

i writing simple script more familiar powershell. this script reads input parameters hash $states = @($args) $states write-host color $states.color on command-line, set following values $shape = 'circle'; $color = 'pink'; $size = 'large' i invoke program following command .\shapes_n_colors.ps1 $shape $size $color and, following output: circle large pink color i unable figure out why $states.color blank. expecting output "color pink" i following artical, http://technet.microsoft.com/en-us/library/hh847780.aspx where going wrong??? not sure start... first of - don't create hash @ point... @($args) doesn't anything: $args array, , @() useful make sure expression produce array... hash literal @{} . next: script have no clue names you've used variables passed it. see 3 strings. suggest using param() named parameters (that default positional, calling script wouldn't change much): param ( $sh...

websocket - How to implement ReST services with Sails.js? -

i quite new node. came across sails.js . think based on websocket, seems building real-time applications. know whether sails can used implement rest architecture uses websocket? , if yes, how? yes can. sails js allows build restful api, no effort started. also, websockets (through socket.io) integrated default view , api. to create restful app ground up, requires no js. try: sails new testapp cd testapp sails generate model user sails generate controller user cd <main root> sails lift the crud (create, read, update, delete) actions created you. no code! you can create user in browser doing following: http post (using tool postman) http://:1337/user/create { "firstname": "bob", "lastname": "jones" } next, see new user: http http://:1337/user/ fyi - sails js uses default disk based database going done.

javascript - Google Maps Marker double click zooming map -

i have placed several makers on google map, follows - var newmarker = new google.maps.marker({ position: someposition, map: map, title: 'my marker', draggable: true }); and set number of listeners on markers; click, dblclick, dragend & rightclick - google.maps.event.addlistener(newmarker, 'dblclick', function (evt) { dostuffwith(newmarker); }); this works, problem when double click markers, map zooms in. i'd map zoom in when double click map only, if double click marker i'd listener event fire & map not zoom. is possible ? thank you. you can add disabledoubleclickzoom: true to map options.

Codeigniter Nested Database Data -

i google , google , read 100000 tutorials think inposible in codeigniter on model, controller , views. am tring show database records : default category |----- sub category | ----one more category |----- somthing else i try lft , rgt cols realy dont understand concept. i read , try function optimize in codeigniter model work in model. http://www.sitepoint.com/hierarchical-data-database-2/ http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/ i have simple db sheme : categories cols id, parent_id, title any1 can give me 1 simple example... please thanks assuming follow basic table structure: id parent_id name you need nested loop. something like: select * table parent_id = 0; # first level select * table parent_id = ?; # subsequent levels normally build object in model return array children in it. function calls , returns object append previous object. watch out recursive functions though, have te...

Node.js child_process.fork() to run on different CPU cores -

i have application runs long-executing processes. make faster, simple sharding of data , want run them in parallel, .fork() 2 instances of same application. i'm having 2 cores machine there , want make sure 2 cores utilized , first instance running on first core, second on second core. i know cluster module, seems not relevant in case, since don't need http services running , load-balancing between them. workers (mean, dont need communicate each other, send messages or whatever - http requests , store data database). is there possible @ control cpu core node.js process take? how monitor on mac/linux? cluster module need : http://nodejs.org/api/cluster.html

algorithm - Text matching names in java -

i've sports application captain can register team tournament. there can multiple tournaments in year , each tournament requires registration. now, want support below in registration process if player has participated in previous tournament app need reuse existing details rather forcing registration. need make sure player not playing 2 teams. i wondering how can best implement name match feature. it makes difference, of names indian origin. i using neo4j data store. you use db4o , use unickey feature field name in player class. tornament class have (set) field players name (and @ least reference indexed name, date name may indexed). then 2 fields : last tournament , registration next 1 have 1 player 1 tournament. using soda query can select player last referenced tournament, , register others

image processing - Trying to understand implementation of gaussian blurring in matlab -

Image
i trying blur scanned text document point text lines blurred black.. mean text blends each other , see black lines. i'm new matlab , though know basics cannot image blur properly. have read this: gaussian blurr , according blur managed/decided sigma function. not how works in code wrote. while trying learn gaussian blurring in matlab came find out achieved using function: fspecial('gaussian',hsize,sigma); so apparently there 2 variables hsize specifies number of rows or columns in function while sigma standard deviation. can 1 please explain significance of hsize here , why has deeper effect on result more sigma ? why if increase sigma high value blurr not effected image distorted lot increasing hsize here code: img = imread('c:\new.jpg'); h = fspecial('gaussian',hsize,sigma); out = imfilter(img,h); imshow(out); and results attached: why not controlled sigma ? role hsize play? why cant blur text rather distort entire image? ...

osx - MAXREPEAT issue when running Python 2.7 from MacPorts -

i'm running issues running python2.7 macports. here's list of available python versions: $ sudo port select python available versions python: none python25-apple python26-apple python27 (active) python27-apple when set python27 active (as above), following error when running python : $ sudo port select --set python python27 selecting 'python27' 'python' succeeded. 'python27' active. $ python traceback (most recent call last): file "/opt/local/library/frameworks/python.framework/versions/2.7/lib/python2.7/site.py", line 548, in <module> main() file "/opt/local/library/frameworks/python.framework/versions/2.7/lib/python2.7/site.py", line 530, in main known_paths = addusersitepackages(known_paths) file "/opt/local/library/frameworks/python.framework/versions/2.7/lib/python2.7/site.py", line 266, in addusersitepackages user_site = getusersitepackages() file "/opt/lo...

JavaScript Geolocation failing in all Android browsers - working in iOS and PC -

here basic code: if (navigator.geolocation) { // point test `alert()` navigator.geolocation.getcurrentposition( // not ot point in android browser function(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; }, showerror, { enablehighaccuracy: true, timeout : 5000, maximumage: 0 } ); } else { return alert('no geolocation support.'); } }; it works great in ios (safari , chrome); , pc browsers i've tried. on android, i've tried stock htc browser, chrome , dolphin. satellites searching then, stops. don't recall asking permission use geolocation (could have overlooked part) update : work on nexus 10 chrome browser. not htc 1 x. update 2 - appears happening on 1 android device, at&t htc 1 x. other android devices, pc browsers , ios work fine. on 1 x error code: timeout. also, gps works fine on devi...

asp.net mvc - Handling concurrency exceptions with external API calls -

i have following post edit action method, perform 2 update actions:- edit object on external system suing api calls. edit object on our system database. [httppost] public actionresult create(rackjoin rj, formcollection formvalues) {string controllername = routedata.values["controller"].tostring(); if (modelstate.isvalid) { var message = ""; var status = ""; long assetid = new long(); xmldocument doc = new xmldocument(); using (var client = new webclient()) { var query = httputility.parsequerystring(string.empty); foreach (string key in formvalues) { query[key] = this.request.form[key]; } query["username"] = system.web.configuration.webconfigurationmanager.appsettings["apiusername"]; query["password"] = system.web.configuration.webco...

ios - Core Plot graph bottom axis not visible -

Image
i've got core-plot line graph displaying follows (background view coloured red clarity): i have 0 padding @ bottom, , have x-axis configured, labels. graph squeezed right down against bottom of view though. if increase bottom padding grey bar @ bottom same result. what need change in order move graph bottom of view , display axis? the code quite lengthy, here's excerpts: self->graph = [[cptxygraph alloc] initwithframe:hostview.bounds]; hostview.hostedgraph = graph; self->graph.paddingleft = 0.0f; self->graph.paddingtop = 10.0f; self->graph.paddingright = 0.0f; self->graph.paddingbottom = 0.0f; ... [plotspace scaletofitplots:[nsarray arraywithobjects:p1, p2, p3, nil]]; cptmutableplotrange *xrange = [plotspace.xrange mutablecopy]; [xrange expandrangebyfactor:cptdecimalfromcgfloat(1.1f)]; plotspace.xrange = xrange; cptmutableplotrange *yrange = [cptplotrange plotrangewithlocation:cptdecimalfromfloat(0.0...

Icons do not show up in Informatica Mapping Designer -

Image
i new informatica , trying learn bit bit.currently able enable repository services nothing works after connected. in transformation icons not highlighted when open mapping designer. please find attached screen-shot. let me know if questions. thank you. you opened mapping designer , connected folder there no mapping loaded - create new mapping or open existing 1 , transformations toolbar become active.

Ruby Sinatra Cookies -

i having issue setting persistent cookies in sinatra: i have 2 routes set same key: response.set_cookie('user_id', { :value => params[:user_id], :expires => time.now + (60 * 60 * 24 * 30), :path => '/' }) the difference between 2 routes 1 post , other get. in both cases set path of cookies '/'. when try retrieve cookie value in route: user_id = cookies[:user_id] i cookie set via post route, if later overwrite using route. i haven't been able find documentation aspect of sinatra, appreciated. you must use user_id = request.cookies[:user_id]

java - Receiving the content of one arraylist into another and then empty the first one -

i want receive content of arraylist array1 arraylist array2 , empty content of array1: public arraylist array1 = new arraylist(); public arraylist array2 = new arraylist(); /* array1 contains data , array2 empty*/ array2.addall(array1); array1.clear(); system.out.println(array2); the problem have array2 empty [] . when remove line array1.clear(); , works great , array2 shows content [a1, a2, a3] . i thought when array2 receives content of array1 can clear array1 without problem. removed both place since it's still in memory? how can right way? array1.clear() sets objects contained in arraylist null. not ensure objects contained in arraylist garbage collected. objects have references elsewhere not gced till references removed. and array1= null sets reference null , not garbage collected till there references , objects contained in gced explained above. as never know when gc done , hence cannot force gc setting objects nul...

mean - MATLAB giving me NAN values, can't figure out why -

i'm sure whatever problem here pretty simple, cannot figure out @ all. i have simple data file. .csv file column of labels, , column of values associated each label. trying simple operations involving vector, matlab keeps giving me nan values. even if mean(vector) nan! i can't figure out why. there no nan values in vector. numeric. typed command isnumeric(vector) , got value of 1. used loop cycle through every value in vector, , of them numeric. i have copied of data new csv file , tried that. still gives me nan. i cannot @ figure out going on here. have no problems doing same other vectors. problem matlab won't tell me or problem is, gives me nan. any theories on going on, here? or idea of way check vector see matlab having trouble reading? i using matlab r2008a, on mac. this return indices of data supposedly nan : find(isnan(vector)) you can use nanmean function in statistics toolbox, ignores nan values in data. there nan- versions of ma...

ASP.NET MVC3 Complex Routing Issue -

i have following default route set , works fine: routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "home", action = "index", id = urlparameter.optional } // parameter defaults ); here example of successful route me: "/positiondetail/candidates/2" this fine , dandy, issue have want set route goes deeper. i.e. "/positiondetail/candidates/2/getmorecandidates" , "/positiondetail/candidates/2/resume/3" resume action want perform, , 3 id. note: each of these route load new page, , not partial view. how set this, , 'positiondetail' controller like? for example, second task may follows: public actionresult resume(int candidateid, int resumeid) { return view(); } in routing: routes.maproute( "resume", // route name "{controll...

c# - How to return out of a function or event in VB 6 -

in c# if wanted return out of function do: if (something == true) { //message box return; } else { // nothing } how 1 vb 6? in vb6, write functionname = returnvalue yes, seriously. to stop execution of function, use exit function (or exit sub )

Hide a Column Using Data Annotations in WPF -

i have grid in wpf, auto-generating columns. how can dynamically hide columns using data annotations? i thought of having property in model specify whether column visible, i'm not sure how it. my model, bound grid: public class template { public string county { get; set; } public string operator { get; set; } public string field { get; set; } } here sample uses attributes hide columns. uses attached property handle autogeneratingcolumn event. hidecolumnifautogenerated.cs - attribute namespace autohidecolumn { public class hidecolumnifautogenerated : system.attribute { public hidecolumnifautogenerated() { } } } datagridextension.cs - attached property using system.componentmodel; using system.windows; using system.windows.controls; namespace autohidecolumn { public static class datagridextension { public static readonly dependencyproperty hideannotatedcolumnsproperty = depend...

jquery - get all the dates that fall between two dates -

i have problem user selects range of dates. need find out dates fall between 2 selected dates. they're coming in via jquery simple $('#from').val()+"-"+$('#to').val(); they're coming jqueryui datepicker , like 08/07/2013 - 08/09/2012 but can't figure out how step through dates , determine days in in between. need specific dates, becomes complicated things end of month , different number of days in each month. in specific example, i'd need get 08/07/2013, 08/08/2013, 08/09/2013 you can grab values date pickers using getdate method, since return date object. then, starting @ start date increment "current" date 1 day , add array until current date same end date. note you'll need create new date() when adding between array, or else referencing currentdate object , values same. working demo var start = $("#from").datepicker("getdate"), end = $("#to").datepicker("get...

jaxb - Webservices - called using HttpUrlconnection and JAX WS RI -

in project, consume webservices . confusing me there webservices(say a ) called using httpurlconnection , req/response marshalled/unmarshalled using jaxb there web service(say b ) see many classes jax wsri , not called using httpurlconnection . see .wsdl files these webservices. /** * class generated jax-ws ri. * jax-ws ri 2.1.1 in jdk 6 * generated source version: 2.0 * */ @webservice(name = "abporttype", targetnamespace "http://www.ups.com/wsdl/xoltws/dcr/v1.0") @soapbinding(parameterstyle = soapbinding.parameterstyle.bare) public interface abcporttype { @webmethod(operationname = "processab", action = = "http://example.com/webservices/xxbinding/v1.0") @webresult(name = "xxresponse", targetnamespace = "http://xx.com/xmlschema/xxws/ab/v1.0", partname = "body") } my doubts why calling webservice b these bloat (end point, jax ws ri instead of using httpurlconnection ? can httpu...

java - SQlite delete function is not deleting entries -

im having trouble getting individual items delete in database application using. know method gets called, nothing in list ever removed. im not getting errors making tough track down. assistance awesome. public class mainactivity extends activity{ //global variables listview lv; intent addm, viewm; public dbadapter moviedatabase; string temptitle, tempyear; int request_code = 1; int request_code2 = 2; simplecursoradapter dataadapter; cursor cursor; button addbutton; long testid; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); //creates database moviedatabase = new dbadapter(this); moviedatabase.open(); //moviedatabase.deleteallmovies(); //creates intents start sub activities addm = new intent(this, addmovie.class); viewm = new intent(this, movieview.class); } //handles return of activity addmovie public void onactivityresult(i...

php - Have item description and taxes on Paypal -

i working on online store , wanted add paypal checkout method. started using express checkout worked fine until tried add taxes. problem express checkout need calculate taxes amount , send rest on information. problem need know customer can adjust tax amount. tried use adaptive payments when comes description of order show receivers (ex: onlineshop@something.ye) can not add multiple items express checkout since didn't worked out did not try see if tax working method. so know is... how can address of customer can show him taxes in order details express checkout ? if not possible, there way can change order details of adaptive payment ? there suppose way address before doing doexpresscheckout , change tax amount there using maxamt in setexpresscheckout customer see tax amount on website , not in paypal page think kind of odd. edit 1 now i've added callback it's asking me shipping flat rate. here request string... '&method=setexpresscheckout...

android - Start Activity and don't destroy other activity -

i new android , started activities - b - c - d. activity d, when open activity again how can start activities b , c don't finish , starts again? there should 1 activity a. thanks in advance. use intent flag flag_activity_reorder_to_front in d intent = new intent(activityd.this, activitya.class); i.setflags(flag_activity_reorder_to_front); startactivity(i); this bring activitya front of stack , leave b , c believe want. can call finish() on d if want remove stack. you can find available flags in intent docs

ruby - Rails DateTime Comparison Bug -

i have ticket class has default rails column of updated_at while on ticket page making update polling database see if else has changed @ same time. in view if works <p>updated at: <%= @ticket.updated_at.to_time.strftime('%y-%m-%d %h:%m:%s') %></p> <p>current time: <%= time.now.strftime('%y-%m-%d %h:%m:%s') %></p> <% current_time = time.now %> <% if @ticket.updated_at > time.now %> <p>ticket has been updated</p> <% else %> <p>ticket has not been updated</p> <% end %> so here ajax request (library prototype new to, prefer jquery): <script type="text/javascript"> function checkticketupdate() { var url = '/ticket/check_ticket_update'; var parameters = 'id=<%= @ticket.id %>&current_time=<%= current_time %>' var container = 'ticket_updated_container'; var myajax = new...

android - On Item click of listview not responding -

i have custom adapter set listview itemclickevent not working . have included adapter inside main activity.i have tried many suggestions havent got solutions till yet. public class mainactivity extends activity { private listview listview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); model.loadmodel(); listview = (listview) findviewbyid(r.id.list); string[] ids = new string[model.items.size()]; (int i= 0; < ids.length; i++){ ids[i] = integer.tostring(i+1); } graphlistadapter adapter = new graphlistadapter (this,r.layout.list_row, ids); listview.setadapter(adapter); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } public class graphlistadapter extends baseadapter { p...

javascript - flask: how to get a POST endpoint to redirect correctly -

have complicated endpoint in flask deployed server: @app.route('/whatever', methods=['get', 'post']) def somefunct: if request.method = 'post': << stuff >> << other stuff >> return render_template('sometemplate.html', **<<variable dict>>) that pushes 1 template. sometemplate.html kind of tricky, contains table pulls data variable dictionary , provides dropdown allows user interact it: {% item in << variable in dict >> %} ... <td> <form name="category-form" id="category-form-{{ item }}" action="/whatever"> <select name="{{ item }}" id="{{ item }}"> <option value="1">option 1</option> <option value="2">option 2</option> <option value="3">option 3</option> </select> <...

How can I put kendo sparklines in all rows? -

i put sparklines in column usage, has 1 row, how can put rows in column usage? i put of code relating usage column jsfiddle code columns: [{ { field: "usage", title: "usage", template: '<span id="sparkline"style="line-height: 60px ; padding: 0 5px 0spx ; text-align: center" ></span>' }, { command: ["edit"], title: "&nbsp;" }], editable: "popup", }); thank you the problem use id in template: id must unique. change id class template: '<span class="sparkline"style="line-height: 60px ; padding: 0 5px 0spx ; text-align: center" ></span>' and in initialization use: $(".sparkline").kendosparkline({...}); instead of: $("#sparkline").kendosparkline({}); see here : http://jsfiddle.net/onabai/72kup/embedded/result/

concurrency - Are there any operations/methods in Ruby that are guaranteed/documented to be atomic? -

i did quick google search, , written on atomicity in ruby suggest wrapping mutex around operation. however, suspect approach doesn't satisfy usual definition of atomicity, since signal interrupt synchronized code. example (taken ruby best practices ): lock = mutex.new # xxx example of not inside signal handler: trap(:usr1) lock.synchronize # if second sigusr1 arrives here, block of code # fire again. attempting mutex#synchronize twice # same thread leads deadlock error end end i understand atomicity less important high level languages, sake of research canonical answer on matter implementations gil (e.g. mri 2.0.0 ) , without e.g. jruby 1.7.4, , rubinius 1.2.4 i have limited knowledge on topic. try answer best can. there article jesse storimer wrote concurrency. highly recommend read of 3 parts it. http://www.jstorimer.com/blogs/workingwithcode/8100871-nobody-understands-the-gil-part-2-implementation the conclusion on part 2 gil guaranteed...