Daily Archives

Articles indexed Thursday April 1 2010

Page 31/126 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • Having a problem with reading a file using NSString initWithContents OfFile

    - by srikanth rongali
    In this program when I debug, it is showing the nil for fileNameString. I could not understand what is the problem. Please help me ? @implementation fromFileRead1 NSString *fileNameString; -(id)init { if( (self = [super init]) ) { fileNameString = [[NSString alloc] initWithContentsOfFile: @"enemyDetails.rtf" encoding:NSUTF8StringEncoding error:nil]; NSArray *lines = [fileNameString componentsSeparatedByString:@"\n"]; for (id *line in lines) { NSLog(@"Line1%@", line ); } } return self; } @end Thank You.

    Read the article

  • Tokenizing Twitter Posts in Lucene

    - by Amaç Herdagdelen
    Hello, My question in a nutshell: Does anyone know of a TwitterAnalyzer or TwitterTokenizer for Lucene? More detailed version: I want to index a number of tweets in Lucene and keep the terms like @user or #hashtag intact. StandardTokenizer does not work because it discards the punctuation (but it does other useful stuff like keeping domain names, email addresses or recognizing acronyms). How can I have an analyzer which does everything StandardTokenizer does but does not touch terms like @user and #hashtag? My current solution is to preprocess the tweet text before feeding it into the analyzer and replace the characters by other alphanumeric strings. For example, String newText = newText.replaceAll("#", "hashtag"); newText = newText.replaceAll("@", "addresstag"); Unfortunately this method breaks legitimate email addresses but I can live with that. Does that approach make sense? Thanks in advance! Amaç

    Read the article

  • Acordex Image viewer throws out of memory exception in CITRIX environment

    - by neha
    We have a .net 2.0 application. In the .aspx page we are calling the java applet using . This applet is calling the Acordex Image viewer. In the production environment users are facing "out of memory" or "insufficient memory" issues when users try to open the image or magnify an image in Acordex viewer. Strangely when the users logout and login again they are able to see the same image without any errors. The website is hosted in a CITRIX environment. We have access to this environment but we are not able to reproduce this issue on the test servers or the local machines. We dont know what is causing this issue. What should we do to troubleshoot the issue? Do we have to increase the memory allotted to the users in CITRIX? The RAM is around 4 gb. Number of simultaneous users - 10-13. image size is max 2 mb Following is the code used to call Acordex image viewer:

    Read the article

  • Could CouchDB benefit significantly from the use of BERT instead of JSON?

    - by Victor Rodrigues
    I appreciate a lot CouchDB attempt to use universal web formats in everything it does: RESTFUL HTTP methods in every interaction, JSON objects, javascript code to customize database and documents. CouchDB seems to scale pretty well, but the individual cost to make a request usually makes 'relational' people afraid of. Many small business applications should deal with only one machine and that's all. In this case the scalability talk doesn't say too much, we need more performance per request, or people will not use it. BERT (Binary ERlang Term http://bert-rpc.org/ ) has proven to be a faster and lighter format than JSON and it is native for Erlang, the language in which CouchDB is written. Could we benefit from that, using BERT documents instead of JSON ones? I'm not saying just for retrieving in views, but for everything CouchDB does, including syncing. And, as a consequence of it, use Erlang functions instead of javascript ones. This would modify some original CouchDB principles, because today it is very web oriented. Considering I imagine few people would make their database API public and usually its data is accessed by the users through an application, it would be a good deal to have the ability to configure CouchDB for working faster. HTTP+JSON calls could still be handled by CouchDB, considering an extra cost in these cases because of parsing.

    Read the article

  • Jquery callback function executes over and over again...

    - by Pandiya Chendur
    This my jquery function, function getRecordspage(curPage, pagSize) { // code here $(".pager").pagination(strarr[1], { callback: function() { getRecordspage(2, 5);},current_page: curPage - 1, items_per_page:'5', num_display_entries: '5', next_text: 'Next', prev_text: 'Prev', num_edge_entries: '1' }); } and i call this jquery function, <script type="text/javascript"> $(document).ready(function() { getRecordspage(1, 5); }); </script> As you see my It works fine for 1st time and my callback function is configured to the current function itself... when it gets called the callback gets executed over and over again.... How can i prevent this? Any suggestion....

    Read the article

  • JSON parsing problem in BlackBerry

    - by anta40
    I'm working on how to parse Twitter's JSON response using JSON-ME. For example: [code] http://apiwiki.twitter.com/Twitter-Search-API-Method:-search foo({"results":[{"profile_image_url":"http://a3.twimg.com/profile_images/762620209/drama_queen-6989_normal.gif","created_at":"Thu, 01 Apr 2010 02:35:10 +0000","from_user":"TWEETSDRAMA","to_user_id":null,"text":"NEW Twitter Lists Widget - How to put it on your blog or site http://bit.ly/47NCi6","id":11401539152,"from_user_id":95081097,"geo":null,"iso_language_code":"en","source":"<a href="http://ping.fm/" rel="nofollow">Ping.fm</a>"}... (content truncated)[/code] Here's my method:[code] public void parseDataFromJSON(String strjson) throws JSONException { JSONTokener jtoken = new JSONTokener(strjson); JSONArray jsoarray = new JSONArray(jtoken); JSONObject jsobj = jsoarray.getJSONObject(0); tweeter_profile_image_url = jsobj.optString("profile_image_url"); tweeter_created_at = jsobj.optString("created_at"); tweeter_from_user = jsobj.optString("from_user"); tweeter_to_user_id = jsobj.optString("to_user_id"); tweeter_text = jsobj.optString("text"); tweeter_id = jsobj.optInt("id"); tweeter_from_user_id = jsobj.optInt("from_user_id"); tweeter_geo = jsobj.optString("geo"); tweeter_iso_language_code = jsobj.optString("iso_language_code"); tweeter_source = jsobj.optString("source") }[/code] When I ran it on the emulator, nothing was shown, so I inspected the debugger, and the output was: status: 200 content: {"results":[{"profile_image_url":"http://a1.twimg.com/profile_images/746683548/Photo_on_2010-..... --- OK, I got the JSON content org.json.me.JSONException: A JSONArray text must start with '[' at character 1 of {"results":[{"profile_image_url.... --- but somehow unable to processed it properly. So how to parse this correctly?

    Read the article

  • Css attribute selector for input type="button" not working on IE7

    - by Cesar Lopez
    Hi all, I am working on a big form and it contains a lot of buttons all over the form, therefore I am trying to get working input[type="button"] in my main css file so it would catch all buttons with out having to add a class to every single one, for some reason this is not working on IE7, after checking on the web it says that IE7 should be supporting this. Also it has to be type="button" and not type="submit" as not all buttons will submit the form. Could anybody give a hint what am I doing wrong? input[type="button"]{ text-align:center; } I have also tried input[type=button] Any help would be very much apreciated.

    Read the article

  • htaccess redirect from root to subfolder and then mask the url?

    - by KiwiCoder
    Hello all, Two things: Firstly - I have version 2 of a website located in a folder named v2, and I want to redirect any traffic that is NOT a child of the v2 folder, to www.example.com/v2 The old site located in the root was created in iWeb and has a LOT of subfolders and sub-subfolders. So: www.example.com/v2 = New site www.example.com/Page.html www.example.com/category/Page.html ww.example.com/category/subcategory/Page.html = All generic examples of what I need to redirect. Secondly, and I don't know if this is possible, I want to hide /v2/ in the URL, so that visitors will just see www.example.com/page even though they are actually on www.example.com/v2/page Links are hardcoded to the v2 folder, like so <a href="v2/contact.html" Any help is MOST appreciated. I've spent hours trying to figure this out, but I'm only just learning about htaccess and regular expressions, and am totally confused. Thanks so much!

    Read the article

  • CSS Attribute selector - Match attribute values that begin with

    - by LuckyShot
    I am trying to identify all the <UL> that contain a menu list by defining the ID like this: <ul id="menutop"> <li><a href="#">item1</a></li> <li><a href="#">item2</a></li> <li><a href="#">item3</a></li> </ul> <ul id="menumain"> <li><a href="#">item1</a></li> <li><a href="#">item2</a></li> <li><a href="#">item3</a></li> </ul> As per what I understand, I could use: ul[id|='menu']>li>a {color:#f00;} (<a> direct child of a <li> direct child of an <ul> that has its id starting with menu) But it doesn't work. Searching a bit brought me this [question][1] which suggests that ID is an attribute and not a property so I don't get why it isn't working. What am I doing wrong? Here's a link to the CSS2 Matching attributes and attribute values as per the W3 standards ( http://www.w3.org/TR/CSS2/selector.html#matching-attrs ).

    Read the article

  • trouble with custom 'Text Bubble' component (examples included)

    - by gmoniey
    I'm trying to use a custom Text component to show a series of comments. I got the original idea from: http://www.eonflex.com/?p=40 I've got the base case working but I am stuck with 2 problems I cant seem to figure out: Since I am drawing around the text, the actual height of each bubble is greater than that of the Text field, as a result, the last bubble is always chopped off. I have tried explicitly overriding the height getter, and adding some padding, but I cant seem to get it right. You can see an example here: http://test.lambandtunafish.com/bubbles/CommentTest.swf In my layout, I have 2 VBoxes (one nested inside the other). The first vbox shows a form where the user can enter a comment, and the second box has all the comments. In order to ensure that the scrollbars only show up on the second box, I set minHeight="0" on the nested VBox, but then for some reason, some comments' text is shifted to the right. You can see an example here (look at the first comment): http://test.lambandtunafish.com/bubbles/CommentTest-minHeight.swf Rather than posting the code here, I've provided some links: Container: http://test.lambandtunafish.com/bubbles/CommentTest.mxml Bubble: http://test.lambandtunafish.com/bubbles/CommentBubble.as If anyone has any ideas, I would appreciate it. Thanks!

    Read the article

  • Programmatically determine DPI via the browser?

    - by Brandon Pelfrey
    Hi all. I would like to programmaticaly determine the DPI of a user's display in order to show a web page at a precise number of units (centimeters/inches). I know it a weird request: it's for a visualization research project and it's kind of a control. We currently do it by having the user place a credit card to the screen and match a resizable div (via Mootools) to the real credit card, and voila we can get the DPI and display the page correctly. Can anyone think of a programmatic way to do this?

    Read the article

  • need explanation about bookmarking

    - by Sachindra
    I got stumbled upon this issue once and I guess I need some expertise in getting through this .." some links that one likes to bookmark ." I tried browsing and got confused. is bookmarking just means the use of CTRL + D. Or is ti something like the one in this link .

    Read the article

  • rails date field format on error

    - by ash34
    Hi, I have an input field that captures a date in my form <%= f.text_field :from_date, :style => 'width:80px;' %> The user enters the date in the following format MM/DD/YYYY. However, when there is a validation error in the model and the form is displayed back to the user with the entered values, the date format is converted to YYYY-MM-DD HH:MM:SS UTC. Where do I format this to show MM/DD/YYYY, when the form is displayed to the user. thanks.

    Read the article

  • How good is my method of embedding version numbers into my application using Mercurial hooks?

    - by ArtB
    This is not quite a specifc question, and more me like for a criticism of my current approach. I would like to include the program version number in the program I am developing. This is not a commercial product, but a research application so it is important to know which version generated the results. My method works as follows: There is a "pre-commit" hook in my .hg/hgrc file link to .hg/version_gen.sh version_gen.sh consists solely of: hg parent --template "r{rev}_{date|shortdate}" > version.num In the makefile, the line version="%__VERSION__% in the main script is replaced with the content of the version.num file. Are there better ways of doing this? The only real short coming I can see is that if you only commit a specfic file, version.num will be updated, but it won't be commited, and if I tried to add always committing that file, that would result in an infite loop (unless I created some temp file to indicate I was already in a commit, but that seems ugly...).

    Read the article

  • How to execute a program on PostBuild event in parallel?

    - by John
    I managed to set the compiler to execute another program when the project is built/ran with the following directive in project options: call program.exe param1 param2 The problem is that the compiler executes "program.exe" and waits for it to terminate and THEN the project executable is ran. What I ask: How to set the compiler to run both executables in paralel without waiting for the one in PostBuild event to terminate? Thanks in advance

    Read the article

  • DDD/NHibernate Use of Aggregate root and impact on web design - ex. Editing children of aggregate ro

    - by pbrophy
    Hopefully, this fictitious example will illustrate my problem: Suppose you are writing a system which tracks complaints for a software product, as well as many other attributes about the product. In this case the SoftwareProduct is our aggregate root and Complaints are entities that only can exist as a child of the product. In other words, if the software product is removed from the system, so shall the complaints. In the system, there is a dashboard like web page which displays many different aspects of a single SoftwareProduct. One section in the dashboard, displays a list of Complaints in a grid like fashion, showing only some very high level information for each complaint. When an admin type user chooses one of these complaints, they are directed to an edit screen which allows them to edit the detail of a single Complaint. The question is: what is the best way for the edit screen to retrieve the single Complaint, so that it can be displayed for editing purposes? Keep in mind we have already established the SoftwareProduct as an aggregate root, therefore direct access to a Complaint should not be allowed. Also, the system is using NHibernate, so eager loading is an option, but my understanding is that even if a single Complaint is eager loaded via the SoftwareProduct, as soon as the Complaints collection is accessed the rest of the collection is loaded. So, how do you get the single Complaint through the SoftwareProduct without incurring the overhead of loading the entire Complaints collection?

    Read the article

  • How much faster is C++ than C#?

    - by Trap
    Or is it now the other way around? From what I've heard there are some areas in which C# proves to be faster than C++, but I've never had the guts to test it by myself. Thought any of you could explain these differences in detail or point me to the right place for information on this.

    Read the article

  • question about tablecell and its contols collection

    - by Varyanica
    i have a table (System.Web.UI.WebControls). each row does have three cells. in cells' controls collection i placed some controls TableCell cell = new TableCell(); cell.Font.Bold = false; cell.BackColor = Color.FromName("lightblue"); cell.Controls.Add(new LiteralControl("????")); row.Cells.Add(cell); TableCell c3 = new TableCell(); c3.Controls.Add(new CheckBox()); r.Cells.Add(c3); i cant find the way to get values which this controls are holding i see that CheckBox stores a value, but i don't know how to get it. Can you tell me how?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >