konijn
  • Member for 9 years, 6 months
  • Last seen this week
  • Lyon, France
Creating a Deprecated/Obsolete behavior for methods in a JavaScript library
Accepted answer
5 votes

From looking at your fiddle, the first thing I would do is make sure that your function is not anonymous: // new function implementation var Chart = function Chart(name, data) { //See what I did ...

View answer
Checking input and email field
Accepted answer
5 votes

From a once over: I would do the languages like this: var translations = { 'en-CA' : { emptyFieldMessage: 'This field is required.', invalidEmail : 'This email address seems invalid.' ...

View answer
Object map in JavaScript
5 votes

I can't see a good use for this, but nonetheless: Since you treat tabInfo as a list, why not have it be an array, this way you don't need tabInfoKey and you can use push instead. Arrays are objects ...

View answer
GregorianCalendar
5 votes

As Marc-Andre mentioned, you should really use English for your methods and classes, so that we can review better. Still, I am fairly certain that public boolean czyPrzestepny(){ boolean rr = ...

View answer
Geolocation check and error management for Google Maps
Accepted answer
5 votes

A tricky question, navigator.geolocation.getCurrentPosition will always return undefined, regardless of browser or whether or not the the user allowed the location to be retrieved. That means that //...

View answer
Filtering a Backbone collection with multiple parameters
5 votes

From a once over: Collection You could merge those 2 if statements into 1 You should remove commented out code You should remove console.log code You should try to have 1 chained var block You ...

View answer
Optimise JavaScript loop
5 votes

The location of your countryTemplate function breaks the flow of your code, you should put it at the very end. Also I would encourage you to use some templating routine, you could use this one: ...

View answer
Bulletproof way to clone Objects & Arrays handling circular references?
Accepted answer
5 votes

What the tin says Your code seems to track all cloned objects, so that it will find circular references, so it should be bullet proof indeed. The goggles! !(( function ( methodName, dfn ) { // ...

View answer
Optimizing the performance of html5 video manipulation
Accepted answer
5 votes

After back and forth with ChrisW and yourself, it seems I found a glaring bug var frameFix = function() { hContext.drawImage(sourceVid, 0, 0, sourceVid.videoWidth, sourceVid.videoHeight);...

View answer
WebGL (Three.js) simple application
5 votes

This code is good for tutorial use. Some suggestion: You are switching over 'x','y' and 'z' : function rotateCube( axis ) { switch ( axis ) { case 'x': mesh.rotation.x += 0....

View answer
Improving a JS object "framework"
5 votes

My perspective on your questions: It breaks when you want to change the behavior of all cats, since you do not store functions in the .prototype of the classes. Also, not using .prototype makes your ...

View answer
Very fast query selector
5 votes

My 2 cents, Well commented Naming is never confusing Quite readable for my edification * why [eval][0]('this') instead of eval('this'), to trick lint? As far as I can tell, your library is fast ...

View answer
Optimize/Beautify Boolean Statement in Specific Code
Accepted answer
5 votes

@HostileFork is completely right. From a code review perspective, your code should be optimized for readability. It could be a little more DRY. WhateverType subType = entry.getSubType(); boolean ...

View answer
Storing recordset data
5 votes

From the help : "The default collection of a Recordset object is the Fields collection, and the default property of a Field object is the Value property. Use these defaults to simplify your code." I ...

View answer
Using visual themes in a game
Accepted answer
5 votes

I want to write code like this: setBackground(theme.game.screenBackground) instead of setBackground(theme.game().screenBackground()) Read this : http://c2.com/cgi/wiki?AccessorsAreEvil The URL ...

View answer
Nonogram game in JavaScript
Accepted answer
5 votes

In general, it looks good to me. My 2 cents: I am not sure why you have event related things in your model iterateOverDraggedCells looked like it could use some refactoring. Whenever you start with ...

View answer
Four HTML tabs elements, with fade animations, activated by buttons
4 votes

Short review to make this more DRY Review the documentation on https://api.jquery.com/toggle/, this often helps with code like this Know that you can select multiple id's by separting selectors with ...

View answer
Check equality of an objects array property and a nested object property
Accepted answer
4 votes

Short review; Unless you are writing inline functions, you should stick to using function Using semicolons is preferred, it takes skill and knowledge to avoid the pitfalls of not using semicolons You ...

View answer
Manifest.JS: A lightweight front-end structural framework
4 votes

From a short review; isCyclic -> I would consider throwing obj into JSON.stringify and catch the relevant exception function detect is not a great name, it's okay because of the context, but ...

View answer
Javascript array-matching beginner
Accepted answer
4 votes

From a short review, considering you are a beginner; keep your variables in lowerCamelCase so COLORS -> colors CODES -> codes on the whole, avoid to have data type in the variable name ...

View answer
Data selection and filtering
4 votes

Indent your code! Naming convention Only use English paivitys -> update -> though really this should be with a subject, so updateObjekt? dataa -> data arvvoja -> values paivitaselekt -> ...

View answer
Pagination calculation
Accepted answer
4 votes

From a short review; You use globals instead of parameters for activePage and pageNeighbours You need at least one comment stating what pageNeighbours stands for, without knowing this the code looks ...

View answer
Function invocation every second time
4 votes

A short review of things that could trigger me if I were the lead Why are you returning undefined? That is what a function does by default. All your functions are anonymous, a nightmare in ...

View answer
Slow code pandas 8 million rows
4 votes

Not a lot to review there; The code is well documented and readable, the only thing I frowned at was df[df == 0.0], but my Python is probably just not good enough. In can only think of the fact that ...

View answer
Codility binary gap solution using regex
4 votes

I think your code is okay, however it foregoes some possible optimizations. Notice that the length of the binary number is only up to 31 bits. Once your current largest gap found is greater than the ...

View answer
Generate a URL, shorten it, insert it in a tex file and compile those tex files
Accepted answer
4 votes

I spent a good time reading your code, only found minor stuff: You have code similar to this a few times: exec(command, options, function(err) { if (err) return next(err); return next(null); }); ...

View answer
First "Revealing Module" implementation
Accepted answer
4 votes

I like your code, good use of the Revealing Module pattern. I only have the following minor observations: mtype could use a better name ( I know, jqGrid uses it ) autowidth -> autoWidth ( ...

View answer
Simple inbox functionality using JavaScript and Ajax
4 votes

From a short review: I hope your id's are not simply an increasing number, otherwise this: var data = 'deleteIds=' + JSON.stringify(deleteIds) + '&_token=' + pageToken; is just asking a ...

View answer
A String.prototype.diff() implementation (text diff)
4 votes

Great question, I do not like your rotate function; While the nested ternary seems brilliant, it reveals a violation of DRY ( you could do this with one map because every negative n has a positive ...

View answer
A curry function
Accepted answer
4 votes

Interesting question, your code is very close to the code here : http://blog.carbonfive.com/2015/01/14/gettin-freaky-functional-wcurried-javascript/ I prefer your lack of else since your if block ...

View answer
1
3 4
5
6 7
27