Daily Archives

Articles indexed Wednesday May 12 2010

Page 21/121 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Re-use of database object in sub-sonic

    - by cantabilesoftware
    Yet another newbie SubSonic/ActiveRecord question. Suppose I want to insert a couple of records, currently I'm doing this: using (var scope = new System.Transactions.TransactionScope()) { // Insert company company c = new company(); c.name = "ACME"; c.Save(); // Insert some options company_option o = new company_option(); o.name = "ColorScheme"; o.value = "Red"; o.company_id = c.company_id; o.Save(); o = new company_option(); o.name = "PreferredMode"; o.value = "Fast"; o.company_id = c.company_id; o.Save(); scope.Complete(); } Stepping through this code however, each of the company/company_option constructors go off and create a new myappDB object which just seems wasteful. Is this the recommended approach or should I be trying to re-use a single DB object - and if so, what's the easiest way to do this?

    Read the article

  • How to dismiss the MFMailComposeViewController in cocos2d ?

    - by srikanth rongali
    I have changed my code to this way. Now mail controller is opening in landscape mode. But the problem is If I touch on cancel button or send button the mail controller is not dismissing its view. How can I do it ? -(void)goToFirstScreen:(id)sender { NSLog(@"goToFirstScreen: "); CCScene *Scene = [CCScene node]; CCLayer *Layer = [EmailScene node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] setAnimationInterval:1.0/60]; [[CCDirector sharedDirector] pushScene: Scene]; } Th EmailScene class is #import "EmailScene.h" #import "testOfEnd.h" @implementation EmailScene - (id) init { self = [super init]; if (self != nil) { [self displayComposerSheet]; } return self; } -(void)displayComposerSheet { [[CCDirector sharedDirector] pause]; picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [[[CCDirector sharedDirector] openGLView] addSubview:picker.view]; [[CCDirector sharedDirector] stopAnimation]; [picker presentModalViewController:picker animated:YES]; [picker release]; } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [[CCDirector sharedDirector] resume]; //dismiss view after otherwise the code is not executed [picker.view removeFromSuperview]; [[CCDirector sharedDirector] startAnimation]; [picker dismissModalViewControllerAnimated:YES]; //return to previous scene CCScene *Scene = [CCScene node]; CCLayer *Layer = [testOfEnd node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] replaceScene:Scene]; } @end Thank You.

    Read the article

  • what kind of credentials/prerequisites do you need to be a professional penetration tester ?

    - by dfafa
    does it take more than knowing Bt4 ? are there any one that just runs a scanner and no real labor involved ? would you be expected to be able to code your own exploits without having to dl from milw0rm and discover entry into a system by yourself, in other words, do you have to think outside the box even when there's so many tools that makes the job a lot easier ? would you ever be expected to be able to write your own scanners, exploits and etc ? i am also curious how people are able to write long pages of hex address, that magically causes some type of memory overflow...how are people guessing at the hex values for game hacks for instance ? are certification important ? what about formal school education ? I am a CS major.

    Read the article

  • Add objects to NSDictionaryController

    - by kaile
    I have an NSTableView which is bound to an NSDictionaryController. I have set this and the content dictionary through the interface builder. The question I have is, how do I add objects to the dictionary in a manner that the controller will see it automatically and display it in the table. I've seen in examples about NSArrayController that you add the new objects through the controller rather than the actual array so the controller sees the change. However, I don't see a similar way of doing this with the dictionarycontroller... Thanks for the help.

    Read the article

  • Why do my 3GP videos not play audio using VLC?

    - by GiH
    I have a Nexus One phone and when I record video the container seems to be 3GP. When I try to playback using VLC I'm getting no audio, and an error saying that there is nothing I can do because VLC does not support the "samr" codec. Is there really nothing I can do to watch my videos on VLC? If not, whats the alternative? I really like VLC specifically because I never have to download codecs...

    Read the article

  • DVD ripper for Windows

    - by Shawn Miller
    I am looking for a good DVD ripper software for Windows. Looking for something that will easily rip the raw bits DVD to hard drive without any loss of quality. Looking for something that will easily copy the VOB files to a server location for use with the Window Media Center DVD Library feature.

    Read the article

  • Passing optional parameter by reference in c++

    - by Moomin
    I'm having a problem with optional function parameter in C++ What I'm trying to do is to write function with optional parameter which is passed by reference, so that I can use it in two ways (1) and (2), but on (2) I don't really care what is the value of mFoobar. I've tried such a code: void foo(double &bar, double &foobar = NULL) { bar = 100; foobar = 150; } int main() { double mBar(0),mFoobar(0); foo(mBar,mFoobar); // (1) cout << mBar << mFoobar; mBar = 0; mFoobar = 0; foo(mBar); // (2) cout << mBar << mFoobar; return 0; } but it crashes at void foo(double &bar, double &foobar = NULL) with message : error: default argument for 'double& foobar' has type 'int' Is it possible to solve it without function overloading? Thanks in advance for any suggestions. Pawel

    Read the article

  • jQuery + External javascript: How to embed videoplayer in div

    - by Dennis
    I just started with jQuery and so far I have a really good impression of the framework. But now I have a problem that I can't figure out on myself. I want to embed an external javascript file that loads a videoplayer and displays it. If I include the <script>...</script> directly in HTML it loads just fine. But when I try to load it with jQuery it has very different behaviors in several browsers but it doesn't work in a single one. Either the player is not loaded at all or it doesn't update the selected div but reloads the player on a blank page. This is the source: <html> <head> <style type="text/css"> div#test { width: 100%; height: 500px; margin: 10px auto; padding: 5px; border: 1px solid #777; background-color: #fbca93; text-align: center; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ var video = "<script type=\'text\/javascript\' src=\'http:\/\/www.physicalfitnet.com\/video_syndication\/embed\/jssingle.aspx?vid=651&pub=9DF8233261D101B86368400385B8FF2E\'><\/script>"; $("div#test").html(video); }); </script> </head> <body> <div id="test"> Hi</div> </body> </html> I uploaded everything to http://kernast.de/test ... any help is appreciated. THX

    Read the article

  • Mootools Form Post Problem, Abort increasingly+1 with each request

    - by Naresh
    Hi all, i'm using Mootools 1.2. Ihave 15 Forms with same name only change in their id's like form1, form2, form3, ... ,form15 same with their elements. i need to submit all forms by ajax. For that purpos i make a function and call them on each functions onClick event. function is function addStepConfiguration(id,mystrip,comment,error,submitid,i) { $(id).addEvent('submit', function(e) { e.stop(); $(submitid).setStyle('display','none'); loading_Img(i); this.set('send', { onComplete: function(responseText) { $('loading_img'+i).innerHTML = ''; SplittedResText = responseText.split("|"); if(SplittedResText[1]=='undefined') { $(error).innerHTML=SplittedResText[0]; } else { $(comment).innerHTML=SplittedResText[0]; $(mystrip).set('class',SplittedResText[1]); removeMsg.delay(20,'',error); removeMsg.delay(1500,'',comment); } $(submitid).setStyle('display','block'); } }); this.send(); }); } When i submit a form say first one then it submitted and give response normally, but in second time without page refresh, it abort the request one time. in third attempt it abort 2 times..then go on +1 each time. It gives no error, just abort and again request automatically. i can't understand what is the problem. please any one can help me.

    Read the article

  • How Manage Big Linq DataContext ?

    - by Rev
    Hi The major problem in .net programs is "How manage memory for best performance". so Microsoft use garbage collector in .net and with that, we don't need to do something for managing memory(or better say we can use GC easily) But when you develop big project(business app), you make too many tables and database for your own project. so if you use Linq-to-sql, we must build DataContext include hundred or more tables. That make problem for program when you create an object from datacontext, that object give big amount of memory. also we cant divide datacontext to datacontexts(cuz relation between tables) so "How manage datacontext and memory"?

    Read the article

  • Classes with the same name - is it restricted only within the same translation unit?

    - by LeopardSkinPillBoxHat
    Let's just I had the following code: foo.h class Foo { // ... }; foo.cpp #include "foo.h" // Functions for class Foo defined here... Let's say that Foo are built into a static library foo.lib. Now let's say I have the following: foo2.h class Foo { // ... }; foo2.cpp #include "foo2.h" // Functions for class Foo defined here... This is built into a separate static library foo2.lib. Now, if I re-link foo.lib and foo2.lib into an executable program foo.exe, should it be complaining that class Foo has been defined twice? In my experiences, neither the compiler or the linker are complaining. I wouldn't be expecting the compiler to complain, because they have been defined in separate translation units. But why doesn't the linker complain? How does the linker differentiate between the 2 versions of the Foo class? Does it work by decorating the symbols?

    Read the article

  • Testing Django web app with Hudson and Selenium

    - by ycseattle
    This might be a newbie question for Hudson. I am trying to setup Selenium testing for my Django website in my Hudson CI server. The question is, the Hudson will use subversion to checkout my Django code into its own path, how do I "deploy" the code into the same server for testing? This is not a question about deploying django, but instead how to access the source file in hudson workspace. Most tutorials/blogs is about building and running tests, but I couldn't find useful information about how to setup the web application on the server to run the test against. 1) Should I write some shell script to copy the source files from the hudson workspace? Is there an environment variable to use to access the workspace? 2) Is there a tutorial on how to grab web app files in hudson workspace and deploy them? I am sure this apply for other technologies like PHP as well. Thanks!

    Read the article

  • how to use session in iphone programming?

    - by jaydp
    Hi Friends, I made an iphone story book application. Suppose any user read story book and at half of the story book he/she close the apps. when he/she want to read again this application at a time ask for continue or start again. This is possible by using session but i don't know how to use session in iphone sdk. So, please help me about this problem. Thanks!

    Read the article

  • Pass parameter from page to ActiveX

    - by nCdy
    <object id="Bacs_DBTableRepX" classid="CLSID:CA8B72B3-3B15-40D7-9364-478E25AF5B41" codebase="Bacs_DBTableRepX.cab" style=" Z-INDEX: 102; LEFT: 20px; WIDTH: 1200px; POSITION: absolute; TOP: 80px; HEIGHT: 600px"> <param name="ax_Command" value='<%=GetText()%>'/> </object> Here is my try but it made no sense. Parameter had not being sent. Is there any examples how to sent parameter to my ActiveX or some mistakes in my code ?

    Read the article

  • The State of RDF in Ruby

    - by Daniel
    I'm wondering about the current support there is in Ruby for semantic web technologies. Is there good RDF options? It seems that the last surveys done were circa 2007 ( http://paul-classic.stadig.name/2007/10/26/the-state-of-rdf-support-in-ruby-2007/ ). Is Redland's RDF wrappers the best way to go for RDF support - all the other projects mentioned in that aging article seem to be unsupported or dropped. Is Ruby perhaps a bad choice if one which to pursue projects pertaining to the semantic web?

    Read the article

  • 450 Error with Postfix

    - by Shiv
    I have setup postfix to send outgoing mail, It works fine for most of the cases except for some e.g duke.alumni.edu where it gives me a 450 error, even though the email address is valid. This is the exact error I get Sender address rejected: Domain not found (in reply to RCPT TO command)) Any suggestions on how I can rectify this?

    Read the article

  • Is it better to always purchase as much as higher in Watts SMPS, for PC?

    - by metal gear solid
    Is it better to always purchase as much as higher in Watts SMPS, for PC? Does higer watts SMPS also consume more power (electricity bill)? How to know how much watts of SMPS we should purchase? What are factor who decide how much watt of power will need? I'm going to purchase a new Motherboard + CPU + HDD + RAM + DVD Wrtiter + SATA 500 GB HDD ? I'm not purchasing any external Graphic Card. How to decide which watt of SMPS ,I should purchase?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >