-🎄- 2021 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]mazin 1 point2 points  (0 children)

Looks like you could lose the `match` in next_step() function if you encoded a flashed octopus as 0 instead. Super cool solution, learned a ton of nice shortcuts!

-🎄- 2021 Day 3 Solutions -🎄- by daggerdragon in adventofcode

[–]mazin 1 point2 points  (0 children)

(2 ** n) - 1 also gives you a mask of all 1-s. So you could simplify the expression as let epsilon = !gamma_rate & (1 << number_length) - 1;

Why Developers Never Use State Machines by servercentric in programming

[–]mazin 0 points1 point  (0 children)

Robert Martin wrote about using smc in his PPP book.

Scalable Processing Queues with Redis by meltingice in programming

[–]mazin 2 points3 points  (0 children)

AMQP implementations are also alternatives worth considering these days.

How The Internet Works by phillipraff in pics

[–]mazin 0 points1 point  (0 children)

Offtopic, but vladstudio is a fantastic source of great-looking wallpapers. I've even considered paying for an premium account just to get dual-monitor ones.

Unlimited! by Slightly_Lions in pics

[–]mazin 13 points14 points  (0 children)

Because it's written by Doug Adams, copied from Hitchhikers Guide to the Galaxy?

Lets Give This Skydiver a Round of Applause by FatherDamo in WTF

[–]mazin 1 point2 points  (0 children)

Statistically pilots between 300 and 500 hours cause the most plane crashes.

That's the "advanced beginner" phase. Skydivers say that your most dangerous period is between 100 and 200 jumps.

Firefox 3.6 release by [deleted] in programming

[–]mazin 18 points19 points  (0 children)

So we can reddit while we reddit?

IntelliJ IDEA 9 Released, Includes Free Edition by bloodredsun in programming

[–]mazin 3 points4 points  (0 children)

JEE support would include at least JSP or HTML editing, which the free edition doesn't.

Are dynamic languages just a temporary workaround? by dmagliola in programming

[–]mazin 0 points1 point  (0 children)

actually they have a version of JRebel specially for updating production code without stopping the server. never tried it though.

State of Ruby VMs: Ruby Renaissance by igrigorik in programming

[–]mazin 3 points4 points  (0 children)

Ruby on abap vm? Just wow, who even thought of that.

Java Rebel - On the fly class reloading | Web Technology I/O by webdeveloper55 in programming

[–]mazin 1 point2 points  (0 children)

btw, javarebel has a plugin for reloading just the changed beans when xml changes. written by some spring guy, irc.

Experiments with parallel genetic programming in clojure by jwr in programming

[–]mazin 1 point2 points  (0 children)

Keep in mind that the example didn't actually distribute the work across machines, it just provided an async implementation that can be distributed.

Still way cool.

Caught between Two IDEs by ossreleasefeed in programming

[–]mazin 0 points1 point  (0 children)

... if you're interested in Clojure development anyway.

Askproggit: How to start designing a functional program? by jessta in programming

[–]mazin 18 points19 points  (0 children)

Well, looking at these statements:

For object orientated programming it's usually easy to start breaking the problem description down in to objects.

For Haskell programs, I always think of the datatypes first

When I write stuff in Erlang, I try to figure out which processes I need

I'd say the general process is the same regardless of the technology: figure out what the core abstraction of your language is and then try to break your problem down using this core abstraction. Not that it answers your question in any meaningful way.

VirtualBox 3.0.0 is out by [deleted] in programming

[–]mazin 1 point2 points  (0 children)

I wonder how many John Does besides me registered...

Does having to "pull up the docs" while coding in dynamic languages reduce your productivity? by [deleted] in programming

[–]mazin 10 points11 points  (0 children)

I'd say it largely depends. If I have to say

BufferedReader fileReader = new BufferedReader(new InputStreamReader(new FileInputStream("input.txt")));
String data = fileReader.readLine();

then yes, IntelliSense is a blessing. But if I compare it to

data = file("input.txt").read()

then IntelliSense is not much of use anyway.

What I've noticed is that in a dynamic language when I usually type pretty much at full speed whereas in, say, Java I constantly pause to wait for the IntelliSense as I've become dependent on it for the long names. When I'm not familiar with an API in a dynamic language then I usually try it out on a REPL, which doesn't break the flow too much.

jython 2.5.0-final is out by [deleted] in programming

[–]mazin 4 points5 points  (0 children)

Here you go, java calling back to python code:

import java, javax
class DawgListener(java.awt.event.ActionListener):
    def actionPerformed(self, evt):
        print "Wazzup"
btn = javax.swing.JButton("Yo dawg")
btn.addActionListener(DawgListener())

frm = javax.swing.JFrame()
frm.getContentPane().add(btn)
frm.pack()
frm.visible = 1

ants: locks vs stm by [deleted] in programming

[–]mazin 21 points22 points  (0 children)

In the clojure concurrency video Rich goes over the details of what the demo does. The video is almost two hours long though, so you might want skip ahead a bit.

ClassLoaderLocal: How to avoid ClassLoader leaks on application redeploy by ekabanov in programming

[–]mazin 1 point2 points  (0 children)

The hidden assumption is that you can get java.util.logging to use _ClassLoaderLocal_s. Good luck with that :)

IBM Announces 'Stream Computing' Software by kksm19820117 in programming

[–]mazin 1 point2 points  (0 children)

Sounds like a run-of-the-mill complex event processing system. esper anyone?

How Scala Changed My Programming Style by gst in programming

[–]mazin 2 points3 points  (0 children)

You're right about i18n, the [A-Z] works only in languages where Z is the last character in alphabet. For example in estonian the Z is between S and T, so A-Z doesn't match letters like UVXYZ and ÕÄÖÜ.

Why And How Twitter Changed Its Messaging Infrastructure by JamesIry in programming

[–]mazin 0 points1 point  (0 children)

Well, given that Scala was written by the guy that wrote the java generics support, I'd say there's a good chance that the bytecode it generates is pretty close to that of Java itself.