[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
/dpt/ - Daily Programming Thread
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

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

Thread replies: 317
Thread images: 36
old thread: >>52372532

What are you working on, /g/?
>>
LEWD
>>
>>52375982
That thread was made at the wrong time and is old.

>>52376001
What's it parsing? Also that pic is 2cute, might have to watch it
>>
>>52375982
That thread is hours old and nobody is posting there anymore.
Let's stay here.
>>
>>52375963
cli program on linux to read/write facebook IMs without actually needing to be on facebook.
A notification also pops up on the bottom right of the screen briefly showing the message contents.
>>
>>52376021

As a general rule of thumb, if privates aren't showing, it's not lewd. Following this logic, Python is the most lewd programming language, because it will show its privates to anyone who asks. Meanwhile, C++ will only show them to friends, and never to its children.
>>
>>52376001
>1.62 MB .png file
Please kill yourself.
>>
>>52376138
Was that supposed to be funny? Looks like a joke straight from /r/programmerhumor
Fucking autist, kill yourself.
>>
>>52376138
what about ruby? :^)
>>
Why doesn't C++ have a garbage collector?

Because there'd be nothing left
>>
>>52376173
>>52376141

>>>/trash/
>>
>>52376178
>dumb weeaboo doesn't know about compression
Why are all weeaboos technologically illiterate yet try to pretend otherwise?
>>
>>52376198
>Anyways, back on topic, what programming books, besides SICP, does /dpt/ recommend?

This is unnecessary. Off topic posting is allowed on /dpt/.
>>
>>52376209
PNG usually compresses anime better (smaller file size) than JPEG.
>>
>>52376229
There's nothing "on topic" about throwaway questions for the sake of appearance.
>>
>>52376163

In Ruby, objects inherit their privates from their parents, but they can only touch their own privates.

>>52376198

Books? Depends, what subject within computer science/software engineering are you looking for?
>>
>>52376209
Weebs are the only people pioneering video compression for pirated TV.

If it weren't for weebs pushing H264 and MKV containers, you people would still be watching your game of thrones encoded in XVID.
>>
File: ye.png (533 KB, 1440x900) Image search: [iqdb] [SauceNao] [Google]
ye.png
533 KB, 1440x900
>>52375963
Making some improvements to my auto launcher. The widgets on my phone basically send numbers (0, 1....etc) and a very small server (pic related the code, its like 12 KB) running on my PC executes the scripts corresponding to the number (eg 0.sh, 1.sh).
It just werks, i tap on a widget and the curresponding script runs almost instantaneously
>>
>>52376230
That's what I'm saying, that image has no right to be 1.62 MB.
>>52376264
>watching TV
Enjoy your media jew.
>>
>>52376264
This is actually true
Anime sub groups are one of the first to adopt a new codec when it comes out
>>
>>52376311
>caring about the visual quality of a 8 FPS low color depth medium
Anime studios should just make everything in adobe flash and distribute anime as .sfw, there'd be no quality loss whatsoever.
>>
first day in an algorithms and data structure course. I haven't written java in years and it is required for this course, wish me luck ~
>>
>>52376360
>Anime studios should just make everything in adobe flash and distribute anime as .sfw, there'd be no quality loss whatsoever.
Thats actually exactly what they should do. Why not turn anime videos into vector video format? That'd save loads of space and files will be like 10-20MB, at whatever resolution you want (they're vectors).
Vector based videos when?
>>
>>52376425
>anime characters and objects will now only ever face the screen
>>
What do you call a programming language designed for women?

An object orientated programming language
>>
>>52376425
Are you retarded? Good luck storing 20 minutes of high-quality vector animation in 20MB.

>tfw high quality .svg of a flag is >1MB
>>
>>52376453
kek nice one anon
Men like us program in C
>>
>>52376450
and they'll close their eyes EVERY TIME they move their heads

it's so irritating once you actually notice those lazy animator tricks
>>
>>52376453
idgi
>>
>>52376462
>>52376484
...
>>
File: 0.png (148 KB, 1920x1080) Image search: [iqdb] [SauceNao] [Google]
0.png
148 KB, 1920x1080
>>52376461
Well then jack that up to 100MB, or maybe even 500MB, fine?
500 MB is nothing, literally nothing for vector videos that can be stretched right from 144p to 4k or 8k
>pic related, guess this svg image's size? Its 705B vector graphics are crazy efficient unless you do some shit like make roster graphics with them
>>
>>52376592
>unless you do some shit like make roster graphics with them

Have you ever seen an anime?
>>
>>52376161
>knows an obscure sub-reddit
Redditfag
>>
>>52376615
>Have you ever seen an anime?
i have and i strongly believe they can be turned into vectors. Im not saying all anime can be, but look at this one, it has simple colors, some curves here and there, i dont see any reason why it couldn't be turned into vectors
>>
>>52376634
How do you know it's obscure?
>>
File: Tqpkr12.png (18 KB, 533x154) Image search: [iqdb] [SauceNao] [Google]
Tqpkr12.png
18 KB, 533x154
I have a virtualbox VM running with Centos for class, and I'm trying to install the VBox Guest Additions to get seamless mouse working, but it's just not. I keep getting "Failed to create" and in the log it says "Unable to find the source of your Linux Kernel". Pic is what I found, and I believe it is the culprit (mismatching firmware/header/devel), but how do I fix it?
>>
File: D.jpg (42 KB, 512x512) Image search: [iqdb] [SauceNao] [Google]
D.jpg
42 KB, 512x512
>>52376670
btfo
>>
>>52376670
Because I haven't heard of it.
>>
>>52376684
-devel might be just the debug symbols. Check if there's a kernel-source package or something like that.
>>
>>52376684
Forgot to actually address the other part. You do have matching kernel, -devel, -firmware, and -headers (version 2.6.32-573.12.1.el6). The firmware is noarch because the same firmware works on every CPU architecture (because the firmware itself runs on some hardware device's embedded controller, not the main CPU). The others have x86_64 suffix because some parts of those packages are specific to amd64 architecture.
>>
I was having trouble with breaking up a 2D array into smaller arrays, until I realized you can just flatten it into a 1D array and count forward.

>tfw 400 lines of code for a sudoku validator
>>
>>52376726
>>52376703
The error message is:
unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.


What directory is that? (And also how do I specify it? This is my first time using CentOS)
>>
>>52376127
>on linux
>not on other unices
How useless and non-portable!
>>
>>52376926
I'm only making it as useful as I need it to be. It's for my own use.
>>
>>52376870
You have to actually get ahold of the source somehow. There might be a package you can install that will put it in some default location, where that makefile should be able to find it automatically.

Otherwise, look up how to download the source code for a package. On Debian you run `apt-get source package-name`, I assume there's some equivalent for CentOS. Get the source of kernel-2.6.32.whatever, and set KERN_DIR to that directory.
>>
File: iphone.jpg (78 KB, 750x558) Image search: [iqdb] [SauceNao] [Google]
iphone.jpg
78 KB, 750x558
>>52376963
You use Facebook?
>>
>>52376859
post code
>>
>>52376851
The scene you posted is a lot more visually complex than the one you're replying to.
You're either blind or retarded.

>stylized means simple!
Animetards can't even analyse their own medium.
>>
sucks every file out of a folder
for /r %%x in (*.*)  DO move "%%x" "%%x"/../..
for /F %%i in ('dir /b "%cd%\*.*"') do (
for /d %%d in (*) do rd "%%~d"
)
>>
>>52377067
This is literally the laziest bait I've witnessed on this board all year.
>>
Have to modify a Prolog program to scan for tokens in a simple stack based language the professor made up. Have to learn enough Prolog to do this and do so by Friday at 5:00 PM.

Woo Logic Programming!
>>
>>52377109
So you are retarded.
Maybe you should actually count how many visual elements there are per scene in those two animes, since pattern recognition doesn't seem to be your strong point.

There's more colors, more lines, more shapes and the shapes are a lot more complex.
>>
>>52377050
unsigned *flatten_grid(unsigned **grid, unsigned n, unsigned len)
{
unsigned *out = (unsigned *) malloc(sizeof(unsigned) * len);
unsigned i, j;
unsigned k = 0; /* output index */
for (i = 0; i < n; i++)
{
for (j = 0; j < n; j++)
{
out[k++] = grid[i][j];
}
}
return out;
}
>>
>>52377143
Here's your reply :^)
>>
>>52377160
Never reply to me unless you're contributing to the thread.
>>
>>52377174
ebin
>>
>>52376001
If you hide this post and all replies to it, every reaction image, every ad hominem attack, every squabble, every questionably-sfw anime image goes away. Coincidentally, not a single post with code is hidden.
>>
File: image.jpg (110 KB, 1426x810) Image search: [iqdb] [SauceNao] [Google]
image.jpg
110 KB, 1426x810
Trying to program a robot that uses an obscure build of Java For Android built specifically for FTC Robotics. Very inflexible and somewhat confusing at times, but overall very basic.
>tfw only putting up for this shit for scholarship monies.
>pic related, not mine, but it's the type of shit I have to put up with.
>>
Is there a site like hackaday but for open source c projects? I'm trying to surround myself with inspiration
>>
>>52377304
>FTC
>not even old enough for FRC
underaged please go
>>
File: 1423962695192.gif (20 KB, 543x600) Image search: [iqdb] [SauceNao] [Google]
1423962695192.gif
20 KB, 543x600
>download book on vim
>all kinds of neat shit
>completely forget how to use any of it the next day
>>
learning c lel
>>
>>52377154
>casting the return of malloc
>declaring variables outside of the for loop
>using unsigned, not size_t for i,j,k
>not using uintN_t or uint_leastN_t instead of just raw unsigned
>iterating over indices instead of pointers

your C is weak as shit. fix yourself.

http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf
>>
>>52377352
>Not even old enough for FRC
>Not knowing FRC and FTC contain same age requirements

Fuck out of here kid.
>>
>>52377465
Doesn't change that you're still in highschool buddy
>>
File: image.gif (496 KB, 350x197) Image search: [iqdb] [SauceNao] [Google]
image.gif
496 KB, 350x197
>>52377472
"There's no way an 18 year old can be in high school"
>>
>>52377500
ok reddit, ok
>>
>>52377383
>falling for the vim meme

Haha, holy shit, people have been falling for this garbage for over a hundred years
>>
This thread is literally shit.
>>
http://joeburger.ax.lt/TowerDefense2/
>>
Why does /dpt/ hate python?
>>
>>52377623
use the goddamn api

or string manipulate
>>
>>52376309
https://wiki.installgentoo.com/index.php/Programming_resources
>>
>>52377638
Why does /g/ hate perl?
>>
>>52377638
It's 50-50, the memers and fun-lovers love it for its quick production and thus memes. The no-fun-allowed, jealous side who haven't made anything of value hate it for those reasons
>>
>>52377623
>How do I do it in JavaScript?
I suggest killing yourself first
>And no, I won't use the API.
why the fuck not you
>>
>>52377649
s/you//
>>
>>52377638
I dont, its an easy language to write and use, just like php

some people are just butthurt that we(python/php users) can do the same task in 5% more time and 150% easier to code.

>>52377623
use jquery and select the $(".thread").html()
>>
>>52377623
another option is

function getFirstInClass(classname) {
var x = document.getElementsByClassName(classname);
return(x[0].innerHTML);
}
>>
>>52377678
come on lad
function getFirstInClass(classname) {
var x = document.getElementsByClassName(classname);
return(x[0].innerHTML);
}
>>
>>52376670 (you)
>>52376691 (you)
>>
>>52377741
>string manipulate
forget everything you know about javascript
just search the string for the first instance of ".thread" and copy that into another string until you find a space character

this is basic shit
>>
>>52377741
alright, then

parser = new DOMParser();
xmlDoc = parser.parseFromString(InPuttField"text/xml");
var x = xmlDoc.getElementsByClassName(classname);
fag = x[0].innerHTML
>>
>>52377741
>How?
first off, listen to the other guy, I'm only suggesting string manipulation if you don't want to do the jquery

second, google string manipulation functions if you really want to
>>
>>52377665
>use jquery
I too browse stack overflow.
>>
>>52377870
nice meme
>>
>>52377870
I browse stackoverflow to answer questions other people have :^)
>>
File: 1451751832808.png (17 KB, 418x359) Image search: [iqdb] [SauceNao] [Google]
1451751832808.png
17 KB, 418x359
>he fell for the parametric polymorphism meme
>he fell for the oop meme
>>
Finally ready to become a programming literate, /dpt/. Pic related.

Any advice?
>>
I fell for the meme and recently started learning programming, I was originally thinking of using it for looking for a job, as something I can learn on my own time at my own pace is appealing. As I started learning it, I found I'm not stressed or annoyed by the learning process for it, I'm actually rather enjoying it, but that makes me wonder, should I look for a job with it once I feel confident? Or is doing it for a living going to kill my enthusiasm...
>>
File: larf.gif (2 MB, 360x270) Image search: [iqdb] [SauceNao] [Google]
larf.gif
2 MB, 360x270
>>52377565
>not using god-tier vim for editing text files
>>
>>52377997
Should be text/html.
>>
>>52377997
can you even get the myRequest variable into that function? have you defined it global or are you just retarded?
>>
We should really split dpt into two threads. One for 'pediphiles' and one for normies.

Then we can have competitions and stuff. Sounds like fun.
>>
Learn to write a compiler for a subset of the C programming language with Scheme.
>>
lets write a C compiler in PHP
>>
>>52378033
>have you defined it global or are you just retarded?
This is the same thing
>>
Made a PHP reverse shell
https://github.com/AlphaDelta/SPUD
>>
In Scheme, I want to take a function argument, append "_ch" to it, and then define it with a variable.

So that
(ass anus 55)

returns a variable named "anus_ch" that is 55.

I shat out this:
(define-syntax ass
(syntax-rules ()
((_ title arg)
(eval (list 'define (string->symbol (string-append (symbol->string 'title) "_ch")) arg)))))

which works but I don't think is especially elegant.
I hear that eval is bad and I should never use it. Is there a way to do what I want without eval?
>>
>>52378069
well, true
>>
>>52377973
I hope you're good at math
>>
>>52377976
programming isn't a meme you absolute cretin
>>
>>52375963
What SQL database to learn for a newblet i program in python php c++ and java
>>
>>52378081
>Is there a way to do what I want without eval?
>Is there another way to make a string an identifier
Scheme's equivalent of dictionaries.
>>
>>52378114
>https://wiki.installgentoo.com/index.php/Programming_resources << why the fuck did this appear when I clicked to respond to you?

back to why I clicked on you.
You haven't been on other parts of /g/ have you?
>>
>>52378125
>var variables defined outside of a function can be accessed inside

yes, but that doesn't mean you should do it, everything should be done in functions and only variables required for other functions should be passed there with function(x, y, z)
>>
>>52378136
I haven't. Do they consider it a meme?
>>
<pre><?php
echo "hello world";
</pre>
>>
>>52378114
"Everyone should learn programming!" is absolutely a meme.

>>52378125
The way you want to do this is
function handleResponse(var request) { ... }
then call with handleResponse(myRequest);

Might as well get used to writing code this way as it'll be really important later on.
>>
>>52378180
they should though

"if you understand programming, you understand the world" - aristotle
>>
>>52378192
>implying we need more code monkeys in the world
>>
>>52378214
think I'd rather trust aristotle's advice Tbh
>>
File: trig.gif (3 MB, 961x491) Image search: [iqdb] [SauceNao] [Google]
trig.gif
3 MB, 961x491
>he hasn't fallen for the tornado meme
>>
File: carshits.png (2 KB, 397x243) Image search: [iqdb] [SauceNao] [Google]
carshits.png
2 KB, 397x243
Lads how do I change this program so that it draws a car with two circles and two rectangles in java windowbuilder, pic related I did it before but forgot how? Please respond.

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class Grafik extends JFrame {

private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Grafik frame = new Grafik();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Grafik() {
setTitle("Grafik");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 600, 400);//(x,y på skärmen, bredd, höjd på fönstret)
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
public void paint(Graphics g){
g.drawLine(50, 50, 400, 200);
g.setColor(Color.GREEN);
g.fillRect(100, 100, 50, 100);//(x,y,bredd,höjd)
g.setColor(Color.RED);
g.fillOval(200, 150, 50, 50);//(x,y,bredd,höjd)
}
}
>>
>>52378313
m8 please use code tags
>>
In class right now, we gotta make some kind of database for plants.
I cant program for shit so I need help from you anons.

Were using C# in Visual studio by the way
>>
>>52378174
m8

<code>
<?php
echo "hello world";
?>
</code>
>>
>>52378363
muh breh, we fail together, welcome newfag :^)
>>
So for learning programming, I was gonna start with c programming a modern approach, then go through k&r, after those where should I start with c++?
>>
>>52378385
>after those where should I start with c++?
Don't. C++ is a horrible meme.
>>
>>52378404
>C++ is a horrible meme
Now that's a meme right there

C++ compiles slowly, but that's hardly a significant downside when you consider its thousands of advantages over C
>>
>>52378348
I can't help much with the info you gave me. Elaborate.
>>
>>52378428
>its thousands of advantages over C
Even if it does supposedly have thousands of advantages (hint: bloat != advantages), it has several MAJOR disadvantages which make it completely unsuitable to being even close to being a replacement for C.
>Unstable ABI (name mangling)
>Hard as fuck to parse (literally undecidable syntax)
>Hard as fuck to implement (huge standard library)
>Stupid features which make it not viable for systems programming (exceptions etc.)
>>
>>52378435

We're having some kind of "post-apocalyptic" theme week (its boring as shit) and we have to make a database with plants where it says if they're poisionous, if they're edible etc.

You should be able to search it as well.
We only need to make about 10 entries with plants since it's a prototype, not an actual full database
>>
>>52378428
>thousands of advantages over C
Shitload of "features", horrible syntax and inconsistent, bloated standard library doesn't make C++ better than C.
>>
File: 7LijQhD.png (134 KB, 928x267) Image search: [iqdb] [SauceNao] [Google]
7LijQhD.png
134 KB, 928x267
I'm trying to mod Rhytmbox so that the text that displays the song that's currently playing is placed at the center of the toolbar. However i cant seem to find any information on how to do this. I have never programmed XML before so i am a little bit unsure exactly how it works.

This is the code for the "box" that i want to align at the center:
<child>
<object class="GtkToolItem" id="song item">
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="song display">
<property name="can_focus">False</property>
<property name="margin_right">12</property>
<property name="hexpand">True</property>
<child>
<object class="GtkEventBox" id="album cover eventbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="visible_window">False</property>
<child>
<object class="GtkImage" id="album cover">
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="margin_left">12</property>
<property name="margin_right">12</property>
<signal name="query-tooltip" handler="bigger_cover" swapped="no"/>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>


Does anyone have any idea if/how i can do this without having to rewrite the entire program??
>>
>>52378376
ty senpai

<code>
<?php
echo "hello world";
?>
>>
>>52378463
We're gonna use unity to create a gui for it.
>>
>>52378404
>>52378462
>>52378480

I asked where I should start with C++ because I was planning on moving up to Java / C# as well, for the reason of hoping to look for employment eventually because while I enjoy learning it, and playing around with things, it isn't particularly productive on my own time.
If I can become relatively productive, and proficient at programming on my own time, I'd gladly take making it less enjoyable, moving to a job that isn't skilless, making more then the $1,200 a month I'm currently making in the U.S.
>>
>if err != nil {
holy shit fuck this language
>>
>>52378462
>Unstable ABI (name mangling)
The ABI isn't unstable. It's seldom standardised, but not because of name mangling. Compilers intentionally use different name mangling schemes to prevent you from trying linking code whose ABI is incompatible for other reasons (e.g. the implementation of pointer-to-member types and exceptions).

>Hard as fuck to parse (literally undecidable syntax)
Incorrect.

>Hard as fuck to implement (huge standard library)
C is the only mainstream language with a smaller standard library.

>Stupid features which make it not viable for systems programming (exceptions etc.)
You personally not liking exceptions doesn't make them "stupid" or unsuitable for systems programming. And most compilers allow support for exceptions to be disabled.
>>
>>52378631
https://blog.golang.org/errors-are-values
>>
>>52375963
gotta work on my daemon.

even though it's in go and uses concurrency and it's for a webapp I refuse to call it a microservice

I made a paranoid decision to have it disconnect invalid requests made over a unix socket immediately, but I actually need it to not hang up because there's a bit of latency between when the webapp will ask it something and when that resource will be available or something.

Making things that are too clever for their own good has been a major impediment to progress and is something I desperately need to unlearn. However I'm also coming to realize that not everything which can be expressed as code is so easily expressed in English. Moderation is the key to everything in life. So is Jar-Jar Binks.
>>
>>52378725
>>Hard as fuck to parse (literally undecidable syntax)
>Incorrect.
Templates are Turing complete, meaning you can do:

typename collatz_conjecture<N>::type t;
(or any other of your favorite unsolved decision problems)
making it literally impossible to parse.
>>
>>52378725
>The ABI isn't unstable
Yes it is. GCC changed its ABI not too long ago, and programs must be compiled again to use it.
Also take something compiled with GCC or whatever, and try and link it with something compiled with MSVC or some shit. C doesn't have that problem, and the ABI for that is not defined by the standard.
>Incorrect.
http://blog.reverberate.org/2013/08/parsing-c-is-literally-undecidable.html
>C is the only mainstream language with a smaller standard library.
So? That doesn't stop C++'s from being fuckhuge and bloated.
>And most compilers allow support for exceptions to be disabled
>Just ignore shit you don't like
Fucking Sepplesfags.
>>
http://pastebin.com/HathL3ai
>>
File: Untitled.jpg (121 KB, 1680x985) Image search: [iqdb] [SauceNao] [Google]
Untitled.jpg
121 KB, 1680x985
I'm making an open world vidja game
>>
I thought they said nim produced readable C
http://pastebin.com/CNetDGX7
>>
>>52379064
It's pointless to expect anything from machine generated code, even if they indent it or whatever.
>>
>>52378500
There's quite clearly nothing in the code you posted that defines where it appears on the window.

I don't know anything about that application or how it's written, but you're clearly not in the right place.
>>
>>52378300
>Posted in every thread
>Still nobody cares

Just stop posting it and give up.
>>
File: screenshot1.png (520 KB, 1680x987) Image search: [iqdb] [SauceNao] [Google]
screenshot1.png
520 KB, 1680x987
>>52379007
>>
jboss and postgres or tomcat and mysql?

http://strawpoll.me/6516622
http://strawpoll.me/6516622
http://strawpoll.me/6516622
>>
last one, using C's printf function instead of nim's echo
http://pastebin.com/5CJHgphx
>>
File: ff6tFwS.png (624 KB, 1543x967) Image search: [iqdb] [SauceNao] [Google]
ff6tFwS.png
624 KB, 1543x967
>>52378300
I just made my own.

# coding=UTF-8

import time
import math

string = "Mitt i träsket, jo Raggvaldsträsket där sover Theodor"
length = len(string)
space = " "

f = 0
i = 0

while True:
while True:
print space*int(math.sin(f)*40+50) + string[i:] + space + string[:i] #+ space + str(int(math.sin(f)*50)) + space + str(f)
i += 1
if i == len(string):
i = 0
f -= 0.08
time.sleep(0.02)


Wanna post your code?
>>
>>52379007
neat, what with?
>>
What distro should I install for basic programming? I don't need an X server.
>>
>>52379577
It makes basically no difference.
>>
>>52379577
you dont need X? then ubuntu server
>>
>>52379577
Every OS ever made supports basic programming
>>
File: stallman.jpg (36 KB, 700x394) Image search: [iqdb] [SauceNao] [Google]
stallman.jpg
36 KB, 700x394
>>52379577
Parabola GNU plus linux-libre
>>
>>52379602
windows requires you to install a software suite that takes up 3x more space than the OS before you can start programming according to microsoft
>>
>>52379658
You can program in notepad.
>>
>>52379676
enjoy your no compilers bro
>>
>>52379658
-write code in notepad/notepad alternatives
-compile it with mingw32
>>
>>52379708
like I said, windows does not come with compilers of any sort

the official route is through visual studio, or you're free to install your open source hackware.

just install linux, gcc and build-essential come by default on any sane distro.
>>
>>52379577
Every distro has gcc in its repos.
>>
>>52379658
You can use Pelles C or mingw. They're a fraction of the size of MVS. Pelles C is only like 10MB to download.
>>
>>52379594
Thanks.
>>
>>52376859
The best part about this is that it extends to 1D arrays, too.

Because arrays are, at their hearts, just pointers with offsets, you can treat them like that and it'll still work just fine.
>>
>>52379754
Even Android does, although you'll have to hunt for awhile.
>>
http://harmful.cat-v.org/software/c++/I_did_it_for_you_all
>>
>>52379887
pls anon, you are disturbing the industry.
>>
>>52379557
why do you have two while true statements?
>>
>>52379992
To be extra sure it runs forever, duh
>>
>>52376230
That's wrong though.
You're retarded.
>>
>>52379577
W10
VS2015 Update 1
Emacs
>>
>>52379292
>>52379007
Cool
>>
I'm doing the Heroku starting Ruby program and I just can't get over this problem.

at the start an error is expected " 'jruby' is not recognized as an internal or external command, operable program or batch file".
I solved that by just opening the command prompt in the default location "C:Users/xxxx"

Now at the later stages I need to install bundler again and i get the same error message. I tried fixing the PATH in the My Computer/Properties thing.

Someone please help.
>>
>>52380485
Did you reboot?
>>
>>52380577
No ,I didn't reboot...

I closed all cmd prompts and reopened them
>>
>>52380590
You need to reboot (or at least re-login).
Enjoy your Windows.
>>
>>52380590
Ok reboot
>>
>>52380617
Trolled hard LOL
>>
>>52380631
>>52380606
>>52380598
now not even "heroku login" doesn't work

man, fuck me.
>>
File: 1445511667448.gif (1 MB, 320x180) Image search: [iqdb] [SauceNao] [Google]
1445511667448.gif
1 MB, 320x180
how in fuck are sql databases so fast
>>
>>52380657
And this is why many installers modify the PATH for you. So morons like you don't fuck it up.
>>
File: 1426858342702.jpg (31 KB, 456x320) Image search: [iqdb] [SauceNao] [Google]
1426858342702.jpg
31 KB, 456x320
Hey /dpt/ i want to ask for a life advice.
I went to study CS on college and now im going to drop out. I would like to work as a programmer so my family won't think that im such a failure. What should I learn if i want to get a job in summer?

I know a little python, haskell and sql but im pretty bad at programming
>>
>>52380657
i fixed it by opening cmd in the heroku installation directory but the same doesn't work with jruby.

>>52380685
this is literally my first project, ofc I'll make mistakes.
>>
>>52380729
Post your PATH
>>
>>52380713
>I would like to work as a programmer
>im pretty bad at programming
Maybe try to find something you're good at?
>>
>>52380685
W10 has an almost decent editor for enviroment variables these days. Progress!
If only consoles would automatically reload them when they are changed we would be somewhere.
>>
>>52380734
In the meantime I prowsed Stackowerflow and I found this guy http://stackoverflow.com/questions/4154000/jruby-unable-to-install-devise-on-windows-using-jruby

I manually installed jruby and when in the same directory as jruby .exe file I get this "jruby: No such file or directory -- bundle (LoadError)"

The Path that was put in when I installed jruby (in the upper "user" variables) was this JAVA_HOME ; c:\program files\java\jre1.8.0_66

my regular(in the lower system variables) PATH ; C:\Ruby22\bin
>>
>>52380832
We'd be somewhere if this shit was saved on a per-user basis in a text file. So if you royally fuck things up to the point where you can't boot anymore that you could just use a live-cd/usb to restore it to working condition.
>>
I read in my book that all objects are descended from THE OBJECT in js. Can somebody explain more about THE OBJECT. Someone in the previous thread answered my question and this is wjat i got.
>>52372369
>>52372442
So subtypes of THE OBJECT, or condtructors/classes, are all the same thing. And these inherit from "THE OBJECT". Am i correct?
So there is such thing as THE OBJECT? Who created it, how do i see it?
>>
>>52380713

You need to have an attitude different than "im doing this so others dont percieve me as a failure" in order to succeed.

Learning how to program isn't just something you can do on a whim like that, which is why people study the topic for years and years. You will never get good at anything if you approach it with the attitude that it won't take much to master.
>>
>>52380676

https://en.wikipedia.org/wiki/Database_index
>>
>>52379676

Someone already said windows doesn't come with compilers so this is wrong. But also i'd like to add that other OSes also come with editors that you can ACTUALLY program in, such as vim and emacs.
>>
>>52379723
>your open source hackware
>linux
the irony
>>
>>52379992
So that it runs for forever ever
>>
did that guy with the bresenham's circle text ever make a flower of life?
>>
>>52380901

I read in the book that all people are descended from GOD in Heaven. Can somebody explain more about GOD? Someone in the previous thread answered my question and this is wjat i got.

So there is such thing as GOD? Who created it, how do i see it?
>>
>>52379557
>Mitt i träsket, jo Raggvaldsträsket där sover Theodor
what is this meme and why did a youtube commenter post it on 2 different videos 2 years apart? is it an in-joke or a reference or something?
>>
ran this on linux like 5 times, and moved it to windows thinking something was wrong cause it looked like it just wasnt opening in the terminal, on windows it just stopped instantly and I realised I was an idiot.
#include <stdio.h>
#include <stdbool.h>

int main()
{
int digit_seen[10] = {0};
long int n = 0;
int digit;

while(n = 0)
{

scanf("%ld", &n);

while(n > 0)
{
digit = n % 10;
digit_seen[digit] = digit_seen[digit] + 1;
n /= 10;
}

for(int i = 0; i < 10; i++)
{
printf("%d ", i);


}

printf("\n");

for(int k = 0; k < 10; k++)
{
printf("%d ", digit_seen[k]);
}
printf("\n\n");
}
return 0;
}


then fixed it

#include <stdio.h>
#include <stdbool.h>

int main()
{
int digit_seen[10] = {0};
long int n = 0;
int digit;

while(n >= 0)
{

scanf("%ld", &n);

while(n > 0)
{
digit = n % 10;
digit_seen[digit] = digit_seen[digit] + 1;
n /= 10;
}

for(int i = 0; i < 10; i++)
{
printf("%d ", i);


}

printf("\n");

for(int k = 0; k < 10; k++)
{
printf("%d ", digit_seen[k]);
}
printf("\n\n");
}
return 0;
}


slowly moving alone c programming a modern approach. (i guess not super slowly since its my first programming language, and I'm doing 4 chapters a day right now)
>>
>>52381121
Ok fien. But i has another question.
How does a javsscript function allow a new object to use the functions argument as its property?
>>
>>52381400
whoops, original code had while(n > 0) I screwed it up when I went to unfix it
>>
>>52381438
How do laws allow people to use the 'economics' argument for them to own property?
>>
>>52376254
>>52376138
>>52376173
Nice jokes!

And what platform is the best for developing in COBOL and SQL? Oracle Java or Microsoft .NET?
>>
C++ Primer 6th edition

is this good?
>>
>>52381576
I've heard bad things about the primer plus books.
>>
How is Unity cross platform when you write in C#?
>>
Shit man, x86 instruction encoding is convoluted as fuck.

It's no wonder Intel wanted to move to Itanium. This is literally retarded.

http://ref.x86asm.net/
>>
>>52381576

What will you use it for?
>>
>>52381733

Whats retarded about it ?
>>
>>52381648

Unity uses mono instead of microsoft's clr (which is what may be confusing you).

Mono compiles c# into ECMA Common Language Infrastructure (CLI), which is cross platform.

http://www.mono-project.com/docs/about-mono/
>>
>>52380743
You were a good programmer when you started?
>>
>>52381787
There's so many different fields for different scenarios that often fill inconsistent purposes based on the opcode. There's a huge number of ways an operand can be passed in and you have to know what all the different types are to use them. And things that you wouldn't expect to matter will completely change the encoding of an instruction (for example, there might be an old instruction that used to only work on the accumulator register, but now it works on anything, so if you try to use it with ebx you'll get a completely different result than eax cause it's a different opcode).

It's just a mess.
>>
>>52381854
Nobody expects you to be a good programmer when you start. But if you're trying to work as a programmer and are attending college for it, they expect you not to drop out, barring extenuating circumstances.
>>
>tfw no time to work on my own projects because I'm busy with work 24/7

Never let anyone tell you the codemonkey life is a good one
>>
>>52381982
How many hours a week do you work? I've been in a similar situation - it really sucks.
>>
>>52381822
Thanks
>>
So if I have a base class with a function.

And I have a dervied class that inherits from it.

Do I need to define the function in the dervied class if I want to use it?

I've seen something like

int DerivedClass::function()
{
return BaseClass::function();
}

Is this necessary?
>>
>>52381982
Like anything else, depends on the company.

We get free beer and a really relaxed work environment. If I take care of shit on time, they don't even care if I show up.
>>
>>52382361
Is the pay good?
>>
>>52382361
not a code monkey, i work an office job as well. extremely relaxed, always fun. beer near the end of shift, our own really nice offices, plus my boss is the only other one who smokes so i can go out whenever i want. downside, he smokes my smokes, upside, he buys me packs occasionally.
>>
>>52382361
>>52382548
>Pretending to like beer

You're really fitting in.
>>
>>52377973
Get inspired. Don't obsess about languages at first. You can make cool stuff in BASIC.

https://www.youtube.com/watch?v=Bl68a-WftNk
>>
I've decided it's for the best if I learn sepples seeing as C apparently doesn't cut it anymore.

How long does it take to get up to a professional standard in C++? Bearing in mind I know Java and C really well and have thorough understanding of pointers/computer architecture and object oriented programming
>>
>>52382668
Easy, you already know both sides of C++. Just take a few days to learn the syntax and you're golden.
>>
>>52382617
Beer is my 2nd favorite food, are you high or something? There's also nothing more relaxing than finishing a day in the office with a beer at your desk.
>>
>>52382692
That sounds cool although it looks like there's a lot more to it than that.

What's a really thorough and concise book? Bjarnes C++ programming language?
>>
>>52382822
That's the standard, yes
>>
>>52382866
Alright, and what sort of framework/libraries do you need to know besides the standard library?

e.g. in JavaEE I'd say it's Servlets, Spring/struts and Hibernate.
>>
>>52382924
The C++ standard library is huge, you don't really need to know much else. Everything else is just convenience libraries
>>
>>52382952
Really? That's pretty surprising seeing as it's pretty much impossible to have Java project without a whole bunch of external libraries even though it has a massive standard library.
>>
>>52383015
I very rarely find myself needing something that the standard library can't provide. It has a ton of shit and it's easy to work with
>>
File: Langtons Ant SFML.webm (760 KB, 566x478) Image search: [iqdb] [SauceNao] [Google]
Langtons Ant SFML.webm
760 KB, 566x478
Decided to go with SFML instead of libcaca (already have SFML set up)

Found it odd how it folded back on itself. Have never heard of examples of that.
>>
Friendly reminder that Java a shit
>>
>>52383457
What is it supposed to be doing?
>>
>>52382174
No what the fuck
>>
>>52383470
Friendly reminder that all languages have a time and place.
>>
>>52383539
It's a
https://en.wikipedia.org/wiki/Langton%27s_ant
Really simple.

This happened when I didn't take care of the ants position overflowing the buffer size on the Y axis so it wrapped to the top. I've fixed that, but I can't quite understand why it's going in reverse in that case.

I guess it's just because when left is right and right is left it has the exact same track to follow backwards as it did forwards. The wikipedia article doesn't mention this behavior when turning the ant around but I guess it might be fairly obvious if you grab a pen and paper and examine it.
>>
>>52382174
No the point is that you're supposed to only have it in one place. If OOP was about redefining your objects in terms of one another for no apparent reason nobody would even consider it.

Which would be great but that's not the reality we live in.
>>
>>52382668
> How long does it take to get up to a professional standard in C++? Bearing in mind I know Java and C really well and have thorough understanding of pointers/computer architecture and object oriented programming

Between a couple of months and a couple of years depending upon a) how good your Java/C/programming skills actually are and b) what you consider a professional standard.

Getting really good takes forever, but most jobs don't require that. They'd rather have an "adequate" C++ programmer with other relevant knowledge (libraries, formats/protocols, problem domain, etc) than someone who has mastered the dark corners of the language but knows little else.

The main problem is that, because C++ is in decline (Java, web and mobile have taken over a lot of what used to be done in C++), companies can afford to require prior professional C++ experience, and most do, making it hard to get a first C++ job.
>>
Electrical and Computer Engineering student here. Have to select a senior design project and I have no idea what to do. It has to include both hardware and software design.

Any ideas /dpt/?

I would like to do autonomous flight control systems, but that's probably not possible to do and write a 50 page paper on in a school year. Plus I'd probably have to front a lot of money, the school only helps out so much.
>>
File: 23-thomas-pynchon.jpg (1 MB, 2200x3037) Image search: [iqdb] [SauceNao] [Google]
23-thomas-pynchon.jpg
1 MB, 2200x3037
pair programming is literally just a forced hawthorne effect.
>>
>>52383958
Something that involves the following:
>Hardware that does something physically, like open a door or fill a vase full of water
>Database full of data from something, potentially a public API from something like Google
>Software that performs heuristic analysis on the data in the database and then controls the Hardware that does something

Like, parse google API to get hits for the republican candidates on social media, store in database, application analyzes information and fills huge tubes of fluid relative to apparent media support for candidate.
>>
>>52383978
Can probably attest to that. I've done pair programming with my mother at her work. It's very clear that she's more active when I'm there because I've helped her two days in a row on several occasions and there's no way she was as active during her 8 hours that we were during our ~4.

Not saying mom is bad of course. But as you say I don't think it's my direct contribution that helps that much, I make errors, sometimes point out hers, but that's very minor stuff for the most part (especially since she has great attention to detail).

She tells me I'm more courageous, she's very hesitant to most changes while I make them rapidly and then look for errors most of the time but it really doesn't account for that much time saved.
>>
>>52384114
>pair programming with my mother at her work.

I don't think I could do pair programming with my parents. Luckily, neither of them are programmers.

It would be bedlam.
>>
>>52383930
>a) how good your Java/C/programming skills actually are
good enough to get paid a decent amount

>b) what you consider a professional standard.
good enough to get paid
a decent amount for

>C++ programmer with other relevant knowledge (libraries, formats/protocols, problem domain, etc)
I see, that's pretty much what I expected. The question is what can I learn that will get me paid?

I've had a look at the libraries out there and I think the standard library is manageable. WxWidgets looks good for GUI programming and if openMP is used by C++ programmers then I have multithreading nailed.

That leaves a dependency injection framework (is it widely used in C++ like in java?) and a networking library.
>>
>>52376173
Haha! Nice joke. Python master race
>>
>>52384114
>I've done pair programming with my mother at her work.
w-what?
>>
File: smuggysmugsmug.png (36 KB, 268x237) Image search: [iqdb] [SauceNao] [Google]
smuggysmugsmug.png
36 KB, 268x237
>>52384168
No more questions.
Classified.
>>
>>52384168

Nepotism, not that there's anything wrong with that.
>>
>>52384168
https://dotnetfiddle.net/#&togetherjs=eohRtmrMQi

someone want to join ?
>>
assemblyfags are you contributing to psp uofw and why aren't you?
>>
/g/, we need to do something with:

http://www.pornhub.com/video/webmasterss
>>
>>52384012
That's some crazy shit. Sounds fun.
>>
>>52384221
>Nepotism
No not even. Wasn't paid. Just being a good son.
>>
File: 1449889036280.jpg (150 KB, 700x473) Image search: [iqdb] [SauceNao] [Google]
1449889036280.jpg
150 KB, 700x473
>>52384282
>Wasn't paid.
>>
>>52384244

what a clusterfuck
>>
>>52384249
No. PSP is gay. I'd rather work on PCSX2 if I wanted to do assembly in my spare time. TimeSplitters 2 has awful graphical bugs, Jak 3 intro scene is broken, Ace Combat 5 doesn't work at all... the list goes on. At least PS1 emulators have their shit together. No idea why Sony hasn't released a PC PS2 emulator. they would make a lot of money for sure and reuse a lot of the code from the emulator they have on the PS3.
>>
File: 1447824359920.jpg (67 KB, 436x437) Image search: [iqdb] [SauceNao] [Google]
1447824359920.jpg
67 KB, 436x437
Does anyone have experience with either the command line or stdin for txt files and ruby?

I need to create a program that accepts a txt file, makes an average from it, and then outputs another txt file with averages on it.
>>
>>52377406
read da standard, stack boi
>>
http://pythonfiddle.com/

GET IN HERE
>>
>>52384388
Give your program the file name/file path as one of the command line arguments.

Then use
http://ruby-doc.org/core-2.2.0/File.html
>>
>>52384388
Read in the variable ARGV, pop from it whatever
data you need to, open the file(s), read the contents, parse it, open another file, write to it, close both, done.
>>
hello!!
>>
File: 1442777696450.jpg (853 KB, 2276x2276) Image search: [iqdb] [SauceNao] [Google]
1442777696450.jpg
853 KB, 2276x2276
>>52384432
>http://ruby-doc.org/core-2.2.0/File.html
thank you

>>52384434
could you possibly review some of your favorite ways to do those?

Such as parse a txt doc in ruby, or how to create and write to a new txt doc?
>>
>>52384508
That room is just gorgeous.
>>
>>52384508
Depending on how you format your file, like if it's just a bunch of numbers separated by newlines, you could try something like this to turn a file into an array of integers.

def to_array(fi)
tmp = File.open(fi)
lines = tmp.readlines.map do
|line| line.to_i
end
tmp.close
return lines
end


This just maps a function over each line and says to call :to_i on each string.
>>
How the fuck do I start writing a compiler? I've gone through a general language theory course where we were quickly shown some basics of recursive parsing, but I have no idea how to put that into use.

Also what's a good language to write a first compiler for? Something that's significantly smaller than C but bigger than brainfuck or Forth.
>>
I want a snowflake button like the one on catalog.neet.tv on every page in my browser.

But I don't even know where to begin. Where do I begin?
>>
>>52384607
You go back in time, get yourself in CS while you are 6, stop being such a massive cunt eating faggot, start sucking COCK NOW and then you can POSSIBLY YOU HAVE SLIGHT CHANCE of actually do somthing RELATED to writing a compiler.
>>
>>52381110
that's me familio, I moved to CHIP-8 interpreter
>>
>>52384607
>How the fuck do I start writing a compiler?
If you are going to be writing a recursive decent parser you are going to have to design the language first. Try writing something like C, but more compact, with a less ambiguous grammar. Maybe a BASIC-like?
>>
I'm attempting to make a shitty chat server and client using java and sockets.
>Kill me
>>
File: 1451754656606.png (17 KB, 418x359) Image search: [iqdb] [SauceNao] [Google]
1451754656606.png
17 KB, 418x359
>his virtual machine has less than 50 opcodes
>>
>>52384810
Just use mIRC API
>>
>>52384825
>his virtual machine has more than 3

What do you NEED all those opcodes for?
>>
>>52384825
Why would it need more? Especially if the data types are all objects with overloaded methods the amount of op-code can be quite small (although performance will be bad).
>>
>>52384857
just felt like frogposting tbf lad

>>52384861
>why would it need more
>performance will be bad
>>
new thread when ? :3
>>
File: 1449836244895.gif (118 KB, 2130x1198) Image search: [iqdb] [SauceNao] [Google]
1449836244895.gif
118 KB, 2130x1198
>>52384268
is there a better way to do this?
import requests
from xml.dom import minidom

url = "http://www.pornhub.com/video/webmasterss"
foo = requests.get(url).content

xml = minidom.parseString(foo)
items = xml.getElementsByTagName('item')

for item in items:
title = item.getElementsByTagName("title")[0].childNodes[0].data
video = item.getElementsByTagName("link")[0].childNodes[0].data

print "{}\n{}\n".format(title, video)
>>
>>52384904
>nothing
>toronto
>wood
What is the point of this?

Is it some sort of upper-level soft trolling?

The smooth jazz of baiting?

I'm perplexed.
>>
>>52384904
>hydrogen floating in the middle

REEEEEEEEEEEE
>>
>>52384838
lmao
>>
I want to add a list of words to my WPF window and highlight individual words based on conditions.

How could I achieve this? I don't know enough about the controls and the UI to work it out.
>>
>>52384736
This is how I always viewed compilers, I might be taking a too big bite here.

>>52384796
Thanks, you're probably right a custom-made language is better as long as I can design one

Sorry for late replies btw
>>
>>52384954
Wax... That can't be right
>>
>>52384736
Jesus. Compilers aren't really that hard. Good optimizing compilers are hard but that's not what's being asked for here.
>>
>>52384904
>>52384938
>Dn - Doreen
>Te - Tedium
And my favourite
>Hi - Hello
About half the table is bullshit.
>>
>>52384607
Read http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf. That's all it takes.
>>
>>52385042
Make a listbox of textblocks. Databind your data in codebehind to the object.

From here you can do one of two things:
>store string with flag on whether it should be highlighted, this flag is used to modify GUI automatically with databinding
or the easier way
>basically do a foreach iteration over the listbox.Items collection and set the value based on what's in it

Something like this(this is basically pseudocode from memory):
foreach(var item in listbox.Items)
{
if(item.Text == 'ayy')
{
item.BackgroundColor = shitbrown;
}
}
>>
File: awTwlrT.png (6 KB, 635x141) Image search: [iqdb] [SauceNao] [Google]
awTwlrT.png
6 KB, 635x141
>>52385042
>>52385391
Going to expand on this because I'm bored.

Here's how you can easily databind a list of strings to a listbox:

var wordslist = new List<string>()
{
"ayy"
,"lmao"
,"foo"
,"bar"
}

listbox.ItemsSource = wordslist;
>>
>>52385391
Fuck, I was just thinking of doing that before but in my head I thought I was being an utter retard.

I started working on a horizontal stackpanel with a bunch of labels that I just iteratively add a list of values to.

Get the advantage of a horizontal display, completely lock out any user interaction and a little more control over how I display each part of it.

I don't get to use databinding unless I take the time out to create a custom data object for what amounts to 5 strings, and that seems far too much like hard work to me.
>>
>>52385596
Are you working on a media player?
>>
c++ meme tornado

r8
>>
>>52377638
Because the official docs are dogshit and the community's answer to any criticism to that effect is "just ask about your problems on IRC/SO, it's 2016!"

Picked up Ruby and haven't seen a compelling reason to switch.
>>
>>52385701
>20 nigs
0/10, no one wants that
>>
>>52385673
Nope, I dumped it for the time being, not much else I can do with it that I haven't already done, a lot of treading over the same ground.

Used a dictionary in my password generator, which was an absolute arse to find and get working properly, so I thought I'd use the dictionary for a typing speed test. Didn't want all the effort I put into the dictionary stuff to go to waste.
>>
>>52385701
I actually chuckled
although this could have been done in terminal, SDL (as cool as it is) isn't really needed here
>>
>>52385726
I didn't use SDL kek that was just an empty project file I had open
>>
>>52385701
>using memespace
>>
>>52385701
>not using radian
2/10 desu
>>
>>52385761
less precise /10
>>
File: neat.gif (429 KB, 530x981) Image search: [iqdb] [SauceNao] [Google]
neat.gif
429 KB, 530x981
>>52385701

The text is supposed to rotate, too.
>>
>>52385784
This guys fell for the floating point error meme!
Top kek
>>
File: hf1.jpg (54 KB, 800x599) Image search: [iqdb] [SauceNao] [Google]
hf1.jpg
54 KB, 800x599
How do I join a free software project? What's the usual way? I already have a portfolio, but I don't know where to start.

Pic unrelated
>>
>>52385701
combine it with fizzbuzz for reasons!
>>
>>52385701
>codeblocks
fucking dropped desu
>>
>>52385701
>codeblocks
Literally why?
>>
>>52385844
>write some commits
>join their organisation/mailing list
>???
>non-profit
>>
File: Untitled.png (19 KB, 606x404) Image search: [iqdb] [SauceNao] [Google]
Untitled.png
19 KB, 606x404
Threading doesn't make it go any faster,
What am I doing wrong?
>>
http://pastebin.com/ieK5YazG

Yeah I know this is pig ugly and could be done far better by someone with half a brain, but it works (mostly)

For some reason both of my lists end up being identical, containing the exact same list of 5 different words, I just don't understand why.
>>
NEW THREAD!

>>52386154
>>52386154
>>
File: 1447661067683.jpg (23 KB, 499x430) Image search: [iqdb] [SauceNao] [Google]
1447661067683.jpg
23 KB, 499x430
>>52386135
How does one get the right to submit commits? Does one just ask and provide their portfolio?
>>
update
>>
>>52386217
You don't. Anyone can. Read their style guide, if any, and just do it.
>>
>>52386147
lmaopythonthreading
>>
>>52386148
Print out the values generated by rand.Next. You may be misusing the rng.
>>
>>52386598
The values are the same...

Why? How on earth does that happen?
>>
>>52386650
>>52386598

I moved my rand declaration out of the method and now it works fine.

Literally what. I don't understand how that works at all.
>>
>>52386650
I don't know Java(?), check the documentation for Random. Because you use
Random rand = new Random();

in the function the RNG may be initialised to the same state every time. There may be a parameter you can pass to seed it properly.
>>
>>52386707
I'm using C#

But yeah that makes sense, It still seems strange to me that the random would spit out the exact same value even though it's being called again.

I guess I'm iterating through the values of the declared random, instead of generating an actual new random number.

I assume it's entirely performance related.
>>
>>52386743
From the docs
>The default seed value is derived from the system clock and has finite resolution. As a result, different Random objects that are created in close succession by a call to the default constructor will have identical default seed values and, therefore, will produce identical sets of random numbers. This problem can be avoided by using a single Random object to generate all random numbers.
>>
File: HE_MAD.jpg (166 KB, 1000x678) Image search: [iqdb] [SauceNao] [Google]
HE_MAD.jpg
166 KB, 1000x678
Can you explain to me how tagged pointers work in C /dpt/, or at least point me in a good direction.

I mean literally how do you program that.
Thread replies: 317
Thread images: 36
Thread DB ID: 404084



[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | 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.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.