# All Questions

67,810 questions
Filter by
Sorted by
Tagged with
484 views

### Emulator for representing hardware and operating systems

This is an emulator I am currently re-writing for my Operating Systems course. It is a simple emulator that is supposed to represent hardware, OS, etc. It is strictly for learning purposes and I want ...
2k views

### Is catching 'expected' exceptions that bad?

I had to find the corresponding process for a windows service the other day, and I kept on getting this one exception. I've spent some time researching the exception only to find that this exception ...
479 views

...
2k views

### How can I improve this PHP MySql Rank generation function?

How can I improve this PHP MySql Rank generation function? (Mostly looking to improve speed, but any feedback is very welcome) Right now I keep stats and ranks in 2 separate tables. The only ...
3k views

### Iterator over row and columns

I am writing a simple raytracer just for fun. I want to iterate over rows, and each row must be an iterator over columns. A strategy I produced is the following: ...
2k views

### Traversing a BST in iterative inorder

Traverse a binary search tree in iterative inorder. Note that the iterative methods below contain the meat of the code; the remaining code is included for completeness. ...
314 views

### Collapsing Folder Trees with Ruby

This is a quick script I whipped up to collapse some folder trees down to individual folders. The specific situation that arose was my formerly-itunes collection (it's currently organized ...
155 views

### How can i make my Get_Numb_of_Digits_in_a_number() function more accurate?

Here's my function but it sometimes has unpredicted results with entering different numbers but with the same number of digits getting different results. I figure it has something to do with a ...
336 views

### Set of linear equations

I have $N^2$ matrices. Each one is a $3 \times 3$ matrix. I want to concatenation them to a $3N \times 3N$ matrix. I know that the big matrix is symmetric. Evaluation of whole \\$ 3 \times ...
197 views

### all the ways to fit some pegs into given holes

Suppose you have a list of the diameters of some circular holes, and a list of the diameters of some cylindrical pegs. Now the problem is finding all the ways you can fit the pegs in the holes, where ...
5k views

### Parsing strings with escaped characters using Parsec

I have been working through the exercises in a Write Yourself a Scheme in 48 Hours/Parsing and hacked together something to get parseString to comprehend escaped characters. Also had some inspiration ...
15k views

### Handling click events to open and close menus depending on the click target

I'm building a navigation that has a breadcrumb with drop down menus. I want the menus to open up when I click the open link, then there are many instances when the menu should close: The link is ...
1k views

Here's some explanation for accuracy and neg_accuracy: It's meant to keep all the values in terms of what the user specified he ...
26k views

### Learning OOP PHP, simple MySQL connection class.

I have posted an earlier version of this and here is the improved version from the feedback I recieved. Some of the feedback I received was; Don't chain method (tried my best to limit this) Do not ...
1k views

### Is this a good way to store error messages to display back to the user?

I use the following code to put all of my error messages for the application in one javascript variable. Is this efficient way to store my error messages? ...
1k views

### “Pluggable” routes in ASP.NET MVC

How do I handle multi-tenancy with routes in ASP.NET MVC? The application is a multitenant ASP.NET MVC 3 application. Tenants are identified based on hostname so this does not interfere with routing. ...
481 views

### Directed graph similarity calculation — optimizing Mathematica code

I am looking to optimize the following computation. First, some explanations: Explanation I have a directed graph whose adjacency matrix may only contain 1s and 0s. The similarity of nodes i and j ...
145 views

I think that the slice() is a bit hacky, and prone to breaking if I change my mind about the id names, but I wanted this to be ...
571 views

### Find number of divisors for integer and sum of integers

This function computes and returns the number of divisors an integer has. But it is very slow and I believe it can be optimized for speed. ...
427 views

### Working with databases in PHP

I am 100% self-taught, and so I try to read as much as I can about best practices, conventions, etc. However I freelance, and have been in a long-term contract position for the past little while with ...
10k views

### SQL: Search for a keyword in several columns of a table

I want to perform a search in several columns of a table. I use the following query: ...
2k views

### Anti-Bot comment system

With some advice from SO, I developed this system, which I think is quite strong for bots to automatically post comments. index.php ...
247 views

### Critique some Ruby + RSpec Code for a SERP checker

I found a SERP checker written in PHP and I decided, in order to better learn to program, I would re-write it in Ruby. All I have written so far takes a list of keywords that a user inputs and cleans ...
749 views

### IMapDocument in a 10.1 SOE

I am wondering if this code will work in 10.1. This video at 1:02 says not to create mxd based services. I think that just means not using IMapServerObjects3, but seems like IMapDocument should be OK....
832 views

### Pig Latin Translator - follow-up

About a week ago, I put up this code and got some really good help. I've modified it a bit and was seeking if someone would review my second iteration. Original can be found here. Here's the new ...
3k views

Beeing on .NET 3.5 i don't have access to the TPL. Yet i have become fed up of having to manage manually the logic behind delegate.BeginInvoke type of scenarios each time and i set up to implement my ...
55k views

### Simplify splitting a String into alpha and numeric parts

Requirement: Parse a String into chunks of numeric characters and alpha characters. Alpha characters should be separated from the numeric, other characters should be ignored. Example Data: Input ...
2k views

### Improve this function that compares jQuery versions

Please help me improve this function that compares the jQuery version currently available (or not) with the one required. ...
1k views

### To make a calculator from scratch

As a personal challenge, I am trying to make a very basic calculator without using any CLR's integer and arithmetic operations, but to only use memory. The idea was to do what CLR/OS does. i came up ...
464 views

### waitForIt Plugin

Anyone want to comment on this plugin I'm making? (improvements, etc) ...
206 views

### service build with perl - is it correct

I tried putting a script i saw together, plus used an existing script to make something run as a service. Now I have the following pl script and the init.d / start/stop scripts. They work, but I am ...
244 views

### On demand JS loader review

At my work, I need to create a script that third-party webmasters could include in their pages without need to include something else. But this script had dependencies on jQuery and some amount of ...
1k views

### Find the no of pairs whose sum divides the product from 0 - 1000000000

I have designed the code but the problem is it timeouts as the range is 1000000000 but works fine with 1000. Any idea to optimize this or a mathematic logic for it? I just need to find the no of ...
2k views

### Event Registration

I am new to the world of coding, PHP as well as XHTML. As my first stab at object oriented coding, I put together a basic registration form that is meant to serve as a means to collect user details. ...
2k views

### File-serving Twisted resource

I've just written this Twisted resource base class for serving files. It's part of a larger application, this is just for serving its images, JavaScript files, etc. Is it okay? I wonder if checking ...
34k views

### Caesar Cipher program in C

I'm a beginner-intermediate C++ programmer, and I never used or understood C input & validation. I just always used C++ streams. Anyway, I just want code critique, as I have never used the C ...
556 views

### MySQL connection class

I am trying to learn OOP using PHP5 and I wrote a simple MySQL connection class. Please take a look and give me some feedback on better practices, critical errors, and any other feedback you can ...
518 views

### Session in database

I'm posting my PHP code for sessions using MySQL. Please tell me if there are any errors, if it can be optimized, or if security can be enhanced. Host: localhost User: root Password: "" Database: pro ...
165 views

### Coercion of arguments using successive raising

From SICP: Exercise 2.84 Using the raise operation of exercise 2.83, modify the apply-generic procedure so that it coerces its arguments to have the same type by the method of ...
1k views

### TextWriterTraceListener class

I need to extend the default TextWriterTraceListener class to include timestamps with each message on same line and file rotation. I can't seem to find any way of ...
4k views

...
213 views

### Checking user mouse movement

I am trying to update my server to let it know that the user had some activity in the past 15 minutes. In order to do that, I made this implementation: ...
2k views

### Pig Latin Translator

Could someone review the following code? ...
1k views

### Javascript filter class to hide and show content on data-attributes

I'm a hacker, not a trained engineer. I ask/answer specific questions on StackOverflow and am pretty confident in my ability to get the browser to do what I want, I thought I could benefit a great ...
124 views

### Keys in mode maps

I noticed a pattern in some elisp modes I was putting together: (let ((map (make-sparse-keymap))) (define-key map KEY 'FN) ... (setq FOO map)) so I wrote ...
249 views

### List of integer factorization into n terms

I want the fastest way in Mathematica 7 to generate a list of the factors (not prime factors) of an integer into a specified number of terms, with each factor greater than one. For example, 240 into ...
1k views

### Activating items in some randomized arrays

I've got a list with about 120 items in IE and I have some items I want to activate. I compare, build and randomize some Arrays on the fly. The for loop in the run()...
5k views

### Binary tree in Python

As a Python newbie, I have coded this binary tree as best as I could to follow Python idioms. However, I know it is still very verbose and not up to standard. I would like Python experts to tear this ...