/dpt/ - Daily Programming Thread

Old: Working on?

Other urls found in this thread:

tom.preston-werner.com/2009/05/19/the-git-parable.html
some.place/user/repo.git
stackoverflow.com/a/5249129
stackoverflow.com/a/5249028
bell-labs.com/usr/dmr/www/1stEdman.html
man7.org/linux/man-pages/index.html
godbolt.org/g/6OgQjF
getmdl.io/components/index.html
github.com/golang/go/issues/8976
a.desu.sh/mqksfs.pdf
filescdn.com/q0ijkq0x5drj
linux.die.net/man/2/fork
twitter.com/NSFWRedditImage

first for ANIME

Do we seriously need a new thread the instant the old one hits 310?

It makes it more likely for people to join the thread. We have to keep up that velocity™ or our burndown chart™ for this sprint™ won't look as good!

Professional benchmarker here.

Checkmate, atheists.

Just look how many times it fucking collected garbage (yellow arrows on the left).

...

Poast the Heroes

crossposting because too tired to deal

I hate scrum.

GC improves performance somehow.

BTW, same old code rapist here. I'm too sleepy to write more code right now. Might continue tomorrow.

>Might continue tomorrow.
Don't push yourself, user.

We would all forgive you if you decided to not program any time soon.

I don't understand git either. It's black magic.

Me too.

/**
* Calculate d.
*
* @param n n
* @return d on success, -1 on failure
*/
int64_t f(uint8_t n)
{
if (n 92) return -1;
n -= 2;

uint64_t a = 1, b = 1, c = 0, d = 1, e = 1, f = 0;

while (n) {
uint64_t g, h;
if (n & 1) {
g = a * d + b * e;
h = b * d + c * e;
f = b * e + c * f;
d = g;
e = h;
}
g = a * b + b * c;
a = a * a + b * b;
c = b * b + c * c;
b = g;
n >>= 1;
}

/* return d */
return d;
}


How did I do, Cred Forums?

>GC improves performance somehow.
It's probably more to do with the jitter. the GC.Collect() call would certainly not speed anything up.

Remove the System.GC.Collect() line and run again.

I'm working on something for my thesis, actually. It's a database system for a local gas station.

tom.preston-werner.com/2009/05/19/the-git-parable.html

This helped me a lot when I was learning to use it.

I commented out the System.GC.Collect() line and got this.

For high level mathematical/quantitative jobs, what's the best language to know?

Python, R, or Julia?

That's because the single collection is insignificant compared to the processing speed inconsistencies that occur over millions of iterations.

Your oxygen comment needs fork.
What is it supposed to calculate? Your dick? My dick? Andreis dick?

Yes.

...

Thanks. I'll read that.

Isn't it obvious?

>fork
*work

Does anyone have the recent Cred Forums programming challenges image?

...

Will I get real results if my code is O(2^n) or something like that.

...

I expect the jitter is contributing to the time.

Loop over the NoGC and GC methods a few times. They might speed up a bit and become more consistent.

...

Those are some shit tier benchmarks.

I believe you're trolling, but just in case you're being serious: It may or may not be obvious from the code (it's probably not), but i wouldn't know because i don't read code if i don't know what it is i'm supposed to be looking for.
If you cant be arsed to tell me what i should be looking for in your code, i won't be arsed to read your code.

...

...

...

It's nearly impossible to actually benchmark GC vs. Non-GC in C#, because you can't guarantee that .Collect() is actually doing anything to objects, and you can't turn it off.

It's also worth noting that your only difference between your two shitty benchmarks is the measurement of how long it takes to collect like 5 objects, which is also negligible.

Long story short: the managed GC does not significantly affect the vast majority of code bases in a negative way.

What CAN be said, is that it positively affects all managed code by taking care of your heap's memory for you. The GC is specifically designed to collect at the most optimal times in order to reduce its footprint to negligible amounts.

tl;dr: There's no point in trying to benchmark the GC, because it's really really fucking complicated, and real-world applications don't reflect a contrived benchmark.

...

Why not run the code and find out what it does?

UH OH SPAGHETTIOS SOMEONE PUSHED SOMETHING BEFORE YOU DID
ensure you have git mergetool --tool=meld
git merge, go through every conflict, ensure that middle file looks up to date

other than that, you need:

git pull
git add file (alternately use -a to add all)
git commit -m "short message explaining changes"
git push some.place/user/repo.git branchname
git checkout -b "my-new-branch"

Please correct me if I'm wrong with any of this shit, but this is like the basic stuff that you need to understand. She needs her hand held through all of this. I'm pretty sure she has oh-my-zsh installed too, so there's no excuse not to use its autocomplete which practically learns unix/linux commands for you.

This was just to create a basic folder structure, pull in two libraries and create a master/development branch. Preferably this would have included a good readme.md, but now it's just going to have to look like shit, I guess :))))

...

What if the GC interrupts my tight ass loop?

...

What are some good books/resources for learning Haskell?

Why not go fuck yourself?

>There's no point in trying to benchmark the GC, because it's really really fucking complicated
It's not that hard. There's shit tonnes of useful GC benchmarks and profiling tools.

...

Learn You A Haskell For Great Good

ded just like your dreams

>Need to edit a java library.
>Found the source files and edited them.
>Now I have a bunch of documents, and not a .jar that I can use a library.

How do I make this into a .jar?
I'm using Android Studio.

Looks promising. Thanks.

build it

First you have to realize that Haskell is useless for most tasks.

...

...

...

...

...

...

It doesn't build, it's dependant on a bunch of other libraries, and some c++ files somewhere.

I'm a novice, and I don't know where to find helpful information on this subject. Google seems empty.

Google wrote the files I need to edit. It's pissing me off because they had 0 foresight into what people would need. They made these libraries for fun to allow people to create particle and liquid effects, but they included no get position methods. I'm so sad.. literally no reason not to include them.

there you go

...

Can't you extend them?

...

no more

MongoDB question:

I want to query a collection and receive documents which are currently embedded within each document of the collection.

Should I create a new, additional collection that contains these documents that can also be found embedded within the documents of a different collection?

-or-

Should I run an aggregation query to get access to the embedded documents in the collection?

Which option is closer to best practice, and is more scaleable?
The second option leaves me with a more tidy database structure. However, it seems like it will not scale well because it will become gradually more computationally demanding as the database grows.
The first option creates duplicated data which is kind of redundant, but it will probably be more performant.

Would a job at Mathworks pigeon hole me?

The variables I need to access are private. Is there anyway I can overcome this?

lol

Programming novice here. Say I've made a website with a user registration system, logging in, logging out, and so on, mostly in ruby. I'd like to make something like online checkers or online chess where the player's game data (losses, wins, etc.) is permanently tied to their account.

Which language should I use to do this
>and why?

Rude janitor.

Finally removed GLEW from my project and replaced it with a file generated by glLoadGen. Makes things simpler, because GLEW is ridiculously hard to compile despite of being just one C file. The C file generated by glLoadGen is very bare bones, just a list of function pointers and not much else.

Though I had to manually patch glLoadGen first because it was written for Lua 5.1 and does not run out-of-the-box in Lua 5.3. Two 'unpack' method calls must be changed to 'table.unpack', then it'll work.

Now the only dependency my project has outside of the standard library is SDL2, nothing else. Feels good.

Working on a bloated javafx based Cred Forums-client. Features are currently:
- Auto-updating
- Automatically adding threads to trace based on tags/board
- Different viewmodes (original Cred Forums, image only, tree based on quotes)
- A few automated tasks, like: search Cred Forums -> search "/dpt/"-keyword -> scrape all images
- using md5-hashes to detect unique images
- Image dump
- google image source-search
- Sound/color alert when thread autoupdate and notices a respond on your post

Any ideas for more features?

Python or PHP
>why
Those are popular languages for the task

BASED MODS

pic related

Pic related is a method within a superclass.

Using @Override from another class, how would I change the values of x and y?
I want to be able to add my own values to them.

>PHP

Why not JS?

Nice prototyping. When are you gonna rewrite in C?

>If something is popular it means you should use it
Oh my sweet child...

Why are they popular languages for the task? I've read that making this in either ruby or python would be a bad idea, but it was on a several years old forum post that didn't explain why

I was wondering this too. Why not javascript?

any webshits here?
what are some good text editors/ides for javascript editing?
currently I'm using geany, but I'm missing stuff like tab completion based on things i've already written in another document.
Is there anything good, or is web development really pure pain?

>how would I change the values of x and y?
>I want to be able to add my own values to them.
x[0] = 9000.0;

What ever language you are comfortable with.

>what are some good text editors/ides for javascript editing?

I use Notepad++, but I'm curious to hear what others use.

Sublime Text is comfy

If something is popular it means that a programming beginner will easily find support.

Personally I'd write that shit in C with with a userspace TCP stack written in assembly. But that's more for intermediate programmers.
>Why are they popular languages for the task?
It doesn't matter to you. You can't assess the pros and cons anyway at this point.

Fuck. No, sorry. I'd honestly use eclipse for this, because I'm more experienced with this. I don't even know if android studio lets you build .jars, but what would I know.

// time.go
package main

import (
"fmt"
"runtime"
"time"
)

func main() {
t0 := time.Now()
fmt.Println(time.Now().Sub(t0))

t1 := time.Now()
runtime.GC()
fmt.Printf("Took %v.\n", time.Now().Sub(t1))
}


$ go build -ldflags='-s' time.go
$ ./time
1.466µs
Took 658.531µs.

I've heard Aptana is supposed to be decent.

>getting the time takes about 500ns in Go
just end it all

>If something is popular it means that a programming beginner will easily find support.
Agreed. That's not the only reason to use something though, even for a beginner.

Sort of; it does matter to me since I'm a naturally curious person, and I want to make the best decision I can regarding this. I'd rather not have to rewrite virtually everything from scratch years down the line because I made a bad decision today.

So far I've got one vote for python, one vote again python elsewhere, a vote for the language I'm most comfortable with (ruby), and a vote against ruby elsewhere.

vim desu, and I only have cursory knowledge in it

it is pure pain though

If your machine has at least 32 gigs of ram I can recommend Atom.

But my vote takes precedence, because it actually makes sense.

Go with node

Which one? Go or node?

mVelocities is private, but x and y are not.
Any ideas on how to use them?

I'll download Eclipse

It doesn't recognise x, "Cannot resolve symbol 'x'"
I've also tried this.x, in pic related

Both

>being retarded takes almost no time in /dpt/
it's obvious, but I keep coming to this place...

what do you mean by this?

>It doesn't recognise x, "Cannot resolve symbol 'x'"
write it after you declare the x variable.

Which one was yours? If it was the "whichever one you're most comfortable with," sure, I can agree with that. But if yours was for python, why did it make sense? I already have some familiarity with ruby and JS, but none with python. I'm stepping into new territory by trying to program an online multiplayer game, let alone figuring out how to tie it into my existing website, so if I have to learn another new language to do this, I'd like to know why I should choose language X when everyone else is saying I should use language A, or B, or C, without anyone coming to an agreement on why any of them are better than the others.

What I do know is that I tried node, couldn't find any resources on it, and had to give up. All of it assumed I had a bare minimum of 2 years (usually more like 4-8 years) as someone who codes in JS for at least 8 hours a day, every single day. I don't have that kind of experience, so I can't use node due to lack of novice-friendly tutorials. I tried for several weeks straight and it didn't work out, but I appreciate the recommendation

Does anyone know what color scheme is this?

make them protected?

node is the kind of thing they teach at meme bootcamps
are you sure you looked?

Yes, for several weeks straight it was all I focused on.

If you've already written a lot of ruby then stick with ruby. Otherwise you'll just keep rewriting code because you're never going to find the One True Language to write all your code in.

To clarify: I don't go to meme bootcamps, whatever those are. I don't go to training seminars or attend a university or anything like that. Everything I've learned so far has been through online resources, most of them free

Sounds true to me. Thanks, ruby it is

have you tried doing the same in C? you'd be surprised...

C# + Servicestack (v3) + Razor. Use mono & hyperfastcgi + nginx to host. Shit runs

I don't like getting surprised. Better tell me the outcome.

vim + emmet + YouCompleteMe

This guy understands

i was not accusing you of such a horrible thing. i'm just saying that a full js "stack" is what they teach at these coding camps like fullstack that are intended for people who want to make a total career change. they know nothing going in for the most part. i can't imagine the instructors are that good

i played around with node for about a week and while javascript is still awful the amount of excitement around node means that there's a ton of stuff to read. what kinds of things were hard to find?

This.

Could even use something like Serenity for a robust starting template.

this one: stackoverflow.com/a/5249129 takes >2µs in my machine, and this one stackoverflow.com/a/5249028 takes 1µs (although there isn't a way to measure it in ns)

Fact:

If you want to write a open source code, you should not use anything other than C or Python.

That's not an argument.

t. Stefan

>a open source code
Come back when you can write a English.

C++ is fine too

>although there isn't a way to measure it in ns
Are you meming me? clock_gettime takes 30ns on my machine.

Getting a bit exotic now.

>should
>fact

I meant with timeval
of course there are ways in C to get time in ns...

What is your point?

point it, Go is higher level than C, C code probably calls asm functions directly, while Go probably tries to do some magic

in any case, it's "good enough" for what Go programmers would expect... and if it's not good for you, then patches are welcome, as usual

>C code probably calls asm functions directly, while Go probably tries to do some magic
You're not even wrong.

What would best language for time travel be?

B

show me your program
clock_gettime() takes > 900 ns in my machine...

>GLEW is ridiculously hard to compile
what do you mean? right now I'm using GLEW + GLM + SDL2 and I haven't had much trouble setting things up on linux. tho I would like to get down to just SDL2 for autism reasons

#include

int main(void)
{
struct timespec t;
for (long i = 0; i < 100000000; i++) {
clock_gettime(CLOCK_MONOTONIC, &t);
}
}

$ time ./a.out
3s

3000000000 / 100000000 = 30

TFW started learning C# yesterday, is it okay if I post solutions to my lame ass tasks and ask if they are fine?

Another week and you'll be teaching /dpt/.

Dynamic 2d arrays in C++. Wont work for some reason.

as long as it is a completed solution and not "help me solve this", I will allow it

I'm relieving you of duty.

Should I read "The UNIX programming environment" in addition to K&R?
Or maybe some other book that's more recent?

inner for loop should be x < sizeVer
should be 'o' instead of "o"

You should read the manual.

idiot here. learning web development for a class I'm taking this semester. using lamp server at home to develop my PHP.

i'm connecting to local mysql server in PHP. is it okay to have my password in plaintext right there in the source code?

if not, what can I do here?

bell-labs.com/usr/dmr/www/1stEdman.html
?

>is it okay to have my password in plaintext right there in the source code?
usually yeah, just be sure as fuck there's no way to see the source code from the public website.

Description
I just want to ask if there is anything I can improve (that is not too advanced for now of course). Also is this even a good place to ask ?

Write a program that prints the first 10 members of the sequence: 2, -3, 4, -5, 6, -7, ...


using System;

namespace PrintSequence
{
class Program
{
static void Main()
{
for (int n = 2; n

man7.org/linux/man-pages/index.html

What's faster to execute in c++?
x!=0

or
x>0

Do you see other errors? The help is greatly appreciated.

There is so much wrong with this post.

this two are so so different.

Alright, thank you.

Don't really know C# but...

using System;

namespace PrintSequence
{
class Program
{
static void Main()
{
for (int n = 2; n

Depends on target architecture.

x86 has jnz instruction which lets you do !=0, but no instruction that lets you do >0 without having to set another register to zero first for use as the comparand. I can't remember if x86 has a specialized zero register, I know ARM does.

It's easy on Linux, sure, but I need cross-platform compatibility. The second you add Windows to the equation, you get headaches, no matter what compiler you use. Some of the code cannot be compiled on MSVC due to its poor standards support, and MSVC+GCC don't mix. Try compiling GLEW with MinGW in Windows and I guarantee you want to get rid of it too. It can be compiled with MinGW, but you'll be scratching your head for a long time while you're trying to find the correct combination of command line arguments and switches. None of the existing makefiles work.

Then there was the whole issue with GLEW not supporting the OpenGL core profile. There was a hack around it, but I never got it working. GLEW 2.0 supposedly fixes it, but I couldn't be bothered with it. With glLoadGen there are no issues at all. It just works.

I fiddled with this awhile ago, the most accurate timer for me (OSX) was mach_absolute_time.

well...my professor wants us to eventually put our scripts and files on the school web server, and part of each "assignment" involves showing the full source code on some web page. (my password obviously is going to be different there).

I just don't feel right about ever having my password right there in plaintext.

They are the same if all your numbers are unsigned, which is faster to execute by the machine?

I'll use != then.

why are BA computer science majors so genuinely retarded

If you know it's non-negative they're the same. That's not that rare.

Do you mean BS/BSc?

Where I'm from only elite universities offer BA Computer Science.

It doesn't matter. They are both the same.

Yeah, i find this weird too, but SQL passwords are often put directly into code. Sometimes I see more effort put into hiding them though. Ultimately just make sure the password can't be discovered from the public website and it's fine.

I'm not sure how you're implementing your strings, but shouldn't it be something like
>board[i] = new string
>board[i].resize(sizeVer)

i'm from a shithole university and we offer a BA in cs. the people who take it are the type of people who think they're going to be a billionaire from an app, so that's what they all do. every BA i talk to wants to go into app development

uh, yeah, it takes quite more than that in my system. can you try running ?

Range(2, 10).ForEach(x => WriteLine(x % 2 == 0 ? x : -x));

230ns
Took 332.747µs.

What system are you using?

does enterprise development have a term?

I don't to go into web development, or game development, or mobile development, or embedded / systems

Honestly I picture myself working with Java EE or something.

What country? I'm from the UK, I think only Oxbridge let you do a BA in CS there and they are very selective.

take a look at godbolt.org/g/6OgQjF you can see if any targets produce different instructions.

Internal applications developer.
Business-line application developer.
Product specialist, maybe.

Stop confusing people with such nonsense.

linux / AMD cpu.
apparently, the problem is that I'm passing "clocksource=hpet" (because of some old bug I had in my system...), which is slower than TSC

Not sure if .resize exists in C++ - am currently learning to expand 2d arrays manually. I have got the program working in regular arrays.

It's called realloc.

I want to get into game development. Are Accelerated C++ and Game Engine Architecture the best books to buy?

Thank you!

>I'm passing
*to the kernel...

guess Go isn't THAT bad anyway... is it?

Only 800% slower than C.

Is only guaranteed to work on objects/arrays created by malloc.

how do i go about using a database in android? my group decided on mongoDB. this is for a class, and what we're doing is trying to convert information from peoples google calendar into a database, and then compare people's availability in the database to see when a meeting time b/t the two should be. we're accomplishing fuckall because none of us know what we're doing and no one but me is willing to admit we don't know

>start using C++
>now you've two incompatible allocators
>stop using C++

>mongoDB
Why the fuck are you using a DB for this at all?

stop falling for the memes and use postgres

Blame Bjarne.

>Only 800% slower
what the hell does that mean?

>than C.
you mean syscall in inline asm... of course nothing beats that, but that's not exactly "C"

C is what happens when conservatives are in charge.
C++ is the product of progressive governance.

This is why I support the right wing candidate.

we're trying to create an app where multiple users can upload their calendar, and then the app will output a list of meeting times. how else would we do it?

Switch to a relational database.

>you mean syscall in inline asm... of course nothing beats that, but that's not exactly "C"
Here's the secret: clock_gettime does not perform a syscall.

Folks, we're gonna make programming great again.

We're going to build a firewall - and Russia's going to pay for it!

ok, how do i use that? do we need to pay for the server costs or something? i have genuinely zero clue how to do any of this. there's 2 guys in our group that are currently taking databases and they know nothing either

There are multiple free relational databases, such as PostgreSQL, MySQL, and MariaDB.

To keep it simple, your application has two main components: the server and the client.

The client allows the user to upload data representing their calendar. The server simply stores this data.

The client looks at the data in the server, and makes a decision as to when everyone has a free time-slot.

Your first step should be figuring out how to access a Google calendar via an API, when given access.

Your second step is to take two calendars and create the logic that compares them for free time-slots.

Next, figure out how to store calendar information in a database, and determine how often the information will be refreshed.

Finally, put all these components together into a GUI available on the operating systems of your choice.

...

MPGA! MPGA!

i know all of this, i don't need a high level overview. i already did that for the team. the issue is none of us know how to implement any of this. i'll just buy an android development book

>testing garbage collection
>not allocating anything on the heap

>coming to /dpt/ for anything but shitposting and autistic microoptimizations
hmm

There is no web dev thread so i will ask here
in Layouts of getmdl.io/components/index.html

How do they do pic related?, i literally copied and pasted it and the title overlaps the drawer icon how the fuck do i fix this

If there's no then make one.

Variable and function names aren't descriptive. Comment is total shit. At least you use platform independent sized integer types and don't invoke UB 1.5/10.

Then you need to ask more specific questions.

Even a question like "How do I host a database accessible by clients over the internet?" is a massive subject involving hundreds of considerations.

Yes, you need somewhere to host the database that is externally accessible. This machine, virtual machine, or cloud storage option needs to be always-online, firewall configurations, a domain name or static IP, etc. etc.

"how do I go about using a database in android?" is such a broad question that you're not going to get a good answer.

nevermind fixd :^)

How about its efficiency and speed? I tried hard to avoid recursion and heap allocation.

>in job interview
>say SQL Ess Queue Ell
>interviewer mocks me

At least now you know for the future to pronounce it like sequel.

I would too, but it's understandable if you've never worked with it.

Most people do pronounce it "sequel", mostly because that's what the original name was, and was only changed due to trademark(copyright?) infringement.

...

>tfw try c
>now can't stand languages who don't use brackets

it just looks naked

>Here's the secret: clock_gettime does not perform a syscall.
ah, right, it executes the RDTSC instruction... still, not really "C"

btw, I just found this: github.com/golang/go/issues/8976
>The TSC counter is not monotonic unless your process is pinned to a CPU core.
so yeah, don't use that if you want to build a multi-core program

Why do you name all of your pictures 'anal beads'?

...

what kind of fucking autist shit company teases their potential employee?

must suck to be a programmer.

Half of tech interviews are done by devs who just want to stroke their ego.

Anal beads are Pajeetslayer's weapon of choice.

shart in mart

None of this makes any sense.

You don't make any sense.

if you like your blocks to be even less naked, try Pascal!

>!

b-baka

>ah, right, it executes the RDTSC instruction.
No. It calls the vdso. No assembly is involved.

>meme doesn't make sense
how convenient for the designated shart marter

...

original

what does it mean when something happens every 2 weeks, ever 3 weeks, every k weeks?

Im doing this for a problem.

Nigel Farage has let himself go.

The action occurs on a weekly basis.

Herr Farage

bi-weekly, tri-weekly, k-weekly.

i still don't understand

does bi weekly mean I do it in a week, then wait two weeks, and then do it in the following week, and rinse & repeat?

does k weekly mean mean I do it in a a week, wait k weeks, and do it again?

This entire book is fucking gold: The Computer Contradictionary

bi-weekly can either mean "every two weeks" or "twice a week".

You would preface any measure of time with the greek numeric prefix (e.g. 3 = tri, 10 = deca, etc.)

for my problem, I'm sure its the every k weeks not k times a week

Are you trying to name a function or what?

Just say "every k weeks".

>"twice a week".

No, it can't. Something that occurs more than once in a week is semi-weekly.

class Node(object):
def __init__(self, value, next, prev, up, down):
self.value = value
self.next = next
self.prev = prev
self.up = up
self.down = down
def __str__(self):
return str(self.value)

def level_insert(self, value):
current = self
next = None
while current:
if current.down:
next = current.down
if current.next is None:
current.next = Node(value, None, current, None, None)
return next, current.next
if current.value = value:
temp = current.next
new = Node(value, current.next, current, None, None)
temp.prev = new
current.next = new
return next, new
current = current.next
return

PDF pls.

class Skip_list(object):
def __init__(self):
self.root = Node(-infinity, None, None, None, None)
self.levels = 1
def find(self, value):
current = self.root
levels = self.levels
prev = None
while levels>0:
if current is None:
current = prev.down
levels -= 1
elif value > current.value:
prev = current
current = current.next
elif value < current.value:
current = prev.down
levels -= 1
else:
return current
return
def insert(self, value):
ctr = 1
while randint(0,1) != 0:
ctr += 1
while ctr>self.levels:
self.root.up = Node(-infinity, None, None, None, self.root)
self.root = self.root.up
self.levels += 1
temp = self.levels
current = self.root
prev = None
while ctr:
if temp

While technically, this is true, bi-weekly is often used interchangeably, while semi-weekly is clear that it's twice a week.

How about bi-annual vs semi-annual? Those are also often used interchangeably.

How would you say that something occurs 3-times a week? Tri-weekly is often used for this, and would also refute your assertion.

Can't find one, let me know if you do.

>No, it can't. Something that occurs more than once in a week is semi-weekly.

Bi- can mean "two" and "twice", which is why tri is ambiguous as well.

Semi- does always mean "half", but Bi- can be either.

People use that way so deal with it.

>allowing the the user a limited quota of GOTOs according to age and experience

where the constant infinity is just some large number

didnt feel like making a class and overloading comparisons

it's relatively slow on inserts, but fast on deletes and searches, but it's all lg(n)

r8

How do you use version control with multiple systems?
For instance you have a laptop and a desktop, on your desktop you make some changes, then on your laptop you make those same changes and then some, then you commit and push to a remote, and you want to come home to your desktop and pull those changes down without regard for whatever bullshit changes you made this morning, but when you 'git pull' it gives you all the fast-forwarding baloney.
What do?

What the fuck are you guys talking about? Just fire up a LAMP stack and use PHP.

And why not JS? Because JS is used on the front-end, you probably would want to talk with a database in order to save user data.

OA, your question is also incredibly vague.
Fuck off.

Why are you doing this?

What is the point?

Ask a dude who's currently enrolled in a 3 grand 3 month bootcamp anything.

a.desu.sh/mqksfs.pdf

Why, when you could have used free online resources instead?

skip list is easier to implement than a red black tree and much easier than AVL in terms of code and you dont have to remember autistic rotations, it's all very logical

why not know a data structure for lg(n) operations that's easy to write

Top lad. Thanks.

Because dynamic typing is disgusting and only suitable for newbies.

Assuming your remote is named origin and your branch is named master:
>git fetch --all
>git rebase origin/master
then follow the instructions that git gives you.

What project are you using it for?

What is the end-product that you'll make money off of or contribute to the open-source community?

whatthefuck am I reading

I love that pic m8, so oldskoool

This link doesn't work for me :(

>paying any amount of money to learn webshit
I can't think of a worse financial investment. You could just buy scale anime figs and still have a better overall financial return.

Which of these books are worth reading?

I want to learn how to program software for video games and for apps and any other various things I'd like to make.

Obviously, I don't really know where to start. I started learning Python a little but I don't really understand what I'm working towards. I feel like I'm being handed tools but not being told what they are for (besides making a calculator. Which is cool but not quite what I need)

Where can I start? How did you all learn?

yes

I started with Java, but I didn't actually start building useful things until I switched to C# (easy GUI creation).

I'm sure that something like Python would work out well for that. The hardest part is defining the end-goal of a project and breaking it down into small parts.

So, I want to get started with some small static webpages. I noticed a lot of plugins and small utilities, such as one of the apparently better HTML minifiers, are done with ruby or js or something. Basically stuff I'm not really used to working with and I don't want to clutter my work and server environments with all these language binaries and their package managers. Hell I already felt a little dirty just installing python and pip to handle some webhooks.

Do I just swallow the bullet or should I just find a way to live without them? Is it just a fact of life; I've noticed even vim plugins requiring installation via npm. The stuff I'm working on right now doesn't require js/ruby and the like so I don't want it to be an example of premature optimization (on the other hand, I may be exhibiting premature optimization by being unwilling to install packages I may or may not need).

None. Read the C standard.

why not? whats the error?

Rewrite in C.

how does a C++ map work i forget

if i add the data [1,2,3] specifically in this order

is map.begin 1, or is it 3

So you recommend any "beginner projects" for early coding? I learn better, I think, when I have a task and have to figure out how to accomplish it but I don't want to get myself in over my head at first and get burnt out on learning

what, this whole thing is just a little script
working on a project doesnt mean you can't write a little script

if you think it's a waste of time, well, that's you

>no C Interfaces and Implementations

>@return d on success, -1 on failure

good, but, this is a bit more "proper" for some people

enum dummyStatus { STATUS_OK, STATUS_BAD }.

dummyStatus f(uint8_t input, uint64_t &output)

//instead of return d
output = d;
return STATUS_OK

fucking beginnerrs, fuck off to stackoverflow or wherever, the internet is full of resources, fuck off with your spoonfeeding entitlement

"no"

pleb

your the pleb

"no"

on the other hand dpt only suggests either well known shit like sicp which is good for beginnres

or some braindead "kode 101" tier books
or
just write a gaaaeaeaem maaan, just write anything maaan, it'll come to you

I'm telling you to read the C standard. It's only a few pages and teaches you everything you need to know.

>teaches you everything you need to know.
teaches how to do taxes?
teaches how to pick up girls?
teaches how to kill myself?

iterating over the elements of a map gives unspecified order, depending on the underlying implementation.

basically, if you care about the order of the iterated elements, don't use a map

How do I stop lurking on this imageboard and start being productive?

>teaches how to pick up girls?
Especially this one.

1.im not the guy asking for advice up above
2.your advice is fucking retarded

>iterating over the elements of a map gives unspecified order

well that doesnt make sense, its working fine on my end.

tldr a device sends a packet every second, and the software saves it to memory as basically [timestamp, data]

if i iterate through the map, everything shows in order.

ill just fuck with this some more i guess.

Here is a task for you.

Research graphic and user input libraries for your chosen language and target system. Many standard libraries don't have graphics and io suitable for games. (I'm looking at you, C/C++). This means you have to interact directly with you operating system api, or use a third party lib that does that for you.

Where do you think you are?

>the internet is full of resources
And we're one of them. Don't like it? GTFO.

>games
gaaaaaaaaaeeeeeeeeeeeeaaeeeaeeaeaaeeaeaems man

>I'm looking at you
:S
xDDD

He just said it was implementation specific.

You're an aspiring programmer. You don't need to know how to pick up girls.

Alternative link here:
(I just reuploaded it.)

filescdn.com/q0ijkq0x5drj

Thanks I'll do that. I appreciate your help hombre

See that little X in the corner of your browser window? Click that.

Delete your account.

Go home user. You're drunk.

>You're drunk.
It's frigday night, your nor?

>the number of software bugs found in the tests of program units developed by programmers is dependent on the average number of sleeping hours of the programmers

>I appreciate your help hombre
Oh, you'll change that tune soon enough.

dude dude check it out dude
whats up dude
im making a gaaeaeeaeaeaaeeaeam dude
dude thats so AWESOME, youre making a gaaeaeaeaeaeaaaeaeaeme, dude

So I clicked the little "X" in the corner but somehow I managed to find myself here again

shutdap nigger

You make a point. It's friday night. Why are we sitting at home lurking Cred Forums?

Rewriting a flash app into javascript.

The JS library is built on dojo, so I have to learn dojo. It's not making a lot of sense, and I can't stop typing dogo instead of dojo.

It really makes me think about the difference between "I need this to work" and "I need to understand how this works"

Does anyone here use dogo?

child trauma
doing stuff on my computer, programming among them, helps me forget

>Why are we sitting at home lurking Cred Forums?
Why not, Cred Forums, a bottle of whiskey, good times.

Yeah, I use updogo all the time

story pls

>Cred Forums, a bottle of whiskey,
Waste of a good bottle of whiskey, if you ask me.

>bottle of whiskey
Meh. Don't burn your neurons like that.

>quads of prosperity and good health

you've heard it, just wasn't posted by me to you

Starting on C. Simple program to reverse user input, not sure why it isn't working. I think it should be simple but I have been looking at it for too long.

#include
#define LINELIMIT 1000

main() {
char c, input[LINELIMIT], reversed[LINELIMIT];
int i, j, str_length;

for (i = 0 ; ((c=getchar()) != EOF); ++i) {
input[i] = c;
}
input[i] = '\0';

str_length = i;

for (j = 0; j < str_length; ++j) {
reversed[j] = input[i];
--i;
}
reversed[j] = '\0';

printf("%s", reversed);
return 0;
}

whats updogo? :^)

You're an advanced case.

Here's what you do: Go out, find a whore, bring her back to your place and pay her to kick you in the nuts every time you go on Cred Forums.

because your reversed string starts with a null byte

I'm drunk and am programming an toilet's IoT botnet ',:)

I have no reason to believe that there is a better way, but is it good or bad practice to send a shitload of parameters to a method if said method requires them and none are implicit?
I.E. for starting a threaded webcrawler, here's the constructor
CrawlWorker(String threadName, SimpleTrie urlTrie, String url, int maxDepth, int maxBreadth, boolean sidedness, boolean verbose, boolean backCrawl, String crawlerBounds, float courtesyDelay){
//constructor code here
}

so you can literally shit post over the entire world

i like it

Damn I'm like "I thought I understood programming what's fork"

>it isn't working
be more specific

Also, would it be better to instead send an Object[] for said parameters?

wewewew lad
i dont see any other way, it's clunky, but itll work

you could grab a three legged chair and some rope, alternatively

>what's fork

linux.die.net/man/2/fork

>i dont see any other way, it's clunky, but itll work
gorramit
At least this isn't as bad as when I was doing webdev and I had to pass parameters to the database manager, because that looked like this
DBEntry(String name, int id, int id2, char[] password, Date entryDate, Date expiryDate, String address, float balance, char type, String publicKey......)

Try builder pattern.

keep a master & develop branch.

when starting a new feature, checkout a new branch from develop

git checkout develop
git checkout -b 754-fix-something

commit to your branch often, occasionally, rebase against develop:

git fetch
git rebase origin/develop

When you're done, squash your commits and push the branch:

git rebase -i origin/develop
git push

On merging computer:

git checkout develop
git pull
git merge origin/754-fix-something
git push

So my life is a lie...

NEW THREAD!

What? Again? How fast is Cred Forums anyway?

why not port it to haxe, and compile that to JS?

Because there is nothing of value worth saving. It really needs a complete rewrite.

What a weird coincidence. I just came back to the thread and someone posts a reply.

it took my sleep deprived brain a few more reads of it to grasp it.

so the idea is git fetch (in folder containing feature, and fetch the latest version of the feature fork)

then rebase so that when you finally merge the feature into development branch, you don't get as many conflicts... right?

I'm actually learning things on 4chin, wow

hi im doggo, please pay before use