Top new questions this week:
|
Is there a better way of doing this?
// Definition: Count number of 1's and 0's from integer with bitwise operation
//
// 2^32 = 4,294,967,296
// unsigned int 32 bit
#include<stdio.h>
int …
|
My entry for Weekend Challenge #5.
In scope :
Old Skool green on black text adventure
Keyboard handling
A story with 2 mini-quests
2 endings
Virtues ( Hi Ultima ) save the day
Out of scope :
…
|
I wrote this code for dynamic strings and would like to know what mistakes I've made.
It's just a struct that gets filled on the first call to ds_allocate and freed on the first call to ds_free. It …
|
int FindStr(char* str, int strsize, char* fstr, int from)
{
for(int i=from, j=0; i<strsize; i++)
{
if(str[i]==fstr[j])
j++;
else
{i-=j; j=0;}
…
|
Needed a quick stream to get json objects.
#ifndef THORSANVIL_STREAM_THOR_STREAM_H
#define THORSANVIL_STREAM_THOR_STREAM_H
#include <istream>
#include <mutex>
#include …
|
The following code is my answer to a Stack Overflow question:
#include <string>
#include <vector>
#include <fstream>
#include <cstdio>
#include <assert.h>
struct …
|
I'm kinda curious how I'd refactor this in the best way. I've only used Linq for simple queries.
What it does:
Depending on the type that is submitted, we're grouping events or payments by …
|
Greatest hits from previous weeks:
|
I've been learning Java for about 3 weeks now, and I was hoping someone could check over my code for me, and let me know how to improve.
I am aware that the maths class could be removed (I could've …
|
Is there a simple way to create a comma delimited string from a list of items without adding an extra ", " to the end of the string?
I frequently need to take an ASP.NET CheckBoxList and format the …
|
Can you answer these?
|
Here's my solution to Problem #82 on projecteuler.net:
def main():
matrix = [
[131, 673, 234, 103, 18],
[201, 96, 342, 965, 150],
[630, 803, 746, 422, 111],
…
|
I've been working on a website and Rails and am fairly proud of my HTML semantics. However, my CSS code has become enormous in size, which is largely unnecessary for such a small website.
How could I …
|
I implemented an algorithm that gives me a list of points that should be drawn in order the get a line between two points. Please note: it works only in a coordinate system whose origin (0,0) is in …
|