/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

blogs.msdn.microsoft.com/dotnet/2017/03/09/new-features-in-c-7-0/
hastebin.com/uheqodeyej.json
twitter.com/NSFWRedditVideo

whatever, this thread seems nicer

Need help plox

>created way before bump limit
No.

ACTUAL NEW THREAD:

assembly question

i can't seem to be able to find an example of x86 assembly (preferrably ATT syntax) of a program using command line arguments

i just need to know where I access the number of arguments(ie argc) and where i access the pointer to the arguments (ie char** argv)
and where i access the name of the program

i should be able to just use ebp somehow, but i don't know where ebp points to in the beginning and can't find info

halp

>created way before bump limit
Not true.

It is true, you made this at 309

haram

Chart doesn't seem too far off, but I do question it a bit.

Namely, the fact that Javascript isn't higher.

Can someone help me with this, this is what happens when i try to start downloading from my app

Most of the job listings I see for C# say ".NET Developer".
I'd be curious as to what that looks like if you take that into account.
Probably tons of javascript jobs left off due to them just saying "website developer".

>his is what happens when i try to start downloading from my app
What do you think should happen instead?

He's clearly making fun of these popularity charts.

It is not downloading file user, it add torrent and remove it for unknown reason

sauce?

That multiple selection poll is just woefully inadequate for measuring anything. Speaks for how retarded the person who made it is.

a[n]>a[n-1]: add to ms_arr; inc n;
else: inc n;
Repeat for various starting positions: start at n=0,n=1,etc... check size of ms_arr;

wouldn't that find only consecutive numbers?

Ahhh, yes, thanks... I mean I wouldn't do that, of course, but it's good to know.

Yes. He misunderstood the problem.

My goal in life is to learn the top 3 reasonably well + Python. Still haven't gotten into C# though.

I believe it is specifically made to get a rise from reasonable people like you.

Could you write those 2 for loops in code, i'm not really sure if you're correct

>use references for everything in c++
>feel like a fucking god

>old thread got deleted
what a radical solution

I'm sick of being at the mercy of the scummy dev's who make a living off of the play store.
I want to make my own android apps, where's a good place to start?

I already know Java, just never tried to make anything for another device.

The top 3 being Java, C++ and C#.

Install Android Studio and fill in the gaps

blogs.msdn.microsoft.com/dotnet/2017/03/09/new-features-in-c-7-0/

switch(shape)
{
case Circle c:
WriteLine($"circle with radius {c.Radius}");
break;
case Rectangle s when (s.Length == s.Height):
WriteLine($"{s.Length} x {s.Height} square");
break;
case Rectangle r:
WriteLine($"{r.Length} x {r.Height} rectangle");
break;
default:
WriteLine("");
break;
case null:
throw new ArgumentNullException(nameof(shape));
}

(string first, string middle, string last) LookupName(long id) // tuple return type
{
// retrieve first, middle and last from data storage
// ...

return (first, middle, last); // tuple literal
}

// ...

var names = LookupName(id);
WriteLine($"found {names.first} {names.last}.");

public int Fibonacci(int x)
{
if (x < 0) throw new ArgumentException("Less negativity please!", nameof(x));
return Fib(x).current;

(int current, int previous) Fib(int i)
{
if (i == 0) return (1, 0);
var (p, pp) = Fib(i - 1);
return (p + pp, p);
}
}

>ŧfw your hardcore number crunching pushes the java GC to the limit
i-i dont want to learn C++ just for this

>What are you working on, Sup Forums?
Still working on Hydrus tag repository scraper. Writing parsers for 50 thousand levels of nested tuples.

looks like mod finally arrived with banhammers

Do you have an anime picture of your favorite programming language?

Fuck the C haters
C ftw

you wrote the piece of shit. you should know

C is a classy mature woman.
What's your favorite?

C++ is best girl, but the language is shit.

>Writing parsers for 50 thousand levels of nested tuples.
why does it matter how nested the tuples are

it's a tree either way

C++ a slut, she takes whatever hot feature members of the standard committee want to put in her.

C is far more conservative.

PHP is cutest.

Haskell, because she's pure

in python you get to pet the snake

Neon Genesis Evangelion: C
Serial Experiment Lain: Lisp

C++ is the sluttiest

anime : trash

Because it's not a tree, it's a structure of multi-level nested objects without keys mixed with tuple arrays. To make it worse, it's full of redundant data, that can be easily inferred. Here's a truncated sample: hastebin.com/uheqodeyej.json

Serial Experiment Lain: Python
Flip Flappers: Haskell

Anime website

Python was barely known at the time of Serial Experiment Lain

first sort the array, then do what said

opinion: discarded

Lain is often seen programming in Lisp

Lain is the entry level bro anime of deep shows like Python, Flip Flappers is the apex like Haskell.

so it's a complex tree without parent pointers

Asm is Texhnolyze

My point it that it does not need to be a complex tree. This API would have been far easier to use, if it returned a struct with 2-3 tuple/struct array fields.

Paranoia agent: brainfuck

writing a compiler
it will have 1 (one) datatype a 32bit signed int
it will also have pointers, 32bit ints also

if you want to pass a char to a function, you pass an int from 0 to 256

if you want strings, well, you use arrays of ints and utilize bit operations to fit 4 bytes/int

this scheme is feasible write, no problem to write a "standard" IO library for such a language

>blaming devs when devs have to pay to get in

Are you making Java?

>char
>0 to 256
>256

What the fuck?

> That Java dominance
Here's it's 50/50 .Net and Java stacks.
Makes for much funnier banter at meet-ups etc.

"Web Dev" is also up there.

no
the thing that will be the syntax looks like this currently, the language will be prettier but transformed to this

this takes two arguments, a and b
has 0 local storage(for local variables)
and returns the bigger one
in the language everything is an expression, so like rust

compile_function("max", [["a", "1"], ["b", "1"]],
[],
["if", [">", "a", "b"], "a", "b"])

i will use an ascii table
actually 0 to 255, obviously

ActionScript looks like artwork from Rustle.

If you sort it you fuck up everything mate

>writing in a typesafe language in an ide on a mac
welp

What do you guys think of ruby?

I don't like tripfags in overall.

Her favourite language is shit

.type max, @function
max:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
pushl %eax
popl %eax
neg %eax
pushl %eax
movl 12(%ebp), %eax
pushl %eax
popl %eax
neg %eax
pushl %eax
popl %ebx
popl %eax
cmpl %ebx, %eax
pushfl
popl %eax
movl %eax, %ebx
shrl $7, %eax
and $1, %eax
shrl $11, %ebx
and $1, %ebx
xor %eax, %ebx
pushl %ebx
popl %eax
cmpl $0, %eax
je else_clause_max_0
movl 8(%ebp), %eax
pushl %eax
jmp skip_else_clause_max_0
else_clause_max_0:
movl 12(%ebp), %eax
pushl %eax
skip_else_clause_max_0:
popl %eax
movl %ebp, %esp
popl %ebp
ret

here's the assembly
it has tons of "push %eax, pop %eax", but those are VERY easily optimized away later

i honestly can't remember what it does since i wrote most of the code months ago with 0 comments

but it's processing the "if" expression

r8

microsoft donated the source code of DOS 1.0 to a museum, it's available for download and study. Check that.

// If submit with POST
if ($_POST) {
// Test for nothing entered in field
if ($_POST['firstName'] == "") {
$firstNameErr = "Error - you must fill in a first name";
$dataValid = false;
}
if ($_POST['lastName'] == "") {
$lastNameErr = "Error - you must fill in a last name";
$dataValid = false;
}
}
// If the submit button was pressed and something was entered in both fields, process data
// (we just print a mesg)
if ($_POST && $dataValid) {
?>
Data is valid!
//FOLLOWING NOT IN PHP TAGS , WHAT IS GOING ON??

First name:

> out variables
Just fucking why.

Is there anything, anything at all, that these fuckers will not add to their language?

> touples
I'm kind of on the fence about this.
On the one hand they make some common use cases simpler. On the other hand, for production code that's going in a large enterprise system, you really should use separate classes for this, so that it's always semantically clear what you're getting in return.

Basically, instead of
return (4, 5);
you actually should return
return new Coordinates(4,5);

This does requires you to make a whole new class, but C# has decorators to make that shit fucking obvious.

And if you really need the speed, you have all sorts of disgusting tricks to do it fast regardless.

For quick and dirty exploratory code though, it seems really fucking nice.

> hardcore number crunching
> pushes GC to the limit
Stop generating garbage as much as possible.

Java has an unsigned int type.
It also has 8, 16, 32 and 64 bit signed int types, floats and doubles.

this is in reference to my apache server and php module

I was thinking of the language.

JavaScript isn't ADHD enough. I guess this was made back when the JS community was content with jQuery.

Also,
>best girl being worst language
Why is this allowed?

Try some implementation of Dijkstra's algorithm, searching for the longest path (in terms of number of nodes).

Learn how GC works. Reuse objects if you have to. Look into object pools.

Or just don't use Java for hardcore number crunching. It's like trying to use word when you really need libreoffice calc.

dijkstra is a shortest path algorithm and you can't use it to find longest paths even if you flip the weights to be negative

genetic evolution of fuzzy rules
please help they converge to quickly (probably to few rules and inputs)

>mfw nobody wants a Ada developer

>mfw no one on Sup Forums provided clear answer for this shitty problem for 2 days already

I can't think of anything that isn't bruteforce big-O(n!)

>clear answer
There has been plenty of clear answers. But nobody can explain well enough for a retard to get it.

I'm learning Python and I don't know why

>tfw reading Maximum length sequence wiki
>tfw don't get it
>tfw must mean I'm retarded
>tfw retarded

My condolences. But it's not that bad. You can become a prostitute.

Well I'm a JS dev just visiting from /wdg/.. I come here when I wanna feel dumb.

>JS dev
So you're already a prostitute..

>js dev
Top kek!

So you copypaste from stack overflow and glue frameworks together with spaghetti code

Fuck web """devs'""

Is it smart to run a tor exit node on your computer for plausible deniability about what you're searching for online?

Hey /dpt/ do you guys know if theres a VM that allows you to see its memory?
Am writing a small os in assembly and its hell to write without knowing whats going on in the stack.

typedef struct list
{
int v;
struct list *n;
} list;

/* O(n^2) */
int findSequence( int *seq, int n, int **res )
{
int len = 1, *lengths, ind;
list *l;

allocArray(&lengths, n);
l = malloc(sizeof(list) * n);
memset(l, 0, sizeof(list) * n);

for (int i = 0; i < n; i++)
l[i].v = seq[i];

for (int i = n - 1; i >= 0; i--)
for (int j = i; j < n; j++)
if (l[j].v > l[i].v && lengths[j] >= lengths[i])
{
lengths[i] = lengths[j] + 1;
l[i].n = &l[j];
}

len = maxElement(lengths, n, &ind);

allocArray(res, len);

list *s = &l[ind];

for (int i = 0; i v;
s = s->n;
}

free(l);
free(lengths);

return len;
}

int main( void )
{
int *a = 0, n = 0, len = -1, *res = 0;

if (readSequence("muhSequence.2", &a, &n))
return EXIT_FAILURE;

len = findSequence(a, n, &res);

for (int i = 0; i

I'd probably not ask here, but rather look at court cases similar to those you expect.

And I certainly wouldn't say that I'm planning to employ tactics to counter the judicial system on Sup Forums.

Just implement a hex dump function.

Make a 'sequence' array, initially empty.

Get a number from the input array, placing into every sequence into the sequence array where it is larger than the last element. Otherwise, make a new sequence in the array and make that the initial element.

Continue for all the numbers in the input array. Once completed, find the sequence in the sequence array with the maximum length.

pseudo-code
for num in input
for sequence in sequences
if num > sequence[end]
sequence[end+1] = num

print(max(filter(\x: len(x), sequences)))


O(n) time, O(n^2) space.

I feel like your ISP would shut you down for all the sketchy plaintext stuff going on

>spaghetti code
It's getting better with frameworks that enforce better project structure.

>So you're already a prostitute
Yes, I'm a total whore for js

So how long have you guys been devs? What do you do? I'm wondering how different it is from my job

>So how long have you guys been devs?
You think people here have jobs? Hah, silly /wdg/.

Thats the thing I need to see it in real time because I keep getting a bug in qemu and virtualbox which only happens 50% of the time when testing on real hardware, its fucking bizarre.