« first day (480 days earlier)      last day (3545 days later) » 

12:05 AM
@nhgrif yeah in considering things from your point of view, now I see a number of advantages with ints vs. strings, for numeric and serial data
 
system.random looks like it could use some love:
  /*=====================================Next=====================================
  **Returns: An int [0..maxValue)
  **Arguments: maxValue -- One more than the greatest legal return value.
  **Exceptions: None.
  ==============================================================================*/
  public virtual int Next(int maxValue) {
      if (maxValue<0) {
          throw new ArgumentOutOfRangeException("maxValue", Environment.GetResourceString("ArgumentOutOfRange_MustBePositive", "maxValue"));
Exceptions: None. ಠ_ಠ
 
Grand Central Dispatch (GCD) provides a simple and robust mechanism for concurrent and asynchronous operations in iOS, Mac OS X, and FreeBSD. ... "simple"... I'm not completely certain...
 
Wow @mjolka. Crazy bug.
16
A: Idiom for "just because you give something a different name, it doesn't change what it is"

Dan BronDo you like Shakespeare? If so, how about "A rose by any other name would smell as sweet", or, shorter these days, "A rose is a rose is a rose." If you're not a big fan of the Bard, consider "If it walks like a duck and quacks like a duck ...".

Quack
 
^ lol
 
12:23 AM
> (i.e. faster than the UI can reasonably update; say > 60 times a second)
If data is updating faster than you intended to reflect the data update in your UI, is it really updating that fast?
 
Feel free to change the tag wiki. I just copied it from Stack Overflow's.
 
That was more of a sarcastic comment.
 
It could be less simple.
 
I agree.
That's why I'm not necessarily for removing it.
Somehow, this answer earns me about 1 upvote per month. I think it was originally accepted with zero upvotes...
7
A: clipsToBounds how does it work?

nhgrifIf my superview is a box measuring 10 units on each side, and my subview is 20 units wide, with clipsToBounds set to YES, I'll only see the part of the subview that fits within the bounds of the superview. Otherwise, if clipsToBounds is set to NO, I'll see the entire subview, even the parts outs...

And now it has 7 upvotes... and it feels like they were all very spaced out.
 
That's what a good SE answer should do.
 
12:26 AM
Hardly anyone bothered to upvote the question until now.
 
I just upvoted it. I never thought it was that great of a question... but apparently, my answer is one of the very few clear explanations of clipsToBounds on the Internet, so apparently the question is better than I originally thought.
 
ouch^^
Had some crazy wind gusts a few minutes ago, thought a tornado might touch down
 
KY?
But the really question is... if you're updating the data faster than you can update the UI, is the data actually updating? (If a tree falls in the woods, etc...) So to me, seems the real solution might be to slow down the data updates... — nhgrif 42 secs ago
2
 
Yeah KY
 
12:54 AM
It's quiet tonight.
I wonder... does the bit datatype in SQL actually only take a single bit... or does it take an entire byte and only allow values of 0 or 1...
 
> The SQL Server Database Engine optimizes storage of bit columns. If there are 8 or less bit columns in a table, the columns are stored as 1 byte. If there are from 9 up to 16 bit columns, the columns are stored as 2 bytes, and so on.
so.. yes and no ;)
 
Sounds like Yes (single bit) to me, unless it's worded funny and "columns" means something different than what it means everywhere else...
 
it's stored as a byte, but a single byte will store up to 8 bit column values.
if there's only 1 bit column in your table, it's still stored as a byte.
 
Ah, ok
Is a bool column stored as 1 byte too?
 
@Mat'sMug i don't understand how they can do that bit-packing when bits can be null
 
1:02 AM
there's no bool type... that's bit ;)
@mjolka that's ..interesting.
 
So bool is just bit with a different name...? and uses True/False instead of 1/0?
Hmm... testing time
 
Entity Framework maps bool to bit
 
@Mat'sMug "The fact that a BIT value is NULL must be stored separately from the bit value itself, since the bit values can be compressed so that 8 BIT values are stored in a byte." stackoverflow.com/a/14702211/1220238
 
ah
 
:)
 
1:08 AM
your google-fu is better than mine!
 
@Mat'sMug lol, i googled "sql server bit null"
2
 
set search_path = test;
drop table if exists test3;
create table test3 (
  testBit bit,
  testBool bool
);
insert into test3 (testBit, testBool)
values
  ('0', False),
  ('1', True),
  (null, null)
;
select * from test3;
 
"sql server bit type" <-- fail
 
@Phrancis What flavor? I think we're talking about SQL Server.
 
Yeah pg here, probably the closest tho
Never did realize a bool or bit could be null
 
1:10 AM
66
A: How do you create a yes/no boolean field in SQL server?

GuffaThe equivalent is a bit field. In SQL you use 0 and 1 to set a bit field (just as a yes/no field in Access). In Management Studio it displays as a false/true value (at least in recent versions). When accessing the database through ASP.NET it will expose the field as a boolean value.

 
The data packing is different from non-SQL programming by the way.
 
Well, back to music :p
 
Although, it's not worth worrying about 7 lost bits per bool variable...
I am kind of curious if there's a performance difference between these two things though:
 
still I learned something today, and it's good to know.. I guess. Like, when you have a table with 1 bit field and a couple of million rows.. you could add another 7 bit fields without weighting a single additional bit.
 
if (someBool1 || someBool2 || someBool3 || someBool4 || someBool5 || someBool6 || someBool7 || someBool8)

if (some8bitMask)
Even with short-circuiting, the former will have to look at up to 8 bytes, where the latter has only to look at a single byte.
 
1:20 AM
I think that's why I hang out here. I learn stuff and things.
2
 
And SQL does offer bitwise operations (&, |, and ^ anyway)
So, presuming that if(someBitMask) is faster an equivalent number of chained bools, it still may be worthwhile to favor a tinyint field over 8 bit fields even though storage space would be the same.
 
1
A: Animated magazine

pomehI'm not just what would be the best way to refactor your code, but I still have some tips for you. I'll take parts of your code and show you how I would have done using a before/after approach: Snippet 1 Before magazine.turn({ width: MGZ_WIDTH, height: MGZ_HEIG...

 
By the way... students are back in class:
4
0
Q: String Representation of Integer in C

skyeshuaI have to make a function to return a string representation of an integer that is passed as an argument. If the argument is 5, the function should return "5". Anyone has an idea on how to get started with this?

 
0
Q: Parsing Valve Key-Value files

KroltanIntroduction Valve recently launched the Dota 2 Workshop Tools, which allows players to create their own maps with custom gamemodes, similar to Warcraft 3 in capabilities. Ability and unit definitions are stored in txt files under a specific format, very similar to JSON: { "key" "value" ...

 
This is my favorite sort of snide comment by the way:
char * stringRepresentationOfFive(int five) { return "5"; }nhgrif 1 min ago
 
1:32 AM
@nhgrif assert(five == 5);
to make it production quality
 
Yea, too late to edit.
 
And it's gone.
 
> i already searched about it..what i get is about itoa and sprintf, which converts 5 to five..but what i need is to convert 5 to "5"
What he needs is a new major.
 
1:49 AM
Oh wow... Yeah.
 
It's not that he doesn't know how to do it. It's just that he doesn't even come anywhere near the correct approach.
It's probably not even entirely his fault.
I'm sure there are teachers, who on day 1 of the most introductory programming classes say "StackOverflow is a great resource"
 
To be fair, classes started yesterday.
 
I know, but does this guy even Internet? How do you go to StackOverflow and click Ask a Question before doing any searches at all?
You know what I just realized?
39.3 million results in half a second.
The Internet is uh-may-zing.
I think this is how I should approach StackOverflow for the next few weeks. When I see a bad question, I'm going to spend 2 seconds to think up how I'd Google that, then Google it with those obvious search terms. If the top result answers the question, they're getting a screenshot like this.
 
or link them to lmgtfy.com
 
2:06 AM
Does this work?
cout << "quotient is" << (b==0) ? (" undefined") : (": " << a/b) << endl;
 
@nhgrif nope
 
Okay.
You can use ternary in cout though, right?
The problem is here I assume: (": " << a/b)
 
@nhgrif Firstly, it'll complain at you because "undefined" and ": " have different types
if you wrap them both in std::string and wrap the whole expression in () then it will compile
 
Yeah, I'm not worry about it.
I was going to try one-lining this:
3
A: If else postion

nhgrifThe problem is your last cout should be inside the else block: cout << "quotient is"; if (b == 0) { cout << " undefined"; } else { quot = a/b; cout << ": " << quot; } cout << endl; As written, your "quotient is: " << quot is executing in every case, but you actually only want it to...

 
far more effort than it's worth
 
2:16 AM
yeah exactly
If what I wrote worked, I'd put it in there. If it worked with the tiniest of changes, I'd put it in there. Otherwise, I don't care.
I don't write C++ code, and even if I did, I can't imagine I'd be writing any C++ code with many cout statements.
 
well, probably not any cout statements using a ternary
I can't think of a time I've actually done that, other than when being asked the exact question
 
0
Q: Determine maximum window bounds

muffinPreamble: the default frame positioning with Swing JFrames has always bothered me. Eventually I wrote some code to calculate my available desktop space, not counting my abnormally-large right-side-anchored taskbar, and use that information to size and position my JFrames. Then I got sick of copy/...

 
2:45 AM
1
Q: Safe Reverse Polish Notation

Kevin MeredithI implemented the following (what I believe to be) safe Reverse Polish Calculator. Now I'm using foldM to take advantage of the power of Monads. Previously, I was not. Can you please critique my code? import Data.Maybe import Text.Regex import Control.Monad import Network.CGI.Protocol data Op...

 
3:07 AM
0
Q: Zeckendorf numbers the Clojure way

mjgpy3I'm just getting into Clojure, and I wanted to make sure I am writing code the "Clojure way". The challenge I took on is Zeckendorf numbers (fairly trivial). Here's my code: (defn fibs-until ([n] (vec (if (< n 3) (range 1 (inc n)) (concat [1 2] (fibs-until n 1 2))))) ([n a b]...

 
4:00 AM
0
Q: How can I write a fast mutable trie

SeriI am implementing a mutable trie. You can find below the full working code. I tested and it produces correct results. However, it is very slow. I benchmark it against plain old Data.Map and Data.Map is more than twice faster. Full source: https://github.com/seri/toys.hs/tree/master/SpellChecker/s...

 
4:22 AM
0
Q: JavaScript function that toggles element visibility according checked radio input V2.0

Cadence96this question is about an improvement of the code from this previous question. It is a constructor function that attaches a click event to radio inputs using event delegation in order to add and remove css classes to the text input which contains a data-value equals to the radio value. Short e...

 
4:34 AM
this should be a comment, not an answer codereview.stackexchange.com/a/61147/44723
 
^ DV + flagged
 
0
Q: Update only specific item (data) in List from YAML

Heatherdata Repository = Repository { location :: String , branches :: [String] , upstream :: String , enabled :: Maybe Bool , clean :: Maybe Bool ...

 
@CaptainObvious do you really need to cater to IE6 users? (JavaScript question)
 
wow what is with all the haskell today
wonder if it's another first-day-of-class thing
 
Sounds like it
At least they're not bad questions...
 
4:37 AM
that last question needs some context
 
Well yeah last one is vague enough
@mjolka looks like he added an explanation so I removed my VTC
That said, TTGTB
 
night @Phrancis :)
 
5:05 AM
0
Q: HackerRank "Service Lane" in Python

mleyfmanProblem statement: Calvin is driving his favorite vehicle on the 101 freeway. He notices that the check engine light of his vehicle is on, and he wants to service it immediately to avoid any risks. Luckily, a service lane runs parallel to the highway. The length of the highway and the service...

0
Q: HackerRank "Manasa and Stones" in Python

mleyfmanProblem Statement: Manasa is out on a hike with friends. She finds a trail of stones with numbers on them. She starts following the trail and notices that two consecutive stones have a difference of either a or b. Legend has it that there is a treasure trove at the end of the trail and if Man...

0
Q: How can I optimize a particle filter weighted selection step?

t.pimentelI have a vector with 10000 particles that I use in a Particle Filter. The problem is it's taking too long to compute the weighted selection of the particles. Is there anyway I can optimize this? std::vector< double > probabilities; probabilities.reserve(util::NUMBER_OF_PARTICLES); std::vector< ...

 
 
1 hour later…
6:35 AM
0
Q: Partitioning a list to a list of smaller lists

janosI created a utility method ListUtils.partition(iterable, size) to partition a potentially large list to a list of smaller lists: public class ListUtils { public static <T> List<List<T>> partition(Iterable<T> iterable, int size) { if (iterable == null) { return Collections...

 
7:02 AM
0
Q: c++ zero on a button

erencanI am asked to restrict a button on a program. By using another restricted one, I added a few lines and restricted it. But one of lines was adding 0 for when we have nothing on the button. When we delete this code system gives #econverterror. I cant delete this but I cant delete this "0" neither. ...

 
7:18 AM
Quick question: Do we want this question from SO?
0
Q: Java Eclipse random number

SwordOfDoomHello I have created this program and it works fine its just that its too wonky and huge so I was wondering if anyone knew how I could shorten the program so I didn't have to put all of these into each button if(guess == number){ l1.setText("You have won the number was " + number); } if(guess >

"it works fine its just that its too wonky and huge"
 
 
1 hour later…
8:38 AM
0
Q: How to make this code small or remove the code smells

Mike Rossi am new with coding and i recently read article about code refactoring so i have made a console application for booking rooms in ship i need help with code refactoring as far as i understand the refactoring i think in my project there are only 2 part where i need refactoring which are as follow ...

 
8:51 AM
Monking
Does anyone know if I from my laptop via RDP connect to my home PC, if I can share local (192.168.x.x) addresses to my PC at home?
 
Monking
@skiwi you're not making much sense in that description..
 
@Vogel612 Well... At work I have access to 192.168.x.x there for some shared servers
With my laptop (which I use at work), I connect via RDP to my home PC, because it's way faster
 
and now?
 
I'm wondering if I can share those shared folders as well via the RDP
 
how would you do that??
It's not like you have a shared network...
 
9:00 AM
I think it works with printers
 
the problem is that you move in two different nets here.
nonono. You can just use the printers that are available on your home PC in the RDP.
and you can only use your shared nw-folders on the computer that's connected to exactly that network
RDP is like a P2P 4-Host network
 
I guess it does make sense
 
most RDP's will go via VPN tunnel
and that's a different network.
sure you can first transfer the files to your laptop and then to your PC:..
 
Yes, that works, would be nicer if it wasn't needed though
 
but why would you need access to the company network share on you home PC anyways??
 
9:04 AM
For easier transfer of files
But it kind of looks like a security risk if that was possible
 
@skiwi let me phrase that differently... why would the company want files from your home PC?
 
@Vogel612 That wouldn't be the case though, but I get what you mean, it's a 2-way connection
 
@skiwi well the problem is, there could be "files" coming from your home PC that you didn't even move ;)
 
Why is it that here people always want to talk and make loud noises when I'm barely awake... :|
 
0
Q: Managing lifecycle of entities

packageI'm trying to find best structure for managing lifecycle of my entities. Let's say we have classes Component, Parameter and ComponentParameter. Component and Parameter are separate entities, ComponentParameter is an association entity between them having overriden value of Parameter's value. cla...

0
Q: Simple class, solely for setting "globals"

mowgliI'm aiming for the best (and simplest) way to access "global" variables set in the config file for the site. So I can use them anywhere (even inside functions) It's for file versioning, and I use htaccess to rewrite urls Right now, I'm at this: // settings.php: class VERS { static $css = '...

 
9:47 AM
0
Q: Java method for executing any type of hql

Lalit Chattari have written two methods in java that executes any type of hql and returns data. Methods are like public static Query getHqlQueryObject(String hql) throws Exception{ Query query = null; Session session = null; try { session = HibernateUtil.getSessionFactory...

 
10:08 AM
0
Q: I want to refactor my test

Mikkel LarsenI'd like to refactor my extractSimplePromptName so it does the same but it's "prettier", hence less code. As far as looking at it, it seems like it could be refactored so it does the same thing, but it's just less code. I'm just fairly new to programming so having a hard time seeing where i shoul...

0
Q: Should cell setup take place in ViewController or TableViewCell?

MahirI have a custom tableview cell for displaying different foods, with a star next to each name. If the food has been favorited (i.e., it exists in the database), the star is filled in, otherwise it is empty. I'm not sure if the logic that determines the color of the star should go in the view cont...

 
10:24 AM
hehe
The exercise on my exam was 90% the same as the exercise I made for myself last night
That was a fun exam
4
 
0
Q: Conversion of CRC function from C to C# yields inconsistencies

Kells1986I posted this question on Stack Overflow and was advised that it is best suited to this site. I'm trying to convert a couple of simple CRC calculating functions from C to C#, but I seem to be getting incorrect results. The C functions are: #define CRC32_POLYNOMIAL 0xEDB88320 unsigned long CRC3...

 
This happens when you create a project for fun... github.com/skiwi2/GithubHookSEChatService/issues
3
@JeroenVannevel Nice nice, looks like you passed :)
And all of this only happened because I was frustrated that the Atom feeds of Github commits were not working with chat.SE channels...
 
10:55 AM
Funny how that happens ain't it?
 
0
Q: Unit Testing of Curl based Rest Client Library

ajameswolfhttps://github.com/andrewjwolf/payjunction-php I ran into some issues with unit testing in that getting the response body etc from the curl handle was tricky. I didn't want to necessarily use a mock or abstract the curl functionality. A colleague of mine suggested that I just use the localhost ...

 
Does anyone have a better tittle for this? He's not really refactoring his unit test, but the code he's testing.
1
Q: Refactoring Unit Test

Mikkel LarsenI'd like to refactor my extractSimplePromptName test so it does the same but it's "prettier", hence less code. As far as looking at it, it seems like it could be refactored so it does the same thing, but it's just less code. I'm just fairly new to programming so having a hard time seeing where i ...

 
@RubberDuck done
 
Thank you @Vogel.
 
11:10 AM
0
Q: Cache locking with c#

PeteI have used the example in the following this question to lock my cache: public static IEnumerable<Asset> Assets { get { List<Asset> assets = (List<Asset>)_cache["AssetList"]; if (assets == null) { // stop multiple calls to this lock (_ass...

1
Q: A function to convert FASTA .txt to a dictionary

mattkaeoI'd like feedback on my function to convert FASTA data to a dictionary in python. Here's example FASTA text. FASTA lines to be used as a key begin with '>' FASTA lines to be used as a value follow the key line. Repeat Is this the best way to remove whitespace, tabs, newlines, etc? I suspect ...

 
darned swing..
 
Isn't Swing fun?
 
				addActionListener(new ActionListener() {
					@Override
public void actionPerformed(final ActionEvent e) {
		// TODO: Perform action!
		System.out.println("Entering action listener");

		Window owner = (SwingUtilities
				.windowForComponent((Component) e.getSource()));
		final WindowEvent closeEvent = new WindowEvent(owner,
          		WindowEvent.WINDOW_CLOSED);
		final EventQueue queue = Toolkit.getDefaultToolkit()
				.getSystemEventQueue();
                SwingUtilities.invokeLater(new Runnable() {
 
Oh, even more fun without Java 8
 
borked indentation..
@skiwi well, it could be worse..
 
11:19 AM
You're posting the event yourself... uh okay
 
only crap is, that () -> { needs to be new Runnable () { @Override public void run () {
@skiwi well I try to post the event myself..
but the window doesn't close...
because it isn't nice to me.
 
Is there anything that consumes those events?
 
um..
well I can't close the window either way..
actually the real plan is to have it call this.dispose() without calling it.
--> I want to make Swing think, that User clicked the small red X
 
Hmm okay
 
but JFrame doesn't expose anything like "close" or whatever.
 
11:29 AM
@Vogel612 I hope you're not planning on using that throw new GameEndException(); ?
 
@skiwi It works.
@SimonAndréForsberg no ofc not
final WindowEvent closeEvent = new WindowEvent(owner,
    WindowEvent.WINDOW_CLOSING);
If I enqueue this crap, it gets closed correctly..
wth?
 
I assume JavaFX is not an option @Vogel612?
 
@SimonAndréForsberg wouldn't matter much FWIW.
0
A: Refactoring String manipulating method with TDD

Lars-ErikTry using parameterized tests: http://www.vogella.com/tutorials/JUnit/article.html#junitadvanced_parameterizedtests

Link-only answer..
my SE Auto-comment is borked..
 
@Vogel612 Platform.exit(), it closes.
 
@skiwi and what do I do with the non-GUI part of my application???
and all the other stuff I maybe wanna do?
 
11:34 AM
That could be an issue
:)
 
like performing a save and other cool things before closing?
 
You could handle that in your close handler, but may not always be an option
 
@skiwi well I could, but if I call Platform.exit() it will not get to my (not-yet-existant) window-close handler.
 
0
Q: Perl script to handle include files

Håkon HæglandI am trying to extend the JSON format (for private use) to include an include statement. This could be used to include other .json files into a master file, for example. Here is my current code: #! /usr/bin/perl use warnings; use strict; use File::Slurp 'read_file'; my $str=parseFile('t.json')...

0
Q: Styling and activating radio buttons on condition

MaxKorlaarI have some php code to style a button and activate it, when a specific variable is true. It's actually a radio button, styled with the bootstrap to a button. As you can see below, this is how it looks when the variable is '1'. Also, the buttons at the bottom are the same, but then with one extra...

 
@Vogel612 Update it. Mine was borked too for a while but it's back on track again. Use the Greasemonkey script. I couldn't get the Firefox plugin to work.
 
11:47 AM
@SimonAndréForsberg well.. none of my greasemonkey scripts do what they say..
actually none of them is getting executed properly.
 
The Auto-comments thing is the only one I use I think, after updating it I haven't had that problem
244
Q: AutoReviewComments - Pro-forma comments for SE

Benjol No more re-typing the same comments over and over! This script adds a little 'auto' link next to all comments boxes. When you click the link, you see a popup with 6 configurable auto-comments (canned responses), which you can easily click to insert. This script was inspired by answers to thi...

 
0
Q: php form data handler class - need suggestions

OMII've started to write a form data handler class in PHP. Can you please review it and point out any mistakes or logic errors, or perhaps if a method can be written in a better way. Code is below. Thanks in advance for your efforts :) define('VALIDATION_ERR', ' couldn`t be validated.'); define('R...

 
@SimonAndréForsberg That is pure awesome. Now I know how you're so fast.
2
 
@RubberDuck My secret is revealed!!!
 
0
Q: In the word "Scent", is the S or the C silent?

PimgdSo I saw a post on a funny pictures site... "In the word "Scent", is the S or the C silent?" And I thought I could ask about it here. In particular, how does the pronunciation of "scent" differ from "cent" and "sent"? Small audio references would help me in particular.

 
11:54 AM
I'll have to customize a few comments later. That is seriously cool.
Hello @Pimgd!
 
Heeyo
On a different topic, seeing how I murdered the conversation somehow
SO is implementing code snippets
so you can run JS code inline
 
Oh yeah?
 
357
Q: Feedback requested: Runnable code snippets in questions and answers

HaneyToday we're proposing a new feature to the Meta Stack Overflow community: Stack Snippets. What do Stack Snippets do? Stack Snippets make code blocks runnable. Here's an example: alert("You can even do alerts"); .hello { font-weight: bold; font-size: 1.5em; } <div class="hello">Stack...

 
@SimonAndréForsberg thanks, "fixed" it ;)
 
Do you think they'll port it over to CR too?
 
11:58 AM
@Pimgd I hope they don't..
the editor looks somewhat unusable for larger snippets.
 
Yeah but right now it's mostly JSfiddle
 
I get what they're doing. I think it would be a good thing for Javascript questions here. There'd be no question about it being working code.
And no need to create an external Fiddle to prove it.
 
12:16 PM
Post a meta question asking for the tool to be implemented on CR. We can all answer/vote for yes/no, and use that as evidence in a request to the SE devs.
@RubberDuck - 4 backslashes are actually 2 (two of them are escape sequences....)
 
Greetings, Programs.
 
SHALL WE PLAY A GAME OF CHESS?
 
CHES
 
@rolfl And 2 backslashes are actually 1.
So the OP checks for 1, but splits on 2
 
@Donald.McLean Greetings, User
@rolfl What do you think of my Suggested Edits Query?
 
12:30 PM
@rolfl Ahhhhh crud. Escapes. D'oh!
Thanks for the edit @SimonAndréForsberg.
 
@RubberDuck On my way to Copy Editor!
 
@SimonAndréForsberg Not true, the split("\\\\") only splits on one backslash
 
@rolfl Afff... regex!
 
split is a regex ;-)
See my answer, by the way?
 
Sorry @RubberDuck
 
12:33 PM
It's a gimme-the-code answer.
 
0
Q: What's the point of voting on "questions"

Elias Van OotegemOn this site (code-review), the best questions sometimes contain the worst possible code. I'm not the only one who noticed this. On any other code-related SE site, questions with code that causes puppies to cry, and babies to cringe, down-voting is a good way of notifying other users to "not both...

 
@rolfl Doesn't that only remove until the first? Does it really remove until last?
Hmm... ah, .* is greedy
 
(I made the change, and ran it through hos tests too ;-)
 
0
Q: How do I adhere to the command-query segregation principle here?

Caster Troypublic class Authenticator : IAuthenticator { public bool Authenticated { get { return HttpContext.Current.User.Identity.IsAuthenticated; } } public bool Authenticate(string username, string password) { var authenticated = FormsAuthentication.Authenticate(user...

 
@StackExchange I have no idea actually
why do I vote on questions again
... maybe because I find them interesting
I guess mostly if either the code is interesting or the problem is interesting then it gets an upvote...
2
 
12:38 PM
@Pimgd Which also means it is usually a well written question.
 
and downvotes are mostly for... well, things that actually need to be closed. Or almost closed.
3
liek teh pooor gramrer
public codes
But not really, I should revisit my question downvotes
... I only have two downvotes it seems, the rest got deleted
and one is on the worst question ever
-23
Q: How could I optimize this script?

irywJust wondering if there was someone out there that could offer help in optimizing my script. <?php /** * If you don't understand what this does * you have no hope as a programmer. * */ function usage ( ) { // Ahhh the marvels of echo, such a wonderful tool // yet so advanced that a begin...

The other is actually on an answer, and it's on vogel making a doo-doo
-1
A: Morris inorder traversal

Vogel612In addition to Pimgd's remarks I want to throw in: Program against high Interfaces, not low ones: Currently your methods all take a List<? extends T>. That in itself is quite nice already. Now a traversal of existing elements does not necessarily have to be done on an ordered Collection only. ...

 
hahahaha I just crashed Windows File Explorer.
 
@rolfl well it worked for my SO suggested edits.
 
are all your edits rejected?
 
12:42 PM
the name's not changed yet though.
@rolfl the name is a lie ;)
 
That would explain a bit.
 
just a bit ;)
 
@Vogel612 - in your profile, there are a bunch of 'tabs' like 'summary', reputation, activity, etc. In the activity, there is a 'suggestions' option.
Isn't that what you want?
 
@rolfl I'd need to open all the links to see the status of the suggestion.
 
OK
 
12:47 PM
@Pimgd right, I wanted to revisit that one, but somewhen the 2 rep didn't really make a difference...
and then I forgot..
 
I didn't want to downvote it either but you just had a massive brainfart there on how java works
or object references in general
 
Hello everybody :)
 
@StackExchange Well, voting on this site is pretty much pointless. (Imaginary internet points)
@Morwenn Good morning.
 
I updated my answer
1
A: Validating UTF-8 byte array

JaDoggBetter Test Cases byte[] bytes1 = {(byte) 0b11001111, (byte) 0b10111111}; System.out.println(validate(bytes1)); // true byte[] bytes2 = {(byte) 0b11101111, (byte) 0b10101010, (byte) 0b10111111}; System.out.println(validate(bytes2)); // true You are using simple print statements for testing,...

 
@Pimgd seems like it. or rather I never knew exactly enough...
 
12:59 PM
@Vogel612 Well your statement boils down to this:
a = new Object();
b = a;
a = null;
b is now null!
... no.
 

« first day (480 days earlier)      last day (3545 days later) »