The terms foobar (), fubar, or foo, bar, baz and qux (alternatively, quux) are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation. They have been used to name entities such as variables, functions, and commands whose purpose is unimportant and serve only to demonstrate a concept. The words themselves have no meaning in this usage. Foobar is sometimes used alone; foo, bar, and baz are sometimes used, when multiple entities are needed.
The usage in computer programming examples and pseudocode varies...
im coding in c and with a prototype of:
Data* bubble_sort(Data *list);
I'm trying to Implement a bubble sort given a linked list of names. Note: this returns functions the new
modified head back to the caller. In case the head has been updated with ...
Threads:
Threads are hard. It's difficult to do it right and very very easy to mess up. One of the things you shouldn't do are so called Busy Waits.
These busy waits is calls to Thread.sleep() with values other than \$0\$ or \$1\$. You got one with the value \$1000\$
This is a big code-smell an...
I could use someone to proofread what I said here...
never used ScheduledExecutorService (or any ExecutorSerivce that is)...
The code below is sort of complicated to explain...
It writes a "sphere" of data to a 3D array from the given 3D-Position outwards in a spherical shape based on the given radius and value to write.
A graphical representation of this would be:
double UbytePrism :: PrismSphereSet( uint64 Xpos ,...
@Vogel612 insomnia also I'm off tomorrow (so I can drive to the new place and move furniture and boxes all day with no air conditioning until the utility company shows up)
So I wanted to write a Makefile that would allow for module specific rules or just make some standard rules for a module. I started writing this with, if I'm honest, no idea about makefiles.
The idea was essentially that each module would be a folder in the $(SRCDIR), if there is a make file nam...
Threads:
Threads are hard. It's difficult to do it right and very very easy to mess up. One of the things you shouldn't do are so called Busy Waits.
These busy waits is calls to Thread.sleep() with values other than \$0\$ or \$1\$. You got one with the value \$1000\$
This is a big code-smell an...
you do know that the code he posted is the "algorithm"?
I love your code. I made a solver a few months back without using recursion, but was some 600 lines :( . Can you please give the algorithm which you used? — Indrajith Indraprastham28 mins ago
As with all VS updates, Update 3 offers new features as well as reliability fixes and bug fixes (...) and general improvements to the user experience including a new setting that enables you to turn off the ALL CAPS menus
Despite me using VS only occasionally, those annoyed me
It is possible to change though vai registry already
@Vogel612 Hm I don't know... There's surely programs that read mail at intervals like 15 mins, but others also provide live mail in some way, his solution may not be that bad
got question at work about improving the D.js library performance-wise.
I m a FE dev for a year, but i mostly do stuff like dom manipulation and simple ajax. I know what promise is, no xp on the topic though.
Went over A+ specification(http://promises-aplus.github.io/promises-spec/)
and the code...
L15, L26, L31-60: Inconsistent indentation levels.
L4-43: Consider indenting this block.
L04: I don't see the point in storing the ID rather than the jQuery object itself. Instead of var id = "#" + post_id;, go ahead and store the object: var $id = $("#" + post_id);. Modify the references as app...
I have the following function that creates an array of JSON objects with properties from an array of arrays, where the first 'row' in the array contains the keys.
It works, but could it be improved?
var myArray = [
["a","b","c","d"], // will become keys
[1,2,3,4],
["foo","bar","baz...
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below N.
#include <stdio.h>
int main(){
int i=0,j,k,l,sum=0;
scanf("%d",&i);
if(i<=100000&&i>0){
for(...
In my Android app I have number of methods that should be executed in a background thread.
One of the methods looks like this
public static void processItem(final Context context, final String itemId)
{
if (Looper.myLooper() == Looper.getMainLooper())
{
Thread task = new Thread...
I have a multithread application and in it I have a List<string> with about a million data in it. I want to split it into multiple small list objects so that it won't take much memory.
I am creating a vector class which can be manipulated on the GPU and I am using C++AMP for the GPU accelerated code.
I am wondering the most efficient way of assigning elements of a different type to a concurrency::array in C++AMP. There are two ways that I can think of (but there may be more):...
We have a decent selection of language and technology tags, but we also have many meta tags, such as refactoring. A meta tag, at least on here, specifies the OP's request(s) in a review, and not much else. It could especially become problematic if the OP has many requests and tries to apply as ...
beginner, intermediate, expert tags should be a must, would be nice to know the experience level of a user before answering in some technical jargon they will never understand!
@CodeX [intermediate] and [expert] have been suggested before, but were rejected. The idea behind just beginner is to give an indication that reviews be tailored around a beginner, such as by explaining something rather than mostly giving some code snippet to consider. Anyone else above a beginner should be able to deal with any other type of review.
"MySQLi prepared statements are meant to be used with a recurring loop when working with arrays i.e foreach() { } blah blah " - Im pretty sure there is another way to do it without that..
@JeroenVannevel you can have a different name and picture for each account I believe, you don't have to have them all the same. (talking profile stuff)
but some advanced aspects of a review will be wasted on a beginner, it would be worth it to note that those things are advanced concepts so that the OP doesn't freak out
I need to get some work done though... either way I am not overly opposed to losing the tag, most people put the fact into the post and don't need to tag it as beginner as long as everyone reads the post
Burning beginner would hurt mediocre programmers like me. A lot of code posted here is over my head, but that beginner tag is an indicator that I have a real shot at helping somebody.
Why can't I call myCar.engine or any of it's properties in the following code?
var Car = function(make, model, engineSize, horse) {
this.make = make;
this.model = model;
this.engine = function(engineSize, horse) {
this.size = engineSize;
this.horse = horse;
getSize = function()...
I have some minor things to point out:
Since you're using C++11, you should be using <random> in place of std::rand. It has been determined that the latter is broken and should no longer be used in C++11.
Unless I'm misunderstanding the use of multithreading here, I don't think you should be u...
Sorry it took so long for you to get an answer to your question, there is a large group of us starting a new beginning for Code Review, it looks like you have plenty to offer in terms of helping this site grow with questions and answers, please feel free to join us in The Second Monitor either to converse with us or bring attention your questions — Malachi5 mins ago
and for the record, you cannot strike through in a comment
I have looked in the documentation of Spring profiles.
They clearly say that multiple default profiles are possible.
This you could find back here.
You can register your default profile in your web.xml by this way :
<context-param>
<param-name>spring.profiles.default</param-name>
<param...
Ignoring my shocking use of the mysql_* extension (and any associated issues), could you take a look at my script that uploads an image, adds it to a database, creates a thumbnail of the image 578px in width, and adds that to the database too.
<?php
require_once("validate.php");
while ($hq = my...
I'm not too familiar with inheritance, but here are some stylistic things I've noticed:
There is no need to use the public, private, and protected keywords repeatedly in the same class declaration. It just makes it harder to read and adds nothing of value. You should just use the needed keywo...
"I noticed that you hardcoded the number of days into the date calculations. Your spreadsheet will be easier to maintain if you reference the "# of days prior to reset" column instead.
So, for E5 you would have "=E$4 - C4" instead of "=E4-147". Note that adding the dollar sign means you can just copy cells as well."
N,K,P = map(int,raw_input().split(' ')) # N: No of Inputs, K: highest possible jump, P: no of test cases
L = map(int,raw_input().split(' ')) # Takes in the N space separated inputs
Li = sorted(L)
Breaks = [] #Records the starting point a of pair a,b such that the jump from a to b is larger than k...
I have a small script that takes a list of objects from an SQL table and groups them if the date-time on the object has less than 60 second difference with the last object.
It does this by converting the date-time to epoch and then subtracting the epoch of the previous object from the epoch of ...
Is there a better way (I'm pretty sure there is) to create a stored procedure to do dynamic paging, filtering and sorting than the following code?
CREATE PROCEDURE [uspProductWithPagingSortingFiltering]
(
-- Optional Filters for Dynamic Search
@ProductID INT = NULL,
@Name NAME = NULL,
@ProductNu...