Posts

Showing posts from February, 2013

PowerShell: Script Module variables not available outside of ISE -

i have been working on updating of scripts have written. still learning powershell go on old ones , see if can improve things. stumbled upon modules , idea of using them store different actions can called on @ anytime. i wrote simple script test (or thought). should mention storing modules on server share. write-host "testing available variables" write-host "loading modules" import-module <path module on server share>.psm1 write-host "" write-host "done" write-host "print loaded modules" get-module write-host "" write-host "done" write-host "=================" write-host "" write-host "printing variables" write-host "" write-host "variable: arch: " $arch write-host "variable: wownode: " $wownode write-host "" write-host "done" my module contained if ( "${env:programfiles(x86)}" -ne "" ) { $scrip...

javascript - SetTimeout inside emberjs model -

i have in emberjs application model doesn't has database data. have create model because want object pools requests server not binded controller or view. something like: statuschecker inside application.create this: webapp = ember.application.create({ rootelement: '#content', log_transitions: true, ready: function() { return webapp.status_helper = webapp.statushelper.create({ timer: 15 }); } }); this instantiate webapp.statushelper object must unique application. when call init on object start polling using default timer: webapp.statushelper = ember.object.extend({ init: function(params) { this.timer = this.get("timer"); this.timeoutid = null; this.controller = null; this.start(); }, start: function() { this.execute(); }, stop: function() { cleartimeout(this.timeoutid); }, settimer: function(newtime) { this.stop(); this.timer = newtime; this.start(); }, execute: function()...

python 2.7 - Creating a Class with variable properties -

hi interested in creating class this - class tutor tutor first name tutor last name tutor age tutor primary subjects tutor secondary subjects my main issues subjects, tutor may have 1 10 primary subjects , 1 10 secondary subjects, not tutors have have same number of primary , secondary subjects class trying create needs flexible enough accommodate number of primary & secondary subject combinations. how best create data structure can use this use list , or tuple if want several data types in list. class tutor: firstname = "" lastname = "" age = 0 primarysubjects = [] secondarysubjects = []

linux - Library error when building a make file for a CUDA program -

Image
i trying build makefile in linux. code goes makefile follows: nvcc = /usr/local/cuda/bin/nvcc cudapath = /usr/local/cuda nvccflags = -i$(cudapath)/include lflags = -l$(cudapath)/lib64 -lcuda -lcudart -lm vectoradd: $(nvcc) $(nvccflags) $(lflags) -o vectoradd vectoradd.cu so when type "make" i following error: how rid of , build make file? since you're using nvcc don't need lflags , nvccflags definitions. nvcc knows how find automatically. but if want fix it, rid of space @ end of cuda path definition: cudapath = /usr/local/cuda ^ there space here, delete

Accepting payment in store without PCI -

i'm looking way accept payments inline in store users don't have go off paypal if don't want to. i've been reading pci compliance sounds nightmare , quite expensive. i've seen many sites doing this. 1 here: https://www.liquoricekids.co.uk/ on payment page credit card details can entered. it's small shop there's no way they're pci compliant. how can accept payment in shop? i know might closed being conversational kind soul can me shed light on this. you might better off using company handles pci compliance you. right, pci compliance can nightmare deal if have limited resources devote becoming pci compliant. i recommend using 1 of many payment services. payment gateways recurly (which work for), braintree , stripe have forms can embedded site card collection. way pci liability reduced due fact credit card number never hits server. save credit card use again when needed.

Kendo Categorical chart to display only points with non numeric x-axis -

i using kendo ui dataviz charts display data has text(symbols) on x-axis , numerical value on y-axis. have serverside datasource provides data. how can achieve this? i tried use scatter charts xy charts , need numerical values on both x , y axis. can display data linecharts categorical line connecting markers meaningless in case , don't need displayed. here's example of data var data = [{id:"1", number:"1.23", label:"a"},{id:"2", number:"4.11", label:"b"}] you use simple line chart , set markers visible series.opacity 0 series: [{ field: "value", type: "line", opacity: 0, markers: { size: 5, visible: true, } }] http://docs.kendoui.com/api/dataviz/chart#configuration-series.opacity

ios - CCSpriteBatchNode stops adding children at around 15k -

i using ccspritebatchnode draw line 1 pixel @ time (using 1x1 swatch). need because user controlling line goes in real time (it's not drawing app think i'm doing comparable). it turns out when add between 15-16k children batchnode stops registering new children. seems pen ran out of ink! i poked around in cocos2d code little bit @ no point seem goes wrong. stops registering new child nodes. know why is? first of all, , let me in way that's gigantic understatement: ouch! next, technical reason. sprites fail render have batched 16.384 of them. since each sprite uses quad (4 vertices) render sprite on screen, hit vertex limit of 65.536 vertices per batch operation. more vertices won't drawn per batch operation ( vbo buffer limit ). technical limitation. try use ccspritebatchnode additional sprites - you're going down road here. if need draw lines, worst possible approach can imagine. consider using line drawing (ccdrawline), individual pixels (...

ruby - Can't install json gem in Windows -

i tried install json gem on windows. installed devkit. following error below. suggestions? question json gem not install (windows) suggests installing devkit , try using json_pure. did both. problem bundle install trying install json , won't proceed until json installed. bundle install rails project btw. d:\source\my_project>gem install json -v '1.6.3' temporarily enhancing path include devkit... building native extensions. take while... error: error installing json: error: failed build gem native extension. c:/ruby200/bin/ruby.exe extconf.rb creating makefile make generating parser-i386-mingw32.def compiling parser.c in file included parser.rl:1:0: ../fbuffer/fbuffer.h:129:13: warning: 'fbuffer_append_long' defined not used [-wunused-function] ../fbuffer/fbuffer.h:136:17: warning: 'fbuffer_dup' defined not used [-wunused-function] ../fbuffer/fbuffer.h:149:14: warning: 'fbuffer_to_s' defined not used [-wunused-function] ....

Android Java Service and Timer/Thread Sleep -

basically, need code simple, i'm beginner, still confused service, intentservice, creating new thread separate main activity/ui thread, etc. i'll explain task first , then, how think might best achieved. task the main activity/ui has 2 buttons, start , stop. app should make cycle of 2 tasks, taska , taskb. when start pressed, cycle executed. cycle has these steps inside- update status on main activity's ui: "taska execution in 60 seconds" wait 60 seconds update status ... : "taska executing" execute taska update status ... : "taskb execution in 120 second" wait 120 seconds update status ... : "taskb executing" execute taskb on completion, cycle repeats. cycle must continue until user presses stop. cycle must not stop, interrupted or destroyed if main activity/ui onpause, onstop, or ondestroy. main activity/ui should separate cycle thread. stop button: stops execution of steps inside cycle, regardless of step is....

Nginx Password Protect 403 Forbidden -

i running centos 6 nginx. running perfectly, trying password protect admin directory.i can login. however, 403 forbbiden when try view main index page (index.php) in directory. 2013/04/18 02:10:17 [error] 17166#0: *24 directory index of "/usr/share/ngin/html /somedir/" forbidden, client: xxx, server: mysite.com, request: "get /somedir/ http/1.1", host: "mysite.com" i have double checked permissions on ".htpasswd" file. belongs "root:root" chmod 640. have tried setting owner ship "nginx:nginx" , error still persists. this how getting htpasswd working: location ~ ^/([^/]*)/(.*) { if (-f $document_root/$1/.htpasswd) { error_page 599 = @auth; return 599; } } location @auth { auth_basic "password-protected"; auth_basic_user_file $document_root/$1/.htpasswd; } though question pretty old, must put solution here others. problem pain in somewhere. i have read ou...

Python - How to transform counts in to m/s using the obspy module -

i have miniseed file singlechannel trace , assume data in counts (how can check units of trace?). need transform in m/s. checked obspy tutorial , main problem dont know how access poles , zeros , amplification factor miniseed file. also, need calibration file this? here code: from obspy.core import * st=read('/users/guilhermew/documents/projecto/dados sismicos 1 dia/2012_130_doc01.mseed') st.plot() thanks in advance, guilherme edit: understood how convert data. obspy has different ways achieve this, comes down removing instrument response waveform data. @robert barsch said, needed file instrument response metadata. came following code: parser=parser("dir/parser/file") tr in stream_aux: stream_id=tr.stats.network+'.'+tr.stats.station+ '..' + tr.stats.channel paz=parser.getpaz(stream_id, tr.stats.starttime) df = tr.stats.sampling_rate tr.data = seissim(tr.data, df, paz_remove=paz) im using seissim function convert data. p...

network programming - SCTP protocol support in android -

how can use sctp protocol in android? i'm aware that android systems don't support sctp default, it's may possible enable inserting sctp kernel module, or rebuilding kernel sctp enabled in modules configuration. i need insight on issue. possible? how make android support protocol? how build kernel module , insert correctly? if succeed in making system support it, how can use protocol? java api on android support sctp? going module right way. answer questions: sctp provided kernel module in linux source tree - "config_ip_sctp=m" enable module. , can change "y" hard link, though unfeasible, since you'd have rebuild entire kernel that. the module have still built per kernel version. per vendor, you'd need kernel sources (doable), , compile module against it. to use: in user mode - create socket calling s = socket (af_inet[6], sock_stream, ipproto_sctp); point, socket apis work same, few exceptions (namely setsockopt, particu...

javascript - What is the most 'kosher' or 'correct' way to do https redirection? -

the 'most visited' or 'speed dial' page of google chrome shows website 500 or 404 server error consistently, if remove , gets reset. fear has https redirection scheme. the reason suspect because of https because don't have problem running app locally, preview of page shows correctly, title , all. difference not running https on local machine. my main question 'kosher' way redirect https? use client side js scheme. i.e window.location.href = www.example.com. reason site doesn't show correctly on chrome's 'most visited' page? i haven't seen problem on firefox. redirect may have nothing @ all, difference know of between main server , local one. typically if want redirect " http://www.example.com " " https://www.example.com " on server side, scripting language php or ruby or python, or configure web server (eg, apache) it.

git - Github windows, whole file shows change after commit. -

i using github windows app. seem having problems showing has changed , hasn't. before commit correctly shows changed lines, after commit, shows lines have changed in file. way stop this? it quite annoying , appreciated. ps, made sure no line ending issues. this usual core.autocrlf issue (different setting in clients , definitely wrong in github client) - read "formatting , whitespace" topic , core.autocrlf part of carefully ps : can test statement using differ, can ignore eol-difference in compared files

how do I enable transparent huge pages by default on ubuntu? -

how enable transparent huge pages default on ubuntu ? $ uname -a linux yoda 3.5.0-23-generic #35~precise1-ubuntu smp fri jan 25 17:13:26 utc 2013 x86_64 x86_64 x86_64 gnu/linux ~$ cd /sys/kernel/mm/transparent_hugepage/ /sys/kernel/mm/transparent_hugepage$ ls defrag enabled khugepaged /sys/kernel/mm/transparent_hugepage$ cat enabled [madvise] never /sys/kernel/mm/transparent_hugepage$ sudo echo > enabled -bash: enabled: permission denied /sys/kernel/mm/transparent_hugepage$ sudo ls [sudo] password <...>: defrag enabled khugepaged /sys/kernel/mm/transparent_hugepage$ sudo ls defrag enabled khugepaged /sys/kernel/mm/transparent_hugepage$ sudo echo > enabled -bash: enabled: permission denied /sys/kernel/mm/transparent_hugepage$ cat enabled [madvise] never adding following: transparent_hugepage=always to grub_cmdline_linux_default in your: /etc/default/grub and doing a: update-grub should trick.

java - NoClassDefFoundError in Android project -

i have been working on project past few months colleagues, , finished our final android build of started noclassdeffrounderror in our logcat when run app on our devices. code did not change, , class referencing call on same level, in same package class cannot found. project runs on other computers, , seems kind of random. have tried resolve this, none have worked. if compile code on different computer can, , make apk, runs fine. if compiled computer has error, crash. help! 04-17 20:05:55.929: e/androidruntime(12615): fatal exception: main 04-17 20:05:55.929: e/androidruntime(12615): java.lang.noclassdeffounderror: com.team.catswithhats.androidgps 04-17 20:05:55.929: e/androidruntime(12615): @ com.team.catswithhats.mainactivity.oncreate(mainactivity.java:14) 04-17 20:05:55.929: e/androidruntime(12615): @ android.app.activity.performcreate(activity.java:5104) 04-17 20:05:55.929: e/androidruntime(12615): @ android.app.instrumentation.callactivityoncreate(instrumentation.j...

Facebook api php get specific friend profile -

i want know date of birth of specific friend. i'm using this. possible friend profile field? $user = $facebook->getuser(); $perms = array('scope' => 'email,user_photos,read_mailbox'); if ($user) { try { $user_profile = $facebook->api('/me'); $facebook_login = "1"; } catch (facebookapiexception $e) { $user = null; } } else { die('<script>top.location.href="'.$facebook->getloginurl($perms).'";</script>'); } if ($user) { $friends = $facebook->api('/me/friends'); foreach ($friends["data"] $value) { ?> <img src="https://graph.facebook.com/<?php echo $value["id"]; ?>/picture"/> <?php echo $value["name"]; ?> <?php } i can complet name , id of friend, want date of birth. , of specific friend, ex. $friend = $facebook->api('/me/friends/friend_id'); thanks you...

asp.net - How can I correctly write this database search query? -

i'm attempting write query search database based on many different form fields. want query filter fields entered , disregard fields not entered on form. example: form fields: -project name -project number -project manager so if user enters "joe" project name, should return results form of "joe" in name field regardless of other values in record. i've been trying accomplish strictly sql , i'm having incorrect (yet expected) results. i've got pretty hefty queries, , apologize if they're pretty far fetched. this first query set using , statements conditions. realized doesn't work, null values in database still don't picked wildcards. <listdatasource commandtext=" select [surveyid], [projectnumber], [siteno], [person], [subatpdate], [projectname], [priorsurveyor], [siteaddress], [sitecity], [sitestate], [sitezip], [survey], ...

google drive sdk - Can't retrieve file content via download URL -

since hour, can't retrieve file content via download url attribute. each time try it, api answers 401 (unauthorized error). here's code used: https://gist.github.com/arnaudbreton/5409015 credentials stored in gae datastore , retrieved / refresh. first call file endpoint working not second call download content. it working morning. tried different things far: - revoke client secret (found solution in other thread) - create new client test - disconnect app drive, accept again nothing seems solve issue. thanks help. a fix/rollback in progress, should normal soon.

asp.net - MachineKey Relationship in subdomains. Across Servers possible? -

in example have couple of sites. a.site.com b.site.com c.site.com each of above sites have same identical machinekey . example a.site.com , b.site.com exist on server1 , c.site.com exists on server 2. using forms authentication i'm able navigate between a.site.com , b.site.com without issue, authenticating once. however, though c.site.com has same machinekey i'm unable navigate c.site.com , maintain being logged in. i'm able fix using domain cookie. isnt ideal solution lot of reasons. how use machinekey across servers without domain cookie? they in same domain. sites same exact code, multple iis pages. difference sites sit on different servers thanks! edit web.config <machinekey decryptionkey="encryptkey" validationkey="encryptkey" validation="sha1" decryption="aes"/> <customerrors mode="off" defaultredirect="noaccess.aspx" /> <authentication mode="forms"...

Javascript number regex test failing - can't figure out why -

here's jsfiddle: jsfiddle relevant code: var number = /\d+(.\d+)?/g; $('body').append(number.test(2.5) + "<br>"); $('body').append(number.test(20) + "<br>"); $('body').append(number.test(2) + "<br>"); output true false true get rid of g . it's not needed, , causes regex fail because regexp object keeps track of position based on previous match: https://developer.mozilla.org/en-us/docs/javascript/reference/global_objects/regexp/test as exec (or in combination it), test called multiple times on same global regular expression instance advance past previous match. http://jsfiddle.net/bupyd/1/

c# - Entity Framework Code First Migration issue with linking tables -

i'm using ef 5.0 code first, using automatic migrations via pm console. i'm attempting apply 4th migration project , convention based naming of linking tables causing them dropped , recreated different name. has not occurred during of previous migrations. example : i have 2 classes user , site. initialcreate migration this created link table called "usersites" convention. createtable( "dbo.usersites", c => new { user_id = c.guid(nullable: false), site_id = c.guid(nullable: false), }) .primarykey(t => new { t.user_id, t.site_id }) .foreignkey("dbo.users", t => t.user_id, cascadedelete: true) .foreignkey("dbo.sites", t => t.site_id, cascadedelete: true) .index(t => t.user_id) .index(t => t.site_id); everything works well. skip today : 4th migration...

php - CSS - Transparent bg of image not rendering on website -

Image
i'm trying redesign site original square, tile-based rendering of images can more of cutout of image... rid of grid pattern. here's how looked originally... here's rough mock-up of i'm going for: so resaved image thumbnail transparent background... want dog show, , square transparent show site's background underneath. yet when render on page, has black background. i've checked css see if there sort of img class, or class rendered comics... or bootstrap see there may background-color being assigned black (and searched hex code 000000), didn't find one... do know why may happening? thanks! edit: i've noticed something... my logo @ top renders transparent background... , element png file... therefore, mime type image/png. i'm using thumbnailing script make thumbnails smaller, element of thumber.php, puts mime type image/jpeg. so guess it's thumbnailing script changing mime type. so checked it, , it's crea...

join - Mysql query follow follower system -

i have following tables followtable columns userid followingid and usertable columns userid username now find out follows me assuming i'm user 1 run query select usertable.username, usertable.userid usertable inner join followtable on followtable.userid = usertable.userid followtable.followingid = '1' order followtable.datefollowed desc so i'm able put in , array echo out in php the result this username userid john 2 joe 5 now want find out if i'm following user using same query output table this username userid followinguser john 2 0 joe 5 1 where 0 means not following user , 1 means following user. can point me in right direction on how perform query. tried using self join no avail. select t1.userid,t1.username ,coalesce(t2.followornot, 0) followornot user t1 left join (select f.userid fid,1 followornot follow f f.followingid=...

PHP message on the same page -

hi have similar in code; <html> <head><title></title></head> <body> <form method="post" action="processmaster.php"> <input type="submit" id="testone" name="testone" value="process me"> </form> </body> </html> the processmaster.php reads follows; <?php echo "boom!"; ?> now works fine. but issue once "boom!" appears, appear in separate page(or in page other elements of page not displayed.) is there possibility/workaround can print message on same page can see process me button visible? processmaster.php should contain following: <html> <head><title></title></head> <body> <form method="post" action="processmaster.php"> <input type="submit" id="testone" name="testone" value="process me"> </form> <?...

Running Flows in Mule Parallel -

i have 2 flows in mule want run in parallel. first flow should transfer file remote machine using sftp local directory (does none stop long file updated in remote directory). second flow must take data in file @ update/insert them database invoking pentaho kettle transformation/job (also continuous process long files keep coming in). however, when run flow, somehow passing first flow , tries perform second flow. how can fix this? here mule flow: <flow name="flow1"> <sftp:inbound-endpoint address="sftp://username:password@ip_ddress:22/path" responsetimeout="1000" /> <echo-component /> <file:outbound-endpoint path="/path/to/outputfolder" responsetimeout="10000"/> </flow> <flow name="flow2"> <custom-transformer class="org.transformation.kettle.invokemain" /> </flow> your second flow should have file:outbound-endpoint pick file dropp...

iphone - Labels are not getting displayed and image is not getting saved -

i have created uilabels on toolbar, when try using on ios version 4.3 not getting displayed.. labels getting displayed when deployment target 6 when deployment target changed 4.3 not working.. and i using save button save image in ios 4.3 giving error (ie image not saved). (in ios 5.0 ,5.5 ,6.0 , 6.1 working fine). i using these code save image (any 1 using). uiimage *viewimage = [uiimage imagewithdata:[nsdata datawithcontentsofurl:[nsurl urlwithstring:self.imageurl]]]; nslog(@"uiimage : %@",viewimage); alassetslibrary *library = [[alassetslibrary alloc] init]; [library writeimagetosavedphotosalbum:[viewimage cgimage] orientation:(alassetorientation)[viewimage imageorientation] completionblock:^(nsurl *asseturl, nserror *error){ if (error) { nslog(@"error"); } else { nslog(@"url %@", asseturl); [self assigndictonary:viewimage withurl:asseturl withmediatype:@"public.image"]; } }]; [library...

android - Fetch host name & its type while scaning network using (NDR) Network Discovery Repository -

i'm trying fetch connected device details of network . have refereed network discovery repository i'm able ip address , mac address(hardware address) not able host name & device type . i have used following code different stackoverflow's suggested post.i have implement jcifs jar . no luck i'm not able fetch host name , type network. code: 1) nbtaddress nbtaddress = nbtaddress.getbyname("base"); inetaddress address = nbtaddress.getinetaddress(); string hostname = address.gethostaddress(); 2) inetaddress addr = nbtaddress.getbyname(strip).getinetaddress(); host.hostname =addr.getcanonicalhostname(); your suggestion appreciable? if using 1.3.17 jcifs has bug causes not return hostname. can try use older version of jcifs , give host name. older version of jcifs (1.2.25) has other issues depends use for.

mysql - What happens if I put index on each column in a table -

let consider have table 60 columns , need perform kind of queries on table , need join table other tables well. , using rows searching data in table including other tables. table primary table(like primary key) in database. table in relation table. considering above scenario can create index on each column on table (60 columns ) ,is practice ? in single sentence: is best practice create index on each column in table ? might happens if create index on each column in table? where index might "primary key", "unique key" or "index" please comment, if question unclear people try improve question. mysql's documentation pretty clear on (in summary use indices on columns use in where , join , , aggregation functions). therefore there nothing inherently wrong creating index on columns in table, if 60 columns. more indices there slower inserts , updates because mysql has create keys, if don't create indices mysql has scan enti...

android - Running many Asynctask on timer(countdowntimer) -

i have created countdowntimer this public class mycountdowntimer extends countdowntimer { public mycountdowntimer(long starttime, long interval) { super(starttime, interval); } @override public void onfinish() { //timeout } @override public void ontick(long millisuntilfinished) { paymentasynctask paymenttask = new paymentasynctask(this); paymenttask.execute(); } } in onpostexecute of paymenttask , doing operations on specific condition. basically, checking website, after time interval(say 3 second), task has been completed or not. now if internet runs fast, there no issue code, if task gets completed,i cancel timer in onpostexecute , further work. but if internet runs slow , means response doesn't come in 3 seconds, onpostexecute called more once( executing code inside more once ), while task completed, got response late due server issue/internet delay. how can...

Need to detect mobile browser and load mobile.css file for Joomla template with PHP -

i need detect if using mobile browser (media queries aren't enough in situation) via php , load mobile.css file override few lines of css due lack of proper support code i'm using. i'm building joomla template, need dynamically generate path css file. so, doing right? example: <?php $iphone = strpos($_server['http_user_agent'],"iphone"); $android = strpos($_server['http_user_agent'],"android"); $palmpre = strpos($_server['http_user_agent'],"webos"); $berry = strpos($_server['http_user_agent'],"blackberry"); $ipod = strpos($_server['http_user_agent'],"ipod"); if ($iphone || $android || $palmpre || $ipod || $berry == true) { echo "<link rel="stylesheet" href="$this->baseurl/templates/$this->template/css/mobile.css" type="text/css">"; } ?> in joomla there's mobile detection built in. if using joomla 3.0, may...

How to build inhouse map navigation for iOS application? -

i have requirement mentioned below: already have floor plan map image first detect current location on floor then select destination location using floor plan map image now application should provide direction & distance source destination path this how google direction works, in-house map require. for example, - current position of user is: @ desk - meeting room #11 - application should provide direction , distance updates on map/floor plan image. any kind of suggestions/help great. thanks in advance couple of points... you create various audio files , play them way points based on routing. same principal 'turn right @ next light'. definitely want set accuracy to: kcllocationaccuracybest. still accuracy of around +/- 10 meters @ best. do floor plan overlay using mapoverlayview. if indoor, iphone uses cell towers or wifi location fix. might problem because if looking map multiple floors, gps can give altitude readings - ground floor, se...

android - Command not found in phonegap -

i followed tutorial use command build, run, ... in phonegap @ http://docs.phonegap.com can't use commands, except create command. create command is: create ./test1 com.test1 test1 original command is: $ /path/to/cordova-android/bin/create.bat /path/to/my_new_cordova_project com.example.cordova_project_name cordovaprojectname after created project successfully, run command: cd test1/cordova/build original command is: $ /path/to/my_new_cordova_project/cordova/build.bat but throws error: 'build' not recognized internal or external command, operable program or batch file. then go new project folder, go in folder: cordova build.bat, see nothing. can show me how fix stuff, want use command build phonegap project. thanks! additional info: using phonegap 2.6, android platform. windows 7 64bit. i'm able run command: ant, java, javac, , in android platform tools,...

tree - How to create an unlimited depth category subcategory select box in smarty -

i trying create select box containing unlimited depth category , sub category select box. have array contains unlimited category sub category depth shown below, array ( [0] => array ( [id] => 6 [cata_key] => 32e9c75e38d2a1d77b2b49b2 [cata_name] => road [app_key] => b80e0935b348da61b2a807ff [parentid] => 0 [subcategories] => array ( [0] => array ( [id] => 9 [cata_key] => 780c3eb53264d5c33a26d49f [cata_name] => ...

php - Getting video upload date with Zend Gdata Youtube API -

i'm trying list of videos specific user details video (title, desc., date, tags...) can pretty need, can't figure out how upload date. tried using getvideorecorded() , getrecorded(), both return nothing. i can't seem find related on google, can find class references tell me have use getvideorecorded or getrecorded, nothing more. am doing wrong? how can upload date? current code: $authenticationurl= 'https://www.google.com/accounts/clientlogin'; $httpclient = zend_gdata_clientlogin::gethttpclient( $username = $yt_username, $password = $yt_password, $service = 'youtube', $client = null, $source = '', // short string identifying application $logintoken = null, $logincaptcha = null, $authenticationurl); $yt = new zend_gdata_youtube($httpclient); $feed = $yt->getuseruploads($yt_username); foreach($feed $item) { ...

How to create dynamic multilingual web application using Asp.net 3.5 and c# 3.0 -

i have web application in english language. client wants in arabic. have lot of work database. when searched multilingual solution found have created resource file define key/value of text. want way database automatically converted arabic , vice versa. there way this. i highly recommend against using automated translation website. either use real translation service humans or use google translate widget. google downranks automatically translated websites because of low quality , index spamming.

How to configure my own SMTP server in my system? -

i in position configure own smtp server in system. have internet connection in system well. task create own smtp server , have configured smtp details in client thunderbird etc. , can should able send mail users have accounts in gmail,yahoo etc. example if create domain name www.mycompany.com in smtp , if created user name john, need able send mail john@mycompany.com gmail,yahoo users. need receive email vice versa. procedures? this pdf explains how set computer smtp server. http://www.outlookwise.com/downloads/documents/outlookwise/outlookwise_smtp_mail_server.pdf

How to ensure a process is running in Ruby -

i call ffmpeg command in rails grep stream , push wowza apple device can see also, command this thread.new `/usr/local/bin/ffmpeg -re -i http://10.191.255.90:30080/#{user.phone} -vcodec libx264 -vpre ipod640 -g 15 -acodec libvo_aacenc -ar 8000 -ac 1 -f flv rtmp://127.0.0.1/live/#{user.phone}` end sometimes process killed because of break of network or other reasons, i'm wondering there way can monitor process stop can restart again my current idea record pid of process, , let resque check whether process of given pid running every 60 sencods, has lot of such process wondering it's performance problem later. is there better solution manage these process in ruby? you can this: thread.new begin process.wait process.spawn 'find /oeinfsroif' raise unless $?.exitstatus == 0 rescue retry end end.join to manage number of attempts before failing: thread.new max_attempts = 10 attempts = 0 begin process.wait process.spawn ...

Soci C++ sqlite3 backend abstract on build -

i'm facing issue building application soci c++ 3.2 mysql , sqlite3 backends. here headers included: #include <soci.h> #include <soci-backend.h> #include <soci-mysql.h> #include <soci-sqlite3.h> here building errors i'm getting: /usr/include/soci/sqlite3/soci-sqlite3.h:263: erreur: cannot declare variable ‘soci::sqlite3’ of abstract type ‘const soci::sqlite3_backend_factory’ /usr/include/soci/sqlite3/soci-sqlite3.h:257: note: because following virtual functions pure within ‘const soci::sqlite3_backend_factory’: /usr/local/include/soci/soci-backend.h:271: note: virtual soci::details::session_backend* soci::backend_factory::make_session(const soci::connection_parameters&) const i did not find information issue on web appreciated! i understood issue, soci-3.1 installed on environment (not myself), , autoconf macros selecting files both installation of soci-3.2 performed source , old one. so had uninstall previous one......

asp.net development server port not same as web application port -

when run asp.net web application on vs2008 sp1 , starts asp.net development server port 1257 web application trying browsed on localhost:1559 . web application can not browsed explorer because url incorrect. have change url manually on explorer's address bar browse web application. can guess bit annoying. how can resolve issue? (1257 , 1559 examples.) i answer own question incase needs solution. problem eset antivirus program have. in eset settings need go through " settings/advanced settings/web access security/web browsers ". see list of processes eset accept web browser. uncheck checkbox of " c:\program files\microsoft visual studio 8\common7\ide\devenv.exe " or " c:\program files\microsoft visual studio 9\common7\ide\devenv.exe ". eset stop scanning asp.net development server , port number match port number of opening browser page url. can read post: http://www.wahooga.com/2008/02/20/visual-studio-development-web-server-automati...

spring - Web project dependency pojos, web deployment -

i have 3 maven projects: 1 - common pojos project 2 - web project 3 - java client project web , java project uses same pojos common project, have dependency on 1 project i added web build path common pojos project, when deploy web project server, no pojo classes exceptions.... my question how can configure pojos classes deployed web project ? (it fantastic, if have online examples this) tnx. if 3 project maven projects , dependencies set right maven automatically package dependencies war. commons pojos jar project web project war project depends on commons pojos project. unless dependency scope not provided jar packaged in war. you can verify same opening war file see if commons pojos jar present , jar has required classes.

c# - Reuse of OracleConnection object -

i reuse oracleconnection object more queries wrote simple class: public static class dbconnectionsmanager { /// <summary> /// /// </summary> private static oracleconnection _dbconnection = null; /// <summary> /// /// </summary> /// <param name="aconnectionstring"></param> /// <returns></returns> public static oracleconnection getdatabaseconnection(string aconnectionstring) { try { if (_dbconnection == null) { _dbconnection = new oracleconnection(aconnectionstring); _dbconnection.open(); return _dbconnection; } if (_dbconnection.state == system.data.connectionstate.closed) { _dbconnection.connectionstring = aconnectionstring; _...

NServiceBus: The format of the URI could not be determined -

nservicebus version: 2.6.0.1505 nservicebus doesn't wcf , odata service references. they have been unit tested in different environment , used in different systems same service uri's. has experienced similar exceptions nservicebus? from logs: 1) invalid uri: format of uri not determined. resulting in: an exception occurred while trying create instance of type 'xxx.xxx'. resulting in: cannot activate part 'xxx.xxx'. element: xxx.xxx--> xxx.xxx--> directorycatalog (path="c:\program files (x86)\xxx\xxx\xxx") that version of nservicebus pretty old , i'm sure dealt problem around serialization of uris since then, guess recommendation upgrade newer release , see if resolves it.

c# - Why I cannot set ANY value in IF condition? -

i have 2 static variables below private static datetime _currentpollstartdate = datetime.minvalue; //as default private static datetime _currentpollenddate = datetime.minvalue; //as default in method, try set values: public void processitems() { var items = getitems(); //in here, reaches inside if (items.hasitems) { //items[0].pollstartdate.hasvalue true //i can not set either items[0].pollstartdate.value or datetime.maxvalue _currentpollstartdate = items[0].pollstartdate.hasvalue ? items[0].pollstartdate.value : datetime.maxvalue; //items[0].pollenddate.hasvalue true //i can not set either items[0].pollenddate.value or datetime.maxvalue _currentpollenddate = items[0].pollenddate.hasvalue ? items[0].pollenddate.value : datetime.maxvalue; } //... } but when if don't have problem stated above, why? public void processitems() { var items = getitems(); //in here, reaches inside if (it...

ios - Text in UITextField will not center properly -

Image
i think question related thread . have login screen 2 uitextfields (user/pass). both horizontally center aligned placeholder text. when press field, placeholder text jumps bit left , marker positioned after first character (which looks awful). . when start typing, clear button appears (as should) text not correctly centered in uitextfield view. the problem occurs when text field has first responder. how can make darn text , placeholder text stay in center of text field??? update: text field settings in storyboard: please see control alignment in below image , set accordingly. solve problem

arraylist - Why is my genetic mutation code not retuning the entire gene? Java -

http://i.imgur.com/pwvruq0.png /* * change template, choose tools | templates * , open template in editor. */ package parentmutation; import java.util.arraylist; import java.util.random; /** * * @author renter */ public class parentmutation { /** * @param args command line arguments */ static int population = 50; static int genesize = 25; public static void main(string[] args) { char[] parenta = new char[genesize]; //create parents pull genes (int x = 0; x < genesize; x++) { parenta[x] = 'a'; system.out.print("-"); } system.out.println(); char[] parentb = new char[genesize]; (int x = 0; x < genesize; x++) { parentb[x] = 'b'; } char[][] people = new char[population][]; //how many children make parentmutation p = new parentmutation(); (int x = 0; x < population; ...

c++ - CCCallFunc usage in cocos2dx -

i getting warning on line stating method actionwithtarget deprecated. can 1 tell alternative method can used in cocos2dx cccallfunc *callbackfunc = cccallfunc::actionwithtarget(this, callfunc_selector(gameplay::starttrumphetanimation)); thanks try this: cccallfunc *func = cccallfunc::create(this, callfunc_selector(gameoverscene::myfunction)); //declare function also void gameoverscene::myfunction(ccobject* sender) { }

sharepoint - Create Document Library using Client Object Model -

just quick question, possible create document library using client object model in sharepoint 2010? i know can create lists etc. right in saying document library 'special' type of list? how can specify list create document library? any appreciated thanks yes. can specify templatetype list . list of templatetypes using (clientcontext clientctx = new clientcontext(url)) { listcreationinformation lci = new listcreationinformation(); lci.description = "my own doclib"; lci.title = "library"; lci.templatetype = 101; list newlib = clientctx.web.lists.add(lci); clientctx.load(newlib); clientctx.executequery(); }

objective c - Automatically open an app within iOS -

i'm developing app ios , i've got list of pdf files in app want able open (and show). now know can uidocumentinteractioncontroller , shows apps able open specific file, i'm looking solution can open app (e.g. adobe reader) without first having open uidocumentinteractioncontroller, tapping app want , opening it. is possible? , if so: how? thanks in advance! dckwlff you can have @ url schemes. app want open needs support it. http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html you can open app in app this: [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"myapp://"]]; edit: can find schemes here: http://schemes.zwapp.com