class test {
def buildObjects( rows ) {
def objects = []
def object
rows.each { row ->
if ( object == null ) {
// newObject() takes info from the row to use as properties of object
object = newObject( row )
o...
I am trying to optimize the division and modular operation to increase the overall performance of the code in C.
I have
UINT32 quo = num / 520 ;
UINT32 rem = num % 520 ;
Most of the blogs mentioned the optimization for the power of 2 operations like
num % (2^i) = num & (2^i -1 ).
num in my...
Is there a better way, or the correct one to have this approach for a JSON object that hast the following structure? (its only a portion of my object, the most important one)
{
"Questions": [
{
"AnswerType": "single-choice",
"Answers": [
{
...
i have serious problem with my hexadoku solver. I'd like to run the program under 2s but my solution solves it in cca 10s. Another problem is if the hexadoku has more then one solution, how i should just print the number of solutions.
http://paste.ofcode.org/36yfi4QBYLBtQarGi6p9GYA
My naive cod...
I notice the optimizing powers of 2 post was removed (never saw it so unsure why) -- a while back I wrote a program that split multiplication and division into a few bitshifts added/subtracted together to test web browsers (based on graphics programming ideas) - anyone else ever try that here?
betting that some of them used the computer more than others (using their own calculations) - compiled languages would of course have optimized that already...
not that anyone here seems interested in mathematical computational optimization at the moment i guess ;)
Once I copied over 400K rows of query results from SSMS to Excel, no sweat. ...well it was slow, and the computer froze for 10 good minutes, but it worked
this may be handly.. notes from experts exchange postings on the clipboard info-- anyone verify this? msdn.microsoft.com/en-us/library/ms810627.aspx ("Managing Virtual Memory in Win32"), you know that "Each process is attributed 2 GB of user address space no matter how much physical memory is actually available for the process."
from SetClipBoardData() api notes
it goes on to say that the ram is hindered by a whatever the application is taking out of that 2gb to run
not sure if that is the only way or the only function that sets the clipboard ram size though
Assembler: NASM
Architecture: x86(I believe)
I am fairly new to Assembly language programming and, for practice, I gave myself a problem.
The problem is to count down from 10 and right after 1, say "Blast off!"
Here is my code:
section .text
global _start
_start:
mov eax, '10' ; asci ...
I'm getting really sick of finding folks arguing about votes, only to see that the bickering started with a comment of the form,
-1, because [some perfectly reasonable criticism]
As has been discussed many times, voting is anonymous for a reason; folks who give up that anonymity do so at th...
Winter Bash 2014 is approaching! We signed up for it last year, and it was a really big hit. I'm still posting this in order to get an official word from the community and to make new users aware of this event.
Since the moderators have just received the announcement, there isn't much new info...
I found some information on clipboard ram by the way, apparently virtual memory does help (at least in windows 7) - HP has posted information to their users that they can increase pagefile size to increase clipboard space in their tech support files
they also mention that 64-bit would help over 32-bit as well like we were thinking
then AMD or Intel wouldn't matter, just the ram access
older languages used their own ram access programming, not hardware based, but newer stuff would most certainly be calling the API provided by things like dotnet's codebase
This is my first PHP/ MySQL project that I'm attempting. Im trying to make an address book function that I can addapt to put on my webiste, but it doesn't work at the moment. The error occours when I submit the information using the form and check on phpMyAdmin there is only a blank field imgur...
javascript answer posted after bounty intended for another answer. anyone want to vote accordingly on the new answer before I make a decision on who to award the bounty to? codereview.stackexchange.com/q/41238/18427
that makes sense, and most of what I have to do (add PHP) for my company work
i have only messed with python when I had to adapt a pre-made script for my purposes, been using PHP for nearly everything since that is the base for our architecture where I work
I believe Java game programming is possible once the new Java Value Types / Generics over Value Types (including Primitives) is a thing... Except it will be ages behind in libraries
In my college Java course, I wrote an ASCII Turtle Graphics. My professor said the only thing he could suggest was to turn the turtle into a class and create an instance of it (I hadn't because we hadn't covered classes yet). What do you think?
package javaapplication74;
import java.util.Scan...
With any game 'language; if they can create libraries that are able to go straight to the hardware then they have something. Java was originally not created for that but it has been around forever though.
In my college Java course, I wrote an ASCII Turtle Graphics. My professor said the only thing he could suggest was to turn the turtle into a class and create an instance of it (I hadn't because we hadn't covered classes yet). What do you think?
package javaapplication74;
import java.util.Scan...
I believe there is a term for a person who uses 'expert sounding' terminology and exudes confidence, even when their actual abilities are significantly short of their 'presentation'.
Using 'wine' a subject.... if a person described a taste as:
Magnificent bouquet, the esters resonate with hi...
a few days ago i mentioned an employer of mine who was acronym crazy... he actually used that in his sales pitch (that we are up on all the latest ones) -- i really hated that
@RubberDuck On a more positive note, they have rescinded the shutdown of the Vim site proposal. Now we merely have to gather supporters again from scratch.
@RubberDuck vi (and vim which is a version of vi) are text based linux/unix editors
they are originals from early in the computer science field - used for nearly everything on old machines that had no real capabilities (pre-dialup etc...)
Proposal: Vi and vim
There was already such a proposal and it was declined. Don't follow this.
Reason was that VI and VIM are on topic on SO and a separate site would pull content.
The Rubberduck Saga continues as I find a need to roll my own configuration. Since the program is really a *.dll and available to several host applications, using app.config is not an option. I decided to leverage XML serialization to allow a user to modify which comments get picked up in the Tas...
Please post your nominations for the Best of Code Review 2014 - Lots of Laughs category.
Answer that makes the best use of humor to illustrate a point.
In your nomination post, please make sure to include a link to the nominated answer, as well as a short explanation of what makes that post...
Please post your nominations for the Best of Code Review 2014 - Exterminator category.
Answer that points out the most interesting obscure bug in the original code.
In your nomination post, please make sure to include a link to the nominated answer, as well as a short explanation of what ma...
Please post your nominations for the Best of Code Review 2014 - Best Title category.
The question with the best title.
In your nomination post, please make sure to include a link to the revision of the question (from the revision history) that introduced the nominated title, as well as a sh...
take collection of Object from JavaScript into Java project. My codeI think very rough. How improve this code? What the best solution?
// JavaScript fetch data into List ChartData
int i = 0;
int k = 0;
// output
for (Object currObj : ChartData) {
// get all fields of Object
for (F...
Things you could improve
Efficiency
As @rolfl stated, you want to use a Sieve of Eratosthenes (+1 to that answer).
I can't see if you are doing this already, but you should be compiling with your compiler's highest optimization level. With GCC for example, this would be -O3.
Portability
...
I haven't used Python in a number of years, but recently started working on a project called Photoshell which is written in Python 3.
As I attempted to learn the "Pythonic way", I wrote a parser for Canon's CR2 raw image file format. I'm not sure how "pythonic" the parser is, so I'd love to get ...
This is a question from a phone interview i had,
The Question was 2 parts:
a. find("cat") -> T/F suggest a data structure to find is if a word exists in a large dictionary, how will one node of that data structure will look like?
b. Implement bool Find(string str) function which returns true or ...
Not sure if this belongs here or Stack Overflow, but let's try it anyway.
Is there a shorthand method to write the following code? Often in games we want to make sure certain things dont leave a boundary, or more generally, we want to stop an index of an array from going beyond the bounds of an ...
I have OHS 11g running with default MPM ( worker). I want OHS to create 1 child process only.
Below is the httpd.conf section:
<IfModule mpm_worker_module>
StartServers 1
MaxClients 150
MinSpareThreads 10
MaxSpareThreads 30
ThreadsPerChild 40
MaxRequestsPerChild 0
Ac...
private static int Sum (int[] a, int from, int to){
int total=0;
for (int i=from; i <= to; i++)
res += a[i];
return total;
}
public static int Method3 (int []a){
int temp=0;
for (int i=0; i <= a.length; i++)
{
for (int j=0; j <= a.length; j++)
{
...
I have created a directive which is doing several things, all revolved around adding and active class to navigation elements when clicked. It also adds the class when someone goes directly to the url. I'm fairly new to writing directives and this one seems like it would be something I'd like to r...