[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: 318
Thread images: 30

File: 1480774918481.png (503KB, 940x822px) Image search: [Google]
1480774918481.png
503KB, 940x822px
What are you working on,/g/?
Old thread: >>58496579
>>
First for Rust & C++
>>
Rust is SJW cancer. Avoid at all cost.
>>
suq my Coq
>>
>>58500308
Annoying af error that has no underlying cause. Can someone help?
>>
>>58500557
https://msdn.microsoft.com/en-us/library/ms235406.aspx

RTFM.
>>
Text editor poll continues
http://www.strawpoll.me/12023125
>>
macOS menubar application for MPD.
>>
>>58500500
Worthless used goods.
>>
File: Screenshot_2017-01-15_19-30-19.png (195KB, 859x852px) Image search: [Google]
Screenshot_2017-01-15_19-30-19.png
195KB, 859x852px
noto sans ui any better? doesn't look that modern
>>
>>58500688
She's not completely worthless.
>>
File: 1424380446087.gif (828KB, 200x189px) Image search: [Google]
1424380446087.gif
828KB, 200x189px
>>58500500
Working on TCP socket management for my decentralized TV (mostly SOCKS), as well as creating a general purpose stats library for picking optimal peers for certain types of data.

I also made an IRC channel for my project (#basictv on Freenode).
>>
>11 posts in
>nobody has thanked OP for using an anime image

so i guess this is reddit now
>>
>>58500500
I'm building 3 computers that can take decisions by themselves over the military facility where I work. Each holds a different treat of my personality. One is me as a manchildren, me as a faggot and me as an open source zealot. They are called Larry, Curly and Moe.

What could go wrong?
>>
File: 1482740438260.png (338KB, 1140x813px) Image search: [Google]
1482740438260.png
338KB, 1140x813px
>>58500500

what color makes you fastest?
>>
>>58500826
>thanking for something that always should be done
>>
>>58500800
I'm also working on a live chat system for TV channels, but that's pushing the limit for most residential connections and I'm more concerned with getting a general UI up (although I love the idea).

I need a better font
>>
>>58500874
When there were non-anime /dpt/, no one said fuck you to OP and created /dpt/ with anime OP.
>>
>>58500862
>What could go wrong?
Joining a military facility for one.
>>
>>58500863
Color depends on the programming language in question.
>>
>>58500863
Something that matches your editor's color scheme.
>>
Is webdevelopment the way to go for finding jobs?

I've hit a wall in my python studies and am considering learning django
>>
>>58500960
>>58500942
>>58500863
homo sexual
>>
Know how I can tell that Rust is going to succeed?

Because the retards here can't shut up about it and /dpt/ is always wrong.
>>
For the non-NEETs, how many of you work from home part or full time?

I'm strongly considering it this year.
>>
>>58500977
Yes, that's where the industry is. Learn Django because most people already use it, then learn flask because sometime you don't need Django.
>>
>>58500984
Know how I can tell that Rust is going to fail?

Because the retards here can't shut up about it and /dpt/ is always wrong.
>>
>>58500983
>2017
>Not being homosexual
>>
>>58500874
>>58500927
>>58500826
Go the fuck back to your containment board weaboo faggots
>>
>>58500977
It's the way to learn code monkey jobs that anyone can do tbqh.
You'll end up working with hipster kids and hating your job.
>>
>>58501000
>>58500984
Know how I can tell that the retards here are going to fail?

Because they can't shup and and act like adults for a second.
>>
>>58501010
Anime website, cry some more.
>>
>>58501027
14 out of ~100 of boards are about anime, try again faggot
>>
>>58500942
^ blue and white for haskell
>>
>>58501000
Know how I can tell it's not going anywhere? Because it's already being used in production so they are stuck with it.
>>
>>58501036
Anime boards were here before normalfag shit was added.
>>
Just started to watch SICP video lectures. Why do they record audience's faces? About 20% of the video lecture is people faces rather than blackboard, wtf?
>>
>>58501036
>anime boards
>reddit actually believes this myth
>>
>implying a majority of the people on 4chan actualy watch anime
Anime is degenerate filth m8
>>
File: 1474332185675.png (176KB, 437x556px) Image search: [Google]
1474332185675.png
176KB, 437x556px
@58501010
(You)
Btw, I've just found that SQL Server increments a primary key even when the insert fails. This is disgusting tbhqh.
>>
>>58501057
Nobody cares what immigrants think
>>
File: pusheen-typing.gif (27KB, 262x174px) Image search: [Google]
pusheen-typing.gif
27KB, 262x174px
Hello,

I’m planning to develop a web-based platform vaguely like Twitter. Using the site as an example, I’d like to know:

>Which languages would I have to learn to develop the front-end of Twitter?
>Which languages would I have to learn to develop the back-end of Twitter?
>How much would it cost for me to deploy a site like Twitter once it was made?
>What would be a reasonable estimate of the time it'd take me to learn the languages required, and actually code something like Twitter from scratch?

Thanks!
>>
>>58501048
>>58501051
Back to your designated anime boards fags
>>
>58501057
Low quality bait.
>>
>58501073
No, kid.
>>
>>58501047
>be employee at mozilla
>no background in cs
>have to fix memory leak
>valgrind won't start
>wtf i hate c++ now
>>
how do i read a file line by line and store it in a char array in c?
>>
File: 1429042807715.jpg (91KB, 786x581px) Image search: [Google]
1429042807715.jpg
91KB, 786x581px
>>58501072
>Front end
HTML
CSS
Javascript
>Back-end
PHP
MySQL (not really a language)
Some language that can work with MySQL might be helpful (Reddit runs off of Python)

The cost of the internet and a Raspberry Pi. Web servers are pretty lightweight, so you can get away with a Pi for a while. However, you should seriously invest in a pfSense router when things start taking off (dropped TCP connections are terrible on consumer hardware). If you can't do that, at least opt for DD-WRT.
>>
>>58501129
you open it read until a '\n' and store each character in a char array of some size

use the file functions or read() syscall
>>
>>58501072
>Which languages would I have to learn to develop the front-end of Twitter?
JavaScript
>Which languages would I have to learn to develop the back-end of Twitter?
JavaScript
>How much would it cost for me to deploy a site like Twitter once it was made?
Look at the pricing of Amazon AWS, Google AppEngine and Microsoft Azure
>What would be a reasonable estimate of the time it'd take me to learn the languages required, and actually code something like Twitter from scratch?
Assuming you've never written code, a year.
>>
>>58501129
fopen in binary mode and read individual bytes.
>>
>>58501047
The things Rust needs are backwards-compatible and aren't just syntax sugar.
>>
I'm messing around with mapping files with the win32 api in c and have a LPVOID pointer from MapViewOfFile which I want to add an offset to that, which is in the form of a DWORD. How can I safely add a DWORD to a LPVOID type?
>>
>>58500711
I liked the previous one more
>>
>>58501196
With the + operator. If you know that the offset is not bigger than the file size, obviously
>>
>>58501072
>Which languages would I have to learn to develop the front-end of Twitter?
HTML, CSS, JavaScript + some framework (React and Vue.js are pretty popular)
>Which languages would I have to learn to develop the back-end of Twitter?
Literally anything. But I myself would suggest ASP.NET, PHP or node.js so you could use the same tooling for both back-end and front-end.
>How much would it cost for me to deploy a site like Twitter once it was made?
Mostly depends on bandwidth on storage, I'd say somewhere around $20/month for some few hundred users? BTW I totally pulled that out of my ass. Amazon Web Services, Google Cloud have some cost estimators. There are some application hosts that offer free tiers (see Heroku, OpenShift etc)
>What would be a reasonable estimate of the time it'd take me to learn the languages required, and actually code something like Twitter from scratch?
Of course that depends on you. Learning a language is easy, but the Web has so many quirks it could take you well over 6 months to have a working version if you're starting from absolute scratch.
>>
File: neuron activation intensifies.jpg (470KB, 979x832px) Image search: [Google]
neuron activation intensifies.jpg
470KB, 979x832px
what is /dpt/'s opinion on the agile manifesto?
>>
>>58501196
Cast to a char * or an integer capable of holding a pointer (uintptr_t from stdint.h or UINT_PTR from windows.h)
>>
>>58500500
trying to learn python
syntax is weird
will get used to it
>>
'scuse me mate not an argument
>>
File: 1483273627346.png (49KB, 348x642px) Image search: [Google]
1483273627346.png
49KB, 348x642px
>>58501338
>>58501323
>>
File: 1483038374549.png (1010KB, 2000x2210px) Image search: [Google]
1483038374549.png
1010KB, 2000x2210px
once more for the children
>>
File: yum.gif (786KB, 500x281px) Image search: [Google]
yum.gif
786KB, 500x281px
>>58501139
Thanks, especially for the advice about servers. I've heard of the Pi, but I had no idea it could be used as a web server - that might be my go-to considering capital is lacking.

>>58501162
A year's what I was anticipating. It'll certainly be worth it, if I can confirm demand with a few intermediate MVPs. Thank (You)!

>>58501258
Thanks. Cloud storage is definitely an option I've considered! I'll have to get more data before I can get a reliable estimate of how much it'll cost, unfortunately.
>>
>>58501049
To keep people entertained.
You aren't watching at the blackboard on lectures all the time, are you?
>>
>>58501364
C# is the only language on that image that isn't absolutely 100% trash

And that's because C# is only 50% trash
>>
>>58500800
Where is the src?
>>
>>58501049
Should I watch them before or after reading the book?
>>
>>58501364
made by a python programmer
>>
>>58501401
You watch them together with reading the book.
>>
>>58501364
first day on /dpt/, is python a meme?
>>
>>58501420
No, memes usually have at least some kind of value to them.
Python is completely without merit.
>>
>>58501420
>that usage of "meme"
yeah, it's your first day on this website too. Fuck off, plebbitor.
>>
we raytracer now
>>
>>58501420
It's just straight up shit, not a "meme"
>>
File: Kqkd4sP.png (549KB, 1920x1080px) Image search: [Google]
Kqkd4sP.png
549KB, 1920x1080px
Did this ever get past version 4.0?
Also, post more like this.
>>
>>58501473
nice image hehe
your from the programming sub too?!
>>
File: 1392858534804.gif (933KB, 343x284px) Image search: [Google]
1392858534804.gif
933KB, 343x284px
Has anyone heard of the "Acestream" application?

It appears to be a bittorrent-based livestreaming thing, and /sp/ uses it a lot to stream sports.

I'm trying to figure out how it works, and how its protocol differs from the actual bittorrent spec.

Has anyone played around with it before? Do any of you guys have whitepapers or guides on the topic?
>>
>>58501401
No, don't watch lectures, don't read book, sicp don't have any use in 2017, you simply won't be able to use concepts in modern languages, + your co-workers would see this in way that you are showing off with all those abstractions and lambdas.
>>
>>58501444
Nice trips, what is that?
>>
>>58501420
>Mentioning Python in /dpt/

Here's your first lesson on your very first day, don't bring up that shit language here, it's for talentless sysadmins and babbys who just
import CompletedProject
>>
>>58501478
The what?
>>
File: 1483008807152.png (3MB, 5288x2158px) Image search: [Google]
1483008807152.png
3MB, 5288x2158px
>>58501473
I have this one, there's a bit of overlap tho
>>
is python a gimmick?
>>
>>58501481
i don't care about your pleb-tier """"""""languages"""""""" though
>>
>>58501492
You seem to be talking about Node.js.
>>
>>58501503
no, it's just trash
>>
>>58501492
It really isn't that awful when it's used as intended for smaller versatile projects. The problem lies with it being so easy to learn that there's a lot of shit made with it, and people trying to make bigger things end up with 300 lines of importations because they're too lazy to write their own things.
>>
>>58501504
How so? You won't find a job without knowing modern languages like c++ or python
>>
>>58501499
The programming subreddit
>>
>>58501533
And why do you think I care about that?
>>
>>58501480
Looks like it's bittorrent with some very minor enhancements suitable for livestreaming. Not very much info on their website though.
>>
>>58501548
>i have evolved beyond the need for employment
>i have become infiNEET
>>
>>58501585
>infiNEET
neet
>>
>>58501548
Why would someone start to learn to programming if he doesn't have in mind a goal of finding the job in the future? You can't programm then you're dead due to lack of food.
>>
>>58501614
Why would someone start to learn to play guitar if he doesn't have in mind a goal of finding the job in the future? You can't play guitar then you're dead due to lack of food.
>>
>>58501555
Their website looks very sketchy to me, and I'm hesitant to download from there.

It seems that "acestream URLs" are just regular torrent content hashes.

I tried making a magnet link from one of these content hashes and adding it to my torrent client, and I can SEE other clients in the swarm, but none of them connect to me.

I guess they changed the protocol enough to not be compatible with regular torrent clients
>>
>>58501482

it shoots a ray out of every pixel on the screen and sees what spheres it intersects.

then it calculates the normals of the ones that intersect and recursively does the same thing

when the line no longer hits a sphere, it returns the average of all the colors of the spheres it hit
>>
What's the best Lisp?
>>
>>58501614
Why do you assume I'm interested in getting a programming job?
>>
>>58501533
>"I'd rather have a vague semblance of how to use python, than have an actual understanding of how to write programs in Scheme"
>"I only have a month to learn a language before my attention span wears off, so if that language isn't hip and cool then I'm going to be screwed"
Anyways, HtDP (How to Design Programs) was literally written as a response to SICP (and every other even more sub-par intro courses) that failed a lot of students by
1) being too complex
2) only introducing language concepts without actually showing students how to go able >>>designing<<< programs
>>
I'm trying to convert the working asp.net mvc 5 with login sample to use mysql, but it seems way too compilcated
>>
>>58501646
s/able/about/
>>
>>58501642
Because you are interested in programming, therefore soon or later you should start to make money from that, or everything was meaningless
>>
>>58501668
>feeding the capitalist machine
>>
>>58501391
https://github.com/Dako300/BasicTV
Join the IRC to ask any questions.
>>
>python is shit
Why? What are any objective reasons to say that? What's good language to get shit done quickly then?
>>
>>58501677
>>>/r/ebbit
>>
>>58501683
"shit", and "able to get shit done" are not mutually exclusive
>>
>>58501629
Yeah, they mention HTTP2P which might be some form of server-enforced DHT. Plus, their client might reject connections from/to other bittorrent clients.

In a way, it works basically the same as Popcorn Time:
- you need at least a "stream source"
- stream is is probably ABR which is why they needed to add HTTP (MPEG-DASH, HLS, SS all work over HTTP)
- from them on, clients connect to the source and to eachother for stream segments
>>
>>58501683
fuck off and don't post here until you learn english
>>
>>58501049
Probably to make you feel like part of the audience.
>>
>>58501668
If I had a job for every interesting thing I did, I would need more than 24 hours in a day
>>58501677
>being a communist
>>
>>58501668
>you are interested in x, therefore soon or later you should start to make money from that
what kind of retarded """""logic""""" is this? should i start making money from watching anime too?
>>
>>58501658
You probably need a MySQL connection driver (check NuGet packages) and then change the connection string in Web.config.
>>
>>58501699
>>58501705
>no reasons given
nice
>>
>>58501722
Well, of course, why would human being start to do something that takes time and energy if this won't give him a profit as money in the future?
>>
>>58501736
you aren't entitled to any answers if you can't even use basic English correctly
>>
>>58501679
Tell me more about what this software does. It enables any Linux box to work like an STB?
>>
>>58501683
Go away. It's not our responsibility to teach you
>>
>>58501745
it gives me other "profits". i'm not desperate for money right now.
>>
>>58501750
he is actually, his question made perfect sense
>>
>>58501703
I see, thanks for the explanation.

Do you think it would be possible to view acestream streams without actually having the client?

I think I'll just download the client from their site, and run it in a virtual machine.
>>
>>58501637

a dead lisp
>>
>>58501793
heh
>>
>>58501637
Common Lisp.
>>
File: 1461442084646.png (163KB, 400x400px) Image search: [Google]
1461442084646.png
163KB, 400x400px
>>58501793
wow rude
>>
>>58501767
>it gives me other "profits".
What kind of? I (and a lot people I know) can't imagine any other profits from life but money. I mean, human beings take pleasure from having money, from spending them, and you have to spend money to things that would give you more money. More money = more profits/pleasures. Thats the rule of the real world, kiddo.
>>
>>58501729

I did that, and commented out the old connection string, and after running the app i can log in and out without a single exception. this shit really is next level cloud tech, it doesnt even need a database to store the data
>>
>>58501782
nah, you shouldn't post here if the phrase "what's good language" makes any sense to you.
even if we assume his question somehow made sense why would it make him entitled to an answer?
>>
>>58501722

life is a game and money is points

what you want to do should be what makes you money

and you should want to do it because it makes you money
>>
>>58501635
what's it written in?
>>
>>58501502
Good stuff, appreciated.
>>
>>58501762
>>58501705
>tfw you repeat memes and someone calls you on it and you don't have any actual reasons for saying it other than trying to fit in
>>
>>58501808
i seriously hope you're just a poorfag trying to cope with his situation.
>>58501822
>what you want to do should be something a random plebbitor tells you to do
wrong
>>
>>58501736
It doesn't have anything good going for in terms of language features.
It has terrible botched support for functional features.
It's OOP is garbage
len() and repr() being both functions and methods doesn't make any sense
>>
>>58501838
All those "Programming Challenges" pics are for people who doesnt have their own imagination and ideas. You would make a much more progress from reading sci-fi fiction and try to implement ideas from them rather than do challenges form this picture. It would certainly make your imagination and "ideas making machine" stronger.
>>
>>58501783
Obviously, you first need to to connect to other peers and download data. If I'm right and you're actually downloading segments of an ABR stream, the simplest thing you can do is to just feed the data to a video player (they also mention vlc on the website so chances are they use some common video standards). If the stream is encrypted, or otherwise obfuscated through other means, you need to be able to extract the elementary stream somehow.

Welcome to the world of reverse engineering.
>>
>>58501845
Where did I even say anything about python? Don't fucking post here until you learn this site's language.
>>
>>58501867
I have a decent imagination, Sci fi is mostly boring and I enjoy finishing challenges. These will suffice.
>>
>>58501873
>being this upset
I sincerely apologize
>>
>>58501813
You might not have stopped the previous instance of your application. I know this can get confusing with IIS or IIS Express.
>>
>>58501908
Fuck off, retard
>>
>>58501918
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>NOT AN ARGUMENT
>>
>>58501926
>arguing on the internets
>>
>>58501926
Wasn't supposed to be one, now fuck off
>>
>>58501751
It is my stab at a decentralized television broadcasting system. Anybody can broadcast to it anonymously over Tor. It also has insanely high quality video and audio (possible), it also has infinite DVRability, 3D support, Bitcoin integration, multiple different audio and caption tracks for different languages (dubbed and subbed), IR capable, tileable like tmux (multiple channels at one time), and exportable to multiple different formats. I'm also working on a commentary system for the tv channels. It can also do more technical jargon that makes it work better.

Think of it as the lovechild of Bitcoin, BitTorrent, Tor, and cable TV (the good part).
>>
>>58501938
;)
>>
>>58501938
Take a chill pill man
>>
>>58501964
Really now?
>>58501969
no, she's a cartoon and you're all alone
>>
>>58501963
Is there any quality issue with broadcasting on tor? Also wouldn't broadcasting thru tor compromise one's anonymity?
>>
Any suggestions to make this faster?
https://gist.github.com/anonymous/d58771afc36635e832a0a3b134869f3a
>>
>>58501984
>tfw you will never be this mad over being outed as just wanting to fit in on an internet forum
>>
>>58501990
>Is there any quality issue with broadcasting over Tor
No. Multiple circuits are created, and one socket is established per circuit. As long as there is enough information known to occupy all sockets (which is pretty easy), then it won't be hard to push your connection to the max through multiple Tor circuits.
>Also wouldn't broadcasting thru tor compromise one's anonymity?
No. The entire protocol runs off of TCP, and the only identifiable information sent out is an RSA public key (auto-generated at the start) and a Bitcoin address (optional, supplied externally).
>>
>>58501963
That sounds pretty cool, but I don't really believe the "insanely high quality" audio/video claim. 4K streams have lots of issues even through clearnet. I seriously doubt you'll be able to support that quality through Tor.
>>
>>58502033
Who do you think you're responding to?
>>
>>58502055
>>58501984
>>58501938
>>58501918
please just stop.
>>
>>58501963
Not him, but I don't completely understand your description.

Is this comparable to livestreaming sites like twitch.tv in any way?
>>
>>58502085
Are you being retarded on purpose?
>>
How can I get a specific line in c++?

I want to get line 2 from a .txt what should I do
>>
>>58501910

I did, and it did not help. I found the problem tho, it was using some connectionfactory or whatever for entityframework, so i had to install some nuget package that provides an entityframework implementation in mysql. now it fails succesfully, so i'm trying to make it connect now
>>
>>58502048
What do you mean by circuits? Is there a delay then?
>>
Is having a recursive method returning void a bad thing? Would the added stack frames ruin my performance?

void method(2D array, begin) {
for i : begin to array.length
if array[i] > 5
break
for j : i to array.length
if array[j] <= 5
break
do something with i and j
method(array, j)
}


I can write this as:

void method(2D array) {
for k : 0 to array.length
for i : k to array.length
if array[i] > 5
break
for j : i to array.length
if array[j] <= 5
break
do something with i and j
k = j
}


Which performs faster?
>>
>>58502096
I was very much fucking with you. Please calm down.
>>
>>58502102
>what should I do
Kill yourself
>>
>>58502054
That's a fair point. However, the network is internally pretty similar to torrenting, so as long as you
1. Have enough bandwidth to support downloading the stream
2. Have enough processing power to decrypt, decompress, and decode
then there is no limit

If you want to experience higher quality streams, you should be able to donate to the node directly to have your connection prioritized (although not implemented yet), although this is not a sustainable model.

>>58502095
Pretty much. It is like cable TV with an infinite rewind (which is essentially twitch.tv)

>>58502105
I meant a Tor circuit (one single connection to the Tor network). These are very slow individually, but can work quite nicely together as long as you keep them all busy (comparing a fast single core to a slow octa core)
>>
>>58502118
Don't reply or come within at least 3 of my posts ever again if you know what's good for you. Now fuck off.
>>
>>58502102
I can't remember now C++ code, but in a C way of thinking:
Read until you find \n (if your .txt is \r\n works, but in a \r file kill yourself), then read the line.
>>
>>58502105
There is a network wide broadcast delay of 10 seconds which is meant to give the data enough time to reach all of the nodes that are interested. This relies on nodes downloading and forwarding the data to other nodes, increasing the effective throughput of the network.

You can change this broadcast delay, but streams would be pretty choppy
>>
>>58502111
>for k
>k = j
Why do you mess with cycle counter inside the cycle?
>>
>>58502102
Just read up to the N'th line and discard the lines read before it.
I recommend std::getline()
std::string nth_line (std::istream& stream, int N) {
std::string line;
for (int i = 0; i < N; i++) {
// discard the string data from last iteration
line.clear();
std::getline(stream, line);
}
return line;
}
>>
>>58502102
Call fgets() twice. If you want line N, call fgets() N times in a loop. Or if the file has fixed line length, calculate the position and call fseek().
>>58502111
Iteration is almost always better performance-wise than recursion. However, some recursive functions can make code more readable.
>>58502128
>the network is internally pretty similar to torrenting
I'll assume you didn't mean the Tor network, because Tor doesn't work like bittorrent. So your solution is like AceStream which another anon mentioned earlier, but though Tor.
>infinite rewind
So you'll have all participants in your network cache all streams?
>>
>>58502128
This project seems really cool, and I don't want to rain on your parade, but is this really a thoughtful use of the Tor network?

There's already a shortage of relays and bandwidth, and an even bigger shortage of exit nodes.

Wouldn't streaming video through Tor negatively impact the node further?

I haven't gone through your source code yet, but if you haven't thought of this already, what about forcing any client streaming through your service to act as a Tor relay?
>>
>>58502221
Why would you line.clear() when std::getline discards the string's content?
>>
File: Screenshot_2017-01-15_21-24-39.png (229KB, 1149x853px) Image search: [Google]
Screenshot_2017-01-15_21-24-39.png
229KB, 1149x853px
i started adding some buttons to the sidebar

i will probably make it later so that i can have several menus that can be swapped depending on the situation, similarly how i'm trying to display the queue in the large box on the right instead of the search menu now
>>
>>58502276
Oh, I didn't realize it discards the contents. You can omit the .clear()
>>
>>58502255
Why the fuck would you ever use fgets() in C++?
fgets() is a C function, it's a pain in the ass to use, it's unsafe if you fuck up and C++ has safer easier to use functions directly in the standard library (although, C++ IO library is still pretty fucking shit unfortunately)
>>
>>58502326
show code
>>
>>58502388
https://github.com/nukeop/nuclear
>>
>>58502326
Is this an android app?
>>
Anyone know a good resource for learning Lua?
>>
>>58502403
linux/mac/windows
>>
>>58502370
I'm just used to lots of C functions because we don't use anything from the standard C++ library at my job.
>>
>>58502408
http://www.lua.org/pil/contents.html
>>
>>58502395
>all those dependencies

If you're going to use JS anyway, why not just start with it as a simple nodejs app then just package it later with electron?
>>
File: BOAT_ON_A_TRACK.jpg (158KB, 652x422px) Image search: [Google]
BOAT_ON_A_TRACK.jpg
158KB, 652x422px
>>58502255
The infinite rewind only works when the node that broadcasts the data keeps it stored locally (or stored on another node). Of course it won't be able to keep the highest quality version of the stream, but I can see it deleting higher quality versions of the stream and keeping the lowest quality ones.

All data on the stream are compressed and encrypted blocks, and people can hoard these blocks and send them back to the network for a (possible) profit in Bitcoin. Assuming enough information is hoarded (low quality streams), then it can definitely be done. Nodes can be turned on and off, but just need a connection to the internet to download needed data (assuming it isn't exported to disk).

No, nodes don't need to cache all streams

>>58502259
Tor integration can be disabled through the settings.cfg file

>Wouldn't streaming video through Tor negatively impact the node further?
Tor node: not really
BasicTV node: no

I have actually heard that the more junk goes through the Tor network, the more secure it becomes because there is more garbage that needs to be sorted through to find something interesting or incriminating. I also don't believe the Tor network has too few nodes to operate properly.

>what about forcing any client streaming through your service to act as a Tor relay?
I don't like that idea, just because encrypted traffic looks very suspicious in certain parts of the country, and I don't want the party camel coming to somebody's house

Also, bouzer, come back pls
>>
>>58502416
Ah, nice.
I was hoping for something to replace shitty Youtube Music for my phone and your app looks really sleek. Good work.
>>
>>58501868
I really respect people who are skilled enough to reverse engineer proprietary stuff for a living, it seems to require a very good concentration and a lot of knowledge.

Also, I fired up wireshark, and it looks like acestream transfers its data over TCP.

What's up with that? I thought most video streaming services stick with real-time protocols built on top of UDP.
>>
What's the best language for an anime girl?
>>
>>58502487
Believe it or not, I started from a template the author called "electron-react-boilerplate".

Anyway, it severely reduced the time I had to fuck around with initial setup, so why not.
>>
File: 1473176707847.jpg (130KB, 768x1024px) Image search: [Google]
1473176707847.jpg
130KB, 768x1024px
>>58502517
>>
>>58502517
gook
>>
>>58502542
oh that too i guess
>>
>>58502501
Video streaming is generally either HTTP (MPEG-DASH, HLS, SmoothStreaming) or RTMP, both of which are implemented over TCP. It's a misconception that you need real-time communication for video streaming. YouTube for example uses MPEG-DASH.

UDP is however used in lots of P2P networks because it can traverse NAT (read: UDP hole punching) so you can establish two-way communication from behind restrictive routers.

If you're wiresharking it, take a look at a few TCP streams (right click packet->Follow TCP Stream...). Those might show more info. I'd look into the first few packets after SYN/SYN+ACK/ACK for stuff like magic numbers, file headers or whatever else.
>>
>>58500500
working on my homework in java(tm) :^)
>>
>>58501829
Not that fag, but looks like either C or C++. He's using SDL too
>>
>>58502517
English
>>
>>58502680
Thanks for clearing that up, I was under that misconception. I know very little about networking.

I'll try to find headers for the stream.
>>
>>58502747
Would it be possible to export the relevant packets and send them to us so /g/ can work together?
>>
What are the major differences between Python 2.7 and 3?
>>
>>58502792
incompatibility
>>
>>58502792
Python 3 isn't turing complete
>>
>>58502797
I get that, I'm talking syntactical
>>
>>58502822
What about semantics?
>>
>>58502822
No, incompatibility is the only major difference.

Minor differences include 'print' being a function, and '/' never rounding to integers
>>
>>58502759
I don't know enough about wireshark to do it right, sorry.

I just downloaded acestream from their site, installed it with wine, and started watching one of the /sp/ soccer streams. worked perfectly out of the box, and then i started wireshark.
>>
>>58502847
There is a version for Linux, right?
>>
File: primesteps.jpg (123KB, 1207x381px) Image search: [Google]
primesteps.jpg
123KB, 1207x381px
I'm stuck with this. The server takes way too long to calculate all test cases and it won't accept this solution.

def step(step, start, end):
prime = []

for num in range(start,end+1):
if all(num%i!=0 for i in range(2,num)):
prime.append(num)

for pnum in prime:
if (pnum + step) in prime:
return [pnum,(pnum+step)]
[/code

How can I make this run significantly faster?
>>
>>58502860
Think so
>>
>>58502895
By not using python.
>>
>>58502925
Wrong. Python should run a constant factor slower than e.g. C, but the user is looking for a solution larger than that factor.

I have to ask how the fuck are you supposed to interpret
3, 5 - 5, 7, - 11, 13, ...

Why are the commas and -'s fucked up?

>>58502895
Look up sieve of eratosthenes and try to implement this, it should be doable especially because you know the exact range you need to calculate between.
>>
>>58502895

maybe I'll have to check for pair while filling the prime-number list
>>
>>58502128
I should clarify that first part by making three sections
1. Have enough bandwidth to support downloading the streams
2. Have enough processing power to decrypt, decompress, and decode
3. Have enough throughput through all Tor circuits to sustain proper download speeds
>>
>>58503010

I dont know why it looks like that.

maybe algorithm works, its just waaaay too slow
>>
>>58500500
Is there parallel for loop in C?
>>
>>58503083
With OpenMP there is.
>>
>>58503083
fork that bitch
>>
File: 1482397247574.jpg (450KB, 1024x768px) Image search: [Google]
1482397247574.jpg
450KB, 1024x768px
I just finished working through K&R. Right now I'm mainly solving exercises from online judges to get more practice, but I already feel like I'm comfortable with C and I want to do something that serves an actual real life purpose.

What are some good projects for a beginner to work on? I was thinking of working on an open source project, but I don't know where to look for as most seem too daunting, e.g. Firefox and the Gecko engine are open-source but I don't think I have near enough experience to make a meaningful contribution to such large code bases. Does anyone know any open source projects to work on for a beginner that knows C but never worked on a project before?
>>
>>58503010
Constant factors only tend to be important when they reach two orders of magnitude.
>>
>>58503010
>I have to ask how the fuck are you supposed to interpret
>3, 5 - 5, 7, - 11, 13, ...
>Why are the commas and -'s fucked up?
It's a list of pairs of prime numbers. ((3, 5), (5, 7), (11, 13), ...). There are extra commas in some places.
>>
>>58503105
Not really. Most of what a beginner could do somebody more advanced has already done. The only thing that comes to mind are staging drivers in the Linux kernel.
>>
>>58503090
>>58503100
Got it thanks.
>>
>>58503105
Open-source projects love contributors. Some even have beginner tasks and bugs deemed easy so there's always work to be found. I would look into popular/trending repos on Github for a project I like and try to build it/read some docs/read some code and find something to do in the Issues section.
https://github.com/trending/c
>>
>>58503176

>Some even have beginner tasks and bugs

do they deliberately dont fix easy bugs so noobs can have a shot at it?
>>
>>58502701
>>58501829

C++ SDL

you can also make it on a GPU with opengl
>>
>>58503204
Not deliberately, just that easy bugs usually get buried under other higher priority bugs/features/etc.
>>
File: 1482236145668.png (307KB, 500x500px) Image search: [Google]
1482236145668.png
307KB, 500x500px
Are Haskell programmers to smart too be employed?
>>
>>58503265
like pep is to smart for the epl
>>
>>58503265
Yes.
>>
>>58503289
>epl
Esoteric Programming Languages?
>>
>>58503314
no, the >e>p>l
>>
>>58503204
Yes. Mozilla has categories called Good First Bugs, Mentored Bugs and Student Projects for this very purpose.
>>
>>58503326
What is the >e>p>l?
>>
>>58503057
Yes your algorithm probably works, but making it efficient is always the point of these kind of exercises.

>>58503119
>There are extra commas in some places
Why? They expect you to solve this programming challenge but the author's can't be bothered to formulate the question properly?

>>58503219
When people say "C++ with SDL" they almost always mean SDL for the window and OpenGL for drawing.
>>
lets say i have written a struct array to a .bin file like this

int store(char file[], equipasf e[]) {
FILE* fp;
fp = fopen(file,"w+b");

if(fp == NULL) {
printf("Problemas a abrir o ficheiro %s\n", file);
return 0;
}
else {
size_t res = fwrite(&e, sizeof(equipasf), 18, fp);
fclose(fp);
if(res != 0) {
printf("Equipas guardado em %s\n", file);
return 1;
}
else {
return 0;
}
}
}


now how do i load it to the program? i dont think i can return arrays in c, do i have to make a loop to load every element into its position into the array?
>>
>>58503176
Thanks, I'll do that! I make use of a lot of the software in that list (tmux, vim) so it might even be a little easier to contribute.
>>
>>58503406
fwrite to write, fread to read...
>>
>>58503406
HUE
>>
>>58503176
H-how do I introduce myself

I've been on 4chan for too long, I don't know how to behave when I'm not anonymous
>>
>>58503539
>kys yourself :^)
>welcome in our team
>>
>>58503539
Don't be an autist
>>
>>58503539
you send a picture of your lil dick
>>
>>58503539
Don't
Just start contributing
>>
>>58503539
I'd start by submitting pull requests that actually make sense
>>
The Unix standard should include a prime file with a few megabytes of primes.
>>
>>58500500

Why don't people use Lisp anymore? Not even griefing just curious as it seems pretty nice to work with while also being pretty powerful.
>>
>>58503591
anon pls
>>
>>58503631
What could this be used for that makes sense?
>>
>>58503645
Better langs available now e.g. Python
>>
>>58503658
Think of how much electricity it would save.
>>
>>58503406
>now how do i load it to the program?
"Fortunately", you don't have this problem yet; you're not actually saving the array in the first place. That's because C passes arrays by passing a pointer to the first element, and doesn't send the size of the array with it; you need to send that explicitly and you need to write it to the file explicitly (unless you're brave enough to rely on the file length being sufficient information).
>>
>>58503683
That's your fault for not using ARM,the superior architecture
>>
>>58503645
It's not taught, and if it is it's taught as a first language and then abandoned in favor of Java, etc.
And there's too much hype for every other language and framework with little to no love for Lisp. But I've heard that quicklisp is seeing growth in interest
>>
i was looking at openbox recently and i had this realization when looking at the XML config files

why is there no common lisp *box WM? sounds like it would be a perfect fit

i'd try to write one myself but i don't understand X or CLX
>>
>>58503631
Why not have it baked directly in the hardware?
>>
>>58503737
Because that's more expensive.
>>
>>58503715
>But I've heard that quicklisp is seeing growth in interest
Now I know that 1 > 0, but I won't get excited over it.
>>
>>58503715
>But I've heard that quicklisp is seeing growth in interest
can you still get MITM'd using it?
>>
I was thinking about writing a program that would:
1. search the web for items that are being sold at below the average cost for that item
2. buy that item
3. re-list the item for the average cost

However, after a brief search, I can't find anything online about anyone doing something similar. Is there any obvious reason I'm not thinking of that this wouldn't work?
>>
>>58503852
People will generally search for the lowest price anyway. That's why the web is full of price comparators.
>>
File: FBI.png (62KB, 712x429px) Image search: [Google]
FBI.png
62KB, 712x429px
>>58503852
>>
>>58503852
what are you gonna use as reference for the average prices?
>>
>>58503808
I hope not. I scrapped a webserver together in a day with a few quicklisp packages and that's the most I've used of Common Lisp
>>
>>58500516
Rust has the ESR dislike seal of approval.
>>
>>58503873
Yeah, so I might not actually do the average price, but just something that will make me a profit. I'll probably have to play around with a bit to see what price point will work best.

>>58503901
I was thinking Amazon. Basically I'd just have the program look at all the prices listed on the site for that object, and then give me a mean price. I'll probably weight the "official" price slightly more heavily, and then make sure I sell it for slightly below that.
>>
>>58503961
>using the mean price
I would go to the fifth percentile IMHO, just because overpriced junk is more likely to stay unsold
>>
>>58503961
isn't that a shit ton of things to search through?
>>
>>58503961
works fine until it buys you 150kg of fertilizer because some random joe at some farming supplies warehouse clicked a wrong button
>>
>>58503852
Don't forget it'll cost you money to buy, store, and ship the things.
>>
>>58504012
>implying that would be a problem
it doesn't expire and doesn't take up much space
>>
>>58503961
Camelizer shows amazon price history.
>>
>>58504054
and alerts cia to your location
>>
>>58503995
>>58504012
Well, I wasn't going to have it just search through and buy literally anything. I'll choose an item or two, and just stick with that. But right now I'm just thinking about whether in principle it could be done.

>>58504025
Yeah, apparently Amazon has a pretty nice thing where you can ship through them (so you can offer prime shipping), and it looks reasonably priced, but that would go into the calculation.
>>
>>58503961
There's no guarantee that anyone will by it for your price
>>
why do we hate performance?
>>
>>58504075
Is there some legal limit to how much fertilizer a person can possess at once?

Is the cia "alerted" to all farmers too?
>>
File: Screenshot_2017-01-15_17-28-19.png (127KB, 1280x1023px) Image search: [Google]
Screenshot_2017-01-15_17-28-19.png
127KB, 1280x1023px
I added some bitwise ops and 2's complement math.
>>
>>58504117
this isnt /wdg/
>>
File: cute anime pic 0519.png (362KB, 700x700px) Image search: [Google]
cute anime pic 0519.png
362KB, 700x700px
What does Windows use if it doesn't have syscalls?
>>
>>58504139
sorry
did you take a look at the languages used in /dpt/?
>>
>>58504122
what am I looking at here?
>>
>>58504143
WinAPI
>>
>>58504187
A virtual machine for an architecture I came up with.
>>
>>58504105
That is a concern, but assuming the market is rational, the average price will be some indication of what people are willing to pay for the object, so selling at, or below, that price should ameliorate that.

But I'll also have to make sure that it can only use a certain amount of money such that I don't go bankrupt buying things that I never sell.
>>
>>58504143
You call into kernel32, and kernel32 calls into ntdll, which calls into the kernel.
>>
>>58504174
Java is quite performant
>>
>>58504143
It does have syscalls, but the mechanism of action is way different.
In Windows, you're almost always forced to call user mode functions which do the transition to kernel mode if necessary (Close -> NtClose -> ZwClose).
In Linux, you can just call close() directly.
>>
>>58504174
Haskell goes fast. C goes faster.
>>
>>58504228
you can also just call ntdll directly.
>>
https://en.wikipedia.org/wiki/Glossary_of_computer_software_terms

many terms
much wow
>>
>>58504280
Does it have Zygohistomorphic prepromorphisms?
>>
Hey, /dpt/, I was wondering if anyone here knew of a way to take the for loop within this function and add it to the corresponding dict comprehension for that dictionary's values? Or if it is even possible at all?

def mimic_dict(filename):
"""Returns mimic dict mapping each word to list of words which follow it."""
file = open('small.txt', 'r')
f = file.read().split()
prev = ''
dic = {k: [] for k in set(f)}
for x in f:
dic[prev] = dic.get(prev, []) + [x]
prev = x
file.close()
return dic


Here's the data for small.txt in case anyone cares:
We are not what we should be
We are not what we need to be
But at least we are not what we used to be
-- Football Coach
>>
Do you still call this a flow graph?
What do you call it? It's nice.
>>
>>58504312
state diagram you fucking nigger.
>>
>>58504312
I thinkk it is called a state diagram
>>
>>58504312
That is a state diagram.
Finite state machine really are neat.
>>
>>58504351
Rude
>>58504353
>>58504363
Thanks.
>>
>>58504312
It's an automaton.
>>
File: when the D hits you.jpg (23KB, 512x512px) Image search: [Google]
when the D hits you.jpg
23KB, 512x512px
>>58504312
Andrei knows how his readers like it
>>
>>58504257
gotta go faster
>>
>>58504312
>ULULULULULULU
>>
>>58504143
It does have syscalls, it's just that they are not part of the public api and can change between updates, so you are recommended to use kernel32.dll or ntdll.dll
>>
>>58504402
It's a nice book.
Shame the first example aside from hello world doesn't work anymore because they moved where 'splitter' is defined and you need another type conversion essentially (word.idup instead of just word).

I imagine that might bother a lot of newcomers.
>>
>>58504363
Why do you need FSMs?
>>
>>58504402
It's pretty stupid to think that 0x____________1______2_FUL is a valid integer literal.
>>
>>58504483
They are very efficient at certain types of computation, one of which is matching text.
A regular expression is just a description of a finite state machine.
>>
>>58504483
if you have to ask that....
100% troll or gtfo of /g/
>>
>>58504484
Yeah, but when are you going to write anything like that
>>
>>58504515
You don't know?
>>
@58504566
stop
>>
@58504633
stop what?
>>
@58504841
your blatant trolling
>>
New thread:

>>58504863
>>58504863
>>58504863
>>
@58504866
But I don't troll and I'm geniunely curious.
>>
Ok, why the fuck isn't this shit working properly

int j=0,mult=1,ar[]={0,0,0,0,0,0}
for (int i = 0; i < line.size(); i++) {
int num = (int)line[i] - ASCIINUM;
if (num != -4) {
ar[j] = ar[j] * mult + num;
mult *= 10;
}
else {
cout << ar[j] << "," ;
j++;
mult = 1;
}
}


>Sample intput:
45,49,49,65,65,
79,83,100,85,105,78

>Sample Output:
45,49,49,65,65
79,83,1000,85,1005,
>>
>>58503390

I'm not even using openGL. SDL has a drawpixel() function that is good enough for a ray tracer

with opengl I prefer GLFW
>>
>>58504909
if (ar[j] > 100)
ar[j] /= 10;

why the fuck does it work now
>>
>>58501364
Since when do Facebook and Google do Python?
>>
>>58501364
who learns programming for kids what does that even mean
Thread posts: 318
Thread images: 30


[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.