|
qntm posted:hooray, everybody has abandoned timezones i'm fine with this.
|
# ¿ Jun 4, 2013 23:49 |
|
|
# ¿ May 16, 2024 14:39 |
|
prefect posted:i'm thinking people would get mad if noon came around and the sun wasn't somewhere in the general overhead area railway time
|
# ¿ Jun 4, 2013 23:54 |
|
Nomnom Cookie posted:why can't we have an api to turn (date, time, locale) into UTC and back again. thats all i want *stores local time as utc* *dst changes by law* *all appointments an hour off*
|
# ¿ Jun 5, 2013 08:54 |
|
Nomnom Cookie posted:most of the time this is acceptable do you work on the android team
|
# ¿ Jun 9, 2013 01:32 |
|
*adds one to year* *crashes in leap year*
|
# ¿ Jun 9, 2013 02:13 |
|
prefect posted:is this a religious thing, or was there some guy named church who thought them up? it's because functional programmers believe in the separation of church and state
|
# ¿ Jun 9, 2013 18:35 |
|
https://groups.google.com/forum/?fromgroups#!topic/golang-nuts/hJHCAaiL0soquote:Gofmt was written to reduce the number of pointless discussions about
|
# ¿ Jun 14, 2013 02:18 |
|
ruby: has objects that respond to messages. this invokes methods. has lisp-2 style namespaces for method calls and variables. uses observer/internal iterators pushing a callback to the object. uses require/include to build scripts. python: has objects that have attributes. this invokes functions. single namespace. self is lexically scoped. uses external iterators that return a value. has a library system. both imperative call by object style scripting languages hth
|
# ¿ Jun 23, 2013 17:32 |
|
heh https://www.youtube.com/watch?v=TFxRSV9cucM ft: mr scruff https://www.youtube.com/watch?v=jZHAb92E31E tef fucked around with this message at 03:41 on Jun 27, 2013 |
# ¿ Jun 27, 2013 03:39 |
|
prefect posted:semi-serious question: what's the serious engineer-scientist opinion of things like ip, tcp, and http? are those masterpieces of engineering design, or are there chunks of them that are the equivalent of spit and baling wire, things that work despite themselves? the best design decision in tcp was to split it into ip and tcp. tcp itself is a good idea: pretend a packet switching network is really a phone network, and making calls between computers, but early tcp also caused network collapse (congestion control), it was vulnerable (syn flooding) and has a number of just unused or broken features (tcp urgent). the real problem with tcp is that it is fossilized. now it's hard to change tcp because of nat shitboxes + smart routers, as well as being burnt into kernels, instead of in userland. applications can't control tcp flow or congestion, so many flock to udp to get what they want (like not saturating bandwidth) tcp is really a stream atop of messages, but people tend to send messages over tcp, so they kinda end up reimplementing flow control + acks + timeout over tcp. many attempts to shoehorn a message protocol over tcp also suffer from a lack of multiplexing as well as head of line blocking too. tcp in some ways is too high an abstraction for messaging protocols. for example: http and websockets. http can't be multiplexed, and pipelining isn't great as a substitute. websockets has to implement acks, timeout and flow control atop tcp too. http itself isn't really a masterpiece of design as implemented, but the intentions behind it are rather neat. instead of abstracting things as special sockets, or a series of weird and ad-hoc methods, http works more like a filesystem, and through this allows proxies, caches, loadbalancers, as well as gateways to non http services. http is a a badly implemented protocol that makes the web work so well. still, it has weird things like line folding and a series of workarounds for older versions. meanwhile in opposition to tcp/ip there is this idea of named data networking/content addressable networks, the idea that sometimes getting a file is more important than talking to a specific computer. bittorrent makes an excellent example of doing this end-to-end/at the application layer without having to have new routers. instead of asking for a file on a given computer (i.e a url), you ask nearby computers for the file you're after.
|
# ¿ Jun 28, 2013 05:39 |
|
http/tcp/ip is just the most recent in a long line of good ideas executed badly and misused
|
# ¿ Jun 28, 2013 05:46 |
|
basically tcp is a skeuomorph for the phone network
|
# ¿ Jun 28, 2013 05:49 |
|
FamDav posted:a) what language implements an associative container and calls it an hash table instead of a map? perl, ruby. python calls it a dict, not a hash or a map. quote:c) i was curious what go's underlying implementation for map is and the spec doesnt even give algorithmic complexity for its operations. thanks rob. quote:hashmap.c is a multilevel hash table (a short tree so that it doesn't http://golang.org/src/pkg/runtime/hashmap.c
|
# ¿ Jun 28, 2013 15:24 |
|
FamDav posted:why cant they put that in their spec? i realize that the implementation of their map type is changing every day but i would appreciate it if i could just go read through the spec and have a general understanding of the performance characteristics of basic types. because it might be a property of the implementation, rather than the design
|
# ¿ Jun 28, 2013 15:55 |
|
trekdanne posted:I ran into this "problem" with Python scoping. I know that Python uses statical scoping but that doesn't really work that well with the lambda keyword. the i is stored in the outer scope, and not copied into the lambda, so i keeps the value from exiting the loop. code:
tef fucked around with this message at 11:49 on Jul 20, 2013 |
# ¿ Jul 20, 2013 11:47 |
|
|
# ¿ Jul 21, 2013 23:27 |
|
ps should i make a smart dog book thread in CoC and then argue about stuff?
|
# ¿ Jul 24, 2013 00:41 |
|
Jerry SanDisky posted:no, calling set() on a list comprehension is not a set comprehension (ps technically he called it on a generator comprehension). (pps you don't need to return a list, a set would be fine I think)
|
# ¿ Jul 24, 2013 00:42 |
|
i'm guessing that the set-comprehension is mostly implemented in C, so python can go woosh. with the generator comprehension, some extra work is done, and a bit of indirection to build the set.
|
# ¿ Jul 24, 2013 01:16 |
|
just a butt posted:I probably should have read the PL thread before post post posting cause they were literally talking bout cucumber which was what I was thinking about you only need to read it once it's basically the same three arguments over and over again -- checked exceptions -- plangs vs jlangs -- hay is java pass by value or pass by reference
|
# ¿ Jul 25, 2013 16:23 |
|
someone counted all the little languages used to build a rails app and got to thirteen
|
# ¿ Jul 25, 2013 16:24 |
|
covariant arrays are like this: eh eh eh eh contravariant arrays are like this: do do do do
|
# ¿ Jul 26, 2013 00:01 |
|
JewKiller 3000 posted:it's not a difference of opinion, covariant arrays are objectively wrong by the only reasonable metric: they make type checking unsound yeah covariant arrays are pretty wat, they only made sense as a workaround for a lack of generics. however, there is a use for covariance outside of arrays, but i guess you know this so whatever. my real problem is now when people say LSP i don't think of the substitution principle first
|
# ¿ Jul 26, 2013 03:39 |
|
Mido posted:UserManager::GetUserManager()->findUser("Mido")->setLaughs(UserManager::GetUserManager()->findUser("Mido").getLaughs()+1); [✓] Global Variable, or as we call them now, Singleton Pattern [✓] Getters and Setters instead of methods that do things [✓] Possible Race Condition
|
# ¿ Aug 27, 2013 11:32 |
|
Shaggar posted:singletons have valid uses and db proxy objects is one of them (assuming that's what usermanager is) I have no objection to passing in a singleton, but it seems a bit bad to use a global to find it, it can make code harder to test and in effect tightly coupling parts together.
|
# ¿ Aug 27, 2013 16:01 |
|
Shaggar posted:in my case the singletons im pulling out of a global store (spring proxies) implement a specific interface. I pull them out of spring and shove them into whatever is using them. Then my tests can be built against the interface and I can inject proxies the same way to test implementations. you'll note in the example above it pulls it out of a global and doesn't use a dependency hth
|
# ¿ Aug 27, 2013 17:07 |
|
Shaggar posted:oh, you mean tests on the proxy consumer. right. my bad. tef was right i think i need to go and sit down
|
# ¿ Aug 27, 2013 17:34 |
|
MrMoo posted:They asked yesterday what is 224? It's 224? This is a perfectly fine way to represent the number
|
# ¿ Sep 19, 2013 10:33 |
|
Mido posted:but once your python poo poo starts growing into like 5 class monstrosities that break into 12 different files you're gonna start not enjoying all the duck typing bullshit when your poo poo breaks yep
|
# ¿ Oct 23, 2013 01:23 |
|
PrBacterio posted:I really do wonder though how regex based languages became so utterly dominant to the point that the "regexes" they parse arent even regular anymore but some sort of hybrid hellspawn of backtracking and exponential running time, when context free grammar parsing has been a solved problems for so long now. I mean obviously snobol and its successors are poo poo too, but why havent any modern, usable CFG based parsing languages been invented for whats literally decades now, when its quite obvious to anyone with a brain that regexes arent really what people actually want or need for parsing in most cases as, for one, what people call regexes nowadays actually arent because debugging lalr is painful, recursive descent is easy, and ll is really loving trivial and lr isn't. actual cfg parsing is still slow and clumsy.
|
# ¿ Oct 24, 2013 00:50 |
|
Shaggar posted:the javadocs. java is great and easy and you don't really need a book, just don't try to replicate what you did in those hosed up and lovely p-langs cause it was probably wrong. this is wrong, you probably want "Effective Java" by Joshua Bloch. It's a cookbook of good ways to use Java
|
# ¿ Oct 25, 2013 14:30 |
|
Notorious b.s.d. posted:i believe shaggar was referring to the official oracle/sun tutorial content, not literally the docs generated by the javadoc tool effective java is a pretty good book tho
|
# ¿ Oct 25, 2013 14:44 |
|
doesn't windows use nt paths internally and exposes dos style paths for compat?
|
# ¿ Oct 25, 2013 17:54 |
|
PleasingFungus posted:I kind of want to learn an erlang but I don't know what I could use as a learning project chat server ?
|
# ¿ Nov 5, 2013 10:28 |
|
MeruFM posted:it is, my post was just worthy of this thread you mean visibility, right? not scope
|
# ¿ Jan 18, 2014 12:13 |
|
MononcQc posted:Print statement debugging has been my bread and butter of debugging. Languages that allow tracing make that easier. When all else fails, I get a piece of paper and pencils and I think really hard. It's hard to run debuggers in production systems, especially after they've crashed. I found that many of my debug statements were worth keeping after the bug was found. Logging is lovely.
|
# ¿ Jan 31, 2014 15:49 |
|
USSMICHELLEBACHMAN posted:replace catch with tweet imo code:
|
# ¿ Jan 31, 2014 15:59 |
|
USSMICHELLEBACHMAN posted:okay I've learned how to implement the following data structures and algos today: if someone's been reading their algorithmic puzzle book, you're always in for a arduous interview. i am pretty much convinced this is normally to justify the interviewer's computer science degree, because they have rarely had any opportunity to use this stuff in production. classic things are reversing a linked list without overhead, so write just a reverse first, and then optimize it. there will be some linear time algorithm where the trick is doing two scans over the collection, once to find a number, value, depth, item, and a second pass occasionally you'll get a divide and conquer thing, like quickselect. always write the simplest algorithm that works. and by simple i mean, slow, verbose and in parts. break it down into tiny, tiny pieces and assemble it slowly. don't try and write the whole thing top to bottom. as for when you get asked to write binary search, remember this one weird old tip: are you writing a lower bound or an upper bound: http://canhazcode.blogspot.co.uk/2012/02/we-need-to-talk-about-binary-search.html quote:I haven't done hashmaps. Knowing the basics of hash tables might help you a bit, especially on collisions. quote:I can only fit so much more in my head in the next couple days. I really want to nail this interview so I can go from a hobbiest terrible programmer to an official terrible programmer. some of the crap up there is worth repeating about coding and algopuzzles in interviews: - read this: http://canhazcode.blogspot.co.uk/2012/02/we-need-to-talk-about-binary-search.html - be patient and methodical: write highly explanatory code, deconstruct it into plenty of functions and methods - don't solve it all at once, either. if it is to be fast, linear and correct, get it correct *first* - algorithms always have a trick to them. sometimes it's divide and conquer, sometimes it's that linear time can mean multiple passes over the data. finally, when you get an algopuzzle, don't ask the interviewer "when was the last time you used this in production code", because they don't like saying "oh, we never use anything like this" because it makes them look and feel stupid. if you want to rub salt on their wounds, just say "I just want to know if this interview reflects the sort of work I may be hired to do" actually don't do that, but it's really funny and I do it every time.
|
# ¿ Feb 10, 2014 03:44 |
|
Innocent Bystander posted:also, I got asked this question at two different shops: Find the intersection between two strings (in C). What is its runtime? If I gave an O(n) solution, they would ask me to give a O(n^2) solution, if I gave an O(n^2) solution they asked me to do it in O(n). hth so you want to find the common elements between two lists of characters option a) use a hash table, or a array option b) if list is sorted, merge the common elements. option c) two nested for loops common subset? build a suffix tree i think eh it's 6 am
|
# ¿ Feb 12, 2014 07:04 |
|
|
# ¿ May 16, 2024 14:39 |
|
Malcolm XML posted:is this for set or multiset instersection tho does it make a difference? a) use a hash, keep count of how many elements are in a set. find the intersection of hash keys + sum of hash values (or same but use array with counts) b) if mutiset is expressed as sorted string, merge them, skipping ones that only appear in one string, keeping duplicates c) two for loops
|
# ¿ Feb 12, 2014 14:36 |