20,305 reputation
54180
bio website lukasatkinson.de
location Germany
age 22
visits member for 2 years, 8 months
seen 2 hours ago

I do this thing where I make computers do things.


9h
comment Store decompiled code of external apk in public repo legal?
Do you have the copyright for the decompiled source (no) or was the binary licensed to you in a manner that allows you to publicly distribute it or its decompiled source (most likely no)? So if none of those two cases apply, on what legal basis did you think this might be possible? You can't just take something (e.g. a book, or a program) and mechanically transform it (e.g. scan it to a PDF, or decompile it) and then distribute the result as if you were the creator.
1d
comment Hidden dependencies - why not?
Regarding setter injection: I consider that to be an antipattern, since this means that between construction and proper initialization through setters there is a time where the object is in a partially constructed, invalid state and cannot fulfill the contract of that class. It's too easy to forget a call to a setter and start working with a half-initialized object. Constructor injection is the only “correct” solution, though the Builder pattern can help alleviate the pain of too many constructor arguments
1d
comment Beginner Facade Pattern Example
Even better idea: Don't use a revision control system that requires you to lock the files you're currently editing. With a modern DVCS such as Git, edits in different parts of the same file don't conflict with each other, and can be seamlessly merged together.
1d
comment Pattern matching against two similar types
Your example is in Scala so I tagged it as such. If your question is not Scala-specific but applies to all programming languages with pattern matching (e.g. also Haskell or F#), please revert the edit.
1d
revised Pattern matching against two similar types
edited tags, added syntax highlight
2d
comment Javacript File Inclusion Not working
Is the path to the JS file always correct? Wouldn't an absolute path such as /js/check.js be better? What errors do you see in the browser console? Also: why did you ask here? This site is about programming concepts, not about implementation problems (see the help center for details).
2d
reviewed Leave Open Objects or primitives as arguments
Mar
27
comment Image segmentation - show or hide clusters
So you probably selected all yellow areas and substituted them for white? You could surely write a program that copies the image but substitutes each yellow pixel for a white one. Even simpler, you could have one layer for each cluster, with areas not in the cluster being transparent. When you render the result, you just compose all selected layers.
Mar
27
comment Image segmentation - show or hide clusters
How did you create that second picture that shows what you want? Could you translate your steps into a program?
Mar
27
answered When to use ANTLR and when to use a parsing library
Mar
27
comment How to create DFA from regular expression without using NFA?
You need to provide more context. What (informal) algorithm are you currently using to translate regular expressions? It might be helpful to explain your process with an example such as a(a|ab|ac)*a+. You can either directly translate that to an NDFA which you reduce to a DFA, or you can normalize it to something that maps immediately to a DFA.
Mar
26
comment What are the different types of whitespace referred to by Perl?
The Perl regex documentation perlre refers to the perlrecharclass page that lists the meaning of these character classes in a table. Note that \X and \R are not real charclasses since they match multiple code points – see Unicode Technical Standard #18: Regexes for details. Perl implements \h and \v through the non-standard Unicode properties HorizSpace and VertSpace.
Mar
26
comment Dynamic Code Evaluation in Java - Clever or Sloppy?
@Doval Writing a small DSL isn't exactly rocket science, and I could whip up a simple language in 3hrs to 5 days. But this seems like 1) complete overkill, 2) risky, and 3) error-prone to me. Do you really want to write a whole mini-language? What if some business rules are more complicated than expected and need a fully-featured language? Are you suffering from Not Invented Here-syndrome? Instead of reinventing the wheel, why don't you use an existing language? It's much easier to use a language that's already been battle-tested.
Mar
26
comment Dynamic Code Evaluation in Java - Clever or Sloppy?
But wouldn't JavaScript be used as a DSL-like scriping language here? We set up necessary data (read-only), wrap the snippet in a function, and safely evaluate it. Since the code can't do anything except return a boolean, there would be no malicious opportunities here.
Mar
26
reviewed Close “How to code better” training
Mar
26
reviewed Leave Open Checking for valid state inside function or outside
Mar
26
comment Why does Golang expect a right bracket in the middle of a for loop?
This question should be closed since it has resolved itself in a meantime, and does not have lasting value.
Mar
26
reviewed Leave Open Where and when does firmware of a device run?
Mar
26
reviewed Close In plain English, what is a database index most similar to?
Mar
26
reviewed Close Securing a WCF Service