Posts

Showing posts from June, 2010

java - spring webservice Invalid NamespaceHandler problem (jaxws) -

i building web service spring. can build , deploy project tomcat when server starts getting following error: invalid namespacehandler class [org.apache.cxf.jaxws.spring.namespacehandler] namespace [http://cxf.apache.org/jaxws]: problem handler class file or dependent class; nested exception java.lang.noclassdeffounderror: org/springframework/beans/factory/xml/namespacehandlersupport i have included cxf-rt-frontend-jaxws.jar in classpath. my bean definition here: <jaxws:endpoint id="hellowebservice" implementor="#com.xxx.impl.hellowebserviceimpl" address="/hellows"> </jaxws:endpoint> my lib folder contains(web-inf/lib): antlr-2.7.6.jar asinus-api.jar asinus-ri.jar aspectjrt.jar aspectjweaver.jar backport-util-concurrent-3.0.jar cglib-nodep-2.1_3.jar commons-beanutils-1.6.jar commons-codec-1.4.jar commons-collections-3.2.1.jar commons-fileupload-1.2.jar commons-httpclient-3.1.jar commons-io-1.4.jar commons-

project management - Building and Planning of a Web-Application -

good morning everyone, i hope i'm not posting in wrong place; i've been programming web projects, in mvc , asp.net consulting companies, pick-up unfinished projects, gotta say, experience in web development isn't i'd be. improve experience, decided accept building project veterinarian clinic , i'm going build project in mvc. there few things i'd know make project structured , avoid feeling lost in process because don't have time research i'd to. main questions i'd ask are: when beginning new project, should begin? making stylesheets? should go straight code? if make planning, how should go then? when building media folder in project, if decide i'll use jquery , like, files should get? what's best way implement jquery in mvc project without having mention in every page? to make sort of planning for myself, complete deadlines i have respect, structure should use? well, i'm not @ designing at all, , have rely on other

JavaScript function calls within Django form fields -

i'd create form have checkboxes, , when clicked, open separate textareas user enter more information in. if want use django's dynamically created form fields, there way can put function call in each checkbox. you can dynamically add event handlers using javascript. can add script that, once page loaded, find checkboxes want , add handlers there. in jquery , can write this: $(document).ready(function() { $(".my_form input[type=checkbox]").change(function() { //some code here }); }); be careful, have not tested code above! should enough started.

tfs2010 - TFS 2010 Hotfix Branch/Merge Strategy without baseless merge? -

i trying understand how work branching , merging in team foundation server 2010. strategy below web development team. my idea have 5 folders. main folder, development folder, qa folder, production folder , hotfix folder. main folder consist of main branch. developer either work directly in main branch or create new branch in development folder , merge main branch when done. when want create release version promote main branch qa 1.0.0 branch. when branch stable promote branch production branch 1.0.0. production branch becomes read only, , qa branch merge main branch. use qa 1.0.0 branch example branching hotfixes. example here after qa branch goes production find bugs. promote qa branch 1.0.0 hotfix 1.0.1 branch. when hotfix branch stable promote production branch 1.0.1. when new bug found in production 1.0.1 branch create new hotfix 1.0.2 branch hotfix 1.0.1 branch. when branch stable promote branch production branch 1.0.2. works in team foundation server 2010. the problem hav

sorting - High Mysql Load - CPU 360% -

i having high mysql cpu usage , on server intel(r) xeon(r) cpu e5520 @ 2.27ghz 16 core of processors , 16 g.b ram running on centos 5.4 the load average server 500 - 900 , that's high numbers here information out mysql configuration file /etc/my.cnf [mysqld] local-infile=0 safe-show-database skip-locking skip-innodb skip-networking old_passwords back_log = 50 skip-innodb max_connections = 40000 key_buffer_size = 640m myisam_sort_buffer_size = 256m myisam_max_sort_file_size = 2048m join_buffer_size = 3m read_buffer_size = 3m sort_buffer_size = 3m table_cache = 8000 thread_cache_size = 1024 wait_timeout = 300 interactive_timeout = 600 connect_timeout = 10 tmp_table_size = 1024m max_heap_table_size = 1024m max_allowed_packet = 128m net_buffer_length = 16384 max_connect_errors = 100000 long_query_time=0 thread_concurrency = 32 concurrent_insert = 2 table_lock_wait_timeout = 30 read_rnd_buffer_size = 4m bulk_insert_buffer_size = 16m query_cache_limit = 4m query_cache_size =

jquery - How to resolve Javascript error "Type is Undefined"? -

hi please tell me how resolve javascript error 'type' undefined in 'microsoftmvcajax.js' please help. we need see @ least code before can sure of giving answer; simple typo in code. assuming isn't, guess you're trying run js code on page load, before ms library has been loaded, it's throwing error because you're referencing object in library javascript doesn't yet know about. if case, you'll need defer bit of code running until library loaded. there should standard way of doing specified library.

objective c - NSPopUpButton placeholder value? -

Image
notice in xcode's symbols list (the nspopupbutton directly above editor, right of edited documents), shows <no selected symbol> when you're out of scope of symbols lists, when click on option not there. there trick making "placeholder" magic happen, or there setter somewhere i'm not seeing? if you're using bindings, can set null/no selection placeholders , turn on "inserts null placeholder" using interface builder's bindings inspector. if you're not using bindings, can put whatever menu item in there @ runtime.

php - sorting database result object (array) according to months -

i have database has newsletter entries want arrange according months. db has following fields id, title, description , date. date has full date e.g. 2007-02-01 15:26:02. want arrange newsletters according corresponding month e.g want have this november 2010 title of newsletter title of newsletter ... till title of november 2010 newsletters printed out december 2010 title of newsletter ... till title of november 2010 newsletters printed out and on. please me code achieve or give me idea on how go it. select * db order month(date) 'd' desc group month(date) this query looking for, rest pretty basic php/sql should able guide or , apply it.

.net - WP7 AutoCompleteBox going crazy -

good morning all, i’m wondering, since last wp7 sdk update there’s new autocompletebox included in ns: microsoft.phone.controls. using system.windows.controls.autocompletebox, , saw new 1 told myself “hey! phone oriented autocompletebox ! let’s replace oldy one”. thing that, buggy… doesn’t seem work @ all, when click on it, type letter autocompletion, choose value text property gets filled alright but keyboard never goes off (either after taping elsewhere or switching screen)…. has big flaw… textchanged event never triggered… either there’s wrong in update, or emulator going nut. did run already? if not, suggestions anyway? thanks in advance, cheers miloud b. the november update silverlight toolkit windows phone first time "official" autocompletebox has been made avaialble phone. the sample on codeplex works fine me. can confirm versions using. also, how , why wiring textchanged event handler? this how did it: xaml: <toolkit:autocomplete

Problem binding data to controls in dynamically created wpf TabItem -

i having problem putting data controls on wpf tabitem. have defined several datatemplates in xaml. here 1 of them: <window.resources> ... <datatemplate x:key="memotab"> <textbox name="memotextbox" horizontalalignment="stretch" verticalalignment="stretch" acceptsreturn="true" /> </datatemplate> ... </window.resources> i create new tab in code behind follows: tabitem tab = new tabitem(); tab.header = "memo"; tab.contenttemplate = (datatemplate)findresource("memotab"); tab.applytemplate(); system.windows.controls.textbox tb = (system.windows.controls.textbox)tab.template.findname("memotextbox", tab); if (tb != null) tb.datacontext = memo; //string memo created earlier linq query tabcontrol.items.add(tab); //tabcontrol xaml defined the problem tb null, , therefore no data appears in text box (the text box shows in tab , functional) i not use xaml create

CSS, selector in table -

i looking für css-way set td-attributes in tables special id. i tried this: table.myid > tr > td {....} but seems 2 level parent-relation not working. any ideas?? wont set class-ids in every td! you using class , not , id. i guess dont have tables tables, try simplest relantioship between elements table#myid td {....} it free problems occuring because of "tbody" elements , on.

java - NoClassDefFoundError found! -

import java.io.*; public class arrayapp{ public static void main(string[] args){ system.out.println("lllll"); } // end main() } // end class arrayapp i error when run application after compiling it. exception in thread "main" java.lang.noclassdeffounderror: arrayapp caused by: java.lang.classnotfoundexception: arrayapp @ java.net.urlclassloader$1.run(urlclassloader.java:202) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:190) @ java.lang.classloader.loadclass(classloader.java:307) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:301) @ java.lang.classloader.loadclass(classloader.java:248) not find main class: arrayapp. program exit. you need make sure class file in classpath. assuming using default package (i.e. no package declaration), need tell java find class when run it. let's assume arrayapp.c

Using Amazon cloud - do I need a NA location? -

if have files hosted on amazon s3, why need use cloud north america? wouldn't download s3? s3 has multiple regions. there four . each s3 bucket in specific region. if you're using ec2 lowest prices (free bandwidth) , best performance (latency , bandwidth) if use s3 bucket in same region ec2 instance.

java - Support for @ElementCollection in hibernate tools hbm2ddl -

i trying use jpa2 feature @elementcollection list of strings in entity. using hibernate3-maven-plugin carry out hbm2ddl task. however seems version of hibernate tools used plugin not know how deal @elementcollection annotation can give me pointers version of hibernate tools need use not case. should case of specifying correct version of hibernate tools? <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>hibernate3-maven-plugin</artifactid> <version>2.2</version> <dependencies> <dependency> <groupid>postgresql</groupid> <artifactid>postgresql</artifactid> <version>8.3-603.jdbc4</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-tools</artifactid> <version>3.2.4.ga</version> <type>jar</type> <scope>runtime</scope> <

performance - Multiple GLES contexts, one framebuffer (iOS) -

i'm doing ios app have black box rendering library has own eaglcontext , framebuffer , it's own rendering. need additional rendering outside black box lib. up until i've been doing reading, setting , restoring pertinent states each frame. works, fiddly , hard maintain. occurred me, "why not have separate eaglcontext instead?" i've implemented second context, i'm switching contexts instead of setting/restoring states each frame. problem i'm getting lots of visual artifacts , performance went rock solid 30 fps 5 fps... so apparently i'm not meant render same framebuffer several contexts. can confirm this?

popupwindow - Problems creating a Popup Window in Android Activity -

i'm trying create popup window appears first time application starts. want display text , have button close popup. however, i'm having troubles getting popupwindow work. i've tried 2 different ways of doing it: first have xml file declares layout of popup called popup.xml (a textview inside linearlayout) , i've added in oncreate() of main activity: popupwindow pw = new popupwindow(findviewbyid(r.id.popup), 100, 100, true); pw.showatlocation(findviewbyid(r.id.main), gravity.center, 0, 0); second did exact same code: final layoutinflater inflater = (layoutinflater)this.getsystemservice(context.layout_inflater_service); popupwindow pw = new popupwindow(inflater.inflate(r.layout.popup, (viewgroup) findviewbyid(r.layout.main) ), 100, 100, true); pw.showatlocation(findviewbyid(r.id.main_page_layout), gravity.center, 0, 0); the first throws nullpointerexception , second throws badtokenexception , says "unable add window -- token null not valid&qu

gis - GPS application with downloadable Maps -

i looking map application following: windows based. city/town street maps downloaded computer (i.e. not required wireless internet connection map images real-time). uses gps on computer via comport. allows me visually track on map drive around. we have written our own gps application uses esri shapefiles. periodically complaints customers saying gps "delayed" (i.e. icon showing current location 2-3 blocks behind true location). to isolate whether might hardware related or our software, test alternative applications see if have same delay. i used microsoft streets , trips on couple of road trips. mid-level package comes gps receiver.

iphone - changing uifont color in a table cell -

i trying change color of cell using following code, displays cell's white font instead of gold rgb color code have. if (row == 0) cell.detailtextlabel.text=@"an blah blah"; cell.textlabel.textcolor = [uicolor colorwithred:139 green:136 blue:120 alpha:1]; you're setting on wrong label, should work: cell.detailtextlabel.text=@"an blah blah"; cell.detailtextlabel.textcolor = [uicolor colorwithred:139/255.0f green:136/255.0f blue:120/255.0f alpha:1];

portal - FileMaker Pro pop up values from related table -

Image
i have portal in contacts table layout shows related mention in second "mentions" table. related table has relationship third "sources" table want user select when view data in "mentions" portal of "contacts" layout. works part. problem comes when user changes "source" in portal attempts change "source" in next portal row t change "source" last select source regardless make selection any ideas ? here screen shots of how have setup portal , specified field and field control setup and relationship you modifying value of source field in sources table, not want. want use data populate value list , store serial number of source (or source text) in mentions table. 1) create value list sources using values sources field. 2) create new field in mentions table called 'source.' 3) add field portal , remove current sources field. 4) apply value list new field.

EDIFACT How to group, spilt, sort and sum up values from a EDI string into variables in VB.NET -

i new vb.net 2008. have tricky task resolve, regarding extracting characters (values) long string, extracted values text shall summed , sorted keywords, reformatted , saved csv file. it looks longer : unh+ram6957'company1by500c10'zew+reqest6957'company2sl200c20'company1sl300c10'zew the values seperated ' . as first step splitted string make readable, used function like: dim lineoftext string dim integer dim arytextfile() string lineoftext = p_edi arytextfile = lineoftext.split("'") = 0 ubound(arytextfile) console.writeline((arytextfile(i))) next now result looks like: unb+unoa:1+ccp:zew+ste:zew+100901:1200+2010917283 unh+m000001+ordrsp:d:96a:un:egt102 bgm+02g::zew+nomres24364+34 dtm+z05:0:805 dtm+137:201009011000:203 dtm+z01:201009090400201009100400:719 rff+ahi:gscompany1 nad+zso+ccp::zew nad+zsh+gsstatkraft::zew tdt+41g++70 loc+z11+:::ttf lin+1+23 loc+z11+:::ttf qty+z05:0:kw1 dtm+2:20100909040020

iphone - Some questions about bitwise operators -

i read bitwise operators today , seem rather handy me. noticed apple uses them too, example uiviewautoresizing . in app need keep track of 7 days of week. each day can either enabled or disabled. used have 7 bool 's, i'm trying use single integer this: enum { daysmonday = 1 << 0, daystuesday = 1 << 1, dayswednesday = 1 << 2, daysthursday = 1 << 3, daysfriday = 1 << 4, dayssaturday = 1 << 5, dayssunday = 1 << 6 }; typedef nsuinteger days; my question is, how can enable/disable values now? know can check variable days specific day this: if (days & daysthursday) { // thursday enabled } but how i.. enable thursday? disable thursday? toggle thursday? enable all? disable all? thank you. i'm not familiar objective-c, here basics when dealing bitwise operators. enable thursday days = days | daysthursday; disable thursday alldays = daysmonday | daystuesday | ...

asp.net - Quarantine SQL Server queries in .net 3.5 -

alright, have 2 database servers, 1 owned us, 1 owned partner. our partners have been having issues lately have been causing numerous sql timeout errors, takes down our whole system. we'd prefer limit time queries can take 20 seconds max, otherwise quit trying , throw error (which can catch try/catch block). couple of questions: is there way set particular db/connection string timeout after x seconds? is best way quarantine other system? or there better ways go this? thanks dumb question - commandtimeout in connection string suffice needs.

actionscript 3 - How do I access all of the children of a DisplayObject programatically? -

how access of children of displayobject using code? (i'm looking movieclip.children ) i'm using in 2 cases: 1) loop through , reposition of children of enclosing movieclip. or 2) loop through , delete of children of movieclip also, flash cs5 project. this loop touch every child inside movieclip foo. i'm not sure you're going them, can run whatever methods need inside loop. for (var i:uint=0; i<foo.numchildren;i++){ foo.getchildat(i).whatevermethodyouneed(); }

c# - can i detect desktop changing to do screen capture -

i'm in process of creating desktop screen capture application. i'm using timer poll screen changes. can detect if desktop has changed through windows api? as far know there no easy api this. way more efficiently use mirror driver capture screen events (e.g., way remote desktop it). you try ultravnc mv2 mirror driver: http://www.uvnc.com/products/mirror-driver.html

search - Finding where source has branched from git -

i have git repository (covering more or less project history) , separate sources (just tarball few files) have forked time ago (actually somewhere in 2004 or 2005). the sources tarball have undergone quite lot of changes i'd incorporate some. question - how find out branch point changed sources minimal diff of has happened there. so want find place in git history, code similar tarball of sources have. , don't want manually. it worth mentioning changed sources include subset of files , have split files more. code in there seem small modifications , several additions. if want play yourself, tarball sources here , git hosted @ gitorious : git://gitorious.org/gammu/mainline.git in general case, you'd have examine every single commit, because have no way of knowing if might have huge diff in one, small diff next, huge diff, medium diff... your best bet going to limit specific files. if consider single file, should not take long iterate through versions of

asp.net - Error when adding service on server -

i have created restful service. on client can run service out no error. trougth server error. this error message: this collection contains address scheme http. there can @ 1 address per scheme in collection. parameter name: item here solutions this. http://syedemad.wordpress.com/2009/05/29/wcf-this-collection-already-contains-an-address-with-scheme-http/

java - Restlet On Android - Issues with serialization -

i trying retrieve serialized classes using restlet 2.1 android client , gae server. relevant code: clientresource cr = new clientresource("http://localhost:8888/mydata"); // mydata object mydataresource resource = cr.wrap(mydataresource.class); mydata mydata = resource.retrieve(); i tested in standalone jse class, , worked fine. when try run same thing in android, mydata object null. ideas? you can check here android specificities: restlet android page i spent few hours before understand problem well, need explicitly register jackson convertor : engine.getinstance().getregisteredconverters().add(new jacksonconverter());

objective c - Book App Tutorial iphone -

totally beginner in programming. played bit xcode. but question is: how make application book pictures, texts , sounds, , when children change page, image, text , sound in context? need find tutorial or if wants teach us. want teach do, walk our own legs after. thank attention , help. there no tutorial covers everything but there tons of documentation provided apple introduction objective-c programming language getting started ios your first ios application itunes u: stanford — developing apps ios paul hegarty itunes u: stanford — iphone application development alan cannistraro , josh shaffer and search box on stackoverflow.com (upper right)

node.js - direct (non-tcp) connection to redis from nodejs -

hello all looked @ at redis-node-client source (relevant part shown bellow) , see connects redis via 'net' package, tcp based. line 370 exports.createclient = function (port, host, options) { var port = port || exports.default_port; var host = host || exports.default_host; var client = new client(net.createconnection(port, host), options); client.port = port; client.host = host; return client; }; i wondering if there's more direct client redis, preferably via domain-sockets or of sort. im using redis localy, cache, without going on wire unnecessary encode/decode messages tcp headers... thank you unix domain socket support appears have landed in redis of nov 4th. http://code.google.com/p/redis/issues/detail?id=231 to connect unix domain socket, need supply pathname net.createconnection. maybe in redis-node-client: exports.createsocketclient = function (path, options) { var client = new client(net.createconnection(path), options); client.pa

c# - order of execution of try catch and finally block -

i having big confusion order of try, catch , block execution. i want know when should use try catch block , should put in try catch block, want know if exception comes in try block if action taken corresponding try block 1 executed first catch or (which executed), , after execution of these 2 does control return try block or abandon forever. if have ( note: not valid c#, see below valid example): try { // ... code: } catch(...) { // ... exception code: b } { // code: c } code going executed. if goes (i.e. no exceptions thrown while executing), going go finally, code c going executed. if exception thrown while executed, go b , c. as example, here's valid c# code block http://msdn.microsoft.com/en-us/library/dszsf989.aspx : public class ehclass { void readfile(int index) { // run code, substitute valid path local machine string path = @"c:\users\public\test.txt"; system.io.streamreader file = new system.io.st

html - How do I include an external file in PHP? -

i need include , external file on url. example google.com. have tested include using local files, works, if try , use 127.0.0.1/filetoinclude.txt nothing happens. don't error, blank page. how supposed include http://google.com in page? i have no idea why you'd want this, try like: <?php $google_page = file_get_contents('http://www.google.com'); echo $google_page; ?>

windows - Perpend X Number of Lines in a File with PowerShell -

i'm stuck on problem i'm working on text file. file flat text file dates have been added, in other words simple log file. problem "i need comment out number of lines, number passed param". part i'm hung on actual commenting out x number of lines part (lets # added). can read , write files, read lines , write lines search string can't seem figure out how edit x number of lines , leave other lines alone. ps in actuality doesn't matter if lines @ end of file or beginning, though nice understand method on how add beginning or end gc .\foo.txt | select -first 3 | %{ "#{0}" -f $_ } gc .\foo.txt | select -skip 3

Sitecore: How do I retrieve the 'Display Name' in XSLT -

i've tried <sc:text field="display name" /> and <xsl:value-of select="sc:fld('display name',.)"/> and <xsl:value-of select="sc:field('display name',.)"/> various different case , spacing. all can find online examples of how retrieve in .net code sitecore.context.item.displayname am missing obvious? has been bothering me while. most standard fields on sitecore item prefixed double underscores. believe you'll find value on "__display name".

Flip View in ipad -

i having button on view clicking on next view should open in flip view. can me?? i'm going assume view managed view-controller, , view want flip-in. a relatively easy way present new view using presentmodalviewcontroller:animated: myviewcontroller* mvc = [[[myviewcontroller alloc] init] autorelease]; mvc.modalpresentationstyle = uimodalpresentationfullscreen; mvc.modaltransitionstyle = uimodaltransitionstylefliphorizontal; [self presentmodalviewcontroller: mvc animated: yes];

iphone - set border for grouped UITableView -

i want set border uitableview. dont want seperators highlighted. if set clear clor seperator, border table set clear color. want black colored border table. how this? please help. try code. also import quartzcore framework tableview.layer.borderwidth=4.0; tableview.layer.bordercolor=[[uicolor blackcolor]cgcolor];

android - Click LinkText To Open A activities -

in android have textview, type "hello kello kie hambery " want when click on kello pass kello activity , when click on hambery pass hambery activiy i supposed use multiple textviews form sentence. words want clicked, add onclicklistener , have open correct activity.

language agnostic - Does this higher order function have a name? -

i see pattern everywhere in code, , in libraries, yet there appears no name or abstraction of can find anywhere. example (pseudocode) t foo( t x, void f(t&) ) { t y = x; f( y ); return y; } basically: take value, , function transforms value. make of copy of value, transform it, , return it. real-life examples (c++) t operator+(const t& x, const t& y) { t z = x; // make copy operator+=(z, y); // modify in place return z; } vector3 vector3::normalized() const { vector3 x = *this; // make copy x.normalize(); // modify in place return x; } t sorted(t const& x) { t y = x; // make copy (yeah, yeah, have passed value) sort( y ); // modify in place return y; } basically, have in place function (with side-effects) , make out-of-place function (without side-effects) out of it. is there name pattern? know of libraries or languages use it? functional languages won't use because don't have referentially opaq

php 5.3 - Error message: Fatal error: Can't use function return > value in write context in -

i trying run code book . there appears problem code. here error message: fatal error: can't use function return value in write context in /applications/mamp/htdocs/eclipse-workspace/simpleblog/test.php on line 24 here code referenced in message (starting on line 24) if (!empty(trim($_post['username'])) && !empty(trim($_post['email']))) { // store escaped $_post values in variables $uname = htmlentities($_post['username']); $email = htmlentities($_post['email']); $_session['username'] = $uname; echo "thanks registering! <br />", "username: $uname <br />", "email: $email <br />"; } i appreciate help. please let me know if need provide more information thanks lot guys. fast. solution works great. the problem empty() function needs applied direct v

What is the 'hidden' limit on file name length when using an ASP.NET FileUpload control? -

i have fileupload control, , when select file 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.txt' , (which can create in windows no problem), saying not have file when postback. it works fine smaller file names. what's going on? this happen if try save file in folder on server side (like temp folder in c:\documents , settings\blabla...\temp) , exceed max_path limit of 255 characters while on client file located @ root , max_path not reached.

iphone - A question of objective-C protocol -

i try learn protocol of objective c. write 2 files, first 1 firstviewcontroller.h, , in there protocol "print". declare firstviewcontroller class in successviewcontroller delegate method "print". question why console output "c". why can not "b" output? why protocol method did not perform? #import <uikit/uikit.h> #import "firstviewcontroller.h" @interface successviewcontroller : uiviewcontroller <firstviewcontrollerdelegate> { } @end #import "successviewcontroller.h" #import "firstviewcontroller.h" @implementation successviewcontroller - (void)viewdidload { firstviewcontroller *firstviewcontroller= [[firstviewcontroller alloc] init]; firstviewcontroller.delegate=self; nslog(@"c"); [super viewdidload]; } -(void) print{ nslog(@"b"); } @end #import <foundation/foundation.h> @class firstviewcontroller; @protocol firstviewcontrollerdelegate <nsobject> - (voi

c# - timer on thread? -

can create timer clock on thread? i'm creating 1 doesn't seem work well. app multi-thread app has start timer on thread when ever event happens. timer placed in every client connection. clock doesn't work until close winform(i don't know why) . there in particular should know timers in threads ? here timer code : timer1.interval = 1000; timer1.tick += new eventhandler(timer_tick); timer1.enabled = true; timer1.start(); you might try use system.threading.timer , timer that's in separate thread. might consider using waithandle that's never fired , using waitone(1000, false) wait second.

Hibernate: how to map one-to-many with another database? -

have 2 classes: user , message. 1 user can have several messages. i.e. association one-to-many. users table in first database , messages table in second database. how can map them? my users , messages tables mapping: <hibernate-mapping> <class name="com.example.hibernate.user" table="users" lazy="false"> <id name="xid" type="int" column="xid" > <generator class="increment"/> </id> <set name="messages" inverse="true" table="messages"> <key> <column name="xsin_id" not-null="true" /> </key> <one-to-many class="com.example.hibernate.message" /> </set> </class> </hibernate-mapping> <hibernate-mapping> <class name="com.example.hibernate.message" table="messages" l

Problem in accessing a project from another in same solution in Visual Studio -

i have windows service project added few other projects. added references , can access them. when build, says "does not exist" remove reference , add again , can access it, still fails when build , can't access later. clue happen form? a few things check: where web service built to? might check not getting deployed \bin folder has contents deleted on rebuild. is added web reference or reference directly assembly?

c - foward typedef structures -

gcc 4.4.4 c89 i have in header file. port.h struct struct_tag; int initialize_ports(struct_tag *port); in implemenation file have this: port.c typedef struct struct_tag { int port_id; } port_t; and in driver.h file, have following: #include "port.h" int initialize_ports(struct_tag *port) { port = malloc(sizeof *port); /* checking here */ } i have forward declared structure, want hide internal elements. however, getting following error on initialize_ports in header file: expected ‘)’ before ‘*’ token i wondering how can forward declare , able pass structure parameter? many advice, as other answers have noted, could change struct_tag struct struct_tag in prototype. way of getting code compile write typedef struct struct_tag struct_tag; in place of existing struct struct_tag; (i.e. combine typedef forward definition). allow write int initialize_ports(struct_tag *port) without compile failures. however, still not qui

Locking several SQL Server records -

my scenario this. have single entity composed of several rows in several tables. conceptually can seen single document. when user opens "document", associated rows must locked, windows locks file when opened. "document" may open until user chooses close it, don't think transactions viable solution. solution have come have boolean 'locked' field in every table , set true on relevant rows when "document" opened. i'm using sql server 2008 r2. any ideas? assuming each document has unique id, portable solution use single table knows every locked document: create table documentlocked ( doc_id int primary key, session_id <some type>, lock_acquired datetime ); when want lock document, try insert id of document in question along session id identifying owning session , time locked it. if fails, document locked. session id , lock_acquired columns don't play role in locking. helps display useful information user

extjs - Why does insertHTML('text') render as "undefined"? -

Image
when execute following extjs code, shows me "undefined" instead of text want insert div. result how insert html extjs element? <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"> <style type="text/css"> body { padding: 20px; } div#message { margin: 10px 0 0 0; } </style> <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext/ext-all-debug.js"></script> <title>simple extjs</title> <script type="text/javascript"> ext.blank_image_url = 'ext/resources/images/default/s.gif'; ext.onready(function() { console.info('check

animation - Which is better java + OpenGl or C++ OpenGl? -

i not have experience regarding #d animation. 1 better java open gl or c++? diffrence between java 3d , opengl? "which 1 better" needs metric possible answer. if performance metric, answer c++ , opengl. (among other things) because calls between java , native can little bit more time-consuming, , c++ has arrays more in line opengl expects. but if metric how java developer able make reasonable performance, answer java + opengl. java3d higher level api opengl.

c# - web service error: operation with parameters cannot be found -

i trying consume .net webservice cold fusion. methods having simple types working fine. having problems 1 particular method accepts byte[] array input. below sample webmethod declaration [webmethod] public avstatus scanstream(byte[] fileobject) { // code } and cold fusion code consuming service is <cffile action="readbinary" file="#filename#" variable="filedata"> <cfset b64file = #tobase64(filedata)#> <cfinvoke webservice = "http://xxx/scanservice.asmx?wsdl" method = "scanstream" returnvariable = "result"> <cfinvokeargument name="fileobject" value="#b64file#" /> </cfinvoke> this leads error web service operation scanstream parameters cannot found . can me out this? it seems binary data has been exposed bas64 string in coldfusion while byte[] exposed service xml array (of bytes

android - What is getVoiceMailAlphaTag() for? -

i saw method telephonymanager.getvoicemailalphatag() have no idea it's for. javadocs useless. in situations helps use source® - imho huge advantage of android on other platforms. on gsm phones gets down simrecords . apparently (after googling) alpha tag voicemail name mobile operator uses voicemail. if not set defaults "voicemail" in english this data (voicemail alpha tag & voicemail number) stored inside sim , set operator.

Cross-domain iframe to insert cookie -

i need track visitors websites own using same script. i own both example.com , site.com i want insert site.com/track.aspx in example.com using iframe. track.aspx insert flash-cookie visitor machine , save data db. how it? can achieve same result without using iframes? this re-redirect mechanism. track.aspx write cookie site.com domain, want cookie can read in example.com domain (i assume) create page in example.com writes cookies , redirects site.com create page in site.com redirects example.com have site.com/firstpage.aspx redirect example.com/writecookie.aspx?val=abc have example.com/writecookie.aspx write cookie , redirect site.com/track.aspx stick site.com/firstpage.aspx iframe, , let it's re-redirecting.

iphone - Bytes to KiloBytes -

i retrieving size of files in document directory. using method attributesofitematpath so. successful. getting output in form of bytes , of class nsnumber . does'nt good. so, need output in kbs or mbs , have convert them nsstring in order store in nsdictionary have display in tableview. please me so. thank you. here code.. directorycontent = [[nsmutablearray alloc] init]; (nsstring *path in paths){ filesdictionary =[[nsmutabledictionary alloc] init]; filessize = [[nsnumber alloc] init]; filessize = [filesdictionary objectforkey:nsfilesize]; filesdictionary = [nsdictionary dictionarywithobjectsandkeys:filessize, @"filessize", nil]; [directorycontent addobject:[filesdictionary copy]]; } and using following code bind size in tableview not working. cell.lblsize.text = (nsstring *) [[directorycontent objectatindex:listindex] objectforkey:@"filessize"]; help me convert size of file byte kilobyte , display in tableview. thank in advance..

How do you share common methods in different grails controllers? -

currently when need share method processparams(params) between different controllers, use either inheritance or services. both solution has inconvenients : with inheritance, cannot use multiple inheritance means need have of controller utility methods in 1 place. , also, there bug in grails not detect code changes in base controller classes in development mode (you need restart app) with services, don't have access injected properties params, session, flush... so question : there other way use common methods accessible multiple controllers ? one option write common methods category, mix controllers necessary. gives lot more flexibility inheritance, has access stuff params, , code simple , understandable. here's tiny example: @category(object) class mycontrollercategory { def printparams() { println params } } @mixin(mycontrollercategory) class somethingcontroller { def create = { printparams() ... } def s

.net - Load testing strategies for network server applications -

i building windows service listens connections on tcp and, once connection established, sends steady stream of data. simple... once initial request made, communication one-way (on application layer, of course). what way test significant load, 3,000 simultaneous connections? there standard tools kind of thing, or should write own? i have feeling have written own protocol, think you're stuck implementing own load testing client. writing load testing client isn't hard. thing advise though think whether you're going test on connection 1 physical machine or multiple. i'm not saying should test 3,000 physical machines, 10 or 20 machines idea. otherwise have chance client machine being bottleneck. also, test server, have have load test implementation. if see processor usage of load tester staying @ 100%, you're not testing server; you're testing client.

need help accessing data coming off a callback C# .NET -

i'm @ wits end trying solve issue. i have function in class such public class receivedata { dataprovider provider = new dataprovider(); public void responsedata() { foreach(string anitem in thelist) { // alldata function declared in class dataprovider string result = provider.alldata(anitem); } //do } } that's simple. however, if alldata function had make async function calls data? meaning, say public class dataprovider { myserviceclient client = new myserviceclient(); public string alldata (string myitem) { client.formatteddatacompleted += new eventhandler<formatteddatacompletedeventargs>(client_formatteddatacompleted); client.formatteddataasync(myitem); } void client_formatteddatacompleted(object sender, formatteddatacompletedeventargs e) { // here's response comes back. } as can see, cant call alldata function , directly