Posts

Showing posts from April, 2011

c# - Question about tab control -

i creating app that uses tabbed view. pull data sql database , display in grid. want able allow users add, edit, delete, etc on each tab. there way have add, edit, , delete buttons show on each tab without having code each tab individually? let me know if more info needed. thanks you either put buttons outside tab control , apply them selected tab, or have each tab display control derived base class includes buttons (so implemented once in base class).

windows - WCF Hosted as Service -

i have vb.net wcf service hosted window service. able create install package, install service machine, , start service manually services in administrative tools. now when try reference service in test console application (address: http://localhost:8080/ ), following error: there error downloading 'http://localhost:8080'.` unable connect remote server no connection made because target machine actively refused 127.0.0.1:8080` metadata contains reference cannot resolved: 'http://localhost:8080/'. not connect http://localhost:8080/ . tcp error code 10061: no connection made because target machine actively refused 127.0.0.1:8080. unable connect remote server no connection made because target machine actively refused 127.0.0.1:8080 if service defined in current solution, try building solution , adding service reference again. not sure can this. ideas??? thanks, jason. here's code app.config inside service: <

windows - Does an Adobe AIR ActiveX Control exist? -

i wondering: air activex control exist? want load swf movie inside flash activex controller, movie created using adobe air , therefore cannot load of dependencies. i've seen air .exe wrapper somewhere around internet, think possible somehow. any clues on this? thanks in advance! regards, theo

ios - Reusing Certificate Signing Request for Apple Push Service -

the creation of csr prompt keychain access simultaneously generate public , private key pair. private key stored on mac in th.... so every ios app can have 2 environments set push notifications, development , production. what harm in reusing same csr (and same private key?) both dev , prod environments? possible? in similar effect harm of using same csr across different apps. basically want manage single private key when install required elements on server handle push notifications on end. thanks i use same private/public key certificates. time ever end having different private/public keys when client wants me manage whole apple account , certificate generation.

Android MarketPlace filter for 3G or 4G devices -

can restrict our app,so visible/shown 4g devices in android market place. i have 2 apps,one 3g , other 4g.i don't want user confused seeing 2 icons of same app in marketplace. regards, andy ok,since no 1 updated long time,i updating myself. currently don't have filter network type (like 3g/4g-lte). we can restrict @ application level,by checking hardware support 3g/4g having conditions hspa,hspa+,hsrpd,...

objective c - Connecting to a server with NSNetService but failing- automatic socket disconnect? -

new simpler version of problem: i'm trying connect , communicate bonjour device using objective-c client , i'm having trouble resolving service (server). tried more complicated example, found basic socket connection port/ip specified wasn't working. i have barebones possible code using cocoaasyncsocket library: asyncsocket *xxx = [[[asyncsocket alloc] initwithdelegate:self] autorelease]; nserror **err; [xxx connecttohost: @"localhost" onport: 5000 error: err]; nslog(@"err=%@",err); and here's server i'm trying connect (python script): # tcp server bonjour broadcast! import select import sys import pybonjour import socket time import sleep #name = sys.argv[1] #regtype = sys.argv[2] #port = int(sys.argv[3]) # bonjour service parameters name = "test" regtype = "_xxx._tcp." port = 5000 # tcp socket stuff server_socket = socket.socket(socket.af_inet, socket.sock_stream) server_socket.bind(("", po

javascript - Render any response from ajax call (HTML and/or JS) -

i wonder what's effective way render might come ajax call. response can html and/or javascript i doing document.write() since ajax call sync. have use async calls can't write page using document.write, have add content specific html object when call finished. i tried this $jquery.ajax({ url: "myurl.ashx", data: params, success: function(data){ var newdiv = document.createelement('div'); newdiv.innerhtml = data; document.getelementbyid('target').appendchild(newdiv); } but doesn't work javascript returned, broken (this means; doesn't render content or weird things showing content in new tab). work simple scenarios. i wonder if there better approach works better this. thanks! edit this code, example, doesn't work expected. renders content on blank page instead of adding content current page. i'm testing ff 3.6. simplicity, i'm harcoding javscript on str var, script returned

c# - binding two VerticalScrollBars one to another -

i have 2 textboxes in control , , have in both of thems 2 verticalscrollbar. want bind verticalscrollbars between them , if 1 goes secound go etc... possible if how can ? thanks not real binding works: <textbox name="scrltb1" height="100" scrollbar.scroll="scroll" scrollviewer.verticalscrollbarvisibility="visible"/> <textbox name="scrltb2" height="100" scrollbar.scroll="scroll" scrollviewer.verticalscrollbarvisibility="visible"/> private void scroll(object sender, scrolleventargs e) { if (sender == scrltb1) { scrltb2.scrolltoverticaloffset(e.newvalue); } else { scrltb1.scrolltoverticaloffset(e.newvalue); } } ( this example ignores possibility of horizontal scrolling )

OOP PHP Codeigniter Controller Hierarchy -

i'm having litle problems concepts of oop. i'll try explain best can. i have class class application_controller extends ci_controller{ public function additem(){ "some code add item database (working)"; } } and have class, both controllers: require_once 'application_controller.php'; class contact extends application_controller{ public function __construct(){ parent::__construct("variables needed"); } } and in view add of contact added following action contact/additem . ok, here's know oop in general. isn't method additem supposed part of contact class because extends application_controller? i'm asking because when submit form no action, , when add method additem in class contact overriding parent 1 works. the reason no action codeigniter doesn't find method additem in contact class (update: due way codeigniter routing works). solution make additem generic method in mode

facebook - Can I read FB API information in offline mode? -

i know fb allows offline mode, how work it? when getting access permissions user login app via facebook, need ask permission offline access in api call. auth token fb has expiry on - if user gives offline access permissions, expiry time set infinite. for more info on offline access, refer: https://developers.facebook.com/docs/authentication/ , https://developers.facebook.com/docs/authentication/permissions/ (see section under write permissions)

objective c - ObjC/iPad buttons in subviews calling methods in master controller. How? -

is model mess? i'm writing ipad app multiple views. have masterviewcontroller subviews other view controllers. of these subviews contain buttons. the user clicks these buttons change views. intention masterviewcontroller responsible changing these views. how? how can masterviewcontroller tell when button pressed? @implementation subviewcontrollerone - (ibaction) switchtosubviewtwo { //where send message? [masterviewcontroller mymethod] //doesn't work because need message specific instance } you could pass reference master controller sub controllers , tell way make master controller singleton , reference way you have sub controllers post nsnotification master listens for.

flex - arraycollection unique var -

how create new arraycollection can generate unique variable name? like: ac+nu in ac1:arraycollection ac+nu in ac2:arraycollection ac+nu in ac3:arraycollection ac+nu in ac4:arraycollection nu++; i think want: var ac1:arraycollection = new arraycollection(sourcearraycollection.list); var ac2:arraycollection = new arraycollection(sourcearraycollection.list);

linux - streaming HD video over home network -

just looking advice, pointers, , suggestions further reading. i have: 1 router 1 linux server (ubuntu 10.04) 2 tvs various speakers 2 desktops 1 ipad i want make home network given request server (perhaps request php script or something) server can start streaming audio or video device. think easier things can have ips (desktop, ipad, etc) not sure others (i don't have ip tv). on wireless, may need ethernet hd video, etc. what can recommend? i've been recommended mbone. maybe problem stems form fact don't understand how push streaming video tv, "dumb" (no processor or ip address). i'd forget writing (unless want academic excercise). instead, upnp/dlna. get upnp server linux box. mediatomb come highly recomended. for tvs can boxee or seagate freeagent/goflex. i think existing players in windows/ubuntu support dlna extent, xbmc. for ipad media:connect to push media server player, dlna control points (paid version of media:conn

What is the correct way to set build configurations in an ios project using static libraries for creating an archive in xcode 4? -

i have working application relies on several static libraries, i've added dependencies application , added link static libraries bit in build phases. builds , runs fine in simulator , on attached ipad. i wanted create .ipa use test flight followed instructions on test flight's site ( http://support.testflightapp.com/kb/tutorials/how-to-create-an-ipa-xcode-4 ) , other tutorials relating creating archive app uses static libraries ( http://diaryofacodemonkey.ruprect.com/2011/03/18/ad-hoc-app-distribution-with-xcode-4/ , http://www.musicalgeometry.com/?p=1237 ). following these tutorials, when create archive linker errors not being able find various libraries, example: ld: library not found -loauthtouch (i've tried using new project , new static library project make sure it's not setting i've changed , same problem). this seems because added build configuration called "ad hoc" app creating archive, , based on linker command , fact adding "ad h

c# - is "Double-Checked Locking is Broken" a java-only thing? -

the page @ http://www.cs.umd.edu/~pugh/java/memorymodel/doublecheckedlocking.html says double-checked locking flawed in java. i'm wondering apply other languages (c#, vb, c++, etc) i've read double checked locking pattern: broken or not? , is broken double checked locking? , how solve "double-checked locking broken" declaration in java? truthful don't know common consensus is. yes broken others no. anyway, question apply other languages (c#, vb, c++, etc) double checked locking safe in java, provided that: the instance variable declared volatile , and the jvm correctly implements jsr-133 specification; i.e. compliant java 5 , later. my source jsr-133 (java memory model) faq - jeremy manson , brian goetz, february 2004 . confirmed goetz in number of other places. however, goetz says, idiom time has passed. uncontended synchronization in java fast, recommends declare getinstance() method synchronized if need lazy initialization. (an

php - PDO SQLite3 connection failure when database is in different folder -

i'm trying connect sqlite3 database php, i'm hitting brick wall when want place db somewhere convenient , outside of web accesible space. when db file in same folder php script runs ok, when place somewhere else - silent fail. i've written simple checker easier understand mean <?php $files = array( 'data.db', getcwd() . directory_separator . 'data.db', 'some_inner_folder' . directory_separator . 'data.db', getcwd() . directory_separator . 'some_inner_folder' . directory_separator . 'data.db' ); foreach($files $file) { if(file_exists($file)) echo $file, ' found<br/>'; else echo $file, ' not found!<br/>'; try { $db = new pdo('sqlite:host=' . $file); if($db) echo 'connection ', $file, ' made succesfully<br/>'; } catch (pdoexception $error) { echo 'error connecting ', $file

php - creating a table with a primary key that is auto increment with default values of 10000 -

"create table dummy ( tnum unsigned int not null auto_increment, primary key (tnum), )"; alter table dummy auto_increment = 10000; this not running. know causes error, , alternatives can create auto-incrementing primary key has default value of 10000. unsigned great auto_increment columns! gives twice many possible values! change query following: create table dummy ( tnum int unsigned not null auto_increment primary key ) auto_increment=10000

osx - Change XCode 4 Multi-Touch Gestures -

i use magicprefs customize multi-touch gestures use in os x. example, use 3 finger swipes , down switch between tabs in applications. xcode 4 seems have 3 finger swipe up/down bound "switch between header , implementation". there way turn off binding in xcode? i have looked high , low within xcode 4 , online, , sadly, there seems no way disable three-finger swipe gesture within xcode. last resort, tried disabling keyboard shortcuts jump next counterpart , jump previous counterpart -- had no effect on gesture. if using tab bar in xcode 4 , looking easier way switch between tabs, can use default keyboard shortcuts cmd + { , cmd + } select previous tab , select next tab , respectively. apple accepts feedback developers using this form -- perhaps can submit request make option in next xcode update.

php - Grouping rows together with the same parent-ID -

i writing private-messaging script. however, have run few problems on mysql end. i've got partially working. an example: messageid | parentid | subject | flags 1 null 'foobar' 2 //has been read 2 1 'foobar' 2 //has been read 3 1 'foobar' 1 //has not been read messageid: auto-incremented of message parentid: messageid of first-message in thread subject: subject (or title) of thread flags: bit-wise flags (1 = unread; 2 = read) the problems (which can me solve) 1. way have setup right now, script display message-thread in unread-messages page , read-messages page. goal display in unread-messages page until been read. here query //$_get['node'] allowed be: unread, read, or sent $wftype = $_get['node'] == 'sent' ? 'sender' : 'recipient'; $filter = $_get['node'] == 'sent' ? '' : ' , (`flags` & &#

c# - how to use Wcf in communication between the desktop and WP7? -

hi new person wcf .. have 1 confusion if use wcf whether need maintain server. or not required. please explain clearly.. ...i want send files phone modify in phone app resend desktop app. there alternative without server. if using wcf connect windows phone 7, going need "server" of sort. think since new wcf, should start learning basics of wcf. once speed on basics, have better handle on how deal issues in manner best suited environment. here quick quote microsoft's site on wcf services about: wcf microsoft's next-generation programming platform , runtime system building, configuring , deploying network-distributed services. http://msdn.microsoft.com/en-us/library/aa480190.aspx basically, if designing network-distributed services, need them installed on central server. true if communicating mobile devices.

c# - Loading multiple RIA Services queries at same time -

i want similar below loading in parallel related data each of collection of loaded entities: foreach (var parentthing in parentthings) { context.load(context.getchildthingforparentquery(parentthing.id), op => { parentthing.child = op.entities.firstordefault(); }, null); } however, doesn't seem work. data mixed in callback lambda, e.g. parentthing last object in collection , op.entities contains first child. the problem foreach caused accessing modified closure . try: foreach (var temp in parentthings) { var parentthing = temp; context.load(context.getchildthingforparentquery(parentthing.id), op => { parentthing.child = op.entities.firstordefault(); }, null); }

regex - PHP regular expression -

what purpose of following code? preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string ); what kind of $string match expression? why there character @ ? that regular expression match <script>...</style> or <style>...</style> (x)html blocks in string , remove them. done prevent users inserting these (potentially harmful) tags data might echo user. if not removed, allow malicious users change site appearance, or insert javascript site rewrites page content; might force users visit other websites automatically , many other nasty things. as @ .... when defining regular expressions, traditionally enclosed slash example: /regexphere/si the / around regular expression indicates boundaries , characters trailing second slash there flags regular expression engine behave way. in particular i means "case insensitive" , s means . in expression should match whitespace newlines , tabs. format in

asp.net - How to Convert pdf file to datatable -

is there way convert pdf file datatable? pdf file consist of tables highly appreciated. if pdf contains marked content (you can see how find in blog article http://www.jpedal.org/pdfblog/2010/09/the-easy-way-to-discover-if-a-pdf-file-contains-structured-content/ ) can extract pdf file. otherwise need extract text , try guess structure.

qt - Is there a way to use space between buttons in landscape -

after digging i've realised there no qt-way use 3 middle buttons in landscape mode in s50v5, don't waste precious space. i've tried place widgets there menu bar on top , widgets aren't visible. is there way utilise space without using native symbian apis? controlling stock softkeys in qt pain. strategy have used make qmainwindow full-screen showfullscreen() allows use softkey space yourself. have make sure widgets create parents of main window, , mindful of this bug when creating pop-ups.

authentication - cakephp - can not get User->login() method to run through it's code -

hi have followed through cake users guide , followed auth tutorial. have had trouble login method. seems method getting called when not log in. whenever able log in of session variables set in user controller's login method not display in redirected view. can't seem narrow down. i think should mentioned in cake tutorial (or maybe somehow missed it,) function of user -> login() method gets skipped on auth component , never executed. seems in order execute login code have add before filter of app controller: $this->auth->autoredirect = false; then can manually log in through login() method so: $this->session->read('auth.user') hope helps :)

c# - validate search result using Linq -

i have search result database, int searchterm = "xx" var result = orderlines in context.orderlinesearch(searchterm) select new { ordernumber = orders.ordernumber, orderlineid = orders.orderlineid }; i need validate whether result contains many orders. need check whether multiple orders returned or not. i did validation storing first order number in variable , compared whether other rows contains order number. see below string ordernumber = result.first().ordernumber; bool isvalid = result.where(x => x.ordernumber != ordernumber).count() == 0; i want know best way validate using linq? can 1 me? thanks in advance. may should try group results ordernumber , calculate count? var result = orderlines in context.orderlinesearch(searchterm) group orderli

php - how to show textbox if radio button value is checked from database? -

i have 3 radio buttons <input type="radio" name="preferedpaymt" value="checkmailed" id="checkmailed1" <?php if($paymnt=="checkmail") {?> checked="checked" <?php }?> /> (a)check mailed <input type="radio" name="preferedpaymt" value="paypal" <?php if($paymnt=="paypal") {?> checked="checked" <?php }?> /> (b)by paypal <input type="radio" name="preferedpaymt" value="wiretransfer" id="wiretransfer" <?php if($paymnt=="wiretransfer") {?> checked="checked" <?php }?> /> (c)wire transfer bank a/c$12 but value of radiobutton checked database . these 2 tables associated if radiobutton 2 checked table1 1 should populate id tb1 here problem when value of radio button checked database table not populate if click gets populated want automatis how can it? jquery co

Autohotkey Script to reliably bring an application to the forefront -

i'm looking autohotkey script (or else matter) allow me associate bringing application forefront keyboard shortcut (preferably function key). very basic solution. create new .ahk script , run. when press f7 window activated. edit hotkey labelled (keep double colon). edit window title want activated. settitlematchmode, 2 ;// matches partial window titles f7:: ;// hotkey winactivate, firefox ;// activate window title return

java - How shall I post a variable number of user-defined data to Paypal? -

friends, have shopping cart code took on when started company, unfortunately i'm weak on java , integrating paypal. here form sends data paypal when customer checks out of shopping cart. can send 1 product, include data on products purchased cart. thinking logic:iterate me? how increment "on#" , "os#" when presented variable amount of products? <form name="paypal" id="paypal" style="float:left;" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="lc" value="us"> <input type="hidden" name="business" value="shop@myshop.com"> <input type="hidden" name="item_name" value="order detail information"> <input type="hidden" name="amount" id=&q

how to make work a web service compiled with java 1.3 in a java 1.6 project? -

i'm working on java ee application made flash builder 3, hibernate, apache cxf , spring. jre i'm using 1.6. i've service has compiled java 1.3. application server tomcat 6. here's problem, how can work 1.6 , 1.3 @ same time? fact of mentionning classes should compiled 1.3 compatibility enough? otherwise, should use 2 different tomcat version (one i'll deploy 1.6 services & other particular service) communicate??? , need use axis on 1.3 side?? i'm pretty lost, , architecture im supposed use welcome. thanx if understand correctly, want develop java 1.6 , deploy java 1.3 web container. that's going difficult do. use retroweaver make classes compiled 1.6 compatible 1.3. can use enums, generics , few other things. you restricted on system , third party libraries can use. can't use system classes , methods aren't in 1.3 (note 1.4 , 1.5 introduced lot of useful classes). same apply libraries depend on. , if they're compiled v

c# - Multiple file sending over to a server -

i have made windows service motive behind send multiple files designated server. private void sendfile() { timer.stop(); registrykey thelocalmachine = registry.localmachine; registrykey thesystem2 = thelocalmachine.opensubkey(@"software\\networkusagemonitoring\\", true); registrykey interfacekey4 = thesystem2.opensubkey("usagerecorder", true); string serverno = interfacekey4.getvalue("serverno").tostring(); (int = 0; < netarr1.length; i++) { (int j = 0; j < netarr2.length; j++) { if (netarr1[i].name == netarr2[j]) { ipendpoint ipend = new ipendpoint(ipaddress.parse(serverno), 5656); socket clientsock = new socket(addressfamily.internetwork, sockettype.stream, protocoltype.ip); try { if (file.exists(@"c:\" + neta

Doing complex queries with jQuery -

how query jquery div element visible , has z-index > 0 , id != "" . i raw linear search using document.getelementsbytagname have been told it's excessively performance-impacting. on page 400+ divs takes quite lot of time perform. somebody told me jquery can perform more complex queries. possible? please bear in mind have absolutely no control on ids of these popup divs can't work on "well-known" ids. thank you. jquery features very rich set of selectors (nearly of css3 , few extras). combined handy filter function, can useful things: var divswithzindexandid = $('div:visible[id!=""]').filter(function() { return parseint(this.style.zindex, 10) > 0; }); that looks @ z-index on element's inline style. if need computed style, use css . var divswithzindexandid = $('div:visible[id!=""]').filter(function() { return parseint($(this).css("z-index"), 10) > 0; }); (both

C# MS Project Interop - Get Resource's Working Time -

in ms project can go resource sheet, right click on resource, go the resource information dialog, click "change working time..." , enter holidays, sick leave or other absences resource. i'd access same information programatically c#. i have microsoft.office.interop.msproject.project object loaded in memory , can access tasks , other properties. project object can access resource property (type microsoft.office.interop.msproject.resource) don't know in type find resource's working times. i'm using vs2008 ms project 2007. any appreciated. my (out of date) understanding of ms project working time resource set in calendar. after quick google (and bing!), looks something you're after.

xslt - how to get required tag value from an xml file in .xsl file? -

i have following type of file contains in xml format <?xml version="1.0" encoding="utf-8"?> <root> <serviceimpl category="default"> <package>estermemorymanagement</package> <service singleton="true"> <provides>xoc.hw.cor.memgt.zcontenttype</provides> <brief>this sis first sdrevice</brief> </service> </serviceimpl> <serviceimpl category="default"> <package>w.cor.testerm</package> <service singleton="true"> <provides>xoc.hw.zaccesstypeprovid</provides> <brief>this sis first sdrevice</brief> </service> </serviceimpl> </root> i have values within tag <provides></provides> in .xsl file. how can that? in advance. here's 1 way of doing it: <?xml vers

java - How to use smack with Openfire -

hi planning develop chat client can connect gtalk facebook etc...i have decided use smack api along openfire.. but need little guidance how use openfire server.. and openfire provide basic ui log in box chat window etc... i need know how plug or use smack openfire thanks:) i have decided use smack api along openfire.. need little guidance how use openfire server.. what smack api getting started ? and openfire provide basic ui log in box chat window etc... openfire server. chat, you'll need jabber/xmpp client. use spark tests.

c++ - cmake: compilation statistics -

i need figure out translation units need restructured improve compile times, how hold of compilation time, using cmake, translation units ? i expect replace compiler (and/or linker) 'time original-cmd'. using plain 'make', i'd say: make cc="time gcc" the 'time' program run command , report on time took. equivalent mechanism work 'cmake'. if need capture command time, can write own command analogous time (a shell script do) records data want in way want.

forms - How to find in GSP from which action of controller its been called? -

i new grails , got stuck issue. i have 2 form's in single gsp search.gsp , have 2 actions in controller serach , results . now when click on search button in 1 of gsp file takes me search action renders me search.gsp.at time should display me first form in it. when click results button in form take me results action .which has code line. redirect(action:"search",params:[merchants:merchant,address:address]) this take me search action want display 2nd form in search.gsp.. my problem is how can make search action once run out parameter's , once parameter's? how determine in gsp action been called? with advance thanks. depending on how different forms are, may want consider having 2 separate gsp files (e.g., search.gsp , results.gsp). use render(view:'action', model:[...]) render different view in controller. clearer single file lots of conditionals. otherwise, can find out action using ${params.action} , example: <

DBPEDIA + SPARQL Selecting films in function of their genre -

is possible list of films in function of genre? i tried this: select distinct ?film_title ?film_abstract ?film_genre { ?film_title rdf:type <http://dbpedia.org/ontology/film> . ?film_title rdfs:comment ?film_abstract . ?film_genre <http://dbpedia.org/ontology/genre> ?film_genre . filter(lang(?film_abstract) = "en" ). } limit 20 but i've doing wrong ! thanks, danilo looks simple typo on part. third triple pattern should following: ?film_title <http://dbpedia.org/ontology/genre> ?film_genre also filter using may make query slow, try using following instead: filter(langmatches(lang(?film_abstract), "en")) though having played query there doesn't appear data matches query in dbpedia. genre property using appears applied music , not films should remove third triple pattern entirely if want results

objective c - How to create a transparent web view in iphone -

i m parsing rss feed , loading in webview..ive placed image in background of webview.wat want transparent webview shows image , parsed content ....below code..cud u guys me out...the itemsummary contains parsed feed [self.itemsummary loadhtmlstring:[item objectforkey:@"description"] baseurl:nil]; [self.itemsummary setclipstobounds:yes]; self.itemsummary.opaque=no; self.itemsummary.backgroundcolor=[uicolor clearcolor]; check discussion: https://discussions.apple.com/message/9175823?messageid=9175823& summary make uiwebview transparent: [mywebview setbackgroundcolor:[uicolor clearcolor]]; [mywebview setopaque:no]; make page transparent (use one): <body style="background-color: transparent"> body{background-color:transparent;}

mysql - Constrain a columns value to a value of a different column inside the same table? -

i'm creating tree view website using databases. create 2 tables, let's call them "folder" , "file". folder can contain multiple folders , files, , files act leaf nodes - means they're "dead end" in tree if you're unfamiliar term. the folder table contain columns: folder_id, folder_name, folder_parent file contain: file_id, file_name, file_parent obviously file_parent reference folder_id, creating foreign key, how make folder_parent reference folder_id? example: folder_name | folder_id | folder_parent root 1 null cars 2 1 planes 3 1 bmw 4 2 create table folder ( folder_id int primary key, folder_name varchar not null, folder_parent int references folder(folder_id) )

osx snow leopard - How do you restart Samba on OSX 10.6.7? -

how restart samba on osx 10.6.7? i've looked everywhere can't fine docs. reason asking on occasion samba hangs , have forcibly restart mac fix it. (restart command hangs mac) on terminal, sudo killall smbd terminate smbd instances. respawned on demand accoring tests (i.e. kill smbd, try browse services smbclient -l hostname , , daemons restarted automagically). you can check smbd processes ps uax | grep smbd edit: if need assassinate blocked smbd processes, use killall -9 smbd (which not recommended , see section on signals )

doctrine2 - How to access a custom repository from a controller in doctrine 2.0 and Zend framework? -

im unable access custom repository controller in doctrine 2.0 , zend framework? i have file structure following:- application/controllers /configs /domain/ entities/user.php /mappings/user.php proxies/ repositories/ vendor/ doctrine in user.php, have included this: namespace repositories; use doctrine\orm\entityrepository; /** * @entity(repositoryclass="repositories\userrepository") * @table(name="user") */ class user { } even tried namespace entities; use doctrine\orm\entityrepository; /** * @entity(repositoryclass="entities\userrepository") * @table(name="user") */ class user { } ive generated repositories domain/repositories command. now have customized repositories in folder domain/repositories. ill want access ex: userrepository in usercontroller.php tried this. $this->em = zend_registry::get('em'); $userlist = $this-

iphone - Black screen after applicationWillEnterForeground -

seems have problem multitasking in ios app. have nstimer running, updates things on screen , nstimer fired once after defined time interval. the problem is: want react on fire-event. whether app in foreground or not. i used following code able track timer: -(void)backgroundthreadstarted { nsautoreleasepool* thepool = [[nsautoreleasepool alloc] init]; // create scheduled timer nstimer *timer = [nstimer scheduledtimerwithtimeinterval:1.0 target:self selector:@selector(backgroundthreadfire:) userinfo:nil repeats:yes]; [[nsrunloop currentrunloop] addtimer:timer formode:nsdefaultrunloopmode]; m_isbackgroundthreadtoterminate = no; // create runloop double resolution = 300.0; bool isrunning; { // run loop! nsdate* thenextdate = [nsdate datewithtimeintervalsincenow:resolution]; isrunning = [[nsrunloop currentrunloop] runmode:nsdefaultrunloopmode beforedate:thenextdate]; // re-create autorelease pool whilst program running [thepool release];

Enabling Users for LYNC 2010 using C# -

is there way enable users on lync server via c#. refer same functionality runs when go lync server control panel, , creating new lync server user. you call enable-csuser powershell command c# app - see articles here , here

hyphenation - how to hyphenate string / text in a textarea using jquery -

i not able hyphenate string using jquery. seems there no library available . tried following link failed . please if know how hyphenate string in textarea according textarea width using jquery plugin (if found) http://plugins.jquery.com/project/jqueryhyphenate this link did'nt contain reqired library i think hypher you're looking for: https://github.com/bramstein/hypher

grails - peculiar behaviour of mockDomain -

hi have below unit test, class bookunitspec extends unitspec { def "person_roleof() able retrive person role based on roletype enum"(){ setup: "mock person object" mockdomain(person); //if move line 3 lines below ... //otherwise test passes def person = new person() def employee = new employee(id:1) def employees = [employee] // mockdomain(person); on here below error mockdomain(personrole,employees); mockdomain(employee,employees); when: "add employee role person" person.addtopersonroles(employee); person.save() then: "check if role can correctly retrieved" person!=null person.roleof(roletypes.employee)!=null; person.roleof(roletypes.author)==null; } } throws groovy.lang.missingmethodexception: no signature of method: com.nthdimenzion.domain.base.person.addtopersonroles() applicable argument types: (com.nthdimenzion.domain.employee) values: [com.nthdimenzion.

php - Cannot read pdf generated through dompdf in chrome -

i'm testing dompdf. , found out i'm generating can't red chrome. tried open sumatra pdf reader, , opened. tried opening random pdf file ebooks in chrome , red it. there wrong code chrome wasn't able read it: <?php require_once("dompdf/dompdf_config.inc.php"); $dompdf = new dompdf(); $d_r = array(array('name'=>'ab', 'course'=>'bsit'), array('name'=>'yoh', 'course'=>'bscs')); ob_start(); put_table($d_r); file_put_contents('sample.html', ob_get_contents()); generate_pdf('sample.html'); function put_table($raw_data){ ?> <table border="1"> <tr> <th>name</th> <th>course</th> </tr> <?php foreach($raw_data $data){ ?> <tr> <td><?php echo $data['name']; ?></td> <td><?php echo $data['course']; ?></td> </tr> &l

android - help for google maps -

Image
am running commonsware project map map display squares , not maps or streets @hassan khwieh i think have not supply valid google map key review click here

batch file to assign a variable and compare with a string -

i know how achieve this, tried few times no luck.. syntax error i need write batch file read first line of text, assign variable , compare string. bool.txt: hello test.bat: set variable =< c:\bool.txt if "%variable%"=="hello" echo here thanks in advance sr see help for , help set , try this /f %%a in (bool.txt) ( if "%%a"="hello" echo here )

php - Drupal 7 theming: region error -

this in theme.info file of drupal theme: regions[conf_modules] = configurator: modules i'm using multiple templates different node types. in 1 of them i'd region/block show up. i've put in node--configurator.tpl.php: <?php print render($page['conf_modules']); ?> in drupal administration panel have assigned views block region, on node--configurator.tpl.php pages, views block not shown. using render() properly? what's going wrong here? in advance! in node templates, $page status variable is: true if node being displayed page. however, can add regions page specific content types through page.tpl.php if like. below should work if placed in page.tpl.php : <?php if ($node->type == 'content_type') { print render($page['conf_modules']); } ?>

networking - IIS 7.5 app pool network drive access issue -

i have 2 apps pools both .net 4.0 app pools. if switch application second app pool application able connect network drive, if switch application first app pool can't connect network drive application. we created both these app pools month ago don't remember did cause second app pool work or first app pool break. i tried create new app pool , switch application 1 , application still can't connect network drive. so, means default app pool doesn't have access network drive, how should be. what can first app pool has access network drive. note:- giving permission app pool access network drive not option. have read access network drive. we found temporary solution (might one). changed app pool's identity server user. since server user had access network drive, app pool , applications under has same access server user. it might have security flaws, running intranet applications, might ok.

Clojure Agent question - using send-off -

i have couple of questions following code: (import '(java.awt color graphics dimension) '(java.awt.image bufferedimage) '(javax.swing jpanel jframe)) (def width 900) (def height 600) (defn render [g] (let [img (new bufferedimage width height (. bufferedimage type_int_argb)) bg (. img (getgraphics))] (doto bg (.setcolor (. color white)) (.fillrect 0 0 (. img (getwidth)) (. img (getheight))) (.setcolor (. color red)) (.drawoval 200 200 (rand-int 100) (rand-int 50))) (. g (drawimage img 0 0 nil)) (. bg (dispose)) )) (def panel (doto (proxy [jpanel] [] (paint [g] (render g))) (.setpreferredsize (new dimension width height)))) (def frame (doto (new jframe) (.add panel) .pack .show)) (def animator (agent nil)) (defn animation [x] (send-off *agent* #'animation) (. panel (repaint)

javascript - jquery plugin "jStepper" - not working for me -

i trying use plugin: http://jstepper.emkay.dk/default.aspx increments values nicely, when try launch "onstep" event, runs right after page loads, not when value incremented. hope can point me in right direction, maybe similar plugin exists? or maybe simple fix in plugin's source. can try in "demo" box: $(".txttesting").jstepper({onstep:alert("test")}); you have this..... $(obj).jstepper({onstep:testfunction}); function testfunction(objtextfield, bdirection, blimitreached) { alert("test"); } or $(obj).jstepper({ onstep: function(objtextfield, bdirection, blimitreached) { alert("test"); } }); thanks

facebook login error -

i using code obtain login:(i put 000..0 instead app id. <html> <head> <title>my facebook login page</title> </head> <body> <div id="fb-root"></div> <script src="http://connect.facebook.net/en_us/all.js"></script> <script> fb.init({ appid:000000000000000, cookie:true, status:true, xfbml:true }); </script> <fb:login-button> login facebook </fb:login-button> </body> </html> the problem on web browser pops facebook login page. have following error: invalid argument given url not allowed application configuration.. why?! thx

OpenLayers.Control.Button's trigger parameter won't get called -

i'm trying add button openlayers map supposed call js function when clicked. i've managed appear how like, trigger functionality not work. if have control.navigation present, clicking on button seems start dragging event , can drag map clicking on button. if remove other controls, button's trigger handler not called. i've tried adding "autoactivate" parameter (which not make control automatically active reason anyway), i've tried call activate() function button after i've added it, seem toggle control's "active" property, still not respond clicks. can point me right direction, please, or post working example? non-working example below. thanks, janis <html> <head> <title>openlayers.control.button</title> <style text="text/css"> .olcontrolbutton { position: absolute; top: 0; right: 0; background: red; width: 22px; height: 22px; } </style> <script type=&

javascript - How do I unset CSS values? -

i have written firefox extension alters , feel of facebook. used js code inject css styles override fb defined values. url patterns don't want force styles. issue here fb doesn't seem load full page parts of page (but somehow url in address changes). this means when new page loads old styles still remain applied , want restore them original values. how should that? you should inject custom css styles 1 <style> element, , remove <style> element (using javascript) when new page loaded on don't want custom css. here's example using jquery: http://jsfiddle.net/thirtydot/bapzf/

javascript - How can I remove all characters up to and including the 3rd slash in a string? -

i'm having trouble removing characters , including 3 third slash in javascript. string: http://blablab/test the result should be: test does know correct solution? to last item in path, can split string on / , pop() : var url = "http://blablab/test"; alert(url.split("/").pop()); //-> "test" to specify individual part of path , split on / , use bracket notation access item: var url = "http://blablab/test/page.php"; alert(url.split("/")[3]); //-> "test" or, if want everything after third slash , split() , slice() , join() : var url = "http://blablab/test/page.php"; alert(url.split("/").slice(3).join("/")); //-> "test/page.php"

objective c - [NSNull isEqualToString:]: unrecognized selector sent to instance -

try compare field returned web-service , contains either string true or false (yes, it's string , not boolean), try compare string : if ([withoptions isequaltostring:@"true"]) { annotation.stationlavage=@"with"; }else { annotation.stationlavage=@"without"; } so when withoptions string contains "true" string, ok, , when contains "false" string got exception in log : terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsnull isequaltostring:]: unrecognized selector sent instance 0x2984d68' i pretty sure in cases, withoptions contains string value (either "true" or "false") , never contains null. i pretty sure in cases, withoptions contains string value (either "true" or "false") , never contains null. clearly, assumption wrong. :) on line before if() statement,

java - how to handle large amount of float data? -

we have binary file contains large amount of float data (about 80mb). need process in our java application. data medical scanner. 1 file contains data 1 rotation . 1 rotation contains 960 views . 1 view contains 16 rows , 1 rows contains 1344 cells . numbers (their relationship) fixed. we need read floats our application code structure reflect above structure rotation-view-row-cell . what doing using float[] hold data cells , using arraylist rotation , view , row hold data. i have 2 questions: how populate cell data (read floats our float[]) quickly? do have better idea hold data? for data loading: datainputstream should work well. make sure wrap underlying fileinputstream in bufferedinputstream, otherwise run risk of doing i/o operations every float can kill performance. several options holding data: the (very marginally) memory-efficient way store entire array in on large float[], , calculate offsets needed. bit ugly use, might make sense if

flex4 - Flex 4 state transition Move effect in a VGroup -

i trying create nice state transition have 2 containers (in example below have used panels). when state changes, want fade away upper panel, move lower panel top of screen, , below want fade in new 'lower' panel. in code below, fades working fine, panel doesn't move top of box, goes it's new position without transition. also 'reverse' transition doesn't happen @ all. tried set autoreverse true, , tried build opposite transition, both no result, there no transition. when replace vgroup (in happens) vbox, better result, transition works in 1 way. reverse transition still doesn't work @ all. <?xml version="1.0" encoding="utf-8"?> <fx:script> <![cdata[ private function switchmode():void { if (currentstate == "up") currentstate = "down"; else currentstate = "up"; } ]]> </fx:script>