[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 35
File: mastercode.gif (1 MB, 1280x1024) Image search: [Google]
mastercode.gif
1 MB, 1280x1024
[Daily Programming] Thread

What are you working on, anonymous ?
>>
>>51251359
1st for Go
>>
SQLite access with Haskell, should be pretty easy.
>>
Rewriting the linux kernel in haskell.
>>
Rewriting the linux kernel in Go
>>
Rewriting the linux kernel in Rust
>>
Nothing its my day off and I'm hungover as shit.

Although I have started to look into F# and its neat.
>>
>>51251406
Rewriting the linux kernel in C#
>>
>>51251428
Godspeed based anon
>>
Rewriting the linux kernel in Delphi
>>
>What are you working on, anonymous ?
Adding some syscalls to the kernel.
>>
>>51251390
how are you gonna use your database without sideeffects anon?
>>
File: s.png (831 KB, 679x674) Image search: [Google]
s.png
831 KB, 679x674
I'm learning R, Python, and SQL so I can get a job fapping to all your precious data.
>>
File: shitposter.webm (3 MB, 1280x720) Image search: [Google]
shitposter.webm
3 MB, 1280x720
Ask your beloved programming literate anything.

>>51251100
What do you expect from a mentor ?
>>
Correcting the 30th shitty bin tree implementation in C by java babbies.
>>
File: DSC03916.jpg (125 KB, 1211x1210) Image search: [Google]
DSC03916.jpg
125 KB, 1211x1210
>>51251359
I'm actually writing a kernel.

Adding multiprocess support right now, using shitty round-robin scheduling.
>>
Last thread, someone had a question about mingw-w64 and Ada. I have a response for them if they are still around.

>>51250336

I have mingw-w64 installed on my computer, and with it, GNAT 5.1.0. It supports Ada 2012 with the -gnat2012 option (actually, this is the default). Searching through the adalib and adainclude directories, I could not find anything related to "Ada Core". Indeed, the substring "core" did not appear in any of the .ali, .adb, or .ads filenames. It is therefore safe to assume that with mingw-w64, applications have the GCC linking exception applied to them, and one can make non-GPL applications with it.
>>
>>51251459
are you a TA or something?
>>
File: 1441488596897.jpg (49 KB, 613x574) Image search: [Google]
1441488596897.jpg
49 KB, 613x574
Can someone write me a program that can teach me and my friends how to hit the quan?
>>
File: 1377120235127.jpg (1 MB, 1280x800) Image search: [Google]
1377120235127.jpg
1 MB, 1280x800
I fucking love java.
>>
I want to implement a node structure in python, so what i want to do is make an array of "child nodes" but i dont know how to do so, because normally if you want to make an array you just write a = [] but i neet to insert an entire object so i can point to it
>>
Rewriting the linux kernel in Smalltalk
>>
>>51251502
wait 'til you learn a lisp
>>
so, I have this small project (webapp) to which I want to add features... and now, after writing (and again) a few files, I feel it's a burden instead of something I want to do.
FML.
>>
>>51251498
Quan?

>>51251502
I don't. But then again, I like my programs to either run really fast (C, C++), or to be able to be written really fast (Ruby). I am less interested in compromising on both.
>>
>>51251452
I'll keep my side effects neatly tucked inside a monad.
>>
>>51251502
meanwhile, in reality:
http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/
>>
Rewriting the linux kernel in Emacs Lisp so that I never have to leave Emacs again.
>>
>>51251550
It's there a lisp with C syntax?

I just don't like how lisp look (parenthesis).
>>
>>51251552
You should switch to an inherently enjoyable language so that the mere act of writing code becomes a worthwhile experience. I suggest Haskell, but OCaml is good too.
>>
I have a class templated on <typename ... T>
should my constructors take
std::tuple<T&&...>&&
std::tuple<T...>&&

or both
>>
VIM OR EMACS
>>
>>51251576
Someone should at least rewrite the C parts of emacs that handle all the sys calls in an embedded Lisp implementation like GCL
>>
http://pastebin.com/a1Zs5KrK trying to figure out why this is crashing or not working at the specific parts mentioned.
>>
>>51251609
it's not really the language, is the lack of knowledge, experience and motivation that kills me.
I still need to build a DB and an API, and I don't want to fuck up... the site itself was the easy part, apparently

>>51251628
Vim >>>> emacs
>>
>>51251600
>I just don't like how lisp look (parenthesis).
What are you a fashion designer?
>>
>>51251428
Rewriting the Linux kernel in F#
>>
>>51251600
Standard ML
>>
>>51251502
Hey man, I'm a masochist too, but don't you think that's a little too far?
>>
>>51251600
microemacs, its what Torvalds uses
>>
>>51251628
spacemacs
>>
>>51251600

It wouldn't be Lisp then. The key defining feature of Lisp is homoiconicity. That is, that data can be code and vice versa. The syntax behind lisp and scheme is extremely simple, to the point that you could probably fit everything you need to know on a couple of notecards. Everything else is just knowing the standard library.

Also, most text editors provide parenthesis matching features. Who cares if you have )))))))))) if you know what each parenthesis matches to simply by having your cursor next to it?
>>
Working on my bachelor's thesis. It's a 2D visualization of a path-finding algorithm. The platform is WPF and MonoGame.
It'll have built-in map/vehicle editor so I'm currently coding serialization.

Am I the only one who thinks that C# attributes make the code barely readable?
>>
hey guys i wanted to start developing, but I have no idea where to start. I'm learning java right now, and i wanted to make a bot for this discord server im in. problem is i have no idea how to work with the API, and i don't know where to look
>>
>>51251685
because it looks like garbage.
I rather keep using java than to use something I like because it's magical or some BS.

I learned to code to make games, not to masturbate to CS topics.
>>
>>51251622
T2&&...
>>
>>51251712
>java for games
That's almost as retarded as using FP for games.
>>
>>51251692
>path-finding algorithm
which one?
>>
>>51251692
>Working on my bachelor's thesis. It's a 2D visualization of a path-finding algorithm.

... What? That's trivial, Freshman-tier
>>
>>51251725
desu i might give up on move and add it in some other time
>>
File: lol1.jpg (60 KB, 380x500) Image search: [Google]
lol1.jpg
60 KB, 380x500
>>51251712
>>
File: 1443738621478.jpg (353 KB, 1000x1000) Image search: [Google]
1443738621478.jpg
353 KB, 1000x1000
>>51251692
>bachelor's thesis
>2D visualization of a path-finding algorithm
what... how does that qualify as a bachelor's thesis?
>>
File: UR1AWlY.jpg (10 KB, 441x408) Image search: [Google]
UR1AWlY.jpg
10 KB, 441x408
>>51251600
>It's there a lisp with C syntax?
>I just don't like how lisp look (parenthesis).

>>51251712
>because it looks like garbage.
>I rather keep using java than to use something I like because it's magical or some BS.
>I learned to code to make games, not to masturbate to CS topics.
>>
>>51251694
you start with the greeks


seriously now, docs are here: https://docs.oracle.com/javase/7/docs/api/ (java 7)
>>
>>51251692
Literally one (1) hour in python + pyQt.
>>
>>51251502
What is that the shit mantra?
>>
>>51251811
Do it then, fggt
>>
>>51251824
>mfw he does it
>>
>>51251782
oh i meant i dont know how to work with the discord API unless these are the same thing
>>
>>51251824
which algorithm faggit?
>>
>>51251735
Nothing specific. We (me and two collagues) have to come up with something. The vehicle is a polygon that can only move forward and rotate in place. Maps are composed of other polygons.

>>51251740
>>51251773
>>51251811
The space is linear, not a grid so I wouldn't say it's freshman level. We also have to provide polygon editor by point & click and bitmap tracing.
>>
>>51251853
>inb4 A*
>>
>>51251847
nm, I misread, I have no idea what you are talking about
>>
File: why.png (214 KB, 500x375) Image search: [Google]
why.png
214 KB, 500x375
Hi guys,

Basically I need to make a rather simple Android app with a register and login forms, picture uploading and payment information. I have ~3 days to develop something what looks like an app. I have no experience with Android and I'm downloading the Android SDK and JDK as we speak. How fucked am I?
>>
okay nerds, how do I code a shmup enemy bullet?
how do I code that it should move in a curve, not just a straight line.

remember that I barely remember anything past elementary school arithmetic.

pls no bully.
>>
>>51251879
unless you use libgdx, you're pretty much fucked.
>>
>>51251886
https://en.wikipedia.org/wiki/Trigonometric_functions
>>
>>51251879
To make it funnier: I use a fucking mac.
>>
>>51251886
take a class on math
>>
>>51251667
That's an editor, not a language.

you dipshit.
>>
>>51251907
Just believe in yourself and you'll be fine. :^)
>>
>>51251502
>Not living by the C mantra
- Trust the programmer.
- Don’t prevent the programmer from doing what needs to be done.
- Keep the language small and simple.
- Provide only one way to do an operation.
- Make it fast, even if it is not guaranteed to be portable.
- Maintain conceptual simplicity
>>
>>51251915
>asks retarded question like is there lisp without lisp's syntax
>gets retarded answer
You really should kill yourself
>>
>>51251899
>>51251918
Thanks guys :)
>>
>>51251948
((((( ( (
slowly
)))))))()
>>
>>51251879
android studio
>>
>>51251773
This. It's barely highschool level.
>>
File: how.png (48 KB, 720x618) Image search: [Google]
how.png
48 KB, 720x618
wtf is this and how it works?
pls sponfeed a retard pls.
;u;
>>
>>51251600
OpenDylan is pretty much that.
>>
Anyone know any matlab? I have some colored squares on a white background and I'm trying to get a script that will read the image and give me the area of the square on the image. I remember reading on here once that matlab is pretty good for image manipulation and reading. Anything would be helpful.
>>
>>51252023
>:=
>>
>>51252023
l2trigonometry
>>
>>51252023
https://en.wikipedia.org/wiki/Sine
https://en.wikipedia.org/wiki/Unit_circle
>>
>>51251811
This. I did A* visualization with java and swing and it took less than half an hour, and I had never used swing before nor implemented A*.
>>
>>51251886
fucking fuck the fuck off you stupid fucker
>>
>>51252023
read a chapter on highschool trigonometry lmao
>>
File: 1425532265051.webm (208 KB, 507x953) Image search: [Google]
1425532265051.webm
208 KB, 507x953
>>51252023
>>
>>51252023
haha I learned this in like precalculus literally every 14 year old in the US knows this come on son
>>
>>51251940
>Provide only one way to do an operation

Are you sure this is C?
>>
>>51252098
>ameridumbs
>knowing math
>>
>>51252023
lemme guess: you want to make games
>>
>>51251861
I did LITERALLY that (not the point and click editor, I just had to put vertices in a text file) in my second intro CS class.
>>
>>51252112
He's the shmup guy from before, noob. Lrn2samefag detection.
>>
>>51252098
>implying I remember anything from high school
>>
>>51252023
>>51252153

x = cx + r.cos(t)
y = cy + r.sin(t)
∀ t ∈ [-π, π]
>>
>>51252109
What duplicate functions (considering only standard library and the language itself) does C have?
The only thing I can think of is /% and div().
>>
>>51251861
I sure as hell hope you get F- for this garbage.
>>
>>51252161
ffs
[-π, π)
>>
>>51252161
Oh, I wasn't the original poster, just stating that all 4 years of high school have been wiped from my mind
>>
>>51252139
>>51252164
Wow, you're so amazing. Also, wait more than one minute between consecutive posts if you want to look like two different posters.
>>
>>51252186
are you one of those people who always says that I shouldn't go to college because you can learn everything on your own in a library? I would put money on it
>>
>>51252163
*(a + i) is a[i]

x->y is (*x).y

There are a million different functions to print, copy, take input, etc. and most of them are huge security vulnerabilities.
>>
>>51252229
Naw
I just forgot everything
>>
>>51252245
relearn it, maths is cool
>>
>>51252140
m8, do you know how hard is to never put attention in high school about STEM shit because you were too busy trying to learn to do art?

I barely remember elementary school arithmetic.

you know how easy is to watch youtube lectures aimed at kids about high school math when you're like 27?
>>
>>51251502
/g/ likes to shit all over Java, but in terms of actually getting shit done, it's really hard to beat. Sure, there are other languages with very interesting ideas, but I really don't care if some language feature can turn 4 lines of code into one if I still have to write another 100,000 lines because of the lack of quality APIs and tooling. The reason businesses choose Java isn't because they are morons who aren't aware of Lisp or Haskell. It's because they know that it's far better to put up with some minor annoyances than to have to recreate the entire damn universe because those "better" languages don't have the required libraries and tooling.

I also find Java to be more predictable than other languages. Once you know Java, you will rarely find things that outright surprise you. Yes, there are some ugly parts to the language and some inconsistencies, but I find far fewer of those working with Java than other languages.

I'm working on a project now using Java with Spring Batch. I've made a huge amount of progress in a very short period of time. This project will take me a couple months where as it would probably take a full year to get it done with a /g/ approved language because I'd be dicking around with shit that Spring already handles for me. I want to focus on my pure business logic. Java is just better at that.
>>
>>51252055
>lying on an anonymous hungarian cooking site
>>
>>51252278
>/g/ likes to shit all over Java
dropped
>>
>>51252203
Wrong. I only have to say you're retarded once because you are retarded, and anyone can see that.

Please do a real thesis like making a DHT, OS, compiler, or SVM visualizer
>>
File: 1446754709042.png (160 KB, 318x365) Image search: [Google]
1446754709042.png
160 KB, 318x365
I have an exercise for you /dpt/.

Say you have base N numeral system. One can put all words in the canonical order like this:
//for N = 3:
e // epsilon a.k.a. empty word
0
1
2
00
01
02
10
..
22
000
001
...
0000
...

Word 'e' has index 1, Word '0' has index 2, '1' has index 3, etc.

You are given N and a word index. How do you generate the word?

>inb4 homework
>>
>>51252278
>The reason businesses choose Java isn't because they are morons who aren't aware of Lisp or Haskell. It's because they know that it's far better to put up with some minor annoyances than to have to recreate the entire damn universe because those "better" languages don't have the required libraries and tooling.
:^)
>>
>>51252278
nice bait you fucking idiot
>>
>>51252303
can you just take a picture of the homework question I can't visualize what you want to do
>>
>>51252303
There is literally NO WAY this is a serious question.
>>
>>51252303

N + 1
>>
>>51252303
This is literally just converting an integer to a string in a particular base.
>>
>>51252295
You sure do seem frustrated for whatever reason. Go take a chill pill.
>>
>>51252278
>because those "better" languages don't have the required libraries and tooling.
GUI builders.
C# is better :^)
>>
>>51252232
>There are a million different functions to print, copy, take input, etc
They all do things in different ways and have different semantics, making them not equivalent. Also C tried to preserve existing practice before it was standardised, making them have to include some questionable stuff like gets() (which they obsoleted and removed later).
>>
>>51252369
Nope. It easy to do the other way around (generate the index having given the word and base) but it's hard to find the smart way to do this.
>>
>>51252397
base<N>(i - 2)
>>
>>51251504
nvm, i did it like this:
class Node(object):

def __init__(self, data=None):
self.data = data
self.next_nodes = []

def get_data(self):
return self.data

def get_node(self, index):
return self.next_nodes[index]

def set_node(self, child):
self.next_nodes.append(child)

def get_length(self):
return len(self.next_nodes)

d = Node(5)
dd = Node(7)
d.set_node(dd)

for x in range(0, d.get_length()):
print d.get_node(x).get_data()
>>
File: 03.jpg (664 KB, 1280x800) Image search: [Google]
03.jpg
664 KB, 1280x800
>>51252397
>>
Is it possible to add lexical scope to elisp so it has both lexical and dynamic scope like common lisp?
>>
>>51252397
>if i tell him it's super difficult, he will solve it for me to prove me wrong :^)
>>
>>51252397
If you post the homework problem I will give you the answer.
>>
>>51252319
>>51252305
I suspect you've never built anything apart from simple FizzBuzz type programs. Sure, you can point out examples in the trivial cases where a language like Python is a lot less verbose than Java. I'd use Python or Bash scripts for simple jobs like that. But once you start scaling out into really complicated software, Java is just better.

>>51252376
No, not GUI builders. Most of the software I write doesn't have a GUI. Go look at Spring. On a related topic, that's one of my annoyances with Java EE. They always announce "new" features that Spring has had for years.
>>
>>51252442
 ;; -*- lexical-binding: t; -*-
at the top of every file. Using defvar and such is still dynamic as far as I know.
>>
>>51252303
solution in python
def get_word(N, i):
res = ""
while i > 1:
res = str((i+1) % N) + res
i = (i + 1) / N
return res or 'e'
>>
>>51252421
N = 4
i = 8
the correct answer should be '02'

i - 2 = 6
'6' base 10 is '12' base 4

Bravo.
>>
File: qa2ow.jpg (85 KB, 500x666) Image search: [Google]
qa2ow.jpg
85 KB, 500x666
I made this bash script to play all the webm's that we find in a 4chan thread


#!/bin/bash

curl $1 2>&1 | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2|uniq|grep webm |
{
while read p;
do mpv https:$p || break;
done
}



uses mpv
>>
>>51252488
The problem with your argument is that when Java was in its ascendancy it was not more feature-rich than other languages. Today it has a massive standard library but this was simply not always the case and anyone who isn't 15 knows this, and they therefore know that your entire argument is shit.

Java is popular because the average programmer is shit and companies who want to hire the average programmer don't want to use C or C++ where the average programmer will fuck up their entire world.

There is no reality in which a company almost used lisp but then at the last moment moved to java. The kind of companies that consider lisp would never consider java, though this isn't because java is a bad language.
>>
>>51252488
Like it or not GUIs are a big part of computers, not having a builder makes programming a pain in the ass when you're not doing simple tasks. They might not be the main part of the program (just an interface for it), but they're important nonetheless.
>>
>>51252545
>There is no reality in which a company almost used lisp but then at the last moment moved to java. The kind of companies that consider lisp would never consider java, though this isn't because java is a bad language.
There are a lot of companies who tried Scala and went back to Java, making an enterprise level OO/FP language was a failed experiment with Scala and so far no one has done anything better than Scala
>>
File: 1441100423026.jpg (85 KB, 640x640) Image search: [Google]
1441100423026.jpg
85 KB, 640x640
>>51252303
this is day 1 stuff kiddo your teacher just wants you to think in terms of "words" and shit. you literally just write a one liner that takes the "index" or whatever that means, store it in an integer and mod it by N -> store it, will be last element in word, then divide the index integer by N -> store it, attach last element to this word and you are done.
>>
>>51252550
It wasn't a matter of me "liking it or not". It's just that 90% of the work I do is backend server jobs and the other 10% that actually does have a UI will be a web based application.
>>
>>51252620
the use of the groovy language (basically a lot of syntactic sugar for java) has been pretty successful for java webapps in the grails framework
>>
>>51252524
N = 4
i = 8
the correct answer should be '02'

res = (9%4) + res = '1' (i = 2)
res = 3%4 + res = '3'+'1' = '31' (i = 0)

result '31'
wrong
>>
>>51252620
>assume scala is somehow better than java as a counterexample
>conclude that scala is worse than java
How young are you, really? 4chan is 18+. It may seem like the quality of posts here are low but it seems you are completely overwhelmed by your own incompetence because you've mistaken the usual shitposting for a room full of idiots like yourself.
>>
>>51252488
>FizzBuzz
try harder you stupid retard
>>
>>51251940
delusions.png
>>
>>51252303
Silly way to do it in a text editor:
- generate the word list up to N^(log(word_index)+1)
- goto line word_index

dunno if you can easily change ctrl+a's base, but that would be an easy way to generate the list in vim.
>>
for an unkknown reasons, i love everyone in this thread. mb its because you guys helped me everytime i ask for help. i m generally aggressive and hateful person, i guess there is hope for everyone. share the love
>>
>>51252645
As I said, it's not a home assignement. I used the term 'word' because originally this problem came up during my automata theory classes.

> just write a one liner that takes the "index" or whatever that means, store it in an integer and mod it by N -> store it, will be last element in word, then divide the index integer by N -> store it, attach last element to this word and you are done.
You didn't even think for once second, did you? Canonical order =/= lexicographical order.
>>
>>51252709
That was literally taken from the C99 rationale document though.
>>
>>51252684
Ah, I see. Okay. Here it is then.
def get_word(N, i):
res = ""
while i > 1:
res = str((i+N-2) % N) + res
i = (i + N - 2) / N
return res or 'e'

Cute problem
>>
>>51252725
Yeah, that's one way to do it. There is no (to my knowledge) a simple formula but it's possible to generate the word without generating all previous ones.
>>
>>51252771
I think it is a very good set of principles and if we followed it we wouldn't have bad languages like C++ and Java.
>>
>>51252747
We love you too. No homo.
>>
>>51252550
I used to use the WinForms designer a lot in my first few years programming
But nowadays I find it faster and easier to just create the GUI procedurally
>>
>>51252782
just realized that it could have been
res = str((i - 2) % N) + res


oh well
>>
>>51252827
Really? I find winforms designer a hell of a lot easier, it's the WPF one that's difficult to make things with without writing code.
>>
>>51251692
I'm in college but I'm like a fucking child in terms of creative academia. How do people come up with their {Bachelor,Master,Doctoral} thesis? Like, that seems pretty fucking hard even though I'm good at programming and math.
>>
>>51252860
Well, if you are going to that anon's college, you pick a really easy project that has been done a million times before and then code it up with some shitty proprietary libraries and maybe attach an essay explaining what it is and why it sucks
>>
>>51252860
I use my other hobbies as a source for inspiration and programs that I use that miss features I could elaborate on in my own program.
>>
>>51252303
so, essentially the problem is to convert a base 10 in to a different base, with a little bit of arithmetic?
>>
>>51252782
did you even test your shit
>>
File: program.webm (589 KB, 1296x758) Image search: [Google]
program.webm
589 KB, 1296x758
I wrote a program that pixelizes videos! How large the pixels are is dependent on the mouse X position. Here's the source:

import processing.video.*;
Movie forest;

void setup() {
size(1280, 720);
forest = new Movie(this, "words.mov");
noStroke();
forest.loop();
forest.volume(0);
forest.jump(25);
}

void draw() {
//tint(255, 20);
int counter = int(map(mouseX, 0, 1280, 5, 30));
for (int x = 0; x < width; x += counter) {
for (int y = 0; y < height; y += counter) {
fill(forest.get(x, y));
rect(x, y, counter, counter);
}
}


}
// Called every time a new frame is available to read
void movieEvent(Movie m) {
m.read();
}
>>
>>51252913
I'm sorry for the bad quality, and please excuse the screenpresso bullshit.

How does it look?
>>
>>51251359
Does Code Golfing make you a better programmer?
>>
>>51252817
Speak for yourself.
>>
>>51252908
yup, works fine
>>
>>51252856
The designer can get a bit tricky with lots of nested controls
And it's pretty handy if you just have to change a single variable to affect multiple controls

WPF is garbage in general
>>
>>51252913
Just imagine how hard the C fags would struggle to make a program like this.
>>
>>51252922
>I'm sorry for the bad quality
Isn't that the entire point of the program?
>>
>>51252902
For my projects I like to tie my other classes into it
I like chemistry so I'll write a program that solve a bunch of conversions and equations for me and that sort of thing

as a bachelors project it'd be something much more complicated but I could see something like cloning orbitalViewer (calculating statistically probably orbital fields based on repulsion factors and number of electrons in your valence)
>>
How to stop a window from being accessed via alt-tabbing... Any suggestions anon
>>
>>51252949
*probable
>>
>>51252922
It looks utterly useless
>>
File: pic-related.png (7 KB, 388x200) Image search: [Google]
pic-related.png
7 KB, 388x200
>>51252935
>>
>>51252944
And imagine how much faster it would run.
>>
File: kKfpe6G.jpg (250 KB, 800x532) Image search: [Google]
kKfpe6G.jpg
250 KB, 800x532
>>51252537
update: looks like there is a more simple playlist option for mpv


#!/bin/bash                                                                                                             

curl $1 2>&1 | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2|uniq|grep webm |sed -e 's/^/https:/'>playlist.txt

mpv --playlist playlist.txt
>>
>>51252913
make the framerate 60
>>
>>51252974
it just werks
>>
>>51252944
Just imagine how slow that program would run if all of the heavy lifting done in the background were written in a high level language instead of C.
>>
>>51252950
change its window style so it doesn't show up in the task bar
>>
>>51252947
I meant of the Webm. It looks surprisingly nice when ran. Very comfy in my opinion.

>>51252963
If things needed a use to exist then you wouldn't be here.

>>51252977
Find some 60fps footage and put this in the setup.
frameRate(60);
>>
>>51252974
Don't run my python2 code in your filthy python3 interpreter. Here, a python3 compatible version for your autism
def get_word(N, i):
res = ""
while i > 1:
res = str((i - 2) % N) + res
i = (i + N - 2) // N
return res or 'e'
>>
>>51252942
You know, I can never figure out whether WPF is meant to be good or not.
When I used it it was a hunk of shit.
When I look around the internet I see people saying
>WinForms is old and WPF is the replacement
>WinForms is no longer being supported, better start using WPF if you want to make programs for windows >8
>WPF is much better for [reasons]
It just seems to be missing a ton of features and some features are worse than before.
>>
>>51252996
your webm is definitely less than 24 fps is what I'm saying

looks more like 15
>>
>>51252782
Shit man. Now I'm embarassed to post my solution:
public Word(int canonicalIdx, int alphabetSymbolCount)
{
int length = 0;
for (int acc = 0; ; length++)
{
acc += Mathematics.IntPow(alphabetSymbolCount, length);
if (canonicalIdx <= acc) break;
}
int relativeIdx = canonicalIdx - new Word(new int[length]).GetCanonicalIndex(alphabetSymbolCount);
_word = Mathematics.ToBaseN(relativeIdx, alphabetSymbolCount, length);
}
>>
>>51252391
>damage control
>>
>>51252283
>>51252371
[butthurt intensifies]
>>
angular, node, express, and mongo :^)
>>
>>51253003
>python is so good!
>you should change and stop using your silly lisps / Cs / MLs / anything
>except when it gets new features, I don't personally like change
pythonistas everyone
>>
>>51252989
I'm obviously very autismal so correct if I'm wrong. I'm using node WebKit and removed it from the taskbar but I still see it when alt-tabbing, I'm going to use c++ handles to prevent focus but I don't think that'll stop it from being seen in the windows manager interface (alt-tabbing/win-tabbing)
>>
>>51252944
The code could look pretty much identical provided you had little "simple_gfx.h" and "simple_movie.h" libs.
>>
>>51253020
>if (canonicalIdx <= acc) break;
>empty for loop conditional

Uhh....
>>
>>51253080
Did you mean Mongo, Express, Angular and Node? The order matters mate.
>>
>>51253107
I don't want loop to check the condition before the first iteration.
Do-while would probably be a better idea but whatever.
>>
>>51253136
>Do-while
I use that so little I nearly forgot it exists.
>>
>>51253109
kek, thanks for the correction, m8
>>
File: program.webm (2 MB, 845x477) Image search: [Google]
program.webm
2 MB, 845x477
>>51253013
Honestly, every screen recorder tanks the FPS due to my computer being terrible. Here's another video where's it's *slightly* better.
>>
Would NASA be upset at me if I had profanities in my code on GitHub? Applying for an internship.
>>
does khan academy have CS courses?
I wanna master C.
>>
>>51253136
Hmm... you could just && it with length. Or use my awesome solution >>51253003
>>
>>51253198
They probably won't even look at it.
>>
>>51253204
>master C
>khan academy
lol
read a book
>>
>>51252303
unreadable C follows
#include <stdio.h>
#include <math.h>

int main(int argc,char **argv) {
int base = atoi(argv[1]);
int index = atoi(argv[2])-1;
if (!index) {
printf("e");
return 0;
}
if (base < 2) {
return 0;
}
int targetIteration = 1;
while ((1-pow(base,++targetIteration))/(1-base) < index+1) {}
index -= ((1-pow(base,targetIteration-1))/(1-base))-1;
int i,currentPower,currentDigit;
for (i=targetIteration-2;i>=0;i--) {
currentPower = (int)pow(base,i);
currentDigit = (index-1) / currentPower;
printf("%d", currentDigit);
index -= currentDigit*currentPower;
}
return 0;
}
>>
>>51253204
You're not "mastering" anything through Khan Academy, and no they don't have anything C related if I remember correctly.

Please don't fall in to the meme/trap that is C.
>>
>>51253210
alright, cool thanks
>>
>>51253008
People are just repeating what Microsoft says, even though WPF has been abandoned for years now

I personally only found it useful to display images because you can move/resize them on the GPU
But even there I quickly switched to a DirectX WinForms control because WPF startup times aren't very nice

And it's slower than WinForms in all other areas as well
>>
>>51253231
>Please don't fall in to the meme/trap that is C.
I love this "C is a meme" meme.
Upboated XDD
>>
>>51251359
Rewriting linux kernal in vb
>>
>>51252913
cool stuff! this could also be done (and probably more efficiently) with a GPU pixel shader program

Also, using the average value for the pixel (or in your case, just skipping various pixels) doesn't give a very good pixelized style

there are some techniques you can use to downsample things to look more 8bit, but
anyways, cool idea!
>>
>>51253235
Well, they *might*. But they wont be looking through your commit messages or anything so make sure there just isn't loads visible and you'll be fine.
>>
>>51253293
>probably more efficiently
>>
>>51253249
WinRT is now the new thing, right?
>>
>>51253309
I just have shit like
if (!thingthatisntworking()) puts("FUCK");

I'll get rid of them and commit a few times just in case
>>
>>51253293
Oh, it most definitely would be better. I'm just playing around with some stuff in Processing at the moment and thought I'd throw it together.

What would you say is the best method to get a "good" pixelized style?

>>51253318
Speaking in absolutes when talking about anything technical either makes you an expert or retarded. Some people aren't either.
>>
>>51253334
I wouldn't go out of my way to include things I would be embarrassed if I had to explain in an interview.

>somewhere in the code "obama doesn't care about black people" is nested into a function that will never be called or in comments sporadically littered throughout
>>
>>51252976
My 4chan download script does

files=($(curl "$url" | grep -o "i\.4cdn\.org/$board/[[:digit:]]\+\.\(gif\|jpg\|png\|webm\)" | sort | uniq))
>>
>>51253364
>What would you say is the best method to get a "good" pixelized style?
Limited amount of colours that fit nicely. No single pixels, only clusters.
>>
File: Slide058.jpg (57 KB, 960x720) Image search: [Google]
Slide058.jpg
57 KB, 960x720
>>51252771
I love how people love to claim they designed the C rational when it was an accident of history
>multics cancelled, Thompson is dicking around with pdp-7 which by that time is a dinosaur collecting dust
> makes video game, adds file system, adds editor, with Ritchie's help this slowly morphs in OS.
>memory is so tiny BCPL is only compiler that will run on it
>Ritchie turns B, a typeless interpreted language into a compiled semi-typed language
>home computer age starts, C and Pascal only two compiled languages in common use. C wins because it was designed to exist in tiny memory space from the beginning
>>
Reminder that 'programming' anything other than in C or lisp makes you a code monkey.
>>
>>51253436
what about C++
>>
I now finally understand the phrase "monads perform capture avoiding substitution".

Substitution is started using `fmap` and finished with `join`. Which, of course give you `>>=` when composed together.
>>
>>51253440
especially C++
>>
>>51253331
I've never used it, but considering it's intended for Windows Store Apps and doesn't work on Windows 7...

>>51253364
It would literary be about 1000 times faster using a shader
>>
>>51251600
The original LISP didn't have that parentheses syntax.
The LISP 2 project was going to have a surface syntax and an internal syntax.
http://www.softwarepreservation.org/projects/LISP/lisp2/TM-2710-101-00-LISP_2_Primer.pdf
>>
>>51253219
>atoi(argv[1]);
Undefined behavior nigga, you have to check argc before accessing that shit.
>>
>>51253414
Accident or not, it turned out very well.
>>
>>51253364
not exactly sure, I just remember using this shader one time and it looked like crap

https://web.archive.org/web/20150905100717/http://www.lighthouse3d.com/opengl/ledshader/
>>
Friendly reminder that every program written in non-OOP language doesn't translate to reality and is, therefore, inferior by design.
>>
Why do strings have to be so annoying?

>have to create a special string object
>can't dynamically change the contents of the string without a bunch of object functions to make sure it's the right length in memory at all times
>have to constantly create and delete strings just to change punctuation
>>
>>51253485
Uh, don't do that then™.
>>
>>51253465
Not a thousand times faster to write :^)
>>
>>51253494
>nobody will ever solve strings
>>
>>51253491
Computations don't exist in reality though.
>>
>>51253494
Don't blame whatever language you are using's shitty implementation of strings on strings in general.
>>
>>51253554
Objects, actions associated with them and interactions between them do.
>>
can anyone who knows Python/Flask tell me why this is giving me an internal server error?

@app.route('/books')
def books():
url = urllib.request.urlopen("http://www.amazon.com/gp/search/ref=sr_pg_1?fst=as%3Aoff&rh=n%3A283155%2Cn%3A5%2Cn%3A3839%2Cn%3A3944%2Ck%3Aprogramming&keywords=programming&ie=UTF8&qid=1447025233")
soup = BeautifulSoup(url)
links = soup.findAll('img', src=True)
for link in links:
print(link['src'])
>>
>>51253578
Nope.
>>
>>51253569
No. Strings are bullshit, and it's the fault of character arrays for existing.

>can't declare a string
>can't do a simple = "..." and change to a simple = "not ..." later
I mean, fuck. Why do I have to implement my own operator functions?
>>
reminder that if your language distinguishes between ``operators'' and "procedures" it's shit
>>
>>51253594
try
url = urllib2.urlopen('http://www.amazon.com/gp/search/ref=sr_pg_1?fst=as%3Aoff&rh=n%3A283155%2Cn%3A5%2Cn%3A3839%2Cn%3A3944%2Ck%3Aprogramming&keywords=programming&ie=UTF8&qi').read()
>>
>>51253641
operators have precedence, dipshit.
>>
>>51253494
Make your own string object, instead of it being a character array make it a character list.
C# has something similar called StringBuilder.
>>
>>51253662
>what is lisp
>>
>>51253662
lel
>>
>>51253688
>hey, let's confuse and mixup everything, right ?
lisp doesn't has any operators, only procedures. dipshit.
>>
>>51253688
Lisp has '(' and ')' as special tokens.
The only requirement a language should have is just some distinguished word separator (say white space), everything else should be re-definable.
>>
>>51253656
>>51253594
>urllib
why
you've already installed flask, go install requests
>>
>>51253740
>what is modifying the reader
Just learn lisp before you talk about it ok buddy.
>>
File: 1442534310070.jpg (214 KB, 345x336) Image search: [Google]
1442534310070.jpg
214 KB, 345x336
I love making very specific code for very specific problems. To hell with abstraction.
def search(arr, val):
""" if val is in arr, return val.
if val is in a subarray in arr, return the subarray"""
for i in arr:
if i == val:
return i
elif isintance(i, list):
tmp = search(i, val)
if tmp == val:
return i
>>
>>51253783
>I love making very specific code for very specific problems.
>python
:^)
>>
>std::set in C++ does NOT guarantee the uniqueness of its elements
ALL HAIL C++!
>>
>>51253778
In what language are you gonna write those reader macros?
>>
>>51253739
b-but muh precedence, dipshit
>>
>>51253742

i already have it installed. What parts of the code do i change?
>>
a CS teacher at my school says python is an interpreted version of C++
>>
>>51253839
The best one.
>>
To be honest, people mocking other each others favorite languages is very confusing for me as a noob. It feels like I've made a wrong choice.
>x is a meme
>loving "x is a meme" meme
>x >epic :^)
>using x >2015
>using anything but x
>reminder than only plebs use x
>>
>>51253742
instead of
url = urllib.request.urlopen("http://www.amazon.com/gp/search/ref=sr_pg_1?fst=as%3Aoff&rh=n%3A283155%2Cn%3A5%2Cn%3A3839%2Cn%3A3944%2Ck%3Aprogramming&keywords=programming&ie=UTF8&qid=1447025233")

do
url = requests.get("http://www.amazon.com/gp/search/ref=sr_pg_1?fst=as%3Aoff&rh=n%3A283155%2Cn%3A5%2Cn%3A3839%2Cn%3A3944%2Ck%3Aprogramming&keywords=programming&ie=UTF8&qid=1447025233")

and instead of
soup = BeautifulSoup(url)

do
soup = BeautifulSoup(url.text)
>>
>>51253865
>he fell for the CS degree meme
>>
>>51253867
>The best one.
Seems kinda pointless to write lisp reader macros in Forth, just use Forth for everything instead.
Thread replies: 255
Thread images: 35

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.