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
DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i've never set a global variable

except for one time during an interview when they asked about something and i just diarhea'd out 'global variable' and then was like "WAHAT"

Adbot
ADBOT LOVES YOU

leftist heap
Feb 28, 2013

Fun Shoe

MrMoo posted:

Standard fare with commodity man-month managed projects, despite the trillions of dollars burnt this way there does not appear to be any effort to reduce the damage. I guess Agile was supposed to be the answer?

p much yeah.

Bloody
Mar 3, 2013

Luigi Thirty posted:

is a mess of duplicated code, and manipulates global variables when it can be refactored not to

saaaaaaame

comedyblissoption
Mar 15, 2006

class/instance/module-level mutable variables that could've been scoped to only be immutable function parameters are basically the same as global variables and i see this everywhere

gonadic io
Feb 16, 2011

>>=
dear terrible programmer thread, please try to talk me out of designing my own data structure or at least point me to where somebody has already made it

the general idea is to combine list-compressing (i.e. "aaaaccb" to "4a2c1b") with the Yale encoding of sparse matrices

this way when you have an array that has a LOT of repeated entries (the original inspiration was a minecraft world which has a few layers of rock, then dirt, then air but they're not uniform and need to be easily mutable) you compress them together and record the index where the repeated element begins:

for example
____
____
_...
....

would be encoded as [(0,'_'), (9, '.')]

Yale however caches a bunch of information to avoid having to constantly traverse the list though, for example rows 0, 1, and 2 all start in the 0th element of the list of pairs (i.e. start with a '_') and row 3 starts with a '.' so the row-start array would be [0,0,0,1]. Yale also caches the height of each element but I'm not sure if that'd be useful.

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
what do you actually want to do with this data structure? because if it's just storage, you may as well use an image compression library. if im remembering my web poo poo right, png's the one for images with large flat areas

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
if it's for storage but you also want to index into sub-arrays, HDF5's approach is to chunk the array and then store the gzip'd chunks in a b-tree.

gonadic io
Feb 16, 2011

>>=
I was playing minecraft and I was wondering how I'd implement that and it seemed like a decent project to learn f# in because it's inherently mutable

plus it needs to generalise to 3d. I figured I'd try to implement morton ordering and maybe a visualiser after this

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

gonadic io posted:

dear terrible programmer thread, please try to talk me out of designing my own data structure or at least point me to where somebody has already made it

the general idea is to combine list-compressing (i.e. "aaaaccb" to "4a2c1b") with the Yale encoding of sparse matrices

this way when you have an array that has a LOT of repeated entries (the original inspiration was a minecraft world which has a few layers of rock, then dirt, then air but they're not uniform and need to be easily mutable) you compress them together and record the index where the repeated element begins:

for example
____
____
_...
....

would be encoded as [(0,'_'), (9, '.')]

Yale however caches a bunch of information to avoid having to constantly traverse the list though, for example rows 0, 1, and 2 all start in the 0th element of the list of pairs (i.e. start with a '_') and row 3 starts with a '.' so the row-start array would be [0,0,0,1]. Yale also caches the height of each element but I'm not sure if that'd be useful.

helllo

i only read the first line of your post. but from now on i'd like to say that anyone using tr own data strcutre must refer to it as 'my bespoke data structure'..

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

gonadic io posted:

plus it needs to generalise to 3d. I figured I'd try to implement morton ordering and maybe a visualiser after this

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.19.7508&rep=rep1&type=pdf

looks like it uses morton ordering and run-length encoding

im penalising it for using a 3d barchart though

coffeetable fucked around with this message at 13:15 on May 17, 2015

Gul Banana
Nov 28, 2003

FamDav posted:

I'm vibing on elm.

vibing HARD

i was all excited by elm and i started trying it out. elm-html seemed like a great way to write html, so i did some demo stuff and it turned out that you're still putting together freaking html
basically it made me miss XAML.

also, the Elm Architecture paradigm seems a little.. undercooked? it's impressive, but you run into stuff like.. why isn't there a built in way to have 'child' components, the state of which you update whenever you update your own? & the conceptual issue of, is a foldp over your entire set of inputs really, really a sane thing to do? really? all the buttons on a page and everything someone could press or click or drag or.. that should *really* be a single type/handler? r e a l l y ?

oh no blimp issue
Feb 23, 2011

https://kore.io/

has anyone posted this yet?

Arcsech
Aug 5, 2008

Awia posted:

https://kore.io/

has anyone posted this yet?

as a c programmer this is sort of neat, but along the same lines as https://github.com/cioc/functionalC

like, why the gently caress would you ever use this in production. if you need bare metal performance use rust or at least c++

Bloody
Mar 3, 2013

because unlike c++ and rust, c is a glorious beautiful language

oh no blimp issue
Feb 23, 2011

oh, does anyone know a good c++ programming book from a c# dev perspective?

Bloody
Mar 3, 2013

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I want an O'Reilly Rust book that's just got a pencil drawing of a dumpster fire on the front

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Luigi Thirty posted:

I want an O'Reilly Rust book that's just got a pencil drawing of a dumpster fire on the front

dumpster fires aren't animals

Luigi Thirty
Apr 30, 2006

Emergency confection port.

uncurable mlady posted:

dumpster fires aren't animals

there could be an animal inside the dumpster

Bloody
Mar 3, 2013

Luigi Thirty posted:

there could be an animal inside the dumpster

it's you!

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Luigi Thirty posted:

I want an O'Reilly Rust book that's just got a pencil drawing of a dumpster fire on the front

is rust that bad? it can't be worse than go, can it?

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



groverhaus

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

eschaton posted:

is rust that bad? it can't be worse than go, can it?

i think rust is a lot better than go

Luigi Thirty
Apr 30, 2006

Emergency confection port.


the Go book would have groverhouse on the front

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
the gopherhouse

Valeyard
Mar 30, 2012


Grimey Drawer
hi im looking for Anita Goforadump

oh no blimp issue
Feb 23, 2011

i really wanna do a cool programming project for myself while im not working and out of uni, but im unimaginative

Valeyard
Mar 30, 2012


Grimey Drawer

Awia posted:

i really wanna do a cool programming project for myself while im not working and out of uni, but im unimaginative

ill start....the repo

oh no blimp issue
Feb 23, 2011

Valeyard posted:

ill start....the repo

can i start the wiki?

Valeyard
Mar 30, 2012


Grimey Drawer

Awia posted:

can i start the wiki?

great, we just need the ideas guy pleasurekevin and the project is all set

oh no blimp issue
Feb 23, 2011

right, im gonna shoot for the moon and do an os
and literally get bored after making it show hello world

oh no blimp issue
Feb 23, 2011

BUT I'LL DO IT IN HASKELL

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Awia posted:

BUT I'LL DO IT IN HASKELL

A haskell os??


That does not sound very functional!

CPColin
Sep 9, 2003

Big ol' smile.
It will definitely have no side-effects.

Because it won't run.

qntm
Jun 17, 2009
I wanted to invent a purely, purely functional programming language with lazy evaluation where introducing IO of any kind was specifically forbidden in the licence

every program, regardless of content, would run instantly and return nothing

Luigi Thirty
Apr 30, 2006

Emergency confection port.

i wrote a self-booting 16-bit command prompt in assembly a while ago

it had two commands: reboot and ascii_goatse

it ran in my PC emulator but when I tried to run it on a real pentium 90 it didn't work :(

assembly is neat but i don't know why you'd chris sawyer yourself and write a bideo jame in it in 2015

Luigi Thirty fucked around with this message at 00:29 on May 19, 2015

MeruFM
Jul 27, 2010

qntm posted:

I wanted to invent a purely, purely functional programming language with lazy evaluation where introducing IO of any kind was specifically forbidden in the licence

every program, regardless of content, would run instantly and return nothing

0

suffix
Jul 27, 2013

Wheeee!

gonadic io posted:

dear terrible programmer thread, please try to talk me out of designing my own data structure or at least point me to where somebody has already made it

the general idea is to combine list-compressing (i.e. "aaaaccb" to "4a2c1b") with the Yale encoding of sparse matrices

this way when you have an array that has a LOT of repeated entries (the original inspiration was a minecraft world which has a few layers of rock, then dirt, then air but they're not uniform and need to be easily mutable) you compress them together and record the index where the repeated element begins:

for example
____
____
_...
....

would be encoded as [(0,'_'), (9, '.')]

Yale however caches a bunch of information to avoid having to constantly traverse the list though, for example rows 0, 1, and 2 all start in the 0th element of the list of pairs (i.e. start with a '_') and row 3 starts with a '.' so the row-start array would be [0,0,0,1]. Yale also caches the height of each element but I'm not sure if that'd be useful.

have you looked at sparse voxel octrees? i think that's the standard cool way to do this because it supports efficient raytracing

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

Awia posted:

i really wanna do a cool programming project for myself while im not working and out of uni, but im unimaginative

1) read a book on machine learning
2) look through open government databases until you get an idea

very few of those datasets have had ML techniques applied to them. very very few pairs of those datasets have had ML techniques applied to them.

Adbot
ADBOT LOVES YOU

Su-Su-Sudoko
Oct 25, 2007

what stands in the way becomes the way

coffeetable posted:

1) read a book on machine learning

any recommendations?

  • Locked thread