Daily Archives

Articles indexed Friday March 26 2010

Page 12/121 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • C++ portable end of line

    - by Andrew
    Hi everyone, is there any way to automatically use correct EOL character depending on the OS used? I was thinking of something like std::eol? I know that it is very easy to use preprocessor directives but curious if that is already available.

    Read the article

  • Example of an ASP.NET MVC post model?

    - by Anthony Potts
    I was watching the HaHaa presentation on ASP.NET MVC from MIX and they mentioned using a Post Model where I guess they were saying you could use a model that was ONLY for posting. I have tried looking for examples for this. Am I not understanding what they are saying? Does anyone have an example of how this might work in a strongly typed view where the view model and post model are not of the same type?

    Read the article

  • Capture data read from file into string stream Java

    - by halluc1nati0n
    I'm coming from a C++ background, so be kind on my n00bish queries... I'd like to read data from an input file and store it in a stringstream. I can accomplish this in an easy way in C++ using stringstreams. I'm a bit lost trying to do the same in Java. Following is a crude code/way I've developed where I'm storing the data read line-by-line in a string array. I need to use a string stream to capture my data into (rather than use a string array).. Any help? char dataCharArray[] = new char[2]; int marker=0; String inputLine; String temp_to_write_data[] = new String[100]; // Now, read from output_x into stringstream FileInputStream fstream = new FileInputStream("output_" + dataCharArray[0]); // Convert our input stream to a BufferedReader BufferedReader in = new BufferedReader (new InputStreamReader(fstream)); // Continue to read lines while there are still some left to read while ((inputLine = in.readLine()) != null ) { // Print file line to screen // System.out.println (inputLine); temp_to_write_data[marker] = inputLine; marker++; }

    Read the article

  • Selector and Iterating Through a Table Within a Div

    - by GregH
    I have been working on this and cannot get this iterator to work. I have the following HTML and am trying to iterate through all rows (except the first row) and extract the values in cells (td) 2 and 3 : <div id="statsId"> <table width="220" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td width="65"/> <td width="90"/> <td width="65"/> </tr> <tr style="font-weight: bold;"> <td align="left">$1.00</td> <td> <a href="#">UserID1</a> </td> <td>Single</td> </tr> <tr> <td align="left">$6.99</td> <td> <a href="#">UserID2</a> </td> <td>Multiple</td> </tr> <tr>... .....(snip) I tried the following iterator to iterate through all except the first row of the table that is a child of "div#statsID" and get the values of the 2nd and 3rd cells (in the example, the first extracted cells would have values of "UserID1" and "Single"), but it doesn't work. $('div#statsId > table tr:not(:nth-child(1))').each(function(i, ele) { var secondCol = $('td:nth-child(2)', ele).innerHTML var thirdCol= $('td:nth-child(3)', ele).text() ..... }); Any suggestions on how to specify and iterate through the rows (except the first) of a table that is a child of a div would be appreciated.

    Read the article

  • MySQL unique clustered constraint not constraining as expected

    - by igor
    I'm creating a table with: CREATE TABLE movies ( id INT AUTO_INCREMENT PRIMARY KEY, name CHAR(255) NOT NULL, year INT NOT NULL, inyear CHAR(10), CONSTRAINT UNIQUE CLUSTERED (name, year, inyear) ); (this is jdbc SQL) Which creates a MySQL table with a clustered index, "index kind" is "unique", and spans the three clustered columns: full size However, once I dump my data (without exceptions thrown), I see that the uniqueness constraint has failed: SELECT * FROM movies WHERE name = 'Flawless' AND year = 2007 AND inyear IS NULL; gives: id, name, year, inyear 162169, 'Flawless', 2007, NULL 162170, 'Flawless', 2007, NULL Does anyone know what I'm doing wrong here?

    Read the article

  • How to flush the input stream in python?

    - by jinxed_coder
    I'm writing a simple alarm utility in Python. #!/usr/bin/python import time import subprocess import sys alarm1 = int(raw_input("How many minutes (alarm1)? ")) while (1): time.sleep(60*alarm1) print "Alarm1" sys.stdout.flush(); doit = raw_input("Continue (Y/N)?[Y]: ") print "Input",doit if doit == 'N' or doit=='n': print "Exiting....." break I want to flush or discard all the key strokes that were entered while the script was sleeping and only accept the key strokes after the raw_input() is executed.

    Read the article

  • Python 3 with the range function

    - by Leif Andersen
    I can type in the following code in the terminal, and it works: for i in range(5): print(i) And it will print: 0 1 2 3 4 as expected. However, I tried to write a script that does a similar thing: print(current_chunk.data) read_chunk(file, current_chunk) numVerts, numFaces, numEdges = current_chunk.data print(current_chunk.data) print(numVerts) for vertex in range(numVerts): print("Hello World") current_chunk.data is gained from the following method: def read_chunk(file, chunk): line = file.readline() while line.startswith('#'): line = file.readline() chunk.data = line.split() The output for this is: ['OFF'] ['490', '518', '0'] 490 Traceback (most recent call last): File "/home/leif/src/install/linux2/.blender/scripts/io/import_scene_off.py", line 88, in execute load_off(self.properties.path, context) File "/home/leif/src/install/linux2/.blender/scripts/io/import_scene_off.py", line 68, in load_off for vertex in range(numVerts): TypeError: 'str' object cannot be interpreted as an integer So, why isn't it spitting out Hello World 490 times? Or is the 490 being thought of as a string? I opened the file like this: def load_off(filename, context): file = open(filename, 'r')

    Read the article

  • Collaborative localization website supporting Android strings.xml?

    - by Nicolas Raoul
    My open source Android application has internationalization done the Android way, with strings.xml files. The community has many people from many countries, and they are willing to contribute/improve translations using a collaborative website. There is Launchpad but it only supports the gettext format so we would have to use scripts, not very convenient. There is Crowdin but somehow this website seems dead, nearly no projects, and the download links do not work. Actually we started using Crowdin but all download links fail to give any strings.xml file back, see here. What website is convenient for translating open source Android applications?

    Read the article

  • Objective-C categories: Can I add a property for a method not in my category?

    - by Squeegy
    I want to use a category to make a method on the original class available as a property as well. Class A: @interface ClassA - (NSString*)foo; @end Class A category @interface ClassA (Properties) - (void)someCategoryMethod; @property (nonatomic, readonly) NSString *foo; @end Now when I do this, it seems to work, but it gives me warnings because I am not synthesizing the property in my category implementation. How do I tell the compiler everything is actually just fine since the original class synthesizes the property for me?

    Read the article

  • Setting the a caret in an JEditor Pane causes an exception.

    - by Elliott
    I have a JeditorPane which has some text in HTML format. When I execute the following command int len = editorPane.getText().length(); The value for len is 7473. But then I try to do the following: editorPane.setCaretPosition(4995); And I get the following exception: java.lang.IllegalArgumentException: bad position: 4995 My understanding is that I should only get this exception if the position at which I'm trying to set the caret is less than 0 or greater than the text length. It is neither. How can this be. Thank you, Elliott

    Read the article

  • How do you get AOL's OpenID site verification to work?

    - by Shawn Miller
    I have an OpenID relying party setup and using XRDS. It passes the "RP has discoverable return_to" interop test over at http://test-id.org/RP/DiscoverableReturnTo.aspx. Yahoo no longer complains with the message "Warning: This website has not confirmed its identity with Yahoo! and might be fraudulent." as outlined in Andrew Arnott's excellent blog post: http://blog.nerdbank.net/2008/06/why-yahoo-says-your-openid-site.html However, when I try to authenticate using AOL I see the "Warning! site verification could not be completed." message.

    Read the article

  • Rendering a view to a string in ASP.NET MVC 2

    - by Frank Rosario
    We need to render an ActionResult to a string to add pages to our internal search engine index. We settled on this solution to render to string. I've run into a problem with the ExecuteResult call used to process the View. Code Snippet: var oldController = controllerContext.RouteData.Values["controller"]; controllerContext.RouteData.Values["controller"] = typeof(TController).Name.Replace("Controller", ""); viewResult.ExecuteResult(controllerContext); // this line breaks I receive the following error: "Object reference not set to instance of object" error. I've confirmed viewResult is not null, so the exception has to be thrown internally in ExecuteResult. What could we be missing?

    Read the article

  • Invalid message signature when running OpenId Provider on Cluster

    - by Garth
    Introduction We have an OpenID Provider which we created using the DotNetOpenAuth component. Everything works great when we run the provider on a single node, but when we move the provider to a load balanced cluster where multiple servers are handling requests for each session we get issue with the message signing as the DotNetOpenAuth component seems to be using something unique from each cluster node to create the signature. Exception DotNetOpenAuth.Messaging.Bindings.InvalidSignatureException: Message signature was incorrect. at DotNetOpenAuth.OpenId.ChannelElements.SigningBindingElement.ProcessIncomingMessage(IProtocolMessage message) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\OpenId\ChannelElements\SigningBindingElement.cs:line 139 at DotNetOpenAuth.Messaging.Channel.ProcessIncomingMessage(IProtocolMessage message) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\Messaging\Channel.cs:line 940 at DotNetOpenAuth.OpenId.ChannelElements.OpenIdChannel.ProcessIncomingMessage(IProtocolMessage message) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\OpenId\ChannelElements\OpenIdChannel.cs:line 172 at DotNetOpenAuth.Messaging.Channel.ReadFromRequest(HttpRequestInfo httpRequest) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\Messaging\Channel.cs:line 378 at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.GetResponse(HttpRequestInfo httpRequestInfo) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\OpenId\RelyingParty\OpenIdRelyingParty.cs:line 493 Setup We have the machine config setup to use the same machine key on all cluster nodes and we have setup an out of process session with SQL Server. Question How do we configure the key used by DotNetOpenAuth to sign its messages so that the client will trust responses from all servers in the cluster during the same session?

    Read the article

  • Cisco CCENT Exam

    - by freddy6
    Hi All, I am due to sit my CCENT exam in about 3 weeks, for anyone who has sat the exam recently or knows about the exam: How many questions is in the exam How long does the exam go for Will there be a lot of question based on the CLI commands?

    Read the article

  • SketchFlow Training Videos

    Ready to learn how you can create interactive prototypes with SketchFlow in Expression Blend 3? Get started with this 12-part series with downloadable guide and files....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • SQL SERVER Generate Report for Index Physical Statistics SSMS

    Few days ago, I wrote about SQL SERVER Out of the Box Activity and Performance Reports from SSSMS (Link). A user asked me a question regarding if we can use similar reports to get the detail about Indexes. Yes, it is possible to do the same. There are similar type of reports are [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Analyze your IIS Log Files - Favorite Log Parser Queries

    The other day I was asked if I knew about a tool that would allow users to easily analyze the IIS Log Files, to process and look for specific data that could easily be automated. My recommendation was that if they were comfortable with using a SQL-like language that they should use Log Parser. Log Parser is a very powerful tool that provides a generic SQL-like language on top of many types of data like IIS Logs, Event Viewer entries, XML files, CSV files, File System and others; and it allows you...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Change password via NetScreen remote

    - by Marcelo Cantos
    I'm using NetScreen remote to VPN from home. I recently changed my password at work, and now my home system keeps complaining, "Windows needs your current credentials to ensure network connectivity." I can't change the cached password for peanuts. I can't find an option in NetScreen remote to connect to the VPN before logging in, as suggested here.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >