Posts

Showing posts from August, 2011

audio - iOS: retrieve volume from different 'routes' -

i want save current volume in application, accessible using [mpmusicplayercontroller ipodmusicplayer] , can listen different hardware 'routes' subscribing route change notifications (so can detect headphones, etc). however, couldn't figure out how following; volume of both ios device , headphones @ once. right now, can retrieve volume of current active hardware route. is there solution problem? i'm not sure if enough of answer, best manage , retrieve volume of headphones when active route. compare volume prior. to headphone volume when plugged in, can subscribe avaudiosessionroutechangenotification : [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(audioroutedidchange:) name:avaudiosessionroutechangenotification object:nil]; and comparing current volume in callback last recorded volume. - (void) audioroutedidchange:(nsnotification*)notificaiton { avaudiosessionroutechangereason routechangereason = [[notificaiton.use...

java - BigDecimal in JSTL, divide by int or double returns integer -

<fmt:formatnumber var="instamount" value="${invoice.amount / offer.gettotalinstallments()}" minfractiondigits="2" /> where amount bigdecimal in java , totalinstallments int . tried setting totalinstallments double nothing changes. returns integer , behaves when divide 2 integers in java, integer. am missing or there workaround? the easiest solution calculation in controller/servlet , use result on view page. think calculations should done in controller , not view. use divide() method on bigdecimal. that said, if want in view have define jstl function in tag library , create static version of divide accepts bigdecimal , int diving by.

java - proving drop-down facilities in ANTLR -

in current project, developing domain specific language. instance, syntax of language following: structs: tempstruct tempvalue : double; unitofmeasurement : string; abilities: sensors: temperaturesensor attribute responseformat : string; generate tempmeasurement : tempstruct; // forward reference of defined structs in above code fragment, can see tempstruct defined. requirement want facilitate dsl programmers drop down list of defined structure. so, programmer can select 1 structs drop down list. i started working on antlr, not sure how can achieved in antlr. idea ? pointers , suggestions other tools welcomed writing dsl. i provide answer of question. have received pointers our collaborators. may others. tools create dsls , associated development environments: xtext: oaw xtext: framework textual {dsls} http://www.eclipse.org/xtext/ spoofax: the spoofax language workbench. rules ...

javascript - IE8 XHTML returned in jQuery ajax call issue -

i'm having issue cannot resolve through trying lots of different methods!! works in chrome, ff, ie9 not ie8 or ie7 overview i have page, ajax's in whole html local .aspx of reads photobucket xml feed puts html list , returns. http://custommodsuk.com/gallery.aspx i've done way page ranking isn't penilised google speed rankings, server going off , making call. the code $.ajax({ type: "get", url: ajaxurl, datatype:'html', success: function (feedhtml) { var gallerylist = $(feedhtml).find('#gallerylist').find('.listitem'); var noitems = gallerylist.length; console.log(feedhtml.type); gallerylist.each(function (index) { ... }); } }); what i've tried as can see console.log(), type undefined, feedhtml.le...

ios - Facebook Profile Picture Large -

i having trouble trying request large version of users profile picture on facebook.. in graph path i'm doing: nsstring *requestpath = @"me/?fields=first_name,last_name,gender,email,birthday,verified,picture"; the picture field in there gives me small version of profile picture, need large , normal version.. tried changing picture picture_large, pic_large, image_large none of works.. please, read documentations, don't bother answering if plan on telling me read again.. i'm asking here because searched everywhere , couldn't find solution. thanks, newton you can use: http://graph.facebook.com/user/picture?type=large where user can either user id or user name. that returns redirect static image url, written in user object documentation : http 302 redirect url of user's profile picture (use ?type=square | small | normal | large request different photo).

escaping - How can I read a CSV with quoted commas as a flat file in BusinessObjects Data Services Designer? -

i'm trying sap businessobjects data services designer 12.2.3.1 read csv file contains rows like: "00501","p",0,0,"nassau-suffolk, ny","suffolk" the results i'm getting column delimiter set comma, however, read line 7 columns rather six: "00501" "p" 0 0 "nassau-suffolk ny" "suffolk" what additional options need in order read file as-is, without external preprocessing? (if isn't possible, please , i'll stop getting grey matter on nice brick wall. thanks!) the solution set text delimiter " . text: denotes start , end of text string. characters (including specified column delimiters) between first , second occurrence of character single text string. treatment of row characters defined "row within text string" setting.

c# - How to remove the Zero Space Character (&#8203;) that ASP Repeaters generate? -

i have basic asp repeater generates ul , child li s. seems each li preceded magical 0 space character ( &#8203; ). messes design adding space between each list item. the code on dev site can't give link. here basic markup <asp:repeater id="rptrpagemeta" runat="server"> <headertemplate> <ul> </headertemplate> <itemtemplate>​ <li> </li> </itemtemplate> <footertemplate> </ul> <div class="clear"></div> </footertemplate> </asp:repeater> the repeater has list of data items gets bound in presenter. in example irrelevant since nothing each item gets rendered. generates: <ul> &#8203; <li> </li>&#8203; <li> </li>&#8203; <li> </li>&#8203; <li> </li>&#8203; <li> </li>&#8203; <li> </li> </ul>...

java - NucleusUserException when creating Google Calendar Request -

i trying authorized requests google calendar api work. seem credential , good, when try use it, i'm told i'm trying persist persisted object. this code authorization servlet, i'm authorizing user, , performing request (the callback called once, subsequent requests don't require it). protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { somethingtest(); response.getoutputstream().println("<html><head><title>hello</title></head><body><p>hello world!</p></body></html>"); } void somethingtest(){ event event = new event(); event.setsummary("appointment"); event.setlocation("hq"); arraylist<eventattendee> attendees = new arraylist<eventattendee>(); attendees.add(new eventattendee().setemail(other_attendee)); event.setattendees(attendees); datetime start = datetime.par...

c# - Dependency injection through method with Resharper or DevExpress -

i want inject dependency in 1 of class , don't know if there refactor in tools resharper or devexpress that. here class: public class classwithinjections { private dependency _fieldinjected; } public class dependency { } and final result want like: (note field can initialized method initialize ) public class classwithinjections { private dependency _fieldinjected; public void initialize(dependency fieldinjected) { _fieldinjected = fieldinjected; } } i want able activate refactor option while specifying field mouse cursor , tool suggest me if want inject dependency method, property or constructor. with resharper , can 'encapsulate field' ( ctrl + shift + r ) or creating constructor code generation tool ( alt - insert ) don't found option inject dependency 'method' technique. anybody have solution? you can use devexpress refactor! pro > create setter method refact...

windows phone 7 - WP7 BackgroundAgent will not start -

i'm facing wierd problem scheduled agent. created weeks ago , worked on phone, tested , right. today modified it, recompiled, deployed and... didn't start. i added launchfortest, tried different timespans... nothing worked. i've ensured assemblies correctly referenced, i'm not using forbidden api... , won't start. clean & build, , clean install. tried on emulator , works. if has clue of happening... thanks. there 3 options when background agent not launched: background agent disabled in settings, battery level low, background agent has crashed 2 times in row

c# - Call WCF - Host from Windows application -

i have 4 projects in solution. 2 wcf service library projects called getdetfromdb , modifydbservice , 1 console application has reference of these wcf service libraries , windows application call wcf service. i made reference of console app in windows app. able call client app window app. but how can invoke services referred in console app calling windows app? note: when press f5 or debugger-->start new instance both service runs correctly console. configured binding,endpoints address correctly. want how call programmatically. here console application code: namespace servicehostconsole { public class program { static void main(string[] args) { console.writeline("enter start"); console.read(); type servicetype = typeof(getdetfromdb.impservice); type servicemodifydb = typeof(modifydbservice.manipulate); servicehost host1 = new servicehost(servicemodifydb); host1.op...

CakePHP Google Analytics Plugin -

i building core reporting system app. , right using http://code.google.com/p/google-api-php-client/ purpose. want move application cakephp leverage framework. how can dump php client in vendors folder , leverage inside cakephp ? have never used 3rd party script inside cakephp. there write can me started ? loading vendor files in cookbook should started.

assembly - Subtracting from stack pointer for alignment? -

i have seen assembly code subtracts stack pointer before calling function without particular reason. space subtracted left empty , not used: sub esp, 8 ; stack align push dword y push dword [x] call foo add esp, 16 mov [x], eax the writer of code added comment 'stack align', don't know meant 'stack align' nor how command sub esp, 8 achieving it. any ideas? if stack pointer aligned cache line when function entered, execution of functions place less stress on cache. so, compiler system can organized insist functions entered sp aligned on cache line, , compiler, knowing how stack has been used @ each call site, how takes re-align sp before makes call. that explain example. haven't seen many compilers this, since stack tends grow/shrink modest distances , overall doesn't put demand on cache virtue of reusing local storage again , again. another use allocating space callee work in, or return result bigger fits in regi...

objective c - architcture 86_64 error -

Image
getting error: which seems connected this, have no idea why: // inline inline float onsetsds_phase_rewrap(float phase); inline float onsetsds_phase_rewrap(float phase){ return (phase>minuspi && phase<pi) ? phase : phase + twopi * (1.f + floorf((minuspi - phase) * inv_twopi)); } any ideas?

Enlisting the Gtk.Dialog.Close event from another dialog is never triggered (C# mono) -

i'm enlisting gtk.dialog close event dialog this: addtask dialog = new addtask (task); //addtask inherits gtk.dialog dialog.close += handledialogclose; dialog.show(); void handledialogclose (object sender, eventargs e) { refresh(); //does stuff in calling dialog } when close dialog (the 1 created above), handledialogclose event never triggered. idea why? here sample code, , solved myself. enlisting close() event, when should have been enlisting destroyed() event. code below works (the commented code not working). using system; using gtk; namespace test { public partial class mainwindow: gtk.window { public mainwindow (): base (gtk.windowtype.toplevel) { build (); button button1 = new button(); button1.label = "open about"; this.add(button1); button1.show(); button1.clicked += handlebutton1clicked; } void handlebutton1clicked (object sender...

Terminal screen coordinates in python -

i'm newbie in using curses lib. want make python program (running in dos terminal) can return cursor start of current line allowing subsequent output overwrite written there. tried call shellscript python it, beleive may exist better way doing it. if want rewrite current line, print return char "\r". example, prints "abcdef": # print 'abcdef' backup start of line, print 'abc' # (then print normal cr/lf 'print' does) print "abcdef\rabc" (also helpful know can suppress cr/lf ending print trailing comma...) .

Python: Change list type for json decoding -

in python 2.7+ can use object_pairs_hook in builtin json module change type of decoded objects. there anyway same lists? one option go through objects arguments hook , replace them own list type, there other, smarter way? to similar lists need subclass jsondecoder. below simple example work object_pairs_hook . uses pure python implementation of string scanning rather c implementation. import json class decoder(json.jsondecoder): def __init__(self, list_type=list, **kwargs): json.jsondecoder.__init__(self, **kwargs) # use custom jsonarray self.parse_array = self.jsonarray # use python implemenation of scanner self.scan_once = json.scanner.py_make_scanner(self) self.list_type=list_type def jsonarray(self, s_and_end, scan_once, **kwargs): values, end = json.decoder.jsonarray(s_and_end, scan_once, **kwargs) return self.list_type(values), end s = "[1, 2, 3, 4, 3, 2]" print json.loads(s,...

mysql - Values of generated column not appearing in table -

i'm using mysql version 5.1.41-3ubuntu12.10 (ubuntu) . mysql> show create table tt\g *************************** 1. row *************************** table: tt create table: create table `tt` ( `pz` int(8) default null, `os` varchar(8) default null, `uz` int(11) not null, `p` bigint(21) not null default '0', `c` decimal(23,0) default null, key `pz` (`pz`), key `uz` (`uz`), key `os` (`os`), key `pz_2` (`pz`,`uz`) ) engine=myisam default charset=latin1 1 row in set (0.00 sec) mysql> select pz,uz,pz*uz, -> if(pz*uz,1,.5), -> left(pz,2) pl,left(lpad(uz,5,0),2) ul, -> p tt limit 10; +-------+----+-------+----------------+--------+----+--------+ | pz | uz | pz*uz | if(pz*uz,1,.5) | pl | ul | p | +-------+----+-------+----------------+--------+----+--------+ | null | 0 | null | 0.5 | null | 00 | 4080 | | null | 0 | null | 0.5 | null | 00 | 323754 | | 89101 | 0 | 0 | ...

azure - Acquiring multiple leases on blobs -

if have multiple compute instances try acquire lease on same blob @ same time, seems succeed quite often. under impression once lease given out (and thus, acquired client) should impossible given out @ same time? i hope case, have been using blob leases distributed locks in azure. you need read article "managing concurrency in windows azure leases" @smarx exact answer: by @smarx: "a lease distributed equivalent of lock. locks rarely, if ever, used in distributed systems, because when components or networks fail in distributed system, it’s easy leave entire system in deadlock situation. leases alleviate problem, since there’s built-in timeout, after resources accessible again." http://blog.smarx.com/posts/managing-concurrency-in-windows-azure-with-leases

c# - How do I choose the implementation of a type been registered with Microsoft Unity -

say have interface named ipumaservices, , have 2 classes implement it: posixmlservices , taxmlservices. now have interface called ipumanotification , class implementing called pumanotification. constructor of pumanotification receives ipumaservices implementation. my question: in unity, how can register implementation of pumanotification injects posixmlservices in contructor , injects taxmlservices? this have far. using (_unitycontainer = new unitycontainer()) { _unitycontainer .registertype<ipumaservices, posixmlservices>("posixml") .registertype<ipumaservices, taxmlservices>("taxml") .registertype<ipumanotification, pumanotification>(); } i have not idea how make work requirements have above. i not able research online issue not sure how describe issue facing. i appreciate help. you can specify resolved parameters constructor , resolve inst...

cordova - Can I use the Google Maps API in PhoneGap without whitelisting the google domains? -

is there way use google maps api in phonegap application without whitelisting domains like: <key>externalhosts</key> <array> <string>maps.google.com</string> <string>maps.gstatic.com</string> <string>maps.googleapis.com</string> </array> no. if using google maps javascript api, try communicate google servers via webview , issue requests google servers. must whitelist domains, then. an alternative use native maps phonegap plugin (such mapkit), create mapview in app , presumably around whitelist restriction.

Flow panel behaves like vertical panel in Google Script GUI Builder -

when place 2 elements (buttons, etc.) side-by-side in flow panel in google apps script gui builder, rearranged in column. in other words, flow panel behaving vertical panel, not flow panel. on related note, list of widgets in gui builder includes vertical panel, not horizontal panel. consequently, can't place items side-by-side short of using absolute placement (which imagine not adjust different window sizes). is bug? being fixed? there workaround? (for reference, i'm working through example in chapter 3 of james ferreira's "google script" book.) the first thing check width of elements. admit never use gui builder. not doesn't work, it's not how write code.

html - DB Will not open from a link using file:/// in Chrome -

Image
link code in question: <a href="file:///g:\fileshare\general\po_database\po.mdb">purchase order database</a> opens fine in ie... why not in ff or chrome? there work-around? this issue caused default security settings in chrome , firefox. in order have chrome automatically open *.mdb file after being downloaded, perform following steps: 1) first time, tell browser want keep file 2) tell browser want open file automatically on 3) after step #2, notice in chrome settings new button "clear auto-opening settings" 4) associate file extension microsoft access program

C++ Array Size Initialization -

i trying define class. have: enum tile { grass, dirt, tree }; class board { public: int toshow; int tostore; tile* shown; board (int tsh, int tst); ~board(); }; board::board (int tsh, int tst) { toshow = tsh; tostore = tst; shown = new tile[tostore][tostore]; //error! } board::~board () { delete [] shown; } however, following error on indicated line -- first dimension of allocated array can have dynamic size. what want able rather hard code it, pass parameter toshow constructor , create two-dimensional array contains elements want shown. however, understanding when constructor called, , shown initialized, size initialized current value of tostore. if tostore changes, memory has been allocated array shown , therefore size should not change. however, compiler doesn't this. is there genuine misconception in how i'm understanding this? have fix want without having hard code in size of array? use c++'s containers, th...

Unix one-liner to extract substring from all files in a directory and subdirectories -

i'm looking unix one-liner output file occurrences of nslocalizedstring (from word end of line) in files in current directory , subdirectories. i've googled, haven't found solution. find . -type f -exec fgrep nslocalizedstring {} \+ | \ sed -e 's/^.*\(nslocalizedstring.*\)$/\1/' > ../your_output_file

asp.net mvc 2 - knockout.js load form into viewModel -

i'm using knockout.js handle of data-binding in application. however, on each page load, in document.ready i'm doing initial asnychronous data load this: $(document).ready() { getdata() }); however, possible instead, load data form (using asp.net mvc2) , reverse load data view model based on data-bind tags? i feel doesn't work, want confirm i'm not doing improperly. the 'value' binding sets value of element 1 in view model, no. however, duplicate code 'value' binding own handler set model values values on controls. download debug version of knockout, , ko.bindinghandlers['value'] = { on line 2182. copy binding handler declaration , change 'value' else, add call valueupdatehandler() @ end of init: ko.bindinghandlers['myvalue'] = { 'init': function (element, valueaccessor, allbindingsaccessor) { // skipping code valueupdatehandler(); // update model control values }, ...

Alternatives for accessing PHP functions -

currently, i'm developing application using standard php. such, there assorted functions called forms. examples include registration, login, logout, , others. rather creating separate file each function, i'm using phpscripts.php file in includes folder. execute function html input, pad url ?action=functionname . inside script file, use switch/case tree execute proper function based on s_get['action'] variable. is there better way implement html calls php functions? no, correct way interface html form php script. other alternatives include employing url rewriting (to convert /actions/functionname/param ?action=functionname&param=x ), basic principle remains same.

windows - Whats Difference Between (Protected / Partial) & (Friend / Shared) & (Sub / Function) on VB.NET -

when find examples online of vb.net watch functions use: (protected / partial) & (friend / shared) & (sub / function) exp() end (sub / function) my question difference? these different, unrelated items. public , protected , private , , friend access levels , determine can "see" or use method. partial used split declaration of type across multiple files. see partial details. sub , function define procedures. sub procedures not return values, function procedures return value. you'd typically combine 1 access level 1 procedure definition, hence private sub or public function , etc.

java - Geronimo double slash "//" in urls with application having context root "/" -

i using geronimo version 2.2.1. trying deploy war -file context-root set / in geronimo-web.xml . now every time navigate application urls rewritten double forward slashes. examples: http://mydomain:8080//login.jsp http://mydomain:8080//home.html how can change configuration single slash appears. have found similar questions none of them seem have answers. this known issue geronimo 2.2.1. can see details @ geronimo issue 6171 . the issue has been fixed , part of next release. have verified works expected using latest snapshot of geronimo 2.2.2.

c# 4.0 - Show Splash Screen & Progress Bar with Percentage using MVVM & WPF -

i need show splash screen image & progress bar. in application start have code below show main window. splashscreenwindowviewmodel vm = new splashscreenwindowviewmodel(); autoresetevent ev = new autoresetevent(false); thread uithread = new thread(() => { vm.dispatcher = dispatcher.currentdispatcher; ev.set(); dispatcher.currentdispatcher.begininvoke((action)delegate() { splashscreenwindow splashscreenwindow = new splashscreenwindow(); splashscreenwindow = new splashscreenwindow(); splashscreenwindow.show(); splashscreenwindow.datacontext = vm; vm.instigateworkcommand.execute(null); }); dispatcher.run(); }); uithread.setapartmentstate(apartmentstate.sta); uithread.isbackground = true; uithread.start(); ev.waitone(); in main viewmodel have code below class mainviewmodel : viewmodelbase { rivate string _...

html5 - Should HTML meta charset be lowercase or uppercase? -

normally utf should uppercased it's abbreviation. however, attributes in html lowercased. so, should be: <meta charset="utf-8"/> or <meta charset="utf-8"/> ? i know both work. thank you. the value charset case-insensitive. from w3.org a case-insensitive match character set name iana [character sets] registry has name or alias field labeled “preferred mime name”; or, if none of alias fields labeled, case-insensitive match name field in registry. link full document: http://www.w3.org/tr/html-markup/meta.charset.html

string - What is the Ruby equivalent of PHP's .= -

possible duplicate: ruby equivalent of php's “.=” (dot equals) operator i want create variable include_items , keep on adding strings it. in php be... $include_items = "<td>first item</td>"; $include_items .= "<td>second item</td>"; $include_items .= "<td>third item</td>"; try << , see how works. can use += , creates objects unnecessarily.

user interface - How do I create this Java Swing separator UI component? -

i'm creating ui in swing toggles various jtables displays different data, example image attached below. does know how create separator ui component highlighted in red box, appears, toggle respective ui component? i've accomplished intent using jbuttons toggle jpanels, ui layout not clean compared attached example. tia! (sorry...new users can't post images) example swing ui answer: used jbutton separator graphic painted inside create clickable separator graphic.

PHP cannot verify if directory exists -

i going crazy one i have folders , files structure / /projects /mytest /install /index.php /product /resources so, inside install/index.php file trying verify if /product folder exist. know folder exists, looks php doesn't. code: if(file_exists('../../mytest/product') && is_dir('../../mytest/product')) { echo 'folder exists!'; } else { echo 'php blind or something!'; } maybe tired, cannot figure out wrong. rested minds here maybe see problem. thanks! with current directory structure: / /projects /mytest /install /index.php /product /resources the following code works fine: <?php if(file_exists('../product') && is_dir('../product')) { echo 'folder exists!'; } else { echo 'php blind or something!'; } ?> as current code: <?php if(file_exists('../../mytest/product') &...

c - Having issues with fwrite and fgets processing it -

char string[50], s[50]; file *f = tmpfile(); count = 1; while (fgets(string, 50, stdin)) { if (string[0] == '!') { rewind(f); } else { fwrite(string, 50, 1, f); } if (strcmp("history\n", string) == 0) { rewind(f); while(fgets(s, 50, f)) { printf("\t%d %s", count, s); count++; } count = 1; } } the context of code not hugely important. problem let's fgets takes in "ls", "date", , "history". resulting output is: 1 ls 2 3 te 4 5 ory 6 it should be: 1 ls 2 date 3 history since feature requests mark comment answer remain declined, copy above solution here. looks '\r's in buffer. , should fwrite strlen(string) bytes. – daniel fischer

visual studio 2010 - ASP.NET Publishing Error -

i'm trying publish project given host. have ftp access , publishing visual studio. says succesfully published. when try access says the page cannot found the page looking might have been removed, had name changed, or temporarily unavailable. what can problem? it can caused several reasons. the publish may not successful. your request file excluded project won't copied other files. your request url incorrect. the logic handles request may returns 404 response defined developer. you better check file status on published server decide reason. or can access other pages via browser of published web site?

html - Prevent DIV from Wrapping with Fluid Layout -

i having trouble preventing div wrapping next line when shrink browser window. there must small , simple missing, i've been @ while , cannot figure out. appears kick down "blog" div, not "info" div. suggestions? here example: http://www.spynsycle.com/portfolio/ css: /* level 1 */ #container { min-width: 800px; width: 100%; min-height: 768px; height: 100%; background-color: lightgrey; } /* level 2 */ #portfolio { min-width: 396px; width: 40%; min-height: 768px; height: 100%; float: left; background-color:lightgreen; } #information { min-width: 108px; width: 20%; min-height: 768px; height: 100%; float: left; background-color: lightcoral; } #blog { min-width: 396px; width: 40%; min-height: 768px; height: 100%; float: left; background-color: lightblue; } html: <html> <head> <meta http-equiv="content-type" content=...

ASP.NET postback has empty request body, but only sometimes -

i'm working on high-traffic asp.net website, , around once per 30 minutes, post request triggers httpexception: request timed out. in our debugging, found out asp.net getting request, not request body. here headers : connection: keep-alive content-length: 49476 content-type: application/x-www-form-urlencoded accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 accept-encoding: gzip,deflate accept-language: en-us,en host: abc.123.com referer: https://abc.123.com/page.aspx and request body empty. behind load balancer, if helps anything. my question is, how debug , fix issue this ? according accepted answer in post: diagnosing "request timed out" httpexceptions it looks may happening request being split 2 tcp segments, 1 header , 1 body. since we're behind load balancer common virtual ip, may entirely possible 1 of tcp segments being sent 1 server , other being sent another. plausible case? or can else causing ...

asp.net mvc 3 - Workflow foundation locale setting different from instantiated thread -

i hosting few workflows inside mvc project. in web.config, set currentculture , currentuiculture en-au while server en (or en-us, doesn't matter). anyway, mvc site runs in aus locale fine, workflow foundation in original locale (en-us). setting when workflow starts resolves problem, seems more hack solution. so, how set locale of workflow thread? thanks in advance.

email - AppleScript and Mail.app: checking if new messages contain a string -

i'm writing script check if particular web form has been submitted. the script far reads thusly: tell application "mail" check new mail set newmail unread count of inbox repeat msg in newmail if msg's subject contains "new newsletter built by" return msg's subject end if end repeat end tell i've got unread email in inbox script work with, still error: error "mail got error: can’t make 1 type specifier." number -1700 1 specifier any @ appreciated. cheers! tell application "mail" check new mail repeat until (background activity count) = 0 delay 0.5 --wait until new messages in box end repeat try return subject of (first message of inbox read status false , subject contains "new newsletter built ") end try end tell

iphone - Image Description NSLog -

when try nslog image this; nslog([images description]); this appears: 2012-06-05 10:31:38.801 project1[1180:1a303] ( "<uiimage: 0x9a52bb0>", "<uiimage: 0x9c89460>", "<uiimage: 0x9c9c720>", "<uiimage: 0x8e4ee70>", "<uiimage: 0x8e805f0>" ) i'm loading uiimage nsdocumentdirectory .could explain whats this. it looks images object nsarray (or similar array object) of uiimage s. when nslog description of images array listing objects in array , calling description on each of objects. doesn't make sense text description of image instead prints object type, in case 'uiimage', , address of object in memory, e.g. 0x9a52bb0 . i'm not sure mean "and how make nsinteger?' doesn't make sense convert image integer.

php - move_uploaded_file() gives a Owner/Group error -

i'm using move_uploaded_file() upload images server, gives usual error of: warning: move_uploaded_file(upload/file.png) [function.move-uploaded-file]: failed open stream: no such file or directory in /home/newuser/public_html/model/account.class.php on line 39 warning: move_uploaded_file() [function.move-uploaded-file]: unable move '/tmp/phpulkuge' 'upload/file.png' in /home/newuser/public_html/model/account.class.php on line 39 this not permission based have set folder 777 root access , ls -l displays correctly this. 755 /home/newuser/public_html/model 755 /home/newuser/public_html/model/account.class.php 777 /home/newuser/public_html/upload php line move_uploaded_file($_files["photo"]["tmp_name"], "../upload/file.png"); the problem think down owner/group setting being configured incorrectly .. while had of sites subdomains in 1 account: /home/olduser/public_html/subdomains/index.html i changed , c...

java - Need a regular expression for a spreadsheet calculator -

i'm building calculator can operate on cells in spreadsheet, , need regular expression part of it. what need parse out following: digits: integers. cell names: named 'alpha character' + 'digit' ie. a1, b2... operations: +, -, *, / an example like: 23 a4 * 2 b5 / here want groups be: 23, a4, *, 2, b5, / it shouldn't tough, operations throw me off. the reason wanting regex , not splitting on spaces validation. i'm looking specific things, thought regex best thing use. here want groups be: 23, a4, *, 2, b5, / string[] groups = "23 a4 * 2 b5 / ".split(" ");

ios - UITextField automatically begins editing mode -

Image
i have 3 uitextfields inside of uitableview (3 separate rows). first 2 standard uitextfields require text input third requires data entry , associated uidatepicker . problem statement: when screen loads, third text field automatically begins editing , pops date picker. annoying. want screen wait user begin input before doing anything. please find below viewdidload code. / insight appreciated - (void)viewdidload { [super viewdidload]; [scrollview setcontentsize:cgsizemake(320, 910)]; expirationdatepicker.hidden = yes; expirationdatepicker.date = [nsdate date]; [expirationdatepicker addtarget:self action:@selector(changedatevalue:) forcontrolevents:uicontroleventvaluechanged]; [self configureview]; } - (void)configureview { nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentspath = [paths objectatindex:0]; //get docs directory nsstring *filepath = [docum...

linux - Replacing a website on a Tomcat Server with a static HTML website -

i made small static website client , want me replace present dynamic website static one. have ubuntu ssh installed on remote location. existing website running on tomcat6 server , site root in "/var/lib/tomcat6/webapps/root/". my website consists of static html pages. how can reconfigure/ replace present website 1 made? should stop server , replace files in site root files? adding updated web.xml: <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>welcome onelearn</display-name> <description> welcome onelearn </description> <session-config> <session-timeout>60</session-timeout> </session-config> <servlet> <servlet-name>helloservlet</servlet-nam...

sencha touch 2 numberfield separator -

i have st2 app has numberfield phone number: { xtype: 'numberfield', id: 'phone', name: 'phone', cls: "detailtext", label: 'phone:' } i have running on both android , iphone. if enter phone number of "555123987", android display "555123987" while iphone display "555,123,987". how remove commas? i'm using numberfield because elsewhere in app user uses contents of field make call. there way stop junk characters getting in there without watching keydown or something? maybe using textfield regex somehow? you can set ui config text ( ui: 'text' ). so: xtype: 'numberfield', ui: 'text', label: 'phone', name: 'phone' that's quick way prevent commas automatically getting in there on iphone. doesn't prevent user typing in own ...

ruby on rails 3 - Missing client_id with Devise and Facebook-Omniauth -

here initializers/devise.rb code facebook: require "omniauth-facebook" config.omniauth :facebook, "app_key", "app_secret" and have added: devise :omniauthable model want able use facebook with. when click on link: <%= link_to "sign in facebook", user_omniauth_authorize_path(:facebook) %> i get: an oauthexception message: "message": "missing client_id parameter.", notice app_key , app_secret ones can see on facebook app haven't put here. on url redirected when clicking sign in facebook link see client_id parameter empty: https://graph.facebook.com/oauth/authorize?response_type=code&client_id& but why? i have never done directly devise. works devise. omniauth podcast on railscasts alternatively, if still want stick using devise built-in omiauth, try find way provide app id , app secret. i'm pretty sure have provide in devise.rb in config/initializers/

java - How to measure the rendering time of a View? -

i'm using chartengine create scatter plots. each scatter plot view . how measure time required render view ? like this class myview extends view { @override protected void ondraw(canvas canvas) { time t = new time(); t.settonow(); long timestart = t.tomillis(false); super.ondraw(canvas); t.settonow(); long timetodraw = t.tomillis(false) - timestart; } }

How to convert first few seconds of a video to multiple output formats using ffmpeg -

i want convert first few seconds (say 5 seconds) of video multiple output formats using ffmpeg. when use syntax convert whole video, goes ok: (to simple, left options default) ffmpeg -i input.flv output1.mp4 output2.avi but when trying first 5 seconds using syntax: ffmpeg -t 5 -i input.flv output1.mp4 output2.avi first output file (i.e ouptput1.mp4) ok , 5 seconds length, second (and next outputs, if present) has size of original file. this ffmpeg prints out on screen. d:\ffmpeg\bin>ffmpeg -t 5 -i input.flv output1.mp4 output2.avi ffmpeg version n-40301-gc1fe2db copyright (c) 2000-2012 ffmpeg developers built on may 3 2012 11:40:38 gcc 4.6.3 configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable -libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libope n...

html5 - CSS3 animations perform worse in a web browser control than IE10 -

i made new wpf project web browser control in it. when load html page css3 transformations in both simple app , plain ie10 (both on windows 8, versions), there vast different in performance. inside webbrowser control choppy, in ie10 smooth. things have tried: installed high end video card added dword value of 10001 wpfapplication1.exe registry @ hklm\software\microsoft\internet explorer\main\featurecontrol\feature_browser_emulation . (we set value wow6432 version of same key) set feature_gpu_rendering 1 wpfapplication1.exe (e.g. hkey_local_machine\software\wow6432node\microsoft\internet explorer\main\featurecontrol\feature_gpu_rendering ) confirmed both these new values being read application using process monitor. does know more tricks force web browser control behave ie10? know there lot of featurecontrols turned on default in ie off in web browser control, doesn't more affect animation performance.

javascript - Alert message if there is new data on server -

i'm building simple phonegap application new messages mysql server , show them user. application supposed json { "key": [ { "message": "test" } ] } from server every minute , alerts if there new. right alerts message "test" every time though json has changed this: {"key":[]} after application has asked server first time. this js use setinterval ( "getmessages()", 60000 ); function getmessages() { $.getjson(serviceurl + 'messages.php' ,function(result){ $.each(result.key, function(index, field){ alert(field.message); }); }); } the request being cached browser. change url to: serviceurl + 'messages.php?' + new date().gettime() this trick browser thinking it's different request each time , therefore avoids issues caching.

php - Creating or updating multiple mysql lines using Yii model -

i've started working yii, forgive ignorance :) i have sql query returns multiple rows (array of arrays), want insert rows db: $queryresults = $command->queryall(); $model=new campaigns(); foreach ($queryresults $cactive) { $model->setisnewrecord(true); $model->attributes=$cactive; if($model->save($cactive)) { echo "good!"; } the problem though i'm setting model new record has record of previous pk (since it's same model). do need create new model each row? (doesnt seem likely...) thanks always, danny you have create new instance @ every insert, this, otherwise updating 1 model on , over. $queryresults = $command->queryall(); foreach ($queryresults $cactive) { $model=new campaigns; $model->attributes=$cactive; if($model->save($cactive)) echo "good!"; }

Hibernate Search @IndexedEmbedded not indexing -

@entity @indexed @sequencegenerator(name="subjectseq", sequencename="subjectseq") public class appinfo { @id @generatedvalue(strategy=generationtype.sequence, generator="subjectseq") public integer id; public integer district; @field @boost(2.0f) public string appname; public string thumbnail; public integer statistics; @field public string description; public integer publisher; public date publishat = new date(); @manytoone @indexedembedded @boost(1.5f) @joincolumn(name="type") public apptype type; @manytomany @jointable(name="appinfo_appcatalog", joincolumns={@joincolumn(name="info_id", referencedcolumnname="id")}, inversejoincolumns={@joincolumn(name="catalog_id", referencedcolumnname="id")}) @indexedembedded @boost(1.5f) public list<appcatalog> catalogs; } @entity @sequenceg...

.net - How to get event/exception from timer event handler back to main thread in C#? -

i have windows service application (no winforms). in main method started timer. timer elapsed event handler running in new thread(?). easy way how throw exceptions timer elapsed event handler main thread? i trying handle exceptions in handler body , rise custom events, when restart main process on rising event, runs 2 processes doing same things simultaneously. how can event or exception information form timer event handler thread main thread? thank you. edit: using system; using system.security.permissions; using system.timers; namespace testingconsoleapplication.model { static class threadexceptiontester { [securitypermission(securityaction.demand, flags = securitypermissionflag.controlappdomain)] public static void run() { appdomain currentdomain = appdomain.currentdomain; currentdomain.unhandledexception += new unhandledexceptioneventhandler(myhandler); timer timer = new timer(1000); timer.elapsed += new elapsedeve...

qt - Include calculatorform example as custom widget without promotion? -

i've build collection of several widgets , included them qtdesigenr. can't figure out how include calculatorform-example. it's ui build widget after adding collection interface still can't compile because of missing ui_calculatorform.h file. what missing? promoting widget no option, has drag'n drop. thank hints. if want create ui_form.h form form.ui. do, uic -o ui_form.h form.ui

embedded - Implementation refrence for Intelligent SPI Controller (Queue Based) -

intelligent spi controllers queued serial peripheral interface (qspi) 1 type of spi controller. uses data queue programmable queue pointers allowing data transfers without cpu intervention.[6] has wrap-around mode allowing continuous transfers , queue no cpu intervention. can suggest me tutorial/refrence code can develop better understanding of intelligent spi controllers described above.

javascript - How to send messages not to all subscribers of channel -

is there way send message n random subscribers on channel, not subscribers, using faye , ruby client server and/or javascript browser. i'm interested in clients examples in both these programming lnaguages if possible. found answer creator of faye http://groups.google.com/group/faye-users/browse_thread/thread/6cabf09bb9367e04 "faye not support (send message one, specific client), can address messages channels. easy way have client pick unique channel using guid generator , have communicate server."

c# - Async Tcp Server cannot receive data -

i tyring create multi threading , async tcp server implements tcpl listener current server working intended able send data server transmit data client out problems however after have sent data server , sent data client, when client sends data server again server unabe pick data i have tried days find answer problem no luck here code using in server: using system; using system.collections.generic; using system.linq; using system.text; using system.net; using system.net.sockets; using system.threading; using system.windows.forms; using system.io; namespace mytcpasyncclass { public class stateobject { public tcpclient mytcpclient = null; public networkstream mynetworkstream = null; public const int mybuffersize = 1024; public byte[] mybuffer = new byte[mybuffersize]; public string requeststring = ""; public stringbuilder mystringbuilder = new stringbuilder(); char[] requestchars; // char array of requ...