Does Java have any functionality to generate random characters or strings? Or must one simply pick a random integer and convert that integer's ascii code to a character?
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 ?
I'm storing color values as HEX in my database, which is mapped via ORM settings in CF9. When my color values are entirely numeric (e.g. 000000), ColdFusion is serializing them as numbers (e.g. 0.0) when returned from my CFC as JSON. Is there a way to force these columns/properties to be serialized as strings?
I have 3 separate strings:
$d = 'Created on November 25, 2009';
$v = 'Viewed 17,603 times';
$h = '389 hits';
Which needs to be converted to:
$d1 = {unix timestamp of November 25, 2009};
$v1 = "17603"; (commas stripped if it exists)
$h1 = "389";
What is the most efficient way to do this (possibly with regex)? Any code snippet would be great.
I'm currently trying to get into the Java EE development with the Spring framework. As I'm new to Spring, it is hard to imaging how a good running project should start off.
Do you have any best practices, tipps or major DO NOTs for a starter? How did you start with Spring - big project or small tutorial-like applications? Which technology did you use right away: AOP, complex Hibernate...
I've got a mysql dataset that contains 86 million rows.
I need to have a relatively fast search through this data.
The data I'll be searching through is all strings.
I also need to do partial matches.
Now, if I have 'foobar' and search for '%oob%' I know it'll be really slow - it has to look at every row to see if there is a match.
What methods can be used to speed queries like this up?
G-Man
A question I got on my last interview:
Design a function f, such that:
f(f(n)) == -n
Where n is a 32 bit signed integer; you can't use complex numbers arithmetic.
If you can't design such a function for the whole range of numbers, design it for the largest range possible.
Any ideas?
How can I write a regex to match strings following these rules?
1 letter followed by 4 letters or numbers, then
5 letters or numbers, then
3 letters or numbers followed by a number and one of the following signs: ! & @ ?
I need to allow input as a 15-character string or as 3 groups of 5 chars separated by one space.
I'm implementing this in JavaScript.
We've got Ultraseek 5.7 indexing the content on our corporate intranet site, and we'd like to make sure our web pages are being optimized for it.
Which SEO techniques are useful for Ultraseek, and where can I find documentation about these features?
Features I've considered implementing:
Make the title and first H1 contain the most valuable information about the page
Implement a sitemap.xml file
Ping the Ultraseek xpa interface when new content is added
Use "SEO-Friendly" URL strings
Add Meta keywords to the HTML pages.
I am producing a javascript-based widget. Nothing complex just a few document.writes...
When I place it inline in the page it renders fine in all browsers. When I place it externally and load it via it fails to render in Firefox and IE but not Chrome.
Anyone know why and a possible workaround?
i've got an mvc project written in C#. i'm trying to reference it from ironpython. i've got no issue importing the objects and referencing the dll, but some of the objects rely on connection strings from the web.config, is there any way for me to reference the dll and then specify the web.config it should be using?
I have a class with 2 strings and 1 double (amount).
class Donator
string name
string comment
double amount
Now I have a Array of Donators filled.
How I can sort by Amount?
What is the difference between the following declarations:
int* arr1[8];
int (*arr2)[8];
int *(arr3[8]);
What is the general rule for understanding more complex declarations?
must you convert from strings to double? if so. how?
Are there functions for trig that will accept textbox string data as is?
Is there a way to pull the data from the textbox as a numeric value, not as a string?
I'm having some issues trying to change the look / style of a combo box in Expression Blend / WPF. While there are tutorials out there describing setting styles for buttons, there seem to be a few wrinkles with ComboBox controls.
Can anyone offer any advice, or point me towards good tutorials that cover re-styling something more complex than a button?
Hi All,
I am trying to compare to textbox values on an aspx form. Both the values represent dates. The are formatted like "dd/MMM/yyyy". How can I compare them in javascript to see if they are not equal and which one is greater etc... Does javascript have a date constructor for strings like this? Any tips would be appreciated. Thanks for the help.
Cheers,
~ck in San Diego
I am using following directives in my htaccess to remove trailing slashs from my uris to prevent duplicate content. However these directives also remove any query string, that might be present.
RewriteCond %{HTTP_HOST} ^(www.)?mydomain\com$ [NC]
RewriteRule ^(.+)/$ http://www.mydomain.com/$1 [R=301,L]
I'd like to know how to remove a potential trailing slash from my URI, but also preserve query strings.
My app is a very complex game that uses json objects to store its execution state (aka save games). I'm looking for a nice database script that can talk json and interact with javascript via ajax.
Hi,
I am drawing strings in a rectangular frame. The string is drawing perfectly. Now I need to write test cases using sentesting kit. I have no ideas from where I should start. For help I have also seen the iPhone sample calculator application
But still out of sorts.
Any body having ideas please help.
Thanks,
Madhup
I have a Word document which is several hundred pages long.
I would like to use a macro to automatically create about a dozen or so sub-documents based on certain rules (mainly, occurrence of certain strings in each Section).
Is this possible? What VBA functions should I read-up on? Does anybody know of any code examples which are even remotely similar and which I may be able to customize for my purposes?
Thanks
For a multiplayer game I'm working on I'd like to record events to the mysql database without blocking the game update thread so that if the database is busy or a table is locked the game doesn't stop running while it waits for a write.
What's the best way to accomplish this?
I'm using c3p0 to manage the database connection pool. My best idea so far is to add query update strings to a synchronized list with an independent thread checking the list every 100ms and executing the queries it finds there.
Hi there,
If i have an array of strings for example
Static final String[] TEST = new String[] {
"g","a","b","t","e" };
How would i go about sorting this in alphabetical order please?
hey guys i need to implement a standard encryption decryption logic across an entire project platform which has different clients implemented using different platforms as follows:
1) iphone app (objectiv c)
2) website (classic asp)
3) webservice (asp.net)
the iphone app as well as the website need to send info to webservice using encrypted query strings
the web service then decrypts this and processes the info further
wanted to know the simplest way to achieve this. is there some free and ready to use binary available with an easy to use api to achieve this?
encryption needs to be as secure as possible
thnx in advance
Which language would you propose for solving a system with:
first order differential equations
complex variables
N-dimensions
using 4th order Runge Kutta or the like.
Speed matters a lot but would sacrifice for:
Elegant (clean and short) code
Flexibility + scalability
I'm mostly between a Lisp and OCaml but any other suggestion is welcomed.
Thanks!