All Questions

Filter by
Sorted by
Tagged with
4
votes
1answer
638 views

Carousel for website

I have been building my own carousel over the past few days. I am not a jQuery guru, just an enthusiast, and I think my code is a little sloppy, hence the post. Basically what happens is: If someone ...
6
votes
1answer
1k views

MVC Async Action Invoking Workflow

I've just started working with Workflow (WF4) and have been playing with an idea of using it in MVC3.0 controller actions to see if it improves the maintainability of complex actions; also potentially ...
0
votes
1answer
482 views

JSON formatting and processing hierarchies

I have a properties file I'm using for GIS software. You have a feature like a road, then properties under it, like so: ...
3
votes
2answers
213 views

Application for allowing a user to “follow” another user

I have taken a stab at creating my first jQuery script from scratch. I use this to post an update to a Django application that allows a user to "follow" another user. I am sure that there are better ...
10
votes
3answers
4k views

Read a space delimiters settings file in C

I'm a C# programmer and I would like to start getting better at coding in C. I wrote a function which reads a space delimiters settings file (supports comments / and #). The code works fine. But from ...
2
votes
2answers
86 views

Algorithm to replace this duplicated code

I've got a simple thing that I inherited from another developer and think it could be replaced with something a bit more elegant. What this is doing is comparing the length of a string to a set value, ...
1
vote
1answer
202 views

App for typing chemical equations to the screen

I am making an app that allows the user to type chemical equations (H2O + NaCl) to the screen. The user taps, inside a tableviewcell, a custom textfield and types on a custom keyboard (both subclasses ...
5
votes
1answer
775 views

Jon Bentley's bitmap sort implementation

I've implemented Jon Bentley's bitmap sorting algorithm from Column 1 of his Programming Pearls book. This code supports user-defined integer range (works from ...
2
votes
1answer
202 views

Publishing a description about a selected band

This is a basic program I wrote that lets you select a band, and give a description about the band and publish what you wrote. Are there ways I can apply concepts of OOP to improve this code? Any ...
3
votes
4answers
11k views

Linux C++ Timer Class: How can I improve the accuracy?

I wrote this class today, but I am trying to figure out how to make it more accurate. I pass in seconds and multiply by 1000 to make it milliseconds, and the time does not line up. I need the ability ...
1
vote
1answer
82 views

Help tidying up a Draw call

Simple static class that will write out a message that is passed in. The SpriteSheet is 256x256 and the A-Z starts at line 240 and the 0-9 starts at 248. Each character is 8x8. I hate the ...
5
votes
3answers
5k views

How could this object oriented design class be improved for future extensibility?

I wrote a C++ program for review and got feedback that I had not used any kind of extensibility of object orientation. I am wondering if this is a clearly defined concept or one that is more in the ...
2
votes
1answer
63 views

Is this an ok implementation of an UnorderedPair?

I want to create pair, where new UnorderedPair(ObjA, ObjB) == UnorderedPair(ObjB, ObjA) returns true. I also want to avoid any (...
4
votes
3answers
501 views

Finding and testing primality

I have written a class who is responsible for both enumerating primes and testing the primality of a number. Here is the code : ...
2
votes
1answer
68 views

How can I improve CreateGenre() function?

I use this function in my wordpress site to add genres to an album: What is it that makes this code so bulky? Is it have for the server or it just looks like? ...
3
votes
2answers
689 views

Text parser implemented as a generator

I often need to parse tab-separated text (usually from a huge file) into records. I wrote a generator to do that for me; is there anything that could be improved in it, in terms of performance, ...
1
vote
2answers
208 views

Question on where to put code logic

I am developing a small compiler like tool. In the process, I wrote a Class<?> wrapper, JavaClass: ...
2
votes
1answer
1k views

How do I make this C# code more efficient, in terms of FPS and time complexity?

...
3
votes
1answer
183 views

Long calendar related function

This works but feels like alot of code for what it accomplishes. I feel like I'm maybe missing something obvious. ...
1
vote
1answer
197 views

jQuery Plugin for Detailed images

I'm working on a jQuery plugin for a client. Instead of finding one that was already out there I wanted to practice writing plugins since I hadn't in awhile. This plugin grabs all the images in a UL,...
2
votes
1answer
2k views

AJAX call in JavaScript

I know there is a lot of libraries with this built in $.get() etc... but as for writing this in pure JavaScript how does this look? ...
4
votes
1answer
106 views

Seeking a quick and dirty way to populate a list of entities for testing purposes

Here's what I have at the moment. Any ideas for improving on this? ...
1
vote
1answer
493 views

Designing a service/business logic layer that returns useful/consistent messages [closed]

This is a question regarding design of a service or business logic layer that returns or exposes messages meaningful to the user. RegisterUser method that takes a ...
5
votes
1answer
2k views

Lazy Pirate Request Response pattern using zeromq and C#/.NET bindings

I'm a zeromq newb and have implemented the REQ/RES Lazy Pirate pattern with C#. It's essentially a port from the C example given in the documentation. It's harnessed by tests, and seems to be work to ...
3
votes
1answer
327 views

Parsing Oracle errors with a ksh function

Some time ago I wrote a small routine to run some quick n' dirty queries (and with that I mean it is not used for large queries) against an Oracle DB, but also wanted to do it a bit easier to parse ...
3
votes
1answer
853 views

Personalized, weighted recommendations - Rank all content with PHP

First of all, I apologize for the length of this but I'm trying to show the data I'm working with and that I attempted to figure it out on my own. I'm building a social site for musicians. I would ...
3
votes
1answer
3k views

Using temporary file as backing object for a tarfile

I have existing code that handles a tarball and would like to use that to process a directory, so I thought it would be reasonable to pack the directory up in a temporary file. I ended up writing: <...
8
votes
1answer
229 views

Is this appropriate way to pass data from presentation to application layer?

What is the best practices to pass data from presentation to application layer? Currently I have something like this: in presentation layer: the controller: ...
4
votes
2answers
884 views

Immutable pure data classes with public setters on properties

I'm putting together some classes as a model for some information (that I'm currently pulling from a website). The classes are implemented in C# - because in the current version of F# there are no ...
2
votes
1answer
326 views

Am I using my data source array correctly?

When I want to make some quick tests for my UITableViewControllers, I usually create an NSArray that holds some dummy data. I would like to know if I'm doing anything wrong here: First in ...
11
votes
1answer
2k views

Efficient way to deal with maintaining Many:Many relationships in EF Code-First

I've got this all working, but it seems to be quite long-winded, and I thought I'd post here and see if I'm doing it wrong... I have a M:M relationship between an Installer and a MasterInstance. The ...
11
votes
3answers
2k views

Can these unit tests be improved?

I'm not the greatest at writing tests yet and I'm starting a new OSS project for learning and as part of it I want to tackle being more effective at writing tests, more specifically quality tests. I ...
5
votes
1answer
1k views

Prepared statements syntax review

Migrating to using prepared statements and would like some feedback on CRUD modules, concerned with syntax (usage and DRY) and speed: START: ...
5
votes
1answer
145 views

Safety, sharing, and laziness

Is there a more succinct way to write code like this that has a lot of sharing between branches of the case statement? (This is the main part of my solution to one of the Round 1 problems of the ...
7
votes
2answers
33k views

Insert sort on a linked list

I want to do insert sort in a linked list without using dummy nodes. This is my code. How can this be improved? Any input is appreciated. ...
2
votes
2answers
24k views

setInterval loading data from server every 10 seconds

Today, I do not have a coding question, but just a general question about a piece of code that I have written. As you guys can see, I run the following JavaScript code every ten seconds. I tried to ...
3
votes
2answers
770 views

Building an HTML table using JavaScript

More readable way to do this? ...
2
votes
2answers
133 views

Small: Setting locale

I'm new to Rails/Ruby and I would like to get feedback on my little ApplicationController which is able to detect the visitor's language. I'm especially interested ...
3
votes
1answer
1k views

Simplify regular expression? (Converting Unicode fractions to TeX)

Background I'm converting Unicode text to TeX for typesetting. In the input, I'm allowing simple fractions like ½ and ⅔ using single Unicode characters and complex fractions like ¹²³/₄₅₆ using ...
4
votes
1answer
155 views

jQuery drop down

This does the job, and it's pretty much all the functionality I need at the moment. However, I feel like it could be optimized a bit. Namely, is there a way I can do this without the ...
2
votes
1answer
171 views

Twitter scanner

How can I script this in a better way? ...
1
vote
1answer
200 views

New to PHP, can I script this in a better way?

How can I code this in a better way, in one file? Output must be more than one (if there is more that one status_update with the given word "online or performancedegradation"),like: ...
4
votes
4answers
2k views

Temperature converter that seems to violate SRP

I've written this class for two purposes (I think only this fact shows that this code violates SRP): convert weight from one unit to another and to represent them accurate or not accurate. So class ...
1
vote
1answer
482 views

Best way to get day-of-week occurance

I need to determine a meeting date which convenes on the second Thursday of every month. I've written the following code to do this: ...
7
votes
2answers
229 views
0
votes
4answers
2k views

Optimizing javascript/jquery code for HTML creation with JSON

I use the following code to populate my HTML with JSON. The problem is that I'm afraid this code will be inefficient if the number of records that I get from the service call are large (200 or more). ...
10
votes
4answers
1k views

Vegetable factory

I'm new to Java. I'm trying to build a simple hierarchy of classes. ...
2
votes
2answers
630 views

How to refactor these C#-events or fix this architecture?

I need some second or third eyes to look over this, since right now, the necessary actions to make this work sound just bad and I suppose I am missing something due to a lack of C# experience. I am ...
0
votes
2answers
86 views

Better way to determine date

I am looking for best practice on how I may write this function more efficiently. ...
5
votes
2answers
2k views

Handling addition of two binary numbers

This code is for handling addition of two binary numbers, which can be as long as 100,000 bits... and up to 500,000 queries are performed. High-level pseudocode: First input ...

15 30 50 per page