« first day (1125 days earlier)      last day (2897 days later) » 

4:04 PM
Dang it Rust, it doesn't support generating unique function names in any easy way in a macro :|
 
@skiwi reminds me of #define UNIQUE_NAME(NAME) __COUNTER__##NAME
 
There's a concat_idents! macro which could be used for concat_idents!(test_blabla_, $foo) as function name, except you cannot use macros in macros to define the function name
Making it practically useless
 
counter is compiler extension and everytime increments, concatenating with the name it will always give unique names :)
@skiwi, yeah. Pared down c++ :D
 
The only way the macro can name a function is either hardcoded or as identifier, but you cannot compute the identifier in the macro itself
Something really hacky would be to have a macro that calls a macro or something..
 
0
Q: Square and Multiply in C++?

olaghiiiI wanted to write a c++ code for square and multiply but i dont't know how to start. How can i convert the exponent for example to binary ? and then read from left to right for either squaring (1) or multiply (0) https://en.wikipedia.org/wiki/Exponentiation_by_squaring

 
4:12 PM
can I raise a flag on it to have useful flags please? :D
 
@OlzhasZhumabek just do it
 
@OlzhasZhumabek Flag as low quality
 
actually you can also flag for the close-reasons
which is more appropriate here
 
@Vogel612 You can?
 
@Vogel612, I've done so.
 
4:16 PM
@syb0rg 'course
so long as you can't already vote that
 
@Vogel612 Ohhhhh, that's why I don't see it
 
would also allow you to game flags
 
@Vogel612 I think I might start doing that since my flag count is low, and should be higher
 
@skiwi Self-testing code? Sounds interesting. Also sounds like it's violating SRP.
 
@syb0rg You can't, so there's that
 
4:18 PM
@Mast, single responsibility principle?
 
@OlzhasZhumabek yeap
 
Yea.
 
To ask for improvement of working code like yours, it's probably better to ask at Code Review SE. — πάντα ῥεῖ 42 secs ago
 
why is there so low C++ programmers? The ones I see frequently are Janos, LokiAstary and JerryCoffin, but others seem to be reviewing only one question in a long while
 
@OlzhasZhumabek those three are the big ones in the C++ tag
 
4:23 PM
Ah, I was unaware of code review se. thanks - I was worried about opinion based — johnnymopo 51 secs ago
 
@Vogel612, JerryCoffin is so cool, one day I want to write code like him :D
 
lol
Why not aim for the stars?
"one day I want to write code better than his"
 
:) the only way I can exceed either of them is when they stop learning, cause it's impossible to beat 20+ years experience with 1+ year experience :D
 
@OlzhasZhumabek Edward, glampert, 200_success, there's a couple more.
 
4:26 PM
Hey at least you're writing C++. I'm still only writing Java or C#
 
Morwenn used to be very active in that tag.
 
Those are kinda boring, considering they are managed
 
Yea, you should totally drop that and learn ASM instead.
 
actually VHDL will be coming before that
 
@Mast, I've seen that Andrei Alexandrescu mixes inline asm, macros and templates
 
4:27 PM
VHDL is awesome, we definitely need more questions in that tag.
 
and I may have to learn Perl, Haskell and C++ as well as a huge handful of others for "Programming Paradigms" lecture
relics like Ada and Basic are coming
 
COBOL.
 
I hope not
 
@Vogel612, it's cool that you're in university, I'm going to be enrolled in one soon. The only reason it's cool is free programming books
 
If that's your reason, don't do it.
I can get you a hundred free programming books in less time.
 
4:29 PM
@Mast ^^ there they are
 
@Mast I would say that we more VHDL answers.
 
Darn, beat me to it.
 
@Mast bookmark organization ftw
 
@200_success All VHDL questions are answered already IIRC. So get more questions first.
Both would be great.
Too bad Paebbels isn't around more often. He has awesome answers on both SO and CR, but he seems to prefer SO.
On an unrelated note, it's almost Friday.
 
:30075999 I don't pirate Mr. Judge. I am merely borrowing this file...
 
4:33 PM
and comes the day when I will start attending startup school, where we write ios and android apps :Q
 
@syb0rg aaand you missed the train
 
@Vogel612 I like being the caboose that fell off and is trailing behind
 
sidenote: I can read both of those messages anyways
 
@Vogel612 You're RO, doesn't count.
99.9999999% of the internet isn't.
add extra 9's at will
 
@Mast is it like people who cache stuff always?
 
4:35 PM
RO?
 
Room Owner.
 
no that just means my name is in italics and I can do some useless things
 
aka name-in-italics
lol
 
Blue names are also room owners.
AKA moderator.
Of the site, not just the room.
 
they can do not quite so useless things
and they are chat-wide. not only for one room
Sidequestion: @Mat'sMug did you see the little raffle about merging chat.SO into chat.SE on meta.SO?
 
4:37 PM
doesn't look like it's going to happen
from what I read anyway
 
@200_success How's your VHDL anyway?
You seem to know a bit about most of the languages out there.
 
I seriously wouldn't mind and both answerers seem to just spout away unfounded assumptions
 
btw can I ask someone to clean up after I've completed clarifications in comments? Should I just flag it?
 
@OlzhasZhumabek Yes and no.
 
@Mast actually... yes and yes
 
4:40 PM
Flag those comments which need cleaning up, not just the post saying 'needs clean-up'.
 
where?
 
Be mindful of our moderators.
They like cleaning-up crap, but don't make it unnecessarily hard on them.
 
@Mast it's not like they're drowning in flags like SO mods
 
@Vogel612 True, and our flag-handling time is awesome.
 
@Vogel612 Dang it, forgot to flag this incoming question for closing and just went straight for the close
 
4:40 PM
But I'd like to keep it that way.
 
@Mast I know nothing about VHDL.
 
@Mast, I wanted to keep it clean, but also wanted to keep my point. I kept clarifying his concerns. I will try to avoid that next time
 
@OlzhasZhumabek remember, you can invite them to chat if the discussion needs a faster pace
 
@200_success Would it help if I post a 'Hello, World!' style question explaining the basics?
Assuming you're interested in the language, that is.
 
4:42 PM
@Vogel612, I want to, but the discussion is terribly slow
 
@Mat'sMug That would actually be quite interesting to implement.
 
@Mast There are two university courses that I didn't do well in. One was Digital Design. The other was a physics course at 8 am.
 
@200_success Physics is cake.
Even at 0800.
 
@EBrown physics is vectors and right hand rule :D
 
@OlzhasZhumabek Until you get into the EE part of physics.
 
4:47 PM
That course was quantum mechanics and special relativity.
 
@EBrown, I believe there are 3 right hand rules in EE
 
I liked physics early in the morning. Every now and then the laws of physics would be slightly groggy, and our experiments would do weird stuff.
 
who can even do that at 0800?
 
@200_success Even better.
 
@EBrown cake at 8am?
 
4:48 PM
@Mat'sMug Hey, it's 1700 somewhere.
 
in Spain, probably
 
Bam. I'll just eat Spanish cake and drink Spanish beer.
 
-1
Q: Fortran File Reading Error

user107007I have been working on a fluids simulation and an error recently popped up for no apparent reason. When trying to run my Fortran program, I receive the following error: TIME: 0 Reading flow from ~/Documents/Research/Code/code0 /New3/diablo.saved.0000000 ...

 
can I destroy the room to which I moved extended discussion in comments afterwards?
 
I swear, @OlzhasZhumabek every time I see you chat something I think it's @200_success for a minute thanks to your identicon.
 
4:51 PM
"identicon" sounds like some kind of Transformer bot
 
I thought that was Bumble Bee?
Spoiler alert: Bumble Bee is yellow.
 
@EBrown, I wanted to put something, but I don't like avatars and photos. Gonna put something anime style soon
 
@OlzhasZhumabek It better not be a fish. >.>
 
@EBrown, why not? I can cosplay him from time to time :D
 
This computer is a joke.
Every now and then a different hard drive fails S.M.A.R.T. testing.
Now it won't detect my SSD at all on the SATA bus.
This is not good.
 
4:56 PM
Are you on Windows? Intel made some nasty stuff about SSD in their CPUs
 
Sata_1 and Sata_2 won't be detected at all.
Wtf.
There we go, Sata_1 is up.
That's a start.
Not a particularly good one, mind you. But a start.
 
Satan_1 and Satan_2?
 
Starting to look like it now.
Only 6/7 HDD's are detecting.
Now the SSD won't boot.
That's what I needed today.
"BOOTMGR is missing"
 
@EBrown, have you tried to put AHCI mode on them?
 
Bull.
 
5:02 PM
@EBrown, clearly put AHCI and reinstall OS
 
I'm not reinstalling anything.
And they're already AHCI.
This MB is the problem.
Freaking MSI
I think the Boot Manager is on the drive that won't be detected.
FFS why me?
 
I believe there was something like repair mgr in preboot menu, not really sure though
 
WTF
 
btw now I'm a blue fish
 
This is dumb.
Everything works great for years, now all of a sudden it's messed.
FINALLY
Detected.
Boot you piece of crap.
Oh look, another one of Windows 10's many loading screens.
 
5:09 PM
it seems like windows 10 uses windows 8 as backend
 
Windows 10 uses Windows ME as a backend.
That's the only other OS that was this bad.
 
0
Q: SICP exercise 1.28 - miller-rabin test

morbidCodeFrom SICP Exercise 1.28: One variant of the Fermat test that cannot be fooled is called the Miller-Rabin test (Miller 1976; Rabin 1980). This starts from an alternate form of Fermat’s Little Theorem, which states that if n is a prime number and a is any positive integer less than n, t...

 
Schrödinger's Production Network
heh
 
this is amazing
so amazing it breaks markdown
 
it has 2 redirections o_O
My icon is not reloading, sigh
 
5:25 PM
@DanPantry also doesn't have vivaldi, canary or chromium
 
or Servo :p
 
@Vogel612 I thought that chromium is chrome
 
nope it's not
 
No, Chrome is google's fork of Chromium i believe
 
@DanPantry the other way round-ish
also Canary is in there somewhere, too
 
5:27 PM
Canary is the beta channel of Google Chrome
 
@OlzhasZhumabek hit F5, I'm seeing your new avatar and refreshed your chat profile a while ago already
 
@Mat'sMug, not fish, but a tide
 
@OlzhasZhumabek No.
 
oh it's on now
 
should be good now
 
5:31 PM
thanks
 
np
 
/shrug I see a fish here, but a tide in his chat profile
 
@DanLyons, I had that a few seconds ago
 
I see something blue, not sure whether it's a fish.
@200_success In that case, I won't bother you with it :-)
 
@Mast, I wanted blue fish like a reverse flash, but was too lazy to use blue bucket on his avatar :D
 
5:38 PM
0
Q: Unit test with check testing framework

Programmer 400The function that I want to test is int IBQplain(int pos, char *str, int offset); int IBQdouble(int pos, char *str, int offset); int IBQsingle(int pos, char *str, int offset) { int escaped = 0; for (; str[offset]; ++offset) { if (!escaped) { switch (str[offset]) { ...

0
Q: Generating passwords using python and saving to txt

JacobI need help making a python file that generates passwords and saves them to a .txt file. This is what I have below... How can I make it save to a .txt file?import itertools res = itertools.product('1234567890!@#$%^&*()QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm', repeat=8) # 8 is the l...

 
anybody plays guild wars 2 || black desert ?
 
I play the former
 
do you have legendary weapon? I couldn't grind it in 5 months
 
wow... wtf. You can call ASM code directly from java??
 
5:54 PM
@Vogel612, can it wire to C in the backend?
 
better. It compiles to given ASM instructions
sure you can wire it to C in the background. But that's not really new for java
JNI did that
 
o_O crazy stuff
 
1
Q: Code Explorer UI

Hosch250The third post in the Code Explorer series is about the UI and main VM. This is the XAML, except a few hundred lines of styling: <UserControl x:Class="Rubberduck.UI.CodeExplorer.CodeExplorerControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmln...

 
@Vogel612 The real question is why you'd ever want to do that.
 
@Mast when you need extreme optimization? :D
It's kind of this optimization
423
A: Fastest way to determine if an integer is between two integers (inclusive) with known sets of values

Jerry CoffinThere's an old trick to do this with only one comparison/branch. Whether it'll really improve speed may be open to question, and even if it does, it's probably too little to notice or care about, but when you're only starting with two comparisons, the chances of a huge improvement are pretty remo...

works on C as well
 
6:02 PM
@OlzhasZhumabek Doing something in ASM does NOT magically make it faster.
 
@Mast I'm not saying always :) I always recall what Herb Sutter says: first rule of optimization: don't do it
 
I don't know who Sutter is, but that sounds like generic advise easily taken out of context.
 
yeah, but other advices include to avoid premature pessimization
 
Premature optimization is the root of all evil (well, together with a whole bunch of things really), but that doesn't mean one should never optimize.
Optimization can be good.
 
most premature optimization quotes I know came from Donald Knuth, who includes the context in the original text, but nearly everyone drops off the important bits
 
6:06 PM
http://www.commitstrip.com/en/2016/06/02/thank-god-for-commenters/
CommitStrip
Thank God for commenters
CommitStrip
1464890557
 
is CommitStrip a bot? Sorry if not
 
@OlzhasZhumabek Feed.
 
it's a feed.
close but not quite
 
Feed.
 
A feed is an automatic post system. It isn't intelligent and doesn't do anything except that one task.
 
6:08 PM
I've read that making a train makes Cpt Obvious join it. @Mast, yeah I've read about them on meta
 
@OlzhasZhumabek He shouldn't.
 
@Mast he did.
just saying
 
@Mast but I've seen a screenshot where he says "Hi"
 
6:09 PM
let's call it magic, aight?
 
Feeds can't do that. I suspect someone pulled a funny there.
 
@Mast yea. I even know how
 
@Mast "Feeds can't do that." Why? What rule is that?
 
@Vogel612 I smell RO power abuse.
 
@EBrown feeds are dumb
 
6:10 PM
@Vogel612 So are most bots.
 
@EBrown It's a feed. Feeds are plain stupid and only carry on information.
It's their definition.
 
@Mast ROs cannot impersonate other chat users
 
Bots have a broader definition.
@Vogel612 Who 'owns' Captain?
 
Making a bot join a train is easy
@Mast Captain is a Feed
 
Exactly.
But someone took over.
Easter egg?
 
6:11 PM
meh. why would it be?
KISS... who can take over user accounts?
 
SE staff, probably.
Mods can't IIRC. So someone above that.
Direct database injection could work I guess, but you'll need a dev for that.
 
So, feeds are stupid. If you see any sign of intelligence in a feed, it's dev magic.
 
yep
 
6:13 PM
though I can make feeds say something.
it's just red tape messages though
 
@Mast, got it. @Vogel612, may be joining a train would be great?
@Mast, btw isn't direct database injection too low level and dangerous?
 
Oct 19 '14 at 2:06, by Captain Obvious
Hi
@OlzhasZhumabek Definitely.
 
@OlzhasZhumabek oh it would be, but you know...
 
But if you know what you're doing most of the risk is mitigated already.
 
^^ admin privilege vulnerability in chat that's been patched out
> [...] I had a database query interface where I could directly query any database that I wanted. I had admin access to chat.
 
6:18 PM
@Vogel612, that's what I was thinking about :)
My 50 rep, I will miss you ... not for long
 
> When they configured a page which would dump the raw request headers, my requests came through as Remote_Addr: 127.0.0.1!!!
That's bad.
 
Periodically I get random up votes on my SO questions...I guess that's what's supposed to happen?
 
@Mast, should that numbers tell anything?
 
@OlzhasZhumabek The server thinks he was logged in locally, lifting some of the restrictions put in place.
 
That is the loopback IP address.
 
6:21 PM
@EBrown, I've got an upvote on very old ones. Seems like people just watch profiles and see interesting question / answers
 
@EBrown yeap it is
 
@OlzhasZhumabek Google, my friend.
 
@EBrown Yup. On any site, really.
 
@EBrown, I've never seen a good question that I could upvote, because most people who use google actually are new users. wow, I only know 192.168.0.1 :D
 
I get most random SO votes on that simplistic fix from ages ago where you can't compare SQL's TEXT-Type to Strings...
 
6:25 PM
My Hello Brainfuck and Wabbit questions are doing quite well with random votes as well.
 
In the documentation I'm reading: "MMS-EASE Lite has many global variables... This can cause problems..."
OH REALLY
 
>IP addresses are usually written and displayed in human-readable notations, such as 172.16.254.1 (IPv4), and 2001:db8:0:1234:0:567:8:1 (IPv6).
 
0
Q: Creating multiple objects using two forms

MilanoI would appreciate if you check my code and tell me what should I change. The code finally works but it could be much clear in my opinion. This is all about creating an order which is a Job object. The order is an order of translation of some text or file. There are models Job, Language and Leve...

 
2001:db8:0:1234:0:567:8:1 so readable
 
@OlzhasZhumabek it's better than 128 binary digits
also you'll only ever need ::1 anyways
 
6:28 PM
@Vogel612, yeah. Can't see double colon anywhere
 
IPv6 simplifications are interesting
the problem in your example is that there's no canonical simplification
 
so cool that c++ makes possible to have ' character in numbers, like 1'000'000
@Vogel612, may be erasing that db?
 
you may only use one double colon in one address and that has to be applied to the longest :0: chain
@OlzhasZhumabek wat?
 
@Vogel612, std::cout << 1'000'000; is valid
 
soo... what does it result in?
there you have your answer.
 
6:32 PM
clarifies number of 0s in code. It does nothing, but does it in style
 
so in what way would that relate to dbs?
 
@Vogel612, oh sorry, I was thinking about c++. I just recall it always when I hear about unreadable numbers
 
0
Q: How to fasten Json parsing in bash

RahulI have a json file which needs to be restructured. The following is the code. while IFS='' read -r line || [[ -n "$line" ]]; do COUNT=$(( $COUNT + 1 )) #echo "[$COUNT]" [ $COUNT -lt 5 ] && continue sj=`echo $line | jq ._source` index=`echo $line | jq ._index | tr -d '"'` ...

 
@CaptainObvious tehee ... fastening Json parsing
 
He's parsing 4 Gb (probably GB) and wonders why it takes long.
In fairness, it's not the worst implementation I've seen.
 
6:43 PM
@Mast, during my generation of input for a test, I accidently generated string of size INT_MAX, and was wondering why I get memory peeks sometimes. I will remember this for the rest of my life.
 
0
Q: Submitting a new version for review

mdd-sboI previously posted a class for review (~2 weeks ago). It received some feedback. I accepted a response. I made changes per the review, then additional changes that were not motivated by the review. I'd like to post the new version for additional review. I'd like it to be open to anyone (not...

 
@StackExchange Powerhandled.
> TYIA
 
so fast
 
0
Q: Hash table OOP implementation in C

Tobias JohanssonTo brush up my C I decided to do some OOP programming in C. I have never tested this before, but I was curious to try it since seeing an example of it a while ago. I decided to implement a simple hash table. My first approach was to give each instance of the object its own methods, i.e. pointers ...

 
gonna finish 2nd season of flash, bye guys
 
7:21 PM
0
Q: Simple Background Thread Worker Class (follow-up)

mdd-sboThis is a follow up of Simple, generic background thread worker class What changed? Moved from synchronized lazily evaluated static instances to true Singletons per the on-demand holder idiom https://en.wikipedia.org/wiki/Initialization-on-demand_holder_idiom Added a constructor to auto-start ...

 
you are in the wrong place my friend, you want your code reviewed. — Tadhg McDonald-Jensen 35 secs ago
 
@Duga Possibly incoming. Needs some clean-up.
 
0
Q: number of Divisors of factorial in python

john smithI was solving this problem: Given a number, find the total number of divisors of the factorial of the number. Since the answer can be very large , Print answer modulo (( 10^9)+7). Input The first line contains T , number of test cases T lines follows each containing the numb...

 
Just as a sidenote on international deviations: In Sweden criminals will get a discount for all subsequent crimes that are less severe than the most severe crime. So if you did 5 crimes with 2 years sentance each (which would result in 10 years) you would in reality get around 5-6 years instead (40-50% discount!). So as you commit more and more crimes, the risk gets lower. It's a crazy world. — Liren yesterday
 
@Mast as I said earlier I did not knew about code review site before Tadhg McDonald-Jensen mentioned and now I also have posted the question on that site also codereview.stackexchange.com/questions/129974/…john smith 20 secs ago
@johnsmith Since you have posted this question on Code Review, you should delete this post here. — syb0rg just now
I'm voting to close this question as off-topic because it is much better suited for code review and has been migrated already. — Tadhg McDonald-Jensen 54 secs ago
If your code works, post to CodeReview @ StackExchange.com for a performance review. BTW, have you profiled your code? — Thomas Matthews 14 secs ago
 
7:44 PM
That's an interesting law @Mast, but I think it's a bit facetious of Liren to look at it that way. I'd have to research to ascertain this, but it's probably meant for isolated actions/sequence of actions. Most crimes tend to inherently break other related crimes-- there's the psychological factor when one's already done wrong, but we even have terms that group them like "assault and battery" not to mention things like DUI, Felony DUI, and public intoxication are technically different.

It's interesting for sure though.
 
@Duga That's now how migrations work, but points for trying to understand the lingo.
@Legato Yea, now I wonder whether this also means the 'base penalty' is higher than average to compensate.
I think this next comment puts it in perspective as well.
@Liren The justice system is not about "trade" where you trade X years of your life for the right to murder someone. Instead it's about a combination of reintegration, satisfying the need for vengeance, and making people feel safe. In simple terms: someone who robs 4 banks is quite simply not twice as evil as someone who robs 2 banks, so there's no ethic or economic need to spend twice the money to punish them. — Peter yesterday
 
Definitely.
 
Say robbing a store gets you 6 months. Robbing 30 stores would get you 15 years, without discount.
No judge would agree with such a ruling.
It would also mean robbing 100 stores gets you the equivalent of a lifetime sentence.
 
I'm in the U.S. and over here it sometimes seems people forget that the purpose is rehabilitation rather than merely punitive action.
I still think it's about the fact that laws inherently break others. Like to rob something is theft, but it's also probably breaking and entering / trespassing, public disturbance and vandalism.
On the news when people are on trial it's often for something like "2 counts of A, 3 counts of X, and C and it could've been something that all happened within 30 minutes.
But anyway, getting OT. :)
 
getting OT? ;-)
 
7:55 PM
@Mat'sMug Got anything better to talk about? :P
I'm not active on Law at all. Got exactly one answer there.
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: NodeJS static file HTTP server
 
@DanPantry
 
8:13 PM
0
Q: extracting exception throwing code, is there a way to avoid `return null;`?

Jeff Shaw(Note: this is originally posted as this SO question ) I'm trying to refactor the error logging and exception throwing into a method. Original code: private Box retrieveBox() { BoxParameter param = new BoxParameter("red", 10, 5, 3); List<Long> boxIds = boxDao.retrieveByParameter(param...

 
8:23 PM
0
Q: Symmetry analysis of a problem in materials research (a.k.a. "how is my Haskell?")

Exp HPFor a while now I've been meaning to post some of my Haskell code here so that someone can tell me what parts of the language/base library I've been completely overlooking. This is the first thing I've brought into a "working/finished" state that isn't a PE problem, and unfortunately it is a tad ...

 
If you have working code which merely needs improvements then you're probably in the wrong place with this post. Code Review is where they handle existing / working code and do their upmost to improve it in terms of speed, security, sustainability, and longevity. Give it a try. They're good! In the meantime you might want to consider using this: Dim aNavRec as Variant and then aNavRec = Range("A2:D" & LR )Ralph 52 secs ago
 
0
Q: understanding c++ header : Stack push and pop operations

user230871Attached is a C++ header. I would like you to write what you think of the header and what you would do to improve it. Do you see errors? Do you see places where the design could be better? Does the header follow best practices in C++? What’s missing? Etc. #include <stdlib.h> #include <iost...

 
Guys need your help with the last question. I can't explain to OP that title and text in question should contain description of what code should do. For now it's only in comments
 
Op's code is working (for the most part) and is seeking advice on improvements. Code review is a good place for reviewing working code. — chux 40 secs ago
 
8:55 PM
@OlzhasZhumabek I think you're taking it too far and have rejected your edit ...
other opinions may differ. let's see what happens :)
 
actually it wasn't me talking, it was OP
I just wanted to keep my intervention minimal
extracted description from the comment and put on the first paragraph. @Vogel612 could you suggest tips for better edits for the future?
 
hmm... it's maybe just me...
 
anyway I want to know some, if you don't mind
 

« first day (1125 days earlier)      last day (2897 days later) »