string

How to slideToggle table row using Jquery?

Hello, I was wondering how I can slideToggle a table row from my script. I have a php file that is included in an html page inside a div called 'output-listings'. PHP FILE: <?php function outputListingsTable() { $mysql = new mysqli('localhost', 'root', 'root', 'ajax_demo') or die('you\'re dead'); $result = $mysql->query("SE...

When is it acceptable to not trim a user input string?

Can someone give me a real-world scenario of a method/function with a string argument which came from user input (e.g. form field, parsed data from file, etc.) where leading or trailing spaces SHOULD NOT have been trimmed? I can't ever recall such a situation for myself. EDIT: Mind you, I didn't say trimming any whitespace. I said trim...

How do i convert string value to int? in C#

I have a string which typically is in the format "0xFF". I'll trim it since there is a chance of whitespace. How do i convert that into hex and convert "34" to decimal. I know about .Parse but does this support hex characters when the string is 0x123? ...

Interesting strings algorithm

Given two finite sequences of string, A and B, of length n each, for example: A1: "kk", A2: "ka", A3: "kkk", A4: "a" B1: "ka", B2: "kakk", B3: "ak", B4: "k" Give a finite sequences of indexes so that their concentration for A and B gives the same string. Repetitions allowed. In this example I can't find the solution but for example if...

Memory-efficient C++ strings (interning, ropes, copy-on-write, etc)

My application is having memory problems, including copying lots of strings about, using the same strings as keys in lots of hashtables, etc. I'm looking for a base class for my strings that makes this very efficient. I'm hoping for: String interning (multiple strings of the same value use the same memory), copy-on-write (I think this...

Can scanf identify a format character within a string?

Let's say that I expect a list of items from the standard input which are separated buy commas, like this: item1, item2, item3,...,itemn and I also want to permit the user to emit white-spaces between items and commas, so this kind of input is legal in my program: item1,item2,item3,...,itemn If I use scanf like this: scanf("%...

C# Strings - Simple syntax Question

Ok, I haven't programmed in C# before but I came upon this code and was wondering what it does. Now, I now that it just searches and find the first occurrence of "." and replaces it with "" but what exactly is in the ""? Would this just delete the period or is there a space character that replaces the "."? I'm trying to figure out how to...

Get an array from an HTML page?

I'm rather new to HTML programming. I understand the basics of interactive collection of input via forms. I'd like to collect some data computed by a JavaScript function during execution of a page. Not being able to think of an alternative, I think the way to do that is to enter the function result into a form variable. How do I do ...

set string to sqlbinary

Hi, I'm having issues with setting a string to sqlbinary or something like that. Example: The string comes from a csv file: 0x0000000001E5CFE7 It's read into string, but now I have to execute a stored procedure with the parameter timestamp, because it's an timestamp. Does anyone have an idea for me how to set this. ...

D2009 TStringlist ansistring

The businesswise calm of the summer has started so I picked up the migration to D2009. I roughly determined for every subsystem of the program if they should remain ascii, or can be unicode, and started porting. It went pretty ok, all components were there in D2009 versions (some, like VSTView, slightly incompatible though) but I now ha...

Parse a JavaScript string best practice

I have this var checkBox = e.target; var tableRow = checkBox.parentNode.parentNode; var key = tableRow.attributes["key"]; var aKey = key.nodeValue; at this point aKey = "[123]" what the best way to return 123 as an int in javascript? note that aKey could just as likely be "[5555555555555555555]" so I can't just grab c...

Convert double to string C++?

I want to combine a string and a double and g++ is throwing this error: main.cpp: In function ‘int main()’: main.cpp:40: error: invalid operands of types ‘const char [2]’ and ‘double’ to binary ‘operator+’ Here is the line of code which it is throwing the error on: storedCorrect[count] = "("+c1+","+c2+")"; storedCorrect[] is a stri...

Unexpected results with C# recursion method

I've got a fairly simple method which recursively removes begining/ending html tags class Program { static void Main(string[] args) { string s = FixHtml("<div><p>this is a <strong>test</strong></p></div>"); Console.WriteLine(s); } private static string FixHtml(string s) ...

Objective-C switch defines contents of string

Hi, I've come from a java background, so i'm still getting to grips with some of the ways of doing things with Obj-C. Depending on a number provided, I want an NSString variable to have different contents. In java I would do something like this: string foo; switch (numberToSwtich){ case 1: foo = "Something!"; break...

Oracle Builtin String Character Classes

Does Oracle have built-in string character class constants (digits, letters, alphanum, upper, lower, etc)? My actual goal is to efficiently return only the digits [0-9] from an existing string. Unfortunately, we still use Oracle 9, so regular expressions are not an option here. Examples The field should contain zero to three letters...

how to return an script in c / gcc?

guys, had been years since I wrote my last line in C, now I'm trying to start again to make some function and use than as an extension for php. this is an easy function to create "small urls" lets say: a0bg a0bf a0bh the problem I'm having is when I have to "increment" an string like zzz then I got: Bus Error otherwise if I increme...

How do I split a string by a multi-character delimiter in C#?

What if I want to split a string using a delimiter that is a word? For example, "This is a sentence". I want to split on "is". So I will get "This " and " a sentence". In Java, I can send in a string as a delimiter, but how do I accomplish this in C#? ...

Combinatorics : Grouping Characters Challenges

I was working on some grouping problems at my work. There are quite a few questions, please bear with me. I find them quite interesting. If anyone here is also interested in combinatorics, please help me out. Ok so we have a bunch of characters , here i have taken a i d s. What are the ways we can group the elements ? Let us say we ha...

understanding String^ in C++ .Net

I remember seeing somewhere there "^" operator is used as a pointer operator in Managed C++ code. Hence "^" should be equivalent to "*" operator right?? Assuming my understanding is right, when I started understanding .Net and coded a few example programs, I came across some code like this: String ^username; //my understanding is you ...

C++ string comparison in one clock cycle

Is it possible to compare whole memory regions in a single processor cycle? More precisely is it possible to compare two strings in one processor cycle using some sort of MMX assembler instruction? Or is strcmp-implementation already based on that optimization? EDIT: Or is it possible to instruct c++ compiler to remove string duplicates...