[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 317
Thread images: 40

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>61289173

What are you working on, /g/?
>>
>>61295410
bangin ur mum
>>
nth for join points
https://www.youtube.com/watch?v=LMTr8yw0Gk4
>>
who's your favorite csci author? mine's brian kernighan
>>
implementing signal processing paper with sepples
>>
File: Screenshot_20170507-102528.jpg (374KB, 1280x720px) Image search: [Google]
Screenshot_20170507-102528.jpg
374KB, 1280x720px
>>61295481
Link paper.
>>
Haskell!
>>
File: govnocode.webm (924KB, 600x336px) Image search: [Google]
govnocode.webm
924KB, 600x336px
Python!
>>
>>61295652
>>61295675
Fags!
>>
File: hask.png (294KB, 960x800px) Image search: [Google]
hask.png
294KB, 960x800px
>>61295652
excellent post
>>
I'm finishing up an android app, and I've reached the point where everytime I want to publish it, I decide I want to add one more feature. I think I'm just worried if the first release is missing "feature x" then people will pass over it or rate it bad
>>
Does anything in university ever actually get seriously difficult?
I just got into algo/data struct and we've already built simulated multi-level caches and round-robin CPU schedulers, which I'm sure would be much more difficult to implement on the OS level but as an exercise were...not hard, at all.
I keep expecting "the next class" to be where it gets real and interesting, but class after class is just "oh so that's how you do that" followed by no critical thinking for two weeks.
>>
Is there a language like C that doesn't require me to spend hours trying to get libraries from 20 years ago to work?
>>
inheritance was a mistake
>>
>>61295761
Yeah. It's C without windows.
>>
>>61295813
OOP was a mistake.
>>
>>61295815
why hello there missy
>>
>>61295847
procedural was a mistake
>>
>>61295815
lolno
>>
>>61295879
I'm sorry you don't know how to use a package manager and automake. It's way less arcane than adding packages in visual studio or java ides.
>>
>>61295508
yes
http://ant-s4.unibw-hamburg.de/dafx/paper-archive/2010/DAFx10/RaffelSmith_DAFx10_P42.pdf
>>
haskell is dead
>>
>>61295941
I'm sorry you have never written a program that is deeper than a puddle.
>>
>>61295813
>>61295847
C++ killed programming back in the 80's
>>
ocaml
>>
>>61296028
You're making a mistake if you're in a situation where you can choose what you can use and you chose 20 year old obscure libraries with compatibility that you can only download off geocities backups on archive.org

It's not C's fault that you're straying into the woods and getting cuts on your legs. You can do that with any language.
>>
>>61296113
Enjoy your single threaded pile of garbage
>>
>>61295706

So just release it, have people complain and the update with a new feature. Gets your shit out there and shows you listen to your userbase.
>>
>>61296139
Calm down. This is a nice thread.
>>
>>61296124
Actually, I'm not making a mistake. You're just too stupid to understand that your own experiences don't necessarily reflect everyone else's.
>>
>>61296180
>I'm not making a mistake
>I'm trying to write stuff in C and am heavily relying on everybody else to have written a library for me already
You should go back to Python, C is not meant to be used with your import addictions.
>>
>>61296180
this guy -> >>61296204 is right, listen to him
>>
>>61296159
stop posting rude languages like ocaml!
>>
>>61296124
Yeah, okay. Come back to me when you can find a low-level boot delimitation library for C that's compatible with current hardware.
You can find one for plenty of other languages.
>>
>>61296204
>>61296217
Complete idiots...
https://en.wikipedia.org/wiki/Dunning–Kruger_effect
>>
>>61296255
The irony is palpable.
>>
wrote a toy assembler today. The assembly lang is fictional and rather limited, though
>>
>>61296262
It's really not. You have no idea of what you're talking about. Go back to writing hello world programs.
>>
Also started working on my minimal shell again calling it lush.
>>
>>61296269
Nobody cares, fucktard.
>>
>>61296223
I have literally never heard of boot delimination, searching boot delimination brings up nothing. Fuck, google autoexcludes delimination.

I have a lot of trouble believing there's a "low level" library you can't call with inline assembly.
>>
File: 1491689412994.gif (3MB, 360x270px) Image search: [Google]
1491689412994.gif
3MB, 360x270px
>>61296272
I can taste how upset you are from here.
C is not a language where you run around and import 30 libraries to do what you want. If you're working in C you're almost guaranteed going to have to write most of it yourself.
I know that's not the answer you want to hear because boo hoo, now you have to work! But that's the reality of the language.
>>
>>61296289
> What are you working on, /g/?
I said what I'm working on.
>>
>>61296305
Yeah, and I told you nobody cares.
>>
>>61296269
Neat. Post some examples.

I've thought about writing a FORTH interpreter myself.
>>
>>61296305
>>61296327
samefag
>>
>>61296308
fair point.
What are you working on?
>>
>>61296305
>>61296327
lol @ pretending someone actually cares about your garbage to make yourself feel better
>>
File: nope.png (27KB, 487x248px) Image search: [Google]
nope.png
27KB, 487x248px
nope
>>
>>61296334
I'm a contributor on the NodeOS project and I'm working on that right now.
https://github.com/NodeOS/NodeOS
>>
>>61296327
some examples of?
>>
>>61296360
>Lightweight operating system using Node.js as userspace.
I don't like you.
I don't like you very much at all.
>>
>>61296369
Why not?
>>
>>61296360
>https://github.com/NodeOS/NodeOS
that's neat! how does it boot though? And everything has to be run in userland or am I wrong? cr0 can't be accessed.
>>
>>61296387
Stop using javascript for things it wasnt meant for
>>
>>61295410

Shit programmer here.

So I'm extremely unfamiliar with android studio and I haven't touched Java in forever.

I'm trying to create a color changing like stop light button that takes in a click, then pauses, before turning to the next color.

Basically how I have it is

//Stop is the Button from my MainActivity.xml file
Stop = (Button) findViewById(R.id.stopButton);
//(onclick class)
Stop.setBackgroundTintList(getResources().getColorStateList(R.color.Red));
try{
Thread.sleep(5000);
//Pausing the thread for 5 seconds
Stop.setBackgroundTintList(getResources().getColorStateList(R.color.Yellow));
Thread.sleep(5000);
Stop.setBackgroundTintList(getResources().getColorStateList(R.color.Green));
} catch (InterruptedException e) {
e.printStackTrace();
}


But this basically ends up with Thread.sleep for the time, but the actual Tint change never happens. It's just sleeps for 10 seconds. Is there (obviously) a better way to do this, or some method more specific to AS for handling Activity pauses/breaks? How do I pause the activity for 5 seconds, do a tint change to the button, then continue on?
>>
>>61296364
Examples of your assembly

>>61296360
Of course the fag being so hostile to an anon working with assembly is a jscuck. I bet you're also the fag who can't comprehend "apt-get install libxxx-dev" and "./configure; make; make install"
>>
Please have mercy on me /dpt/

This is a program written for a university assignment. INb4 "not doing your home work for you", I've already completed it. Could I get some meaningful feedback? The TA who grades these "doesn't like to type" and just gives out 100's or 0's.

I know there are a multitude of things that could be done better, but I'll never be able to fix them if I don't know what/where they are.

https://pastebin.com/cw4sajaQ

Requires http://mcsp.wartburg.edu/zelle/python/graphics.py
>>
>>61296443
Is it due tonight? If not, go directly to the TA and ask for help. That's your best plan. And if the TA shoots you down, bitch to the administration.

I'd bitch to the professor AND administration anyway for only giving 100s or 0s on essentially an essay assignment.
>>
>>61295410
>What are you working on, /g/?
I'm writing a fizzbuzz program in pure binary using only a hex editor.
>>
>>61296429
oh sure.
the lang is just simple functions ATM.
IM 2
PU
AR 0
SW
PO
AD

this would be the assembly of a function that takes one input and adds 2 to it.
>>61296392
Your code isn't an OS... it just calls os constructs via system calls and would not work without another OS beneath it.
>>
>>61296508
>Your code isn't an OS...
Right.. And macOS isn't an OS either, is what you're saying?
>>
>>61296429
It's really minmal. you have 2 regs (one Accum, one GP), a stack and basic arithmetic ops.
SW swaps the contents of the two regs.
>>
>>61296528
No It is. It is self reliant. It has access to real mode and is written in a language that can use constructs of Machine language necessary for an OS.
>>
>>61296543
you're retarded
>>
>>61296543
>It is self reliant.
HAHAHAHAHAHAHAHAHAHA
>>
>>61296549
probably. I mean my assembly lang was made without IO or a strict wordsize. That's pretty dumb.
>>
>>61296529
Have you ever played TIS-100?
>>
>>61296599
No. is that the assembly lang game on steam?
>>
>>61296479
>bitch to the administration.
Do you live in some sort of alternate universe where people care? The administration doesn't care. The professor doesn't care.

The TA "Just took the class semester" and "doesn't like typing".
>>
When do you realize that you got comfy with your language? Is it when you start using it to automate your personal tasks?
>>
>>61296679
I didn't.
>>
>>61296679
>getting comfy with a language
brainlet
>>
>>61296625
I'm guessing you're taking an intro to programming course. So drop the course then. Take it at community college or another semester.

Also have you >>tried<< talking to the TA? Have you actually >>tried <<talking to the professor? Have you gotten other students to bitch too? I'm inclined to assume you haven't done these things, and if you haven't, then all you are doing is justifying inaction.
>>
what programming can I learnto make an iphone app
>>
>>61296726
C but you'll need to learn to inline asm as well so research assembly
>>
>>61296726
assembly
>>
>>61296726
https://www.bell-labs.com/usr/dmr/www/bintro.html
>>
>>61296726
You'll need Ruby for that. You can try it out in your browser at http://tryruby.org
>>
>>61296625
Fuck, you could go nuclear if they don't do anything. Research around for similar on campus and write a hit column about how "University of Students Getting Fucked Because They're Weak Cucks'" computer science department is a degree mill which puts little effort into ensuring students have an ability to program.

And tips for talking with people. Don't whine about your grade. You sound like an cheating indian premed student. Whine about how you don't understand the material and you can't learn from your mistakes because the TA is a lazy piece of shit.
>>
>>61296726
a gun
>>
>>61296726
read this book to make your iphone apps fast
>>
>>61296791
A lot of this.
School administrators are gigantic fucking pushovers, so if your prof is pulling some kind of bullshit you can go over his head and get that shit taken care of.
>>
Machine code is the master race because it came first, no computer or language can run without it. Efficient and organized. Nobody ever said the master race of programming needed to be handwritten. Prove me wrong /g/.
>>
>>61296775
The more I read, the worse it gets
>>
File: C History.png (11KB, 562x320px) Image search: [Google]
C History.png
11KB, 562x320px
>>61296853
Respect your elders, cunt.
>>
>>61296852
You can handwrite machine code.
>>
>>61296902
prove it
>>
>>61296919
Just use this:
http://ref.x86asm.net/coder64.html
>>
>>61296726
Swift !
>>
>>61296722
>Take it at community college
Already taking it at a "I couldn't afford to go anywhere bettter" state school.

>Also have you >>tried<< talking to the TA?
I'll give it a shot. But like I said, the TA isn't familiar with the material.

>Have you actually >>tried <<talking to the professor?
Yes, last semester. He doesn't answer email, and doesn't return phone calls.

>Have you gotten other students to bitch too?
Why would they bitch? Most of them are teen-agers who don't care as long as they pass.

>all you are doing is justifying inaction
Maybe, like I said, I'll try.

>>61296791
>TA is a lazy piece of shit
In his defense, he only has one hand.
>>
if your classes are longer than four lines you're doing oop wrong
>>
>>61297017
shut the fuck up idiot
>>
>>61295410
Do you know any good Javascript arithmetical parser which stores an expression in an AST and lets me run it thousands of times with different variable values?

I have found and tried some conventional parsers, but I don't want to rebuild the AST each time I evaluate the function with different variable values.
>>
>>61297017
That makes no sense whatsoever.
>>
>>61295714
unless you go to a university prestigious for stem you shouldn't really be humble bragging. my university's not the best so i supplement with self study
>>
>having classes at all
Pajeet, out.
>>
>>61297070
I'm not trying to humble brag, I'm legitimately asking, because if it's not gunna get hard I'm gunna start slamming textbooks into my brain.
>>
>>61296272
C is for systems programming and things that require super high efficiency. if you want numerous easy to use libraries that just werk and which you can copy-paste together, C isn't the language for you. if you're making a desktop application use java or something. no one hardly even uses C anymore so why are you even using it?
>>
>>61296726

You'll need either Swift or Objective-C, and XCode, which only runs on Macs.
>>
>>61297087
all college is easy as balls nowadays you gotta do stuff outside of class
>>
>>61297087
what language did they have you use for the scheduler simulator?
>>
File: 1480493819029.jpg (17KB, 600x600px) Image search: [Google]
1480493819029.jpg
17KB, 600x600px
>>61297118
then why am i paying so much fucking money for it
why is the information era so fucking stupid
>>
>>61296150
Thanks Anon, may sound weird but that motivation helps!
>>
>>61297147
the government decided to make college affordable.
so they gave out loans to everybody who couldn't afford it
so colleges said ok, we can be even more expensive now
thank president roosevelt and the gi bill
>>
>>61297107
>no one hardly even uses C anymore
except like 25% of developers if you look at the actual statistics, moron.
>>
>>61297147
Because a college degree is mandatory for a while collar job. If you don't wanna play along with that racket, you're going to have to go to a technical school and get a degree in welding or construction or something.

Or you could choose neither and die poor.
>>
>>61297143
Java, but I specifically didn't use any pre-defined things in the standard library because that would defeat the point.
I re-wrote it in C and for giggles and saved about 200 lines.

>>61297191
>you could choose neither and die poor.
how much is heroin again
>>
>>61297147
You dont even need uni anymore for tech jobs.
CS/CE are scams.
>>
File: 1499262685980.png (74KB, 1095x1281px) Image search: [Google]
1499262685980.png
74KB, 1095x1281px
>>
>>61297210
>github
irrelevant
>>
>>61297218
What should i be using instead?
I looked at gitlab, but it seems purely for startups with all the useless bloat.
>>
>>61297210
>github
https://www.tiobe.com/tiobe-index/
>>
>>61297147

What you are paying for is the diploma certifying that you know this. If you just needed to learn something for the sake of learning, you could reasonably learn a lot more for cheaper with a couple of textbooks and the Internet... although you would not have the environment of having an actual professor to talk to and bounce ideas off of.

As for why it costs so much... the reason is that because the government is guaranteeing everyone's loans, and because everyone feels that education is a must regardless of the cost, tuition costs are allowed to balloon with no end. If you can raise the price of a good, and the number of customers does not decrease proportionally so that profits drop, then it is always a smart move to raise the price. Basic supply and demand.
>>
>>61297218
>github is irrelevant
Of course, real programmers host their programs in /g/
>>
>>61297210
>A graph describing the largest number of retards per language
Looks about right, honestly.
>>
File: 1491081808903.jpg (56KB, 945x482px) Image search: [Google]
1491081808903.jpg
56KB, 945x482px
>>61297237
>>
>>61297243
real programmers don't host their programs at all
>>
>>61297218

Name a larger repository.
>>
>>61297237
>D in the top 25
Were gonna make it.
>>
>>61297253
Nope, they just send the project tree to the fellow real programmers by email
>>
>>61297249
>C is very steady
>Right until 2016
>Plummets into nothing
>Same year the billion JS frameworks took off
fucking javascript
>>
>>61297260
do you think it might be possible that people who program in C are not using online repositories such as github?
>>
>>61295410
Writing C++/ROOT experimental particle physics code for finding the critical point of nuclear matter

https://arxiv.org/abs/1603.09057v1
>>
>>61297263
People have been saying that for over 15 years. It's never going to happen. D is a dead language.
>>
>>61297260
It's not a good sample. It's like taking a presidential poll in New York and using that to predict election results.

If you wanted to do it right, you would need to do a random sample of businesses using a list generated from each state's secretary of state.
>>
>>61297289
It's more alive than your git
>>
>>61297288
Does it take into account the speed of the neutrons and thermalization n shit or is it just raycasting with nuclear radii?
>>
>>61297271

And what do you suppose that they are using for version control? An on-site git repository?
>>
>>61297289
I think being several places above scala is impressive though.
>>
>>61297173
i get paid to go to college as an undergrad, and i plan to go to grad school on fellowships as well
>>
>>61297318
Yes of course. Most businesses do.

Sometimes it's git. Sometimes it's subversion. Sometimes it's a disgusting in house solution (I'm looking at you Microsoft).
>>
>>61297316
Well im simulating Au+Au nuclei collisions and the particles they create, which shows what's happening in the quark gluon plasma
>>
>>61297365
Ahh. That's different than what I thought lol. I went str8 to nuclear power and nuclear bombs. Neat
>>
>>61297376
Well it might be able to make nuclear power/bombs more fuel efficient...
>>
>>61297294
It's actually not. I'm a top contributor on https://github.com/crystal-lang/crystalc
>>
>>61297417
>ruby syntax
>no version 1 in 2017
kek

Elixir is a better webdev language
>>
>>61297417
>404
>>
File: 13129702.jpg (11KB, 320x320px) Image search: [Google]
13129702.jpg
11KB, 320x320px
>>61297417
>page not found
>>
>>61297437
Whoops. https://github.com/crystal-lang/crystal
>>
>>61297437
>>61297446
The memes write themselves
>>
File: 305.jpg (25KB, 427x231px) Image search: [Google]
305.jpg
25KB, 427x231px
>>61297237
PHP is never going to die, is it?
>>
>>61297454
GOOD
>>
File: 1453304848381.jpg (42KB, 712x712px) Image search: [Google]
1453304848381.jpg
42KB, 712x712px
How do I run a function whenever my program is killed by a signal in C?
I tried using atexit and at_quick_exit, but they don't seem to work.
I would rather not set a signal handler for basically every potentially lethal signal, but I really need to run some cleanup shit should my program die unexpectedly.
>>
>>61297446
>>61297453
https://github.com/crystal-lang/crystal
>>
File: anime-punch.jpg (208KB, 785x757px) Image search: [Google]
anime-punch.jpg
208KB, 785x757px
how do we make haskell a popular scripting language
>>
File: FeaTOvh.png (28KB, 633x758px) Image search: [Google]
FeaTOvh.png
28KB, 633x758px
>>61297454
>it will take even longer for javascript to die
>>
r8 muh m8kfile
.RECIPEPREFIX = >
.PHONY: executable objects dependencies\
clean-executable clean-objects clean-dependencies clean

EXECUTABLE = ydc
COMPILER = g++
CFLAGS = -g -c -Wall -Wextra -Werror -std=c++14
DFLAGS = -MM -o $@
LFLAGS = -o $(EXECUTABLE)
LANGUAGE = cpp
SOURCES = $(wildcard *.$(LANGUAGE))
OBJECTS = $(patsubst %.$(LANGUAGE),%.o,$(SOURCES))
DEPENDENCIES = $(patsubst %.$(LANGUAGE),%.d,$(SOURCES))

all: executable

executable: $(EXECUTABLE)

objects: $(OBJECTS)

dependencies:
> @:

$(EXECUTABLE): $(OBJECTS)
> $(COMPILER) $(LFLAGS) $(OBJECTS)

%.o: %.$(LANGUAGE)
> $(COMPILER) $(CFLAGS) $<

%.d: %.$(LANGUAGE)
> $(COMPILER) $(CFLAGS) $(DFLAGS) $<

.PRECIOUS: $(DEPENDENCIES)

clean-executable:
> rm -f $(EXECUTABLE)

clean-objects:
> rm -f *.o

clean-dependencies:
> rm -f *.d

clean: clean-executable clean-objects clean-dependencies

-include $(DEPENDENCIES)
>>
>>61297482
JavaScript is here to stay thanks to node.js
It's basically the new C.
>>
>>61297476
D and UFCS with rdmd/dub have it beat.
>>
File: 1497830335496.jpg (157KB, 884x902px) Image search: [Google]
1497830335496.jpg
157KB, 884x902px
>>61297482
>and decades upon decades for Go to die
>>
>>61297470
atexit handlers only run on normal exit so they won't work. install signal handlers on SIGINT and SIGTERM.
>>
>>61297499
This

D is scriptable too.
>>
desu crystal would be the greatest language ever if it didn't have ruby's shitty syntax
>>
>>61297470
setup one generic signal handler
turn its definition into a single-letter preprocessor macro
call the macro on every potentially lethal signal
#undef the macro when you're done because single-line macros are shit
you've basically now written a signal handler for every potentially lethal signal except all you had to do was write one signal handler and exhaustively list the signals which will have been much less work
>>
>>61297484
Ooh are we posting makefiles
I still need to add dependencies (-MM etc) but so far there isn't enough source code (about 4 .c files) for it to be a huge issue.

cc=gcc -g
cflags=-Wall -std=c99
linker=gcc -g -lm

deps.test=lib.vm lib.test

libdir=src/$(LIB)
builddir=build/$(TARG)/$(LIB)

.PHONY: all target lib
.PHONY: test x86 arm clean

all:
@echo "usage: make [test | x86 | arm | clean]"

test:
@make --no-print-directory TARG=$@ $(deps.$@) target
@echo -e '\nRunning tests:'
./test

x86:
@echo "target x86 unavailable" && false

arm:
@echo "target arm unavailable" && false


target: $(deps.$@)
@echo -e '\nLinking'
$(linker) ${wildcard build/$(TARG)/*/*.o} -o $(TARG)

lib.%:
@echo -e '\nTarget: $(TARG) Lib: $(@:lib.%=%)'
@make --no-print-directory TARG=$(TARG) LIB=$(@:lib.%=%) lib

lib: $(builddir) ${patsubst $(libdir)/%,$(builddir)/%.o,${wildcard $(libdir)/*.c $(libdir)/*.a}}

$(builddir)/%.c.o: $(libdir)/%.c
$(cc) $(cflags) -c -o $@ $<

$(builddir)/%.s.o: $(libdir)/%.s
$(as) $(aflags) -c -o $@ $<


$(builddir):
mkdir -p $@

clean:
@echo -e '\nCleaning'
rm -rf build/
>>
File: 1456502951227.jpg (68KB, 563x491px) Image search: [Google]
1456502951227.jpg
68KB, 563x491px
>>61297482
>there are OS written in javascript
>>
>>61297511
>>61297535
Damn. I'm writing a library, so I was hoping not need to install signal handlers and possibly overwrite theirs or have them overwrite mine.
Oh well.
>>
>>61297476
https://hackage.haskell.org/package/turtle-1.3.6/docs/Turtle-Tutorial.html
>>
>>61297548
>using VSC
>hate my self everytime i open it up because im perpetuating JShit
>but too lazy to strip out all the shit or just write my own TE
>>
>>61296744
>>61296763
>>61296775
>>61296786
>>61296800
>>61296813
>>61297003
>>61297111
thanks guys, i found a app maker program which looks good and was worth the money over programming in my opinin. any good app ideas i was thinking something like facebook
>>
File: tfwyoufinallysolveshit.png (514KB, 490x618px) Image search: [Google]
tfwyoufinallysolveshit.png
514KB, 490x618px
What are some kewl not popular or esoteric languages to impress cs qts? Stroustrup-sama says that every adult male should take the time to learn an esoteric language to get a broader perspective on things. I was thinking Prolog
>>
File: 07182011_The_Binding_of_Isaac.jpg (85KB, 602x375px) Image search: [Google]
07182011_The_Binding_of_Isaac.jpg
85KB, 602x375px
>>61297548
>there are OS written in C
>>
>>61297524
crystal with javascript syntax would be glorious
>>
File: boom.png (111KB, 423x318px) Image search: [Google]
boom.png
111KB, 423x318px
>>61297582
>there are OS written in Python
>>
>>61297454
My webshit mate says that we are living in the golden age of php, it's finally a somewhat decent lang
>>
>there are OS written in HTML
>>
>>61297595
Name 1 (O N E)
>>
File: shitte.jpg (37KB, 250x323px) Image search: [Google]
shitte.jpg
37KB, 250x323px
>there are OS written in Lua
>>
File: image.jpg (70KB, 640x360px) Image search: [Google]
image.jpg
70KB, 640x360px
>there are OS written in PHP
>>
File: memedoffthefaceoftheearth.png (732KB, 1200x1200px) Image search: [Google]
memedoffthefaceoftheearth.png
732KB, 1200x1200px
>there are OS written in Ruby
>>
>>61297553
You shouldn't install signal handlers in libraries. I think the best approach is to provide a global cleanup function and let the main program invoke it when it terminates.
But you'll want to make sure that main program also masks signals during the initialization, to avoid the possibile race conditions.
>>
>>61297592
>>61297618
>>61297635
>>61297644
>memedoffthefaceoftheearth.png
accurate
>>
>>61297594
it's the legacy code that worries me
>>
>>61297569
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle

-- #!/bin/bash
{-# LANGUAGE OverloadedStrings #-} --
--
import Turtle --
--
str = "Hello!" --STR=Hello!
--
main = echo str --echo $STR


this will never be popular. there needs to be a haskell fork which lets someone write a hello world script in 1 line with no configuration, as easily installed as python and just as ready to go
>>
>>61297553
Don't worry about it desu, resources getting stuck in limbo is an accepted risk when you force quit a program
>>
>>61297672
fair point, ye

also I heard that there are tons of legacy perl out there, how true is that?
>>
https://en.wikipedia.org/wiki/Redox_(operating_system)

best OS
>>
>>61297707
pray that you don't get a gov't or uni job
>>
>>61297763
best language too
>>
File: gellar.jpg (327KB, 800x1215px) Image search: [Google]
gellar.jpg
327KB, 800x1215px
>there are compiler written in go
>>
File: 1441530535946.jpg (54KB, 662x684px) Image search: [Google]
1441530535946.jpg
54KB, 662x684px
>there is no OS written in Haskell
>>
>>61297681
It can actually leave their computer in an unresponsive state, and they will need to hard-reboot.
I'm writing some shit for a wayland compositor, so one of the things the library does is take over the virtual terminal. I just want to reset the virtual terminal to its default state.
>>
>>61297681
No it isn't you baka, that is only the case on SIGKILL. Allowing your process to leak system resources is terrible Unix etiquette.
>>
>there are antivirus written in sepples
>>
>>61297782
https://en.wikipedia.org/wiki/House_(operating_system)
>>
File: 1384570285362.jpg (87KB, 640x512px) Image search: [Google]
1384570285362.jpg
87KB, 640x512px
>>61297807
>>
>>61297824
If you knew the ways how antiviruses fornicate with your windows kernel you'd be terrified
>>
>>61297673
>
{-# LANGUAGE OverloadedStrings #-}


God haskell is such trash.
>>
File: 1495795105772.png (126KB, 816x754px) Image search: [Google]
1495795105772.png
126KB, 816x754px
>>61297824
don't worry bruh, what could go wrong?
>>
>>61297831
>desire to know more intensifies
About what? The library or the fact that my program can leave your computer unusable?
>>
>>61296408
You have to do invalidate() or something if it's a shape or drawable I think. Ask SO, I'm not at my laptop so I can't check for ya
>>
/dpt/ is this a good idea for an app?
>detect user's hardware
>match it against an online database
>download low level code
>run it
>it's specially tailored to exploit any known hardware design flaws and thereby inflict physical damage on the machine
>>
>>61297890
what sort of wayland project are you working on?
>>
>>61297897
Windows does a pretty good job of that already.
>>
>>61297897
Sup NSA
>>
>>61297860
Do you even know what that means? Overloaded strings is actually a really neat feature
>>
>>61297921
It's a library handling a lot of the backend sort of shit for a wayland compositor. It's being written as a replacement for another similar library.
I've probably already given away too much information. You may be able to find it without too much effort.
>>
>>61297933
Its not the feature i disagree on, its the Xtension system thats trash.

Also overloaded strings wouldnt even be a thing if haskell just had dependent types.
>>
>>61297895
>>61296408

Changed it to a runnable, and used postDelayed for the timing method and it seems to work. I got this to work with one Stoplight (or button), so now I want to try and get it to work with multiple buttons. I was thinking interating through an array or list of 3 values to switch between the buttons but I'm unsure how I would get the timing to work for it to delay between each three buttons, since it will just iterate through the list without the pause and all the runnables will start going at the same time.
>>
>>61297964
can you explain how? dependent types is memed on here hard but I've never got the meme
>>
>there are OS written in Go
>>
https://insights.stackoverflow.com/survey/2017
>>
Don't know where else to ask this and don't want to shit up the board with a whole thread for it.

If I wanted to build up a big knowledge base (programming, general comp-sci, networks, etc) what books would you recommend I read? (Programming-wise, I'm learning Python right now but I'm open to anything)

Assuming I'm starting from a level of zero-knowledge (I'm not but I'd prefer to build from the ground up)
>>
>>61298152
>90% male
lmao
>>
>>61298158
Start with the basics of comp-sci I guess
>>
>>61298152
>most loved language
>rust
holy shit
>>
File: 1469418388643.jpg (8KB, 250x238px) Image search: [Google]
1469418388643.jpg
8KB, 250x238px
>>61298152
>72% web developer
>>
>>61298163
>even less professionals than hobbyist
>75% white
>1% blind
>~70% white across all major fields
>>
>>61298152
>For the second year in a row, Rust was the most loved programming language. This means that proportionally, more developers wanted to continue working with it than any other language.
based
>>
>>61298152
>perl is the least wanted language
BAHAHAHAHAHAH
>>
>>61298222

I highly doubt most of the respondents even know Rust, and probably only selected it because it's the new "in thing" with its progressive SJW CoC cuckoldry.
>>
>>61298152
>students
>8.3% women
>4.4% ill
wew
>>
>>61298240
This is the worst post I have ever seen. Go back to >>>/pol/
>>
>>61298249
Today i shall remind them.
https://github.com/rust-lang/rust/issues/41646
>>
>>61298240
you're likely correct
>>61298236
literally started learning perl today
>>
>>61298168

Just wondering if there was anything you've read that you liked and felt was comprehensive.
>>
>>61298240
Wrong. You didnt read how the statistic is derived. You have to be currently programing in Rust to be included.
>>
File: file.png (14KB, 773x198px) Image search: [Google]
file.png
14KB, 773x198px
*cough*
>>
>>61298305
>a google backed language pays alot
gee, who would have guessed.

And anyone who is sane or functioning enough to write and maintain scala deserves more.
>>
>>61298305
>that UK tab
kms
>>
>>61298293
>You have to be currently programing in Rust to be included.

There is absolutely no way for them to verify that. "Currently programming in" means you could have written hello world.

>>61298249

Programming and politics are the same thing. Leftists and other CoC supporters need to be dropped out of a surplus Chinook over the atlantic.
>>
>>61298359
>Programming and politics are the same thing
Fucking kill yourself.
>>
>>61298380

Wrong.
>>
>>61298359
is quicksort left wing or right wing?
>>
>>61298305
>grand total of 15 jobs
>but they pay well!
fuck off
>>
>>61297506
>implying that meme won't die the moment google gets bored with it in one of their schizo moves
>>
PS C:\Users\justin\Documents\perl-programs> perl6 .\name.pl
What is your name?
Justin
Hello, Justin!
PS C:\Users\justin\Documents\perl-programs>


anyone else /perl%38powershell/ here or just me?
>>
>>61298305
that's because the only people who use it work at google, idiot. you're not going to be quizzed on your Go knowledge in a google interview
>>
>>61298533
Dont see the purpose of perl, even as a toy language.
>>
>>61298557
what do you mean? it's a general purpose scripting language, is it not? perl6 also has functional influences from haskell, except it's useful
>>
>>61298557
i once worked with a team of pajeets who wrote unmaintainable perl
>>
>>61298612
I think anon meant she doesn't see the purpose of using perl in 2017.
>>
>>61298640
perl's widely known to be a write only language, if you mean you couldn't understand their code
>>
>>61298640
>unmaintainable perl
that's redundant, isn't it?
>>
>>61298646
the purpose is to create scripts
>>
Can someone settle this for me; does Java have unisgned int's or not? One person says yes, one says yes but they're objects not primatives and someone else says no.
>>
Hey /dpt/, long time no see.

I was wonder what you all might think about my new compression algo. The objective is to minimize transmission length.

The algorithm is very simple:
1. Find the data you with to encode in the digits of pi.
2. First transmit the position where the data begins, then transmit the length of the data.

Here's an example:
The data I wish to transmit is "12345678"
So, I find this sequence in pi, and then transmit the location of that sequence, followed by 8 - the length of the sequence.
Thus, I transmit 186557266, followed by an 8.

What do you guys think?
>>
>>61298698
yes
>>
>>61298707
Primatives or object uint's?
>>
>>61298741
yes
>>
>>61295410
Writing a basic chat program, just started.
>>
>>61298741
>>61298745
sorry I was just shitposting, I actually have no idea
>>
>>61298704
It's fucking brilliant.

It's based on an unproven conjecture, so it may or may not halt, and it's average compression ratio assuming the conjecture is true could be conjectured to be 1 over n!
>>
>>61298704
not proven to work
>>
>>61298801
>>61298843
To speed it up, I'll make it lossy, and just find the first sequence that is a 70% match.
>>
>>61298892
also not proven to work
if the start is > than the size of the data you wish to compress, you've not compressed it at all
>>
>>61298892
That really boosts the compression ratio from 1/n! to (0.7n)/n! In some use cases that could be a millionfold or more compression savings!

Good work anon!
>>
Long term FPGA project. Making the custom micro DSP currently.
>>
>>61298907
Thanks! :)
>>
>>61298915
what is the project?
>>
>>61298240
>>61298359
Fuck off back to plebbit you attention whoring tripshitter. I've seen enough of you bullcrap. Get the fuck out.
>>
>>61298979

Dont want to talk about what the full project is, imma gonna make some money off of it!

I will say there is a heavy signal processing component to it, hence the micro DSP. rather than using a core ip processor of the FPGA I am designing the processor from scratch, so it is very small, so I can instantiate a bunch of them
>>
File: dickslap.png (6KB, 202x147px) Image search: [Google]
dickslap.png
6KB, 202x147px
0x400b56    push   rbx
0x400b57 mov rbx,rdi
0x400b5a jmp 0x400b7b <configure+37>
0x400b5c add rbx,0x1
0x400b60 call 0x400a40 <__ctype_b_loc@plt>
0x400b65 mov rdx,QWORD PTR [rax]
0x400b68 movzx eax,BYTE PTR [rbx]
0x400b6b movsx rcx,al
0x400b6f test BYTE PTR [rdx+rcx*2],0x1
0x400b73 jne 0x400b5c <configure+6>
0x400b75 cmp al,0x23
0x400b77 jne 0x400b7b <configure+37>
0x400b79 jmp 0x400b79 <configure+35>
0x400b7b cmp BYTE PTR [rbx],0x0
0x400b7e jne 0x400b60 <configure+10>
0x400b80 mov eax,0x0
0x400b85 pop rbx
0x400b86 ret

What the actual fuck, GCC?

>0x400b79 jmp 0x400b79
Seriously?
>>
>>61299046
Cute. What about picoBlaze?
>>
>>61299048
its an optimization goy
>>
>>61299068

picoblaze is too general and likely too big. I am to optimize area and I will likely beat out picoblaze with my implementation.

Its not that complicated of a processor I'm making, but is very specific to the application.
>>
Reminder that "computers" are an object oriented imperative mutative nonfree bloated slow poo in the loo LIE!!!! Built on the pure functional stateless truth of more general logic circuit design. Electrical components are the perfect physical implementation of lambdas. Unfortunately they aren't first class -- you can't send a component as an electrical signal between other components -- but you can compose them, map them, curry them, fold them, and so on. Processors are a LIE! You do NOT need a CPU, or even an ALU, to do extremely efficient high level functional programming that runs MUCH faster than what passes for a """""computer.""""" Just grab some copper wires and a soldering iron, "write" your program, and hook it up to a battery.
>>
>>61295410
I'm working on homework and I'm stuck, could someone assist me?
 During the tax season, every Friday, J&J accounting firm provides assistance to 
people who prepare their own tax returns.
Their charges are as follows.

a. If a person has low income (<= 25,000) and the consulting time is less
than or equal to 30 minutes, there are no charges; otherwise, the service
charges are 40% of the regular hourly rate for the time over 30 minutes.
b. For others, if the consulting time is less than or equal to 20 minutes,
there are no service charges; otherwise, service charges are 70% of the regular
hourly rate for the time over 20 minutes.

For example, suppose that a person has low income and spent 1 hour and 15 minutes,
and the hourly rate is $70.00. Then the billing amount is 70.00 * 0.40 * (45 / 60) = $21.00.

Write a program that prompts the user to enter the hourly rate, the total consulting time,
and whether the person has low income.

The program should output the billing amount. Your program must contain a function that
takes as input the hourly rate, the total consulting time, and a value indicating whether
the person has low income. The function should return the billing amount.

Your program may prompt the user to enter the consulting time in minutes.


What I'm having a problem with it where it says,
>For example, suppose that a person has low income and spent 1 hour and 15 minutes,
and the hourly rate is $70.00. Then the billing amount is 70.00 * 0.40 * (45 / 60) = $21.00.
I'm an idiot, how do I apply this formula to my code? Everytime I enter the hourly rate at 70 and the time at an hour and 15 minutes, it returns either 28.
For one thing, what the hell is the (45 / 60) for? Did they subtract time by 30 for some reason? Please help me out here.
>>
>>61299124
Is there a specific board would be good for instantiating a lot of cpus?
>>
File: Automata_theory.svg.png (15KB, 300x225px) Image search: [Google]
Automata_theory.svg.png
15KB, 300x225px
>>61299380
anything more complicated than a boolean function requires state my man
>>
>>61299384
>the service charges are 40% of the regular hourly rate for the time over 30 minutes
>did they subtract time by 30 for some reason?
hmmmm
>>
>>61299384
Actually fuck me in the ass, time is a keyword. Disregard my retardness everyone.
>>
>>61299430
That's a lie. Combinatorial logic is only inferior to a Turing machine insofar as those of its features used to implement one are concerned. Beyond that, it's actually a fairly rich boolean lambda calculus. Any program you can throw at me I can "write" in circuitry and have it be stateless and faster than the computer equivalent.
>>
>>61299380
Fuck off FPGA vendor. I don't wanna buy your products.
>>
>>61299490
>FPGA
You misunderstand.
I'm talking about even more specific- purpose circuits.
Like, building a whole independent circuit from scratch for every computational task, and having them not be connected in any way.
>>
I have an interview with Tinder tomorrow. Wish me luck, anons.
>>
>>61299511
if you get in you gotta hook up dee pee tee. give us all with matches with sloots
>>
>>61299380
God created the world and he made it "object-oriented" and "mutative".
I am a programmer = I am a lesser God. God created me in His image, and I honor God by designing my programs (worlds) in His image in return.
>>
>>61299534
>there is only one God
>>
>>61299436
Still, what is the 60 for?
Here is my current code
double bill(int earnings, int aTime, double rate){
if(earnings <= 25000 and aTime <= 30){
cout << "A"<<endl; //debug
return 0;
}else if(earnings <= 25000 and aTime >= 31){
aTime = ((aTime - 30)/60);
rate = rate * 0.40;
return rate * aTime;
}
}
>>
>>61299547
i'm not gonna spoonfeed you this sorry
>>
File: 1496863763581.gif (203KB, 248x225px) Image search: [Google]
1496863763581.gif
203KB, 248x225px
>>61299564
That's alright. I figured out where to place the 60 and the significance of it just a few seconds ago. Working on the next two conditions now.
>>
>>61299048
Canary of some sort? Are you sure you're not in crt0?
t.can't read that awful x86 crap

>>61299124
That does sound oddly specific. At least you have the luxury of letting the FPGA architecture define your ISA rather than vice versa. I take it you're constraining the hell out of your building blocks?

>>61299391
Not a board, but some FPGAs have better interconnects for that sort of thing. It depends on the layout and the details of your basic block, really.

>>61299506
>muh artisanal small-batch organic analog computers
Yeah nah.
>>
>>61299473
Is what you're talking about something like this?
http://foswiki.cs.uu.nl/foswiki/pub/Cco/CourseResources/new_implementation_technique.pdf
I'm having trouble understanding what you mean.
>>
>>61299391

You mean a specific FPGA? No, really depends on is you want a CPU that is vendor specific IP or an included hard CPU (some FPGAs have several).

In my case I am building a tiny one and am limited by the FPGAs capacity (logic cells). If it is not big enough, I move up to a larger FPGA, or scrap the project if that breaks my BOM price.
>>
>>61299473
Then write me a combinatorial kitchen timer.
>>
>>61299728
It would ring instantly. The output would be correct and it would be faster than the ones which use microcontrollers.
>>
How do I properly learn haskell? I already made a neural network on it, but I don't really feel like I learned much other than how to use the linear algebra library I decided to use.

Any idea on a way I can learn how to use some of that juicy category theory stuff in my programs? I feel like I can do anything on haskell right now but it would take too much time, I want to get to the point where I'd rather do things in haskell than in python or javascript, like I do right now.
>>
>>61299786
write an interpreter for a custom, typed language of your own design
>>
>>61299786
>How do I properly learn haskell

You should find a company that uses it and ask somebody who works there how it's used professionally.
>>
>>61299843
I'm a mathematician though, I'm not going to be hired by a webdev company
>>
>>61299786
>I feel like I can do anything on haskell right now but it would take too much time
Haskell is a playtoy for academics.

>>61299843
savage
>>
>>61299852
>R is a playtoy for academics.
>M.GT is a playtoy for quants.
ok
>>
>>61299849
can you use the following libraries

>mtl and/or transformers
>lens
>containers
>parsec or similar
>text and bytestring

and the following extensions

>Rank2Types or RankNTypes
>Existential Quantification
>Pattern Synonyms
>GADTs
>DataKinds
>MultiParamTypeClasses

?
>>
>>61299776

Connect battery to buzzer. There, I optimized your circuit. Now you don't even need combinational logic.

You have got to be going for a laugh here.
>>
>>61299901
That is combinatorial logic. It's the identity combinator.
>>
>>61299914

You pedantic fuck.
>>
>>61299843
I personally know someone who professionally writes Haskell. He's a turbonerd neckbeard but he's quite knowledgeable.
>>
>>61299987
Ah, but what does he *do* with it, out of curiosity?
>>
>>61297249
>VB.net actually rose
>>
>>61300006
Correct that, I actually know two.

One mostly writes in another language, but he writes programing tools in Haskell. He just finished a config-swapping utility. You can find it on github but I'm not linking it. The other (the neckbeard) works in security, he mostly writes tools that scan client's networks for vulnerabilities and similar things.
>>
>>61300013
Who even writes in VB.NET other than old VB6 developers are used to the syntax? If you aren't already a VB developer I cannot see how the syntax would be appealing at all, it's so ugly.
>>
what ever happened to that gftp server with a bunch of books. or that one massive torrent with like a billion books on it
>>
>>61295410
I don't understand why gcc is bitching about this code.

 27 static int menu_compare(const void * a, const void * b) {
28 const menu_instance ** ac = a;
29 const menu_instance ** bc = b;
30 ....

Here's what GCC spits out at me:
menu.c: In function ‘menu_compare’:
menu.c:74:30: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
const menu_instance ** ac = a;
^
menu.c:75:30: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
const menu_instance ** bc = b;


This code doesn't generate any errors though:
 22 int triple_compare(const void * a, const void * b) {
21 const triple * ac = a;
20 const triple * bc = b;
21 ...
>>
>>61300184
Install clang.
>>
>>61300184
Take a deep breath, look at the stars and you shall know the answer.
>>
>>61300184
const menu_instance *const *ac = a;
const menu_instance *const *bc = b;

Your const is 1 level too deep.
>>
>>61300116
The site's still up:
https://g.sicp.me/books/
Am curious about the gftp server though.
>>
File: 1498948825545.png (339KB, 387x550px) Image search: [Google]
1498948825545.png
339KB, 387x550px
>>61300184
>MMXVII
>unironically coding in C
Off yourself.
>>
https://lkml.org/lkml/2017/7/6/577

>And yes, a large part of this may be that I no longer feel like I can trust "init" to do the sane thing. You all presumably know why.
>>
>>61300262
>>>/g/fglt
>>
>>61300262
....why?
>>
>>61300208
Thanks anon! That makes sense. Hopefully won't make that mistake again.
>>
File: 1499486904283.gif (577KB, 540x540px) Image search: [Google]
1499486904283.gif
577KB, 540x540px
>1200 page book
Is it possible to learn C++ anymore?
>>
>>61300297
Linus has never been bright. No surprise he's hating on systemd. There's a reason we acknowledge Stallman as the real genius and father of the whole thing, you know.
>>
>>61300262
>>61300297
there is a thread about this, I hadn't seen it:
>>61300062

>....why?
systemd
>>
>>61300313
learning C++ is undesirable
>>
>>61300352
useless*
>>
File: file.png (43KB, 640x607px) Image search: [Google]
file.png
43KB, 640x607px
This nigga serious?
>>
>>61300423
>"Hello, world!.".getBytes()
Eww.
>>
New thread:
>>61300449
>>61300449
>>61300449
>>
>>61300423
OOP(S) is a cult
>>
>>61300423
you see this weird view a lot in academics, constantly spewing "tightly coupled" and "burden of knowledge" over practical application

we use high level abstracts all the time but people like this want to bring us back down to the age of assembly to maintain purity, it's just ridiculous
>>
>>61300116
Careful with opening pdfs.
>>
>>61297348
You and me both, buddy
>>
>>61297147
Higher education is a bubble.
Thread posts: 317
Thread images: 40


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.