|
CRIP EATIN BREAD posted:speaking of npm look at this whiny baby: im currently saving up money to liberate my modules too, op
|
# ¿ Mar 23, 2016 13:18 |
|
|
# ¿ May 11, 2024 10:55 |
|
|
# ¿ Mar 24, 2016 13:54 |
|
http://left-pad.io/
|
# ¿ Mar 24, 2016 23:02 |
|
MononcQc posted:That's IEEE Standard 754 on floating points. well then it's a loving stupid standard
|
# ¿ Mar 24, 2016 23:03 |
|
GrumpyDoctor posted:lol what was the bug system("sudo rm -rf /");
|
# ¿ Mar 24, 2016 23:24 |
|
BattleMaster posted:maybe i just use C too much because i don't see what's wrong with null being 0 in c++ at least, the following code behaves very differently if you substitute 0 for NULL: code:
|
# ¿ Mar 25, 2016 00:27 |
|
Plorkyeran posted:this is completely wrong by both the standard and in practice gently caress me apparently youre right its me im the terrible programmer (well in c++11 it can also be std::null_ptr but w/e)
|
# ¿ Mar 25, 2016 05:04 |
|
HoboMan posted:pretend i have design skills and was making a webpage, "what program do i loving boot up to start crafting some html/css?" is essentially my question. all you've said in response is "be a designer". this is not helpful grep and sed
|
# ¿ Apr 2, 2016 00:37 |
|
Awia posted:the answer is visual studio same except vim and make
|
# ¿ Apr 2, 2016 18:03 |
|
computer parts posted:not in academia academic code owns
|
# ¿ Apr 10, 2016 19:39 |
|
Awia posted:im the pointer named t im Malloc not malloc, Malloc
|
# ¿ Apr 10, 2016 19:45 |
|
Awia posted:what does Malloc do over malloc? why does it take a type and a random variable and return a pointer? Malloc is a macro that performs a sizeof on the first element and then returns memory of that size. i dont remember what the random variable does and no the macro is not parentheses-wrapped
|
# ¿ Apr 10, 2016 19:57 |
|
i looked up the macro for you nerdscode:
|
# ¿ Apr 11, 2016 01:56 |
|
hey fun c++03 fact: if you have a std::vector<Object*> v, then v[i]+1 compiles fine and without warning!
|
# ¿ Apr 12, 2016 00:40 |
|
VikingofRock posted:Really? I get a -Wunused-value warning, which is part of -Wall. (Link to example) unless im mistaken you're only getting unused value if you don't actually then read it. also the only reason that you get "pos" in your example is that you already put "yos" and "pos" in an array so they're guaranteed to be adjacent, if they're not already adjacent you'll segfault when you try to access v[0] + 1
|
# ¿ Apr 12, 2016 03:21 |
|
Bloody posted:I thought vector guaranteed adjacency vector guarantees adjacency, but the vector type is Object*. the Objects themselves are in no way guaranteed to be adjacent since it entirely defends on how and where they were defined as a really lovely example that you should never actually write: C++ code:
|
# ¿ Apr 12, 2016 03:26 |
|
fritz posted:no stop that, jesus christ would if i could m8, not up to me
|
# ¿ Apr 12, 2016 13:12 |
|
honest question: is html turing-complete
|
# ¿ Apr 13, 2016 20:22 |
|
Bloody posted:for(int i = 0; i < butt.Length; i++) nah now it's code:
|
# ¿ Apr 14, 2016 18:47 |
|
Notorious b.s.d. posted:and smarter pointers not if it's c++03 or earlier
|
# ¿ Apr 14, 2016 18:48 |
|
fritz posted:can you at least use a boost in theory yes, at this job no
|
# ¿ Apr 14, 2016 19:28 |
|
weird posted:
yes this technically works but it assumes that the contents of the loop are one and only one function call of course you could (a) write an external function that handles the inside of loop () or (b) write a lambda, but lambdas only exist in c++11 and up. and besides goddamn is that some ugly code either way if you aren't just trying to fart() each butt oh also without lambdas you can't capture variables from outside the loop so have fun trying to get that to work with c++03 with any function that depends in some way on external state!
|
# ¿ Apr 14, 2016 19:32 |
|
i pretty frequently have to iterate over stl::map objects, which is really "fun" in c++03. say i want to add one to each member of an int map keyed by stringsC++ code:
|
# ¿ Apr 14, 2016 19:34 |
|
also be sure to note that it is not a pointer, it just overrides operator* and operator-> to make it look like one! this has the fun side effect that &(*it) != it
|
# ¿ Apr 14, 2016 19:37 |
|
more like dICK posted:std::transform should do that? same problem as before re: external functions or lambdas. im intentionally making simple examples here of loop structures, ofc there are easier ways to add 1 (also std::transform and std::for_each are in libraries separate from, say, <map> so you have the added joy of more #includes, hooray)
|
# ¿ Apr 14, 2016 19:49 |
|
more like dICK posted:I think that "operation I regularly apply to a map entry" is he perfect thing to encapsulate in a function but I'm in this thread so whatevs depends on how often you actually apply that operation i guess. plus im generally of the opinion that fewer functions = better (within reason, of course)
|
# ¿ Apr 14, 2016 19:55 |
|
VikingofRock posted:Why wouldn't you just do ++(it->second)? again because it's a simple example to demonstrate the general gist of what im talking about christ almighty do i have to write unit tests for example code too
|
# ¿ Apr 14, 2016 20:21 |
|
Fergus Mac Roich posted:what is the purpose of reducing the number of functions? keeps anybody reading the code (yourself included) from having to jump around in a file (or multiple files!) to figure out what the code is doing. if you need code that does One Thing, write a function that does it. don't then separate One Thing into Nine Subthings and write nine functions
|
# ¿ Apr 14, 2016 22:27 |
|
example from my current neural network code for job: one function trainFromCsv that opens a csv file, reads data out of it, closes the csv file, and then trains itself based on that data i could do, in theory (pseudocode before someone jumps down my loving throat) code:
|
# ¿ Apr 14, 2016 22:31 |
|
JimboMaloi posted:uh the reason you do it like that is because its way easier to read. if youre working in a language with a functional ide the cost of jumping to a method implementation is trivial, and then each thing is actually readable without the noise of unrelated tasks surrounding it. its precisely the 'write a function that does one thing' notion that you just stated. reading a csv file and training a neural net are 2 things i mean i run vim/ctags so it's literally as easy as :ta <name of function> or C-] on the function name itself. that still doesn't change the fact that it's an additional step other than "scrolling down"
|
# ¿ Apr 14, 2016 22:53 |
|
Bloody posted:verilog's most common form of flow control is a convoluted version of goto *hits blunt* all programs are just applications of subleq, maaaaaaan
|
# ¿ Apr 14, 2016 23:14 |
|
Illusive gently caress Man posted:The ideal is that you don't need to scroll down or look at the other function at all because it does exactly what the function name says and trainFromCsv() trains the network from a .csv your point?
|
# ¿ Apr 14, 2016 23:40 |
|
Jabor posted:i really love it when the fiddly implementation details of reading a csv (do you use a library for this, or is yet-another-bespoke-csv-like-format?) occupy the same space as my machine-learning neural net stuff. i can think of no reason you'd ever want to separate those two wildly distinct concepts. none at all. it's straight up an stl-based csv reader and the main training loop is a function called propagate and a function called back propagate it's v easy to extend to new formats
|
# ¿ Apr 15, 2016 01:22 |
|
Bloody posted:wish I could back propagate your posts gently caress me im so owned
|
# ¿ Apr 15, 2016 05:03 |
|
Wheany posted:you have to use "butt" and "fart" as your variable names or us terrible yospos programmers will think you're posting production code. what if i write enterprise code for the fartbutt industry
|
# ¿ Apr 15, 2016 13:44 |
|
Bloody posted:i have created a revolting clusterfuck you're posts!!
|
# ¿ Apr 15, 2016 15:35 |
|
Wheany posted:are you hiring? i'm willing to relocate we currently have job offerings on uranus
|
# ¿ Apr 15, 2016 15:36 |
|
piratepilates posted:the evil fartbutt industrial complex hillary clinton takes donations from Big Butt
|
# ¿ Apr 15, 2016 17:18 |
|
|
# ¿ Apr 15, 2016 17:25 |
|
|
# ¿ May 11, 2024 10:55 |
|
triple sulk posted:lol if u think this is as bad as it can get oh no i know it can get worse than this, but this is a chain of ifs with a single line that it actually executes embedded into a switch statement embedded in a for loop in a function literally kill me
|
# ¿ Apr 15, 2016 17:26 |