Using the stock Sun 1.6 compiler and JRE/JIT, is it a good idea to use Duff's Device to unroll a loop? Or does it end up as code obfuscation with no performance benefit.
I found the following claim in the documentation for Net::OpenSSH:
Note that using password
authentication in automated scripts is
a very bad idea. When possible, you
should use public key authentication
instead.
What's flawed in using password authentication in automated scripts?
I've read somewhere that functional programming is suitable to take advantage of multi-core trend in computin.. I didn't really get the idea. Is it related to the lambda calculus and von neumann architecture?
I am trying to define a mapping for Ctrl+. as follows:
map <C-.> :bn<CR>
This does not work. Typing Ctrl+. just results in repeating the last action just as you would get when typing .. Note that I do not want to change the behaviour of .. Any idea how to get this to work?
And is there an elegant linqy way to do it?
What I want to do is create string of given length with made of up multiples of another string up to that length
So for length - 9 and input string "xxx" I get "xxxxxxxxx" (ie length 9)
for a nun integral multiple then I'd like to truncate the line.
I can do this using loops and a StringBuilder easily but I'm looking to see if the language can express this idea easily.
(FYI I'm making easter maths homework for my son)
IM DEVELOPING AN ANDROID APPLICATION WHERE in a website i PROGRAMMATICALLY submit data into search box and retrieve results by JAVA.
i get the data by using URLConnect JAVA. i get the source code ie html code......
Urlconnection a = .connect to host
getinputstream
read data
i use these functions
now if the site has content like:
sahil
3/5 patel chowk
965955
since these details will be inside html tags i want to extract this information . any idea
These characters show fine when I cut-and-paste them here from the VisualStudio debugger, but both in the debugger, and in the TextBox where I am trying to display this text, it just shows squares.
??\r\n???????,3-9 ?????????,???2 ?,???3 ?;10 ????4 ???????????,???2 ??\r\n??\r\n??????????,???????\r\n
I thought that the TextBox supported Unicode text. Any idea how I can get this text to display in my application?
I have a mysql database with 60 tables most of the tables have primary keys (expect pivot tables) all these primary keys had the attribute AUTO INCREMENT
Then over night some how all the primary keys had that attribute removed, and the default value set to 0.
I have no idea how this may have been caused. Any suggestions?
I'm not big on creating GUI's, and generally my philosophy is: I don't create them, or I make them as simple as possible (and convince myself that it's better for usability :)
For my current project, I'm using Qt from Python (PyQt), and I want to start adding some GUI elements without cluttering the interface.
My idea is to create these elements as sort of floating-shaped-widgets that only appear when necessary; pretty much like the status bar (and find bar) in chrome.
Is there any standard api that enables creating this kind of interface?
Given a integer number and its reresentation in some arbitrary number system. The purpose is to find the base of the number system. For example, number is 10 and representation is 000010, then the base should be 10. Another example: number 21 representation is 0010101 then base is 2. One more example is: number is 6 and representation os 10100 then base is sqrt(2). Does anyone have any idea how to solve such problem?
Hi,
I am fetching a RSS, in which i receive the following Date stamp:
2010-05-10T06:11:14.000Z
Now i am using NSDateFormatter to parse this datetime stamp.
[parseFormatter setDateFormat:@"yyyy-MM-dTH:m:s.z"];
But its not working fine if just remove the time stamp part it works for the date [parseFormatter setDateFormat:@"yyyy-MM-d"]; But if i add the rest of the stuff it returns nil.
Any idea ?
Thanks in Advance....
Is it possible to have a UITabBarController inside a UINavigationController? Interface Builder seems to dislike the idea. Although I can create a View with a "Tab Bar" and add "Tab Bar Items", this feels like a hack.
Thanks,
Andy
This code:
foreach my $file (@data_files) {
open my $fh, ',', $file || croak "Could not open file $file!\n";
my @records = <$fh>;
close $fh;
....
}
produces this error:
readline() on closed filehandle $fh at nut_init_insert.pl line 29.
and I have no idea why.
I have the datepicker component in the format of MM/dd/yyyy, But I want to create date picker in java the form of dd/MM/yyyy. So where can I get the suggestion or related solutions. Please give the basic idea about that.
Thanks in Advance..
In the code below if I get into the if statement I can safely say my site is under attack. What information is it a good idea to log?
Any recommendations on actions that can be taken to minimize the damage at this point?
protected void btn_Search_Click(object sender, EventArgs e)
{
if(tb_SearchBox.Text.Length > tb_SearchBox.MaxLength)
{
//What should i log?
//What actions should I take?
}
//Otherwise search
}
say I have:
class Test
{
public static int Hello = 5;
}
This obviously works:
int j = Test.Hello;
But why should this not work?
Test test = new Test();
int j = test.Hello;
The instance could not have a member equally named, so I don't see how this could be ambiguous or unresolvable for a compiler.
Anyone any idea why this is?
MSVC's "secure" sprintf funcions have a template version that 'knows' the size of the target buffer. However, this code happily paints 567890 over the stack after the end of bytes...
char bytes[5];
_snprintf_s( bytes, _TRUNCATE, "%s", "1234567890" );
Any idea what I do wrong, or is this a known bug?
(I'm working in VS2005 - didn't test in 2008 or 2010)
hello
i want to add a headers and index to a list in pyqt , it's really not important what list of QT (qlistwidget , qlistview , qtablewidget, qtreeview)
in short .. i want something like the spin box delegate example in the pyqt demo ...
but instead of the index in the column headers i want a strings ...
hope the idea is clear enough
thanx in advance
Hi, I am trying to implement a Newsletter feature for my website www.cricandcric.com
Can you please tell me is that a good idea to develop a code or
Shall I get a open source to integrate this feature in the site?
if Yes, which Open Source Is good for this feature(without any Malware, Spyware, Spamming feature)
Can you please guide me on this?
Hello,
I'd like to brush my brain to avoid confusions. In few words, what can be said about Mocking process in TDD
What's the GREAT idea behind MOCKING?
Mocking frameworks are meant to be used only to avoid accessing DB during tests or they can be used for something else?
For new comers (like me), are all the frameworks equal or I need to choose one for this or that reason?
Thanks for helping
Hello, everybody!
May be that is a stupid question. How to create, say, 30 arrays (it doesn't matter of what type, say, char[])? It seems to me that it is not a good idea, to create them one by one by hand. I want to do that using a "for" cycle, but how should I specify identifiers?
The javascript on my online store product pages seem to have stopped working. They still work fine on Firefox.
You can see the problem by clicking the "Add to Cart" or clicking on the image to enlarge on this page:
http://twistedtime.com/idea-takumi-led-black.html
Anyone know what the problem could be?
Thanks!
Does anyone know of a way to use the mxmlc task of the Flex Ant tasks with a user-definable list of source path or library paths? The idea is that the user can define an arbitrary list of source paths and/or library (swc) paths into an Ant properties file and the build file takes these values and evaluates them for use in the mxmlc task. Just wondering if there are any tricks (maybe utilizing filtering/string replacing) to get this working?
Hey guys,
I wanted some help with trying to implement a simple polymorphic relationship using Entity Framework.
An example of a relationship I would like to implement:
Comment table
ItemType ('Video', 'User')
ItemID
Body
Video has many Comments
User has many Comments
No idea the best way to do this, I come from a Ruby on Rails way of thinking.
When a user logs in to my site, I create a cookie with some info in it. However, whenever they change page from logging in, the cookie loses it's value. Cookie is still there but it's empty.
I've checked my code and the cookie doesn't get rewritten by anything I've done.
Does anyone have any idea to why the cookie becomes empty when the page is changed?