What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
store.xkcd.com
ee.ryerson.ca
jmarshall.com
pastebin.com
twitter.com
I'm learning Go.
But not the language, I have some self-respect.
For you my dear.
Please don't use an anime picture next time.
QUICK
claim your programming waifu before some faggot nodev kidnaps her
>said on vietnamese cardboard forum
fuck you
The Evangelion pics are a nice change desu.
>Le olde pakistani cookie baking website argument
You fags had a different reaction before GR15. But I don't see why, after all it's just like your chinese cartoons.
Kill yourself, fuck stain.
like I said
>fuck you
>What are you working on, Sup Forums?
What a strange question to ask at the beginning of /dpt/ - General/Blog Thread
Are you guys going to support our favorite comic writer?
I just ordered one for Cyber Monday!
There's literally nothing wrong with liking XKCD
post a screen shot of the last code you wrote
Learning how to work in Android Studio. My engineering thesis is application for Android. Do any of you knows good tutorial for this shit? I have two weeks to make it and Google's tutorial is meh.
Get raped and kill yourself, you retarded fucking faggot sack of nigger shit with down syndrome.
not sure if false flag or desperate shill
what does the app need to do? tells us more
i heard this book is good
You don't know what either of those two things are, do you?
>the last code you wrote
I've been deleting someone else's code. Does that count?
yes i do
if you're unironically an xkcd fanboy then kindly fuck off to reddit or the xkcd forum or someshit
why?
is it inefficient or just shitty code?
Sorry I disturbed your safe space >:^^))))
It should allow to create events similar to Facebook's, but about cultural events. Photos, comments, integration with Google Maps and Google Calendar and logging system. Except that nothing more really. I need something that will introduce me easily into making GUI, show me how to use server with Android application and use these things I listed above.
>unironically using a "Sup Forums-esque" filename generator
you're literally randall and shilling your shitty site and merchandise, you should find something better to do
I can't decide whether to create a new class or not.
I currently have a
>Slider class
>MapSetUp class
I could make the x and y scroll bars move the map in the Slider class, or i could make them move the map in the MapSetUp class
But I feel that it would make the Slider class a little messy, and I would have to update the class name of MapSetUp to MapMove, or something.
Or I could create a separate class that's solely for making the map move when the bars are scrolled.
What do? There is no clear way to do this.
>not having 4chanx
>not enabling randomized filenames
>not securing your file names so you don't tell other people when you made the screenshot
shiggy
Or, I could take the camera logic out of the PlayScreen class, and put it in a class of its own, and have the scrolling logic in there, as I'm actually moving the camera, rather than the map. But I need the variables from all of the classes to achieve this.
>tfw to smart too explain things to dumb people
sounds an interesting project.
> integration with Google Maps and Google Calendar
i think this is just using the google maps and Calendar API
>logging system
this is the easiest
In android studio you can create the buttons of the application inside the IDE
Is there some kind of C GUI library that works in mobile and pc alternatively C++ library that exports C api?
You and your entire family tree deserve to be gassed.
define the mobile OS and the pc OS
linux, windows, android
>want to be haxxor (ethical, not the cringe kind)
>have no idea how networks operate (I know of TCP/IP and HTTP, but don't know what they are
>have a basic understanding of operating systems but still don't know how they work in depth
>no idea where to begin in learning about networks and operating systems
Where do I start? I was suggested two books by Tanenbaum, but they seem very very intensive.
here's a simple HTTP reference
jmarshall.com
for TCP and stuff similar to TCP google and stackoverflow are your friends
a more indepth idea of how it all works can come next if you feel like reading many IETF RFCs
Can you ever go overboard with OOP?
I can't tell what I should do in my current situation.
I could create 2 more classes, or I could put my logic in a pre-existing class.
Either way it will all be similar readability and performance.
What do?
I'll help you decide with the last two digits of my post
=50 you put more logic
Thanks user
>>want to be haxxor (ethical, not the cringe kind)
>want to be haxxor (ethical, not the cringe kind)
Unless you're making money or doing something funny, it is all cringe.
Doing it your way made me notice a bunch of inefficient code, this class is now orders or magnitude better.
You da best
>muh data structures
>muh algorithms
>Can you ever go overboard with OOP?
yes
>What do?
Do whatever is more readable and maintainable.
*Even if you are making money or doing something "funny"
>is it inefficient or just shitty code?
It's Java. I'm making the world a better place for unicorns and rainbows.
Well I guess that since he used the word haxxor, just 4 words into his hacking career, he has already failed at not being cringy.
>is it inefficient or just shitty code?
everything i write is inefficient AND shitty
What is your favorite thing for interacting with databases and why is it SQLite?
Anybody know how I'd access a base class container like this:
class Derived : public std::vector {
//code here
}
I'm trying to display the objects in said container but I don't know how to approach it.
Literally just call yourself, you're the vector.
for (auto&& e : *this) {
// Do something with each element
}
Why the fuck are you inheriting from a standard container?
Ikr? It's what the exercise called for though, so I need to find a way to work with it. I guess they call for it because it's technically a more concise way of handling a container of this particular class in this specific scenerio...?
God, thanks! Looks like I need to refresh my knowledge of how derived classe operate though, I don't comepletely understand why this statement works yet (just generally).
>intermediate programming next semester
>syllabus not released yet, not sure what book this instructor will use (cant tell from past courses either)
Want to get ahead on learning C, I know most people say K&R, but I also hear about C99 and the book not including modern best practices when using C and programming in a secure way?
What otherway (or specific book) would you guys recommend for C?
Is there any language that enforces purity, but doesn't rape you with its type system?
Hey /dpt/
any suggestions on how I should name each leaf/entry from this structure?
Adding Nov-Date-Year seems redundant
what do you suggest?
Entries/
└── 2016
└── November
├── Entry-Nov-08-16-1917.txt
├── Entry-Nov-09-16-0800.txt
├── Entry-Nov-09-16-2123.txt
├── Entry-Nov-10-16-1208.txt
├── Entry-Nov-11-16-2153.txt
├── Entry-Nov-12-16-0831.txt
├── Entry-Nov-13-16-1816.txt
├── Entry-Nov-13-16-2312.txt
├── Entry-Nov-21-16-1209.txt
├── Entry-Nov-21-16-2109.txt
├── Entry-Nov-23-16-0030.txt
├── Entry-Nov-23-16-1252.txt
├── Entry-Nov-25-16-1433.txt
├── Entry-Nov-25-16-1650.txt
├── Entry-Nov-25-16-1851.txt
├── Entry-Nov-25-16-1928.txt
├── Entry-Nov-25-16-2013.txt
├── Entry-Nov-25-16-2036.txt
├── Entry-Nov-25-16-2129.txt
├── Entry-Nov-25-16-2149.txt
├── Entry-Nov-26-16-0803.txt
├── Entry-Nov-26-16-0845.txt
├── Entry-Nov-26-16-1829.txt
├── Entry-Nov-26-16-1839.txt
├── Entry-Nov-26-16-1842.txt
├── Entry-Nov-27-16-0700.txt
├── Entry-Nov-27-16-0901.txt
├── Entry-Nov-27-16-0948.txt
├── Entry-Nov-27-16-2017.txt
├── Entry-Nov-27-16-2022.txt
├── Entry-Nov-28-16-0418.txt
├── Entry-Nov-28-16-1655.txt
├── Entry-Nov-28-16-1744.txt
└── Entry-Nov-28-16-1802.txt
Just name them with the date of the month?
I am back with more problems. when I run the program it prints m as being 15 and never changing, do you guys have any ideas?
So.. Entry-date-HH-MM.txt
>i+6
And I told you to get a better color scheme
The answer is yes but it depends.
If the functionality that you're adding is related to an existing class then add logic to whatever class is most appropriate. If it's unrelated to an existing class and the functionally you're adding would benefit from being a class then make more classes.
Something like that, I'm not sure if I'm explaining it well or if I'm missing something
Pick one. You'll get used to it.
>I also hear about C99
You can pick up on most C99/C11 features pretty quickly by just reading the wikipedia articles and maybe a few blog posts.
The only thing that K&R does that isn't "allowed" in later standards (but most compilers will still accept with warnings) is implicit int.
They will do things like main()
but just slap 'int' on the front and it's conforming: int main()
>modern best practices
I'm not really sure what you mean by this. I don't believe there is any code is K&R that is broken, unless there is an example which uses gets().
>programming in a secure way
It depends how 'secure' you want.
Program should run correctly with any reasonable input?
100% certain that it will work and lives are at risk?
The way you would write for both of those are quite different.
Haskell
also are you calling less_than_10_blah with the games[N_OF_GAMES] element and not the actual array? (should be the actual array)
sounds neat
I want more details on what you're tagging
it's worth mentioning the 2016-12-31 date format
and do you need to sort everything into seperate month or year folders?
>day, month and year are different variables
I strongly believe you could pack them in one variable
Yea i forgot to insert the = it works now, thank you.
that for loop is disgusting.
nobody starts out perfect
I'm thinking for long-term organization.
The year/month/entry-date schema allows me go through entries without relying on a script to organize/sort entries and its human-readable too.
I can't pick one if I don't see one.
Meh. I know that Haskell is good, but it is also alien and hard.
What I want is basically JS with optional types, promoted immutability and enforced purity. JS+Flow provides a decent type system, but misses two other requirements. Haskell/PureScript are not approachable for newcomers, thus they are not perfect for collaboration.
Which of them lol, how are they disgusting how would you write them?
Wouldn't I have to save it as a string instead then, right now they are 3 ints. Later on in the assignment I have to retrieve the scores in a certain year, while both day and month aren't really needed.
I mean you get to pick one of "enforces purity" and "doesn't rape you".
Secure as in, not easily exploited in real world applications, I think. Again, I don't know C, so I'll just remember you menioning implicit int, and gets().
So you think K&R is totally a good way to learn C? Definitely the first go to book?
>int *number_of_rounds_with_less_than_ten_goals
Jesus christ, you don't need to use an entire sentence for a variable name.
it's translated danish
Haskell infers almost any regular code, you won't need to write types 99% of the time
I'm gonna change them when I am done, it's so I remember wtf I am doing, I am to lazy to write comments, but I guess I might aswell when my variables are entire sentences.
You don't have to defend me dude, he is absolutely correct.
Baww. Why can we have optional types, but can't have other functional features without BDSM-tier typechecker? ;_;
I know it. I know Haskell and PS. That doesn't make them easy languages. They are often counter-intuitive unless you've spent a couple of years using them.
What's the difficulty?
>Secure as in, not easily exploited in real world applications
Worry about that after you get a bit better with the language, but programming in C well amounts to:
- Handling pointers well
- Handling allocations properly
- Handling null-terminated strings properly
- Checking inputs
>So you think K&R is totally a good way to learn C?
Yes, it's still a very good book. There are quite a few quality of life features added in C99 that K&R won't cover, but again, it's something you can pick up on really quickly.
>Definitely the first go to book?
For someone with some experience with programming, probably yes.
For someone completely new to programming, no. K&R doesn't cover programming fundamentals, just C itself.
Other books I've heard good things about (but haven't read myself) are:
- C Programming: A Modern Approach
- C Primer Plus
>I want more details on what you're tagging
So I started keeping a journal of flat text files to document my day and progress. After about 5 entries, I got the autistic need to have some organization. The journal text files are stored in an crypt disk, so there's no munging of the actual text files themselves.
The first line of txt file can include a tags: line with a comma separated tags. It helps categorize the entries in a sea of entries.
I created four scripts to manage to create, browse, read, and sort entries, if you care.
Just change ENTRIES_LOC to a specified folder that holds your journal entries, preferably in an encrypted disk.
new_entry
#! /bin/bash
ENTRIES_LOC="/media/secrets/journal/Entries"
YrMo="$( date +%Y)/$( date +%B )"
mkdir -p $ENTRIES_LOC/$YrMo
file=$(date +"Entry-%d-%H%M.txt")
vim $ENTRIES_LOC/$YrMo/$file
browse_entries (requires noice or ranger)
#! /bin/bash
ENTRIES_LOC="/media/secrets/journal/Entries"
noice $ENTRIES_LOC
read_entries
#! /bin/bash
ENTRIES_LOC="/media/secrets/journal/Entries"
tmpf="tmpcat.txt"
touch $tmpf
shopt -s globstar
# Specify -r to start from the first entry
if [[ -n "$1" && "$1" == "-r" ]]; then
command=`ls $ENTRIES_LOC/**/*.txt`
else
command=`ls -r $ENTRIES_LOC/**/*.txt`
fi
for i in $command; do
#for i in `ls -r $ENTRIES_LOC/**/*.txt`; do
echo -e "\n" >> $tmpf
echo -e '\E[37;44m'"\033[1mOn $(date -r $i +%c):\033[0m" >> $tmpf
# no color
#echo "On $(date -r $i +%c):" >> $tmpf
echo -e "\n" >> $tmpf
cat $i >> $tmpf
done
less -R $tmpf
rm $tmpf
sort_entries (python, too long) lets me classify entries based on tags.
thanks sir
Best editor?
The main difficulty is:
When someone sees JS, Java or even OCaml, he can just write the code. All hee needs is an editor and documentation. Attracting contributors/hiring developers is trivial.
When someone sees Haskell/PS, he can not just open a file and write a function. He first needs to understand what does "do" mean and how it is desugared. Then he has to learn typeclass hierarchy, monad laws, cryptic operators etc.
20 years of "avoiding success at all costs" clearly shows that Haskell is not really good for most of the people.
...
ed
The one you like.
If you have no preferences, jump the Atom bandwagon.
Atom with Google Analytics integrated
I had a trouble with K&R's exercises and really liked K.N. King's C Programming: A Modern Approach. Great textbook IMO.
yep, this is the problem with meme langugaes in general. It's all well and good until you need to hire someone to work on your code base, and fuck all people know the langugae except neckbeards who can demand high salaries.
This isn't true at all.
Do does exactly what's intuitive
x
if you care,
here's my python sort_entries which lets you read entries with the specified tags
use it like
sort_entries -l # list all tags
sort_entries -t love, life, dream -r # list an entry with the specified tags and show the latest one first
its hacky, but its a personal journal app that I don't expect anyone to see (until now)
Fuck, got it to work mostly because of this. Fucking love you so much right now user
You're welcome, happy to help.
>in general
Nah, in general it's not a big trouble. Even if you're working with some rare and weird dialect of good old Algol/C/Pascal/Java/Basic/whatever else, then there is no real problem. Any decent programmer can learn new syntax and function names.
The problem arises when you're using something _alien_. That's why I want to avoid Haskell. But it taught me how useful controlled side-effects are, so I want to keep the good stuff ;_;
Yeah, yeah, it's all intuitive on the kindergarten level. Just like math, where apple + apple is two apples. But eventually you face differential equations and other trivial stuff that scares normal people.
Can you teach a person what's the purpose of , , concatMap, bind, pure and all the other stuff that's required for trivial applications within one day? I really doubt it.
>required for trivial applications
nope
you can just avoid other monads if you really care
>The problem arises when you're using something _alien_.
Every langugae has something weird. Even a Java programmer learning C# will take a long time getting used to the conventions of C# and learning what patterns that are good in Java are poor in C#.
It's easy to start writing pajeet their code in a new langugae by literally just learning the syntax, but learning how to write good code in the that langugae takes quite awhile.
Go is a really good example of this.