/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 70202726_p0.png (1168x965, 1.39M)

Other urls found in this thread:

doc.qt.io/qt-5/all-examples.html
github.com/newnone/Ffetcher.
practicepython.org/solution/2014/07/25/13-fibonacci-solutions.html
twitter.com/SFWRedditImages

I challenge you to make a caesar cypher in your favourite language

I did a Vigenère cypher in c++

are you proud of me Anone~ ?

>C++
please don't reply to my posts

:thinking:
kek virgin

trying to learn emacs to do Clojure... I gave up and installed spacemacs which is a bit easier

Working with JavaScript is nice!

Attached: a4c58578ef8bab1deab8cf105af40d04.jpg (449x800, 61K)

Why do you keep posting those fucking creepy dolls?

because that's something someone the likes js would do

What's the best C learning source?

The C Programming Language written by Brian Kerninghan and Dennis Ritchie

The C Programming Language by Dennis Ritchie. It has some good exercises in it. You may struggle though if it's your first language.

fuck you. I am the one helping here buddy not you.

no fuck YOU you forgot Brian's name when you recommended The C Programming Language written by Brian Kerninghan and Dennis Ritchie

I want to help too.
Don't learn C, learn lisp.

Attached: 1547034531815.gif (351x357, 405K)

c primer plus

gracias qts
*blows kisses*

Attached: 1486596094290.png (1280x719, 818K)

o-oh

Anons, I need some help to get me started with a project I want to make. I basically want to make a program or 'app' that I can run on windows and android, which reads and stores the date I send from a bluetooth module + arduino and also allows me to change certain paramaters or gains in the program that's uploaded on the arduino. My only programming experience is in writing in 'arduino language' which is I guess C++, to write programs for robots. How do I make a cookie cutter program you know, software software, something that opens a window with little boxes I can type numbers into or click on a tab to see a graph of my measured data. Can I write such a program in c++? Do I need to use some special tools or something? What do I need to google?
To anyone that replies: I fucking love you my man.

Attached: 1516501909485.png (844x1157, 609K)

you can help by never posting that tumblr-tier gif again

Attached: 1462192474095.gif (700x625, 655K)

Working on my /bin/sh a bit today. I haven't had pipes or redirection this whole time, even though all the kernel support was in place, so I'm finally implementing it in the shell :)

Attached: Screenshot at 2019-04-25 16-08-22.png (1920x1080, 1M)

doc.qt.io/qt-5/all-examples.html

Fuck off, stupid frogposter.
You're not welcome here.

Warmer colors, much better

who the fuck cares you autist? I saved that from Jow Forums, good job saving the same stupid gif 2 years ago.

Are you fucking blind? Do you seriously just have taste that shitty?
That ultra-saturated shit looks horrible and is an insult to the anime that came from.

>arduino
is C
>Android and Windows
Highly recommend Java for this.
C++ also works, but I don't know that compatibility for .net and android.

>tools
If using Java. Install JDK and pic a text editor.
Learn to run Java from Console.
OR use an IDE. Netbeans is okay.

For android development, using google's android studio.

Depending on the app, if you have any graphics to do using C++ (OpenGl maybe) would probably be a good option and then code the UI or other functionality in Java.

In saying all this, it seems like you should be focusing on learning one thing at a time as it seems you have little knowledge on this.

I care, now shut the fuck up and replace it

Attached: 1465666457786.png (889x500, 234K)

ok. If it's so important, then go make a webm.

there;s no point since it doesn't have a lot of frames
simply stop being a nigger

I missed the bluetooth part
yea still Java.
You can do it in C++ but it's going to be harder if all you've ever done is Arduino programming.

I'm in the first year of university, can program in C well.
How do I get a side gig? Or do I need to finish my degree for it?

Attached: 1556200555652.gif (351x356, 862K)

Attached: 1465664372657.png (1280x720, 655K)

define programming in C well?

Enough to do it professionally, I'd reckon.
Are there any companies interested in hiring people who work at odd times/from home?
Alternatively, is it possible to make decent money as a freelancer, despite all the Indians?

how do I have sex?

bend over.

I recently updated a repo to let you Jow Forums folks download media content from threads automatically: github.com/newnone/Ffetcher.

Attached: girl.jpg (600x600, 33K)

Got his bitch ass

Trying to get into C#
int[][] arr = new int[n][n];
Error: You can't make arrays like that
int[][] arr = new int[n][];
foreach(var x in arr) x=new int[n];Error: x can't be changed while being iterated
foreach(var &x in arr)
Error: This isn't C++, faggot ;^)

>look this up in Stack Overflow
>have to use a (for int i = 0... loop to initialize it, like a caveman
Who the hell thought this was a good idea?

you need to understand reference types, friend

btw c# has multidimensional arrays, those aren't the same as jagged (nested) arrays. They should cover your use case.

>the absolute state

I don't know what the situation is like nowadays, but a couple years back (2011 - 2016, sporadically) I used to pick up odd freelance data scraping jobs from craigslist. A couple of them offered me more permanent gigs, working remotely or even moving to a new state to start a real job.
I don't know why those people didn't use pajeet sites (never asked them), but they seemed to be happy with a white american.
It can be done but you need to be really good at billing and in general just being a freelancing businessman - which I wasn't, so I got overwhelmed and grew to hate it.
In short, it's kinda gross and annoying, especially because it pollutes the time you'd otherwise be enjoying in front of your computer, but if you're hungry for money and don't want to get out of the house / climb the corporate ladder, it certainly beats working at some low-wage job anywhere.

>btw c# has multidimensional arrays, those aren't the same as jagged (nested) arrays. They should cover your use case.
This should make things easier

Is there some sort of taboo over using uints in C# ? Can't compare them, can't assign them, etc.

Wouldn't want to alienate the Javatards.

Numerical types in C# are fucked anyway
A char takes up two bytes for instance. Madness!

Updating my makefile, needed to patch it up so I can do SDLshit.a

I'll get there eventually

Attached: makefile.png (2072x1381, 168K)

just focus on examples to build your intuition, you can use them without having a general idea

Yeah, data scraping would be cool.

I'm White but not American (Swedish). Do you reckon they'd still be interested, provided I can set up a corporation and do billing properly?

I want to encode and decode QR codes with pure binary data in Python (without it getting interpreted as text or something else). I found pyqrcode and pyzbar, and I can use them just fine as long as it's text, but I can't do anything when trying to work with raw bytes. Honestly, I have trouble using Python to work with raw bytes in general. Any tips?

Just realised I needed to change my indentations to match the style guide
Does Visual Studio Code have a way to automatically shrink down to the new indentation I've specified or do I have to finger my keyboard into submission?

Attached: 1455817553918.png (358x449, 135K)

yeah, you could also just have an extension to auto-format your file on save.

>spend time making command line parser
>only now found out there is a "getopt_long" function

Convert the binary to/from string 0/1s and work from there.

Is there a search and replace with regex? Notepad++ has regex S&R

Thanks man, it's a good answer. I probably should be learning one thing at a time which is what I was planning to do anyways. Just needed to know where to start. I'll start by learning how to make a simple program using Java and expand on that.

i wrote a fully functional tic tac toe game today

Attached: 178523486.jpg.png (1280x680, 281K)

If you're stuck on a choice, choose the lewder of the choices.

on a scale from 1 to 10, how cute is haskell?

data Car = Car { company :: String
, model :: String
, year :: Int
} deriving (Show)

Attached: 1542825239846.jpg (455x476, 25K)

This is some butt fuck ugly formatting.

add an extra line that's too much indent

i do fibonacci code in python just some practice
i get the idea from
practicepython.org/solution/2014/07/25/13-fibonacci-solutions.html
def fibonacci():
num = int(input("How many numbers that generates?:"))
i = 1
if num == 0:
fib = []
elif num == 1:
fib = [1]
elif num == 2:
fib = [1,1]
elif num > 2:
fib = [1,1]
while i < (num - 1):
fib.append(fib[i] + fib[i-1])
i += 1
return fib
print(fibonacci())
input()


and thats what i did..

phibo = input("choose how many numbers will be in your fibonacci squence: ")

ara = []
def start(phibo):
for p in range(phibo):
if p == 0 or p == 1 or p == 2:
ara.append(p)
else:
phibo = ara[-1] + ara[-1-1]
ara.append(phibo)

print ara

start(phibo)


That editor is a tard right?
Is it more effective to do it as the first example ??

does Sweden have something like craigslist where people post computer gigs? or you want to go worldwide?
I don't think you need anything special, a Paypal account or something where people can pay you is sufficient. Paypal also has an invoicing thing that I would use for anybody who wanted that.
note I had to do scraping just to find decent stuff, 99% of the ads are spam or stupid unrelated "work from home!" scams.
I've never tried a freelancing website because I assume it's just pajeet hell and the competition is too insane.

best OP is /dpt/'s history

tested it with 1000
0.0050008296966552734 secs
vs
0.005001068115234375 secs
turn ur dumb input into a integer

phibo = int(input("How many numbers that generates?:"))

ara = []
def start(phibo):
for p in range(phibo):
if p == 0 or p == 1 or p == 2:
ara.append(p)
else:
phibo = ara[-1] + ara[-1-1]
ara.append(phibo)

print ara

start(phibo)


and now?

put ara in brackets
here is my atempt, got 0.004999637603759766
def fib():
fib_number=1000
if fib_number==2:
return [1,1]
elif fib_number==1:
return [1]
else:
fib_list=[1,1]
for i in range(1,fib_number-1):
fib_list.append(fib_list[-1]+fib_list[-2])
return fib_list
print(fib())

Trying to write an API in Flask for an SQLite database.

Anyone got any examples I can look at?

>Signed 24.8 decimal numbers. It is a signed decimal type which offers a sign bit, 23 bits of integer precision and 8 bits of decimal precision.
>sign bit

Attached: 1378928792646.gif (500x366, 475K)

the modules and making your own typeclasses chapter in learn you a haskell is making my brain hurt

can i just skip to the io chapter and start fizzbuzzing

what part? don't skip type classes

btw some parts of LYAH aren't up to date and might be wrong about e.g. the appropriate type class constraints/APIs

never get what is e-06 when you test time..
like 1.90734863281e-06

who the fuck learns a language by reading a book without trying it out?

>A char takes up two bytes for instance. Madness!
this isn't 1970 anymore grandpa

Fuck off

i'm memcmping structs and there's nothing you can do to stop me

I sure hope you don't mean in C++.

everyone who isnt a C grognard has been using 16 bit chars for decades

I'm gonna use both eventually, so should I learn C# over Java first?

And it's a giant waste of memory.

t. Wintard

and it's the stupidest fucking thing in the world
not only is it an enormus waste of space but also 16 bits are far from enough to cover every symbol
the only encoding that makes any sense today is UTF8

Here it is in my toy language.
strlen s = i -1 : ?? !! s[+ i 1 1] i

encrypt s key = i _ c _ len _ t _ result _:
:: len strlen s
:: result @m +[t] len 1
!: result [len 1] 0
??[i 0 len][c s 1]
!: result[i 1] + c key
result

decrypt s key =: encrypt s + ! key 1

sure if you only support english

listen grandpa, ucs codepoints don't all fit in 16 bits anymore. do keep up.

English is the only language that exists.

you can use 32 if you want but 16 is a good comprimise for a multi-lingual program seeing it supports all common characters in every language

stop using utf16 you fucking grognard

Please fuck off

utf8 is the only acceptable text encoding. It still baffles me windows hasn't switched.

Attached: utf8.jpg (749x403, 35K)

imagine being this mad about a text format

Ah so not only are you wasting memory, you don't even meet the old as fuck UCS-4 standard.

The fucking state of wintards.

Thanks, man.

>does Sweden have something like craigslist where people post computer gigs?
No, nothing.
>or you want to go worldwide?
Yeah, that'd be fine. I speak English and basic Spanish.

Where do you look? Are you supposed to use Google, or go through all the states' craigslist websites? Is there any good way to filter out sales ads ("I will do web scraping")?

>I care what OS I use
how's high school programming class treating you

you are a grognard

really? I use UTF8

>I don't use utf8
>I use utf8
Which is it