Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Max Facetime
Apr 18, 2009

Otto Skorzeny posted:

there are a shitton of exit nodes in langley, va :tinfoil:

running tor nodes is mainly of interest to cryptonerds, OTOH nsa/cia/fbi employ a lot of cryptonerds

correlation is not causation :rant:

Adbot
ADBOT LOVES YOU

Max Facetime
Apr 18, 2009

rotor posted:

if you're sitting there programming away and you hit on this really clever solution and you implement it and it's just so cool and you're really happy about it, i want you to remember my stern visage and then go back and comment out all that clever poo poo and rewrite it super-plain so a retard can read and understand it.

the little difference between

"I read your code and you are a genius" and "I tried to read your code and well, you must be a genius"

Max Facetime
Apr 18, 2009

vapid cutlery posted:

im watching mit sicp but i feel like this is a little too basic for someone with years of development experience in several languages

it starts to pick up once you get into implementing prolog in scheme and stuff

Max Facetime
Apr 18, 2009

Tiny Bug Child posted:

your bosses are either lying to the spergs to placate them, or they are incompetent

or they are unspeakably evil and planning to make the python people write the cost/benefit analysis that will crush their hopes and dreams

Max Facetime
Apr 18, 2009

ZYNGA STOCK CRASHER posted:

what kind of song only has 4 beats??

a ringtone

Max Facetime
Apr 18, 2009

OOGA-BOOGA MONGO WEB SCALE

Max Facetime
Apr 18, 2009

Otto Skorzeny posted:

ah yes, having accurate floating point is bad for users, unsigned integers are for autists

the autists got their strictfp keyword in December 1998, 7 months after that rant

meanwhile everyone else just uses floats for money calculations to get the highest possible performance

Max Facetime
Apr 18, 2009

Zombywuf posted:

code:
db.write(person_record);
db.write(fact_about_person_record);
Transactions avoid you ending up with nonsense in your db when one of those fails.

also traditional race-conditions when updating any sort of sum over values

code:
db.put(key, value)
db.put(sumKey, db.get(sumKey) + value);

Max Facetime
Apr 18, 2009


well when your data doesn't conform to a strict schema and you need to write a distributed map-reduce query just to figure out your schema so you can write a distributed map-reduce query to calculate a sum,

updating a simple sum-value with every little addition doesn't sound so bad anymore :unsmigghh:

Max Facetime
Apr 18, 2009

google invented map reduce because their big tables kept getting bigger and bigger

Max Facetime
Apr 18, 2009


Hibernate OGM with Infinispan, Ehcache and MongoDB support

Max Facetime
Apr 18, 2009

Nomnom Cookie posted:

Using user-supplied regexes opens you to a complexity DoS

more importantly it makes for a nasty api

may I suggest

code:
interface SomeParser {
  SomeParser register(String key, String valueRegex);
  void parse(String content);
  String getValue(String key);
}
which at least limits the nastiness

Max Facetime
Apr 18, 2009

0xB16B00B5 posted:

getting rid of controllers seems to be primarily an excercise in semantics versus actually changing anything

what really needs to happen is getting rid of the model by replacing it with an excel file

also put the cell->ui component id-mapping in the excel too, also any input validation/output formatting, that should get rid of most of the controller too

Max Facetime
Apr 18, 2009

WHOIS John Galt posted:

i keep feeling like i'm at this crossroads

been writing poo poo for work and for home in python but every program i write that gets to about 5k lines starts getting really unmaintainable and difficult to refactor and add new functionality. mostly i get told to 'write more tests' which to me doesn't really feel like the right answer. like, let me write more code to try and maintain the code i have

I hate tests. as a gardener would you rather

1) wrap more and more nets around trees and hedges or
2) cut off the extra bits and use some almost-invisible zip ties to guide the growth of the remaining braches and leaves? *

*I have no idea what being a gardener actually entails

WHOIS John Galt posted:

so sometimes i feel like it's not taking advantage of language features or paradigms properly but i'm not just gonna learn something like concurrency or mapreduce or something to shoehorn it into what i'm learning

don't learn those so you can shoehorn them into your code, learn them so you know when to not use them in your code

WHOIS John Galt posted:

i guess the main issue is i don't really have a concrete problem to solve so no one can point me at a solution. but i do have a problem, it's "all my code is poo poo and difficult to maintain and it never really feels like i can trust it to do what i want it to do"

i'm not going to tell you to rewrite your code in java

instead i'm telling you to set a challenge to yourself which goes something like this: "people say java code is very modular and easily malleable when it doesn't fall into the AbstractFactoryFactory trap; assuming that's true, what would my code look like if it was written in java and what would that "extra sauce" be that makes it more maintainable/clear/understandable than what I have written?"

WHOIS John Galt posted:

i'm a bad coder

welcome to the club, please have a seat over there

now get better

Max Facetime
Apr 18, 2009

salted hash browns posted:

if it was ~~java~~ i would just serialize the object no probs

yeah seriously, just use GSON

I even customized it so that it can take json that has a value
code:
"TEXTURE_MIN_FILTER": "LINEAR"
and set it to a properly named java class field
code:
private String textureMinFilter;
automatically based on the levenshtein distances between the name and the names of fields in the class

Max Facetime
Apr 18, 2009

bret victor posted:

In his influental essay No Silver Bullet, Fred Brooks makes the case that software is inherently "invisible and unvisualizable", and points out the universal failure of so-called "visual programming" environments. I don't fault Fred Brooks for his mistake -- visual programming is indeed worthless. But that's because it visualizes the wrong thing.

Traditional visual environments visualize the code. They visualize static structure. But that's not what we need to understand. We need to understand what the code is doing.

holy lol

Max Facetime
Apr 18, 2009

herp derp, if only we could see what that terrible library is doing in the form of endless lists of numbers and abstract drawings then we all could be programmers

Max Facetime
Apr 18, 2009

rotor posted:

java is fine, i dont get the hate.

if it ever got actual function pointers that'd be just the best.

I think it might already have that, but it's implemented in the standard library (java.lang.invoke.MethodHandle) and the incantation to construct one is really complicated and not type checked

otoh the resulting method handle can look just like e.g. a Runnable object and it seems to be much closer to metal than what it's pretending to be

so this might not be exactly what you're looking for

Max Facetime
Apr 18, 2009

yaoi prophet posted:

e: lol no generics? that's loving ridiculous

also no continuous compilation and no running the code before pressing compile and fixing all type errors

so it's no surprise that "the statically typed group required significant more time for fixing the type errors"

whilst "it seems obvious that this should have been led to a worse result in the parser development, in fact it was not"

sooooo then "there must be a positive impact of static typing in something else which compensates this negative effect" of being constantly interrupted by the IDE

extrapolating from their findings to create the same quality software, the allocation of time between fixing type errors and bugs looks like this:

dynamic typing in any IDE: 0% / 100%
static typing in a bad IDE: 50% / 50%
static typing in a good IDE: 1% / 50%

therefore eclipse is the best and java is the best, QED


Max Facetime
Apr 18, 2009

rotor posted:

then Paul Graham is a Hero

when Heroes get their way they cause way more collateral damage than Villains

makes you think

Max Facetime
Apr 18, 2009

the git plugin in the latest freshly unzipped eclipse pops up 2 dialog windows if it can't find git

in those dialogs it kind of weakly apologizes that it can function just as well without using a real git, it's pretty :catstare:

Max Facetime
Apr 18, 2009

Hard NOP Life posted:

Things have gotten out of hand and the technical debt is through the roof. Old tests are commented out or given null parameters to shut the compiler up and then nothing gets done to fix them later.

did you hear about this weird old tip discovered by Romney's mom that can reduce technical debt in your tests by 80%

Max Facetime
Apr 18, 2009

wtf was the deal with osgi anyway?

Max Facetime
Apr 18, 2009

tef posted:

i wrote an osgi wrapper for jython once, true story

ehhehe, was there any chance that wouldn't have ended up being a total waste of time?

incidentally, I've usually liked python's api design in the few random snippets I've seen, would jython's implementation be helpful in making 100% pure java versions of them?

Max Facetime
Apr 18, 2009

trex eaterofcadrs posted:

the classloaders are abstracted away

you specify, group, artifact and version of each library to import, and the osgi container does the resolution automagically,

you can have like v1 v2 and v3 of some lovely library installed and any module can import any of those and run correctly without worrying about classloader nonsense, as long as you aren't a moron with your pom files

wasn't the deal there that two modules both using the same v2 of the same library would use the exact same classes and memory which would open a whole host of concurrency bug opportunities, if the modules don't know of each other?

Max Facetime
Apr 18, 2009

tef posted:

the problem with trying to make java apis nicer, is that python features like default values, named arguments, and with statements make a bunch of stuff quite neat. decorators, and descriptors too.


with java on the other hand, you will need to find java ways to do it. there are a bunch of nice java libraries out there that make use of 1.6 that I never got the chance to use - including project lombok

see, I don't think that's generally true, maybe in some specific cases that syntax-sugar makes all the difference

but for a simple case like this:

code:
import httplib, json

body = json.dumps({
  'key' : '<YOUR API KEY>',
  'image' : 'http://example.com/kitten.jpg',
  'operations' : [{
    'operation' : 'convert',
    'args' : { 'to' : 'png' }
  }]
})

req = httplib.HTTPConnection('api.imageflyapp.com')
req.request('POST', '/v2', body, { 'Content-Type' : 'application/json' })
response = req.getresponse()

print response.status, response.reason, response.read()
I could see a java version of those apis that allows:

Java code:
package simple;

import simple.httplib.HTTPLib;
import simple.httplib.Request;
import simple.httplib.Response;
import simple.json.Json;

public class Example {
  public static void main(String[] arguments) {
    @SuppressWarnings("unused") String body = Json.dumps(new Object() {
      String key = "<YOUR API KEY>";
      String image = "http://example.com/kitten.jpg";
      Object[] operations = { new Object() {
        String operation = "convert";
        Object args = new Object() {
          String to = "png";
        };
      } };
    });

    Request req = HTTPLib.newHTTPConnection("api.imageflyapp.com");
    req.request("POST", "/v2", body, "Content-Type", "application/json");
    Response response = req.getResponse();

    System.out.println(response.status + " " + response.reason + " "
      + response.read());
  }
}
so i'm wondering if jython has those apis already mostly implemented

Max Facetime
Apr 18, 2009


rotor posted:

just base64 all the images and inline them in the html imo

yeah this is pretty dumb thing already

but I think I can do better than that

how about sending uncompressed binary data encoded as a PNG image using its inbuilt compression to avoid having to configure your web server to compress http responses:



but if that doesn't have you shaking your head already, it doesn't have to stop there, this technique could be taken further

you could encode all your static .html, .js, .css files in with the sprite sheet, then you could dump your user-viewable database in binary, serve it with a second http get and run javascript queries against that, no further network traffic required!

but wait, PNG is an extendable format where any unknown chunks are supposed to be ignored by browsers, so what if we could include java applets, Silverlight w/e things, windows 8 metro apps, etc in that initial static file bundle that's going to end up cached everywhere, we could do a real optimized cross-platform software bundle

Max Facetime
Apr 18, 2009

it's amazing how much ingenuity goes into taking the few bits of web programming that work reasonably well and using them to build workarounds for everything else

Max Facetime
Apr 18, 2009

b) they don't crash to desktop

Max Facetime
Apr 18, 2009

rotor posted:

man have you even used firefox??

L-O-L, firefox

lolfox

but seriously now, if a web app doesn't work you don't have to post your full computer specs on forums just to get some vague suggestions on things you can try to do to fix your problem from some 15-year old IT pros

you just need to chill and wait it out

Max Facetime
Apr 18, 2009

rotor posted:

this is only a thing with games though

yea I guess that's true, but what other desktop apps normal people put on their computers frequently, photoshop maybe?

Max Facetime
Apr 18, 2009

rotor posted:

but i think the point is that nobody would do this because writing apps in html using polling or stateless communication with the server is just so great, people do this because it's an expedient solution.

well yes, but doing this you also lose the benefits that adhering to the html/http programming model has forced upon you:

you introduce a whole lot of needlessly complicated installers and updaters, there's native-code specific failure modes that are now your responsibility and all the new opportunities for data loss and corruption when running on someone else's hardware

Max Facetime
Apr 18, 2009

Funnehman posted:

is this not enough for you, pussy?

e:

Python code:
[3]>>> from PIL import Image
[4]>>> Image.MODES
       ['1', 'CMYK', 'F', 'I', 'L', 'P', 'RGB', 'RGBA', 'RGBX', 'YCbCr']
bitch

counterpoint:

Image.open(infile, mode) => image [...] If the mode argument is given, it must be "r".

Max Facetime
Apr 18, 2009

you don't need to refactor when you're duet programming

Max Facetime
Apr 18, 2009

Hard NOP Life posted:

Thats been known since the 70s when the mythical man month was published. He was recommending since then to write in less verbose and higher level languages since you output the same number of lines of code regardless of the language

he says "Productivity seems constant in terms of elementary statements, a conclusion that is reasonable in terms of the thought a statement requires and the errors it may include", but this is from a comparison between lines of code in PL/I and assembler and is a special case

he says of this gain in productivity from the transition from assembler to a higher-level language: "Most past progress in software productivity has come from eliminating noninherent difficulties such as awkward machine languages and slow batch turnaround" and that "There are not a lot more of these easy pickings".

also, to go much beyond the state of the art in 1995 "Radical progress is going to have to come from attacking the essential difficulties of fashioning complex conceptual constructs".

programming by its nature already abstracts repeated fragments into functions or modules, therefore mere compression to reduce the number of keypresses leads to just less typing, not increased productivity

Max Facetime
Apr 18, 2009

tef posted:

software productivity (and reuse) is mostly a social issue, not a technical one.

definitely, social issues make up the majority of what MM-M is about, but the technical issues get all the press. I know I'm guilty of that as well

I just realized my copy of mythical man-month is the 20th anniversary edition and there's only 2 more years to go until its 40th anniversary :eyepop:

tef posted:

the next big leap will not be finding new ways of programming, but new ways to avoid programming.

or to put that in less technical terms, finding ways to solve simple problems in place of complex problems

tef posted:

this is a pretty modern idea of programming. programming for years was more about performing a calculation, repeating a set of instructions over and over again.

back then eliminating redundant code was a necessity borne out of limited memory and storage space

then it turned out to be a good idea anyway

maybe a bit of duplication isn't so bad and it's time for things to swing the other way for the first time? see DLL hell and the current recommendation of including a version number in DLL names and keeping your DLLs in the same folder with the program binary for some hints of this

I think you might have posted a video lecture touching on this as well

Max Facetime
Apr 18, 2009

rotor posted:

I think we have enough languages, what we need now is a program to write other programs for us because we're super bad at it.

but which programming language would that program use?

Max Facetime
Apr 18, 2009

that's maths but without all the number crunching that's got useful applications in the real world

Max Facetime
Apr 18, 2009

MononcQc posted:

car, cdr, cadr, caddr, cdadaddr or whatever all suck. I'm always torn with lisps because to me they feel like write-only languages.

they don't suck. once you've written them for a few hours they start to make sense on a visual level

cdadaddr is "take right, left, right, left, right, right and you're there", like navigating from the root of a tree to a leaf

and I just now realized why they are called A and D rather than A and B: A is the 1st in a pair and D is the 2nd or using WASD-keys, A is left and D is right

what does suck is trying to remember what the meaning of caadr was supposed to be when applied to a thing, but that is the point where the student is supposed to discover the value of abstractions and using meaningful names

Adbot
ADBOT LOVES YOU

Max Facetime
Apr 18, 2009

I think I discovered that once I started hitting the maximum length limit and was writing things like (caar (cadddadaar (....))

E:

trex eaterofcadrs posted:

maybe ur joking here but they're called car and cdr cause of contents of the address register and contents of the decrement register

does it really matter? happy accident or elegant design, the end result is what's important

Max Facetime fucked around with this message at 16:10 on Dec 11, 2012

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply