Do antistatic bags have conductive interior, exterior or both?
is the Question with the answer that I flagged.
I came upon this question by way of a link from a comment on an answer to a question on the Superuser site.
I flagged this answer because it doesn't answer the question(to any degree)...
I've recently made a calculator using Java and Swing. I'm okay with the results but I'm curious what are the mayor flaws I've made (assuming there are, because it is my first program making GUI). I can't think of a fancy way for not duplicating code in the function action listeners classes.
Whic...
How would you name this function (I gave in a name pipe in the example) which constructs combines a chain of functions with a single attribute into a single callable:
# pseudocode
function pipe (chain_of_functions) {
return function(value) {
for( fun in chain_of_functions ) {
...
Exercise 5-4. Write the function strend(s,t), which returns 1 if the string t occurs at the
end of the string s, and zero otherwise.
#include <stdio.h>
int str_end(const char *, const char*);
int main(void)
{
char *s1 = "Man is a rope stretched over an abyss.";
char *s2 = "an abyss.";
...
Here is a login system I am working on, I just want an opinion on it and whether I am going in the right direction or just completely missing something. I realize time is money so I appreciate any help you fine folks here at SE can provide.
The main thing I would like to know is am i initializin...
A Java processor is the implementation of the Java Virtual Machine (JVM) in hardware.
In other words the bytecodes that make up the instruction set of the abstract machine become the instruction set of a concrete machine.
Implementations
Up to now the following Java processors are available:
*picoJava was the first attempt by Sun Microsystems to build a Java processor
*[http://www.ajile.com/index.php?option=com_content&view=article&id=2&Itemid=6 aJ102] and [http://www.ajile.com/index.php?option=com_content&view=article&id=3&Itemid=7 aJ200] from [http://www.ajile.com aJile Systems, Inc.]...
I was really tempted for a moment to comment about someone using "JAVA" in a Dutch forum, but it may be better for both of us to just pretend nothing happened
A handful of people seem to have formed the opinion that an example project is exempt from this topicality constraint:
Is it actual code from a project rather than pseudo-code or example code?
The FAQ clearly states example code is off-topic, and this notion of example projects being exempt...
A few notes:
Analyzing your code, I see a simple bug that isn't accounted for. Consider the following case:
char *s1 = "Man is a rope stretched over an abyss.";
char *s2 = "an abyss..c9f0c50bc2e417b078e3b0bf82d5386d418cfba4";
Your method still returns 1 even though it clearly shouldn't, bec...
@Jamal I don't, I'm haven't used OpenMP that much yet. I looked over it but couldn't find anything to really optimise that much, or even comment on (other than what you said). I was thinking about saying something along the lines of the toilet analogy though.
I have a shell script to configure Synaptic touchpad settings at login.
Background
You configure the touchpad with the synclient command. Its usage is
synclient [-lV?] [var1=value1 [var2=value2] ...]
For example:
synclient PalmDetect=1 — to set a single setting
synclient PalmDetect=1 Pa...
I am not sure if I am approaching this task the correct way. I have a view model with multiple string properties. I pass the model through an interface to a service class that contains a void to repopulate the user input with my desired format.
using System.Globalization;
using System.Text.Reg...
Calculating probabilities in Minesweeper might sound like an easy task, but I've seen so many probability calculators that's either incorrect, horribly slow, or with ugly code (or all of them) so I have to share my code for this.
This code is used within my Minesweeper Flags online game by the A...
Calculating probabilities in Minesweeper might sound like an easy task, but I've seen so many probability calculators that's either incorrect, horribly slow, or with ugly code (or all of them) so I have to share my code for this.
This code is used within my Minesweeper Flags online game by the A...
If @Jamal wants to Jamalize that question, he's going to have a hard time :)
@ckuhn203 Thanks. It is a cool project. I have not seen any other algorithm for this out there so far that is as efficient as mine, so I hope it will bring a lot of attention.
@Jamal Don't kill me, kill my review-preparer and the formatting in Eclipse! I always use tabs in my code. And remind me to kill you for almost starting up the old tabs-vs-spaces war. ;)
Soooooo..... Do I try to use extended properties to document the database, or do I just keep it in an excel document? Which one is going to actually get maintained?
I have a process that is under constant dev. It's impossible to keep up with the docs. I end up rewriting it from scratch every other year. It's getting old.
@DanLyons - I agree. I've just spent about 7 hours getting an android sample cloud messaging app downloaded, installed, tested to find out it doesn't work right.
@Vogel612 lol, well... now that Jamal has removed 10 characters there's room for two jaxizations. Assuming the formulas themselves don't need to be modified.
@SimonAndréForsberg you never answered whether you think "code created solely for the purpose of illustrating a question" is an accurate definition of "example code." To me, it feels like a much more natural definition that "code lacking context." What are your thoughts on that?
possibly replacing "question" with "concept" or "pattern" or similar
For now I think I'll say: Perhaps. For me, code created solely for the purpose of illustrating a question can still be on-topic. Such as some A vs. B questions we've had in the past.
@SimonAndréForsberg I'm not going to answer that because it would just get downvoted into oblivion. The only people who seem to be interested in the conversation other than myself seem to be predisposed to the idea that "example code" has a very specific and non-intuitive meaning.
Exactly. Convince me. What are your arguments? Right now the question has very few examples and too much agreement. To come to any kind of conclusion, I think we need to here more opinions.
i would only suggest that we either use a natural, common-sense definition for example code, like the one I proposed, or ditch the "example code" wording in the FAQ and say what we really mean instead
The code is the view part of my bookmarker - project for managing bookmarks by categories. It uses Python 3.4/Django 1.6. I have also included models.py for reference.
The code does the following
Providing relevant autocomplete JSON data
Providing details of categories/bookmarks (both are DB m...
@Vogel612 Indeed it is. Which is why treating example projects as off-topic would harm the site a lot IMO. What good would it do to treat probably most of those projects as off-topic?
A lot of people coming here are enthusiast who are learning something. Whether it be a language or a concept in a language. ALL of those questions become off topic the second we start judging how "real" a project is.
look, forget about "real project," the important distinction is "project (code) which exists only to illustrate some concept" vs project (code) that exists for some other reason.
all I'm saying is "code which exists only to illustrate some concept" is the most natural, common-sense definition for "example code" that I can think of
I am learning java and now making a game Guess My Number,
where computer choses a random number which is declared as int rNumber for random number.
i have created 2 buttons, guess and exit, when player enters a number in texfield next to label and click on GUESS button then it displa...
point being, if we mean something other than a natural, common-sense interpretation of "example code," then we should not write "example code" in the FAQ, we should write whatever we really mean
@Vogel612 I honestly don't think we should, sometimes you want to ask a question about code you wrote at work and you have to obfuscate it a bit so you're not infringing on someone's IP
I've seen lots of examples of that happening here and nobody bats an eye
@rolfl I know, the complexity is O(2^n) I believe. However, in my approach n is only the number of shared fields, which is what makes it quite fast compared to other algorithms.
Anyone knows a good resource explaining and implementing MVC with PHP? Not frameworks themselves which uses MVC because by looking at documentation implementation details are supplied
@Vogel612 - Thanks! Followed it, hope it gets off the ground. My model building one has stagnated badly.
@SimonAndréForsberg - Working on it. I haven't looked at PHP in so long that I didn't know it was deprecated, other than seeing comments all over doing SO searches.
@SimonAndréForsberg - Yeah, I'm working on a droid message application, so I found an example with both the droid app code and the php side, and it works...*almost*
@SimonAndréForsberg - I've always been in Clipper and lately C# as we modernize/migrate. It's a dead simple app, just my time vs. learning curve are holding me back atm.
I can't debate any more today @DaggNabbit, but that meta could really use an opposing viewpoint and you're obviously the guy to do it. I think you should consider it.
This is related to Why is hypothetical example code off-topic for Code Review?
Which is related to On-Topic question #3:
Is it actual code from a project rather than pseudo-code or example code?
It seems that we're not quite consistent in our treatment of "example code", which is what this...
My application has a fairly important query that is used in a lot of places. Unfortunately it takes about 14 seconds to run, so I'd like to find a way of possibly improving it.
The application receives incidents (right now there's about 70,000 total incidents, and about 16,000 incidents in this...
I am using var in my code to initialize and define all of the functions. Here is the code,
public void MainWindow() {
var name = "Afzaal Ahmad Zeeshan";
var age = 18;
Console.Write("My name is: " + name + "\n");
Console.Write("My age is: " + age);
}
But I was told by my teacher th...
I am posting this question for input on comparisons between other sieving methods and opinions on what I have discovered. I believe this might be the fastest (singular, non-threaded) array implementation of prime sieving to date, correct me if I am wrong.
My rudimentary benchmark tests stand as ...
This is being used now, seems decent to me but I'm curious.
if (m=s.match(/^\s*(https?:\/\/[^\s<>"]+)\.(bmp|png|webp|gif|jpg|jpeg|svg)\s*$/)) {
// example s: http://mustachify.me/?src=http://www.someImage.jpg
return '<img src="'+m[1]+'.'+m[2]+'">';
}
if (m=s.match(...
sorry, i see where you got confused, it doesnt just have D, E and F. theres a million possible values, so I need to just be able to select all rows which have a unique value (only 1 row of that value)
I am working on a ground-up rebuild for an app that has a relatively simple purpose. Users can view/favorite entities that are backed by a RESTful API. I own both the client code as well as the API. For this rebuild, I wanted to refactor the networking code out of my view controllers and hopefull...
To see how any of the formulas were made in any question or answer, including this one, use the "edit" link to view the complete source. To quickly see the source of a single expression, right-click on it and choose "Show Math As > TeX Commands".
(Note that in some browsers, such as Firefox, th...
Inversion Count for an array indicates – how far (or close) the array is from being sorted. If array is already sorted then inversion count is 0. If array is sorted in reverse order that inversion count is the maximum.
Formally speaking, two elements a[i] and a[j] form an inversion if a[i] > a[j...
And I apologize if I sounded a little too arrogant. It wasn't entirely apparent to me that you were a beginner. You could tag your question(s) as beginner.
Someone suggested me to post it in Code Review so here I am.
I can't really find a satisfying solution for that problem. I have a n-layers application :
UI
Presentation (Domain Model used as DTO, ViewModels are then presented)
Business Layer (Domain Model)
Repository and DAL (Data Model)
My ...
I'm working on cleaner code with proper variable names
But its school style - I dont want to flood the window, but when I'm done if I share will it make a small scrollable text box if I share here.
I can attempt to write it in C#. I just started C# this summer.
If you understand C# then maybe you'll get it.
I mean psuedo code is pretty descriptive I feel - basically primes can never be even (factor of two) or a factor of any other prime. Six is the smallest number that is a factor of the smallest two primes - and as such is a perfect tool to count by one above and one below.
@AlexLieberman Better, but a one-space indent is visually very difficult to pick out (2 is about the minimum and I usually use 4). Also, the advice that "Bobby" already gave about putting in braces even in the case of a single if is sound.
@AlexLieberman I don't like the code formatting very well. You seem to vary between 1- and 2-space indentation, and don't always have your closing braces aligned with the opening. Makes matching them up pretty difficult.
@JerryCoffin I was mostly talking about the formatting, but using any of Java, notepad or Windows all fall into the "don't do that" category in my bigoted, er, enlightened view.
@Edward My brother likes to talk about one of the "old" buildings at Google, where they had to put up signs to remind people to flush the toilets, since (unlike the rest of the campus) the toilets there don't flush automatically. To which somebody added "How can you expect us to live with such primitive conditions?"