Posts

Showing posts from May, 2015

CodeIgniter Datamapper ORM: Error with relationship by using get() -

i have problem datamapper orm in codeigniter... :o my first model: class mil_widget extends datamapper { // insert related models mil_widget can have more 1 of. var $has_many = array( 'mil_relationship' => array( 'join_table' => 'mil_fields_mil_widgets' ) ); } and other model: class mil_relationship extends datamapper { // insert related models mil_widget can have more 1 of. var $has_many = array( 'mil_widget' => array( 'join_table' => 'mil_fields_mil_widgets' ) ); } if di works , saves right database entry: $w = new mil_widget(1); $r = new mil_relationship(1); $w->save($r); but if error: $w->mil_relationship->get(); and error: datamapper error: 'mil_widget' not valid parent relationship mil_relationship. relationships configured correctly? thank you!

ios - CorePlot: xAxis NSDateFormatter trouble -

Image
i'm making app coreplot , trying labels along xaxis read 12pm , 1pm, 2pm, etc. have implemented nsdateformatter xaxis.label formatter. problem is, intervals appear in seconds (see pic below) need them in hours. i tried fix making xaxis.majorintervallength 3600, makes graph this: the tick stil there, they're placed 3600 placed apart, if makes sense. here code: cptxyaxisset *faxisset = (cptxyaxisset *)self.graph.axisset; faxisset.xaxis.title = @"time"; faxisset.xaxis.titletextstyle = textstyle; faxisset.xaxis.titleoffset = 30.0f; faxisset.xaxis.axislinestyle = axislinestyle; faxisset.xaxis.majorticklinestyle = axislinestyle; faxisset.xaxis.minorticklinestyle = axislinestyle; faxisset.xaxis.labeltextstyle = textstyle; faxisset.xaxis.labeloffset = 3.0f; faxisset.xaxis.majorintervallength = cptdecimalfromfloat(3600.0f); faxisset.xaxis.minorticksperinterval = 1; faxisset.xaxis.minorticklength = 5.0f; faxisset

playframework 2.0 - Intellij Play make project error: not found: object Keys -

intellij idea 12.1, play 2.0.4 i got error running build...make project: scala: not found: object keys import keys._ this existing play 2.0.4 project typically run eclipse , command line using "sbt ..." instead of "play ...". use paul sbt-extras script https://github.com/paulp/sbt-extras plugins.sbt has line addsbtplugin("play" % "sbt-plugin" % "2.0.4") the error in build.scala file has typical first few lines of play project like import sbt._ import keys._ import playproject._ i think need specify play configuration home , working directory not sure put in them. in case ran same issue, had few things. note: using sbt version 0.11.3-2 1) plugins.sbt changes added resolver: "sbt-idea-repo" @ "http://mpeltonen.github.com/maven/", added sbt-idea plugin: addsbtplugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0") downgraded play plugin 2.0.1 : addsbtpl

Generate a page with php based on what user clicks -

so i've made database of guilds of mmo. people can go there , filter gaming guilds based on numerous different options , displays in nifty table. example: guild name - focus - leaders guild 1 - pvp - bob guild 2 - pve - fred now want make guild name link takes user guilds page. page doesn't exist until person clicks on link, create temple called viewguild.php , if person clicks "guild 1" takes them http://somesite.com/viewguild.php?name=guild1 . , have done! using code: echo '<tr><td><a href="viewguild.php?id='.$guild2.'">'.$guild2.'</a></td>'; it creates link fine! problem is, can't seem php file, viewguild.php, generate information based on guild name person clicked. you can use $_get['id'] variable in viewguild.php name of guild in url.

servlets - Password protection .htaccess like in Java web applications -

i have following scenario: i'm developing java ee web application running on jboss 6.1.0 , want publish application on public server end-user testing. for example: http://mysite.com/testings/app1/ my question: appropriate way protect directory in .htaccess (apache http server) fashion, so, when client try access http://mysite.com/testings/app1/ asked user/password combination?. i think there 2 options: configuration on servlet server? reverse proxy?. i want clarify best practice in situation, because php applications .htaccess feature fit needs. you can use spring security that, wrote example in how do http basic auth using struts 2/ spring 3? . or can use apache httpd server "above" jboss (using rewrites , proxy) users access site via apache, , apache forwards jboss (that listen on localhost). here example rewrite rule forward "www.mysite.com" web application "myapp" ajp connector on port 8009: <virtualhost www.mys

image processing - How to find and display a graph of mean square error as a function of quality factor using Matlab? -

our teacher wants print @ matlab graph plots, in x axis , quality factor , , on y axis mean square error . image known "lenna.jpg". i've searched , found how find mse, didn't find helps me on how find quality factor. so, can please tell me in matlab code, how find these 2 things , how display them in graph? thanks in advance. i don't have matlab available right now, think following should work: original=imread('lena.jpg'); mse=zeros(1,100); q = 1:100 tempfile = sprintf('lena%03d.jpg', q); imwrite(original, tempfile, 'quality', q); thisone = imread(tempfile); mse(q) = sum((original - thisone).^2)/numel(thisone); end figure plot(1:100, mse) xlabel 'quality factor' ylabel 'mse' title 'degradation of lena.jpg quality factor'

django - Converting and Unifying API data in Python -

i'm trying pull similar data in several third party apis, of have varying schemas, , convert them unified schema store in db , expose through unified api. re-write of system this, minus storing in db, hard test , not elegant. figured i'd turn community wisdom. here thoughts/what i'd achieve. an easy way specify schema mappings external apis schema internal schema. realize nuances in data might lost converting unified schema, that's life. schema mapping might not easy , perhaps overkill academic papers i've found on matter. an alternative solution allow third parties develop interfaces external apis. code quality of these third parties may or may not known, established via thorough tests. therefore system should easy test, i'm thinking mocking external api calls have reproducible data , ensure parsing , conversion being done correctly. one of external api interfaces crashing should not bring down rest of them. some sort of schema validation/way detec

Cocos2d-x: How to optimize memory from 100 same sprites? -

my task draw 1 sprite 100 times in frame. example need draw row made of 1 sprite "sprite.png". this: ccsprite *spritearr[ 100 ]; ( unsigned int = 0; < 100; i++ ) { spritearr[ ] = new cocos2d::ccsprite(); spritearr[ ]->initwithfile( "sprite.png" ); spritearr[ ]->setposition( cocos2d::ccpoint( * 10, 100 ) ); this->addchild( spritearr[ ] ); } and that's problem. allocate memory 100 times 1 sprite don't know how differently. how can optimize it? there way in cocos2d drawing sprite using coordinates (x , y) not allocate memory each same sprite? you're good. 100 sprites reference same texture object, it's single texture in memory. each sprite instance adds less 500 bytes of memory on top of that. your best option conserve memory use .pvr.ccz format images.

php - infinite loop in Facebook app -

in facebook app, infinite redirect loop because of following 2 lines, although working yesterday! $loginurl = $facebook->getloginurl(array('redirect_uri' => $fbconfig['appurl'], 'scope' => 'user_birthday,email')); print "<script type='text/javascript'>top.location.href = '$loginurl';</script>"; apparently problem in getting user data api: if ($user) { try { // if user has been authenticated proceed $user_profile = $facebook->api('/me'); } catch (facebookapiexception $e) { error_log($e); $user = null; } }

Is it 'illegal' to include a GENDER type in vCard 3.0? -

i understand vcard 4.0 introduce commonly used contact property fields (types) gender, anniversary, etc. there no standard way represent these in vcard 3.0 format. my question should client if vcard 3.0 object contains gender type. make invalid vcard, or clients ignore fields? some clients add x-gender property. however, since it's extended property, there's no guarantee application reading vcard detect it. x-gender:male source: http://en.wikipedia.org/wiki/vcard#vcard_extensions you go ahead , include gender property, though it's not part of 3.0 specs. specs if vcard contains property consumer not recognize, consumer must ignore property , continue parsing rest of vcard.

Macromedia Director: Decompile EXECUTABLE File -

it possible extract executable files?? if possible software may use? it depends how deep want dig executable , kind of data need exe. exe files can analyse them on low level. assume want have high-level tool director files used create exe, right? exe-file (the "projector" use appropriate director wording) there no such tool known me. but exe file used files extensions such .dxr or .dir. director files. dxr-files protected. importing them director can extract of cast memebers (graphics etc.) included. need in-deep knowledge of lingo so. you might find .cst or .cxt files. cast files. can hold media, scripts etc. too. cxt protected versions. these files same true dxr , dir files. all in - not easy , chances low completly reveal code , media. director programmer use protected files distributing programs. not allow reveal data included.

c - how to find funcation name based on address in library -

i'm printing stacks c code using backtrace_symbols() (following instructions on http://www.gnu.org/software/libc/manual/html_node/backtraces.html ). however, can addresses of stack frames in dynamic library though built library using -g -rdynamic . now, have running process , have library, how find out method each frame address corresponds to? thank in advance. this on 64bit linux. the example of print out looks this: obtained 9 stack frames. /tmp/libexample.so [0x2aaabaae9771] /tmp/libexample.so [0x2aaabaae9828] /tmp/libexample.so [0x2aaabaaa8138] /tmp/libexample.so [0x2aaabaab2402] /tmp/libexample.so [0x2aaabaabd029] /tmp/libexample.so [0x2aaabaa1e23a] /tmp/libexample.so [0x2aaabaa24ded] /lib64/libpthread.so.0 [0x30b700677d] i think you're looking dladdr function.

initialization - Does declaration in c# allocate memory or is it the new operator that allocates memory? -

does declaration in c# allocate memory variable created or new operator allocates memory , enables invoke constructor initialize allocated variable in memory? to understanding, cannot call constructor of type without new operator. correct? does declaration in c# allocate memory variable created or new operator allocates memory , enables invoke instructor initialize allocated variable in memory? first let's make sure you're asking question think you're asking. value type, variable storage location , value storage location the same storage . reference type, storage location associated the variable contains reference storage location associated the object . different. second, let's clarify mean "declaration" of "variable". static field, instance field, local variable , formal parameter have declarations. moreover, allocation semantics of local variables , formal parameters different if closed-over outer locals of lambda, , se

Comparing Multiple Lists Python -

i'm trying compare multiple lists. lists aren't label...normally. i'm using while loop make new list each time , label them accordingly. example, if while loop runs 3 times make list1 list2 , list3 . here snippet of code create list. for link in links: print('*', link.text) locals()['list{}'.format(str(i))].append(link.text) so want compare each list strings in them want compare lists @ once print out common strings. i feel i'll using this, i'm not 100% sure. lists = [list1, list2, list3, list4, list5, list6, list7, list8, list9, list10] common = list(set().union(*lists).intersection(keyword)) rather directly modifying locals() (generally not idea), use defaultdict container. data structure allows create new key-value pairs on fly rather relying on method sure lead nameerror @ point. from collections import defaultdict = ... link_lists = defaultdict(list) link in links: print('*', link.text) link_

jquery - Cannot affect css worth a darn -

i'm new foundation , jquery selectbox. said, have wasted night trying accomplish simple task , virtually no results @ all. i have html: <!-- top nav --> <div class="nav row"> <div class="small-3 columns"> <select id="team" name="team"> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </select> </div> <div class="gear small-1 columns"> <a href="#"><img id="teamsettingsgear" src="/images/settings.png" alt="team settings" /></a> </div> <div class="small-3 columns"> <select id="site" name="site">

Good UML to java code generator? -

is there programs simple , stand-alone can convert uml diagrams java code? if there isn't best eclipse plug-in? you can try web application genmymodel it enables generate uml java. if use github repository, can preserve changes between each generation (using jmerge annotations).

image processing - How to find width of (1D discrete) Gaussian Kernel for a certain sigma? -

is there rule of thumb or mathematical equation tells me how wide (1d discrete) gaussian kernel should sigma? lets say, choose sigma of 1.87, should kernel 5 values/steps/pixels wide, 7 oder rather 25 in order perform standardized image smoothing? thank you. pick threshold consider ignorable, t = 0.01 . solve exp(-x^2/(2s^2)) / sqrt(2pi s^2) < t : |x| < s sqrt(-2 ln(sqrt(2pi s^2) t)) the right hand side gives width. s = 1.87 , t = 0.01 , gives width of 4 pixels.

java - How to get a byte array from FileInputStream without OutOfMemory error -

i have fileinputstream has 200mb of data. have retrieve bytes input stream. i'm using below code convert inputstream byte array. private byte[] convertstreamtobytearray(inputstream inputstream) { bytearrayoutputstream bos = new bytearrayoutputstream(); try { int i; while ((i = inputstream.read()) > 0) { bos.write(i); } } catch (ioexception e) { e.printstacktrace(); } return bos.tobytearray(); } i'm getting outofmemory exception while coverting such large data byte array. kindly let me know possible solutions convert inputstream byte array. why want hold 200mb file in memory? going to byte array? if going write outputstream, outputstream ready first, read inputstream chunk @ time, writing chunk outputstream go. you'll never store more chunk in memory. eg: public static void pipe(inputstream is, outputstream os) throws ioexception { int read = -1; byte[] buf = n

text - How do I set up a listener? -

i think need listener, can’t set up. in code below, both time dialog , date dialog work. little dialog w/ rollers comes up, select date/time, select , have date. cannot text input work. have tried several iterations of code sample program had: bnbodyentered = true; bodydialog = new textinputdialog(this); bodydialog.settext("body"); code showed text dialog w/ alphabet roller, program ran past , when entered few letters , selected nothing happened. makes since did not set listener. added (as noted) bodydialog.setondismisslistener(textsetlistener); using several "seton----listener" values , either still runs past, or various compile errors. this wimmone watch, version 7 , no virtual keyboard. needs dialog. (note: deleted gobs of commented code before posting - possibly more, if doesn't make since - sorry. ) thanks, clark /****************************** * wimm imports ******************************/ import com.wimm.

php - (Apparently) weird "Access denied" MySQL error -

i begun working on legacy php application , found myself fighting strange behavior. i'll try explain scenario/code/error: all queries executed through singleton class, opens connection , keeps opened whole session (as far understand code) every time mysql_query returns false , exception thrown. many queries executes "fine", complaining not existing tables (one of tasks clean messy-clipper-inherited-database-scheme, i'm running code , creating tables needed). after creating missing tables, queries runs well. some queries returning 1045 error: access denied user 'appuser'@'localhost' (using password: yes) here comes "weird" behavior: i have enabled general log in mysql install, there no mentions of access denied errors. application queries seem run fine (i "seem to" because i'm having problems understanding sections of log format). the username/password configured in singleton class ok. can log in using mysql cl

iphone - Displaying the time duration the app was in background -

i new ios programming, , trying make simple app know more lifecycle , different states. app store current timestamp when app running, , whenever goes background , comes up, show message "good see after xx minutes". now, approach this, @ beginning there timestamp stored in variable, , when viewdidload() method called, check timestamp current timestamp , display subtracted value. when app going background, change value of local timestamp variable in viewdidunload() method , when coming compare timestamps , display message. any pointers regarding correct approach of doing this? use below code in appdelegate.m file put below method -(void)mincalculation_backgroundtime:(nsstring *)backgroundtime forgroundtime:(nsstring *)foregroundtime { nsdateformatter *dateformat = [[nsdateformatter alloc]init]; [dateformat setdateformat:@"mm/dd/yyyy hh:mm:ss"]; nsdate *lastdate = [dateformat datefromstring:foregroundtime]; nsdate *todaysdate = [

c# - zoom image in gridview -

i new asp.net.i have gridview displays data database.one of field contains image.the image shown dynamically image path stored in database. table contains fields car_name car_id car_photo no_of_seats now want when user clicks on image want pop image in modal.....or image should zoomed that.... <%@ page title="" language="c#" masterpagefile="~/project/masterpage/masterpage.master" autoeventwireup="true" codefile="reserve.aspx.cs" inherits="project_reserve_reserve" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="asp" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> <link href="reserve.css" rel="stylesheet" type="text/css" /> <script src="../../javascript/jquery-1.9.0.js" type="text/javascript"></script&

database - update query issue using jsp -

please resolve update query (using jsp) //resultset resultset object & working //rsmd resultsetmetadata object & fetching data properly for(int i=1;resultset.next();i++) { update_query="update demo_table set "; for(int j=1;j<=rsmd.getcolumncount();j++) { temp_str=request.getparameter(rsmd.getcolumnname(j)+i); // having id of textboxes of columnname1,columnname2(eg. s_no1, name1) using if(j==rsmd.getcolumncount()) { update_query+=rsmd.getcolumnname(j)+"=\'"+temp_str+"\'" ;//not working //working update_query+=rsmd.getcolumnname(j)+"=\""+ temp_str+"\"" ; } else { update_query+=rsmd.getcolumnname(j)+ "=\'"+ temp_str+"\' ,";//not working //working update_query+=rsmd.getcolumnname(j)+ "=\"" + temp_str + "\" ,"; } } . . . . remaining upda

java - Implmentation of JNI.h vs JVMTi.h -

i working on software till supports jni , not jvmti. not able make clear distinction why jvmti helpful , if working jni jvmti going add it, seem doing same kind of work. jni , name suggests, serves purpose of integrating native code java applications. means can call function written in c java code. now jvmti doesn't add jni serves different purpose. provides means of communication between jvmti agent , java virtual machine tools profilers, debuggers etc... merely uses jni, doesn't add it.

dicom - How to Draw Marker in MRI File With Respect to Contrast Agent -

i confuse on draw overlay on mri image means part similar structure report(sr) processing or not i trying read mri file in such way contrast agent. after searching on google information such "the data extracted injecting contrast agent patient’s vein,then taking sequential snapshots of volume of interest contrast agent diffuses through area" but totally new out can me 1. give me specific link these topic 2. how read contrast agent value mri dicom file. 3. how show shaded region cancer detected or kind of marker on location pixel intensity of dicom file higher. well, mri scan stack of grayscale images, pretty ct is, except intensity units of course different. so, read other dicom image, , pixels values intensities, or perform segmentation. cancer tumor regions , other features stored in separate dicom object, called rt structure set (it produced radiotherapy planning system or contouring software).

How to convert NSDate to milliseconds in Objective C? -

this question has answer here: how nsdate millisecond accuracy? 3 answers for example: assume nsdate tempdate = "05-23-2013" . want value converted milliseconds. how can objective c? there similar post here , here . basically have second form reference date (1 january 2001, gmt) , multiply 1000. nstimeinterval seconds = [nsdate timeintervalsincereferencedate]; double milliseconds = seconds*1000; cheers!

matlab - Error with ^2, says matrix should be square -

i wanted plot following y=linspace(0,d,100) temp=y^2; plot(y,temp); i getting error y^2 , says matrix should square. is there way plot. you not getting error because of plot. getting because of temp=y^2 instead, should using temp=y.^2 ^ means matrix power. .^ elementwise power. can find more matlab operators here . let's have 3x3 matrix, magic(3). a=magic(3) = 8 1 6 3 5 7 4 9 2 here square of matrix (which a*a, dan suggested): a^2 ans = 91 67 67 67 91 67 67 67 91 here matrix contains squares of a's elements: a.^2 ans = 64 1 36 9 25 49 16 81 4

php - what does mean unique users and getting its value for a perticular application In Fluury -

fluury issue : want know, mean unique users in flurry , how value perticular application in flurry ? have api : http://api.flurry.com/appinfo/getapplication?apiaccesscode=apiaccesscode&apikey=apikey&versionname=versionname&country=country . provided accesscode , api key since version name , country optional, not getting. please reply , please help. thanks in advance please refer flurry's support page more details on how achieve this.

CUDA, low performance in storing data in shared memroy -

here problem, in order speed project, want save value generated inside kernel shared memory, however, found takes such long time save value. if remove "this line" (see codes below), i.e., remove "this line" , fast save value(100 times speed-up!). extern __shared__ int sh_try[]; __global__ void xxxkernel (...) { float v, e0, e1; float t; int count(0); (...) { v = fetchtexture(); e0 = fetchtexture(); e1 = fetchtexture(); t = somedevicefunction(v, e0, e1); if (t>0.0 && t < 1.0) <========== <this line> count++; } sh_try[threadidx.x] = count; } main() { sth.. start timing: xxxkernel<<<griddim.x, blockdim.x, blockdim.x*sizeof(int)>>> (...); cudadevicesynchronize(); end timing. sth... } in order figure out problem, simplify codes save data shared mem. , stop. know shared mem. efficient mem. besides register, wonder if high latency normal or i've done sth wro

asp.net - find count of distinct values in a column -

Image
hi trying build sql query display information on dashboard. i have table in store sales data.my query needs find total sales in last 7 days,average , group based on region(which present in user table.) .i created temp table item sales.dashboard_items table contains particular item needs shown on dashboard.now problem need store count of each region find average sales.can 1 please help declare @tabletest table(itemid int,itemname varchar(100),itemdescription varchar(100),id int,itemidd int,userid int,orderdate varchar(40),qty int) insert @tabletest select * dashboard_items join salesqty on salesqty.orderdate>= convert(varchar(10) , dateadd(day,-7,getdate()),126) , oos_dashboard_coreitems.itemid=salesqty.itemid select distinct t.userid,u.region @tabletest t join users u on t.userid=u.userid , region not null above select query returns how can region count above select query region count 5 - sun west 2 2 - long island 3

dynamics crm - Crm 2011 Plugin doesn't trigger on Message "RemoveMember" -

i've built custom plugin crm 2011. basically, same plug-in has been deployed in 2 different environments: test , pro. these environments twins. same entities, same configurations etc.. the plug-in, triggers on update of specific boolean field. on true value, triggers , add contact list. so, same logic, on same field set on false, triggers , remove contact list. now, on "test environments", triggers on both situations. on "pro environments" , when boolean field it's set on false, doesn't trigger! i discard supposition of logic bug implementation. reason works on the first environment. above, doesn't write log in case. , makes me more convinced doesn't trigger @ all. does knows , problem? first, make absolutely sure theory correct. throw exception right @ top of plugin, , see if exception pop-up in crm on both true/false. if do, plugin is firing on both true/false update , there wrong code - can't imagine since wor

arrays - Can't find a proper signature for a function using STUArray (neither can GHC) -

i built function finding determinant of matrix using st-monad , unboxed starrays (stuarray). type matrix following: newtype matrix e = matrix (array int (uarray int e)) that is, immutable array containing immutable unboxed arrays containing elements. require me add predicate iarray uarray e functions dealing matrix , in turn requires flexiblecontexts . okay, done. the function used calculate determinant has following signature: detst :: (iarray uarray e, marray (stuarray s) e (st s), num e, eq e, division e) => array int (uarray int e) -> st s e i required add predicate marray (stuarray s) e (st s) since internally arrays converted mutable arrays (the outer boxed, inner unboxed). this function can used so: main = let m@(matrix x) = matrix [ [1,-2,3,234] , [5,2,3,-3] , [7,18,3,40] , [2,9,71,0] ] d = runst (detst x) :: int -- needed type check, ambi

ios - How do I nest blocks so they end at the same time -

how turn method block won't complete until 'request startwithcompletionhandler' block completes it's request , code in own block? i have series of blocks need call in order require code sent requests. trying find clean way accomplish task. +(void)???????? ^block() { fbrequest *request = [fbrequest requestforgraphpath:kfacebookquerymekey]; [request startwithcompletionhandler:^(fbrequestconnection *connection, id result, nserror *error) { .... }]; } added info: yes, want outer function wait until inner function complete thanks. it depends on mean. given example code, seems want function call block when nested block completes. you'd want this: + (void)domythingwithblock:(void(^)(void))block { fbrequest *request = [fbrequest requestforgraphpath:kfacebookquerymekey]; [request startwithcompletionhandler:^(fbrequestconnection *connection, id result, nserror *error) { // whatever want connection ... if (

html - Javascript with multithreading? -

i coming desktop application background, when learning javascript, difficult understand threading mechanism in javascript. for example: <!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("#btn1").click(function(){ (var = 0 ; < 100000 ; ++){ $("#loop1").html(i); } }); $("#btn2").click(function(){ (var = 0 ; < 100000 ; ++){ $("#loop2").html(i); } }); }); </script> </head> <body> loop 1 : <p id="loop1"></p> <button id="btn1">button 1</button> <br/><br/><br/> loop 2 : <p id="loop2"></p> <button id="btn2">button 2</button> </body> </html> when click on button 1, browser hang

Getting date format in xslt -

i have xslt code getting date.my code like <xsl:copy-of select="substring-before(msxsl:node-set($notes)/root/item/lastchanged,'t')"/> her got output 2013-04-05 but need output 15 jan 2013. how can achive this?any 1 help just change order xslt <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <xsl:template match="/"> <html> <head> </head> <body> <xsl:for-each select="xmlsamples/filedetails/date"> <div> date unedited: <xsl:value-of select="."/> </div> <div> date edited: <xsl:value-of select="ms:format-date(., 'mmm dd, yyyy')"/> </di

lexical scope - Type extensions and members visiblity in F# -

f# has feature called "type extension" gives developer ability extend existing types. there 2 types of extensions: intrinsic extension , optional extension . first 1 similar partial types in c# , second 1 similar method extension (but more powerful). to use intrinsic extension should put 2 declarations same file. in case compiler merge 2 definitions 1 final type (i.e. 2 "parts" of 1 type). the issue 2 types has different access rules different members , values: // sampletype.fs // "main" declaration type sampletype(a: int) = let f1 = 42 let func() = 42 [<defaultvalue>] val mutable f2: int member private x.f3 = 42 static member private f4 = 42 member private this.somemethod() = // "main" declaration has access values (a, f1 , func()) // members (f2, f3, f4) printf "a: %d, f1: %d, f2: %d, f3: %d, f4: %d, func(): %d" f1 this.f2 this.f3 sampletype.f4 (func()

port - Bind subdomain to IP -

i have ubuntu 11.04 natty , i'm using bind9 service. have configured this: $ttl 86400 example.com. in soa ns1.example.com. root.example.com. (2012111201 10800 3600 604800 86400) example.com. in ns ns1.example.com. example.com. in ns ns2.example.com. ns1.example.com. in 55.55.44.44 ns2.example.com. in 44.44.55.55 example.com. in 55.55.44.44 *.example.com. in cname example.com. now, of subdomains point main domain's ip, first ns (55.55.44.44) what i'm trying have subdomain point ip if port changed. example: test.example.com on port 80 point 55.55.44.44 , test.example.com on port 25565 point 33.33.33.33 further explanation: host website on test.example.com on port 80, on same server bind9 service is. if save test.example.com in minecraft has point 33.33.33.33:25565. so: test.example.com:80 -> 55.55.44.44:80 test

iphone - Getting property of an array with viewControllers -

i got array viewcontrollers different types, named viewcontrollersarray first check if type correct (questionviewcontroller) , want print out property. for(nsuinteger = 0; i<viewcontrollersarray.count; i++) { if ([[viewcontrollersarray objectatindex:i] iskindofclass:[questionviewcontroller class]]) { nslog(@"%@",((questionviewcontroller*)[viewcontrollersarray objectatindex:i]).getqanswer ); } } however shows me (null) instead of nsstring property. edit what got far this: for(nsuinteger = 0; i<viewcontrollersarray.count; i++) { if ([[viewcontrollersarray objectatindex:i] iskindofclass:[questionviewcontroller class]]){ nslog(@"ident: %@", [[viewcontrollersarray objectatindex:i] ident]); nslog(@"answer: %@", [[viewcontrollersarray objectatindex:i] getqanswer]); } } the second nslog (getqanswer) works. getqanswer method in questionviewcontroller. first nslog (ident) shows incorrect output (null), pro

html - Css using z-index with unordered list -

good day have example: http://jsfiddle.net/xarsw/ <ul> <li id="li1">li 1</li> <li id="li2">li 2</li> <li id="li3">li 3</li> </ul> and css: li { border:solid 1px red; float:left; width:150px; height:150px; -webkit-border-top-left-radius: 50px; -webkit-border-top-right-radius: 50px; -moz-border-radius-topleft: 50px; -moz-border-radius-topright: 50px; border-top-left-radius: 50px; border-top-right-radius: 50px; text-align:center; list-style: none; } #li1 { background:#282828; } #li2 { margin-left:-15px; background:#888888; } #li3 { margin-left:-15px; background:#b8b8b8; } what i'm trying show li2 behind li1 , li3 behind li2 . i trying use z-index did not result. or advice? regards. #li1, #li2, #li3 { position:relative; } #li1 { z-index:100; } #li2 { z-index:90; } #li3 { z-inde

javascript - Data entered alters string length -

i new javascript , have been doing work creating form in html , javascript. in work have been trying limit string of field depending on text entered previous field. what have been trying if country 'australia' entered 'country' text box 'postcode' text box limited 4 numbers (the australian postcode standard) i have done of function far: document.getelementbyid('txtcountry').onblur = function postcode() { var country = document.getelementbyid('txtcountry').value; if (country == "australia" || category == "australia") { document.getelementbyid('txtpostcode').maxlength = 4; } else { document.getelementbyid('txtpostcode').maxlength = 9; } } here segment of initial html have use function with: <b>postcode:</b> <input type="text" id="txtpostcode" name="postcode"> <br> <b>country:</b> <input type="text" id=&quo

extjs3 - TreePanel not expanding ExtJS 3 -

this code - var mytree = { containerscroll: "true", width: 500, root: new ext.tree.asynctreenode({ id: "source", text: "root", expanded: true, draggable: true, expandable: true }), loader: new ext.tree.treeloader({ dataurl: 'page.php?action=get_tree', preloadchildren: true, expandall: function () {} }), xtype: "treepanel", loadmask: { msg: 'loading...' }, maskdisabled: false, id: "tree", listeners: { click: function (node, event) { // render entity data in right panel handleaction(node); } } } when user clicks on node of tree, fetch data db , rendering panel using handleaction method. in case, need show node's info in panel , update it. on update handler, need change node's text/id updated now. this works fine nee

embedded linux - Cross compile kernel modules using kernel-headers from rootfs of target ARM board -

i have olinuxino board. downloaded archlinux img file (archlinuxarm-2013.02-olinuxino-rootfs.img) , wrote sd card using dd , booted board using card. connected board internet using ethernet , installed gcc , make on using pacman. able build userspace program board o n board. the archlinux sd card image had kernel headers directory in rootfs (/lib/modules/linux-3.7.2-2-arch/build). , able build loadable kernel modules board on board too. i have ubuntu 12.04.1 development pc. have installed sourcery codebench lite arm gnu/linux (arm-2012.09-64-arm-none-linux-gnueabi.bin) on it. able cross compile userspace programs olinuxino on development pc , transfer board on sftp , run on board (using console on ttyama0 serial port). now want cross compile kernel modules olinuxino board. have done earlier custom build imx233 board - in case had configured kernel build system (ltib) leave kernel sources , rootfs intact after building image. way able specify kernel headers build directory c

jquery - How to hide Facebook chat boxes on Window resize? -

i'm trying reproduce in jquery, how facebook hide or show opened chat boxes when viewport size changes. basically, if have 6 chat windows open, , if resize or shrink browser, of chat windows hidden if visually 6 can't fix screen size. i'm using function $(window).resize() detect if total width of open windows plus margin greater window's width, hide first chat window, or show last 1 if there's space more windows. basic pop or push stack... my method isn't working because whenever resize runs, script trying hide or show windows... (see code below) any suggestions appreciated. chatwidget.isenoughroom = function() { return ($(window).width() > ((chatwidget.window_width * $('.chatwindowwidget:visible').length) + chatwidget.contactlist_width + 100)); }; $(window).resize(function(){ if(!chatwidget.isenoughroom()) { $('.chatwindow:visible:last').hide() ; } else { $('.chatwindow:hidden:last').

php - Receiving HTTP 401 Unauthorized when making a Google plus API call -

i'm trying list of friends google plus via api. user on behalf i'm doing operation authorized request , got auth token. i've tried following code in php: function callapi() { $opts = array( "http" => array( "method" => "get" ) ); $url = 'https://www.googleapis.com/plus/v1/people/me/people/visible?key=xxxx'; $context = stream_context_create($opts); $response = file_get_contents($url, false, $context); var_dump($response); } but keep receiving http request failed! http/1.0 401 unauthorized. how can prove user authorized operations or doing wrong? appreciated. you need authenticate user use special keyword "me" using simple api key not work (assuming key passed simple key). instead, need access token , pass that. for great example of how in php using php client library, try quickstart: https://developers.google.com/+/quickstart/php if getting access token, can call tok

Bind Kendo UI treeview to Json data returned by ASP.Net .ashx handler -

i want create treeview kendo ui treeview widjet. i read documentation, can't go further first step: bind simple, simple non-nested json value: in head section put: <script> $(document).ready(function () { var homogeneous = new kendo.data.hierarchicaldatasource({ transport: { read: { url: "kendotwdata.ashx", datatype: "json" } }, schema: { model: { id: "employeeid", fullname: "fullname" } } }); $("#treeview").kendotreeview({ datasource: homogeneous, datatextfield: "fullname", datavaluefield: "id" }); }); </script> the handler "kendotwdat

python - Finding all roots of a complex polynomial with SymPy -

i'm trying symbolically solve polynomial complex numbers , conjugates sympy. think i've come long way, solve not give me solutions although polynomial solveable. from sympy import * # set symbols a, b = symbols("a b", real=true) t = a+i*b t = functions.conjugate(t) # set polynomial a1=0.005+i*0.0009 a2=0.9+i*-0.9 a3=0.4+i*0.5 a4=8+i*-80 a5=284+i*-1.5 a6=27100+i*-11500 poly=t**2 * t * a1 + t * t * a2 + t**2 * a3 + t * a4 + t * a5 + a6 # trying solve symbolically... solve([re(poly), im(poly)], a, b) # output: [] # solving numerically works, finds 1 solution... nsolve((re(poly), im(poly)), (a, b), (0, 0)) # output: matrix( # [['-137.962596090596'], # ['52.6296963395752']]) # verify 2 solutions obtained in maxima poly.subs({a:-137.9625935162095, b:52.6296992481203}).n() # output: 0.000540354631040322 + 0.00054727003909351*i poly.subs({a:-332.6474382554614+i*-185.9848818313149, b:258.0065640091016+i*-272.3344

php - Get GPS Location of Mobile Phone -

this question has answer here: is possible (rough) mobile phone location http request 5 answers i have been looking around google , way gps location of user using mobile phone php. however, solutions have found use javascript, , rather not have complicated stuff using javascript when can add php code existing system. my question simple: how can gps location of browsing site php, instead of javascript? additionally: if have use javascript, how can access value php? also, there way city/country gps location, or possibly method city/country? there no way retrive data via php, remember php executed in server, not in client, need client execution language javascript.

PHP tinymce, validation issue -

i'm using tinymce on cms page , facing issue require validation (jquery). goes when i'm inserting date{date d/m/y} using editor. jquery validation not goes off. i mean if date there creates problem if give white space after or before validation works well. why validation don't work when date{date d/m/y} there ?? what should resolve ? tinymce.init({ theme : "advanced", theme_advanced_toolbar_align : "left", height : "400px", mode: "exact", elements : "description", plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,ibrowser", setup : function(ed){ ed.onkeyup.ad

c# - Decimal marshaling in COM-Interop -

i have com object method signature hresult _stdcall method1([in] int ms); next, call method c# reflection: ... decimal ms = 100.5m; comtype.invokemember("method1", flags, null, comobject, new object[] { ms }); ... is call correct ? mean how decimal ms marshaled int ? this code works if create instance activator var comtype= type.gettypefromprogid("mycom.server", false); var comobject= activator.createinstance(comtype); thanks! the first snippet makes early-bound call, using runtime callable wrapper created when added reference com server. not going enjoy passing decimal when argument type int, reflection won't convert argument values you. the second snippet makes late-bound call, using idispatch::invoke(). decimal converted variant of type vt_dec. idispatch implementation in com server converts variant required argument type. com automation helper function vari4fromdec() that, depends if server implemented idispatch or