« first day (334 days earlier)      last day (3684 days later) » 

1:12 PM
So, you have a clear requirement that the file 'picking' stage has to be independent of the processing stages. Use an FixedExecutirService as the buffer between them. Easy.
 
had to star something, it is quite a dreary day today
 
@skiwi - just realized that you are probably wondering how to process the subsequent stages in a stream... and that my suggestion does not make sense....
... well, you are trying to shoe-horn a process in to a stream, and the proces is not a stream.... so, that's why it is not working.
You can use a stream to pick the files, but, using a custom Callable<Path> or whatever is the right solution for handling each picked file.
Then, your picker stream adds a new Callable the the executor service, and the Callable does its thing, when scheduled.
@palacsint - welcome to #2
 
I'll read that up in a bit
 
1:28 PM
@mat's Mug looks like we have some fun new VBA questions....not sure I can answer these ones either......
From ▼▼▼▼
@rolfl there aren't very many stars in that Assembly chatroom.. there is one from July on the side bar
 
0
Q: Prime Generator Program Python SPOJ Python Code time limit exceed

Andres PenaProblem Statement Input The input begins with the number t of test cases in a single line (t<=10). In each of the next t lines there are two numbers m and n (1 <= m <= n <= 1000000000, n-m<=100000) separated by a space. Output For every test case print all prime numbers p such that m <= p <= n...

 
Argh, I just realized that my wall of C code cannot be compiled ><
 
Hmmm, I really miss @kleinfreund, his css reviews were informative
 
@Malachi - for SE wide Mod-involved discussion:
> Open room for discussion amongst and with moderators for SE wide issues. Sensitive details should remain inside TL. On rare days, you may find a wild @Aarthi here
Very much a formal room, not for frivolous starring.
 
1:44 PM
@rolfl I Caught that.
I did have to star this though ▼▼▼▼
in The Assembly, Jul 12 '13 at 23:09, by ManishEarth
@Aarthi It's very impressive when they used it to burninate [tag:god] on Christianity
what is @Aarthi anyway, @rolfl??
 
No idea.
 
:For the similarly spelled Christian movement, see Arathi. Aarti (Hindi आरती), also spelled arathi, aarthi (from the Sanskrit word "आरात्रिक" with the same meaning) is a Hindu religious ritual of worship, a part of puja, in which light from wicks soaked in ghee (purified butter) or camphor is offered to one or more deities. Aartis also refer to the songs sung in praise of the deity, when lamps are being offered. Origin Arati is derived from the Sanskrit word Aratrika, which means something that removes Ratri, darkness (or light waved in darkness before an idol). Aarti is said to have d...
 
is her reputation locked? have you looked at her profile for meta??? doesn't look right
 
occam's razor
 
1:51 PM
Always fun when variable renaming causes bugs
3
 
@skiwi - you see my pastebin?
 
@rolfl what do you mean? look at some of those answers. there is no way a downvote spree would bring a user down that far.
I upvoted one of her answers and it increases her rep
 
@rolfl Reding it in a bit, fighting with SVN at the moment
 
@Malachi -what are you on about...... I don't see any crazy downvoting.
 
@rolfl I need to look up Occam's razor
 
1:56 PM
I finally managed to improve my wall of C /o/
 
@Malachi -
Occam's razor (also written as Ockham's razor from William of Ockham (c. 1287 – 1347), and in Latin lex parsimoniae) is a principle of parsimony, economy, or succinctness used in problem-solving. It states that among competing hypotheses, the one with the fewest assumptions should be selected. Other, more complicated solutions may ultimately prove correct, but—in the absence of certainty—the fewer assumptions that are made, the better. The application of the principle often shifts the burden of proof in a discussion. The razor states that one should proceed to simpler theorie...
 
@rolfl I was already reading it....lol
BTW.Work
 
@skiwi who uses SVN anyway ;)
 
You've earned the "Yearling" badge. See your profile.
(unfortunately on SO...)
 
Ditto ... a couple of days ago ... I was disappointed....
 
1:58 PM
disappointed because of it not being CR?
@Vogel612 I was using SVN at work, but I do prefer git a whole lot more :)
 
@Vogel612 At work here they do
 
Kinda the same situation here..
we used to use it for code, but now it's only Office Documents..
for code we moved to git.
 
@rolfl With the pastebin, what is the difference vs what I do now?
And nice that you did the filter and add together +1
 
Since when can you +1 a pastebin?
 
@skiwi - the executor service is standard, there is no synchronization, and there is a simple Collector .... what is the same?
 
2:02 PM
The implementation seems the same to me
 
1 min ago, by rolfl
@skiwi - the executor service is standard, there is no synchronization, and there is a simple Collector .... what is the same?
 
I don't need to know any results though
Why is your version a callable though
 
Fine, so drop off the
because it is not a stream.
If you want the call method can use streams, but the whole problem you are facing is that you are trying to change the nature of Streams. I am just making one stream for the picker, and then the use of the picked file can be somewhere else (as a stream, or not).
 
My functionality is implemented on a `Consumer<T>` on which I execute `() -> consumer.accept(path);`
Yours submits the callable directly, which I can see is an improvement
What is the biggst difference of execute vs submit btw?
 
You are using a Consumer as a Callable.
 
2:06 PM
Where am I using a Collector?
 
^^^ edited to Consumer
submit allows you to use a Callable which has a return value, and can throw exceptions, and the submit returns a Future, which you can track
Submit is the difference between an Executor and an ExecutorService.
 
I read "Excalibur" at first.
 
Now, after the edit, things start to make sense
 
@konijn He still visits CR, just not chat. Not sure why
 
So I'll need to change that soon tm
 
2:15 PM
kleinfreund is probably one of the most missed chat visitors ever: chat.stackexchange.com/…
8
 
Where did he go? :o
 
hello
 
@kleinfreund ... ping ?
Hey @Mat'sMug
 
hi there @Mat'sMug.
 
2:21 PM
Wtf!? I'm +170 today, how did that happen?
 
I'm kinda impressed that some guy tried to remove the tag from my only C question, stating that "this question has nothing to do with C".
3
 
@SimonAndréForsberg just thank Santa, collect the money rep and run.
 
@Mat'sMug - nice round 9K.
5 days to 10?
 
Not anymore now appereantly
 
is there Versioning software that is open source that I can use at home, that is similar to something like Team Foundation Server???
@SimonAndréForsberg thought that was all in a row....
 
2:27 PM
@rolfl 5 answers yesterday, anemic votes (I tried not to be too much of a rep-whore). Is my answer quality dropping? Is it the tags? Is it a conspiration? Heaven knows...
 
Have you seen my activity recently? Shocking.
 
@Mat'sMug It's global. My last answers also got few votes :o
 
@SimonAndréForsberg he only has 9 pages. I have 33 pages chat.stackexchange.com/search?q=malachi&user=&room=8595
 
@Mat'sMug I think it's the -tag
 
Since I got to about 15K I stopped whoring .... and at 20K, with the mod stuff, I have taken some time to get other things in order, and it seems writing answers on Meta are at least 5X the work of on main.
 
2:29 PM
BTW.work BTW.Work BTW.Work UGH!
 
@Malachi Yes, but that's because you're here often. Take a look at the 10 or so latest messages mentioning kleinfreund (ding! This is one more btw)
 
@SimonAndréForsberg perhaps more so the or tag?
 
@rolfl So that's why you haven't had a single rep-max day for 10 days?
 
Well, that's embarassing: chat.stackexchange.com/search?q=rolfl&user=&room=8595 49 pages.
 
@Mat'sMug Probably yes. It's probably more related to the question quality than the answer quality.
 
2:30 PM
@SimonAndréForsberg Look at my answers, they are pathetic, and few.
 
And the lack of rep whoring announcing answers in chat (@Mat'sMug)
 
Well, yeah, I figure that I have no real rep target anymore, not pushing it.
 
@rolfl You didn't post a single answer on March 28th and April 1st!
 
@Malachi do you mean repository software
 
At some point I will burn in again on Legendary.
 
2:32 PM
@Malachi Subversion is good
 
@BenVlodgi well yes.
 
Right now I am figuring out the mod side of things ... takes time.
 
I don't want to do Git, I want something on my machine, or one of my home machines.
 
You are doing well so far at least :)
 
not something public. I don't use Visual studios at home either, I am currently going to be using Xamarin
 
2:33 PM
@Malachi git is on your machine. You don't need to put it online just because you're using git
 
@Malachi Subversion is free for private repos
github is nice, and you can have free public repos, or you can just push to your own machine
 
Well thanks, but there really has not been any real crisis.
@BenVlodgi Free for public repos.
 
@rolfl @kleinfreund's not here, if that's not a crisis I don't know what is!
 
Git and Github are two different apps though right? which is better.
is it called a Subversion application?
 
@Malachi Github is using git.
 
2:35 PM
Does anyone know of any good resources to learn Java Swing?
 
@Malachi use the TortoiseSVN application for subversion
 
@NiallSzalkai Oracle's documentation. docs.oracle.com/javase/tutorial/uiswing
 
@SimonAndréForsberg ok that is what I was thinking
@BenVlodgi TortoiseSVN huh??
 
@SimonAndréForsberg Do you use netbeans personally?
 
2:36 PM
@NiallSzalkai - he has a secretary for that.
 
@NiallSzalkai I prefer Eclipse.
 
^^^ ditto
 
Xamarin has source control built in, is that the same thing?
 
is this a visual studio project you are going to work on?
subversion and git have VS plugins which make it easy to maintain your project
 
37 messages, what
 
2:42 PM
@skiwi 54.
as soon as @Ben and @Malachi came, the shit hit the fan ;)
 
happens
 
Shit happens?
 
shit hitting the fan happens (too)
 
@BenVlodgi I don't have VS on my new machine at home. so I am going to be using Xamarin (MonoDevelop). I can still code for the .NET framework with Xamarin and I can code for MonoGame(OpenSource XNA) as well. but it looks like Xamarin has Native Support for Git
 
ah wth
0
A: Speed up processing between VBA and IE

Mat's MugJust reviewing what you've got here... Indentation The code would read much better with proper indentation: Function FillInternetForm() Dim HWNDSrc As Long Dim ie As Object Set ie = CreateObject("InternetExplorer.Application") HWNDSrc = ie.HWND ie.Navigate "http://helppoi...

 
2:44 PM
@Vogel612 I been here a long time.
 
0
A: KeyValuePair implementation

Mat's MugThat has been said before in previous reviews, there's not really a gain in having a Private Type that lets you define a Private this As tKeyValuePair, which forces you to use this. to access what would otherwise be private fields. Actually there is one gain: doing that allows having a Key publi...

 
then it's all @Ben's fault.
 
@Vogel612 don't talk about flinging poop around the monkeys
 
@Mat'sMug ho ho ho ( <<<---- pun intended )
2
 
1
A: Dictionary<TKey, TValue> Implementation

Mat's MugAlthough CallByName doesn't seem to have a return value (from the parameter tooltip), it does. This means if IsSafeKeyXxxxxx methods were Public you could use CallByName instead of the Select..Case block. However exposing all these methods through your Dictionary interface would be rather ugly. ...

^^ 3rd ho
 
2:44 PM
I was here too, just not talking... my fault
 
well @Mat'sMug I was yesterday...
 
@BenVlodgi lol. I needed answers so I thank you not blame you
@Mat'sMug remind me in like 10 hours
BTW.Work
 
@Malachi, I dont know if that software has plugins or not, but you can certainly use subversion with anything it plugs into your explorer
 
personally I like to use github for my projects, subversion is good though, you can have free private repos, where with github you do have to pay for those
 
2:47 PM
we need more voters, it's not normal that a question's only answer remains unvoted (up or down) unless it's ho-ho-ho'red.
 
@Mat'sMug your word in the ear of TPTB...
 
The powers that be ... apparently
 
In Germany we say (lit. translation): You're breaking through open doors
 
@BenVlodgi I was just looking at that. I am going to check it out more later when I am actually in front of my computer... at home.
 
we don't even have a whole page of voters this week.
with ~250-500 new users every week, we should have much, much more than that.
 
2:50 PM
Users need rep to vote.
 
don't we upvote good questions?
 
Needs 3 upvotes to have enough rep.
And not all new users ask/answer questions
In fact, 36K users, but 13K questoins.
 
^^ good point. 90% of people create an account and just read stuff
right?
 
Which is odd since they don't need an account to read stuff.
 
right... I think...
They could comment without rep, and many new users have SE 100 bonus
 
2:55 PM
at least that's what I recall from the SE/SO survey (data mining analysis?) results (where's that link...)
 
@rolfl I keep your usggestion about consumer to callable in mind for next week ;) 5 more mins until end of work day
 
What, it's Friday for you?
 
I only work one day a week, I'm still at university
So other days at university ;)
 
@Simon I used your CR-Question generator ;)
0
Q: DataLayer Interfaces Genericized

Vogel612I have some concerns on my refactoring for the data layer in my current Project. Just for a small info, I am currently building a CRM as "training JEE application". But enough of talk, let's talk code! IService.java: (7 lines, 160 bytes) public interface IService<T> { public void update(T u...

 
3:06 PM
0
Q: DataLayer Interfaces Genericized

Vogel612I have some concerns on my refactoring for the data layer in my current Project. Just for a small info, I am currently building a CRM as "training JEE application". But enough of talk, let's talk code! IService.java: (7 lines, 160 bytes) public interface IService<T> { public void update(T u...

 
@Vogel612 That's the spirit :)
 
maybe I should add some implementations...
just interfaces over interfaces...
that thing is really awesome ;)
 
@SimonAndréForsberg posted a answer :)
 
@Mat'sMug I did?
 
I did
 
3:13 PM
No I didn't
 
IDid<Answer>
 
@Vogel612 I'm starting to think that yes, some implementations would be nice to see... because if you have what I suspect you're having, things can be simplified a lot!
(Although that could perhaps be posted in a different question? Not sure what's best)
 
@Simon I suspect you suspect right..
 
Concerning the marker interfaces... some Interfaces are simply required to expand the extended list service and I felt i should standardize this to always have the implementation implement a non-generic interface — Vogel612 5 mins ago
@Vogel612 over-engineered?
 
I'm German, I'm allowed to over-engineer.
3
@Mat'sMug explicitly IAddressService, IProductService, IContractService
 
3:25 PM
meh.. I'm so not into .. deleted
 
@Mat'sMug I'm glad you posted a Java one, but I think you can do better. It's a hard question adding an answer to though.
 
@Mat'sMug i could have voted 41 times today then....
 
yeah, it's just I'm writing a VBA answer at the same time, and trying to work a little as well...
 
1
Q: Merge sort could work 10 times faster

Ilya_GazmanI am implementing merge sort in Java and I got performance problem in this method: private static void marge(int[] source, int[] buffer, int startingIndex, int count) { int index1 = startingIndex; int index2 = startingIndex + count / 2; int maxIndex1 = index2; ...

0
Q: WPF - Updating the UI while doing work on a thread, but keeping the sequential nature of the original and avoiding callbacks

ernestoferroLet's say that I have a method that makes an HTTP request that will take a long time to finish. While that's happening the UI is not updating because I'm doing it in the UI's thread. One solution is to: Show the "Loading" animation. Start the HTTP request on a thread. On the completion callba...

 
Wow it feels nice to have the edit privilege...
I almost forgot that feeling of editing a post and the post changing directly...
 
3:33 PM
I hope @skiwi also will get that soon :)
 
@Simon I'm unfortunately not done with refactoring the implementations. There's still some really dumb stuff in there...
FacesMessages and injected Controllers.
1
Q: WPF - Updating the UI while doing work on a thread, but keeping the sequential nature of the original and avoiding callbacks

user40033Let's say that I have a method that makes an HTTP request that will take a long time to finish. While that's happening the UI is not updating because I'm doing it in the UI's thread. One solution is to: Show the "Loading" animation. Start the HTTP request on a thread. On the completion callba...

OP left..
 
Hmm... that was quick...
and strange
 
yea...
he also used code-highlight markdown on his "first post"
I guess he creates a new account for each and every question he writes..
and tries to not give away too much personal data, by deleting it after asking the question...
 
@rolfl No problem! I thought it was funny and starred it.
Real life sometimes calls me away ...
 
so, Java knows right, when it compiles that division by 2 should be replaced with a bitshift to the right ? ( for int )
 
3:44 PM
@konijn Good question! I think it does that optimization, yes.
 
wouldn't that be up to the implementer of the VM? seems like it might vary per underlying architecture
 
@Edward afaik the VM is always coming from oracle...
the compiler might be something different, but....
 
@Vogel612 AFAIK There's a bunch of other implementations than Oracle's
 
And home (for some time)
 
@Simon again learned something :)
 
3:46 PM
IBM's JVM doesn't implement JavaFX for example
 
wait a minute
in which architecture would it not be a bitshift ?
 
@Vogel612 I believe the monkey said not so long ago that IBM had their own JVM implementation....
 
probably read over that...
 
@SimonAndréForsberg I think there are many non-Oracle jvms. en.wikipedia.org/wiki/…
 
damn that's a whole bunch...
 
3:47 PM
We should make a Coding Challenge to write your own JVM implementation.
Can you implement a JVM in Java?
 
@skiwi inception...
 
@konijn In an architecture that's just totally stupid... possibly a PHP one... how on earth that would work :)
 
The reason I ask is that I might add that as a codereview point, but if the compiler knows.. Than that would not make sense
 
@konjin well you could assume a malebolge vm...
it's based on ternary system...
 
@konijn I think that for readability it's usually better to use / 2
I think we'll have to ask monkey about this, @rolfl ! Does Java optimize / 2 to >> 1 ? I believe it does. Does it?
 
3:49 PM
>> 1
 
Same shit different way :)
 
LOL
 
and that from one of our top-scoring Java answerers...
shame on you! ;)
 
@SimonAndréForsberg like this? github.com/MateVM/MateVM
 
@SimonAndréForsberg / 2 to >> 1 is so easy that Java must optimize it
I had something in mind, and it is now gone again
 
3:52 PM
good enough, then I will not mention it
 
still feels like an acheivement.
 
Here's something on that topic. Second answer seems reasonable. stackoverflow.com/questions/2143840/right-shift-to-perform-divide-by-2-on-1
 
0
Q: Container class with static member functions for filtering of sensor data

dgratI made a class which inherits some filter functions. Some of the functions could get a function pointer to call a transfer or activation function (in my case always a sigmoid), which makes adding functionality a little bit easier. However I currently think about, how to make the filter function...

 
6
Q: Right Shift to Perform Divide by 2 On -1

Cheok Yan ChengI know that I can perform divide by 2 using right shift. For simplicity, take a 4 bit number system -1 - 1111 -2 - 1110 -3 - 1101 -4 - 1100 -5 - 1011 -6 - 1010 -7 - 1001 -8 - 1000 7 - 0111 6 - 0110 5 - 0101 4 - 0100 3 - 0011 2 - 0010 1 - 0001 0 - 0000 If I try to perform 6 / 2 = 0110 >

@Edward Missed http:// did you? :)
 
I didn't miss it at all. :)
 
4:03 PM
@SimonAndréForsberg That is not defined in the language definition, but the JIT will do a lot of things, probably that too.
 
zombie down!
 
@rolfl I suspect it's actually javac that does that and not JIT
 
(albeit not zombified yet)
 
As it is not context/runtime dependant
 
4:06 PM
I suspect that it's JIT
A way to check could be to use a Java decompiler to see what the decompiled source says
 
I just posted a pretty awesome answer on stackoverflow... Just wanted to throw that out there. =)
How is everyone else doing?
 
@Mat'sMug which one?
 
4:41 PM
@rolfl and @skiwi, this is an interesting SO question about parallel streams:
10
Q: Custom thread pool in Java 8 parallel stream

LukasIs it possible to specify a custom thread pool for Java 8 parallel stream? I can not find it anywhere. Imagine that I have a server application and I would like to use parallel streams. But the application is large and multi-threaded so I want to compartmentalize it. I do not want a slow runnin...

 
@Malachi this one :)
 
@SimonAndréForsberg Luckily I'm just back ;)
Ah it's an old question... Then only interseting read ^^
 
just got a phone call from a former employer... lunch/discussion next monday, I might not even need to find a new job, a new job might just find me!
 
@Mat'sMug how close now?
 
@Mat'sMug this sounds good for you ;)
 
4:44 PM
Interesting, but hackish
 
...or I can make my current employer dance a little, and have them give me a substancial raise if they want to keep me :)
 
@skiwi It's quite good to know though that if using parallel streams with long-running operations, other parallel streams is blocked because they're using the same thread pool!
 
@Malachi thanks not-so-anonymous Santa!
2
 
@Mat'sMug I knew a guy who tried that gambit as a bluff -- and they called him on it. I'm hoping you're a better poker player.
 
I don't bluff.
3
 
4:48 PM
That's the spirit, Mr. Spock! ;)
 
When I left that previous job, I was leaving for a $10K increase that they couldn't match. I can't afford to move without all bases secured, got growing twins that eat like teens (and they're not even 2yo!), playing a stupid move would be ..rather stupid.
 
@SimonAndréForsberg That's not entirely true
 
well who would have thought that ;)) Glad I don't have to take responsibility for anyone but me yet...
 
All parallel calculations should run on a different thread, so coudl only block that thread I'd say
 
@skiwi I don't think you're correct there. Try it.
 
4:52 PM
I think I am
The OP is using a cached thread pool, that can create as many threads as it wants
On that he executes one task
Then that task starts 1 million instances, all having a 1000ms sleep, in parallel
 
es.execute(() -> runTask(1000)); //incorrect task
es.execute(() -> runTask(0));
es.execute(() -> runTask(0));
es.execute(() -> runTask(0));
es.execute(() -> runTask(0));
es.execute(() -> runTask(0));
 
Of course that is going to block everything
 
Looks like six tasks to me
 
Nope
Well yea correct of course
But his runTask is creating 1 million tasks
Which he all wants to perform right now
Then everything that occurs after that, needs ot wait until it's finished
 
Those aren't performed on 1 million threads, if that's what you think...
 
4:54 PM
@Mat'sMug I have a state job, people have to go through paperwork to give me a raise outside of the normal raises given to everyone....
 
How would they not @SimonAndréForsberg?
It's in parallel there
 
Because that'd be impossible
I have some code for you to try, @skiwi
		IntStream tstream = IntStream.rangeClosed(1, 2);
		Collector<Object, ?, Map<Object, List<Object>>> collector = Collectors.groupingBy(i -> Thread.currentThread());

		ForkJoinPool pool = new ForkJoinPool(42);
		Map<Object, List<Object>> coll;
		try {
			coll = pool.submit(() -> tstream.boxed().parallel().collect(collector)).get();
		}
		catch (InterruptedException | ExecutionException e) {
			e.printStackTrace();
			coll = null;
		}

		coll.replaceAll((thread, list) -> Arrays.asList(list.size()));
 
The Executor has no limit defined for the max number of threads, so it will cap out on the JVM cap of #threads
 
TTQW Guys, cya tomorrow (latest) ;)
 
4:56 PM
Change that IntStream.rangeClosed(1, 2); to something like IntStream.rangeClosed(1, 1000000);
 
@Koveras nice! I wish we could get that XNA guru from GameDev to look at that code..
 
What is that forkjoinpoole xactly? I'm not familiar with it
 
That animation code makes my head hurt
but I hear game development is complicated, so maybe it's supposed to
 
First xample used 2 threads, second example 29 threads
@Koveras It's supposed
What is the point exactly you are trying to make?
 
By the way, there's more code to it than I'm asking for review on. Let me know if you want to see the rest.
 
4:58 PM
@skiwi Neither was I until I became familiar with it today
 
(Maybe I shouldn't have made it 100 million)
 
Anybody here have MSVC 2012 handy? If so, does [this simple code[(ttp://pastebin.com/BhRYT18a) crash when run?
 

« first day (334 days earlier)      last day (3684 days later) »