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.
 
  • Locked thread
fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

MononcQc posted:

pretty much any web server could work fine there honestly. Cowboy would be the standard HTTP server to use in a small app with Erlang though. It comes with static file handlers and otherwise let you use raw Erlang code with web requests fairly easily.

i know, i just want an excuse to try erlang for something

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

fart simpson posted:

i know, i just want an excuse to try erlang for something

https://github.com/ninenines/cowboy/tree/master/examples/static_world is a demo of using cowboy to do that.

Unless you really really love makefiles and want to use erlang.mk (the cowboy's author homebrew build system framework made out of makefiles), I recommend you use rebar3 instead (which is the homebrew build system I work on)

Soricidus
Oct 21, 2010
freedom-hating statist shill

Barnyard Protein posted:

what is the current hotness w/r/t java we bapp development? spring boot would be needs suiting in terms of functionality, but i remember shaggar saying to use something else, i forget.

vaadin

Soricidus
Oct 21, 2010
freedom-hating statist shill
tps: turns out trying to analyse an out-of-memory heap dump on the machine that ran out of memory isn't actually the greatest idea ever

MrMoo
Sep 14, 2000

Soricidus posted:

tps: turns out trying to analyse an out-of-memory heap dump on the machine that ran out of memory isn't actually the greatest idea ever

You may be able to use ulimit to limit the memory of the process then attach to the running process via gdb, then no problem. Usually you can tell a lot earlier with Valgrind.

Shaggar
Apr 26, 2006

Barnyard Protein posted:

what is the current hotness w/r/t java we bapp development? spring boot would be needs suiting in terms of functionality, but i remember shaggar saying to use something else, i forget.

I haven't done java webapp dev in a while. asp.net is too good

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


update re: butts.mvc

i refactores to remove the interface and just piled the properties i needed to bind into the base class regardless of whether the inheritors needed them or not, but i kept the inheritor classes which then have their own methods attached for population so i can still have class specific cshtml editor templates and don't have to maintain one mega editor file.

now all i need to do is figure out how to implement lists of checkboxes in razor without it failing to bind.

Ps. It it also total bullshit that .net mvc will let you reference an editor via @html.editorfor but not actually error when no editor exists or when you have an editor for that model but the cshtml filename doesn't match the classname. I spent a good hour trying to work out why my breakpoints were invald because there was a silent validation fail on this poo poo.

Shaggar
Apr 26, 2006
I think you can manually specify a template for an editor if the class name doesn't match the template name but idr. also if you have a bunch of unused things in ur model u may be overcomplicating something, but if it works it works I guess.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Shaggar posted:

I think you can manually specify a template for an editor if the class name doesn't match the template name but idr. also if you have a bunch of unused things in ur model u may be overcomplicating something, but if it works it works I guess.

i think the nature of the underlying database model (which is effectively a list of mixed types) means that the base class returned to the model will always have to be a list of different types of Butt so somewhere along the line there will have to be a class that holds more properties (or classes) than it will ever use/need.

otoh my original implementation didn't even have types, it was just crammed into the methods to work out what to populate on the base class with so even though i have wasted about two days on this it's (probably) better code than before.

Shaggar
Apr 26, 2006
im making some assumptions, but there are maybe a few other ways you could do it.

Lets assume we fix the model and have a base butt interface or abstract class and then individual butt types for each butt type in your db.

If you have an IEnumerable<ButtBase> or IEnumerable<IButt> in your model you could, inside your view, pick different partial views based on the actual concrete class. The problem here is what happens when the butts are changed and submitted? The default binder wont know how to bind buttbase (and in fact it think it will tell you to get bent if its an interface or abstract class). You could then create a custom model binder that would handle the logic of determining the butt type and desterilizing it from the form input. This would give you very nice clean views and models at the expense of the extra dev time on the custom binder.

a really gross other way to do it would be to have in your model a list for each butt type. so IEnumerable<BigButt> BigButts and IEnumerable<LittleButt> LittleButts. then in your view you essentially enumerate all these collections and display them in a way that's transparent to the user. If they can add new butts to the input form you make sure they get added with the input name of the proper butt type list. This way is probably the least effort if you've never done custom model binding before (it really isn't that hard) and the tradeoff is a gross view

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Shaggar posted:

im making some assumptions, but there are maybe a few other ways you could do it.

Lets assume we fix the model and have a base butt interface or abstract class and then individual butt types for each butt type in your db.

If you have an IEnumerable<ButtBase> or IEnumerable<IButt> in your model you could, inside your view, pick different partial views based on the actual concrete class. The problem here is what happens when the butts are changed and submitted? The default binder wont know how to bind buttbase (and in fact it think it will tell you to get bent if its an interface or abstract class). You could then create a custom model binder that would handle the logic of determining the butt type and desterilizing it from the form input. This would give you very nice clean views and models at the expense of the extra dev time on the custom binder.

a really gross other way to do it would be to have in your model a list for each butt type. so IEnumerable<BigButt> BigButts and IEnumerable<LittleButt> LittleButts. then in your view you essentially enumerate all these collections and display them in a way that's transparent to the user. If they can add new butts to the input form you make sure they get added with the input name of the proper butt type list. This way is probably the least effort if you've never done custom model binding before (it really isn't that hard) and the tradeoff is a gross view

yeah i've fortunately avoided having list for each type, that wouldn't really work anyway because the mixed types have to be ordered in a specific way. I think I could do it by using a list of <Butts> where Butts can contain ButtType1, ButtType2 etc. but even then a given instance of Butts will have properties that can never be filled so it hasn't really made anything neater in that sense.

a custom binder for the interface would probably work if I bound the enum that defines ButtType and seems to have been done before but tbh i think what I'm trying to do is a $50 solution to a $0.50 problem and is putting purity of model over readability of code.


Edit: hmmm, on looking into it custom binders might not actually be as bad as I thought because I can add the type enum to the model so potentially all that my binder needs to do is look at that attribute to know what type of class to bind to, but that might be optimistic on my part.

edit 2: holy gently caress this person is doing almost exactly what I am i.e. taking a clusterfuck of a form (though not 100 pages of a word form in my case lol wtf) and using an interface to represent the different types of form item that can exist under it, then using a bound "section type" to force the binder to create an instance of the appropriate concrete class. god drat, i knew i couldn't have been the only person that thought that interfaces should be usable in mvc for this exact case.

Powerful Two-Hander fucked around with this message at 00:36 on Jan 15, 2016

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
we took a chance hiring a guy who was pretty inexperienced and so far he's like quadrupled our new hire /start up/how to do things documentation :cool:

ErIog
Jul 11, 2001

:nsacloud:
I have a dumb math question because I'm terrible at both math and programming.

I'm doing cryptopals and I'm on challenge 36: http://cryptopals.com/sets/5/challenges/36/

The part I'm having trouble with is that ruby is bitching that my 'u' values and 'x' values are too large to do exponentiation on. With the previous Diffie Hellman challenges this wasn't an issue because I was using modexp. However in the lines below I don't see how I can simplify them because I need to give the output of exponents to my modexp function. There might be some algebraic way I can use modexp to avoid the issue, but I'm too dumb to know how to do it or if it's even possible.

quote:

Generate S = (B - k * g**x)**(a + u * x) % N
...
Generate S = (A * v**u) ** b % N

gonadic io
Feb 16, 2011

>>=

ErIog posted:


The part I'm having trouble with is that ruby is bitching that my 'u' values and 'x' values are too large to do exponentiation on.

Check out http://math2.org/math/algebra/exponents.htm

In particular,
y = B - k * g**x
Then the first expression is the same as
y**a * y**(u*x) % N
And
y**a * (y**u)**x % N
And
(y**a % N) * (y**u % N) **x % N

Note that you CAN'T just mod N the exponent. See here for more details: http://www.dragonwins.com/domains/getteched/crypto/modular_arithmetic_intro.htm#Modular Exponentiation
I know it's not complete (God I hate typing maths on my phone) but it should be enough to get you started. When I get home from work I'll give you a better answer if nobody else has. Honestly the math thread in S, A & L might be a better fit for this question as crypto often passes the nonexistent line from programming to pure maths.

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

ErIog posted:

I have a dumb math question because I'm terrible at both math and programming.

I'm doing cryptopals and I'm on challenge 36: http://cryptopals.com/sets/5/challenges/36/

The part I'm having trouble with is that ruby is bitching that my 'u' values and 'x' values are too large to do exponentiation on. With the previous Diffie Hellman challenges this wasn't an issue because I was using modexp. However in the lines below I don't see how I can simplify them because I need to give the output of exponents to my modexp function. There might be some algebraic way I can use modexp to avoid the issue, but I'm too dumb to know how to do it or if it's even possible.

https://en.wikipedia.org/wiki/Exponentiation_by_squaring

Tankakern
Jul 25, 2007

JewKiller 3000 posted:

my work wants to move a couple databases from oracle to postgres. i looked into enterprisedb "postgres plus advanced server" initially for their oracle sql compatibility, but those guys charge a big yearly license fee just like oracle, so now we're leaning toward standard open source postgres.

i ran the ora2pg migration tool and with some manual tweaking was able to migrate nearly all the schema objects successfully, including stored procedures, that felt good. but there are not that many stored procedures. instead there are a fuckton of sql query strings spread across different java codebases, stuffed in excel macros, or copy-pasted from some document by a person doing manual qa. sometimes the queries are all in one place, like a project has some queries.xml file with sql strings in there, that's not SO bad because there are tools to help translate this. however i've found places where the queries are constructed in java code by concatenating strings according to whatever crazy logic is in there. no tool is going to handle this, we'll have to go through all that code manually and fix anything oracle-specific to use the corresponding postgres feature. what am i supposed to do about this besides kill myself?

some other helpful notes:
- the products using these databases go back 15 years and generate almost all the company's revenue
- a migration to postgres was attempted a few years ago as part of some other project that was ultimately abandoned. the person who worked on it is no longer with the company
- as far as i can tell, there is no dba.

I guessing this in unneccessary to point out, but if you haven't yet you should grep the whole codebase after '\(\+\)' to get rid of those oracle left outer joins

distortion park
Apr 25, 2011


I have no idea who our target customer is meant to be. We have options to accommodate everything under the sun but they are all either broken, incompatible, or impossible to use correctly.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
I've been working on a library thing at work and im horrified that maybe I've constructed a monument to myself

Clockwerk
Apr 6, 2005


thats the only kind of monument worth building, grats

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo
tfw the most suitable library you find on github is licensed WTFPL

e: and your company is so strict about licenses you can't use anything that even includes a "can not use this for evil" clause

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Clockwerk posted:

thats the only kind of monument worth building, grats

not if you want other people to use your work

Soricidus
Oct 21, 2010
freedom-hating statist shill

Flat Daddy posted:

tfw the most suitable library you find on github is licensed WTFPL

e: and your company is so strict about licenses you can't use anything that even includes a "can not use this for evil" clause

oh, you're in advertising?

b0lt
Apr 29, 2005

Flat Daddy posted:

e: and your company is so strict about licenses you can't use anything that even includes a "can not use this for evil" clause

i've spent a week waiting for a repository to be created to move code around because of license review of a public domain project that's been in the codebase for 7 years

Soricidus
Oct 21, 2010
freedom-hating statist shill
tps: replaced a large hashmap with a couple of arrays and binary search, watched the code that uses it get 10x faster :smug:

Valeyard
Mar 30, 2012


Grimey Drawer
discovered datamaps.js today, only wish it was a little more mature

Arcsech
Aug 5, 2008
git blame is a great and wonderful feature

Arcsech
Aug 5, 2008

Arcsech posted:

git blame is a great and wonderful feature

I mean sometimes this happens:

"what loving moron wrote this poo poo?"
*runs git blame*
"oh it was me"

BUT when it's not you it's great

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


it's 11pm on a Friday night and instead of being drunk I have been fixing mvc binding to an interface, turns out I removed one important line in my lazy C&P of the custom binder so nesting didn't work properly.

that said, even though its documentation is basically godawful and things that should logically work out of the box a)don't and b) don't always throw errors when they don't*, .net mvc owns bones



*ffs if you're going to make your syntax 100% reliant on filenames matching class names you should at least show an error when @Html.EditorFor points to nothing because you refactored the class but didn't change the template name, instead you just get a "breakpoint won't be hit, symbols not loaded error" which is the Visual Studio equivalent of "gently caress you I hope you enjoy spending an hour loving with settings and running rebuilds to work out why you can't debug dipshit"

Bloody
Mar 3, 2013

what does git blame do

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
attributes each line to the last person who modified it (with commit hash, time stamp etc)

Bloody
Mar 3, 2013

wow so it gives you traceability? awesome

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Arcsech posted:

I mean sometimes this happens:

"what loving moron wrote this poo poo?"
*runs git blame*
"oh it was me"

BUT when it's not you it's great

i'm usually happy when it's me, because then i don't have to worry about the current code working around some non-obvious problem that i'm not aware of, and if it's bad for a reason that i should have noted in a comment then i usually remember that reason as soon as i seen the context in which it was written

oh no blimp issue
Feb 23, 2011

worked out how to add a custom role provider to my asp.net project and then use moq to fake the IPrinciple so that i could test my controllers properly, feels good

Brain Candy
May 18, 2006

Bloody posted:

wow so it gives you traceability? awesome

CVS could do this, unless your vcs is .bak files you too have these powers

craisins
May 17, 2004

A DRIIIIIIIIIIIIVE!

MALE SHOEGAZE posted:

we took a chance hiring a guy who was pretty inexperienced and so far he's like quadrupled our new hire /start up/how to do things documentation :cool:
my goal when the next new person is hired is to make them write down every step and every question they have so the next person who gets hired doesn't have to go through the same poo poo i did

craisins
May 17, 2004

A DRIIIIIIIIIIIIVE!

Brain Candy posted:

CVS could do this, unless your vcs is .bak files you too have these powers
i always check svn blame before bitching about some code so i don't complain to the wrong person (the person who wrote it...technically the right person)

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

craisins posted:

my goal when the next new person is hired is to make them write down every step and every question they have so the next person who gets hired doesn't have to go through the same poo poo i did

yeah i mean that's the idea like every time right? difference is this guy actually did it.

craisins
May 17, 2004

A DRIIIIIIIIIIIIVE!

MALE SHOEGAZE posted:

yeah i mean that's the idea like every time right? difference is this guy actually did it.
he sounds like a keeper. at least until you have everything documented or he realizes he doesn't want to be "documentation guy" anymore.

Bloody
Mar 3, 2013

Brain Candy posted:

CVS could do this, unless your vcs is .bak files you too have these powers

let me tell you about source_code_20161501.zip

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

craisins posted:

he sounds like a keeper. at least until you have everything documented or he realizes he doesn't want to be "documentation guy" anymore.

that's when you promote him to unit test guy, obviously

  • Locked thread