/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

ita.skanev.com/10/02/08.html
en.wikipedia.org/wiki/Involution_(mathematics)
twitter.com/NSFWRedditGif

I want to cuddle Rei and Misato
Asuka and the one OP posted who I can't remember are bitches

...

asuka best

these are cobras, not pythons
REEEEE

>Misato
Good tas-
>Rei
Never mind

You wouldn't hug her?

He said Rei before Misato, user.

All snakes can learn to program in Python.

Nah

My eyes are always drawn to best girl

20 years

post the gendo image

>you guys have been doing this for 20 years
>20 years

first for owo whats this driven programming

>program runs fine
>try to run it in eclipse debugger
>100% cpu utilization, memory leak, shit explodes and dies
epic, simply epic

It's been more than 20 now

took me a long time to figure out what causes this
I almost don't want to tell you because you haven't suffered with it long enough yet
but I will
close the variables view

Why does the variables view cause memory leak?

But what if he needs one of the most useful features of a debugger?

Eclipse a shit.
That's why.

yeah i know that's what causes it from my last job since i worked with java tomcat shit there, but that's all i really want out of the debugger right now anyways

Best way to learn C? I don't really like online courses so i would prefer some really good books. Already found a few but here weren't any good reviews on them.

Thanks.

I'm interested in a technical explanation, not meme posting.

I don't care about eclipse but this problem seems interesting

you can downgrade far enough back and the bug doesn't exist
it was added in an """"update""""
also i think it might be fixed now in the newest versions, not sure about that though

the eclipse people say it's a bug in certain gdb versions

People will recommend K&R. It's OK but targets old C.
I don't know of any books I'd recommend myself.

I started learning from this book recently it's good if you are a complete beginner i found it fairly boring but it is a good way to learn the basics

LLVM has support for ARM microcontrollers, and Scala Native is a front end for LLVM
So now I'm playing with the idea of combining the two
Waste of time or not?

Modern C Programming.

I'd also recommend you throw out garbage like the mostly deprecated standard library by using the freestanding option of your compiler. Learn and target your operating system in the most direct manner possible by talking to it yourself.

Portability is overrated. Never restrict yourself to the lowest common denominator of features by failing to take advantage of OS support.

How can I map a table's 1 to many relationship in C# using Entity Framework and Automapper? I have an OrderHeader and OrderItem DTO, an order header contains multiple order items, with the order header id being in the OrderItem record.

I want to map this to an Order model in my code like...

Order:

- Relevant Order Header Details
- OrderItem[] orderItems

unordered_map mOrder;
that's all it has to be
why does c# make things so much more complicated than it needs to be?

trying to brainstorm some better concept for a decent computerless election.

how did the madman do it?
ita.skanev.com/10/02/08.html

>We can find the pointer to the next item by XOR-ing np with the pointer to the previous item and vice-versa.
np = next XOR previous
therefore
next = np XOR previous (you know previous because you're traversing forward)
previous = np XOR next (you know next because you're traversing backward)

If I can train myself two hours a day at weekdays and 5 hours a day on weekends, how many years would it take to be employed at 100k/year?

>xor is its own reverse
really makes me think

i still dont get me m8. can you walk me through it?

Please tell me it doesn't support GNU.

IIRC someone has compiled something for ios, which runs on arm, so it should be feasible. Getting objective-c library bindings to work could be tricky, though.

any mobile devs here? i don't know a lot about mobile dev. i just finished a react native course. is there anything better out there? i'd prefer something without jsx/javascript.

like, should i be looking into qt? i've previously used qt, does it do well on mobile?

Is XOR the only function that can be used to accomplish this?

It's certainly the easiest one.

Say you want to traverse forward through the list. You already know head. You also know that head->np = head->prev ^ head->next. You know that head->prev = 0, therefore head->next = head->np ^ 0 = head->np. You can use the same process to determine that head->next->next = head->next->np ^ head, head->next->next->next = head->next->next->np ^ head->next, and so on.

wxPython

yes/no?

maybe

en.wikipedia.org/wiki/Involution_(mathematics)

So I'm inexperienced and I wanted to try testing out py2exe. So I downloaded it and I'm trying to convert a simple temperature scale conversion script I wrapped in tkinter, but I'm getting "IndexError: tuple index out of range", when I try to run my setup file.
I'm kinda confused on what to do.
from distutils.core import setup
import py2exe

setup(console=["tempingui.py"])

here's my setup file

why not
what do you want to do

why not native? swift is alright

whatever, people seem to trend towards QT but it is a huge fucking library.

as i said, i don't really know a lot about mobile dev. isn't swift for ios only? i'm looking for something cross platform.
that being said, i looked around the web a little, i feel like react native is a pretty solid option so i'll stick with it. this is more of a curiosity thing anyways so it's not that important.

...

If I have a program that sometimes hangs on a pretty slow computer is this bad for a resume? What I mean is if someone who is hiring people runs my program would they be mad if it hangs? What if it is only when one specific setting is active that it hangs but otherwise it is fine even on my toaster?

It's unlikely they ever run your program.

>If I have a program that sometimes hangs on a pretty slow computer is this bad for a resume?
Why not GIT GUD and fix the program?

Rei best waifu. She reminds me of myself.

Not sufficient.

Well okay I probably won't worry then.
It's kind of hard to but also I kind of want to move on from this program. It runs fine on my desktop though. Plus it is really just a "bonus" feature that doesn't work perfectly. I made a sliding puzzle game that solves the 8-puzzle and 15-puzzle fine but the 24-puzzle gets slow depending on my computer.

Wasted a week on a script to detect loops in animus.

I cant believe, that of all the things ive posted on Sup Forums. Its my Gendo post that has stood the test of time.

I was a faggot and screenshotted my own post because it perfectly encapsulates everything wrong with Evafags.

Seeing it covered in jpeg artifacts is like watching a child grow up.

My hardware can do that lol

software on your hardware
check meight

how does it work?

how would you have it work?

That's neat, source?

by dumb color comparison which is very slow and inefficient.
i've read it might be possible simply with contrast which i'm testing next.

>by dumb color comparison
Oh, never mind then.

How about calculating some identifier for each new picture and comparing that as a first pass? Like the sum of all pixel values, although that's pretty crude.

Employed Haskell programmer here

What do you do?
>inb4 write haskell

He ports Haskell to C#

right now I simply resize the video to reduce the amount of pixels needed to be compared.

it leads to more false positives where you simply get some background colors flickering but reduces the computing time from hours to ~30 min

Maybe autocorrelation could help

I've become sick of compilers and limited capacity for expression in a given language. All the guesswork and uncertainty about what the compiler will generate if something is written such and such a way. The constant internal battle between trusting the compiler, "helping" the compiler infer overarching intent, and trying to outright force the compiler.

I just wrote a simple function. There is an initial series of checks, and if it doesn't return true, the function can return. The caller always has all the information to do these checks before calling, but moving it out of the function, down the line, could allow something else to call without checking and dun goof it all up. Do I move the checks out of the function? Do I put them at the start with a return statement and hope for (partial)inlining?

Fucking fuck I never know if I can trust it. I don't know how far things will be traced back, I don't know if it'll create the ideal.

I'm tired. I hate this. Deep down, I do believe I hate just about everything.

Is it normal for an if else block to be over 1000 lines long? Found one at work, not sure what to think about it.

You need dependent types.

>I've become sick of compilers and limited capacity for expression in a given language.
Common lisp
>All the guesswork and uncertainty about what the compiler will generate if something is written such and such a way.
Common lisp that translates directly to hardware?

Well, no and yes.
No because this is a terrible way to write code, it leads to unmaintainable shit.

Yes, because cunts keep doing it anyway.

SWITCH CASE YOU FOOL

Try adding an identifier as well. You have to loop through each pixel set anyway, so it shouldn't add much overhead.

My arg parsers are generally switch statements that check the first letter. Name one flaw.

protip:
>you can't

>about what the compiler will generate if something is written such and such a way
I worked once with a TI compiler that would have int variable times int constant done by slapping the two values into the appropriate registers, then invoking one OP-code; but would take int constant times int variable and call a long multiplication subroutine for longs instead. Auditing the code and making every thing use the first form was the difference between having enough time to control the system and not.

Why not use existing library that follows some standard for that?

It's got another layer of nested if statements inside of it, not sure if that can be done with a switch statement.

Why would I use a library for it?

MAKE IT INTO SMALLER FUNCTIONS YOU FOOL
what ever you do, don't use regular expression because those are the devils work

>that follows some standard
Just maybe there would be benefit in code bases using same convention, I might just be crazy

>not using regex to scrape html

>not using turing complete html5+css3 to parse regex

man the chef documentation is kind of awful
anyone here used either puppet or chef for their dev ops shit at work?

I still don't see it. It's argument parsing, I can't see a library being efficient or suitable for anything beyond the most trivial cases.

do you want that nigger implements argument parser for every program some nigger writers?
Or should they use some library that uses some commonly known convetion for argument parsing?
Because there are many libraries that do it, some support --shit-nigger and some only work with -shit=nigger

Wait so you're doing this at less than playback speed?
It's not that much data. Especially when you scale it down.

What should I use for Python dev?

PyCharm
Visual Studio
vim
something else

is this true?

>regex to parse html
I remember there was a defcon keynote about something like this. That MySpace worm Samy was brought up. Doing things in such ad-hoc ways was discouraged and they had some research on languages they used to ensure that there wasn't parsing bugs. I wish I remembered better. I think I promised myself I'd read that stuff.

high level koder should still understand the stuff that provides security, world cannot be build on stuff that just be "hacked".
It's true in sense that most people writing applications for users have no idea about security, they only care about shipping "working" application to client

I'm not even sure what this says.
The idea of hacking being bare metal is wrong though. People leave vulnerabilities all over the place.

#include
using namespace std;

int main{
cint >> despression;
cout

fuck off dumb sepples poster