Does anyone know how to return an ordered list of strings with null values last? I have something like this:
using(var context = new DomainEntities())
{
var result = context.Users.OrderBy(u = u.LastName).ThenBy(u = u.FirstName);
}
My problem though is that this query returns null values before non-null values.
Any thoughts?
We’ve got an interesting requirement that we’ll want to support multiple languages at runtime since we’re a service. If a user talks to us using Japanese or English, we’ll want to respond in the appropriate language. FxCop likes us to store our strings in resource files, but I was curious to know if there was an integrated way to select resource string at runtime without having to do it manually.
Bottom Line: We need to be able to support multiple languages in a single binary. :)
Is there a "smart" UDP protocol analyzer that can help me reverse engineer a message based protocol?
I'm using Wireshark to do the sniffing, but if there's a tool that can detect regularities in the protocol (repeated strings, bits of the protocol that are CRC/Checksum or length, ...) and aid the process that would help.
Hi,
In the Android application I am building, I want to be able to communicate with a local server developed in Django. (Basically a login page and a home page populated with posts and images from users) So do I need to use XML Parsers for the parsing the response from a Django server or is it possible for the server to respond with strings which can be directly used? Also what about images?
Regards,
Primal
I want to sort a list of strings based on the string length. I tried to use sort as follows, but it doesn't seem to give me correct result.
xs = ['dddd','a','bb','ccc']
print xs
xs.sort(lambda x,y: len(x) < len(y))
print xs
['dddd', 'a', 'bb', 'ccc']
['dddd', 'a', 'bb', 'ccc']
What might be wrong?
How to Find more than one string with Excel with the graphical interface?
For example, I am looking for the cells which is contained both strings Paul and John?
I have a binary files which needs to be sent as a string to a third-party web-service. Turns out it requires that it needs to be base64 encoded.
In ruby I use the following:
body = body << IO.read("#{@postalcard.postalimage.path}")
body is a strong which conists of a bunch of strings as parameters.
So...how do I base64 encode it into this string?
Thanks.
I will be setting the current thread's culture at the beginning of the request lifecycle.
Does it make sense if I create my own resource.xml to store things like strings/labels/messages that will be used in the web application?
or are their drawbacks and its better if I just use the Global resources .resx files that are 'built-in' ?
I have strings of this type:
text (more text)
What I would like to do is to have a regular expression that extracts the "more text" segment of the string, so far I have been using this regular expression:
"^.*\\((.*)\\)$"
Which although it works on many cases, it seems to fail if I have something of the sort:
text (more text (even more text))
What I get is: even more text)
What I would like to get instead is:
more text (even more text) (basically the content of the outermost pair of brackets.)
Thanks
Hi,
I need to figure out the value of data strings with jquery, for example like this:
{ label: "Beginner", data: 2},
{ label: "Advanced", data: 12},
{ label: "Expert", data: 22},
to add them up.
Something like:
var sum = data1+data2+data3;
alert(sum);
So the result for this example would be 36.
Appreciate your help!
Nicole
If I have a match operator, how do I save the parts of the strings captured in the parentheses in variables instead of using $1, $2, and so on?
... = m/stuff (.*) stuff/;
What goes on the left?
How does objdump manage to display source code? Is there a reference to the source file in the binary? I tried running strings on the binary and couldn't find any reference to the source file listed...
Thanks.
I've read lots of tutorials on how to deserialize a JSON object to an object of a particular using DataContractJsonSerializer. However, I'd like to deserialize my object to a Dictionary consisting of either Strings, Arrays or Dictionaries, such as System.Json does with SilverLight when I say JsonObject.Parse(myJSONstring).
Is there an equivalent to System.Json that I can use in my WPF project?
(just a short background: I'm fetching JSON objects that have way to much info, and I just want to use a little bit to fill out a String array)
Cheers
Nik
strip_tags only catches tags that have a beginning and end tag. With the strings I'm working with it's causing issues and I need to removed all HTML tags.
I need to convert a number which gives decimals in factored format in to decimals,
i.e. 11.16 is 11.5 in decimal. This is because 16 is in base of 32 and 11.16 should be read as 11+16/32 = 11.5
I get 11.16 as a string and I need to change it to 11.5 as numeric in MS SQL(2005) database.
Any shorter way of doing this rather than splitting strings,converting to numerics,maths,convert to string, concatenate and then convert to numeric?
I want a regex to find the following types of strings:
http://anything.abc.tld
http://anything.abc.tld/
where
abc - abc always remains abc
anything - it could be any string
tld - it could be any tld (top-level-domain) like .com .net .co.in .co.uk etc.
Note: The url must not contain any other thing at the end, means http://anything.abc.tld/xyz is not acceptable.
When a cell in a spreadsheet contains a simple date (mm/dd/yyyy) the poi API flags the cell-type as 'numeric'. This is probably because spreadsheets ( IMO ) historically recognize only strings and real numbers.
It is possible to hard-code the cell-index, and use it conditionally to call 'getDateCellValue'. But this feels like a hack.
What other ways are there in the poi API to determine whether the content in a cell is a Date rather than a real number?
What does the word "literal" mean when used in context such as literal strings and literal values? what is the difference between a literal value and value?
I am trying to create a .vcf file programmatically in C#, and writing a bunch of strings in the correct format in that file. But when i try to open it manually, the following message appears. Could not start Microsoft Outlook.The file maynot exist, you may not have permission to open it, or it may be open in another program.
Any help!!!
I have a variable $link_item, it's used with echo and gives the strings like
<span class="name">Google</span>http://google.com
How to remove "<span class="name">Google</span>" from string?
It should give just "http://google.com".
Heard it can be done with regex(), please help.
Hi,
I have a pom.xml that uses cxf-codegen-plugin to generate a couple of WS clients.
Inside the configuration of cxf-codegen-plugin, there are the WSDL locations.
I would like to externalize those strings to a env.properties file.
I used org.codehaus.mojo's properties-maven-plugin to look inside src/main/resources/conf/app/env.properties.
How can I make Hudson to replace those properties with the apropiate host?
Thanks in advance
I am attempting to make some data structures to solve a graph puzzle. I am trying to define an edge's comparison criteria, but I am not sure how. So far:
data Edge = Edge (Set String) Bool
How do I tell let the compiler know that I want edges to be declared equal if they have identical sets of strings, and not have equality have anything to do with the boolean value?
Does psycopg2 have a function for escaping the value of a LIKE operand for Postgres?
For example I may want to match strings that start with the string "20% of all", so I want to write something like this:
sql = '... WHERE ... LIKE %(myvalue)s'
cursor.fetchall(sql, { 'myvalue': escape_sql_like('20% of all') + '%' }
Is there an existing escape_sql_like function that I could plug in here?
(Similar question to How to quote a string value explicitly (Python DB API/Psycopg2), but I couldn't find an answer there.)
I have recently come across an interesting question on strings. Suppose you are given following:
Input string1: "this is a test string"
Input string2: "tist"
Output string: "t stri"
So, given above, how can I approach towards finding smallest substring of string1 that contains all the characters from string 2?