/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

en.wikipedia.org/wiki/List_of_unsolved_problems_in_computer_science
twitter.com/SFWRedditVideos

Tomorrow i think i will learn how to make WndProc handle keyboard input.

What language should I use for math computations?

Matlab

why this no work? output just is 'I'

def removepunct(s):
sminus = ""
for letter in s:
if letter not in string.punctuation:
sminus = (sminus + letter)
print(sminus)
return sminus

It's non-free

I'm annoyed at how incredibly stupid some of this R/Rshiny syntax is. Is anyone else programming in R, or even better Rshiny?

reposting from old thread:
Why does [32724153825,32724153825,32724153825] decode to JSON in php but [32724153825,01/01/2017,Event Lift-Off at Night] doesn't?

Then Octave.

I've heard people like SciPy as well.

Looks like you're returning at the first iteration of the loop.

Any more solutions?

Mathematica. But that's also non-free i think.

Maybe R. That's supposed to be for statistics.

Or write your own math lib in C or whatever other language your comfortable with.

[32724153825,"01/01/2017","Event Lift-Off at Night"]

...

>been working on a complex, ongoing personal project for fun for months
>don't touch it for a while due to work, life, writing some other smaller week / weekend type projects
>open it back up today because bored
>literally no idea what's going on, where I left it, seems like I was in the middle of some kind of refactor when I stopped

fuck. guess it's time to start something new

>in the middle of some kind of refactor when I stopped
Well that was dumb.

git checkout -- . and start refactoring over

Check out my thread if you guys can talk to me about software dev.

What are some programming ideas that have never been done before?

yea pretty stupid of me

meh

... and?

you seem like you're seriously asking this. no one will tell an original idea for free anywhere

Scilab.

Maxima + Common Lisp

General artificial intelligence.
A solution to the halting problem.
A program that tells you whether or not the Reimann Hypothesis is true.
A program that prints the numbers from 1 to 100, but if the number is divisible by 3 it instead prints "Buzz," if it's divisible by 5 it prints "Fizz," and if it's divisible by both 3 and 5 it prints "FuzzBizz."

en.wikipedia.org/wiki/List_of_unsolved_problems_in_computer_science

>use intellij idea for a while
>nice, but slow as fucking molasses
>meanwhile, visual studio is consistently very fast and responsive
>install intellij resharper on vs to see what it's about
>visual studio crawls to a fucking halt immediately
I'm starting to get curious about what the fuck they're putting in their software that makes everything slow
They're like the King Midas of performance death

I'm getting demotivated learning programming. I've already finished C, A Modern Approach
and did a majority of the projects there and don't know what else to do. Every program
that somebody would need or want has already been done both on linux and windows, and
I'm not at a level of knowledge yet where I can contribute to existing programs.
I'm just going to give up programming because now I see how worthless (outside of a job)
and uninteresting it is. Is this really all you guys do here? Do simple and worthless small
programs and circle jerk over which programming language is the best?

I'm planning to make a program that downloads all of the images on a page.

Some pajeet's project I looked at uses multithreading for the downloading but personally I don't think that makes sense because bandwidth and writing to disk are the bottlenecks so surely using a single thread would be better to avoid sharing and slowing everything down.

Am I right on this one?

I guess my final plan would be to have multiple independent threads scrape all the pages and find the image links, then they send these to a queue which a single thread reads from and downloads the images.

Is that a good solution?

Try CLion and see if that's also slow.

No, most of us are at a level of knowledge to contribute to existing programs or working hard at getting to that level.

>already been done
This isn't something you should worry about. Just write what you want to write.
>how worthless (outside of a job) and uninteresting it is
I think the act of programming itself is interesting. You don't need to be solving the world's problems to enjoy it.
Also, most of the programs I really enjoy writing are the ones that solve a problem that I alone have,
I've written a lot of programs which automate a lot of the shit I do, and I still use them all of the time.

You know software has bugs right?

Working on an imageboard: 4kev.org

your bandwidth and disk concerns would have been relevant in maybe 1995

90% of pajeets can solve this.

Are you dumber than a pajeet?

What to do if I feel to be hating programming?

Whatever happened to the gentoomen list? Is there somewhere I can download it? t.bookmarked years ago incase I ever decided to learn programming. Well I've decided.

>automation
can be done with bash scripts
no need for programming
for it to be programming it needs to be complied into binaries
>I think the act of programming itself is interesting.
>Textbook examples

>considering buying the C Programming Language Book

anybody read it?
Is it worth the 40 shekels?

>can be done with bash scripts
I do have several bash scripts.
Some of them are a little too complicated for bash scripts though.
>for it to be programming it needs to be complied into binaries
That's not a requirement.

its 3

>Is the 40 year old book on an outdated standard worth it?

/dpt/ self taught programmers

where did you start and how did you progress?

ive been working through codecademy but its boring, any tips fellas?

I read books

nice, anyone in particular you can recommend to new guy

I dunno, it was long ago.
I learnt BASIC back then.

read programming lang tutorials

function f(x) {
x += 1;
}

var a;

f(a);

console.log(a)
>undefined

I have to make an array in C#, and then do some sort of operation with the values inside and save it in the array or something like this, I can't remember it now. Someone know how to do it? I know is basic but I'm too busy in my career.

What would you except from uninitialised variable?

like their documentation, or any old tutorials i find online which seem credible?

I want maximum meme throughput and I'm not talking server hardware here, I don't have a gbit line so bandwidth is actually an issue.

But #1 & #4 are not possible because b would be 2
I have never programmed in java script so i dont know how it indicates undefined vars.

Javascript is one word.

undefined+1
>NaN

I've been working on a text based Chess game in java. It takes move input in the form of algebraic chess notation. I let the player pick their color, and then the program generates a list of all possible moves for the opposite color and picks one at random.

>then the program generates a list of all possible moves for the opposite color and picks one at random
Next level AI right there

What are you actually trying to do?

You probably want to use a List so you can use LINQ for whatever it is.

Explain your desired input/output or what the operations are.

real thread faggots

Eventually I will add weights to the moves, but not yet.

just got here

I have analysed the old thread and deduced that this is in fact, the correct thread, having been made and posted after the bump limit, whilst the other thread was made and posted earlier

Are there other vortual machines like .NET or JVM?

lua, python ...

What if I wanted to compile code and distribute it like .jars?

def removepunct(s):
sminus = ""
for letter in s:
if letter not in string.punctuation:
sminus = (sminus + letter)
print(sminus)
return sminus

learn a better language

No, but it look's very annoyed

The string must be in quotechar.

any brainfuck interpreter

I need to get a regular expression to match text up until a |, comma, or a # if they appear within the pattern.

For example the strings

var text1 = "Hello world [[I want to extract this#but not this]] and keep the ending double brackets";

var text2 = "Here is [[another example]] of text I should keep";

var text3 = "And one more [[example keep this|but not this]] but keep closing double brackets";

var text4 = "I want [[to keep this,not this]] same keep closing brackets";


Right now I've got the regex to get what I want from text2 in scala as

var pattern = """\[\[(.*?)\]\]""".r


Which returns everything inside of the [[ ]] but the fucking conditionals to find if a |, comma, or # appear are confusing as fuck.

Here it is, using sed. I assume it has the same syntax as whatever you're using. I'm wasn't sure if you wanted to trim the stuff outside of the brackets, although it's an easy fix.
Unfortunately, you're trying to match a lot of shit which requires being escaped, so it's a pretty ugly expression;
$ sed -r 's/^.*\[\[([^\|,#]*).*\]\].*$/[[\1]]/'

Here's what our git history looks like after 2 weeks on a 6-person project.

I had to strip off the beginnings and endings of your expressions but it worked! Thanks

result is

var pattern = """\[\[([^\|,#]*).*\]\]""".r

not first for rust

who is this lass

C is the best

c is S H I T

You are shit

rude

Explain this "putting your data structure on the stack" meme.

>Mov sp down the size of your data structure
>Put values in the space you just allocated

Friendly reminder that Rust is for straight white men.

how so

>xir thinks xir can decide who is a straight man

>xir
what does this even mean

The fact that I'm using it

yeah well there's also straight white men who live in california, but that doesn't make it a straight, white, or male state by any stretch of the imagination

Something that C programmers keep asking me to call them by

literally never heard C lads say anything of the sort

C++ on the other hand

>expecting logic from Rustoddlers

rust is for sissy nerds

t. sjw faggot

t. butt blasted """rustacean"""

is today opposites day or something

Anyone participating in the Google Code Jam this weekend? :)

Can I do it in python :^)

Who said this?

You can do it in anything.
Most people use C++, but people use everything from C, Python or Java to Brainfuck and LOLCODE.

I failed last year in the qualification stage. Looking to get into the Distributed Code Jam stage this time.

So I'm working on a c# application that has two forms open at the same time and I want to update a datagridview on the second form when I insert some data into the database in form1.
Anyone know how I could do this?