I don't mean scripts or tools for your work project.
I mean actual software for your personal use, such as party organizer, CD administrator, whatever.
Getting the subdomain from a URL sounds easy at first.
http://www.domain.example
Scan for the first period then return whatever came after the "http://" ...
Then you remember
http://super.duper.domain.example
Oh. So then you think, okay, find the last period, go back a word and get everything before!
Then you remember
http://super.duper.domain.co.uk
And you're back to square one. Anyone have any great ideas besides storing a list of all TLDs?
John
I'm in search of and useful source of knowledge on Optical/Intelligent Character Recognition, Image and Pattern recognition.
Any books, papers, websites and whatever.
Thanks!
Since naming is a so important thing in programming, I would like to start a thread for giving help to all those that have same problems as I sometimes.
Rules: Set a post with the description of the form||control||class or whatever you need to find a good name for. Get name hints in the answers.
Something I wrote throws a lot of AttributeErrors when using time.strptime() inside a thread. This only seems to happen on Windows (not on Linux), but whatever…. Upon a'Googling, it seems that time.strptime() isn't considered thread-safe.
Is there a better way to create a datetime object from a string? Current code looks like:
val = DateFromTicks(mktime(strptime(val, '%B %d, %Y')))
But, that yields the AttributeErrors as its run inside a thread.
Thanks!
Hello,
I would like to generate a random filename in unix shell (say tcshell). The filename should consist of random 32 hex letters, e.g.:
c7fdfc8f409c548a10a0a89a791417c5
(to which I will add whatever is neccesary). The point is being able to do it only in shell without resorting to a program.
I am using the CKEditor for my website along with PHP, and want to allow only <b>, <i>, <a>, and <img> tags. This is easy, however our problem is that a user could essentially add a <b> tag some where and then not close it resulting in all of the comments thereafter and the rest of that page being bolded.
How do we check and make sure that whatever tag is opened is now closed?
DISCLAIMER:
THIS QUESTION WAS NOT MENT TO BE ARGUMENTATIVE!!!!!!!
What is fastest and less memory draining way of searching a key-value pair? I will be storing items in a key-value like relation and I need to access them quickly. Should I use a SQLite database? A Map? A Hashtable? A HashMap? Please give some advantages/disadvantages of using whatever method of searching.
There are times when I find some example XAML that I want\need to do in code (c#\vb.net).
I assume at some point the XAML becomes code, or at least IL.
So my questions:
Am I correct in assuming that XAML is converted to IL? (or if not IL what does it become?)
If the above is correct, when does XAML become IL (or whatever it becomes)?
Is there some way to see the XAML in as "code"
Thanks.
What is the best SQL query to remove any text within parenthesis in a mySQL database? I'd like something that works regardless of the position of the parenthesis in the text (beginning, middle, end, whatever). I don't care about keeping the text inside the parenthesis, just removing it.
Thanks!
I have a PCRE regex that looks like this
s/(<input.+?)alt(=".+?".*?>)/$1title$2/
Can anybody help me with making that work on sed?
Eventually can anybody point me to some guide/blog post/whatever that explains differences between sed regex and PCRE?
I'm trying to run a rather large query that is supposed to run nightly to populate a table. I'm getting an error saying Incorrect key file for table '/var/tmp/#sql_201e_0.MYI'; try to repair it but the storage engine I'm using (whatever the default is, I guess?) doesn't support repairing tables.
how do I fix this so I can run the query?
The constant 0 is used as the null pointer in C and C++. But as in http://stackoverflow.com/questions/2389251/pointer-to-a-specific-fixed-address there seems to be some possible use of assigning fixed addresses. Is there ever any conceivable need, in any system, for whatever low level task, for accessing the address 0?
If there is, how is that solved with 0 being the null pointer and all?
If not, what makes it certain that there is not such a need?
If you have a bean with a getFoo method, how does whatever framework you're using know how to call the getFoo method when you ask for the value of foo? Is this done using the reflection API? Or is it somehow done using annotations? Obviously I know how you can derive the method given the name of the property, I just don't know how the method is invoked.
I have 1 NSMutableArray and I want to convert whatever data in array will be in NSString.
tell me code for that. Array is nothing but object of NSMutableArray class.
I've to create a dataset from some text files, writing them as vectors of features.
Something like this:
doc1: 1,0.45 6,0.001 94,0.1 ...
doc2: 3,0.5 98,0.2 ...
...
each position of the vector represent a word, and the score is given by something like TF-IDF.
Do you know some library/tool/whatever for this? (java is better)
I need to validate a Perl hash of hash element such as $Table{$key1}{$key2} exist and defined. Here is what i do. (i have no idea key1 even exist)
if
((defined $Table{$key1}) &&
(exists $Table{$key1}) &&
(defined $Table{$key1}{$key2}) &&
(exists $Table{$key1}{$key2}))
{
#do whatever
}
Is there an easier and cleaner way to do it?
Hi everyone. I'd ideally like a vim answer to this:
I want to change
[*, 1, *, *] to [*, 2, *, *]
Here the stars refer to individual characters in the substring, which I would like to keep unchanged. For example
[0, 1, 0, 1] to [0, 2, 0, 1]
[1, 1, 1, 1] to [1, 2, 1, 1]
If people know how to do this in perl or python or whatever, that would be equally good.
Cheers
Assuming you can't use Linq for whatever reason, is it a better practice to place your queries in stored procedures, or is it just as good a practice to execute ad hoc queries against the database (say, Sql Server for argument's sake)?
When i execute my code i am getting this error
LPTSTR lpBuffer;
::GetLogicalDriveStrings(1024,lpBuffer);
while(*lpBuffer != NULL)
{
printf("%s\n", lpBuffer); // or MessageBox(NULL, temp, "Test", 0); or whatever
lpBuffer += lstrlen(lpBuffer)+1;
printf("sizeof(lpBuffer) %d\n",lstrlen(lpBuffer));
}
OutPut
C
sizeof(lpBuffer) 3
D
sizeof(lpBuffer) 3
E
sizeof(lpBuffer) 3
F
sizeof(lpBuffer) 0
I'm working on a PyGTK app with some Buttons that, when clicked, give a text entry dialog, then set the text on the button to whatever was entered in the box. The problem is that if the text is longer than the button can show, the button changes size to accomodate. How do I keep GTK Buttons from resizing when the text changes?
Hi. This question isn't about popping up an iframe inside a Lightbox; rather, it's about an iframe on a page that can launch its own Lightbox-style box in the page that contains that iframe. I'm thinking this can't be possible, because the iframe contains the contents of the other URL and whatever Lightbox that URL launches has to fit within the iframe. Thanks.
I'm attempting to hook into whatever explorer calls when a file is opened (double-click, context menu open, etc.), however I can't figure out which function that is.
Originally, I thought it was ShellExecute, as that does the same thing as far as I can tell, but after hooking into it I learned that it's only used when a new explorer window is opened.
Any ideas which function I should be hooking?
Is it possible to create a file that will contain its own checksum (MD5, SHA1, whatever)? And to upset jokers I mean checksum in plain, not function calculating it.
Hi,
I'm in charge of an oracle db where we don't have any documentation (at all). And at the moment I need to know HOW a table is getting populated.
Ideally, I'd like to know from which procedure, trigger, whatever... this table gets its data from.
Any idea would be much appreciated.
Thanks.