/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

support.amd.com/TechDocs/24592.pdf
github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/issues/248
neocities.org/
en.wikipedia.org/wiki/Recursive_descent_parser)
github.com/DanilaFe/chlang/tree/development
twitter.com/SFWRedditGifs

first (reserved for later)

The next Facebook

Should I learn x86 or x64 assembly?

x86.

x64, amd64 or x86_64 is backwards compatible with it. Basically the architecture is "x86 in 64 bits". Most of the concepts related to asm language translate to amd64, and others architectures like arm.

I sometimes see programs called pure x64 or distros called pure 64 bit and 32 bit programs won't work with it without the 32 bit libraries installed. What's up with that?

I have a device that runs php for web stuff, also i can run python scripts, but cant use python for web stuff.

Is it possible to use a php proxy page to a django page? If so how?

Thanks, I'll checkout out what line causes the issue.

I'm making a recipe-costing program for my sister! Wish me luck!

It's somewhere in the reading, so double check what the args are

There is no "pure 64 bits", probably some commercial thing. amd64 is a processor architecture that runs programs compiled in amd64 or runs programs in legacy x86 (32 bits) mode. You can run, on those systems, programs compiled in x86 because amd64 is compatible with that architecture and understands those instructions in legacy mode.

You need the 32 bits libraries because the program compiled in x86 needs them, it is called dynamic linking. In Debian/Ubuntu dpkg --add-architecture i368. You can make a x86 program that is just return 0; in main and you won't have any library dependencies so you can run it without installing anything else.

Configure your http server properly to handle CGI requests.

>pass user since 2016

what a gay

Any recommended x86 assembly books?

>using haskell in 2016
that's gay

Compile something with some functions and some input/output and play with ollydgb. I never read anything, just resources on the internet and general computer knowledge. A friend at that time was helping me as well (he was decompiling some binaries into C).

The best books on asm are the manuals from intel or amd (amd one is simpler iirc).

support.amd.com/TechDocs/24592.pdf

You are welcome.

Just find some 1980/90s textfile guides

I have an Intel processor. How compatible is the AMD manual going to be?

The architecture is the same on both processors. The manual is on the architecture, not on specific AMD processors. They have different extensions but it doesn't matter.

Anybody mind giving me a helping hand for my homework?
Like they are 4 more questions but only this first one confuses me.
It's supposed to be written in pseudo code.
Am i supposed to reach the input of data id last name etc.
or is that data already in the program and i have to read the data from the program then print?

>The data entry clear is required to enter data
The data shouldn't be in the program, you have to read it, do the calculations, and print.

user when you're done with the primary functions you have planned. Make a tool that scrapes advertisement PDF's (the ones that local stores send you if you ask for it) for deals so she can optimize her purchases. More often than not they got all the info embedded. I'm not sure if stores have good databases for prices, likely not. Because it's a competitive edge to keep that less accessible. But if you can find that too she would probably be super impressed.

And then maybe you could get genuine girl-worn panties. With +2 to programming skill. That would be amazing.

github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
This is the best thing I've ever seen.

So the program should start of as.
Print "Enter employee last name, gross pay and tax"
Read Last Name, Gross pay, Tax.

something like that?

Anybody uses Java?

How Do I pass a value from a JFRAME to it's parent JDialog?

What's the best way to host a static html site, /dpt/? Github?

How do I edit a buffer in WebGL?
I'm wanting to make a game with terrain deformation (tunneling and shiet) but I don't want to recreate the whole buffer every time a swuvle hits the wall.

Raspberry Pi

>no design plan or documentation
>no UML class diagram
>no test plan
>no coding guidelines

0/10 wouldn't pass code review

>Java
see If you have proper code infrastructure to show off, come back and ask that question again.

re-submit the edited data?

Are there any instruction extensions that GCC doesnt compile for on my computer (AMD FX6300)?

Yeah, no and that's not the answer I was looking for, thanks for trying. (only answer if you really know and not pretend)

hi people
I'm next to enter to high school and my father wanted me to pick a real programming language (I used pascal a lot to solve math problems during mid school). I read a lot of things about haskell in this forum, so I think I will pick haskell
just a question I have: what is haskell good for? my father uses a lot of fortran which is good for maths, so I wonder that in what haskell excells? thanks you

>person who doesn't even know WebGL tries to answer WebGL question and says to do what I specified I didn't want to do
>as is usual for /dpt/ and /sqt/, because the question now has a reply it won't be answered

abstraction safety sanity conciseness flexibility

...

There are some issues related to that, for examle github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/issues/248
It has a very active community.

well, what I mean is what problems does it solve? thanks you

>re-submitting is the same as re-creating
anyway look for a bufferSubdata

it's a general purpose programming language

Code validation works now!
The error messages are crappy but that's a whole another topic!

is that the abstract syntax tree, on the left?

how did you implement it?

so, you are saying it really doesn't excell at anything? my father told me that fortran is very good at numbers while being very bad at text processing, that's why I wondered what are the strenghts of haskell? thanks you anyway

Learn C

>stackoverflow

Oh, I totally forgot bufferSubdata was a thing!

neocities.org/

composability
it's pretty good for DSLs too

Is TIS-100 reference manual really only 14 pages? I thought it was a hundred pages.

like avx512?

TempleOS isn't compatible with x86 asm

I was reading about C right now. I mean, both C and haskell are compiled, and C is faster than haskell while also being general. As a plus, seems like there aren't jobs for haskell programmers. I think C will be my pick then.
Thanks you all very much.

but what are the specific strengths of it? thank you

i've told you like 6 or 7 at this point

those aren't usable strenghts faggot, tell him real strenghts

It is indeed an abstract syntax tree.
I wrote this shit in C, and the cleanest way I found was to have a union with a struct for every specific node type. For nodes with a variable number of children, I used my generic implementation of a linked list. Pic related, it's the node struct.

I should also say that I used recursive descent parser (en.wikipedia.org/wiki/Recursive_descent_parser) which is the simplest way to parse code.

Also known as tagged unions, they're the poor man's ADT.

really nice.

i had to build a compiler for my class, and i had to do something like this, but didn't.

is the code available somewhere, so i can study?

if not, its alright

Does TempleOS come with 32 bit libraries to make use of x86 assembly?

It's places like these where I miss OOP the most.

It's pretty shitty at the moment, and everything's implemented from scratch (yay, learning), but sure. The code's on my own server, I'll make a GitHub mirror in a moment. It doesn't take parameters, and just loads "test.txt" from the current directory.

If you are still considering it, pick Python. It's simple, you write what you think if you are already used to write code. It also makes you very hireable in scientific related fields (I think your father is one). It also has many libraries. Per se is slower than anything, but a lot of libraries are in C or FORTRAN, so you gain speed there. It also supports a functional style if you want to pick haskell later. Just avoid the 3.x version and stay in 2.7

thanks user!

i really appreciate it.

my father also use python, that's why I wanted to learn haskell, so I can troll him as you shitpost here with haskell.
Thanks you anyway

Absolutely. I found no better way to do this in C, and C++ comes with just too much baggage and stuff. It's probably some form of compulsive behavior for me to prefer C, but idk.

github.com/DanilaFe/chlang/tree/development

this is the exact thing haskell is exceptional at

How do I break an infinite while loop that is inside the main using a function that is inside the header file ?

>github.com/DanilaFe/chlang/tree/development
thanks!

Can Haskell do this? Jk. To each their own. I use C because I'm probably on the spectrum.

Code A (source: Haskell Data Analysis Cookbook)
import Text.CSV

-- Parses a CSV file
main :: IO ()
main = do
let fileName = "input.csv"
input length x == 2) csv)

-- Finds oldest person.
findOldest :: [Record] -> Record
findOldest [] = []
findOldest items = foldl1 (\a x -> if age x > age a then x else a) items

age [a,b] = toInt b

toInt :: String -> Int
toInt = read

vs Code B (source: me)
import pandas as pd
table = pd.read_csv("input.csv")
print table[table.age == max(table.age)]

Is that a boy or girl's room?

birl

unlikely desu

but working with tagged unions is exceptionally nice in Haskell

I'm sorry to hear that you suffer from amnesia, and apparently have forgotten we already discussed this

The haskell library you are using does not have as much of the work boiled into it, it's a pure language and so you can't do the C style sideEffectFunction(sideEffectFunction()), and the example code is shit

I'm more sorry to hear that you are stuck in haskell. Btw, that's the recipe of the book and I find a book being a better source than you.

Why are you so mad that people use Haskell?
Mad enough to write such dishonest posts?

nigga, i wrote the book

/dpt/ will still argue about this

I'm not mad at people, I'm mad at false promises. At least I didn't bought that book.

I'm new to Java and I have a question about JComboBox.

I would like to add an array to a JComboBox. The array objects would have 3 different variables, including a name string. In the JComboBox I would only want the name to appear in the options that you can select. How would I go about this? It does sound pretty simple.

I could add the names of the array objects one by one but that wouldn't include the other variables, would it? That is, if one were to pick one of the objects with the names, it would not include the other different variables so you can't really use it, or perhaps I'm thinking about this the wrong way.

I suppose I could add a second step by going through the arraylist again and look for the one name that matches the one that was picked but is that really the simplest approach?

You're butthurt about Haskell
It's clear for everyone to see

If you were mad about false promises you would be a lot more honest

Honest in what sense? I cited even the source of the code, so it wasn't a lie. Or maybe the buthurt is someone else who needs to write a fuckton of code to do simple tasks?

Wow, I guess you really DO have amnesia then.
To so conveniently forget all the responses.

a dictionary or hashmap with the name of the array mapped to the array itself.
only put the name of the array in the JComboBox, and then get whatever is selected in the JComboBox from the hashmap.

so convenient is to avoid the argument

in Haskell this is just

import Data.List (sortBy)
import Data.Function (on)
import Text.CSV (parseCSV)

filename = "input.csv"

main = do
Right success

whoops
parseCSV filename readFile filename

Not sure what that duplication achieves though
weird library

too bad man, too bad

whoops

print $ work success
i don't have Text.CSV so i can't really work with it

>dat pic

What the fuck is this Haskell shitstorm?

Gnosis... knowledge storage and "Question Engine" for GeneralAI.
One of the constexpr lookup-tables is giving me hassle.
Like C++14 but it's an ass-ache that you can't appear to use floaing-point in constexpr classes.
Taking a rest from that fucker...

You?

the guy bought a book from a pajeet who doesn't even know haskell

There are a series of autists in these threads desperate to show how horrible Haskell is by taking some badly written Haskell code and comparing it to importing a Python library.

This is the latest incarnation, "data scientist" user posts the code and yet mysteriously when you reply to him with an improvement, he doesn't make the change the next time he posts it. I'm guessing next time the code will somehow become even worse.

Yo, do you mind cloning the code and letting me take down the mirror? It's bothering me that the code is in two places at once... Sorry.

I tested your code, it didn't worked, so another false promise.

your png is now optimized

>it didn't work
Do you mean it didn't report the error when you gave it bad data?
That's because I didn't handle the error.
I was trying to match the python code.

sure.

i'll download the repository

Data seems good enough for python to handle, so the question is: what's wrong with haskell?