/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

greenlab.di.uminho.pt/wp-content/uploads/2017/09/paperSLE.pdf
sites.google.com/view/energy-efficiency-languages/results
code.google.com/codejam/contest/6314486/dashboard
youtube.com/watch?v=0JUN9aDxVmI
godbolt.org/g/vCFmB4
godbolt.org/g/rrTA4h
godbolt.org/g/nPcnkd
godbolt.org/g/kdmo5A
github.com/gergo-/missed-optimizations
en.wikipedia.org/wiki/Lambda_calculus#Pairs
twitter.com/SFWRedditImages

hi

From that post, I'm mainly concerned with the bit about assets. Yeah, I can whip up some code, but I absolutely cannot do anything more than the most basic MSPaint stuff.

>you can start right now and land a client in 30 minutes theoretically
>I had my first client in under 2 hours, including signing up and writing a basic profile (ymmv)
So I have my 3-4 presentable iOS projects, my McJob, a dress shirt, and nothing else. What do I do—take a mugshot, write that I'm a miserable faggot with no real experience and then hope for the best?

Joking aside, can you give me any tips on spinning my very modest resume into something hirable there?

Anyway, thanks for all of this info and the encouragement, I really appreciate it.

Sounds like the way to go, honestly. I'm too honest and forthright when it comes to my drawbacks and I've had some bad luck with bullshitting because I'm such a beginner so I've been avoiding doing any further bsing, but I suppose that's the way to go for someone in my position.

This is true

hello

Hi yourself.

Have you eaten your Lainos today, /dpt/?

Decided to play around with ANTLR a bit. Then I got the bright idea to implement a cancerous language in another cancerous language. It compiles BASIC into bytecode, then a Java program executes it.

In other news, my brain tumor is inoperable.

>basshunter
how much do you think this guy made from his few hits? was he mostly an e-celeb? I hope he made money from that

There are many resume templates available and even more guides on how to fill and write them. It's best to start now instead of continuing to converse and asking for emotional support.

Bump for Lain

>It's best to start now instead of continuing to converse and asking for emotional support
Understood

I am however looking for specific advice on what to do with what amounts to basically no relevant education and no relevant job experience. Can I just leave them off of a resume entirely? What's the 'best' thing to do in this bad situation?

I don't need any more emotional support, but there's not much out there in the way of advice for this specific question

All the languages below the red line should be banned by 2025 and extremely energy-inefficient, If you're using these languages please consider switching to the more environment-friendly alternatives. Remember, by using these languages you're making yourself directly responsible for the Global Warming.

Source: greenlab.di.uminho.pt/wp-content/uploads/2017/09/paperSLE.pdf , sites.google.com/view/energy-efficiency-languages/results

Play up what you can do. Depends on where you are interviewing. If you're interviewing with head bitch at HR, then gussy that fucker up with everything HR will love. Leave the technical shit to a minimum and describe the higher-level concepts.

If you're interviewing with an engineer or at least someone with a pulse and a degree that isn't in feminist underwater autistic dance therapy, consider talking more about the technical aspects of your projects.

This is missing many factors that would better paint a "green" initiative picture. Namely, developer time, considering humans are extremely destructive carbon-footprint-wise.

sorry m8 i know i'm talking to multiple different people here, i was asking for the purposes of freelancing via upwork

if I play my cards right I assume I can put freelance work on my resume and bypass this problem entirely

How good am I in JAVA if I have no problems solving everything in codingbat. Am I fit for a computer science degree?

>banning pascal

You can have my freepascal when you pry it from my cold, dead hands.

Don't bother putting anything related to your education down if you all have is a high school diploma. All your clients care about is a list of projects and/or products you've worked on and how well you present yourself. Now go, user, and impress us.

>Don't bother putting anything related to your education down if you all have is a high school diploma. All your clients care about is a list of projects and/or products you've worked on and how well you present yourself. Now go, user, and impress us.
I... I will
dog bless

You're fit for a lobotomy.

jokes on you I'm already a brainlet or why do you think I would ask such a question and now go kys

but seriously am I a complete beginner or already have some basic knowledge

Try these
code.google.com/codejam/contest/6314486/dashboard

Look, if you can write useful software in Java, then it's safe to say you aren't a complete babby with the language.

kek kys cuck

Yeah they keep me wired

I can make a calculater kek so I m not a complete baby I guess?

Time to set up a server farm executing random Perl scripts non stop in the amazon

HACK THE PLANET

Anyone else feel like the highs and lows are too much?

Friendly reminder that the concept of inheritance is broken at its core and should be done away with. Algebraic data types are the future, or to put it in a friendlier away: Use composition, never inheritance.

Also, friendly reminder that contract-oriented design (interfaces) are a meme as well. A semantically well-structed program will 99% of the time depend on an implementation's behaviour and not just its interfaces, meaning that using the interface as the type is misleading because it does not accurately capture the meaning of your data. This is a consequence of inheritance sucking balls.

Object oriented matlab. I only attempted suicide twice today!

I feel absolutely amazing when I figure a bug out then when I don't and I've been working on it for hours I feel like the biggest idiot on Earth.

Post some thigh highs and low socks!

>object oriented matlab
what the fuck are you doing?

inheritance and interfaces are just partially defined sum types
prove me wrong

computer science has nothing to do with programming tho
youtube.com/watch?v=0JUN9aDxVmI

for software engineering, maybe

Considering Pajeets use less water and energy overall, Java should be considered the greenest language.

i'm working on being an uninspired neet

i'm recompiling a program that was made in 2002.
It's a simple gui file explorer written in C and xforms toolkit.
Can't show any code tough it's proprietary :^)

Being proprietary does not imply being closed source, nor does being closed source mean being proprietary.

You don't understand freedom, as in beer that is free, so you are dumb, as in idiot that posts idiotically on https: // boards . Sup Forums . org / g /

i'm sure i'm not alone in having several questions about this data

I wonder how Go uses so little memory, being a language with GC.

>beer that is free
no such thing

>falling for the dynamic memory allocation meme
>But it makes your programs faster and lighter!

just use vector.push_back()
all the benefits of dynamic allocation with none of the downsides

>benefits of dynamic allocation
there aren't any

Like I said the code does not belong to me and i also have no right to share the code to anyone.
The program is written for freebsd 3 and IRIX unix.
So why the fuck should you even give a single fuck about it.

What's Go's memory model even like? I see a lot of pointers, are these GCd refs or what? Can you explicitly stack allocate?

Gonna probably be assigned my first lab today in my Python course. I don't know what to expect, any suggestions?

>explicitly
no
>stack allocate
yes

hangman.py

(You)
Then again, the implementations aren't equivalent, the ones in Go could sacrifice performance for memory by not caching intermediate results for example.

Writing a Lua bytecode interpretator

It better be written in assembly.

Gameboy Emulator without sound of course I don't know shit about sound emulation.

>He puts spaces at the beginning and end of function parameter lists

Working on a way for customers to add port forwarding rules to their routers so they don't have to fuck with the real config
Probably going to push it from the user portal using Ansible

write some rust they said
let mut todo: BTreeSet = BTreeSet::new();
let mut done = adorned::RulesSet::new();

// start with the query
todo.insert(adorn_pred(&BTreeSet::new(), &query).head);

loop {
let mut todo_iter = todo.into_iter();
let next = todo_iter.next();
let rest = todo_iter.collect::();
todo = rest;

if let Some(ph) = next {
match db.get(&ph.name).expect("Rule does not exist") {
&schema::RuleType::IDB { ref rules } => {
let arules: Vec = rules.iter()
.map(|r| adorn_rule(
&Vec::from(ph.adornment.clone()),
&r.head,
Vec::from(r.body.clone())))
.collect();
{
let idb_heads = arules.iter()
.flat_map(|r|
r.iter()
.filter_map(|p| match db.get(&p.head.name) {
Some(&schema::RuleType::IDB { .. }) => Some(p.head.clone()),
Some(_) => None,
_ => panic!(format!("missing rule '{}'", p.head.name))
})
.collect::()
)
.filter(|ph| !done.contains_key(ph))
.filter(|ph2| ph.name != ph2.name)
.collect::();
todo.extend(idb_heads);
}
done.insert(ph.clone(), arules.into_boxed_slice());

},
&schema::RuleType::EDB { .. } => ()
}
} else {
break
}
}
done

>if let
this is sexy

this is somehow bettah than C++
*sh m h*

This is more write-only than C++. Hell, it's almost as bad as Perl. Rustfags BTFO.

How do you do it lads? I've got a whole load of personal projects I want to be getting on with but I'm so burned out from writing garbage at my shitty job at a big tech firm that I can't motivate myself to do the interesting stuff when I get home.

does rust have constructors?

You're definitely doing something wrong with this loop, doing into_iter -> collect on every iteration is just wrong. I understand you can't use `for` because you need to modify the container, but consider using the container directly without iterators, basically, all you need to do is to pop the top element, I think Vec would be perfect for this.

It doesnt have classes, just structs and enums.
people generally write constructing functions if you need lots of members set

yeah i wasnt sure if i needed faster .contains() or faster .pop().
But i do need to do both

Rust has static functions, which can be used as constructors:
struct A {
x: usize,
}

impl A {
pub fn new(x: usize) -> A {
A { x }
}
}

[...]
let a = A::new(10);
[...]

How do you initialize an object on the heap then?

So I guess you just create arrays with size_t length?
How do you store elements in a container without knowing how many elements you're going to be storing? Some kind of arbitrarily decided upper bound? That's terrible practice.

Conceptually, by moving the value into the heap, practically, by calling the constructor on the allocated memory.
let a = Box::new(A::new(10));
//this is equivalent to
// auto a = make_uniquie(10);

Box::new(123) // its an int on the heap

It's not equivalent.
The rust version requires a move into the heap. The C++ version is constructed directly in-place in the heap.

is that a problem, small stack?

So you create a temporary on the stack and then just do a copy onto the heap? Huh. Does that get optimized away?

Space is not the problem here. Time is.
And yes, I should be able to bypass the stack if for some reason I need to construct a massive object.

Yes.

It should, but it looks like sometimes LLVM doesn't optimize it: godbolt.org/g/vCFmB4 , yet it does with the box syntax: godbolt.org/g/rrTA4h . I guess it doesn't show itself in the benchmarks because creating large arrays in the heap is a rare case, you use Vec instead.

>Xlib: sequence lost (0x3efc8 > 0x2efc9) in reply type 0x23!
what the fuck is your problem

So webdevs are quite literally shitting all over our neat little planet?

They are 'open' types, that is the problem.
You need to be able to model both open and closed sets of things conforming to some structure.

Inheritance implies subtyping, which is a big mess.

and you don't seem to understand

Wow, I always knew Python was an utter shitlang.

Yeah, ironic since they're all vegan hippie code artisans.

agreed

(You)
Looks like it does initialize in the heap when I use an array of usize: godbolt.org/g/nPcnkd , but not if I use an array of u8: godbolt.org/g/kdmo5A . It looks like initialization is directly on heap if no large arrays are involved, for some reason. Still, the box sytnax fixes it, they should have really stabilized it a long time ago.

Reminder that closed polymorphism (sum types) and open polymorphism (interfaces) can both be implemented with the lowly function type.

please demonstrate, I am curious

Rust is not production ready

Using "scripting languages" is basically a morally wrong action, everyone should be ashamed of it.

>a minor optimization sometimes doesn't work in corner cases
>the language is not production ready
I guess no language is production ready then, certainly not C/C++: github.com/gergo-/missed-optimizations .

Shit a post from my former department made it here

I feel like "Employed Rust programmer reporting in" is much more memey tbqh

>C++
>GitHub page is about C compilers

Also,
>Minor

en.wikipedia.org/wiki/Lambda_calculus#Pairs

the first item can be your tag, the second can be your value

What is C/C++? A new language?

and an interface is just a collection of things, use a tuple

No, it's an expression, it evaluates to 1 and then increments the value of C.

newtype Option a = Option (forall c. c -> (a -> c) -> c)
none :: Option a
none = Option $ \n s -> n
some :: a -> Option a
some a = Option $ \n s -> s a

maybe2option :: Maybe a -> Option a
maybe2option Nothing = none
maybe2option (Just a) = some a

option2maybe :: Option A -> Maybe A
option2maybe (Option h) = h Nothing Just


data Shape a = Shape
{ perimeter :: a -> Float
, area :: a -> Float
}

newtype Circle = Circle { radius :: Float }
circleIsShape :: Shape Circle
circleIsShape = Shape
{ perimeter c = 2 * pi * radius c
, area c = pi * radius c * radius c
}

newtype Square = Square { length :: Float }
squareIsShape :: Shape Circle
squareIsShape = Shape
{ perimeter c = 4 * length c
, area c = length c * length c
}

perimeterAreaRatio :: Shape a -> a -> Float
perimeterAreaRatio s a = perimeter s a / area s a

Rust's support outside of x86_64 and i686 on the big 3 operating systems is really shit. Tried to grab some mips toolchains through rustup. Nothing fucking worked. They would either fail to install or fail to compile a simple program, complaining about a syntax error on their own scrpts without looking at the program.

What are I/O bound programs?