Posts

Showing posts from May, 2012

mysql - Query By Example. find passenger who have bought two same ticket -

Image
schema: flight (flight_id, date, from, to) passenger (passenger_name, gender) ticket (ticket_id, flight_id, passenger_name, class, price) i know how find passenger have bought more 1 ticket. don't know how find passenger have bought 2 ticket. if want passengers have bought 2 tickets flight then: select passenger_name, flight_id ticket group passenger_name, flight_id having count( ticket_id ) = 2; if want passengers have bought more 1 ticket flight then: select passenger_name, flight_id ticket group passenger_name, flight_id having count( ticket_id ) > 1;

C: error replacing gets() with fgets() -

i having issue replacing gets() fgets(). have looked @ multiple examples of doing , seems straight forward getting unexpected output in doing so. using gets() method in comments below, behavior shell program writing, when change fgets() call, output ": no such file or directory" when giving input "ls". said, gets() call working fine. code below: int main(void) { while(1) { int = 0; printf("$shell: "); scanf("%s", first); /* gets(input);*/ fgets(input, sizeof(input), stdin); //...parse input tokens exec system call... execvp(first, args); } return 0; } unlike gets , fgets read newline , store in string. from man page: fgets() reads in @ 1 less size characters stream , stores them buffer pointed s. reading stops after eof or newline. if newline read, stored buffer. '\0' stored after last character in buffer. you can remove newline (if present) replaci...

arrays - LCS C Program Crashing on first input -

hello new c , having trouble getting code run, compiles fine when enter first input exe crashes. pretty sure problem lies in either memory allocation of array or use of pointers can not seem figure out issue. here 2 files. main.c #include "stdheader.h" int main(int argc, char ** argv){ char* s1; char* s2; char* s3; while (scanf("%c\n", *s1) != (eof)){ scanf("%c\n", *s2); lcs(*s1,*s2,*s3); printf("%c \n", *s3); } } lcs.c #include "stdheader.h" void lcs(char*s1, char*s2, char*s3){ int i, j, k; int l1= strlen(s1); int l2= strlen(s2); int **a = (int**)malloc(sizeof(int *)*(l1+1)); (i=0; i<= l1; i++){ a[i]= malloc(sizeof(int)*(l2+1)); } (i=0; i<=l2; i++){ a[l1][i]=0; } (j=0; i<=l1; j++){ a[j][l2] = 0; } ...

Issue while getting data from URL. PHP -

i have following code. <?php error_reporting(0); $url = 'https://www.inmateaid.com/prison-search/all?&page=1'; $output = file_get_contents($url); $doc = new domdocument(); $doc->loadhtml($output); $selector = new domxpath($doc); $anchors = $selector->query("/html/body//div[@class='media']//div/h4//a"); foreach($anchors $a) { $output = file_get_contents($a->getattribute("href")); echo 'hi'; } ?> if see below code produces 10 anchors $anchors = $selector>query("/html/body//div[@class='media']//div/h4//a"); so how should printed 10 times? prints 3 times. when comment line inside loop, hi printed 10 times. am missing something? that due max_execution_time = 30 . increased time , issue fixed.

office365 - Office 365 - Save Conflict error when upload sitepage -

i have site pages aspx. when tried upload file site contents - site pages, got error page popup that: "sorry, went wrong save conflict your changes conflict made concurrently user. if want changes applied, click in web browser, refresh page, , resubmit changes." in aspx file have content editor web part. if delete html in <![cdata[]]> in node <content> or if don't delete html have set src="" , href="", can upload aspx file successfully. then if html src="path" , href="path" got save conflict error. what need ? file aspx here

Android MediaPlayer - onBufferingUpdate called with 100 before called with 0 -

the code below minimal example of activity hosting mediaplayer play mp3 stream url. pressing "btn1" triggers url1 play (an npr podcast). pressing "btn2" triggers url2 play (mp3 recording of different station). public class mainactivity extends appcompatactivity { public static final string tag = mainactivity.class.getsimplename(); static final string url1 = "http://13503.mc.tritondigital.com/waitwait_podcast/media-session/822d578a-af47-4d7e-b3ca-d18af78071bc/anon.npr-podcasts/podcast/344098539/464996449/npr_464996449.mp3"; static final string url2 = "http://www.selbie.com/wrekapp/fri0130.mp3"; mediaplayer _player; void startplayerasync(string url) { stopplayer(); // _player.reset(); _player.release(); _player=null; log.d(tag, "==================="); log.d(tag, "starting new player url: "+url); _player = new mediaplayer(); try { _pla...

earlgrey - Early grey environment setup -

i'm trying earlgrey setup on computer following steps cocoapod installation described here after performing steps keep on getting compilation error during build earlgrey.swift:17:27: use of undeclared type 'earlgreyimpl' there 13 such compilation errors related unresolved identifier. i re-tried steps multiple times same results. folder structure matches shown in instructions. any suggestions should further resolved. for reference i'm using this swift project base writing test cases. so issue related bridgingheader.h file setting in test target -> build setting -> swift compiler -code generation -> objective-c bridging header i copied file demo project, did not specify in above setting. once specified there, compilation errors gone.

php - blueimp jQuery-File-Upload not displaying thumbnail after uploading the image -

Image
i have downloaded latest plugin , dependencies here version 9.12.1. copied downloaded files in wamp server , accessed localhost/jquery-file-upload-9.12.1/index.html . after selecting image file, preview of image displayed before uploading. once image uploaded thumbnail not getting displayed. however in inspect element link of thumbnail present in image src. file uploaded in server folder , thumbnail created. name , size of image getting displayed. what doing wrong ? making dirty tricks ... loop until image ready before showing preview image. see jquery: check if image exists . in case use before image tag ... while(urlexists(file.path) != 200) { console.log("still loading image"); } <img src="=file.path" width="100px"> the problem writing image little late response client. , 404 error image after rendering html. image exist when checked. above snippet ,i trying...

android - How to use getSupportFragmentManager() in YoutubeBaseActivity? -

i have class extends youtubebaseactivity , inside want import getsupportfragmentmanager() setting adapter. adapter extends fragmentstatepageradapter. constructer of adapter is: public viewpageradaptermovies(fragmentmanager fm ,arraylist<moviecategoryparent> moviecategorytabtitles, int mnumboftabsumb) { super(fm); this.moviecategorytabtitles = moviecategorytabtitles; this.numboftabs = mnumboftabsumb; } the main problem here not being able use getsupportfragmentmanager() send in adapter.

java - Binary Insertion Sort in a similar fashion of regular Insertion Sort -

so i'm trying figure out how use binary insertion sort without need swap method or that. friend of mine gave me rough interpretation of necessary code can't seem want. private static int binaryinsertionsort(int[] b) { int left, right, middle, i, m; int comparecount = 0; (int j = 1; j < b.length; j++) { left = b[j - 1]; right = b[j + 1]; if (b[j] < b[left]) { = left; } else { = left + 1; } m = b[j]; for(int k = 0; k < (j - - 1); k++) { b[j - k] = b[j - k - 1]; comparecount++; } b[i] = m; } return comparecount; } the int comparecount merely see how many comparisons carried out on course of method. i'm trying arrange array of integers in regular fashion, b[0] = 1, b[1] = 2,...... b[63] = 64. in main method create array , assign values in reverse: b[0] = 64, b[1] = 63, etc. how can code r...

javascript - editable picture and text in dashboard -

i'm developing dashboard end-users can edit specific web page uploading different picture , editing text in page. similar ideas here . i'd done web page design , i'm looking suitable js library make editable dashboard end-users. has suggestions or if no current solution => how implement these features? no idea ... very thanks! you can have on : http://madebymany.github.io/sir-trevor-js/ http://innovastudio.com/content-builder.aspx http://etchjs.com/ http://jakiestfu.github.io/medium.js/docs/ http://createjs.org/ http://www.jqueryrain.com/demo/jquery-wysiwyg-editor/ and use one(s) suit you. in case did not find 1 suits project can make additions (such adding modal windows or css styling) hte one(s) more preferable. hope helpfull.

ruby on rails - How can I have 2 loops display information in-between each other -

i have 2 input fields generated 2 different hashes. table_head = {"key1"=>"thead1", "key2"=>"thead2", "key3"=>"thead3", "key4"=>"thead4"} table_content = {"1"=>"column1", "2"=>"column2", "3"=>"column3", "4"=>"column4"} <%= form_for([@category, @page], url: update_pages_path) |f| %> <% @page.table_head.each_with_index |(key, value), i| %> <%= text_field_tag ('header[' + i.to_s + ']'), value %> <% end%> <% @page.table_content.each_with_index |(key, value), i| %> <%= select_tag 'content[' + i.to_s + ']', options_for_select(@category_keys, value), { :multiple => true, :size => 3} %> <% end%> <% end %> this makes 4 table_head inputs , 4 table_content selects. need them ordered,...

How to deal with floating point number precision in JavaScript? -

i have following dummy test script: function test(){ var x = 0.1 * 0.2; document.write(x); } test(); this print result 0.020000000000000004 while should print 0.02 (if use calculator). far understood due errors in floating point multiplication precision. does have solution in such case correct result 0.02 ? know there functions tofixed or rounding possibility, i'd have whole number printed without cutting , rounding. wanted know whether 1 of has nice, elegant solution. of course, otherwise i'll round 10 digits or so. from floating-point guide : what can avoid problem? that depends on kind of calculations you’re doing. if need results add exactly, when work money: use special decimal datatype. if don’t want see decimal places: format result rounded fixed number of decimal places when displaying it. if have no decimal datatype available, alternative work integers, e.g. money calculations entirely in cents. ...

VBA to get HTML text -

Image
i've got vba open ie page , nagivate results page. want copy results of page excel. here html want result: i want able $505 can see after class "frequencyamount" i've been using variations of following code no luck (it executes no value pasted excel): cells(1, 22).value = ie.document.getelementbyid("result-row0").getelementsbyclassname("frequencyamount").outertext any appreciated

java - The type HashMap is not generic; it cannot be parameterized with arguments <String, Integer> -

this strange error getting today when try implement map below. map<string, integer> cache = new hashmap<string, integer>(); i using jdk 1.7 , not sure why error has been coming , changing above line adding cast removes error. i looked @ related posts in stackoverflow before posting question seems strange issue. map<string, integer> cache = (map<string, integer>) new hashmap(); check using java.util.hashmap , java.util.map in imports .

onkeyup event in Safari on IOS7 from a bluetooth keyboard -

i have following setup: bluetooth scanner ipad webpage textfield scan input usage: user focus textfield , scan barcode bluetooth scanner scanner adds enter (13) @ end of scan problem: on safari in ios7 there seems change on how keyboard events handled on bluetooth devices. code ... window.onkeyup = function (e) { console.log(e.keyboardevent) } ... should return information key pressed. instead ... keycode: 0 keyidentifier: "unidentified" ... no matter key press. same result booth form bluetooth scanner , bluetooth keyboard. thanks / e seems "onkeypress" works expected though. since problem bumbed in in sencha touch project , sencha touch doesn't have keypress event on textfields i'm posting code solved problem. { xtype:'searchfield', name:'search', placeholder:'search', listeners: { painted: { fn: function () { var me = this; ...

javascript - IE8 - "is null or not an object" error -

i have html: <td style="vertical-align: bottom;"><div id="resultcount">n.v.</div></td> and javascript: function processresultcount(data) { $("#resultcount").html(formatnumber(data.resultcount, ".")); $("#resultcount2").html(formatnumber(data.resultcount, ".")); (property in data) { var value = data[property]; $("#" + property).html(formatnumber(value, ".")); } function formatnumber(nstr, delimiter) { nstr += ''; x = nstr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; ..... ...... in ie8, error: "resultcount null or not object" i call function processresultcount here: var jsonformoptions = { // datatype identifies expected content type of server response datatype: 'json', // success identifies function in...

asp.net - The connection string specifies a local Sql Server Express instance using a database location within the application's App_Data directory. -

i'm building sms application , error. don't understand error because i'm beginner. the connection string specifies local sql server express instance using database location within application's app_data directory. provider attempted automatically create application services database because provider determined database not exist. here it's showing sql server express want use sql server 2008 db. an unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [sqlexception (0x80131904): network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified)] system.data.sqlclient.sqlinte...

postgresql - Why am I not receiving this PG notification? -

i've opened 2 database consoles, using rails dbconsole . issued following command in both of them: listen ninja; and, in second console, wrote: notify ninja; however, second console sees notification: notify asynchronous notification "ninja" received server process pid 16837. why aren't both consoles receiving notification? there setting can have both of them receive it? i don't know rails dbconsole, psql program doesn't show notifications until next time execute command, because notifications pulled, not pushed, , console doesn't poll them while inactive. assume dbconsole similar.

android - Optimizing redraws of multiple View objects -

i creating android app dashboard many gauges , indicators on it. have main view added in main activity's oncreate() method. each gauge custom view object added , initialized in main view , drawn in main view's ondraw() method. gauge values updated individual threads launched in main activity's oncreate() method. when thread detects need change gauge value, so, , sends message main view (via message handler) telling particular gauge needs updated (redrawn). using invalidate() in main view's message handler refresh screen. app runs well, wondering if handling display updates efficiently can. question is: when call invalidate() in main view, assume redrawing gauge views, ones have not changed. if so, more efficient redraw view of gauge has changed? best way that? have tried calling individual view's invalidate() , postinvalidate() methods neither works. as requested, here current state of ondraw method in main view. there lot more gauges added. bezels stati...

Change default socket buffer size under Windows -

an application cannot change dropping incoming udp packets. suspect receive buffer overflowing. there registry setting make default buffer larger 8kb? from this set default size of windows use following dword registry keys : [hkey_local_machine \system \currentcontrolset\services\afd\parameters] defaultreceivewindow = 10240 defaultsendwindow = 10240

hadoop - Understanding Map-Reduce -

so has confused me. i'm not sure how map-reduce works , seem lost in exact chain of events. my understanding: master chunks files , hands them mappers (k1, v1) mappers take files , perform map(k1,v1)-> (k2,v2) , output data individual files. this i'm lost. so these individual files combined how? if keys repeated in each file? who combining? master? if files go master @ step, wont massive bottleneck? combined 1 file? files re-chunked , handed reducers now? or, if files go directly reducers instead, happens repeated k3's in (k3, v3) files @ end of process? how combined? there map-reduce phase? , if so, need create new operations: map(k3,v3)->(k4,v4), reduce(k4,v4)->(k3,v3) i think sum up, dont how files being re-combined , causing map-reduce logic fail. step 3 called "shuffle". it's 1 of main value-adds of map reduce frameworks, although it's expensive large datasets. framework akin group operation on complete set of reco...

forms - Getting GET/POST result from third PHP page -

i have following pages: webservice.php - has webservice used handle possible , post variables sent it, returning string result. form_page.php - page form action redirects table_result.php . table_result.php - on page, there table should filled results webservice.php . my question is: if get/post variables' values available on table_result.php (after form data has been submitted), how can send them webservice.php , result fill table without leaving table_result.php ? important note on webservice.php there bunch of if (isset($_get["var_name"])) formulate database query , return result on string, said before. thanks in advance. first, instead of $_get , use $_request , make available via both post , get. can use search here , find answer

c# - ASP.NET MVC '@model dynamic' not recognizing Model properties when partial view is in Shared folder -

not duplicate of: mvc razor dynamic model, 'object' not contain definition 'propertyname' according answers there, according david ebbo, can't pass anonymous type dynamically-typed view because anonymous types compiled internal. since cshtml view compiled separate assembly, can't access anonymous type's properties. why code below - allegedly should never work - work had expected when partial view located in "/home/_partial.cshtml", stops working when moved "/shared/_partial.cshtml"? using asp.net 4.5 (and previous versions), following produces text "hello, world!" web browser: ~/controllers/homecontroller.cs using system; using system.collections.generic; using system.linq; using system.web; using system.web.mvc; namespace testdynamicmodel.controllers { public class homecontroller : controller { public actionresult index() { return view(); } } } ~/view...

powershell - Strange new error in SSIS when working drive and executable drive are different -

i'm using visual studio 2008 code new package call powershell script load csv file in database. the issue i'm facing when i'm create "execute process task" got , error: 0xc0029151, because powershell exe in drive c: , powershell script in drive d:. if copy paste powershell binaries in d: drive, every thing works well. this strange because i've got ssis same task , 1 runnin well. note: looks somewhere need set "cd /d" setting change drive... first of all, 0xc0029151 not strange, , not new error. it's dts_e_execproctask_processexitcodeexceeds means process exit code other expected. in other words, script may not working, or powershell call incorrect. if script fine, try run entire command cmd (that powershell.exe script location parameter - assume that's way you're running in task). if it's working, there may reason. execute process task has workingdirectory parameter, it's not being set .ps1, rather power...

linux - BASH : Sum size of same name directories -

first of all, bash noob, please gentle :) i trying sum size of folders in different places have same name. looks : root --- directory 1 ------ folder 1 --------subfolder 1 --------subfolder 2 ------ folder 2 --------subfolder 3 --------subfolder 4 ------ folder 3 --------subfolder 5 --------subfolder 6 --- directory 2 ------ folder 1 --------subfolder 1 --------subfolder 2 ------ folder 2 --------subfolder 3 --------subfolder 4 ------ folder 3 --------subfolder 5 --------subfolder 6 i trying sum size of subdirectories 1 6 , output .csv at moment outputting sizes of subdirectories in 2 seperate csv files. 1 directory 1 , 1 directory 2 at moment have output sizes of subfodlers run need them : du -h --max-depth=1 --block-size=gb * | grep "[\/]" | sort -n -r > ~/lists/disks/rc_job.csv the output : 40gb folder1/subfolder1 15gb folder1/subfolder2 10gb folder2/subfolder 3 ... i have 1 output directory 1 , 1 directory 2. sum size of subfolders directory ...

javascript - Jquery preload image dynamically -

wondering why not working... function: $.fn.preload = function() { this.each(function(){ $('<img/>')[0].src = this; }); } code: <?php $preimages = glob('images/backgrounds/*{.jpg, .png, .gif, jpeg}', glob_brace); ?> $([ <?php $imgcount = sizeof($preimages); for($i = 0; $i < $imgcount; $i++) { if($i == $imgcount-1) echo $preimages[$i]; else echo $preimages[$i] . ', '; } ?> ]).preload($("#load").fadeout()); i'm trying preload images in foler images/backgrounds folder... want callback $("#load").fadeout()... however works when following: img1 = new image(); img2 = new image(); img3 = new image(); img1loaded = false; img2loaded = false; img3loaded = fal...

why i lost name of my my new joomla hello world extension in components menu? -

i made new joomla3.1 hello world extension using discover extension method install it. after installation unable locate extension name in joomla component menu. i tried link working fine. http://localhost/com/administrator/index.php?option=com_process anticipating helpful response <?xml version="1.0" encoding="utf-8"?> <!-- $id$ --> <extension type="component" version="3.1" method="upgrade"> <name>com_process_name</name> <author>arslan tahir</author> <creationdate>25 dec 2013</creationdate>> <copyright>gpl</copyright> <license></license> <auhtoremail>aaa@outlook.com</auhtoremail> <version>1</version> <description>com_process_description</description> <administration> <files> <filename>index.html</filename> <filename>...

http - What happens when my browser does a search? (ARP,DNS,TCP specifics) -

Image
i'm trying learn basics of arp/tcp/http (in sort of scatter-shot way). example, happens when go google.com , search? my understanding far: for machine communicate others (the gateway in case), may need arp broadcast (if doesn't have mac address in arp cache) it needs resolve google.com's ip address. contacting dns server. (i'm not sure how knows dns server is? or gateway knows?) this involves communication through tcp protocol since http built on (tcp handshake: syn, syn/ack, ack, requests content, rst, rst/ack, ack) to load webpage, browser gets index.html, parses it, sends more requests based on needs? (images,etc) and finally, actual google search, don't understand how browser knows communicate "i typed in search box , hit enter". does seem right? / did wrong or leave out crucial? firstly try understand your home router 2 devices : switch , router. focus on these facts: the switch connects devices in lan together(including ...

java - LidGDX. How to load .G3D(binary) model with animation -

i use lidgdx android app. have animated blender model exported g3d binary format. according docs should use code like assetmanager assets; assets.load("data/mymodel1.g3d", model.class); model model = assets.get("data/mymodel1.g3d", model.class); but works when have json-based models. loaders assetmanager has json files. there no loader binary data. libgdx says binary format g3d supported. can't find way load binary model. the old g3d file format isn't used anymore (assetmanager has never been able load .g3d files). replaced new g3db (binary json) , g3dj (textual json) file format. can use fbx-conv ( https://github.com/libgdx/fbx-conv ) convert fbx models 1 of these file formats. see also: http://blog.xoppa.com/loading-models-using-libgdx/ .

ios - Xcode: How to change icon in xcode 5? -

i'm trying change icon in old app project. i've updated xcode 5 , want "ios 7 design". however, don't change icon way did before. i've seen supposed have e file called images.xcassets should include icons, don't have 1 because seem if making new project. this should easy, should do?? select project icon in file list, choose general tab, , scroll down app icons section. there can either: use source popup choose "don't use asset catalogs" create new asset catalog , drag icons it; clicking little grey arrow icon next popup take icons in assets catalog

HTML Using DIV vs. Table -

what use div's vs. table. i show image , right of image show text. text should aligned top edge of image. there should spacing between text image. i have following code seems image comes , text comes below it: <div style="float:left"> <img src="../../images/img1.png" alt="description" width="32" height="32"></a></p> </div> <div style="clear:left"></div> <div style="float:left"> %#eval("title") </div> <div style="clear:left"></div> you use float/overflow trick : <div class="imgcont"> <img src="../../images/img1.png" alt="description" width="32" height="32"> </div> <div class="text"> %#eval("title") </div> i used classes instead of inline ...

ios - How do I define the size of a CollectionView on rotate -

i have viewcontroller 2 collectionview controllers. i on rotation 1 of collection views resize custom size while other remains same. i have tried use: - (cgsize)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewlayout *)collectionviewlayout sizeforitematindexpath:(nsindexpath *)indexpath { // adjust cell size orientation if (uideviceorientationislandscape([[uiapplication sharedapplication] statusbarorientation])) { return cgsizemake(170.f, 170.f); } return cgsizemake(192.f, 192.f); } however changes both collectionviews. how specific 1 collection? heres 2 cents - because item sizes static why don't set item size on collectionviewlayout ? it quicker rather expecting collection view call delegate method every cell. viewwilllayoutsubviews can used detection of rotation on view controllers. invalidatelayout can used on collection view layout force prepare layout again causing position elements new size...

javascript - Angular ng-if="" with multiple arguments -

i trying started on angular development. , after reviewing documentation questions persist. how best write ng-if multiple arguments corresponding if( && b) or if( || b ) it possible. <span ng-if="checked && checked2"> i'm removed when checkbox unchecked. </span> http://plnkr.co/edit/uknoaajx5kg3j7aswhlv?p=preview

.net - DynamoDB Local throws http 400 bad request -

i trying run dynamo db local released aws week ago through .net sample provided amazon. amazondynamodbconfig config = new amazondynamodbconfig(); config.serviceurl = "http://localhost:8000"; client = new amazondynamodbclient(config); console.writeline(); console.writeline("creating sample tables"); createsampletables(); public static void createsampletables() { console.writeline("getting list of tables"); //this line throws error list<string> currenttables = client.listtables().listtablesresult.tablenames; exception of type 'amazon.dynamodb.amazondynamodbexception' thrown. inner exception: {"the remote server returned error: (400) bad request."} i tried call localhost:8000 using browser, , same error this error (http 400 bad request) means internet explorer able connect web server, webpage not found because of problem address. any appreciated! without seeing code, initial guess stil...

jquery - if statement is visible is undefined -

i'm trying id slide-1 has attr of displays block add class id pagecount-1 of active. i'm trying each slide indicator shown active. have: <div id="slider"> <div class="sp active" id="slide-1" style="display: block"></div> <div class="sp" id="slide-2" style="display: none"></div> <div class="sp" id="slide-3" style="display: none"></div> <div class="sp" id="slide-4" style="display: none"></div> </div> <div id="page"> <div id="page_count-1" class="indicate"></div> <div id="page_count-2" class="indicate"></div> <div id="page_count-3" class="indicate"></div> <div id="page_count-4" class="indicate"></div> </div> jquery: for ...

sms gateway - Sending SMS via PHP -

i woking on final year project , send sms client via php. is there way in can use cell phone gsm modem , send sms via php? i tried "ozeki ng - sms gateway" not sure how send sms via php. if has used/tried "ozeki ng - sms gateway" please let me know how use properly? any suggestions please let me know. i have nokia 701. can used gsm modem?. thank you try out example code twilio, used during 1 of hackathons. demo purpose may help. depends on country though. http://www.twilio.com/docs/quickstart/php/sms

user interface - How to set android:src="@android:drawable/presence_busy" programatically for imagebuton -

when use imagebutton able chose android:src="@android:drawable/presence_busy" image imagebutton choosing "presence_bussy" on system tab of resource dialog box not know how programatically. i.e. if imagebutton btn11 using btn11.setimageresource(r.xxxxxx.xxxxx); what should use here setimageresuorce ?! you as: btn11.setimageresource(android.r.drawable.presence_busy);

sql - How to prevent duplication in view when item is child of an element and also parent of itself -

have mapping table consist of data parent_sys_object_id sys_object_id 18 38 38 38 and inside view have 2 condition case statement when se.sys_object_id = 38 , psom.parent_sys_object_id = 18 when se.sys_object_id = 38 , psom.parent_sys_object_id = 38 however happen 1 case not other. meaning 1 case have data, other case have null. how should fix this? thanks bunch!

html - JavaScript Clock -

i ran snag in code, code below javascript clock works perfectly: function rendertime() { var currenttime = new date(); var diem = "am"; var h = currenttime.gethours(); var m = currenttime.getminutes(); var s = currenttime.getseconds(); if(h == 0) { h = 12; } else if(h > 12) { h = h - 12; diem = "pm"; } if(h < 10) { h = "0" + h; } if(m < 10) { m = "0" + m; } if(s < 10) { s = "0" + s; } var myclock = document.getelementbyid('clockdisplay'); myclock.textcontent = h + ":" + m + ":" + s + " " + diem; myclock.innerhtml = h + ":" + m + ":" + s + " " + diem; myclock.innertext = h + ":" + m + ":" + s + " " + diem; settimeout('rendertime()',1000); } rendertime(); however trying different this: fun...

excel - Extract last number from text string -

Image
i have following text in cells a1:a13 . extract last number string. can see, strings contain several numbers, leading zeros, slash space, others slash, ending text others not. i prefer formula, instead of using vba script. mc hope /0217 mc houston (btl-020) / 2737 mc hwy 69 s. [alltel] /5910 mc i-475 & hamilton / 0380 [ebh] mc i496 east / 0415 [on-net fiber - ebh] mc i675 / 0267 mc i-675 herzner [alltel] /0249 mc i-69 & broadway [alltel] /5404 mc i69 & dort hwy / 0309 [ebh] mc i69 & grand traverse / 0384 [ebh] mc i69 & i94 / 2472 mc i69 & i94 ii [alltel] /5847 mc i69 & m15 / 0327 should come with: 217 2737 5910 380 415 267 249 5404 309 384 2472 5847 327 edit not op per comment: "some items have more 1 slash." if the numbers thing can appear after number , have indeterminate number of digits in number, can use formula: =mid(a1,find("/",a1)+1,iferror(find("[",a1,find("/",a1))-find("/...

python subprocess popen nohup and return code -

i have following code: argpass = ['nohup'] argpass.append('/path/to/script') log_output_err = open(log_file,'a+') out = subprocess.popen(argpass, stdout = log_output_err, stderr = log_output_err) #if script fails need have logic here... i wonder how can return code of /path/to/script. maybe need insert logic in /path/to/script, thoughts? thanks, the subprocess.popen object has returncode attribute can access: http://docs.python.org/2/library/subprocess.html#subprocess.popen.returncode you @ using check_call convenience function: http://docs.python.org/2/library/subprocess.html#subprocess.check_call it return if return code zero; otherwise, raise calledprocesserror (from may read returncode attribute). your example, stdout , stderr pointing @ invoking python script rather log file: >>> import subprocess >>> argpass = ['echo'] >...

asp.net mvc routing - How to Highlight Active Tab Using Navigation Routes in Twitter Bootstrap MVC4 -

my question how highlight active tab using route-based menu system twitter bootstrap mvc4. if parent tab contains child routes, when child route selected, corresponding parent tab should highlighted. please consider example code below , thank help. below example routeconfig: routes.mapnavigationroute<dashcontroller>("parent 1", c => c.index(), "", true); routes.mapnavigationroute<maincontroller>("parent 2", c => c.index()) .addchildroute<maincontroller>("child 1", c => c.do_something(), "", true) .addchildroute<maincontroller>("child 2", c => c.do_something_else(), "", true) ; below example _layout shared view: <div class="nav-collapse collapse"> <ul class="nav"> @html.navigation() </ul> </div> ...

multithreading - Execute Python function in Main thread from call in Dummy thread -

i have python script handles aynchronous callbacks .net remoting. these callbacks execute in dummy (worker) thread. inside callback handler, need call function i've defined in script, need function execute in main thread. the main thread remote client sends commands server. of these commands result in asynchronous callbacks. basically, need equivalent of .net's invoke method. possible? thanks, jim you want use queue class set queue dummy threads populate functions , main thread consumes. import queue #somewhere accessible both: callback_queue = queue.queue() def from_dummy_thread(func_to_call_from_main_thread): callback_queue.put(func_to_call_from_main_thread) def from_main_thread_blocking(): callback = callback_queue.get() #blocks until item available callback() def from_main_thread_nonblocking(): while true: try: callback = callback_queue.get(false) #doesn't block except queue.empty: #raised when queue ...

python - Resize/stretch 2d histogram in matplotlib with x-y dependent number of bins? -

i making 2d histogram follows: import matplotlib plt import numpy np hist,xedges,yedges = np.histogram2d(x,y,bins=[50,150],range=[[0,50],[0,150]]) hmasked = np.ma.masked_where(hist==0,hist) # mask pixels value of 0 extent = [xedges[0], xedges[-1], yedges[0], yedges[-1] ] plt.imshow(hmasked.t,extent=extent,interpolation='nearest',origin='lower') plt.show() this has 50 bins in x , 150 bins in y. resulting plot narrow in x , tall in y. how stretch out plot in x bins in x allowed appear wider? if there code automatically stretches normal figure aspect ratio, optimal. plt.imshow(hmasked.t,extent=extent,interpolation='nearest',origin='lower', aspect='auto')

windows 8 - Installing Pandas for Python 2.7 64 bit - Error unable to find vcvarsall.bat -

i trying install pandas module. tried installer before when importing got cryptic errors. read using pip recommended way install packages. when use pip install pandas manages install pandas, dateultils , package when arrives numpy exits error "unable find vcvarsall.bat" . of course, searched problem seems common. however, none of solution listed (several , not clear/consistent worked). have visual studio 8 folder in program files. installed vs 2012 express added visual studio 11 folder. vcvarsall.bat found in c:\program files (x86)\microsoft visual studio 11.0\vc . i added folder path no avail. installed mingw , added c:mingw/bin path. nothing. have distutils.cfg compiler=mingw32 set already. did not create or modified it. there. puzzles me because python dist , modules should 64 bit. have epd python built on laptop. run win8 read seems harder manage. there seem several ways none clear , above did not work me @ all. please, if know how help, write step-by-ste...

How extract a string from path using regex? -

first try me! i need extract string "videos" path directory: /d/servers/domain/www/domain.com/administrator/components/com_videos/videos.php how proceed solve issue? the question's title states wants regex solution. so regex you're looking is: /(\w+)\.php$/

angularjs - Issues indirectly updating ngModel from ngClick -

i have ngrepeat populates list of customers, shown here : <div ng-repeat="terr in terrdata.data"> <div class="customer-row" ng-click="clickcustomerselect(terr)"> <input class="customer-radio" type="radio" name="customer-select" ng-model="selectedcustomerrow" value="{{terr.customerid}}"> <div class="contact-data-column">{{terr.custnm}}</div> <div class="primaryphone-data-column">{{terr.primaryphone}}</div> <!-- other customer data --> </div> </div> there click event on customer-row div says if row clicked, radio button row should checked. the basic controller logic shown here : $scope.clickcustomerselect = function(customer){ $scope.selectedcustomerrow = customer.customerid.tostring(); //other business logic }; i see whenever customer row clicked (not radio button), ...

Find out the version of Go a Binary was built with? -

is there way tell go version binary built with? i have multiple go instances on workstation, want verify correct 1 used. use runtime.version() @ runtime figure out version of go binary built with: func version() string version returns go tree's version string. either sequence number or, when possible, release tag "release.2010-03-04". trailing + indicates tree had local modifications @ time of build.

gruntjs - Grunt Multitask configuration issues -

i'm trying configure grunt file can run multiple tasks on multiple "themes". since i'm new whole grunt thing, i'm having problems configuration. my example below start, i'd have global configs, , nest specific "theme" configurations within named "target". i'm not speed on syntax, issue, when run grunt powerful error warning: required config property "watch" missing ? feel configs ok, problem lies registermultitask . ideas? module.exports = function(grunt) { // project configuration. grunt.initconfig({ // metadata. pkg: grunt.file.readjson('package.json'), banner: '/*!\n' + '* microsites v<%= pkg.version %>\n' + '* copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + '*/\n' + '/* @package: <%= pkg.name %> */\n', jquerycheck: 'if (!jquery) { throw new error(\"<%...

asp.net - PreviousPage Findcontrol Issue -

i need text of following linkbutton set postback page: <itemtemplate> <asp:linkbutton id="linkbutton1" runat="server" text='<%# bind("computername") %>' postbackurl="~/assetdetails.aspx" commandname="select">linkbutton</asp:linkbutton> </itemtemplate> i have tried many things in receiving pages load event ended with: dim gv gridview = trycast(previouspage.master.findcontrol("content").findcontrol("gridview2"), gridview) dim lb linkbutton = trycast(gv.selectedrow.cells(0).findcontrol("linkbutton1"), linkbutton) lblasset.text = lb.text obviously doesnt (returns blank, not null) work or not making post. :) please help! you doing wrong way. here gridview inside content page ( uses master page), access gridview present in content page as: if (not (me.page.previouspage) nothing) dim contentplaceholder1 control = me.page.pre...

hyperlink - Can't get my <li> image link to go to the href url -

this problems me keeps existing. can't seem figure out doing wrong. <div class="flagholder"> <ul class="langeng" style="position: relative; left: 10%;"> <li style="width: 250px; height: 50px;"> <a href="file://localhost/users/andreas/desktop/multimedia%20design/storcenterapp/en/eng.html" target="_self"> <img src="images/langeng.png" alt="english" width="50px"></a></li></ul></div> the css looks. .flagholder { position: absolute; overflow: hidden; left: -5%; top: 50%; height: 100%; width: 100%; } .langeng { overflow:hidden; } ul { list-style-type: none; } .langeng { height:50px; width:50px; display: inline-block; background-repeat: no-repeat; }

objective c - Why does my app look different when running against iOS 6 vs iOS 7? -

Image
here have set in interface builder. guidelines show can put right inherited nav bar this: when running against ios 7 looks , works fine: but against ios 6 looks uiimageview being pushed down amount, height of nav bar: why happening ios 6? i think may have found answer... my controls copy/pasted ios 6 project new ios 7/6 project. when add new fresh uiimageview project, performs expected. lesson of day: don't copy/paste controls ios 7 project , expect them function properly.

php - Sorting an array based on a condition -

i have following array $records = array( array("postid"=>"1","grid"=>"6"), array("postid"=>"2","grid"=>"3"), array("postid"=>"3","grid"=>"6"), array("postid"=>"4","grid"=>"3"), array("postid"=>"5","grid"=>"3"), array("postid"=>"6","grid"=>"12"), array("postid"=>"7","grid"=>"3"), ); i want sort array in way sum of number of back "grids" equals 12. example: values of "grids" in above array : 6,3,6,3,3,12,3 (6+6=12), (3+3+3+3=12),(12=12) new order should 6,6,3,3,3,3,12 or 3,3,3,3,12,6,6 or 6,3,3,6,3,3,12 so after sorting array new array should following: $records=array( array("postid"=>...

How to show classes in Visual Studio 2010 Professional class diagram in NOT nested way? -

Image
i have annoying problem class diagram in visual studio 2010 professional. here's example: i have main class called mybaseclass inherited myclass on other hand inherited mycomplexclass written manually in code. while try run class diagram generator in vs it's presented in nested way in single "block" of class program . how can make more tree-like(chart) inheritance lines, popular/standard display of class diagram?

Return items from list in function. Python -

this question has answer here: python script returns unintended “none” after execution of function 1 answer my_list = ['a','b','c'] def func(input): in input: print print func(my_list) output a b c none i don't want 'none' how can single line of code return items in input list? i tried: return in input: print but didn't work because return statements don't work that you printing return code func none . call func(my_list) without print .

stored procedures - How do I group a few fields to one indicator to reference later in Access VBA? -

Image
note: i'm pretty new vba. i'm trying create or feature our custom filter users can have option filter 1 or another. i'm thinking user needs select 3 field, comparison , criteria make 1 selection , when or button hit selection generated , on... until click on filter button. have code on filter work far. silly draft have far private sub cmdor_click() dim selector integer here i'm not sure how set these 3 fields 1 indicator selector = field & comparison & criteria if isnull(selector) msgbox "all 3 fields, comparison , criteria must selected", vbokcancel, "filter" else here want increment selector users can select many or option can selector 1 end sub i hope i'm being clear, if not please let me know! thanks! here have in filter button far. note: there dictionaries, collections other modules used. private sub cmdok_click() dim filter ifilter, filterstri...