Search Results

Search found 196 results on 8 pages for 'abcd'.

Page 6/8 | < Previous Page | 2 3 4 5 6 7 8  | Next Page >

  • Compact representation of GUID/UUID?

    - by chakrit
    I need to generate a GUID and save it via a string representation. The string representation should be as short as possible as it will be used as part of an already-long URL string. Right now, instead of using the normal abcd-efgh-... representation, I use the raw bytes generated and base64-encode them instead, which results in a somewhat shorter string. But is it possible to make it even shorter? I'm OK with losing some degree of uniqueness and keeping a counter, but scanning all existing keys is not an option. Suggestions?

    Read the article

  • filling array gradually with data from user

    - by neville
    I'm trying to fill an array with words inputted by user. Each word must be one letter longer than previous and one letter shorter than next one. Their length is equal to table row index, counting from 2. Words will finally create a one sided pyramid, like : A AB ABC ABCD Scanner sc = new Scanner(System.in); System.out.println("Give the height of array: "); String[] words = new String[height]; for(int i=2; i<height+2; i++){ System.out.println("Give word with "+i+" letters."); words[i-2] = sc.next(); while( words[i-2].length()>i-2 || words[i-2].length()<words[i-3].length() ){ words[i-2] = sc.next(); } } Currently the while loop doesn't influence scanner at all :/

    Read the article

  • antlr3StringStreamNew string input error [ at offset 0, at <EOF> : cannot match to any predicted input... ]

    - by Embeguru
    I'm using ANTLR 3.4 with simplecTreeParser example and want to give string input from main.c I'v modified input in main as mentioned bellow pANTLR3_UINT8 input_string = (pANTLR3_UINT8)"int a;"; input = antlr3StringStreamNew(input_string, ANTLR3_ENC_8BIT, sizeof(input_string),(pANTLR3_UINT8)"ABCD"); Apparently getting following error -end of input-(1) : error 3 : 23:1: declaration : ( variable | functionHeader ';' - ^( FUNC_DECL functionHeader ) | functionHeader block - ^( FUNC_DEF functionHeader block ) );, at offset 0, at : cannot match to any predicted input... The parser returned 1 errors, tree walking aborted. Any other way to give String input Regards

    Read the article

  • algorithm for python itertools.permutations

    - by zaharpopov
    Can someone please explain algorithm for itertools.permutations routine in Python standard lib 2.6? I see its code in the documentation but don't undestand why it work? Thanks Code is: def permutations(iterable, r=None): # permutations('ABCD', 2) --> AB AC AD BA BC BD CA CB CD DA DB DC # permutations(range(3)) --> 012 021 102 120 201 210 pool = tuple(iterable) n = len(pool) r = n if r is None else r if r > n: return indices = range(n) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) while n: for i in reversed(range(r)): cycles[i] -= 1 if cycles[i] == 0: indices[i:] = indices[i+1:] + indices[i:i+1] cycles[i] = n - i else: j = cycles[i] indices[i], indices[-j] = indices[-j], indices[i] yield tuple(pool[i] for i in indices[:r]) break else: return

    Read the article

  • Why is my app running

    - by John Smith
    I have compiled my iPhone app with setting (Device, Release). I install it on the test machine and it runs with no problem. Here's the problem. The app is linked to a C++ library. The compilation on the simulator has no errors. However the device compilation produces 568 errors, mostly about different visibilities w.r.t AppDelegate.o. They all look like: QL::Error::~Error()has different visibility (default) in /QL/build/Release-iphoneos/libQLLibrary.a(abcd.o) and (hidden) in /Programming/ObjC/Second/build/Second.build/Release-iphoneos/FG.build/Objects-normal/armv6/AppDelegate.o Why is this, and how can I stop the errors anyway?

    Read the article

  • how can I translate a NSString to NSData? And the data has the same content as the string

    - by someonemaybe
    NSString * theString=@"e88d"; NSData * data; // something I should implement NSLog(@"%@", theString); NSLog(@"%@",[data description]); I want the results of the two printings are the same. AES encryption and decryption: (1).The server: if the plaintext is :@"abcd"; the AES encrypted data(NSData data type) is :"d882830c dc892036 4345839f 13c7516a"; (2).in my local app, my code is : NSData*data=[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://..."]]; NSString * mystring= [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; However, to decrypt data successfully, I must got a data(NSData date type) which equals to "d882830c dc892036 4345839f 13c7516a".But it is the mystring (NSString data type) not the data(NSData data type) that equals to the right value. the encryption and decryption function both need a data(NSData data type) as input datas. (NSData*)AES128EncryptWithKey:(NSString*)key; (NSData*)AES128DecryptWithKey:(NSString*)key;

    Read the article

  • Installing a new SQL Server instance fails

    - by Rubio
    I've previously in my setup installed SQL Server Express 2005. Now I've switched to SQL Server Express 2008. I updated the command line parameters to those documented for the latter. If the comp already has SQL Server Express 2008 installed, my installer should create a new instance. The command line parameters are as follows: /ACTION=Install /FEATURES=SQLEngine /QS /INSTANCENAME=ABCD /SECURITYMODE=SQL /SAPWD=CunningPassword The requested instance name does not exist on the target machine. This will end in an error -2068643838. The logs show the following error: "No features were installed during the setup execution. The requested features may already be installed." If I remove the /QS parameter and try to install interactively, I'll get as far as the Feature Selection page. The UI shows three options, Instance Features, Shared Features and Redistributable Features. Whatever I select, clicking Next results in the same error (There are validation errors on this page). Any ideas anyone? Thanks, -- Rubio

    Read the article

  • Creating a CLR UDF with variable number of parameters

    - by josephj1989
    Hi I wanted a function to find the greatest of a list of String values passed in. I want to invoke it as Select greatest('Abcd','Efgh','Zxy','EAD') from sql server. It should return Zxy. The number of parameters is variable.Incidentally it is very similar to oracle GREATEST function. So I wrote a very simple CLR function (Vs2008) and tried to deploy it. See below public partial class UserDefinedFunctions { [Microsoft.SqlServer.Server.SqlFunction] public static SqlString Greatest(params SqlString[] p) { SqlString max=p[0]; foreach (string s in p) max = s.CompareTo(max) > 0 ? s : max; return max; } }; But when I try to compile or deploy it I get the following error Cannot find data type SqlString[]. Is it possible to satisfy my requirement using SQL CLR ?

    Read the article

  • How to verify mail origin?

    - by MrZombie
    I wish to code a little service where I will be able to send an e-mail to a specific address used by my server to send specific commands to my server. I'll check against a list of permitted e-mail addresses to make sure no one unauthorized will send a command to the server, but how do I make sure that, say, an e-mail sent by "[email protected]" really comes from "thezombie.net"? I thought about checking the header for the original e-mail server's IP and pinging the domain to make sure it is the same, but would that be reliable? Example: Server receives a command from [email protected] [email protected] is authorized, proceed with checks Server checks "thezombie.net"'s IP from the header: W.X.Y.Z Server pings "thezombie.net" for it's IP: A.B.C.D The IPs do not correspond, do not process command Is there any better way to do that?

    Read the article

  • Can someone explain this "endian-ness" function for me?

    - by Mike
    Write a program to determine whether a computer is big-endian or little-endian. bool endianness() { int i = 1; char *ptr; ptr = (char*) &i; return (*ptr); } So I have the above function. I don't really get it. ptr = (char*) &i, which I think means a pointer to a character at address of where i is sitting, so if an int is 4 bytes, say ABCD, are we talking about A or D when you call char* on that? and why? Would some one please explain this in more detail? Thanks. So specifically, ptr = (char*) &i; when you cast it to char*, what part of &i do I get?

    Read the article

  • How to generate pdf files _with_ utf-8 multibyte characters using Zend Framework

    - by Sejanus
    Hello, I've got a "little" problem with Zend Framework Zend_Pdf class. Multibyte characters are stripped from generated pdf files. E.g. when I write aabccdee it becomes abcd with lithuanian letters stripped. I'm not sure if it's particularly Zend_Pdf problem or php in general. Source text is encoded in utf-8, as well as the php source file which does the job. Thank you in advance for your help ;) P.S. I run Zend Framework v. 1.6 and I use FONT_TIMES_BOLD font. FONT_TIMES_ROMAN does work

    Read the article

  • wonder about some #define tricks

    - by kingkai
    Whlie reading codes of my group project, I come across many DEFINEs, and some of them seems strange. To generalize it, please look at the following 2 examples. Example 1: #define SNPRINTF(dst, fmt, arg...) snprintf(dst, sizeof(dst), fmt, ##arg) what does "##" means in this circumstance? I've tried to delete both of them, and write codes like "char buf[1024]; SNPRINTF(buf,"%s,%s","abcd","efg");" which produced the same result. So "##" seems no use and no harm to me. Example 2: #define CLOSE(fd) do { \ if (-1 != (fd)) { \ close(fd); \ (fd) = -1; \ } \ } while (0) Necessary to stuff the inner code to the do{}while(0) statement? what's the use? Thanks!

    Read the article

  • How to marshal the type of "Cstring" in .NET Compact Framework(C#)?

    - by SmartJJ
    How to marshal the type of "Cstring" in .NET Compact Framework(C#)? DLLname:Test_Cstring.dll(OS is WinCE 5.0),source code: extern "C" __declspec(dllexport) int GetStringLen(CString str) { return str.GetLength(); } I marshal that in .NET Compact Framework(C#),for example: [DllImport("Test_Cstring.dll", EntryPoint = "GetStringLen", SetLastError = true)] public extern static int GetStringLen(string s); private void Test_Cstring() { int len=-1; len=GetStringLen("abcd"); MessageBox.Show("Length:"+len.ToString()); //result is -1,so PInvoke is unsuccessful! } The Method of "GetStringLen" in .NET CF is unsuccessful! How to marshal this type of "Cstring"? Any information about it would be very appreciated!

    Read the article

  • Load data from CSV to mySQL database Java+hibernate+spring

    - by mona
    I am trying to load a CSV file in to mySQL database using Java+Hibernate+Spring. I am using the following query in the DAO to help me load in to the database: entityManager.createQuery("LOAD DATA INFILE :fileName INTO TABLE test").setParameter("fileName", "C:\\samples\\test\\abcd.csv").executeUpdate(); I got some idea to use this from http://dev.mysql.com/doc/refman/5.1/en/load-data.html and how to import a csv file into a mysql from an hibernate+spring application? But I am getting the error: java.lang.IllegalArgumentException: node to traverse cannot be null! Please help! Thanks

    Read the article

  • Communicate between content script and options page

    - by Gaurang Tandon
    I have seen many questions already and all are about background page to content script. Summary My extension has an options page, and a content script. The content script handles the storage functionality (chrome.storage manipulation). Whenever, a user changes a setting in the options page, I want to send a message to the content script to store the new data. My code: options.js var data = "abcd"; // let data chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { chrome.tabs.sendMessage(tabs[0].id, "storeData:" + data, function(response){ console.log(response); // gives undefined :( }); }); content script js chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { // not working }); My question: Why isn't the approach not working? Is there any other (better) approach for this procedure.

    Read the article

  • Replacing text node of HTML input in PHP

    - by Aman Kumar Jain
    Hi, I want to replace all the text nodes in a html text. I'll explain with an example: $html = " <div> <p> text2 text2 word text2 <span>abcd</span> text2 text2 word text2 <p> this is a long, very long statement with punctuations. </div> I want to replace "text2 text2 word text2" with "<span>text2 text2 word text2</span>" and "this is a long, very long statement with punctuations." with "<span>this is a long, very long statement with punctuations.</span>" What should be the regular expression for the same?

    Read the article

  • Javascript Regular expression to enforce 2 digits after decimal points

    - by Manas Saha
    I need to validate a text box where users are supposed to enter numeric values with 2 decimal places. I am validating the text in client side javascript. The validation will pass only if the number has precisely 2 decimal places, and there is at least 1 digit before the decimal point. (could be zero) the number before the decimal point can be 0, but can not be multiple zeroes. like 00 or 000 The number before the decimal point can not begin with more than 1 zero. Example of Passed validation: 0.01 0.12 111.23 1234.56 012345.67 123.00 0.00 Example of failed validation .12 1.1 0.0 00.00 1234. 1234.567 1234 00123.45 abcd.12 12a4.56 1234.5A I have tried with [0-9][.][0-9][0-9]$ But it is allowing alphabets before decimal point. like 12a4.56 Can anyone please fix the expression? thanks a lot in advance.

    Read the article

  • Will this LINQ-TO-SQL query fetch all records from the table ?

    - by Puneet Dudeja
    public long GetNewCRN() { return ((from c in DataContext.GetTable<Cust_Master>() select c.CUSTSERH_CRN).Max() + 1); } Will this Linq to Sql query fetch all records from the table first and then select the maximum of the column ? If yes, then isn't it a bad idea using linq to sql instead of normal SqlCommand ? Or is there any other way of doing it in linq to sql ? When I attach Console.Out, I see nothing(command prompt does not even open). But when I include following:- context.Log = new System.IO.StreamWriter("d:\\abcd.txt"); I get an error, that "The process can not access the file because it is being used by another process" and that process is "w3wp.exe". How can I see the sql commands being executed by DataContext then ?

    Read the article

  • How does one avoid "Value restriction" errors with F#'s Seq.cast?

    - by gatoatigrado
    I see that Seq has a cast function from IEnumerable to Seq, but how do I get it to work? open System.Text.RegularExpressions;; let v = Regex.Match("abcd", "(ab)");; Seq.cast (v.Captures);; This produces, error FS0030: Value restriction. The value 'it' has been inferred to have generic type val it : seq<'_a Either define 'it' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation.

    Read the article

  • MVVM Light is too fast :)

    - by Hikari
    Hello, I have a simple WM7 Page with textbox. Futher, I assigned EventToCommand (RelayCommand) to this textbox, reacting to TextChanged event. For testing pourposes I made additional method TextBox_TextChanged in page's code behing. Both command and TextBox_TextChanged print a message box with the textbox content. Initial value of textbox is ABC. Then I press D and: 1) TextBox_TextChanged prints ABCD. 2) Command prints ABC. D is missing. Why commands is so fast???

    Read the article

  • Mod Rewrite 500 Internal Server Error Problem.

    - by HELP
    I keep getting a 500 Internal Server Error when I try to change Example 1 to Example 2 using mod_rewrite. Can someone help me fix this problem? Example 1 http://www.example.com/posts/1/abcd Example 2 http://www.example.com/posts.php?aid=$1 Here is my mod rewrite. <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://www.example.com/ [R=301,L] RewriteRule ^(-[1-9]+)? $ http://www.example.com/posts.php?aid=$1 [L] </IfModule>

    Read the article

  • Counting characters in an Access database column using SQL

    - by jzr
    I have the following table col1 col2 col3 col4 ==== ==== ==== ===== 1233 4566 ABCD CDEF 1233 4566 ACD1 CDEF 1233 4566 D1AF CDEF I need to count the characters in col3, so from the data in the previous table it would be: char count ==== ===== A 3 B 1 C 2 D 3 F 1 1 2 Is this possible to achieve by using SQL only? At the moment I am thinking of passing a parameter in to SQL query and count the characters one by one and then sum, however I did not start the VBA part yet, and frankly wouldn't want to do that. This is my query at the moment: PARAMETERS X Long; SELECT First(Mid(TABLE.col3,X,1)) AS [col3 Field], Count(Mid(TABLE.col3,X,1)) AS Dcount FROM TEST GROUP BY Mid(TABLE.col3,X,1) HAVING (((Count(Mid([TABLE].[col3],[X],1)))>=1)); Ideas and help are much appreciated, as I don't usually work with Access and SQL.

    Read the article

  • Algorithm for Determining Variations of Differing Lengths

    - by joseph.ferris
    I have four objects - for the sake of arguments, let say that they are the following letters: A B C D I need to calculate the number of variations that can be made for these under the following two conditions: No repetition Objects are position agnostic Taking the above, this means that with a four object sequence, I can have only one sequence that matches the criteria (since order is not considered for being unique): ABCD There are four variations for a three object combination from the four object pool: ABC, ABD, ACD, and BCD There are six variations for a two object combination from the four object pool: AB, AC, AD, BC, BD, and CD And the most simple one, if taken on at a time: A, B, C, and D I swear that this was something covered in school, many, many years ago - and probably forgotten since I didn't think I would use it. :-) I am anticipating that factorials will come into play, but just trying to force an equation is not working. Any advice would be appreciated.

    Read the article

  • Perl passing argument into eval

    - by ehretf
    I'm facing an issue using eval function. Indeed I have some function name inside a SQL database, my goal is to execute those functions within perl (after retrieve in SQL). Here is what I'm doing, considering that $RssSource-{$k}{Proceed} contains "&test" as a string retrieved from SQL: my $str2 = "ABCD"; eval "$RssSource->{$k}{Proceed}";warn if $@; sub test { my $arg = shift; print "fct TEST -> ", $row, "\n"; } This is working correctly and display: fct TEST -> However I would like to be able to pass $str2 as an argument to $RssSource-{$k}{Proceed} but I don't know how, every syntax I tried return an error: eval "$RssSource->{$k}{Proceed}$str2" eval "$RssSource->{$k}{Proceed}($str2)" eval "$RssSource->{$k}{Proceed}"$str2 eval "$RssSource->{$k}{Proceed}"($str2) May someone tell me how to properly pass an argument to the evaluated function? Thanks a lot for your help Regards. Florent

    Read the article

  • Changing memory address of a char*

    - by Randall Flagg
    I have the following code: str = "ABCD"; //0x001135F8 newStr = "EFGH"; //0x008F5740 *str after realloc at 5th position - //0x001135FC I want it to point to: 0x008F5740 void str_cat(char** str, char* newStr) { int i; realloc(*str, strlen(*str) + strlen(newStr) + 1); //*str is now 9 length long // I want to change the memory reference value of the 5th char in *str to point to newStr. // Is this possible? // &((*str) + strlen(*str)) = (char*)&newStr; //This is my problem (I think) }

    Read the article

< Previous Page | 2 3 4 5 6 7 8  | Next Page >