Tagged Questions
1
vote
2answers
127 views
Email report generation from database
I have written a small batch job which will collect data from db and send mail to user. Can you please do a review of the code with design prinicples in mind and also with best practices for Db and ...
2
votes
2answers
24 views
Mixin, @extend or (silent) class?
I am struggling with the basic concepts of SASS.
I have a page that has multiple section, all of them are sharing properties like width, font-size etc.
I would like to optimize my code and do one of ...
1
vote
3answers
94 views
Improving Javascript code of a failed test
I just failed in a JavaScript test and I would really appreciate some comments of how I can improve so I can keep learning.
The test was about making a form interactive, where the code should do ...
3
votes
1answer
88 views
Challenge: solution for this deep-iteration JavaScript function dilemma?
Trying to implement a deep-iteration function with some constraints, I've noticed the faster solution is iterating it twice! Any attempt to avoid this resulted in slower code. So, the challenge: can ...
4
votes
2answers
126 views
Move object by one up or down algorithm in a custom order
Basically, I did an object (using hibernate) with a field called sorting_order. This field needs to be unique and I wish to swap two object by one. So one element has to be after or before the current ...
3
votes
1answer
112 views
Python/Django Script - Is it crap? Objects duplicated or passed?
I've written a script using the Django ORM to store 'configuration settings' and interacting with the Google Drive API and another API. The script creates a base project folder and subfolders in ...
0
votes
2answers
127 views
Review code for optimization and implementation
The below code does Read csv files and process it to do some sort of
cacluations.This is more of small picture code , to introduce big picture.
The csv file contains information of seeds of crop which ...
3
votes
1answer
184 views
Optimize PHP Class
I'm looking for a better way to provide configuration options and improvements in general. I'm using the constructor injection pattern to get access to the Cache and Twitter class. $callback and ...
6
votes
1answer
283 views
combining 4 CRUD functions into 1?
I have a console application that I'm trying to make with minimal redundant code.
I have 4 functions, Create, Read, Update, and Delete.
is it possible or practical to combine the four functions ...
9
votes
5answers
2k views
Best Ruby one-liner to generate a random alphanumeric string
This is a little arbitrary, but I'm curious what people might come up with. I want to generate a random alphanumeric string in ruby, as succinctly and efficiently as possible.
([nil]*8).map { ...
3
votes
1answer
188 views
Is there a way to simplify this pattern
I'm using the following pattern in my mobile app. The code snippet below manages stopwatch.
Is there a way to simplify the code for better readability and probably getting away from needing to use ...
4
votes
1answer
104 views
How can I Improve this module?
This module makes a double linked list and initialize each member, I couldn't do it with a loop so I gave up and made each node individually, here is the long output, how can I improve it, or can ...