@EBrown That's what I've been working the last day on - I ended up remigrating my database with new fields to try and remove the need to do substr but this will result in needing to either pass more info or do another db query :P
Don't worry, I've taken the heat before. Only reason I'm in PHP is because my professor pushed it for 3 years. He's under the impression that it is getting much better and that it will become a popular language. Which he's not completely wrong. It is much better, but it's going to have a very hard time getting a popular rep because it's the newbie language
@N3buchadnezzar Like @EBrown said, ASP.NET. Not a whole lot of common and heavily pushed languages beyond that tho. Python Perl C# etc but .NET is the best one from what I can see
So I think what broke it is not the change but the revision page showing the changes lol - cause if you look at the revision history they've removed the ability to see the revision
After getting comments on my previous implementation, I have tried to implement with DP. But without using matrix. I am not doing any boundary checks on the string just wanted to see if I am missing anything in this implementation
Approach
I am using Set to store existing palindromes. First I a...
I'm trying to implement fixed table columns. I've found a quite easy pure CSS implementation, which I haven't seen before. Here you can check out the little fiddle which fixes the first column. I've tested it only in latest IE and Chrome yet.
As I'm not an expert when it comes to deep browser re...
0
down vote
favorite
I am having an issue with my merge sort, when I print out my sortedArray it only returns [ 0.0, 0.0.....] Im not sure if there is an error in my sort code or in my print line or if it has to do with doubles. The code I am us posted below.
By calling System.out.println(toStri...
I'm just working on refactoring my project structure so that the validation can be externally executed - lot's of context comparisons that have to be created or passed...
Note:
This code is a rewrite of the post I mentioned here since according to CR policy I cannot update the same question.
This is somewhat didn't went through that much thought process and I wrote it in a flow but it seems more cleaner to me. I have used inheritance here but I would like to hea...
Well, we've lived in this house for 20+ years, and we aren't on particularly bad terms with any of our neighbors, so I don't think anyone will say we are squatting.
include
include
include
include
include
include
include
include
using namespace cv;
using namespace std;
void find_blob(Mat image)
{
Mat img_hsv;
int i, j, h, s, v;
Vec3b intensity;
cvtColor(image, img_hsv, CV_BGR2HSV);
for (i =...
i'm a teacher and have just started learning to code for making online quizzes for my students. I'm still very new to programming like JavaScript and php, and I've tried to looked for sources online to help create my quizzes. I have 2 questions:
1). I've set a timer for the quiz but everytime wh...
I have done a c++ program that inserts random numbers (between 0 and 4) into a 2D array under a constraint that is
-Its a array with 5 rows and 9 columns.Therefore total enter code here9*5 , 45 elements can be accomodated.
-Each number (0,1,2,3,4) should repeat only 9 times in the table.
...
I've written a class I call ReceptiveMapQueue. It's purpose is to organize the internal structure of an AFKable RPG. It only has two public methods - dumping entries into the queue, and extracting values from the head of the queue. I won't waste time describing it in paragraph form, since it is f...
I'm writing a program which uses OpenCL, and the OpenCL types are mostly over-aligned. Sometimes when using stl containers with these types, I'd get segfaults, so I tried to write my own aligned allocator which I could use instead of the standard allocator.
I've done a bit of testing in valgrind...
http://www.commitstrip.com/en/2016/07/20/one-of-those-aha-moments-in-the-life-of-a-coder/ CommitStrip One of those “Aha” moments in the life of a coder CommitStrip 1469039570
The auth token is weird. Your class can't protect itself against reflection as far as I'm aware, so all this is doing is covering up a bad design. From the documentation I can sort of see it's supposed to guarantee thread safety - I don't understand why you'd go to such lengths; there are better ...
the rest of the code, I'm sure it works, but it's just... wtf...
It screams pre-mature optimization to me
and then explains only the really deep parts
like the author was talking to themselves or something in the comments
It wants to be thread safe but it also has to be performant so it throws the thread safety out of the window and instead guarantees thread safety by use of a password object
I'm trying to convert this Objective-C code (originally found in this Stack Overflow question) which turns an NSString into NSData to Swift:
- (NSData *)dataFromHexString {
const char *chars = [self UTF8String];
int i = 0, len = self.length;
NSMutableData *data = [NSMutableData dat...
just made a note of that - i think the interface, which producers only see the producer-friendly interface, is a much better idea and should be a cakewalk to implement
so clear wait list - you're right, could be named better - the waiting list exists so producers can dump items to process without blocking other producers or the consumer - perhaps the consumer might not get to it this tick, but that isn't a problem - we start at the beginning of the keys queue when we extract so if it should have gone this tick, no worries it goes next tick
Unfortunately, that isn't really descriptive either because this queue doesn't do any processing - it sorts and queues up items to be processed by a consumer
about that empty HashSet, that wasn't premature - that one change increased the speed of the overall game loop by over 10% - i'm on barebones hardware (shoestring budget) so that was quite a bit of improvement
yeah that must have been it - from the time when i was planning to have multiple consumer threads that didn't externally synchronize - but now they need to be synchronized (or just have one)
@Pimgd So when you say "this map does not support two keys having the same value" - you see that it does now, right? That externally, the generic parameters are say, Integer and Player, but internally the map itself is Integer, Set<PlayerCharacter> - so many many players will be processeed on the same tick
Overview On July 20, 2016 we experienced a 34 minute outage starting at 14:44 UTC. It took 10 minutes to identify the cause, 14 minutes to write the code to fix it, and 10 minutes to roll out the fix to a point where Stack Overflow became available again. The direct cause was a malformed post that caused one of our regular expressions to consume high CPU on our web servers. The post was in …
> The malformed post contained roughly 20,000 consecutive character of whitespace on a comment line that started with -- play happy sound for player to enjoy. For us, the sound was not happy.
I was wondering if there a way to figure out the number of ways to express an integer by adding up consecutive natural numbers.
For example for $N=3$ there is one way to express it
$1+2 = 3$
I have no idea where to start so any help would be appreciated
This code is meant to display book titles that are incomplete. I have a HashMap with the book title and a number that represents the amount of the book that has been read. I want the program to
Check to see if there are any books in the HashMap
Check to see if there are any started, yet incomp...
This is a wrapper for multiple NSFetchedResultsControllers. Essentially, a drop in replacement for NSFetchedResultsController to allow me to fetch multiple entities at once. Would anyone mind reviewing my code and suggest any performance improvements, best practices, etc.? I'm coming from an Obje...
I am trying to implement a class for the Node of a Tree in C++ in order to represent an HTML structure.
It is not complete by a shot, but i'd still like an opinion.
TreeNode.h :
#ifndef TreeNode_H
#define TreeNode_H
#include <string>
#include <vector>
class TreeNode
{
private:
std...
I'm trying to write a function for a card game which will allow players to exchange a card in their hand for a card in their opponents'. I'm just starting out, so I know I'm running into a problem with accessing the arrays when I do it - my program currently gets hung up on the first step, and wo...