Daily Archives

Articles indexed Wednesday April 28 2010

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

  • Windows 7 and XP Networking

    - by David-Zazeski
    I'm trying to setup a home network between a windows 7 and windows xp machine. I have a small hub. My XP computer has a manually assigned IP address (192.168.0.10) and I set my Windows 7 machine to have a manually assigned IP address (192.168.0.15). The XP computer works, but the Windows 7 machine does not see the network. It says that there is no connectivity. Ping does not work from either machine. Does anyone have any suggestions?

    Read the article

  • Convert "this" to a reference-to-pointer

    - by Austin Hyde
    Just stumbled onto this problem. (title says it all) Let's say I have a struct struct Foo { void bar () { do_baz(this); } void do_baz(Foo*& pFoo) { pFoo->p_sub_foo = new Foo; // for example } Foo* p_sub_foo; } GCC tells me that temp.cpp: In member function ‘void Foo::bar()’: temp.cpp:3: error: no matching function for call to ‘Foo::do_baz(Foo* const)’ temp.cpp:5: note: candidates are: void Foo::do_baz(Foo*&) So, how do I convert what is apparently a const Foo* to a Foo*&?

    Read the article

  • Subsonic 3 : get only certain columns

    - by CTGA
    Hello, I use : Subsonic 3, SQL Server 2008, Json.Net Here is my problem : I have a house table with id,lot number, address, location, ownerid and an owner table with id,name, description. I'd like to get only the owner name and address of house where location is "San Francisco". How can I do this with Subsonic? My problem is I can only get a typed list or a datareader, I don't understand how to only get an array or a simple list. What is the best solution? Create a custom class ? Create a View ? Anything else ? My aim is to then serialize the data to send it back to my application, but serialization is seriously long because of the numerous relationships (My example here is simplified, there are indeed : house - owner - city - country etc.), whereas I need only 2 fields... Thank you

    Read the article

  • Generate reasonable length license key with asymmetric encryption?

    - by starkos
    I've been looking at this all day. I probably should have walked away from it hours ago; I might be missing something obvious at this point. Short version: Is there a way to generate and boil down an asymmetrically encrypted hash to a reasonable number of unambiguous, human readable characters? Long version: I want to generate license keys for my software. I would like these keys to be of a reasonable length (25-36 characters) and easily read and entered by a human (so avoid ambiguous characters like the number 0 and the capital letter O). Finally--and this seems to be the kicker--I'd really like to use asymmetric encryption to make it more difficult to generate new keys. I've got the general approach: concatenate my information (user name, product version, a salt) into a string and generate a SHA1() hash from that, then encrypt the hash with my private key. On the client, build the SHA1() hash from the same information, then decrypt the license with the public key and see if I've got a match. Since this is a Mac app, I looked at AquaticPrime, but that generates a relatively large license file rather than a string. I can work with that if I must, but as a user I really like the convenience of a license key that I can read and print. I also looked at CocoaFob which does generate a key, but it is so long that I'd want to deliver it as a file anyway. I fooled around with OpenSSL for a while but couldn't come up with anything of a reasonable length. So...am I missing something obvious here? Is there a way to generate and boil down an asymmetrically encrypted hash to a reasonable number of unambiguous, human readable characters? I'm open to buying a solution. But I work on a number of different of platforms, so I'd want something portable. Everything I've looked at so far has been platform specific. Many, many thanks for a solution! PS - Yes, I know it will still be cracked. I'm trying to come up with something reasonable that, as a user, I would still find friendly.

    Read the article

  • Why does Tex/Latex not speed up in subsequent runs?

    - by Debilski
    I really wonder, why even recent systems of Tex/Latex do not use any caching to speed up later runs. Every time that I fix a single comma*, calling Latex costs me about the same amount of time, because it needs to load and convert every single picture file. (* I know that even changing a tiny comma could affect the whole structure but of course, a well-written cache format could see the impact of that. Also, there might be situations where 100% correctness is not needed as long as it’s fast.) Is there something in the language of Tex which makes this complicated or impossible to accomplish or is it just that in the original implementation of Tex, there was no need for this (because it would have been slow anyway on those large computers)? But then on the other hand, why doesn’t this annoy other people so much that they’ve started a fork which has some sort of caching (or transparent conversion of Tex files to a format which is faster to parse)? Is there anything I can do to speed up subsequent runs of Latex? Except from putting all the stuff into chapterXX.tex files and then commenting them out?

    Read the article

  • Java ResultSet how to getTimeStamp in UTC

    - by mkal
    The database has data in UTC and when I try to get data java.util.Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone("UTC")); java.sql.Timestamp ts = resultSet.getTimestamp(PUBLISH_TIME); cal.setTime(ts); Is there anything wrong with this?

    Read the article

  • Propietary modules within GPL and BSD kernels

    - by Francisco Garcia
    Since the Linux kernel is GPL and not LGPL I suppose that it is illegal to link proprietary code to it. How does the industry circumvents this? I would expect that the GPL license will force any developer to release under GPL driver and/or kernel module. Maybe I am confused and implementing a new module is not really linking against the kernel code ??? How do companies deal with this? Maybe linking the other way around (from kernel to their binaries)? On the other hand there is the BSD kernel. Where you are free to link protected IP. Can you get a better design implementing your drivers within a BSD kernel? Is there any design restriction when implementing drivers for GPL kernels?

    Read the article

  • After I've installed it, NUnit doesn't appear in VS2008

    - by Richard77
    Hello, I downloaded and installed NUnit successfuly (or so I was told by the installer). Now, when I start a project, I don't see NUnit in the 'Create UnitTest' prompt as one the choice I'm givven to. All I can see are (i) VS Unit Test and (ii) Mb Unit v3 as choices. In fact, I downloaded today the MbB Unit. After, installing it, I was able to see it right away in the prompt. What happen to the NUnit? Althought, I can see it when I do Start - All Programs Or maybe NUnit dosn't need to appear in the prompt as choice since it has its own GUI. Thanks for helping

    Read the article

  • iPhone: didSelectRowAtIndexPath not invoked

    - by soletan
    Hi, I know this issue being mentioned before, but resolutions there didn't apply. I'm having a UINavigationController with an embedded UITableViewController set up using IB. In IB the UITableView's delegate and dataSource are both set to my derivation of UITableViewController. This class has been added using XCode's templates for UITableViewController classes. There is no custom UITableViewCell and the table view is using default plain style with single title, only. Well, in simulator the list is rendered properly, with two elements provided by dataSource, so dataSource is linked properly. If I remove the outlet link for dataSource in IB, an empty table is rendered instead. As soon as I tap on one of these two items, it is flashing blue and the GDB encounters interruption in __forwarding__ in scope of a UITableView::_selectRowAtIndexPath. It's not reaching breakpoint set in my non-empty method didSelectRowIndexPath. I checked the arguments and method's name to exclude typos resulting in different selector. I recently didn't succeed in whether delegate is set properly, but as it is set equivalently to dataSource which is getting two elements from the same class, I expect it to be set properly. So, what's wrong? I'm running iPhone/iPad SDK 3.1.2 ... but tried with iPhone SDK 3.1 in simulator as well. EDIT: This is the code of my UITableViewController derivation: #import "LocalBrowserListController.h" #import "InstrumentDescriptor.h" @implementation LocalBrowserListController - (void)viewDidLoad { [super viewDidLoad]; [self listLocalInstruments]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)viewDidUnload { [super viewDidUnload]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [entries count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; if ( ( [entries count] > 0 ) && ( [indexPath length] > 0 ) ) cell.textLabel.text = [[[entries objectAtIndex:[indexPath indexAtPosition:[indexPath length] - 1]] label] retain]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if ( ( [entries count] > 0 ) && ( [indexPath length] > 0 ) ) { ... } } - (void)dealloc { [super dealloc]; } - (void) listLocalInstruments { NSMutableArray *result = [NSMutableArray arrayWithCapacity:10]; [result addObject:[InstrumentDescriptor descriptorOn:[[NSBundle mainBundle] pathForResource:@"example" ofType:@"idl"] withLabel:@"Default 1"]]; [result addObject:[InstrumentDescriptor descriptorOn:[[NSBundle mainBundle] pathForResource:@"example" ofType:@"xml"] withLabel:@"Default 2"]]; [entries release]; entries = [[NSArray alloc] initWithArray:result]; } @end

    Read the article

  • How to find N Consecutive records in a table using SQL

    - by user320587
    Hi, I have the following Table definition with sample data. In the following table, Customer Product & Date are key fields Table One Customer Product Date SALE X A 01/01/2010 YES X A 02/01/2010 YES X A 03/01/2010 NO X A 04/01/2010 NO X A 05/01/2010 YES X A 06/01/2010 NO X A 07/01/2010 NO X A 08/01/2010 NO X A 09/01/2010 YES X A 10/01/2010 YES X A 11/01/2010 NO X A 12/01/2010 YES In the above table, I need to find the N or N consecutive records where there was no sale, Sale value was 'NO' For example, if N is 2, the the result set would return the following Customer Product Date SALE X A 03/01/2010 NO X A 04/01/2010 NO X A 06/01/2010 NO X A 07/01/2010 NO X A 08/01/2010 NO Can someone help me with a SQL query to get the desired results. I am using SQL Server 2005. I started playing using ROW_NUMBER() AND PARTITION clauses but no luck. Thanks for any help

    Read the article

  • List files recursively in linux with path relative to the current directory

    - by Darryl Hein
    This is similar to this question, but I want to include the path relative to the current directory in unix. If can do the following: ls -LR | grep .txt But it doesn't include the full paths. For example, I have the follow dir structure: test1/file.txt test2/file1.txt test2/file2.txt The code above will return: file.txt file1.txt file2.txt How can I get it to include the paths relative to the current directory using standard nix commands?

    Read the article

  • When, if ever, is "number of lines of code" a useful metric?

    - by user15071
    Some people claim that code's worst enemy is its size, and I tend to agree. Yet every day you keep hearing things like I write blah lines of code in a day. I own x lines of code. Windows is x million lines of code. Question: When is "#lines of code" useful? ps: Note that when such statements are made, the tone is "more is better".

    Read the article

  • Parse a CSV file using python (to make a decision tree later)

    - by Margaret
    First off, full disclosure: This is going towards a uni assignment, so I don't want to receive code. :). I'm more looking for approaches; I'm very new to python, having read a book but not yet written any code. The entire task is to import the contents of a CSV file, create a decision tree from the contents of the CSV file (using the ID3 algorithm), and then parse a second CSV file to run against the tree. There's a big (understandable) preference to have it capable of dealing with different CSV files (I asked if we were allowed to hard code the column names, mostly to eliminate it as a possibility, and the answer was no). The CSV files are in a fairly standard format; the header row is marked with a # then the column names are displayed, and every row after that is a simple series of values. Example: # Column1, Column2, Column3, Column4 Value01, Value02, Value03, Value04 Value11, Value12, Value13, Value14 At the moment, I'm trying to work out the first part: parsing the CSV. To make the decisions for the decision tree, a dictionary structure seems like it's going to be the most logical; so I was thinking of doing something along these lines: Read in each line, character by character If the character is not a comma or a space Append character to temporary string If the character is a comma Append the temporary string to a list Empty string Once a line has been read Create a dictionary using the header row as the key (somehow!) Append that dictionary to a list However, if I do things that way, I'm not sure how to make a mapping between the keys and the values. I'm also wondering whether there is some way to perform an action on every dictionary in a list, since I'll need to be doing things to the effect of "Everyone return their values for columns Column1 and Column4, so I can count up who has what!" - I assume that there is some mechanism, but I don't think I know how to do it. Is a dictionary the best way to do it? Would I be better off doing things using some other data structure? If so, what?

    Read the article

  • Graphical net and text

    - by chesheerkys
    Hello! My task is to make a control, that behaves itself like RichTextBox, but contains a graphical net. The only task, this net is solving, is to be visible. It should be solution in overriding OnPaint method, but it doesn't. This code: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { base.OnPaint(e); ...//drawing a line } gives me RichTextBox without of text This code: protected override void WndProc(ref System.Windows.Forms.Message m) { base.WndProc(ref m); if (m.Msg == 15) { Graphics g = this.CreateGraphics(); g.DrawLine(new Pen(Color.White, 1), new Point(0, 0), new Point(400, 400)); } } sometimes draws extra lines Actually since these two ways don't work, I don't know what to try. Waiting for your advices :) BR Dmitry P.S. I’ve heard a lot about great opportunities of WPF, but I’m not really common with this technology and don’t know what to start with. P.P.S. Sorry for my English, it’s not my natural language.

    Read the article

  • How to organize the work when project needs to be re-implemented due to poor code quality?

    - by Dmitriy Nagirnyak
    Hi, I have joined a very small where one main developer has been buiding the web app (.NET 4.0) during ~6 months. The project should be delivered within next 2 months. After first look at the code I can say that I would never allow it to go to production (things like catch { }, not tests at all with WebForms etc). So the code quality is incredibly low. My task is to improve that and still deliver the solution. So I plan to start with unit testing and MVC2 reimplementing most of the functionality (though using some of the existing code). I estimate that I will need about 6 weeks to catch up with the current progress and be on te same functionality level as the application will be in 6 months. The problem is that the main developer who has been working on the project does not seem to be very 'professional' and skillful (he seems to be really starting in IT and many basic things are unknown to him). It will take significant amount of time and effort to educate him how to do the proper testing, development and apply some patterns. I am ready to take responsibility for the reimplemnting the application but at the same time I don't want the main developer to be on idle but as he won't be able to significantly contribute to the better-world project at this stage I am not sure what would the best way to keep productivity high for both of us. Currently I think following solution is good enough: He proceeds doing what he does until I will catch up with him and then start working on a new project together. The problem is that of course this approach is not very productive as one developer will do better-world project while the other will proceed with what he did, effectively doing similar tasks. Can you suggest how we could better organise the work together in order to be most efficient for the overall project? Thanks, Dmitriy.

    Read the article

  • Display custom title bar in XML

    - by Casebash
    In Android documentation describing "Configuring General Window Properties", it is suggested that specifying properties via XML is preferable whenever possible. As an example, instead of setting Window.FEATURE_NO_TITLE with requestWindowFeature, they set it to @android:style/Theme.NoTitleBar. Is there a similar way to set a custom title bar to be used in the XML?

    Read the article

  • Encrypt correctly caracters in a PHP mail form ("I'm" turns to be "I\'m")

    - by Peanuts
    Hello guys, I'm testing a PHP mail form, a very barebones one, found here: <?php if(isset($_POST['submit'])) { //The form has been submitted, prep a nice thank you message $output = '<h3>Thanks for your message</h3>'; //Deal with the email $to = '[email protected]'; $subject = 'you have a mail'; $contactname = strip_tags($_POST['contactname']); $adress = strip_tags($_POST['adress']); $contactemail = strip_tags($_POST['contactemail']); $textmessage = strip_tags($_POST['textmessage']); $boundary =md5(date('r', time())); $headers = "From: My Site\r\nReply-To: [email protected]"; $message = "Name: ".$contactname."\n"; $message .= "Adress: ".$adress."\n"; $message .= "E-mail: ".$contactemail."\n"; $message .= "Message: ".$textmessage."\n"; mail($to, $subject, $message, $headers); } ?> The problem is I'm receiving an unwanted slash "\" everytime I write a single or a double quote in my message, so "I'm" appear as "I\'m" in my mailbox. I know it have to do with the way PHP distinguishes code quotes from only lecture quotes, but I wouldn't know what to add in my form to get it properly running. Any help is appreciated,

    Read the article

  • Location of Java dump heap file?

    - by Jim Ferrans
    Well this is embarrassing ... I'm starting to play with the Eclipse Memory Analyzer to look for Java memory leaks on a Windows box. Step 1 is to obtain a heap dump file. To do this< I start my Java (javaw.exe) process from within Eclipse and connect to it with jconsole. Then on the jconsole MBeans tab I click the dumpHeap button. The first time I did this, I saw a pop-up saying it had created the heap dump file, but not giving its name or location. Now whenever I do a dumpHeap again while connected to a different javaw.exe process, jconsole says: Problem invoking dumpHeap : java.io.IOException: File exists and of course doesn't give its name or path. Where could it be? I've searched my C: drive (using cygwin command line tools) for files containing "hprof" or "java_pid" or "heapdump" and didn't find anything plausible. I've even used the Windows search to look for all files in my Eclipse workspace that have changed in the last day. I'm using the Sun Java 1.6 JVM, and don't have -XX:HeapDumpPath set.

    Read the article

  • PropertyInfo from Delegate

    - by Paul Hatcherian
    Is there a simple way to get the PropertyInfo for a property in a delegate, assuming it is a simple property seletor? Example: var propertyInfo = Method<MyClass,int>(s => s.Property); ... PropertyInfo Method(Func<T1,T2> selector) { // What goes here? }

    Read the article

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