« first day (1171 days earlier)      last day (3141 days later) » 

20:00
Tumbleweed candidate; zero score, no answers, no comments, and low views: Command line VBScript spam bot
@forsvarir please read the Meta Post, it lays out how we go about running through that queue fairly well.
a lot of us have our 1k reviews badge for that queue so we leave it to you all so you can learn what Code Review is all about and so that you have a chance to jump on the new posts to give awesome reviews before we see them :)
@pacmaninbw Some formatting errors, see if I missed any in that fix edit
Hello @Neal
20:16
@Vogel612 You can do multi-player Factorio?
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Nested values copies from one object to another
@Mast up to 255 people
@Mast And you can do it over the internet if you can port forward
20:33
@arda Madness.
0
Q: Process bytes and check for start key

ChristianI am working with some wireless communication in Arduino. My data will be wirelessly received like so: 97 97 97 ... ... 979797 is the address of the transmitter. I have written the following code to check the address first before processing the data. My main concern is speed of computation. ...

@Mast yeah
What would be the point of a 255-player Factorio game?
@Mast to see what happens or youtube views
likely second
It's kinda fun rewriting the build system for LibSndFile: github.com/syb0rg/libsndfile/commit/…
If you have ever used Audacity, LibSndFile is in the back end of that application
20:41
monking
@syb0rg I remember writing my own filters for that in that funky language of theirs.
0
Q: Unable to Link Libraries to Target?

syb0rgI have the following CMakeLists.txt, trying to build my software on Windows with MinGW-w64: # # Initial CMake and project setup # # Required CMake version (ExternalProject) CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) INCLUDE(ExternalProject) SET(PROJECT_NAME Khronos) PROJECT(${PROJECT_NAME}...

In case anyone here got awesome at CMake... @SirPython? ^^
Heh, not quite. Still getting used to it and playing around with it (had to take a break recently, though)
@syb0rg I don't want to sound like an ass, but that's not a MCVE.
Have an upvote anyway
@Mast I know... I know
Is a CVE good enough?
20:54
@syb0rg Why do you do this:
possible answer invalidation by Charon on question by Charon: codereview.stackexchange.com/posts/135142/revisions
SET (GCC_COMMON_WARNING_FLAGS "-pedantic -Wall -Wextr...
SET (GCC_COMMON_WARNING_FLAGS "${GCC_COMMON_WARNING_FLAGS} -Wno-u....
:31119868 I thought I removed that... must have those changes still local on my Mac
instead of doing that all in one statement.
@SirPython I should be, and I think I do in a more recent Unix specific edit
Anyways, TTQW
20:58
@syb0rg Added the full name of OPC to your question by the way, hope you don't mind.
If you scout around CR and can find more questions about OPC, you might want to add a tag for it.
@Mast Fine by me!
how do I create a chat room and invite a user that only has 21 rep?
2) give them link, and give them explicit write access when they come in
I think I might invite here
someone ping me when @ExtremeCSharper comes in
thanks
care to join me in The Second Monitor and help me to understand why you don't like my suggestion? I am open to learning more about C# than I already do. thank you — Malachi 29 secs ago
21:11
(if you need help giving explicit write access let me know)
@Malachi I'm pretty sure he is right, that you should leave the using statement, and then return, to properly call Dispose() on the value.
Also, your guest is here.
Hi, @extremecsharper.
Update: Both I and he is wrong: stackoverflow.com/questions/11776945/…
> It's perfectly safe to call return inside your using block, since a using block is just a try/finally block.
@extremecsharper it's not so much that it is faster, I haven't tested it.
like @Hosch250 and that SO answer said, the dispose is essentially inside of a finally block, it wouldn't make sense to return after the finally block, it would make more sense to return inside the block itself.
I also thought about moving the instantiation of the variable inside of the using statement as well, because there was no reason to declare it outside of the statement, it should be declared just outside of the foreach loop
@Malachi Wrong analogy.
yeah probably
I'm not too sure how try/finally's work, but if you don't dispose correctly, you'll have a memory leak.
21:25
the purpose of the using statement is to avoid the "if you don't dispose correctly"
the data isn't linked to the things being disposed of in that code
I mean, I'm not sure where the finally runs.
after scope leaves the using block
Does it run before the return anyway, or after?
I am pretty sure that the finally would run after the return
	private IEnumerable<ExpandoObject> GetOuGroupsUsersData(
		PrincipalContext pc)
	{
		var data = new List<ExpandoObject>();
		try {
			var gp = new GroupPrincipal(pc);
			var ps = new PrincipalSearcher(gp);
			var psr = ps.FindAll();
			foreach (var g in psr.GetGroupPrincipals())
			{
				try {
					var gpsr = g.GetMembers();
					data.AddRange(
						gpsr.GetUserPrincipals().Select(
							u => GenerateData(g, u))
							.Cast<ExpandoObject>());
				}
				finally{
					gpsr.Dispose();
				}
			}
that is what it would look like if you didn't use the using blocks
so of course you would put the return inside the try block before the final finally but after the foreach. the finally statements are just clean up
there is the possibility that a return can error, so I would assume that the return would fire before the finally block cleans up
Yeah, it does.
From what I can figure out, it leaves the scope, loads the value into a variable, then runs the finally.
21:34
@Hosch250 are you saying that it returns then disposes?
Yeah.
Well, no.
It leaves the scope, calls the finally, then returns from the method.
class Bar
{
    public string Main()
    {
        using (var f = new System.IO.StreamWriter(""))
        {
            return "test";
        }
    }
}
IL_0000:  nop
IL_0001:  ldstr       ""
IL_0006:  newobj      System.IO.StreamWriter..ctor
IL_000B:  stloc.0     // f
IL_000C:  nop
IL_000D:  ldstr       "test"
IL_0012:  stloc.1
IL_0013:  leave.s     IL_0020
IL_0015:  ldloc.0     // f
IL_0016:  brfalse.s   IL_001F
IL_0018:  ldloc.0     // f
IL_0019:  callvirt    System.IDisposable.Dispose
IL_001E:  nop
IL_001F:  endfinally
IL_0020:  ldloc.1
IL_0021:  ret
jrh
jrh
Quick question, do you guys think Bit Endianness is still a big deal these days? PowerPC Macs are pretty old...
IL_0006:  newobj      System.IO.StreamWriter..ctor    // creates StreamWriter
IL_0013:  leave.s     IL_0020    // leaves scope
IL_0019:  callvirt    System.IDisposable.Dispose    // calls dispose
IL_001E:  nop
IL_001F:  endfinally    // finishes finally block
IL_0021:  ret    // returns from method
would it be different if it were multi threaded? random question might not have any bearing
I'm pretty sure not.
21:40
it still sets the return variable before it calls the Dispose though
> IL_0016: brfalse.s IL_001F
Of course, otherwise it would lose it.
try to return from outside of the using
Can't return a boolean from a string.
It detects unreachable code and doesn't do anything.
I mis-typed
sorry
IL_0000:  nop
IL_0001:  ldsfld      System.Boolean.FalseString
IL_0006:  ldstr       "False"
IL_000B:  call        System.String.op_Equality
IL_0010:  stloc.0
IL_0011:  ldloc.0
IL_0012:  brfalse.s   IL_0034
IL_0014:  nop
IL_0015:  ldstr       ""
IL_001A:  newobj      System.IO.StreamWriter..ctor
IL_001F:  stloc.1     // f
IL_0020:  nop
IL_0021:  ldstr       "test"
IL_0026:  stloc.2
IL_0027:  leave.s     IL_003C
IL_0029:  ldloc.1     // f
IL_002A:  brfalse.s   IL_0033
IL_002C:  ldloc.1     // f
IL_002D:  callvirt    System.IDisposable.Dispose
The actual leaving of the method is still the last thing to execute.
Once it leaves the method, it can't run any code from it. The finally will always run before the last brace (if you can say the last brace really runs...)
21:44
I asked @Nick_Craver why he sold his house and he said "String allocations in the walls" and I laughed but he didn't https://twitter.com/Nick_Craver/status/754047901949657088
@Hosch250 agreed.
that isn't the same code with the return outside of the using block though, what is the C# code?
class Bar
{
    public string Main()
    {
        if (bool.FalseString == "False")
        {
            using (var f = new System.IO.StreamWriter(""))
            {
                return "test";
            }
        }

        return bool.FalseString;
    }
}
I had to use an if to make it not just compile away the final return.
I gotta finish this email, but this was rather enlightening either way.
remind me to ask you how you get to that compiler code or whatever it is....I haven't ever messed with that, and I would like to
LinqPad.
I have the free version.
me too. but you can see that in VS as well can't you?
21:55
Possibly, I don't know.
It's called "IL", anyway.
Just go to the IL tab in LinqPad.
jrh
jrh
I'd recommend ildasm if you don't have linqpad
it comes with visual studio
you can access it through the visual studio command prompt
I'll tell you where it is in a few... got to go
0
Q: Unit testing Spark transformation on DataFrame

wrschneiderLooking for suggestions on how to unit test a Spark transformation with ScalaTest. The test class generates a DataFrame from static data and passes it to a transformation, then makes assertion on the passing static data generated in the test class. (The transform creates a second column b defin...

0
Q: Python hangman game better ways to write a simple project

YoYoYo I'm AwesomeI've created a little hangman game. It's pretty simple, and not to exciting but I want to know if there's a way I could turn this little game into something more extravagant and more exciting. How can I take this delicate piece of crap machinery into something a little more fun and a bit more com...

0
Q: Best way to move function to models in nodejs? Fat model / skinny controller

NoobSterMy code works, but I understand it's best to have fat models and skinny controllers. However, I am using 3 different models and have unfortunately made my controllers fat. What is the best way to organize this code? I've been reading on code structure, but I'm a bit unsure of best practices. ...

@jrh In most situations? No. In networking and multi-platform? You never no.
Some people pick the craziest user names.
I'd rather be seeing "user239039" than some of these...
@Hosch250 you mean the poster of this question chat.stackexchange.com/transcript/message/31121242#31121242?
22:08
Yeah, and the one below it.
Agreed.
done forget unicode-abusing names
I can't stand arrogant people who claim they are "noobs". Maybe instead of advertising themselves as fools, they should work on the remedy.
@arda that user is a little dramatic though
he's been in a bit of chat drama lately
oh boy did they drop here too?
22:09
I don't think so.
Quill is a mod, he knows.
I'm a man of the world (lots of SE rooms)
that user is claiming that someone will come back and dox someone since like 3 days ago, in bridge at least 0ws.pw/62fs.png
@Hosch250 IMO it's better than people that write up their profile egotistically
@Quill Same principle--they are advertising themselves as fools.
22:11
heh
BTW, I was just working on trying to test a WinForms dialog like WPF, and it can't be done.
Yup. Both are a disgrace to the community.
But hey, this is the internet.
Internet is odd.
Looking forward to 2.1 when I can work on what I please and do some fun things.
22:12
Many people on the internet.
@Mast I've noticed people are very similar on the internet to what they are in real life.
Maybe some things are masked a bit and others brought out, but that is usually because they are trying to hide something.
Yup.
The internet gives them a feeling of anonymity, where they can show their true colors.
22:25
possible answer invalidation by Tom Wenseleers on question by Tom Wenseleers: codereview.stackexchange.com/posts/134926/revisions
@Duga Rolled back.
1
Q: Clojure performance for solving Project Euler 72

ntalbsThis is a solution of Project Euler 72 in Java. public long solve() { int limit = 1000000; int[] phi = IntStream.range(0, limit + 1).toArray(); long result = 0; for (int i = 2; i <= limit; i++) { if (phi[i] == i) { for (int j = i; j <= limit; j += i) { phi[j] = phi[j] /...

22:49
@Duga And the edit train finally pauses at Rev 53.
Wow.
Or 55, depends on how you count.
jrh
jrh
@Hosch250 found it
for me ILDASM is in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
Cool.
jrh
jrh
I really thought it was in the visual studio directory
I strongly suggest that you make a shortcut to that
I always forget where it is (case in point)
it's a great tool, you can reflect an entire assembly, open up any compiled class in a text window, and get a good idea of how the .NET languages work
@Mast Can PowerPCs run .NET though?
is there another Big Endian architecture?
I agree with the principle though
23:21
You guys use the SE app?
yeap
jrh
jrh
nope
my fax machine can't seem to connect
23:43
0
Q: Make Simultaneous HTTP Requests That Resolve Into a Single Return

Drew BeresThis week, in an ongoing job search, I was tasked with the following pre-screening question: Make two simultaneous http requests. Use the language and library of your choice. Make sure the results are combined and resolve into a single return. For this I chose JavaScript and jQuery, culmina...

0
Q: Sort a binary file without loading it into memory or using a temporary file

smrdo_prdoI had a silly assignment: You are given a binary file FLOATS.DAT of unknown length, type float data has been written in it. Write a program which sorts the data in the file (the output is a sorted file FLOATS.DAT). You need to sort it without loading the file into memory, or by using a ...

@jrh I don't know.

« first day (1171 days earlier)      last day (3141 days later) »