Search Results

Search found 4616 results on 185 pages for 'c strings'.

Page 86/185 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • How do I display alternate languages in Interface Builder? (Xcode5)

    - by Anthony F
    The iOS project is using Base Localization with localizable strings set up for the Storyboard in English and German. Everything is working properly when I change the language for the simulator, but some of the text is getting truncated in German. I would like to view the German text in Interface builder so that it's easier to fix the constraints on the text labels and fields. It seems like this should just be a view setting or something, but I can't seem to find anything obvious.

    Read the article

  • Regular Expression - Match only 7 chars?

    - by Simon
    I'm trying to match a SEDOL (exactly 7 chars: 6 alpha-numeric chars followed by 1 numeric char) My regex ([A-Z 0-9]{6})[0-9]{1} matches correctly but strings greater than 7 chars that begin with a valid match also match (if you see what I mean :)). For example: B3KMJP4 matches correctly but so does: B3KMJP4x which shouldn't match. Can anyone show me how to avoid this?

    Read the article

  • C++ string template library

    - by Gopalakrishnan Subramani
    I want simple C++ string based template library to replace strings at runtime. For example, I will use string template = "My name is {{name}}"; At runtime, I want the name to be changed based on actual one. I found one example, www.stringtemplate.org but I little scared when its talks about antlr etc.

    Read the article

  • Regex string match?

    - by Andy
    I have a long string in javascript like var string = 'abc234832748374asdf7943278934haskhjdasfhjkdfas83421def8923487234897234897'; I am trying to match like abc234832748374 and def8923487234897 - that is - I have tried like string.match(\abc[^abc]|\def[^def]|) but that doesnt get me both strings because I need numbers after them ? Basically I need abc + 8 chars after and def the 8-11 chars after ? How can I do this ?

    Read the article

  • Could the Print document ive built in .net cause a UriFormatException?

    - by Smoka
    After adding Print Document, Dialog, and Button to my Forms app i now have UriFormatException and A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.Drawing.dll Additional information: Access is denied Is there something wrong with the strings in my Document? Preview looks fine. but unhandled exception's when it tries to print.

    Read the article

  • Why does my Perl regular expression only find the last occurrence?

    - by scharan
    I have the following input to a Perl script and I wish to get the first occurrence of NAME="..." strings in each of the <table>...</table> structures. The entire file is read into a single string and the regex acts on that input. However, the regex always returns the last occurrence of NAME="..." strings. Can anyone explain what is going on and how this can be fixed? Input file: ADSDF <TABLE> NAME="ORDERSAA" line1 line2 NAME="ORDERSA" line3 NAME="ORDERSAB" </TABLE> <TABLE> line1 line2 NAME="ORDERSB" line3 </TABLE> <TABLE> line1 line2 NAME="ORDERSC" line3 </TABLE> <TABLE> line1 line2 NAME="ORDERSD" line3 line3 line3 </TABLE> <TABLE> line1 line2 NAME="QUOTES2" line3 NAME="QUOTES3" NAME="QUOTES4" line3 NAME="QUOTES5" line3 </TABLE> <TABLE> line1 line2 NAME="QUOTES6" NAME="QUOTES7" NAME="QUOTES8" NAME="QUOTES9" line3 line3 </TABLE> <TABLE> NAME="MyName IsKhan" </TABLE> Perl Code starts here: use warnings; use strict; my $nameRegExp = '(<table>((NAME="(.+)")|(.*|\n))*</table>)'; sub extractNames($$){ my ($ifh, $ofh) = @_; my $fullFile; read ($ifh, $fullFile, 1024);#Hardcoded to read just 1024 bytes. while( $fullFile =~ m#$nameRegExp#gi){ print "found: ".$4."\n"; } } sub main(){ if( ($#ARGV + 1 )!= 1){ die("Usage: extractNames infile\n"); } my $infileName = $ARGV[0]; my $outfileName = $ARGV[1]; open my $inFile, "<$infileName" or die("Could not open log file $infileName"); my $outFile; #open my $outFile, ">$outfileName" or die("Could not open log file $outfileName"); extractNames( $inFile, $outFile ); close( $inFile ); #close( $outFile ); } #call main();

    Read the article

  • Tool to recursively search all files in a directory for a string [closed]

    - by routeNpingme
    Possible Duplicate: Tools to search for strings inside files without indexing Before I make one, any good tools out there for free/cheap that will recurse through all files in a directory and search for a text string in them? Need to find an instance of a string in any configuration files laying around. Kind of like a Windows Search "find files that contain..." on steroids? Oops - This is pretty much a duplicate question, sorry, didn't find the other one before

    Read the article

  • C strange array behaviour

    - by LukeN
    After learning that both strncmp is not what it seems to be and strlcpy not being available on my operating system (Linux), I figured I could try and write it myself. I found a quote from Ulrich Drepper, the libc maintainer, who posted an alternative to strlcpy using mempcpy. I don't have mempcpy either, but it's behaviour was easy to replicate. First of, this is the testcase I have #include <stdio.h> #include <string.h> #define BSIZE 10 void insp(const char* s, int n) { int i; for (i = 0; i < n; i++) printf("%c ", s[i]); printf("\n"); for (i = 0; i < n; i++) printf("%02X ", s[i]); printf("\n"); return; } int copy_string(char *dest, const char *src, int n) { int r = strlen(memcpy(dest, src, n-1)); dest[r] = 0; return r; } int main() { char b[BSIZE]; memset(b, 0, BSIZE); printf("Buffer size is %d", BSIZE); insp(b, BSIZE); printf("\nFirst copy:\n"); copy_string(b, "First", BSIZE); insp(b, BSIZE); printf("b = '%s'\n", b); printf("\nSecond copy:\n"); copy_string(b, "Second", BSIZE); insp(b, BSIZE); printf("b = '%s'\n", b); return 0; } And this is its result: Buffer size is 10 00 00 00 00 00 00 00 00 00 00 First copy: F i r s t b = 46 69 72 73 74 00 62 20 3D 00 b = 'First' Second copy: S e c o n d 53 65 63 6F 6E 64 00 00 01 00 b = 'Second' You can see in the internal representation (the lines insp() created) that there's some noise mixed in, like the printf() format string in the inspection after the first copy, and a foreign 0x01 in the second copy. The strings are copied intact and it correctly handles too long source strings (let's ignore the possible issue with passing 0 as length to copy_string for now, I'll fix that later). But why are there foreign array contents (from the format string) inside my destination? It's as if the destination was actually RESIZED to match the new length.

    Read the article

  • Android/Java Append String + int

    - by xger86x
    Hi, i have a question, what is the best way to append ints and Strings to build a new String? In the allocation debug tool i see too much allocations if i use the operator +. But i have tried also with StringBuffer and there are still too much allocations. Anyone can help me? Thanks

    Read the article

  • How to write (simple) macro?

    - by krzysz00
    I need to write a macro (with-hooks (monster method who what) &body body) for a game I'm writing. Monster is a CLOS object, method and who are strings and what is a function (#' notation). The macroexpansion would be something to the effect of (add-hook monster method who what) ,@body (remove-hook monster method who) I have absolutely no idea how to write such a macro, and I would appreciate some help.

    Read the article

  • How to handle choice field with JPA 2, Hibernate 3.5

    - by phmr
    I have an entity with Integer attributes that looks like this in proto code: class MyEntity: String name Integer frequency Integer type def getFrequency() def getType() get* accessors return strings according to this table. value(type) HumanReadableString(type) 1 BSD 2 Apache 3 GPL min frequency max frequency HumanReadableString(frequency) 0 1000 rare 1000 2000 frequent 2001 3000 sexy It should be possible to get all possible values that an attribute can take, example: getChoices(MyEntity, "type") returns ("rare", "frequent", "sexy") It should be possible to get the bound value from the string: getValue(MyEntity, "frequency", "sexy") returns (2000,3000)

    Read the article

  • Modify values on-the-fly during SqlAdapter.Fill( )

    - by Timothy
    What would the proper way be to modify values on the fly as they are loaded into a DataTable by SqlAdapter.Fill()? I have globalized my application's log messages. An integer indicating the event type and serialized data relevant to the event is stored in the database as show below. When I display the logged events through a DataGridView control to the user, I interpolate the data to a formatting string. event_type event_timestamp event_details ============================================ 3 2010-05-04 20:49:58 jsmith 1 2010-05-04 20:50:42 jsmith ... I am currently iterating through the DataTable's rows to format the messages. public class LogDataTable : DataTable { public LogDataTable() { Locale = CultureInfo.CurrentCulture; Columns.AddRange(new DataColumn[] { new DataColumn("event_type", typeof(Int32)), new DataColumn("event_timestamp", typeof(DateTime)), new DataColumn("event_details", typeof(String))}); } } ... using (SqlDataAdapter adapter = new SqlDataAdapter(...)) { adapter.SelectCommand.Parameters.AddRange(new Object[] { ... }); adapter.Fill(table); } foreach (DataRow row in table.Rows) { switch ((LogEventType)row["event_type"]) { case LogEventType.Create: row["event_details"] = String.Format(Resources.Strings.LogEventCreateMsg, row["event_details"]; break; case LogEventType.Create: row["event_details"] = String.Format(Resources.Strings.LogEventCreateMsg, row["event_details"]; break; ... The end result as displayed would resemble: Type Date and Time Details ==================================================================== [icon] 2010-05-04 20:49:58 Failed login attempt with username jsmith [icon] 2010-05-04 20:50:42 Successful login with username jsmith ... It seems wasteful to iterate the result set twice-- once as the table is filled by the adapter, and again to perform the replacements. I would really like to do the replacement on-the-fly in my LogDataTable class as it is being populated. I have tried overriding an OnRowChanging method in LogDataTable, which throws an InRowChangingEventException. protected override void OnRowChanging(DataRowChangeEventArgs e) { base.OnRowChanging(e); switch ((LogEventType)row["event_type"]) ... I have tried overriding an OnRowChanged method, which throws a StackOverflowException (I assume changing it re-triggers the method ad infinitum?). I have tried overriding an OnTableNewRow method, which does not throw an exception but appears not to be invoked (I assume only when a user adds a row in the view, which I've prevented). I'd greatly appreciate any assistance anyone can give me.

    Read the article

  • C# invisible items in combobox

    - by Lai
    Hi, I'm loading Strings to a Combobox - cboIndexLanguage.Items.Add("ThisLanguage") i would like to make several of these items invisible. does anyone knows how to do it? Thanks For Advance,

    Read the article

  • iOS equivalent to MacOS NSAttributedString initWithRTF

    - by trekme
    What is an iOS equivalent to MacOS NSAttributedString initWithRTF ? The Application Kit extends Foundation’s NSAttributedString class by adding support for RTF, RTFD, and HTML (with or without attachments), graphics attributes (including font and ruler attributes), methods for drawing attributed strings, and methods for calculating significant linguistic units. - (id)initWithRTF:(NSData *)rtfData documentAttributes:(NSDictionary **)docAttributes I need to process a short stream of RTF data in an iOS application. Thank you!

    Read the article

  • PHP: Extending static member arrays

    - by tstenner
    I'm having the following scenario: class A { public static $arr=array(1,2); } class B extends A { public static $arr=array(3,4); } Is there any way to combine these 2 arrays so B::$arr is 1,2,3,4? I don't need to alter these arrays, but I can't declare them als const, as PHP doesn't allow const arrays.http://stackoverflow.com/questions/ask The PHP manual states, that I can only assign strings and constants, so parent::$arr + array(1,2) won't work, but I think it should be possible to do this.

    Read the article

  • can this code be broken?

    - by user105165
    Consider the below html string <p>This is a paragraph tag</p> <font>This is a font tag</font> <div>This is a div tag</div> <span>This is a span tag</span> This string is processed to tokanize the text found in it and we get 2 results as below 1) Token Array : $tokenArray == array( 'This is a paragraph tag', 'This is a div tag', '<font>This is a font tag</font>', '<span>This is a span tag</span>' ); 2) Tokenized template : $templateString == "<p>{0}</p>{2}<div>{1}</div>{3}"; If you observe, the sequence of the text strings segments from the original HTML strings is different from the tokenized template The PHP code below is used to order the tokenized template and accordingly the token array to match the original html string class CreateTemplates { public static $tokenArray = array(); public static $tokenArrayNew = array(); function foo($templateString,$tokenArray) { CreateTemplates::$tokenArray = $tokenArray; $ptn = "/{[0-9]*}*/"; // Search Pattern from the template string $templateString = preg_replace_callback($ptn,array(&$this, 'callbackhandler') ,$templateString); // function call return $templateString; } // Function defination private static function callbackhandler($matches) { static $newArr = array(); static $cnt; $tokenArray = CreateTemplates::$tokenArray; array_push($newArr, $matches[0]); CreateTemplates::$tokenArrayNew[count($newArr)] = $tokenArray[substr($matches[0],1,(strlen($matches[0])-2))]; $cnt = count($newArr)-1; return '{'.$cnt.'}'; } // function ends } // class ends Final output is (ordered template and token array) $tokenArray == array('This is a paragraph tag', '<font>This is a font tag</font>', 'This is a div tag', '<span>This is a span tag</span>' ); $templateString == "<p>{0}</p>{1}<div>{2}</div>{3}"; Which is the expected result. Now, I am not confident whether this is the right way to achieve this. I want to see how this code can be broken or not. Under what conditions will this code break? (important) Is there any other way to achieve this? (less important)

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >