Daily Archives

Articles indexed Monday April 12 2010

Page 1/116 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Eclipse keyboard shortcuts: "alt+shift+" vs. "shift+" vs. "ctrl+alt+" etc. -- Is there an underlying

    - by MatrixFrog
    There are a zillion questions on SO about keyboard shortcuts in Eclipse, but there's I've always wondered if there is an underlying logic to the decisions of which shortcuts would be ctrl+alt+[some letter], and which would be just ctrl+[some letter] etc. Obviously there is a need to use a variety of combinations because there are only so many keys on the keyboard, but why, for example, is "add import" ctrl+shift+m, while "extract method" is alt+shift+m, instead of the other way around? I think if there is some underlying logic to these decisions, it will make it easier to remember more shortcuts without having to scan through the huge right-click menus to find them, and I won't accidentally use the wrong one as often.

    Read the article

  • Best way to get ints from a string with whitespace?

    - by befall
    Hey all, I know this is simple, I just can't recall the best way to do this. I have an input like " 5 15 " that defines the x and y of a 2D vector array. I simply need those two numbers into int col and int row. What's the best way to do this? I was attemping stringstreams, but can't figure out the correct code. Thanks for any help!

    Read the article

  • A layout for maven project with a patched dependency

    - by zamza
    Suppose, I have an opensource project that depends on some library, that must be patched in order to fix some issues. How do I do that? My ideas are: Have that library sources set up as a module, keep them in my vcs. Pros: simple. Cons: some third party sources in my repo, might slow down build process, hard to find a patched place (though can be fixed in README) Have a module, like in 1, but keep patched source files only, compile them with orignal library jar in classpath and somehow replace *.class files in library jar on build. Pros: builds faster, easy to find patched places. Cons: hard to configure, that jar hackery is non-obvious (library jar in repository and in my project assembly would be different) Keep patched *.class files in main/resources, and replace on packaging like in 2). Pros: almost none. Cons: binaries in vcs, hard to recompile a patched class as patch compilation is not automated. One nice solution is to create a distinct project with patched library sources, and deploy it on local/enterprise repository with -patched qualifier. But that would not fit for an opensourced project that is meant to be easily buildable by anyone who checks out its sources. Or should I just say "and also, before you build my project, please check out that stuff and run mvn install".

    Read the article

  • iPhone: How to Display Text from UIWebView HTML Document in a UITextView

    - by ArgMan
    I have an RSS feed that gets arranged in a UITableView which lets the user select a story that loads in a UIWebView. However, I'd like to stop using the UIWebView and just use a UITextView or UILabel. This png is what I am trying to do (just display the various text aspects of a news story): I have tried using: NSString *myText = [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.textContent"]; and assigning the string to a UILabel but it doesn't work from where I am implementing it in webViewDidFinishLoad (--is that not the proper place?). I get a blank textView and normal webView. If I overlay a UITextView on top of a UIWebView on its own (that is, a webView that just loads one page), the code posted above works displays the text fine. The problem arises when I try to process the RSS feed . I've been stuck wondering why this doesn't work as it should for a few days now. If you have a better, more efficient way of doing it then placing the code in webViewDidFinishLoad, please let me know! Does it go in my didSelectRowAtIndexPath? Thank you very much in advance!

    Read the article

  • CGBitmapContextCreate on the iPhone/iPad

    - by toastie
    Hello, I have a method that needs to parse through a bunch of large PNG images pixel by pixel (the PNGs are 600x600 pixels each). It seems to work great on the Simulator, but on the device (iPad), i get an EXC_BAD_ACCESS in some internal memory copying function. It seems the size is the culprit because if I try it on smaller images, everything seems to work. Here's the memory related meat of method below. + (CGRect) getAlphaBoundsForUImage: (UIImage*) image { CGImageRef imageRef = [image CGImage]; NSUInteger width = CGImageGetWidth(imageRef); NSUInteger height = CGImageGetHeight(imageRef); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); unsigned char *rawData = malloc(height * width * 4); memset(rawData,0,height * width * 4); NSUInteger bytesPerPixel = 4; NSUInteger bytesPerRow = bytesPerPixel * width; NSUInteger bitsPerComponent = 8; CGContextRef context = CGBitmapContextCreate(rawData, width, height, bitsPerComponent, bytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); CGColorSpaceRelease(colorSpace); CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); CGContextRelease(context); /* non-memory related stuff */ free(rawData); When I run this on a bunch of images, it runs 12 times and then craps out, while on the simulator it runs no problem. Do you guys have any ideas?

    Read the article

  • getting user input via console in c#

    - by every_answer_gets_a_point
    i have this code in a button in a wpf in c#: private void button1_Click(object sender, RoutedEventArgs e) { Console.Write("What is your name?: "); Console.Write("Hello, {0}! ", Console.ReadLine()); Console.WriteLine("Welcome to the C# Station Tutorial!"); } when i click the button, nothing happens. why doesn't the console appear?

    Read the article

  • accessing a blob ; without using a webrole ?

    - by Egon
    I wanted to knw if there is way we can upload /download a blob; add remove view metadata without using a webrole ? If my application has a lot of gui, shud there be multiple webroles ? everywhere I see webrole's file default.aspx.cs has everything to do with the blob based on a event ; which is perfectly fine, but what if my gui is more complicated ?

    Read the article

  • php html flash website design tools for beginner

    - by LikeToCode
    I have 5 years of C#, Perl and SQL programming experience but I've just found a web designer and developer job. I dont know anything about it but need to design a website using PHP, flash and HTML, whatever it is. Can you give me pointers on where to start to learn it all ASAP and start designing the website? I downloaded WAMP and learned to configure it. Other then that I dont know what to do next. They gave me a few pictures to incorporate, but I dont know how :)

    Read the article

  • Smarty: Display a random sentence from array

    - by Martind
    I have a smarty template, that I want to display a random sentence on each reload. I could do it with this: in php file: $sentences = array('Hello you', 'Hi mate', 'Welcome'); shuffle($sentences); $smarty->assign('sentence', $sentences[0]); in template file: <h1>{$sentence}</h1> Is it possible to do all this in the template instead? Since this isn't exactly programming logic but more a presentation logic, i would like it all in the template like so: <h1>{'Hello you', 'Hi mate', 'Welcome'| selectRandom }</h1> Something like that?

    Read the article

  • GWT - ListBox - pre-selecting an item

    - by rgoytacaz
    Hey there Stackoverflow, I got a doubt regarding pre-selecting(setSelectedIndex(index)) an item in a ListBox, Im using Spring + GWT. I got a dialog that contains a painel, this panel has a flexpanel, in which I've put a couple ListBox, this are filled up with data from my database. But this painel is for updates of an entity in my database, thus I wanted it to pre-select the current properties for this items, alowing the user to change at will. I do the filling up in the update method of the widget. I tried setting the selectedItem in the update method, but it gives me an null error. I've searched a few places and it seems that the listbox are only filled at the exact moment of the display. Thus pre-selecting would be impossible. I thought about some event, that is fired when the page is displayed. onLoad() doesnt work.. Anyone have something to help me out in here? Thx in advance, Rodrigo Dellacqua

    Read the article

  • What is the standard way to deploy memcached?

    - by Tom
    I have two IIS servers and two MySQL servers. On all servers I have some available memory (More than a GB). What is the standard way to deploy memcached? Should I add a new server especially for memcached, or should I use my existing servers? If so, which servers? Thanks in advance

    Read the article

  • unusual backspace behavior in mac terminal

    - by Brandon
    I'm trying to figure out how to get ssh sessions to work how I want using the terminal app on mac os x. I'm used to using PuTTY on windows, where backspace means backspace. On mac when I press delete/backspace on mac it deletes the character following the cursor instead of the one before. I turned on Delete sends Ctrl + H, and that works most of the time, but sometimes it just shows on the screen as ^H this is typically at prompts from some custom python scripts on the box I log into. This doesn't happen with PuTTY on windows. Btw I'm logging into a Ubuntu Linux server running openssh. Any idea what I need to do so that backspace is consistently backspace.

    Read the article

  • BIOS flash XP, 1 long beep, 2 short beeps, over&over

    - by Paul
    BIOS issue on HP dv9233cl laptop, wiped drive of Vista, loaded XP, not all the drives loaded. Went to the HP website, downloaded all drivers for this laptop. Started loading them. Loaded WIN Flash HP Network System BIOS Window SP42187. After a minute a low resolution screen appeared stating "It is now safe to turn off the computer" I waited a minute and half. Turned it off. Let it set 10 seconds try to start and No screen images at all and a nasty loud long beep 2 short beeps, 2 seconds of silence and it happens over & over again. I have unplugged/removed battery, still same problem, Any sugg.... Thx.. Paul

    Read the article

  • Is the Core i5 Processor from Intel like the Celerons of yesteryear?

    - by Chris
    The title pretty much says it. I know that the Core i7's are Quad Core and Hyper-threaded (so 4 cores, and 8 logical), and the Core i5's are Quad Core as well but not Hyper-threaded, does this really make a difference? Or are the only people who are going to care are the ones who CPU intensive operations? I'm a developer, so I'm more concerned about hard drive speed most times than CPU speed. Any thoughts?

    Read the article

  • What is the best resizable circular byte buffer available in Java?

    - by Wouter Lievens
    I need a byte buffer class in Java for single-threaded use. I should be able to insert data at the back of the buffer and read data at the front, with an amortized cost of O(1). The buffer should resize when it's full, rather than throw an exception or something. I could write one myself, but I'd be very surprised if this didn't exist yet in a standard Java package, and if it doesn't, I'd expect it to exist in some well-tested public library. What would you recommend?

    Read the article

  • Dumping out Value on console using jQuery

    - by Rachel
    Hello, I come from PHP background and am used to doing var_dump, echo and print_r while doing some kind of debugging. I have just started on jquery, today is my first day infact and am trying to see if there is a way to dump out value to firebug console. Do we have similar function to var_dump or echo in jQuery or any other way to get values or debug statements displayed on the console ?

    Read the article

  • Label wrapped around radio/checkbox compatibility?

    - by Mark
    I noticed that if you wrap a radio button or checkbox in a label, the whole thing becomes clickable, even without a for/id pair (in fact, it seems to ignore this because I screwed it up!) Example: <label><input type="checkbox"> some text</label> Then "some text" becomes clickable to check the box. I tested it in FF, Chrome and Opera, and IE8, does anyone know if it works in older browsers, like IE6?

    Read the article

  • Lots of questions about file I/O (reading/writing message strings)

    - by Nazgulled
    Hi, For this university project I'm doing (for which I've made a couple of posts in the past), which is some sort of social network, it's required the ability for the users to exchange messages. At first, I designed my data structures to hold ALL messages in a linked list, limiting the message size to 256 chars. However, I think my instructors will prefer if I save the messages on disk and read them only when I need them. Of course, they won't say what they prefer, I need to make a choice and justify the best I can why I went that route. One thing to keep in mind is that I only need to save the latest 20 messages from each user, no more. Right now I have an Hash Table that will act as inbox, this will be inside the user profile. This Hash Table will be indexed by name (the user that sent the message). The value for each element will be a data structure holding an array of size_t with 20 elements (20 messages like I said above). The idea is to keep track of the disk file offsets and bytes written. Then, when I need to read a message, I just need to use fseek() and read the necessary bytes. I think this could work nicely... I could use just one single file to hold all messages from all users in the network. I'm saying one single file because a colleague asked an instructor about saving the messages from each user independently which he replied that it might not be the best approach cause the file system has it's limits. That's why I'm thinking of going the single file route. However, this presents a problem... Since I only need to save the latest 20 messages, I need to discard the older ones when I reach this limit. I have no idea how to do this... All I know is about fread() and fwrite() to read/write bytes from/to files. How can I go to a file offset and say "hey, delete the following X bytes"? Even if I could do that, there's another problem... All offsets below that one will be completely different and I would have to process all users mailboxes to fix the problem. Which would be a pain... So, any suggestions to solve my problems? What do you suggest?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >