Is it possible to translate everething written in OCaml to PHP? for example will it be hard to translate such lib as lib for Fast content-aware image resizing
Hi,
What of this code is faster/more efficient? :
Boolean contains = myString.IndexOf("~", StringComparision.InvariantCultureIgnoreCase)!=-1;
or
Boolean contains = myString.IndexOf('~')!=-1;
I think the second because is a single character, but using the invariant culture ignore case comparer is supposed to be fast too :P
Cheers.
I use the following code to log a map, it is fast when it only contains zeroes, but as soon as there is actual data in the map it becomes unbearably slow... Is there any way to do this faster?
log_file = open('testfile', 'w')
for i, x in ((i, start + i * interval) for i in range(length)):
log_file.write('%-5d %8.3f %13g %13g %13g %13g %13g %13g\n' % (i, x,
map[0][i], map[1][i], map[2][i], map[3][i], map[4][i], map[5][i]))
i have written a object selection algorithm which picks the objects by there color. i give every object an unique color and then i just have to use the glReadPixels method to check which object was selected
this works fine and is really fast but the problem is that the frame is displayed on the screen with all the picking-colors so the screen flashes every time you select something.
so my question is: how do i write everything in the correct display buffer but dont display it on the screen to avoid these flashes?
Hi All,
The home page of my website and some other page also are taking some time to load, instead of making them load fast, I want some please wait screen or progress bar and mean while the required page would be loaded behind.
Is there any way to do it?
Thanks in advance
Using the standard VS IDE, is there a fast way to create class properties that are linked to the local variables?
The class diagram seems to provide something, but it basically just created a property stub. Is there something better / easier out there ?
In an application in Silverlight I'm working on, I need to track the moves of the mouse. My problem is that using the MouseMove event, I don't have a continuous set of points if the user moves the mouse fast enough (if I add each point in a list I can have (10,10) en then (20,20)...)
I'd like to have ALL points where the mouse has been during the move.
Do you have any idea ?
I am using this:
byte[] buffer = new byte[10240];
As I understand this initialize the buffer array of 10kb filled with 0s.
Whats the fastest way to fill this array (or initialize it) with junk data everytime?
I need to use that array like 5000 times and fill it everytime with different junk data, thats why I am looking for a fast method to do it. The array size will also have to change everytime.
Hi, i have a production server that does not have ftp access. Possible way to deploy files is connecting with remote desktop client and send files.
As you know this approach is highly hard and time inefficient.
Could you please provide me best practices to deploy in a more fast way?
Thanks
Things to take into consideration:
- easy to use
- fast
- use underlying OS as much as feasable (like wxWidgets for UI)
Ones I am leaning towards are wxWidgets for UI and Boost for networking - how do they compare to others?
How do I format an NSURL (what path, or path generator function) so that I can display a downloaded local file (NOT part of the application NSBundle) for use offline? The idea is to snag an HTML file, clean it up and stash it in the iFoo application specific storage area, then later use UIWebView to display it.
Next, I go off to RTFM about working with files on iFoo (iPhone / iPad) in general, but any fast-start tips are appreciated.
How do I do the following pseudo code in JQuery?
$(document).ready(function(){
$(".btn-slide").click(function(){
$("#divToSlide").slideToggle("fast");
if ($(this).isToggled) { // <---- DOESN'T WORK -------
// do something when toggled
} else {
// do something different when not toggled
}
});
});
I'm searching for a console code editor with CUA key bindings (ctrl-x c v etc.)
Right now i'm toying mcedit but i don't really like it. My desired features are:
* be fast
* CUA key bindings (ctrl-x c v etc.)
* toggle show line numbers
* find/replace/goto line
* bind custom keys to action( ctrl-shift-arrowdown to double the curent line etc.)
* nice simple vi-like interface (no pointless menus)
* be able to programatically extend it ...
etc.
The code like this:
$(".hide").click(function(){
$(".online-contact").animate({width: 'toggle',height: '100%'}, "fast");
$(this).hide();
$(".show-class").show();
})
I want to show the div with the class of show-class when the the animate function complete,what can I do it?
Hi, this is my first time using stackoverflow. pretty thrilled. lol
anyway, there are hell of a lot books there to teach you C++. But i was wondering whats the best well-known book to pick?
I have pretty solid base in programming and I just wanna go over it fast.
so any recommendations?! sorry for the cheesy question!
How can I look up a hostname given an IP address? Furthermore, how can I specify a timeout in case no such reverse DNS entry exists? Trying to keep things as fast as possible. Or is there a better way? Thank you!
I have a website with Dutch text which I want to translate to English. Is there a fast way of doing this with keeping the HTML tags(<strong>,<span>) in tact. I know I can just copy the parsed TEXT into a translator but this will remove the formatting.
I also know that at the end I have to go trough the text manually to fix some minor spelling and grammar.
I would like to get 2 random different elements from an std::vector. How can I do this so that:
It is fast (it is done thousands of times in my algorithm)
It is elegant
The elements selection is really uniformly distributed
Adobe flash: How to determine users CPU characteristics? (its mhz, its current ocupation) I need to know how fast is users computer now, and I have only 150 ms for it. How to do such thing in actionscript?
How can I get the number of times an NSString (for example, @"cake") appears in a larger NSString (for example, @"Cheesecake, apple cake, and cherry pie")?
I need to do this on a lot of strings, so whatever method I use would need to be relatively fast.
Thanks!
Hi,
I have queries that are built like this:
public static List<MyObjectModel> GetData (int MyParam)
{
using (DataModel MyModelDC = new DataModel())
{ var MyQuery = from....
select MyObjectModel { ...}
}
return new List<MyObjectModel> (MyQuery)
}
}
It seems that using compiled linq-to-sql queries are about as fast as stored procedures and so the goal is to convert these queries into compiled queries. What's the syntax for this?
Thanks.
This is quite a quick question. I currently use
do_this if (testvar ||= false)
Which works just fine.
But this approach unnerves me because while fast, it does not short-circuit like defined?(testvar) && testvar does, and it instantiates and assigns a value to a local variable that is subsequently never used, which seems inefficient.
I enjoy the very reasonable fact that instance variables are nil before assignment, but I'd like for the situation to be just as easy for local variables.
How do you, as a programmer, think that a technical report on a software should be done, in a manner that can optimize the task of another programmer take it and start feeling confortable with the code as fast as can.