Search Results

Search found 3180 results on 128 pages for 'david sauter'.

Page 75/128 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • Where to start when programming process synchronization algorithms like clone/fork, semaphores

    - by David
    I am writing a program that simulates process synchronization. I am trying to implement the fork and semaphore techniques in C++, but am having trouble starting off. Do I just create a process and send it to fork from the very beginning? Is the program just going to be one infinite loop that goes back and forth between parent/child processes? And how do you create the idea of 'shared memory' in C++, explicit memory address or just some global variable? I just need to get the overall structure/idea of the flow of the program. Any references would be appreciated.

    Read the article

  • Create jQuery Slider Range With One Handle Not Using Min/Max

    - by David Savage
    Hey all, Is there any possible way to create a slider that will create a range similar to what is done with one handle using min/max, only instead of min/max, starting the range from say 50 (on a scale from 1-100)? I realize this will most likely require modification of the slider or creating a plugin, just wondering if anyone has done this already or knows how to go about it. I.e. something like this: http://jqueryui.com/demos/slider/rangemin.html Only, instead of the range going from the min, going off of where the handle is, and allowing the user to slide either left or right of that fixed starting point to create the range. Any help is appreciated, and I'd be glad to clarify what I need if that doesn't make sense! :)

    Read the article

  • Learning Lisp - Why ?

    - by David
    I really feel that I should learn Lisp and there are plenty of good resources out there to help me do it. I'm not put off by the complicated syntax, but where in "traditional commercial programming" would I find places it would make sense to use it instead of a procedural language. Is there a commercial killer-app out there that's been written in Lisp ?

    Read the article

  • Modifying my website to allow anonymous comments

    - by David
    I write the code for my own website as an educational/fun exercise. Right now part of the website is a blog (like every other site out there :-/) which supports the usual basic blog features, including commenting on posts. But I only have comments enabled for logged-in users; I want to alter the code to allow anonymous comments - that is, I want to allow people to post comments without first creating a user account on my site, although there will still be some sort of authentication involved to prevent spam. Question: what information should I save for anonymous comments? I'm thinking at least display name and email address (for displaying a Gravatar), and probably website URL because I eventually want to accept OpenID as well, but would anything else make sense? Other question: how should I modify the database to store this information? The schema I have for the comment table is currently comment_id smallint(5) // The unique comment ID post_id smallint(5) // The ID of the post the comment was made on user_id smallint(5) // The ID of the user account who made the comment comment_subject varchar(128) comment_date timestamp comment_text text Should I add additional fields for name, email address, etc. to the comment table? (seems like a bad idea) Create a new "anonymous users" table? (and if so, how to keep anonymous user ids from conflicting with regular user ids) Or create fake user accounts for anonymous users in my existing users table? Part of what's making this tricky is that if someone tries to post an anonymous comment using an email address (or OpenID) that's already associated with an account on my site, I'd like to catch that and prompt them to log in.

    Read the article

  • Facebook Like-button problem

    - by David
    Hi there, I'm using this code to implement the like button <fb:like layout="button_count" show_faces="false" width="450"></fb:like> But when I try to click it the counter is increased for about 1 second and then it goes back to zero again. I can't see on my facebook profile that i've liked something either. Someone have a solution for this? I'm using the newest JavaScript SDk in an Google App engine/ Django environment.

    Read the article

  • Android: Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView that was originally added here

    - by David Joyce
    I am receiving the above error when launching my application in version 3.1 in my tablet It works fine from 2.1 to 2.3 on phones The code it complains about is as follows: @Override protected void onCreate() { // Other logic here // .... showDialog(Constants.INTRODUCTION_DIALOG); } What is the problem here? I see other related threads but I don't see one similar to my problem on launch. Thanks

    Read the article

  • Count rows against to SQL server (2005) table?

    - by David.Chu.ca
    I have a simple question with two options to get count of rows in a SQL server (2005). I am using VS 2005. There are two options to get the count: SELECT id FROM Table1 WHERE dt >= startDt AND dt < endDt;; I get a list of ids from above call in cache and then I get count by List.Count. Another option is SELECT COUNT(*) FROM Table1 WHERE dt >= startDt AND dt < endDt; The above call will get the count directly. The issue is that I had several cases of exceptions with the second method: timeout. What I found is that the table1 is too big with millions of data. When I used the first option, it seems OK. I am confused by the fact that Count() takes more time than getting all the rows(is that true?). Not sure if the aggregation call with Count() would cause SQL server to create temporary table or cache on server side and it would result in slow performance when table is too big? I am not sure what is the best way to get the count?

    Read the article

  • How to Improve my php image resizer to support alpha png and transparent GIFs

    - by David
    Hi, I use this function to resize images but i end up with ugly creepy image with a black background if it's a transparent GIF or PNG with alpha, however it works perfectly for jpg and normal png. function cropImage($nw, $nh, $source, $stype, $dest) { $size = getimagesize($source); $w = $size[0]; $h = $size[1]; switch($stype) { case 'gif': $simg = imagecreatefromgif($source); break; case 'jpg': $simg = imagecreatefromjpeg($source); break; case 'png': $simg = imagecreatefrompng($source); break; } $dimg = imagecreatetruecolor($nw, $nh); switch ($stype) { case "png": imagealphablending( $dimg, false ); imagesavealpha( $dimg, true ); $transparent = imagecolorallocatealpha($dimg, 255, 255, 255, 127); imagefilledrectangle($dimg, 0, 0, $nw, $nh, $transparent); break; case "gif": // integer representation of the color black (rgb: 0,0,0) $background = imagecolorallocate($simg, 0, 0, 0); // removing the black from the placeholder imagecolortransparent($simg, $background); break; } $wm = $w/$nw; $hm = $h/$nh; $h_height = $nh/2; $w_height = $nw/2; if($w> $h) { $adjusted_width = $w / $hm; $half_width = $adjusted_width / 2; $int_width = $half_width - $w_height; imagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h); } elseif(($w <$h) || ($w == $h)) { $adjusted_height = $h / $wm; $half_height = $adjusted_height / 2; $int_height = $half_height - $h_height; imagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h); } else { imagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h); } imagejpeg($dimg,$dest,100); } Example : cropImage("300","200","original.png","png","new.png"); I use php 5.3.2 and the GD library bundled (2.0.34 compatible) How to make it support transparency? i've added imagealphablending() and imagesavealpha but it didn't work. Or atlast is there any similar good classes? Thanks

    Read the article

  • CORE Keygen Problem

    - by David Schiefer
    Hi, after fighting several versions of the CoreKeyGen created by some "minamoto" guy, a new version has appeared. This version is particularly sophisticated and seems to modify the actual binary itself, using a dylib known as libbassmod.dylib (this is in the keygen's mac os folder). Has anyone ever come across this & can give me advice on how to stop it? If so, how can I stop the keygen? it seems like the library can see what calls my app makes and stop them somehow, I'm not too sure.

    Read the article

  • Can I stop NUnit GUI test run from code under test?

    - by David White
    I'm using nunit.exe (v2.5.3, as it happens) for our testers to run UI tests of our web site, using WatiN. The regression test suite is up to around 100 tests. While the test suite is running, the test web site could go down for maintenance. It would be more efficient in those circumstances if the test suite would stop altogether, rather than attempting to run each remaining test, and failing. Is there any way to accomplish this?

    Read the article

  • How to keep views free of authorization logic in mvc?

    - by David Lay
    I have a view to display a list of items. The user can edit, delete or create new items, but according to their authorizations they may or may not be allowed to do some of this actions. I have the requirement to display only the actions which the current user is allowed to do, but I don't want to clutter the views with authorization if-else's Despise of being a very common requirement, I can't find a real satisfactory way of doing it. My best approach so far is to provide an overload to the Html.ActionLink extension method that takes the permission to ask for, but there are going to be more complex scenarios, like hiding entire blocks of html or switching a textbox for a label+hidden. Is there a better way to do this?

    Read the article

  • Who in the software world do you admire the most?

    - by David McGraw
    In an effort to spark some discussion and to find interesting people that I didn't know about, is there anybody around the software industry that you really admire? Perhaps admire is the wrong choice of word, but I'm sure there is somebody out there that has impacted you in a minor way. What did you learn from this individual that defines what you try to achieve today?

    Read the article

  • C++ Array Initialization in Function Call or Constructor Call

    - by david
    This question is related to the post here. Is it possible to initialize an array in a function call or constructor call? For example, class foo's constructor wants an array of size 3, so I want to call foo( { 0, 0, 0 } ). I've tried this, and it does not work. I'd like to be able to initialize objects of type foo in other objects' constructor initialization lists, or initialize foo's without first creating a separate array. Is this possible?

    Read the article

  • jQuery 1.4.x and the @ symbol

    - by David
    I used to use this script for jquery email obfuscation: $(".replaceAt").replaceWith("@"); $(".obfuscate").each(function () { $(this).attr("href", "mailto:"+$(this).text()); }); <a class="obfuscate">name<span class="replaceAt">-AT-</span>server.com</a> But with jQuery 1.4.x, I now get this error: uncaught exception: Syntax error, unrecognized expression: @ Looking this up on the net, it looks like jQuery thinks that the @ is a special character. I tried to "\@" it and a few other things with not luck. I'm not enough of a jQuery ninja to know how to fix this. Any ideas?

    Read the article

  • xCode: iPhone Swipe Gesture crash

    - by David DelMonte
    I have an app that I'd like the swipe gesture to flip to a second view. The app is all set up with buttons that work. The swipe gesture though causes a crash ( “EXC_BAD_ACCESS”.). The gesture code is: - (void)handleSwipe:(UISwipeGestureRecognizer *)recognizer { NSLog(@"%s", __FUNCTION__); switch (recognizer.direction) { case (UISwipeGestureRecognizerDirectionRight): [self performSelector:@selector(flipper:)]; break; case (UISwipeGestureRecognizerDirectionLeft): [self performSelector:@selector(flipper:)]; break; default: break; } } and "flipper" looks like this: - (IBAction)flipper:(id)sender { FlashCardsAppDelegate *mainDelegate = (FlashCardsAppDelegate *)[[UIApplication sharedApplication] delegate]; [mainDelegate flipToFront]; } flipToBack (and flipToFront) look like this.. - (void)flipToBack { NSLog(@"%s", __FUNCTION__); BackViewController *theBackView = [[BackViewController alloc] initWithNibName:@"BackView" bundle:nil]; [self setBackViewController:theBackView]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES]; [frontViewController.view removeFromSuperview]; [self.window addSubview:[backViewController view]]; [UIView commitAnimations]; [frontViewController release]; frontViewController = nil; [theBackView release]; // NSLog (@" FINISHED "); } Maybe I'm going about this the wrong way... All ideas are welcome...

    Read the article

  • Javascript source code analysis ( specifically duplication checking )

    - by David
    Partial duplicate of this Notes: I already use JSLint extensively via a tool I wrote that scans in intervals my current project directory for recently updated/created .js files. It's drastically improved productivity for me and I doubt there is anything as good as JSLint for the price (it's free). That said, is there any analysis tool out there that can find repetitive or near-duplicate code blocks, the goal being to make it easier to find opportunities to consolidate large files or small/medium sized projects?

    Read the article

  • NPE when drawing TabWidget in android (only on HTC Magic?)

    - by David Hedlund
    I've received report from the user of an app I've written that he gets FC whenever starting a certain activity. I have not been able to reproduce the issue on the emulator or on my HTC Hero (running 1.5), but this user running HTC Magic (with 1.6) is facing this error every time. What bothers me is that no single step in the stacktrace actually includes any code in my app (com.filmtipset) 01-07 00:10:26.773 I/ActivityManager( 141): Starting activity: Intent { cmp=com.filmtipset/.ViewMovie (has extras) } 01-07 00:10:27.023 D/AndroidRuntime( 2402): Shutting down VM 01-07 00:10:27.023 W/dalvikvm( 2402): threadid=3: thread exiting with uncaught exception (group=0x4001e170) 01-07 00:10:27.023 E/AndroidRuntime( 2402): Uncaught handler: thread main exiting due to uncaught exception 01-07 00:10:27.083 E/AndroidRuntime( 2402): java.lang.NullPointerException 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.TabWidget.dispatchDraw(TabWidget.java:173) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.View.draw(View.java:6552) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.FrameLayout.draw(FrameLayout.java:352) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1531) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.View.draw(View.java:6552) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.FrameLayout.draw(FrameLayout.java:352) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.draw(ViewRoot.java:1332) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.performTraversals(ViewRoot.java:1097) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.handleMessage(ViewRoot.java:1613) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.os.Handler.dispatchMessage(Handler.java:99) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.os.Looper.loop(Looper.java:123) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.app.ActivityThread.main(ActivityThread.java:4320) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at java.lang.reflect.Method.invokeNative(Native Method) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at java.lang.reflect.Method.invoke(Method.java:521) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at dalvik.system.NativeStart.main(Native Method) Full dump here if I've missed anything of interest I'm guessing, then, that there might be something wrong with my layout. It's quite verbose, so I'm posting it here, rather than pasting the whole thing on SO. There is a tabwidget, where one tab is connected to the scrollview, svFilmInfo, and one to the linear layout llComments. The tab host is populated as such: Drawable commentSelector = getResources().getDrawable(R.drawable.tabcomment); Drawable infoSelector = getResources().getDrawable(R.drawable.tabinfo); mTabHost = getTabHost(); mTabHost.getTabWidget().setBackgroundColor(Color.BLACK); mTabHost.addTab(mTabHost.newTabSpec("tabInfo").setIndicator("Filminfo", infoSelector).setContent(R.id.svFilmInfo)); mTabHost.addTab(mTabHost.newTabSpec("tabInfo").setIndicator("Kommentarer", commentSelector).setContent(R.id.llComments)); Since I cannot reproduce the error myself, and since I cannot find any mention in the stack trace of what might be causing the error, I don't quite know where to start troubleshooting this. I'd appreciate any pointers.

    Read the article

  • How do I use the Silicon Laboratories IDE with SDCC?

    - by David Cary
    I'm thinking about using a microcontroller with an 8051 core from Silicon Laboratories. I hope that I can use C rather than assembly language, so I installed SDCC. I installed the "Silicon Laboratories IDE" to download the executable binaries to the on-chip Flash program memory. It also supposedly can be set up (under the Project Tool Chain Integration menu) to use "any" 8051 compiler. I tried to set it up to use SDCC, but every time I hit the "Assemble/Compile File" button it tells me "Compiler process did not sucessfully complete." How do I get new C code I write onto the SiLabs C8051F310 chip? Is there a web site with a step-by-step HOWTO? (Would it be easier to use a MAKEFILE that calls SDCC, only using the "Silicon Laboratories IDE" for the very last step of downloading the executable binary to the chip?)

    Read the article

  • Best Practice With JFrame Constructors?

    - by David Barry
    In both my Java classes, and the books we used in them laying out a GUI with code heavily involved the constructor of the JFrame. The standard technique in the books seems to be to initialize all components and add them to the JFrame in the constructor, and add anonymous event handlers to handle events where needed, and this is what has been advocated in my class. This seems to be pretty easy to understand, and easy to work with when creating a very simple GUI, but seems to quickly get ugly and cumbersome when making anything other than a very simple gui. Here is a small code sample of what I'm describing: public class FooFrame extends JFrame { JLabel inputLabel; JTextField inputField; JButton fooBtn; JPanel fooPanel; public FooFrame() { super("Foo"); fooPanel = new JPanel(); fooPanel.setLayout(new FlowLayout()); inputLabel = new JLabel("Input stuff"); fooPanel.add(inputLabel); inputField = new JTextField(20); fooPanel.add(inputField); fooBtn = new JButton("Do Foo"); fooBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //handle event } }); fooPanel.add(fooBtn); add(fooPanel, BorderLayout.CENTER); } } Is this type of use of the constructor the best way to code a Swing application in java? If so, what techniques can I use to make sure this type of constructor is organized and maintainable? If not, what is the recommended way to approach putting together a JFrame in java?

    Read the article

  • debugging scaffolding contingent upon degbugging boolean (java)

    - by David
    Recently i've found myself writing a lot of methods with what i can only think to call debugging scaffolding. Here's an example: public static void printArray (String[] array, boolean bug) { for (int i = 0; i<array.lenght; i++) { if (bug) System.out.print (i) ; //this line is what i'm calling the debugging scaffolding i guess. System.out.println(array[i]) ; } } in this method if i set bug to true, wherever its being called from maybe by some kind of user imput, then i get the special debugging text to let me know what index the string being printed as at just in case i needed to know for the sake of my debugging (pretend a state of affairs exists where its helpful). All of my questions more or less boil down to the question: is this a good idea? but with a tad bit more objectivity: Is this an effective way to test my methods and debug them? i mean effective in terms of efficiency and not messing up my code. Is it acceptable to leave the if (bug) stuff ; code in place after i've got my method up and working? (if a definition of "acceptability" is needed to make this question objective then use "is not a matter of programing controversy such as ommiting brackets in an if(boolean) with only one line after it, though if you've got something better go ahead and use your definition i won't mind) Is there a more effective way to accomplish the gole of making debugging easier than what i'm doing? Anything you know i mean to ask but that i have forgotten too (as much information as makes sense is appreciated).

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >