[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: 328
Thread images: 17

File: this cost $1000 dollars.jpg (79KB, 800x450px) Image search: [Google]
this cost $1000 dollars.jpg
79KB, 800x450px
old thread: >>56090130

What are you working on, /g/?
>>
File: photo_2016-08-07_22-23-40.jpg (154KB, 720x1280px) Image search: [Google]
photo_2016-08-07_22-23-40.jpg
154KB, 720x1280px
Dear /dpt/

I don't know jack shit about code, so please be kind to me and use as simple language as possible

I'm getting a syntax error with this bit of code when I try to compile

 #include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty */
KEYMAP(ESC, 1, 2, 3, \
1, 2, 3, 4, \
1, 2, 3, 4, \
1, 2, 3, \
1, 2, 3, 4, \
1, 2 )
};


And here's the error message in question

keymap_poker.c:11:2: error: expected '}' before ';' token
;
^


What do I have to change in my code to make it compile properly? Thanks a lot in advance

It's the TMK keyboard firmware in case anyone's wondering, pic related
>>
>>56094389
>lowercase old thread
is that you, trap fag?
>>
>>56094400
try:
add a ; after ) before };

catch:
if it doesnt work
>>
>>56094400
what's the KEYMAP macro definition?
>>
>>56094400
try removing the {}? probably the KEYMAP macro does it for itself
>>
>>56094275
Both values (cotton-eye-joe and penisCocks) are actually in the list after checking that out, but only penisCocks is printed.
>>
Pls tell me what's wrong with my game of life:
https://github.com/7Y3RPXK3ETDCNRDD/gif_game_of_life
>>
>>56094514
It's written in C++.
>>
>>56094514
>uses 1.5GB ram

WHAT
>>
>>56094514
You forgot to use comonads
>>
>>56094400
Should have used an Arduino and wrote your own firmware from scratch, famalam :^)
>>
Here's what the code's supposed to look like

 const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty */
KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, BSLS, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \
LCTL, A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,FN0, \
LALT, FN1, SPC, PAUS,RALT),
};


https://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html#p141386

>>56094419
Did not work unfortunately, just gave me a second error message

 keymap_poker.c:10:18: error: expected '}' before ';' token
1, 2 );
^
keymap_poker.c:11:3: error: expected '}' before ';' token
};
^


>>56094434
Also an error

 KEYMAP(ESC, 1, 2, 3, \
^
keymap_poker.c:5:5: warning: (near initialization for 'keymaps[0][0]') [-Wmissing-braces]
keymap_poker.c:10:18: error: expected '}' before ';' token
1, 2 );
^
>>
>>56094538
200 500x500 sized images are expensive. Any idea on how to reduce the size? Didn't find anything on magick++ docs.
>>
A question to C/C++ fags:

int a = 1;
int b = 2;
int c = a---b;


Does c evaluate to
(a--) - b
or to
a - (--b)
?
>>
>>56094462
You've got to be doing something silly in your code.

Pastebin the entire method that fires when you change the dropdown selection.
>>
>>56094573
Why the fuck would you need to store them all?
>>
>>56094573
>200
What the fuck?
You only need 1
>>
>>56094599
To make a gif.
>>
>>56094573
Why are you storing them all in memory?
>>
>>56094587
(a--) - b

http://en.cppreference.com/w/c/language/operator_precedence
>>
>>56094389
>What are you working on
a table
>>
>>56094608
Have you never thought to free the last frame after you're done with it?
>>
>>56094573

Compression of some sort.

IF memory is really that restrictive you're going to have to bite the bullet and take the reduction in speed by decompression on the fly.
>>
Am I really a garbage-tier programmer if I use GLFW? I did some googling and everyone says it's retarded to interface with xlib directly, and there is NO FUCKING WAY I'm going anywhere near the shitshow that is Qt. Am I actually losing out on anything by using GLFW?

I'm just writing a simple OpenGL data visualization tool.
>>
>>56094573
200 x 500 x 500 = 50000000 = 50,000,000
50 Mb

assuming you unfortunately needed 24 bytes per pixel, for some weird reason

50 Mb * 24 = 1200Mb = 150MB
>>
>>56094550
so does it work when you copy paste the example code verbatim? my guess is this errors cos you are passing fewer arguments into the macro than it expects but then i also thought you get an error if you give a c macro the wrong number of arguments so what do i know
>>
>>56094632
>Am I really a garbage-tier programmer if I use GLFW?
Not at all.
GLFW is probably the best choice for OpenGL applications.
>>
>>56094608
So write to disk and retrieve them in batches.
>>
>>56094632
There's nothing wrong with GLFW. If all you need is an OpenGL context you should use whatever gets you there in the easiest way. Writing platform specific code for it is just unnecessary masturbation shit.
>>
>>56094632
>Am I really a garbage-tier programmer if I use GLFW?
Yes, use SDL.
>>
>>56094640
>implying he doesn't have 8 objects containing duplicate data for each frame
>>
>>56094389

Working on 2D game engine with c++ and lua, exported 40 function from c++ to lua, now it has nice little small api

For now "engine" reads config.lua for resolution, fps, vsync and that stuff, and main.lua for load, update, draw... Lua handles all logic, c++ just does math and puts stuff on screen
>>
>>56094660
>Use a library that has a ton of features you have no use for to set up an OpenGL context

I use SDL myself but really dude?
>>
>>56094632
well you lose out as soon as you want an actual ui or portability. if you just want to render stuff and maybe have mouse events then who cares.
>>
>>56094673
Cool.
Nice job.
>>
>>56094676
SDL is awesome for quick and dirty stuff
>>
>>56094683
And GLFW is even quicker and dirtier for this purpose
>>
>finally decide to set up Spacemacs
>MELPA is down

Fuck this gay earth
>>
>>56094692
>spacemacs

meme editor
>>
>>56094683
>SDL, king of bloat, awesome for quick and dirty stuff

Kek. I hope you engine your gayme engine kiddo. I'll be over here using Wayland.
>>
File: FixGates.png (22KB, 386x340px) Image search: [Google]
FixGates.png
22KB, 386x340px
>>56094673
Sounds noice. Puts me in awe. Post updates.

(pic related: just a little reward for rocking all the way)
>>
>>56094629
Did you see the code? I don't think that's possible.
>>56094641
It's imagemagicks magick. I don't know why the fuck images are so big.
>>56094654
How do i make gif without loading images to memory? Using magick++
>>56094630
Ok thanks
>>
>>56094692
>spacemacs
why do people keep falling for these "u're choice!!1!" meme projects? just use plain emacs
>>
>>56094705
What you suggest using wayland specific code? Have a good time running that anywhere else...
>>
>>56094705
>Wayland
>comparable to SDL

???
>>
>>56094719
>he saves 2 hours out of a potentially 1000+ hour project by using SDL instead of writing more performant, more controllable, 100% customized per-platform code

You're the meme now, friend
>>
>>56094742
Yes, the performance of my OpenGL context creation is of utmost importance.
>>
>>56094742
If you want performance you use OpenGl not native code, what kind of autistic masochist are you?
And for 2D games even opengl is overkill
>>
R8 my FB! It ran on the first try!

package main

import "fmt"

func main() {
for i := 1; i <= 100; i++ {
case_i := 0
if i % 3 == 0 {
case_i += 1
}
if i % 5 == 0 {
case_i += 2
}
switch case_i {
case 0:
fmt.Println(i)
case 1:
fmt.Println("Fizz")
case 2:
fmt.Println("Buzz")
case 3:
fmt.Println("FizzBuzz")
}
}
}
>>
anon was doing haskell prime sieve earlier
here's a (slightly altered*) sieve from the haskell wiki
{-# OPTIONS_GHC -O2 -threaded #-}
{-# OPTIONS_GHC -with-rtsopts="-n10" #-}

import Data.Array.Unboxed
import System.Environment (getArgs)

primesToA :: Int -> [Int]
primesToA m = sieve 3 (array (3,m) [(i,odd i) | i<-[3..m]] :: UArray Int Bool)
where
sieve :: Int -> UArray Int Bool -> [Int]
sieve p a
| p*p > m = 2 : [i | (i,True) <- assocs a]
| a!p = sieve (p+2) $ a // [(i,False) | i <- [p*p, p*p+2*p..m]]
| otherwise = sieve (p+2) a

main = do
args <- getArgs
case args of
n:_ -> print.last.primesToA.read $ n
_ -> return ()


*i added main and the threaded/n10 pragmas
*if you don't have 10 threads you might want to lower that
>>
>>56094595
Well it's not that it doesn't flat-out work, it just doesn't print both items if I only have two pieces of data within the list. It's the only case where it happens: if I reduce the item list to 1, it prints out the one fine. If I up it to three or more, it prints out all three no issue.

This is the method without placeholders like aThousandDicks. [source] is just the filepath.

http://pastebin.com/X4XRmSv4
>>
>>56094755
Software blitting is slow as shit. If your 2D game wants to run above 720p at 60fps you're going to need to use OpenGL or require an i7 processor as your minspec
>>
>>56094771
compile it with GHC
ghc file.hs

run it with the number
file 2000000
>>
>>56094775
You can get hardware accelerated rendering without using raw OpenGL. Using SDL, for example.
>>
>>56094775
Yes maybe i went bit too far but SDL2 does in fact use hardware blitting, SDL1 used sw
>>
>>56094755
>And for 2D games even opengl is overkill
S U M M E R
U
M
M
E
R
>>
comming from book thread
what book you've read in the past would you recommend ?
>>
>>56094787
SDL is just an abstraction layer on top of opengl
>>
>>56094514
No one has used magick++ before? Is there a better alternative?
>>
>>56094809
Thanks for your insight
>>
>>56094795
refer to >>56094789

But my point still stands
>>
>>56094868
opengl is not overkill for PROPER 2d games, SDL IS FUCKING SHIT, you could use a game engine but even with a game engine for a craptacular 2d gaym if you have the slightest clue what you're doing you should be writing shaders and such
>>
>>56094798
parsing techniques: a practical guide

obviously only useful if you care about parsing
>>
>>56094773
>if I reduce the item list to 1, it prints out the one fine. If I up it to three or more, it prints out all three no issue
Odd.

So after the while statement, if countyTransfer has exactly two, you get the issue, but only if it has exactly two elements.

Is that correct?

Honestly, I don't see anything that would cause that in any of the code you've posted, unless you're using some sort of pants-on-head GUI control library.

I'd need to build your project and play with it myself to try to duplicate the issue.

Try re-arranging where you set the ItemsSource:
http://pastebin.com/dm1Vj4Ui
>>
>>56094930
well if its a good read I'll look into it
thanks for the suggestions though
>>
>>56094913
What's so shit about SDL anon? Dota 2 uses SDL. I'm sure if it's good enough for Valve, it's good enough for me.
>>
>>56094962
using SDL for 3d is basically the same as using raw opengl, the convenience shit is only basic 2d stuff, if you don't want your game to look like mspaint bullshit you'll be using opengl directly

>3D graphics:
>SDL can be used in combination with the OpenGL API or Direct3D API for 3D graphics
>Accelerated 2D render API:
>Supports easy rotation, scaling and alpha blending, all accelerated using modern 3D APIs
>Acceleration is supported using OpenGL and Direct3D, and there is a software fallback
>>
>>56094775
>If your 2D game wants to run above 720p at 60fps you're going to need to use OpenGL or require an i7 processor as your minspec
No.
>>
Task: write a program that outputs a cross to the terminal
#include <stdio.h>
#include <stdlib.h>

void printX(int lines){
for(int i = -lines/2;i<=lines/2;i++){
if(i == 0){
for(int j = 0;j<lines/2;j++)
printf(" ");
printf("*");
} else {
for(int j = 0;j<lines/2-abs(i);j++)
printf(" ");
printf("*");
for(int j = 0;j<abs(i*2)-1;j++)
printf(" ");
printf("*");
}
puts("");
}
}

int main()
{
printX(10);
return 0;
}



output
*         *
* *
* *
* *
* *
*
* *
* *
* *
* *
* *

>>
>>56094389
I'm working on trying to define a variable inside an if statement in scheme
(if  (> number1 number2) (define x number1)
(else define x number2))

assuming number1 and number2 are alredy defined this should work, right?
>>
homework help ? writing a program in C; that shifts strings left or right to a desired amount by the user. i have not figured out how to contain the shifting so that if the user goes over 'z'(right shift too far) or under 'a'(left shift too far) it would reset ?
>is there a lib for this ? im new here
example:

"abcxyz"
shifted to right 8
"ijkfgh"


 how i modulo i dont fucking understand ? pls atleast link me to something
>>
>>56095009
Arent you the same guy who was couple of minutes ago advocating using native wayland code?
>>56094742
>>56094705
>>
>>56095080
Nice argument. Have you done high res software rendering before?
>>
>>56095098
This should be a legitimate replacement for fizzbuzz.
It actually forces you to think.
>>
>>56095123
yes im the guy from last thread

V V here
>>56093934
>>
>>56095128
no, that guy uses capitalization and punctuation
>>
How do I learn haskell? I was reading learn you a great haskell but then i read someone shit on it so I started doing CIS 194 but it's fucking boring and I want to get on to making my own project, but I fear that I'm going to not abstract anything since I know basically enough to program anything (just stacking functions and the type system) but not enough to do the actual cool stuff.
>>
>>56095150
Oooh okay, i was suprised by display of sanity.
So for 2D games do you think opengl is a must? Considering SDL2 does use it behind the scenes for hw acceleration.
>>
>>56095123
dude if you spend an hour failing at this problem, you really should not pass this class

just google caesar code c implementation and there are tons of resources/solution just one google query away

its fucking embarrassing

>inb4 i took the bait
>>
>>56095159
>haskell
>doing cool stuff
you got rused
>>
who reverse engineering here?

smali code is ok i guess. want reliable ways to get the full java source for analysis and review.

any tools to reverse all codes that outputs are close to being replicated without errors or interpreted?

any past experiences to share?
>>
>>56095177
it depends on what you're doing, but imo i think it's best if you learn how to replicate the SDL stuff yourself (using linear algebra in a shader for rotation and scaling) and then you can build upon those skills. if you're going for a retro look then just using SDL stuff and not having fancy shaders could be ok.
>>
>>56095159
LYAH is fine for a beginner, but it's full of autism

>>56095137
x == y or x == n-y
barring linear transformations, and maybe adding or removing 1 from n
>>
>>56095123
If you don't understand the modulo thing just make some if statements checking if you're out of bounds

was it you asking "how to convert chars to ints?" too?
>>
>>56095218
Do you have some books or sites to recommend for learning OpenGl properly?
>>
>>56095187
I had couple of pleasant experiences with jdGUI and some other online decompilers if you already have the bytecode

I wouldnt count that reverse engineering, if that answer covers your question
>>
>>56095150
Why don't you?
Are you underage or something?
>>
File: vtyMBJp.png (6KB, 960x480px) Image search: [Google]
vtyMBJp.png
6KB, 960x480px
>>56095143
I'm not spoonfeeding you the actual solution so you better sort yourself out.

for (int i = 0; i < 100; i++)
Write(i % 11 + ", ");
>>
>>56095240
Best source is the Arc Synthesis tutorials. https://bitbucket.org/alfonse/gltut/downloads

Teaches you "MODERN" OpenGL, not the outdated fixed-function stuff.
>>
>>56095123
from string import letters

list_of_letters = list(letters[0:26])

def rotate(your_string, num_shifts):
n = []
for i in range(len(your_string)):
pos = list_of_letters.index(your_string[i])
new_pos = (pos + num_shifts) % 26
n.append(list_of_letters[new_pos])
return ''.join(n)


print rotate("abcxyz",8)
>>
>>56095240
probably this: >>56095302

and https://open.gl/ could help you get started really quickly but you'll need to read more on the subjects after following those tutorials

and read the opengl wiki, the opengl reference pages and the opengl spec, not all at once but for the specific topic (VBO, FBO or whatever) you're working on at the moment
>>
>>56094938
> So after the while statement, if countyTransfer has exactly two, you get the issue, but only if it has exactly two elements. Is that correct?
Yes.

>pants-on-head GUI control library
I dunno if WPF is pants-on-head but there's a bit more documentation for WinForms over it.

>Try re-arranging where you set the ItemsSource:
Will report back.
>>
>>56095324
this compiles well with gcc thx
>>
>>56095337
Thank you very much. I tried to learn it couple of time but it would always be some old tutorial....
>>
>>56094938
>>56095355
Fast report back; shifting the ItemsSource where I set the list.ItemsSource equal to the list holding the retrieved values fixes that "exactly two only prints the first" case. I don't know why that is.

Thanks for looking it over.
>>
Switching to vim from Emacs, how do I get basic CEDET-style functionality in vim? I'd like some simple autocomplete but it seems like there's a half dozen plugins that offer that. Any that are actually good?
>>
File: EqualUnhealthyImperialeagle.webm (638KB, 1258x362px) Image search: [Google]
EqualUnhealthyImperialeagle.webm
638KB, 1258x362px
>>56095355
>People using WPF without even attempting to use any of the available tools to make their lives easier.

If you're not going to do MVVM at least learn to use some of the basic functionality.
>>
>>56095454
You should make it increase in frequency

faggot
>>
>>56095252
could you copy the java code and recompile it and run it or did you have problems?

and if you recompiled it, what did you do to make it work?
>>
>>56095484
It's literally two whole lines inside the "Timer_Tick" method. Add it yourself instead, faggot.

if(timer.Interval > TimeSpan.FromSeconds(0.1f))
timer.Interval -= TimeSpan.FromSeconds(0.1f);
>>
>>56095525
>download this IDE so you can edit my code for me
no thanks
>>
>>56095098
>>56095137
>>56095220

I tried a little:

fn cross(lines: usize) -> String {
let mut c = String::with_capacity(lines*lines);
for line in 0..lines {
c.push_str(&cross_line(line, lines));
c.push('\n');
}
return c;
}

fn cross_line(line: usize, lines: usize) -> String {
let mut l = String::with_capacity(lines);
let star = lines - line - 1;
for i in 0..lines {
if i == star || i == line {
l.push('*');
} else {
l.push(' ');
}
}
return l;
}

fn main() {
println!("{}", cross(11));
}
>>
File: DtPpMdg.png (31KB, 857x657px) Image search: [Google]
DtPpMdg.png
31KB, 857x657px
>>56095545
>Download this IDE

Sure is summer around here.
>>
Anyone else have that feeling where programming is like magic?

To convey what I mean better, you know that hypothesis about our universe being a simulation?
Aren't the simulations we create just as real to the elements of the simulation as we are to our own universe, then? Even if our simulations are far more simple, of course.

I just think it's a cool idea to, say, create a simple universe simulation, and be the god of it, to actual living beings in the simulation.
>>
>>56095454
>MVVM
I only know that it exists, I don't know how it really works outside of "what the user sees and what goes on under the hood are separate entities that are aware that the other exists and are united somewhere in the middle". I'm not even sure if that's right. This entire thing was more just jumping int and seeing how far I could go based on what I knew and if it all worked out, I'd have something cool that people used to show for it. wpf-tutorial would have been great if it wasn't so basic; "you can implement a comboBox like this and adding values to it using comboBox.Add(shit)"
>Available tools
What are the tools?
>>
>>56095545
>>>downloading an IDE just to compile someone's code
Are you retarded? literally every machine that matters should and does have vim (or vi) and gcc already installed.
>>
>>56095602

You ever see the episode of Rick & Morty with the Gooble Box? That's us.
>>
>>56095159
Read 'Thinking Functionally with Haskell', it's regarding as the best actual book for all I know.
>>
>>56095601
>>56095625
>And .NET
>>
>>56095638
I don't watch that show, but a quick search tells me it has more to do with controlling people than doing magic? i.e. capitalism
>>
>>56095602

>>56095602

Programming literally can be traced back to the concepts taught in the esoteric mystery schools of old.

Actually many forms of "Magic" and Religion teach the same concepts and methods we use in programs / to program.
>>
>>56095622
In this case the single tool you need to know about is an "ObservableCollection" which notifies the UI that the collection has changed.

If you want to get into MVVM it's really not that difficult.

Here's a (somewhat over-simplified) tutorial which will show you how it works.
>>
File: circlebounds.jpg (33KB, 868x177px) Image search: [Google]
circlebounds.jpg
33KB, 868x177px
If I pass in a (Rectangle player), it works fine.

What do I need to do differently to make my circle bounds work?

I'm using Libgdx, and maybe box2d
>>
>>56095223
not convert char to int.

just shift left or right a specific amount of chars chosen by user.
'z' + 1 = 'a'    //  i need this to happen
'z' + 1 = '{' // this is what i get though


i dont know if im making this more difficult than i need to ?
>>
>>56095098
*         *
* *
* *
* *
* *
**
**
**
**
**


You know what, fuck this, I give up.
>>
>>56095666
>controlling people
>capitalism

You're a fucking retard. Please kill yourself.
>>
>>56095702
How, post code
>>
>>56095711
rude
>>
>>56095721
void cross(int n)
{
int i, j;
for (i = 0, j = n - 1; i < n; i++, j--)
{
int z;
for (z = 0; z < i; z++)
putchar(' ');
putchar('*');
for (z = 0; z < j - i; z++)
putchar(' ');
putchar('*');
putchar('\n');
}
}
>>
>>56095727

You said an asinine thing, and you're probably a leftist. You might even be a socialist weenie.

Yes, I am very angry.
>>
>>56095674
this

the higher ups of people who have alot of money and own a bunch of things and people usually are in to the occult. im not joking.

programming is just knowing the language and doing what you can with it to your best ability. the language is arbitrary because it creates specialization.
>>
Not very well written

grid n = concat [ str (pred n) (x,y) | x <- [0..n], y <- [ 0 .. n ] ]
where str n (x,y) = char : newl where
char' True = 'x'
char' False = ' '
char = char' $ cond n (x,y)
newl = [ '\n' | n == y ]
cond n (x,y) = or [ x == y, x == (n - y) ]

main = (read <$> getLine) >>= putStrLn . grid
>>
>>56094707
>self
>>
>>56095711
Forgot you were one of those people, woops
>>
>>56095742
That's not me (>>56095602)
>>
>>56095731
Maybe try to break it up into smaller functions, e.g. printing a line based on the line number and the total number of lines, kinda like >>56095549
>>
>>56095698
hint:
if character > z then
character -= length-of-alphabet
>>
>>56095764

One of those people who isn't a retard. Capitalism isn't about controlling people, it's a system where people get exactly what they deserve.

>>56095780

Oh, okay. Noted.
>>
>>56095698
You're a goddamn moron.

string RotateString(string input, int offset)
{
char[] chrArr = new char[input.Length];
for(int i = 0; i < input.Length; i++)
{
chrArr[i] = (char)((input[i] + offset) % ('a' + 26));
}
return new string(chrArr);
}


Take your solution written in C#, write it in whatever language you're using and go away.
>>
>>56095818
Oh I'm the moron, forgot to add a floor :^)
>>
>>56095814
If capitalism was a pure meritocracy, sure. But if you think people get what they deserve under capitalism as-is then you must also agree that people under serfdom got what they deserved too.
>>
>>56095818
that's wrong tho, if you use 'a' + 26 as the modulo, it won't wrap around to 'a' but to 0
>>
>>56095867
See
>>56095838
>>
>>56095750
obfuscated version
import Control.Monad (replicateM)
import Control.Applicative ((<|>))
grid=grid'.pred where grid' n=concat [(['x'|c]<|>" ")++['\n'|y==n]|[x,y]<-replicateM 2[0..n],let c=x==y||x==(n-y)]
>>
>>56095803
isn't that cheating?
>>
>>56095887
Why would it be? It's just modularization.
>>
>>56095059
>prohibition of drugs, more prison expansion, no abortion clinics
>implying those are bad for any reason (other than perhaps the eugenic effect of abortion)
>>>/reddit/
>>
>>56095814
>>56095854
>capitalism
>it's a system where people get exactly what they deserve.

true until people who get into power through nepotism and unearned credit start making it tough for certain people to move up or make their own space.
>>
>>56095914
He won't budge, no need to derail the thread.
>>
>>56095854
>capitalism as-is

What we have right now is a corporatocracy (or a plutocracy, perhaps).

If this is what you consider "capitalism as-is" then Venezuela is socialism as-is. I think even the most brief inspection should reveal the better option.
>>
>>56095923
>He won't budge

There's no budging to do. I've reached the apex of economic ideologies. There's nowhere further up to go.
>>
>>56095907
ok fine

rate my solution!
void cross(int n)
{
n += (n % 2); /* force even n */
int i, j;
for (i = 0, j = n - 1; i < (float) n / 2; i++, j--)
{
int z; /* top */
for (z = 0; z < i; z++)
putchar(' ');
putchar('*');
for (z = 0; z < j - i; z++)
putchar(' ');
putchar('*');
putchar('\n');
}
for (i = 0; i < (float) n / 2; i++)
putchar(' '); /* middle */
putchar('*');
putchar('\n');
while (i-- != 0 && j++ != n)
{
int z; /* bottom */
for (z = 0; z < i; z++)
putchar(' ');
putchar('*');
for (z = 0; z < j - i; z++)
putchar(' ');
putchar('*');
putchar('\n');
}

}
>>
>>56095946
what about socialism and the only way to move up is genuine contribution?
>>
>melpa STILL fucking down

Goddammit. I JUST installed Linux and was looking forward to doing some programming but how the fuck am I supposed to do anything without my packages?
>>
>>56095965
Socialism is theft. Remember, you don't owe society or the government anything, and if they try to take anything from you, then they're infringing on your rights.
>>
>>56095115
Remove the else.
>>
>>56095967
Use NVIM. No seriously that old hag Melpa is fucking down? Is this the end of history endly? Not too freaking soon...
>>
>>56095977
what if society is paying for my standard of living?
3 hots and a cot and all the internet and healthcare i need. And when i mean healthcare i mean getting my needs met like sex drugs and rock and roll?

Should i atleast devote my time to help with research or make cool gadgets to sell?
>>
>>56094514
>>56094538
>uses 1.5GB ram
Is this serious? I remember writing a version in Quick BASIC that ran no problem on an old 286 machine with 640 KB of RAM (although only 80x25 or 320x200 as opposed to 500x500). If this is true you should fucking kill yourself.
>>
>>56094389
love live is shit
>>
>>56095977
Ha what? That argument is against frree healthcare, free primary schools, subsidised transportation and pretty much anything government provides with tax money
>>
I'm checking if the boundaries of a circle contact any of the 16 rectangles in my game.

Should I first check to see if a square box that surrounds my circle contacts any of the 16 rectangles, for optimised performance?

Any thoughts?
>>
>>56096014
long live the funk
>>
>>56096012
It's because it creates .gifs. It's still too big, though.
>>
>>56096023
No need just check if any edge of polygon lies within circle
>>
>>56096021

That's right. They are all funded by theft. They are not free.

>>56095965
>socialism
>up

Socialism results in extreme poverty.
>>
>>56095123
To your defence, maybe you don't see the link between the raw modulus and your problem, and if you don't have a seasoned mathematical culture --- read: you knew it already --- it's not your fault. Try this but promise me that if you still don't see the light after that, you'll admit that you are a hopeless moron and just commit honourable GNU/Seppuku!
>>
>>56096008
>what if society is paying for my standard of living?
then the wealth of society is be taken through theft. you owe society nothing an society owes you nothing

>>56096021
>anything government provides with tax money
>Steals from people to legitimize it's power
FTFY
>>
>>56096012
That's neat. Though i think you should've spent that time on learning how to read instead.
>>
>>56096063
What the hell are you talking about, most of europe is kinda socialist. Whats better alternative capitalism?
>>
>>56096078
forgot link OMG https://en.wikipedia.org/wiki/Modular_arithmetic
>>
>>56096021
i think i get what hes saying.
Instead of the government rounding people up for tax money with threat of jail through their ranks of racist white people dressed in uniform and weapons payed for by the tax payers and the civilians cannot match against the big corporations should be in charge of providing healthcare, education, living expenses, paid vacations, and bonuses for the people that work under them.
>>
Rate my cross printing program /g/

main=(read<$>getLine)>>=putStrLn.grid'.pred where grid' n=concat[concat[['x'|c],[' '|not c],['\n'|y==n]]|x<-[0..n],y<-[0..n],let c=x==y||x==(n-y)]
>>
>>56096085
>most of europe is kinda socialist.

And that's why they aren't allowed to have guns for personal protection. They'd be shooting at government officials over 50%+ tax rates if they had them.

>Whats better alternative capitalism?

There is no better alternative to capitalism.
>>
>>56096058
Surely that's the same / just as cpu intensive as what I'm already doing?
>>
Going to take Theory of Programming in the Fall semester. Is it going to cover SICP and/or functional programming? Has anyone else taken a class like this?
>>
>>56095748

The people propagating and strengthening this illusionary system of freedom ad knowledge indeed are all into the occult.

The ruling power's use of the occult is shown in everything that surrounds us. The only recourse is to not buy into / fuel / spread the system and actively exposing anything you can to heighten the awareness of the population as a whole.

As for languages they're just forms of expressing and manifesting. You should only develop things that fit your beliefs / truth. Only work on projects that you fully know the impact of and agree with.
>>
>>56096085
>kinda socialist
Thank god for the lack of regulations in most of those EU markets otherwise it would all look like the socialist shithole greece.

>Whats better alternative capitalism?
yup, It's what gave you the computer you're on right now you ungrateful bastard.
>>
>>56096118
>Theory of Programming

theres no fucking theory. its just you either code or you dont. what the fuck is wrong with universities these days?
If you want to code and learn shit and still like to pay for the education get a certification.
>>
what should my git commit message be if I just rewrote a small section to make it nicer and easier to read?

what about if I rewrite a whole script from scratch using a similar design but all new code--what should my message be then?
>>
>>56095992
didn't solve shit senpai
>>
>>56095098
My python implementation.
Works with even and odd line values.
How would you make this more concise?

import math

def cross(n):
k=math.floor(n/2)
for i in range(k):
print((i)*" "+"*"+(n-2*(i+1))*" "+"*")
if n%2!=0: print(k*" "+"*")
for i in range(k-1,-1,-1):
print((i)*" "+"*"+(n-2*(i+1))*" "+"*")

cross(11)
print("")
cross(4)


Output:
*         *
* *
* *
* *
* *
*
* *
* *
* *
* *
* *

* *
**
**
* *
>>
>>56096140
>the soviets didn't have computers

Bruh I'm sure if the USSR could get into Space it proves that Capitalism isn't the ONLY successful form of governance
>>
>>56096148
Fuck off charlatan, just because you're incapable of learning anything past "OOP GOOD. THINKING BAD." doesn't mean you have to discourage others
Bet you think your language just came out of nowhere
>>
>>56095928
>What we have right now is a corporatocracy (or a plutocracy, perhaps).
that's how your "capitalism" always end, it's unavoidable, and really, really obvious.
>>
>>56096106
Seriously? USA has among highest crime rates and most gun shootings among developed nations, ffs you cant walk in some part of citiies and you need overwhelming police force (again payed by tax u so much hate), If you want proper job you have no option but to take risicolous student loans and become slave till you pay it off. You get sick and you have to pay for basic human right?
>>
>>56096175
>you have to pay for basic human right
>basic human right
LMAO
>>
>>56096149
>what should my git commit message be if I just rewrote a small section to make it nicer and easier to read?
lint. It's vague but it documents the why rather than the how and it is widely understood.

>what about if I rewrite a whole script from scratch using a similar design but all new code--what should my message be then?
lint. It can justify absolutely anything, so sign your commits

https://mikegerwitz.com/papers/git-horror-story
>>
>>56096133
I have a relative that is a really great tarot reader. I'm not shitting you she sees all sorts of people from business to housewives. gets callbacks and everything. Theres a reason why they gave that guy who looked into remote viewing of the military a legion of merit. all goverments have looked into it.

I'm beginning to believe that occult is real and want to find a good resources for learning.
>>
>>56096148
>>56096169
I looked it up on wikipedia and it looks like goes into lamba calculus and functional programming. This will probably be an interesting subject to learn about.
>>
>>56096149
Refactor, I guess.
>>
>>56096238
I wish I could have done that at my Uni
It is related to functional programming, and also type theory
>>
>>56096193
Right to health is part of universal declaration of human rights and several others.
>>
File: 1448199768549.png (2MB, 1214x1109px) Image search: [Google]
1448199768549.png
2MB, 1214x1109px
>>56096106
>can't refute the point the anon made
>goes on a tangent about guns instead
>>
>>56095666
vade retro satana

also the show is really good
>>
>>56096309
He mentioned guns there, also i adressed his point
>>
>>56096286
>The UN
lmao
>>
>>56096333
>>56096309
Im retarded ignore me i thought this was adressed to me
>>
>>56096238
ok you got me. but
1. is lambda calculus the template for most programming languages because it looks like it if i were to switch the math looking shit with keywords and variables.

2.is it the only template?
>>
>>56096350

1. it's the fundamental unit of computation
2. fuck turing machines
>>
HOLY FUCK I LEAVE FOR 30 MINUTES AND SUDDENLY WE >>>/pol/ NOW

FUCK OFF TO >>>/pol/

God damn why are tripfags the worst about this. Everywhere I go they HAVE TO respond to any politically charged comment.
>>
>>56096343
Of which USA is part of which you would have known if you were given proper education
>>
How do I learn linear algebra?
I want to do 3D graphics.
>>
>>56096381
Take a linear algebra course.
>>
>>56096365
just show them the IQ list of countries and they'll get triggered and leave.

90% of them are usually Australian.
>>
>>56096365
>>56096365
quick post traps

that'll distract them
>>
>>56096381
Read a book on linear algebra?
>>
>>56096286
>Right to health
Then you're born with an illness and you can't possibly become healthy...
OH SHIT my rights being violated every single day, it's just as bad as living under Big Brother because MUH FAKE HUMAN RIGHTS

You're totalitarian utility and you should know it by now. If the weaklings being as healthy as the athletes is as important as the government not infringing on Freedom, then you can justify whatever totalitarian measure if you phrase it nicely enough...
>>
>>56096368
I do know that. However
1. UN is irrelevant and completely useless afaik
2. A bunch of people coming together and saying, "this is a right", does not automatically make it a right.
>>
>>56096381
find out which code does what and copy and paste.

if you dont have the code look at the list of algebreic functions and ask some forum to type the function into code for you.

thats how some did it and thats how most do it anyway.
math fucking sucks.
>>
>>56096350
not sure, I'm looking up the book for class, ISBN: 9780133943023.
>>
>>56096173

Even our current situation is better than the end game of socialism, widespread death from starvation and abject poverty.
>>
>>56096415
Wow, just wow
Read fucking wiki on it if you have no idea what right to health refers to, dont go talking out of your ass
>>
>>56096421
Meaning you dont think sick people should be provided with healthcare at least basic if they need it?
>>
>>56096432
i shiggy diggy
>>
PROGRAMMING
>>
>>56096465
As long as they can pay for it, sure.
>>
>>56096482

It's okay, we can move back on subject now.
>>
>>56096496
But not if they cant pay? Even though inability to pay might not be of their own fault?
Whats so bad with state providing for those who need it?
>>
>>56096482
Quick /g/, write a function that puts all 9's to the end of a collection. I'll start:
fn sort9(list: &mut [i64]) {
list.sort_by_key(|&val| val == 9);
}
>>
>>56096496
what if they can't immediately pay for it but their illness/death would end up costing society more than just giving them the treatment
>>
>>56096519
what?
>>
>>56096516
Because then I have to pay more in taxes
>>56096521
And how often does that happen?
>>
>>56096496
Also thats argument against having anything state sponsored including army and primary education and infrastructure
>>
>>56096539
the average human life is worth hundreds of thousands of dollars to society
>>
>>56096519
>>56096536
You're given an Integer array, write a function that puts all 9's in this array at the end of the array
>>
>>56096440
>tell the edgy anarcho-statist-capitalist-militarist-conservative that capitalism unavoidably ends in corporatism
>responds with unrelated topic
OK m8, whatever helps you contain the cognitive dissonance

anyway, I agree with the anti-/pol/ fags, this isn't on topic
>>
>>56096539
>And how often does that happen?

Essentially never. Resomation is pretty affordable now.
>>
File: truth.jpg (1MB, 2250x1919px) Image search: [Google]
truth.jpg
1MB, 2250x1919px
>>56096449
I know damn right what your sneaky newspeak formulation covers: it means the government paying for all of your healthcare and more is just as important as freedom of expression. It's not. Live with it and pay your own damn bills, or ask for private charity if you really need to. I know it's not ideal, but the world we live in is not ideal, and Big Govt can't do anything about it, no matter how much actual rights you feed it. Leftist.
>>
>>56096567
lol ok and then you'll get immigrants to replace all the dead people
>>
>>56096557

Socialism isn't unrelated, it's this man's alternative to Capitalism. If he thinks capitalism can't prevent these ills, it means he support socialism.
>>
>>56096548
You want me to fill the end of a pre-allocated array with 9's?
You want me to expand the array and add 9's?
You want me to create a vector or some other data structure and related functionality?

Your question is too vague.
>>
>>56096543
I'm fine with an army, it'd be retarded for a nation not to have one.
The gov shoehorned itself into the other ones you mentioned already, not like I had much of a choice in the matter.
>>56096547
If they couldn't afford healthcare, clearly not
>>
>>56096578

No thanks.
>>
>>56096567
Also ifrequency doesnt matter its the principle.
Lets reorder usa to be as you would like. Toll roads anywhere, why would anybody pay so you can drive to woek. F you pay a fee every day, want to send a kid to primary school? Np pay some corporation 50k, high school 75k, you would pay more for food because fuck subsidies. All that by earning y0k a year? Yea fight
>>
>>56096612
>Toll roads anywhere
There's already toll roads everywhere
Everything else you said is literally not an argument
>>
>>56096547
AHAHAHA AHAHA HAHAHAHAHAHA! No. Just no. You may argue that it's a moral imperative to not let people die of preventable diseases (which in no way mandates a state btw) but you cant say it would benefit society. Not anymore than taking in Rapefugees is valuable to any European country. that's just feel-good statist lies.
>>
>>56096612
***60k a year

Taxes exist for freaking reason, states too. And helping others isnt bad thing.
>>
>>56096627
>>56096593
any country needs citizens you dumb cunts. if you won't even provide basic healthcare to your own citizens you have to import them. fucking retards.
>>
>>56096612
>Toll roads anywhere, why would anybody pay so you can drive to woek.

People already do pay for toll roads to drive to work. Much better than travelling on state-owned roads and having a state-sponsored pothole tear out your control arms.

>Yea fight

Just because you're unsuccessful and need to suck on the government teat doesn't mean that everyone else is.
>>
>>56096624
I mean literally on every road since taxes payed for them, one in front of your house as well
>>
>>56096639
>helping others isnt bad thing.

"Socialism, like the ancient ideas from which it springs, confuses the distinction between government and society. As a result of this, every time we object to a thing being done by government, the socialists conclude that we object to its being done at all."

- Frederic Bastiat, 1850
>>
>>56096646
so much talking shit straight out of your ass. You're too young to know those things Billy, get in your room and let the adults discuss it.
>>
>>56096658
And you can't back this up
Not an argument
>>
>>56096653
Do you understand how much even now your goverment spends on *socialist* policies and how easier it is for you to spout nonsense because of that?
>>
>>56096646
>if you won't even provide basic healthcare to your own citizens you have to import them.

Those two things are literally unrelated to the highest degree. The US already had systems like medicaid and medicare for those unable to afford healthcare. The only thing that Obamacare has done is waste an extreme amount of money with the goal of failure, so that the government could weasel its way further into the industry. That's how it's done.

Immigrants have fuck-all to do with this.
>>
>>56096680
have fun paying $10k+ out of your own pocket for an overpriced surprise visit to the ER because jamal stabbed you and raped your mom
>>
>>56094389
That filename is false. You can buy the plushies for ¥3000 or even less from Yahoo Auctions, and if you were to ship via rape EMS rates, it would add ¥2000 each. The Love Live movie BD special edition (the regular edition is pictured) costs ¥9000 rounding up. A very high estimate for the merchandise in this image is ¥70000 or about $700.
>>
>>56096706
>2016
>not having insurance/working for a company that helps cover it
lmao
>>
>>56096667
Why is that a criticism?
>>
File: truth.jpg (32KB, 440x252px) Image search: [Google]
truth.jpg
32KB, 440x252px
>>56096667
Frédéric Bastiat 2022! Thank you bro for bringing up the only frog I can actually stand.
>>
>>56096700
you said we should just let people die who couldn't pay for basic treatments, it would obviously lead to many deaths, so your country would get fucked and you would have to take in immigrants to make up for the drop in population, that's just the reality of it
>>
>>56096694

Everything I know and love is thanks to Capitalism. I'd like to thank Vint Cerf & MCI for creating this lovely internet, Tim Berners-Lee & W3C for creating HTTP, and Christopher Poole for creating 4chan.
>>
>>56096729
>literally cannot even back this up
>>
>>56096717
>not being covered by the state/being a wagecuck
lmao
>>
>>56096729
>it would obviously lead to many deaths
Prove it?
>>
>>56096729
Funny thing is USA spends shit load of money on healthcare while these patriots and pro usa fags argue against that.
>>
>>56096729
>People were dieing in the streets before socialized healthcare in the US
You cannot be this stupid, Private Healthcare was cheap.
>>
>>56096737
>thanking Poole for creating this shithole
>>56096745
>private insurance doesn't exist
wew my lad
>>
>>56096720

Because you seem to think that the objection is to helping people, when the real objection is allowing the state to interfere in that endeavor. Libertarians are often involved in philanthropy.

>>56096729
>people dying means you have to import people!

No it doesn't. People have sex. When people have sex frequently, they also have children.

This biology lesson was free, by the way.
>>
>>56096745
OK you lost thx bye
>>
>>56096740
>literally retarded
fuck off idiot

>>56096747
HERP DEPRP DASUIODSANKLASDHBJASDASDASD

>>56096753
yes these murriburgers are dumb as shit
>>
>>56096759
>>thanking Poole for creating this shithole
>hating 4chan while being on it unironically
>>
>>56096774
>still cannot back it up
>resorts to insults
wew my lad
>>
>>56096766
first world white people don't breed like niggers IDIOT
>>
>>56096774

That's the thing, you're not even an American. You have no idea how things even work here. I bet you don't even own a gun.

I wish every pinko would die.
>>
>>56095800
i'm a reverse engineer. But i focus on ARM binaries (Embedded systems). And i've studied x86 for 32 bit Binaries (Malware is usually compiled for 32 bit architectures)
>>
>>56096792
>IDIOT
CR;FDZRAD.ZNTDZAGC0R.,LZZ just like you would say
>>
>>56096781
I do everything post-ironically
t. /mu/
>>
>>56096737
But state always interferes, even USA.
>>
>>56096774
>just insulting people now
LOOK A socialist in his natural habitat
>>
>>56096793
>pinko
kill yourself lmfao i'm not even remotely a communist i'm just not a complete hillbilly jackass
>>
>>56096807
Wanted to reply to
>>56096766
>>
if your government wasn't so shitty and corrupt it could easily pay for basic healthcare and decent education, fucking retards
>>
>>56096814
>not even remotely a communist
discutable given, well, the whole discussion really...
>>
>>56096838
being for some amount of state != being a communist
>>
>>56096814
>kill yourself lmfao i'm not even remotely a communist

Just what a commie would say.

>>56096824

Yes, I know. That's what we object. We're trying to create a cleaner delineation between the state and private citizens. They've got their hands in too many things.
>>
File: cute source code.png (69KB, 1050x774px) Image search: [Google]
cute source code.png
69KB, 1050x774px
How do I write cute code?
>>
>>56095666
I hope you're happy Satan
>>
>>56096847
not what I said, but thanks for trying to display your nonexistent talent
>>
File: sicp.jpg (194KB, 931x1398px) Image search: [Google]
sicp.jpg
194KB, 931x1398px
help me out /dpt/,

i fell for the meme and started reading sicp, and want to work through the exercises.

i downloaded gnu scheme but cant into the editor. are there any alternatives?
>>
Also providing good education to only those who can pay for it is fucking bad idea long term. Because you breed more stupid people who cant get a job who breed more stupid poeple and you end up wit uneducated bunch of hillbilies arguing that you should pay to learn how to read. End evonomy needs competent workforce
>>
>>56096866
you're fucked in the head delusional idiot
>>
>>56096879
dr racket with the sicp package
>>
>>56096879
What does SICP teach that other books can't teach?
>>
>>56096883
why are you replying to my post while talking to yourself? Oh yeah you're crazy. Sorry for that.
>>
>>56096849
Im not arguing against libertarianism or liberalism. Im against capitalism because you change one master for another. Only difference is corporations are not responsible to voters and politicians are
>>
>>56096908
>he thinks U.S. liberals are right-wingers
>i'm the crazy one
kek
>>
>>56096906
Nothing. But it teaches well and clearly.
>>
>>56096923
What does it teach?
>>
>>56096881
>public education is bad because you end up with a bunch of stupid hillbillies saying you should have to pay to get an education!

You've just written the argument for me. Bon travail!
>>
>>>/pol/

GTFO of /g/

/g/ is technology
>>
>>56096934
reading comprehension please
>>
>>56096890

This a good choice. DrRacket is a really good editor for a really good (((Lisp))).
>>
File: 1466634860211.png (392KB, 832x832px) Image search: [Google]
1466634860211.png
392KB, 832x832px
>>56096881
>still hasn't produced a single argument, but instead bombards us continually with slippery slopes
>>
Making a program that can take a piece of memory and encrypt it using XOR. Then write the memory to disc.

Obviously I'm not going to get any use of this program because XOR encryption is a joke.

Mainly just trying to get better at low level memory stuff.
>>
>>56096934
No i have not, adress it properly
Solution is not to remove public education but to instead improve it ...
>>
>>56096832
>>56096832
>>56096832
>>
>>56096918
>he thinks U.S. liberals are right-wingers
Wut? No, don't even respond, I know you've lost the plot. No need no prove it again and again, I know you need several iterations before you get stuff, but unlike you we have a brain, thanks.
>>
The fuck is up with this /pol/ invasion.

Guess I'll come back tomorrow and try to discuss programming then.

>>>/pol/
>>
>>56096879
why do you need a special editor?

in the book they use edwin a shitty emacs clone: https://www.gnu.org/software/mit-scheme/documentation/mit-scheme-user/Edwin.html
>>
>>56096982
POO IN LOO PAJEET
>>
>>56096965
What have i not adressed and identify slippery slope
>>
>>56096915
>Im not arguing against libertarianism or liberalism. Im against capitalism

By arguing against one, you've argued against both. Capitalism is merely the free trade of goods between people who own them.

Not only that, but arguing against Capitalism makes you a commie, by necessity.

Way to go, you dunderheaded halfwit.
>>
>>56096985

thats what i was talking about.

i cant into Edwin.
>>
>>56096997
You keep tying together events without giving valid evidence that one will lead to the other
https://en.wikipedia.org/wiki/Slippery_slope

So, not an argument
>>
Anyway, we ought to get back to programming before the moderator actually gets angry.

When he's cross, he's fiery with that ban button (which he does free).
>>
>>56097001
Wow you have obviously never lived in commie country and you have no idea what you are talking about. Google difference between capitalism liberalism and libertarianism. And there is much more between capitalism and communism
>>
>>56097024
Neither have you
Give me one example of such evidence provided for capitalism,
>>
>>56097054
>Wow you have obviously never lived in commie country

No, but I do know people who have lived in them. People who were incredibly glad to have gotten out.
>>
>>56097073
Why, I'm not the one throwing all these fallacies out with every post
>>
File: 1448474986516.jpg (16KB, 225x255px) Image search: [Google]
1448474986516.jpg
16KB, 225x255px
>>56097033
>>
>>56097083
Yes and they could tell you that state sponsored healthcare and subsidies dont equal communism, there is much more to it
>>
>trying to learn programming
>get distracted by commie scum
Why must they ruin everything?
>>
>>56097115
IT'S DA JOOS
>>
>>56096851
Get a cute font and cute colors. Be neat with your comments, add unnecessary flourishes/borders to large comments (as seen in your pic
don't use snake case, be descriptive with variable names
>>
>>56097094
No you are not throwing anything at all, not a single argument, everything i this thread comes down to capitalism is better because... well yes it is! Evidenced by usa evonomic power and acomplishments so it must be best
>>
>>56097103

Right. Communism is well defined by poverty, widespread starvation, purges, political assassinations, etc.

Of course, healthcare is a PART of a time-limited Communist plan, and as such, we cannot even allow that seed to be planted.

>>56097100

Yes.
>>
>>56097115
because the unemployed dirt bags try to squat anywhere where there is intelligent discussion.
>>
>>56095098
pls, beat my recursive triforce.
#include <stdio.h>
#include <stdlib.h>

void triangle(int size, int quantity, int j, int k, int offset)
{
for (int i = 0; i < size - j + offset; ++i)
printf(" ");

for (int i = 0; i < j + 1; ++i)
printf("*");

if (quantity > 1)
triangle(size, quantity - 1, j, k, size);

}

void triforce(int size, int quantity)
{
int i = 0, j = 0;

if (quantity > 1)
triforce(size, quantity - 1);

while (i < size * 2)
{
triangle(size, quantity, i, j, j);
printf("\n");
i += 2;
++j;
}
}

int main(int argc, char **argv)
{
if (argc != 2)
return 1;

triforce(atoi(argv[1]), 2);
}
>>
New thread: >>56097145
>>
>>56097134
You bet my dude
>>
NO POL ALLOWED!!

REAL THREAD!!

>>56097156
>>56097156
>>
File: 1460066692788.jpg (103KB, 1280x717px) Image search: [Google]
1460066692788.jpg
103KB, 1280x717px
>>56096890

exactly what i was looking for, thank you very much.
>>
>>56097135
>Communism is well defined by poverty, widespread starvation, purges, political assassinations, etc.
Exactly which is not very prevalent in europe now is it?
>>
REAL THREAD

>>56097145

>>56097145

>>56097145
>>
>>56097173

Only thanks to that tax money still flowing in. When they've finished with their importation of welfare leech ""refugees"" the process will be complete and civil war will be breaking out.
>>
>>56097143
post output u nigger
>>
>>56097159
>equating being open-minded and balanced on the issue of race wit /pol/
gg
>>
>>56097209
How is that not a logical fallacy you cant back at all?
>>
>>56097211
Run it you shit.
>>
>>56097231
because it's happening in real time
are you seriously blind?
>>
File: unnamed.png (760KB, 1280x800px) Image search: [Google]
unnamed.png
760KB, 1280x800px
I thinking about making a simple video player. To render a video on a screen, I need to do two things:

1. Parse a video file to determine the pixels that need to be displayed for each frame.

2. Render those pixels on the screen.

How would I do part 2? Can I just use OpenGL to send the pixels to some buffer?
>>
>>56095098

For string manipulation I would rather use something like Ruby..

def starcrossed(x)
fuck = ->(i){ puts "\s"*i << "*" << " "*(x-2-(2*i)) + "*"}
that = ->(i){ fuck.call (x/2)-1-i }

(x/2).times &fuck
puts ("\s"*(x/2) + "*") if x.odd?
(x/2).times &that
end
>>
>>56096163

Hey, check my version:
>>56098182

>How would you make this more concise?

Well, if cheat I can make my Ruby version a 5-liner..
def starcrossed(x)
fuck = ->(i){ puts "\s"*i << "*" << " "*(x-2-(2*i)) + "*"}
that = ->(i){ fuck.call (x/2)-1-i }
(x/2).times(&fuck); puts ("\s"*(x/2) + "*") if x.odd?; (x/2).times(&that)
end

starcrossed 7


But actually I have 7 lines like you.
So let's call it a draw, shall we?
:3
>>
>>56094514
use hashlife

>>56094573
>>56094711
evaluate each generation lazily in the iterator
>>
>>56096519

I like how Rust has stolen Ruby's beautiful syntax.. :P

But since in Ruby you can't sort by an boolean, I'd do it like this:

a = [6, 9, 2, 2, 7, 2, 9, 0, 3]

a.partition{|val| val != 9}.flatten
Thread posts: 328
Thread images: 17


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