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

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

Thread replies: 255
Thread images: 26
File: DPT.png (389 KB, 934x1000) Image search: [Google]
DPT.png
389 KB, 934x1000
Old thread: >>55206771

What are you working on /g/?
>>
>>55214118
First for D
>>
How can i write a program to prove the earth is flat? and we're in a simulation?
>>
>>55214185
>Write a program to prove the Earth is flat
Go outside, look off into the horizon and tell me, do you see Tokyo? What's that? You don't see Tokyo? But you can see the sun which is reportedly millions of miles away. There you go, the Earth is flat. Now write a real program.
>>
>>55214217
Round, fuck, the Earth is round.
>>
>>55214217
>>55214226
Seems like a bit of a Freudian slip to me
>>
>>55214238
But anon, every rational, thinking person knows the Earth is gay.
>>
>>55214118
how do i make an app to clean the poo out of my vagina?
>>
>>55214217
That doesn't prove anything.

I could be living in:
https://en.wikipedia.org/wiki/The_Truman_Show

A dome to give the illusion of a circular world
>>
File: dpt_shuffle.png (447 KB, 934x1000) Image search: [Google]
dpt_shuffle.png
447 KB, 934x1000
>>55214118
I was bored so I made something that processes images like the OP into this.
>>
Pages are set to values within an array.

startPage = pageArray[0]

UIImage then displays start page no problemo.

As for making my next page button add to that, I have no idea.

My button action is as follows:
  let newPage:Int = (startPage + 1)

self.ImageView.image = UIImage(named: pageArray[newPage])


This is of course utterly stupid as it will not continue to increase the value of newPage beyond 1, so I end up stuck with a two page book.

How do I into fixing this? I think one of the tutorials I did mentioned an increase value but that would still not help much. I need to return that value but I don't know how to use return very well.

Be gentle, I've been learning code for less than a week.
>>
File: homework.png (224 KB, 1440x900) Image search: [Google]
homework.png
224 KB, 1440x900
pls help.
>>
>>55214411
Did you try reading the error message?
>>
>>55214411
that is not how public works in c++
structs are public by default anyway
>>
>>55214432
the struct already has those members.
>>
>>55214443
Your problem lies on line 15, I'll let you figure it out
>>
>>55214440
>C++
He's writing C though.

>>55214411
"public" is not a thing in C. Also, you need a semi-colon after the struct declaration.
>>
>>55214318
Randomizes the locations of pixels in a bitmap? Or is it organizing them
>>
>>55214463
>>55214464
wait, a C struct is a primitive type and not an object like java and C#?
>>
>>55214539
C doesn't have "objects" (in the OOP sense).
A struct is a record type. It contains other types as members, and you can treat it as one unit, but that's about it. You can access any struct member.
>>
>>55214539
>C
>Objects

this smells like bait
>>
>>55214559
>>55214566
I'm a java C# programmer.
>>
File: 1463389056472.png (849 KB, 1280x720) Image search: [Google]
1463389056472.png
849 KB, 1280x720
>>55214118
>>55211757
How do you reference an @user instance variable inside an entirely different controller, such as a friendships_controller? Is it even possible?
>>
>>55214582
we can see that.
>>
>>55214534
It sorts pieces of images by its 'redness'. Averaging the RGB values of an image piece, converting to HSL (hue,saturation,luma) then sorted by the euclidean distance from red. It also starts a full screen slideshow of these sorted image pieces.
>>
how do I get this to not print the sentinel?

def main():
numbers = int(input("Enter a series of numbers with commas and terminate with '-99':"))
list = [numbers]
while numbers != -99:
numbers = int(input("Enter a series of numbers with commas and terminate with '-99':"))
list.append(numbers)
list = sorted(list)
print(list)

main()

input()
>>
>>55214608
can I declare a struct outside the main function?
>>
File: dpt2_shuffle.png (501 KB, 934x1000) Image search: [Google]
dpt2_shuffle.png
501 KB, 934x1000
>>55214632
>>
So I had a phone interview today, and the technical guy asked me to tell him what a "class" was. To be honest it was pretty difficult defining it, I think I ended up just saying that it "was a recipe which defines objects which are instanced from it".

I think I butchered it; how would you guys define a class?

>>55214539
>wait, a C struct is a primitive type and not an object like java and C#?
it's just plain old data. The struct keyword is used when both defining a struct and creating a struct variable. Some people typedef the struct definition so that you don't require "struct" when creating variables, but a lot of style guides are against it.
>>
>>55214650
try it and see?
>>
If I malloc a 32-bit integer, can I recast it into a char array with an size of 4?

Would it work?
>>
>>55214639
<code>
code here
</code>

replace < with [ and > with ]
>>
>>55214693
Why don't you try it?
>>
Any students that work part-time as a dev during the school semester? What kind of job do you have, and how did you get it?
>>
>>55214693
of course?
>>
>>55214217
What if the simulation controls what you see?
>>
>>55214693
Yes.
char *ptr = malloc(sizeof(uint32_t));

uint32_t n = 10;
char *ptr = (char *)&n;

union {
uint32_t u;
char c[4];
} n = { .u = 10 };
// Do something with c[0] etc.

Will all work, but will introduce endianess issues into your code.
>>
>>55214326
Nevermind, managed it with this:

class Pge {
var Page:Int

init() {
self.Page = 0
}

func UpdatePage(pageToSet:Int){
self.Page = pageToSet
}

func IncreasePage() -> Int{
self.Page += 1

return self.Page
}
}


Is my code still the mess that I think it is, though?
>>
>>55214705
wut
>>
>>55214745
do that with ur code so we can read better
>>
>>55214143
Opinions on D?
>>
>>55214653
It's mostly about 'how' you responded, not so much 'what' you said
if you come right out and say
>Oh! It's like a recipe!
then it seems rehearsed

if you struggle for a bit and have a lot of umms and don't sound sure of yourself, that's also bad

if you think you struck a middle ground between those two, then you're good
>>
>>55214754
so,

def main():
numbers = int(input("Enter a series of numbers with commas and terminate with '-99':"))
list = [numbers]
while numbers != -99:
numbers = int(input("Enter a series of numbers with commas and terminate with '-99':"))
list.append(numbers)
list = sorted(list)
print(list)

main()

input()
>>
>>55214761
too small
>>
>>55214791
I honestly don't understand the question
what do you mean by sentinel
>>
>>55214763
I made a point that it's a collection of data and methods/functions so I think I may have gotten it right as far as he's concerned. They're just weeding people out who have never programmed before. Well that's what I hope.
>>
>>55214845
-99 is the sentinel for that while loop, so when it's entered it terminates the loop and prints the list ordered by value

I want it to disregard the sentinel value from the list so it doesn't show up in the print
>>
>>55214791
what are you trying to do?
get input and sort it?
>>
>>55214862
yes, and not have -99 show up in the print
>>
I was visiting stackoverflow today...

What a cancerous comunity, holy fucking shit.
>>
>>55214860
im not a python fag
but you're complicating things
if the input is a string
then string.split(',')
>>
>>55214891
it isn't a string, that is a prompt for an integer
>>
>>55214904
I assumed the input would be converted to a string, nvm, like im not a python fag
also, the prompt is confusing
it implies I should input, like this: 99,2,1,22,-99
but in fact, I have to press enter everytime, and no commas
change the prompt

anyways, your problem is that something not -99 gets inputted, then stored, the while checks that is not -99, then one actually puts -99, and gets stored, and then it will stop
your best bet is to remove it before sorting
so something like
list = sorted(list[:-1])
>>
>>55214982
*like I said, im not a python fag
>>
Does the size of the vertex buffer automatically increase if I use glBufferSubData to append it with a larger array than I previously bound to it?

So say I:
glBindBuffer(GL_ARRAY_BUFFER,VBO[1]);
glBufferData(GL_ARRAY_BUFFER,sizeof(aBox), aBox, GL_DYNAMIC_DRAW);

But then I:
int offset=96;
glBufferSubData(GL_ARRAY_BUFFER,offset,sizeof(anotherBox),anotherBox);

Will the buffer become 192 bytes or is this bad practice? Is the second 96 bytes just tacked onto the end or is the buffer the correct size?
>>
What's the best language/platform to invest my time on?

I was thinking Python. JVM is too heavy, .NET is too Microsoft, etc
>>
>>55214982
>>55215009
It worked, thanks
>>
Best startup lang? Also is there any interest in creating a better /g/ site
>>
>>55215075
C, Ruby.
>>
>>55215075
Implement FizzBuzz in digital logic circuits then you can move on to a higher-level language like machine code and then you'll have enough of a base to move on to assembly.
>>
>>55214847
yeah, you did fine
>>
>>55214742
what language is this?
>>
/dpt/ my job is making me run Javascript on JVM for their company AI. it's an abysmally shitty combination that makes the whole job a lot harder without any benefit.

Is there any way for me to get around this so I can use the basic goddamn JS methods? I can't install anything else on their server
>>
>>55215476
fuck them right in the pussy
>>
>>55215612
I'm not into 30+ year old Ukrainian immigrants who are dudes. I don't even think they have pussies.

do you have any helpful advice?
>>
>>55214740
Type punning with unions is technically undefined but works in practice.
>>
>>55215476
what's a company AI
>>
>>55215655
The AI the company markets to clients. She's supposed to be like siri but personalized for your own company's office work and customers

that said, she's much dumber and slower than your average employee and actually makes things worse
>>
>>55215647
>technically undefined
Not in C11.
>>
>>55215750
But is she hot
>>
>>55215782
She looks like the creepy 3d model that was made to replace Jennifer Lawrence as Pam in a live-action Archer movie after she tripped over her dress at an awards show and broke her goddamn neck
>>
https://g.sicp.me/books/

Why isn't this in the sticky?
>>
>>55214118
How the fuck do I use Qt Designer to actually do anything useful? I already know C++ and I figured I'd learn Qt, but it doesn't seem like Qt Designer can actually do anything but move buttons around. I just wanted to make a simple program to test if I can; enter numbers in a couple boxes, do some math to the numbers based on the results of some evaluations, then output a number somewhere else.
>>
Hey /g/ what languages aside from C doesn't have the cancer that is OOP?
>>
>>55216616
Lisp.
>>
>>55216616
Haskell
>>
>>55216641
What the hell are you smoking? Common lisp and its many derivatives have one of the most powerful and flexible OOP implementations that exist: CLOS

https://en.wikipedia.org/wiki/Common_Lisp_Object_System
>>
>>55216616

Scheme.

>>55216641

Common Lisp has objects, IIRC.
>>
>>55216656
90% of the people who shill Lisp here have never used it
>>
>>55214539
c++ """"""""""""""""programmers"""""""""""""""" everyone
>>
>>55216675
Fuck off Java shill. You don't get to comment on first world languages.
>>
>>55216641
>>55216651
>>55216656
So in other words, only meme languages that barely anyone here on /g/ actually use... At least I got an answer desu.
>>
>>55216703

Most languages worth using support objects to some extent. If you're looking for a language still in use with no objects... maybe Perl 5?
>>
>>55215643
>helpful advice
>/dpt/
which are you looking for?
>>
>>55216652
Yes, but CLOS is so optional in CL that you could likewise say that C is OOP since there are libraries that do that.

Also, CLOS is different enough from traditional OOP that it doesn't really count as such.
>>
>>55216703
CL is very much not a meme language, though.
>>
>>55216616
Go
>>
>>55216616
Matlab
>>
>>55216616
SQL
>>
File: 1466510063369.png (212 KB, 426x396) Image search: [Google]
1466510063369.png
212 KB, 426x396
What's the best book for learning C#?
>>
>>55217094
The See Pound Sign Programming Language
>>
>>55217094
C# Step by Step.
>>
>>55217182
>>55217120
Thanks anons, I'll give them a read.
>>
>>55216483
Anyone? Does no one here know how to use Qt?
>>
>>55217254
You misunderstand -- this thread is for pissing matches and counting angels on pinheads.

If you need help actually producing something of value, you should look elsewhere. I recommend Freenode.
>>
>>55217254
honestly I've intentionally avoided qt
when I'm making a windows desktop application I use windows API directly
the one time I needed a cross platform GUI, it only needed to be very simple and I made it from scratch with sfml
sorry bro
>>
>>55214118
I'm working on a game.
I had a question and forgot it.
I gotta write this stuff down or something.
Anyway, here's a function I wrote a while back that I wasn't able to get to work with my other code like I wanted, since I was already showing someone. http://pastebin.com/LxhWXths
>>
Why is it that when I call getElementsByClassName("name") I get double the number of posts in the thread?

Also why is it that when I try to go through the list and filter out all the posts that are named "anonymous" only some posts get removed?
>>
>>55217254

It's been years since I've touched Qt, and the last time I used it, I didn't use Qt Designer -- I just did all of the GUI shit in code.
>>
>>55217942
I can handle writing libraries and such in just code, but once I start designing a GUI, I lose 100% of my programming ability and need a GUI to do anything. I don't know why.
>>
I did well on my programming interview today :)) Moving to onsite.

Questions were
> find 2 numbers that sum target
> find largest contiguous sum
> sort k sorted lists
> rotate array 90 degrees
>>
how do i search a 2d array in python? It's an array of all of the permutations of a set of numbers. I need to make sure the first three numbers are increasing.
>>
>>55217986
>rotate array 90 degrees

as in make a column vector a row vector?
>>
>>55218005
Yeah,
so
[1,2]
[3,4]
becomes
[3,1]
[4,2]
>>
How possible is it to get a remote job on machine learning? I've never seen anyone hiring remote for this.
>>
File: 1463696945268.png (25 KB, 396x400) Image search: [Google]
1463696945268.png
25 KB, 396x400
>>55217986
> find 2 numbers that sum target
target positive only?
x = ceil(target/2);
if(x+x > target)
y = x - 1;
else
y = x;

x + y = target

> find largest contiguous sum
of an array of length n?
arr[i] = ith value of the array
max = arr[0];
sum = arr[0];
for i = 1 -> n:
sum = max(a[i], sum + a[i]);
if(sum > max)
max = sum;

max is the max contiguous sum


am I right so far?
>>
>>55216483
Qt Creator was pretty comfy when i tried it. i don't use it anymore but it's pretty powerful.

you want to look up QComboBox, QPushButton, QDialog or QMainWindow.
actually just go to the front page of Qt and start reading documenttation.
i don't think i've ever seen beetter documentation in my life. there's some getting started sections
>>
>>55218054
no one hires remote for anything. if you're indispensable you can negotate it with your curren tcompany.
>>
>>55218174
>no one hires remote for anything
Hi, you must be new to programming
welcome!
>>
>>55217849
because there's both mobile and desktop version of the posts

>.parentElement.parentElement.parentElement...
just do something like this
var p = document.querySelectorAll('.postContainer');
var exp = /Anonymous/;
for (var i = p.length; i--; ) {
if (p[i].querySelector('.name').innerText.match(exp))
p[i].remove();
}
>>
>>55218080
oh oops. I was really vague
The first one is 2 numbers in an array.

and for largest contiguous. You have to take into account negative numbers
>>
File: Misoni.Comi.full.1707526.jpg (937 KB, 1114x836) Image search: [Google]
Misoni.Comi.full.1707526.jpg
937 KB, 1114x836
In openssl do I need to have an underlying socket connection in addition to a BIO, or does having a BIO mean I don't need a standard socket?
>>
>>55218280
>parsing html with regex
DONT
you will summon Them
>>
>>55218991

It comes...
>>
>>55218991
how is that parsing html with regex?
>>
Any kernel hackers in here?

Say I had a program, and it blocks on waiting for input, how does the kernel know to wake it up when data is available on stdin?
Like when the process goes to sleep, does the kernel associate some list of pointers to the process struct in the file descriptor struct when a process blocks on it, so that when data becomes available, it puts those processes into the running queue, or whatever it's called?
Someone please explain how it actually works.
>>
>hmmm I should probably get a bit of programming practice in every day
>play video games instead
>>
Just finished writing an ATA driver

static void ata_read_sector(uint64_t sector, uint16_t* block, ata_dev_t* device)
{
int i;
uint8_t dev;
uint8_t port;

dev = (device->dev_num==ATA_MASTER ? 0x40 : 0x50);
port = device->port;

outb(port | 6, dev); // Send device number to bus
outb(port | 2, 0x00); // Sector count HIGH BYTE
outb(port | 3, (sector >> 24) & 0xFFFF);
outb(port | 4, (sector >> 32) & 0xFFFF);
outb(port | 5, (sector >> 40));
outb(port | 2, 0x01); // Sector count LOW BYTE
outb(port | 3, (sector) & 0xFFFF);
outb(port | 4, (sector >> 16) & 0xFFFF);
outb(port | 5, (sector >> 20) & 0xFFFF);
outb(port, 0x24); // Send the read command to the ATA controller!

ata_400ns_delay(); // Wait 400ns for drive to fill its buffer/prepare itself

for(i = 0; i < 256; i++)
*(block + i) = inb(port);
}


How's this though. The Fucking VS Compiler needs this in the C standard Library to shift 64-bit integers right...... Luckily M$ made it public domain..

__declspec(naked) void __cdecl _aullshr(void)
{
__asm {
cmp cl,64
jae short RETZERO

cmp cl, 32
jae short MORE32
shrd eax,edx,cl
shr edx,cl
ret

MORE32:
mov eax,edx
xor edx,edx
and cl,31
shr eax,cl
ret

RETZERO:
xor eax,eax
xor edx,edx
ret
}
}
>>
>>55219202
Delete your games. It helped me. I also had several thousand hours logged before.
>>
>>55219202
If you can't control yourself do this>>55219366
>>
File: 616.jpg (255 KB, 1321x1782) Image search: [Google]
616.jpg
255 KB, 1321x1782
>mfw finishing The Pragmatic Programmer
damn that was a good one
are there any good books on how to structure and design large ass projects?
i feel like i always get overwhelmed and end up going with a less then optimal solution
>>
so whats the difference between computer engineering and CS?
i dont really like math, but then again i dont really like electronics either so im not sure what to choose
>>
>>55219615
Literature! It'll be a perfect fit for you.
>>
>>55219321
>driver
nice magic numbers
>outb(port | 3, (sector >> 24) & 0xFFFF);
why do you mask 16 bits when you write 8? why mask at all? isn't the second argument uint8_t?
>outb(port | 4, (sector >> 16) & 0xFFFF);
that should be >> 8, and the next >> 16
>How's this though
standard practice; C implementations do use runtime support helpers for operations not provided by the target architecture, such as shifting more than 31 bits or 64-bit division on x86
>>
You guys ever stay up and do absolutely nothing? Me right now.
>>
>>55216616
Rust
>>
>>55219661
i do, but only when im high
>>
>>55219661
Aha! But anon, you are browsing /g/ are you not? Therefore you are doing SOMETHING. Checkmate.
>>
>>55219648
>nice magic numbers
It won't make sense without magic numbers. LBA48 requires using the masks for error and drive select. It's only early boot code (clone of ntdetect.com) so it's basically write once and forget. Plus it's pretty easy to remember or'ing 0xYYZ with a single digit magic number will change Z imho.
>why do you mask 16 bits when you write 8? why mask at all? isn't the second argument uint8_t?
Oops, thanks for pointing that out...
>standard practice; C implementations do use runtime support helpers for operations not provided by the target architecture, such as shifting more than 31 bits or 64-bit division on x86
I had no clue this was the case before the compiler started kicking and screaming about linker errors. The more you know.
>>
>>55219731
I didn't even ingest caffeine yet i'm stuck in this mode.

>>55219734
i want to cry.
>>
What is the best source for learning how I can fuck your mamas?

Haha #rekt
>>
File: aXbVN9g_700b.jpg (77 KB, 587x551) Image search: [Google]
aXbVN9g_700b.jpg
77 KB, 587x551
>>55219796
Start with yours, it's easier for beginner and has more support.

kys
>>
>>55219827
you are one witty motherfucker god damn
>>
What would be a good under $500 thinkpad for programming(aka installing linux)? I am on the market for a decent laptop to practice my linus skills. I don't need it to be a super computer cuz I already have a battle station, I just need something to take with me just in case I gotta keep working on a program on the go. Thanks i n advance.
>>
>>55219965
what rig ya haf, bro?
>>
>>55219977
its pretty simple: i7-4790K Quad core 4.0 GHz , 16 gb, gtx 980, 2tb hard drive
>>
File: a.jpg (128 KB, 700x700) Image search: [Google]
a.jpg
128 KB, 700x700
>>55219965
get a raspberry pi, a small monitor and projector keyboard
your setup will look something like pic related
>>
>>55220008
>16 gb
pleb
>>
>>55220077
I know, I know, I fell for the 16 gb meme. I will soon upgrade it to 32 gb, along with a gtx 1080 .
Then it will be a beast.
>>
>>55220012
>projector keyboard
So these things actually do exist in real life? Noice. Do they work well? How much do they cosz? Can they operate an ergonomic slanted layout?

Also I'm not him but it sounds like a pretty decent idea, congrats.
>>
>>55220129
They've existed since 2000.
They never caught on because tapping your fingers on the table quickly becomes painful.
>>
>>55220129
>Do they work well
not really no
>>
>>55220140
>>55220274
k thx ânons
>>
>>55220012
Ain't gonna lie, that does sound cool. But I am torn between the w500 or a T510. Both look good, and I found some good prices on ebay.
>>
File: 1456401181293.webm (1 MB, 798x596) Image search: [Google]
1456401181293.webm
1 MB, 798x596
>>55214118
Nothing rn. I'm still going to interject for a moment to bring this up. (pic related)
>>
How do I go from learning and implementing algorithms to creating programs?
For example having an exe file which lets me click and type. I'm using python.
>>
>>55220392
Install gentoo. It supports Python scripts better
>>
>>55214118
>dumb makiposter
>>
Got a question.

I kind of want to learn programming, mostly as just a thing I can say I did.

Knowing god damn nothing, I think the easiest way to go about this would be make a game/parts for a game, as I know what I need its how do I make them is the issue.

Unless someone has a better idea, what would be the easiest language to attempt to do this in?
>>
>>55220926
Read a book and just follow it's exercises
I'd recommend python or c++
>>
>>55220012
What could possibly be a useful context of that email?

Why on earth would anyone need to send an image of some asshole gesturing at an image(?) of a basic chart?

It's not even a chart on a screen or projector. It's just printed out or painted on a fucking wall.

God damn I should not be this upset at this.
>>
>>55219628
This or gender studies. Go for it, don't let your dreams be memes.
>>
>>55219734
Speaking of checkmate, I just ravaged my chess engine. It's not very good.
>>
Best c compiler right now? gCC or LLVM?
>>
>>55221320
GCC
>>
>>55221320
Probably GCC, but they both have their own advantages.
>>
>>55219516
code complete 2
but then I switched to functional programming and this shit doesn't apply anymore
>>
>>55216917
>Go
What's /dpt/'s opinion of Go?
>>
>>55220926
listen video game development is easily top 3 hardest programming practice

do what the other guy said, get a book on an introduction to programming
>>
>>55221451
Good, but I think Rust is growing on me more
>>
>>55221451
Too difficult, I'd advise sticking to checkers for now.
>>
>>55221451
A solution looking for a problem.
>>
>>55219731
I like to stare at my code when I'm high.
>>
>>55221051
"lmao man did u see mark yesterday who the fuck brings a cardboard cutout of a graph to afucking board meeting, jesus christ this guy is just taking the piss at everyone now, check it out rofl:"
>>
writing some code generation stuff othat will be integrated into the company build process
can anyone think of a good way to implement "blocks" in C++ (the begin_class stuff, etc), example below
CppFile* pCpp = new CppFile(filename);
pCpp->comment("Generated by blah bla blah");
pCpp->nl();
pCpp->begin_class("test");
pCpp->end_class();

//OUTPUT:
//Generated by blah bla blah

class test
{

};


also the weirdest shit just happened
few minutes ago i suddenly felt scared and anxious as shit, started to panic cause i thought a heart attack was imminent and was like that for about a minute before i started to calm down
its never happened before, no idea what it was
>>
So I'm coding a program that keeps up with current match standings in sports. It does so by scraping an html page every minute, using string functions String.IndexOf and String.Substring in .net. So if I wanted to get the "1-2" in the string "The current match standings are: 1-2", I would use IndexOf, and start from ":" + 1 with Substring. The problem is the site being scraped is full on aids infested autism of the highest degree. Pages looks different depending on what day and game it is, color changes fucks up the chars used for IndexOf, etc. The reason I use the site is because it is the only one that updates its page by changing the html page, which means I don't have to deal with javascript scraping. And I don't want to use external scraping programs, I want all code to be managed by me.

Are there better functions/ways in .net for doing it? Is there a neat way of getting "1-2" from a string by just asking for <any int> - <any int>?
>>
File: fuck_apple.png (103 KB, 531x790) Image search: [Google]
fuck_apple.png
103 KB, 531x790
>>
>>55221904
why even commit on a "fix" without even testing it
>>
>>55221904
are you fucking retarded?
>>
>>55222002
>>55221989
I don't have a Mac. I can only test by committing and letting Travis build it.
>>
>>55222032
ho lee fuc
>>
>>55222032
lel
>>
File: render.png (12 KB, 800x550) Image search: [Google]
render.png
12 KB, 800x550
>>55221904
is that your github?

if so, here's a better render of your profile picture
>>
>>55221904
You should probably git rebase that.
>>
>>55222056
Wow, thanks. Finally a Hi-Def Chen.
>>
>>55222085
inb4 he pushed to master like this
>>
>>55222108
>>55222085
>https://github.com/flanfly/glpk-sys/commits/master

t. Software Engineering Pro
>>
>>55221904
proof that weeabs are cancer
>>
in git, if i make changes in one branch without staging them or committing them and then switch branch, what happens?
will the changes stay or are they removed?
do they also appear in the other branch?
>>
File: 1389567984959.png (123 KB, 600x811) Image search: [Google]
1389567984959.png
123 KB, 600x811
>>55222302
What the hell is with your spelling?
>>
>>55222383
>what the hell is with
>complains about spelling
>>
>>55222428
"What's with" is a colloquial English phrase. "the hell" was added for emphasis.
What is supposedly wrong with my sentence?
>>
>>55214118
*ptr++ = thing;


or

*ptr = thing;
++ptr;


???
>>
File: C_unites_workers.jpg (2 MB, 2000x2610) Image search: [Google]
C_unites_workers.jpg
2 MB, 2000x2610
>>55222480
some people will tell you the first one is bad but they're wrong
those people are shit and can't into pointer arithmetic
>>
>>55222480
0[ptr++] = thing;
>>
>>55222536
there is literally zero reason to ever use an increment operator on the lhs
>>
How does GC work on anonymous classes in Java? Does setting an instance field to static makes the reference static, but not the object it's pointing to?
>>
>>55222610
>I don't know C
>>
>>55222814
>I don't know C
>>
>>55222814
give me a counter-example where your intention/the semantics of what you're writing are made clearer by having increment (++i or i++) on the lhs.
>>
>>55222886
*ptr++ = thing;
>>
>>55222900
you are being intentionally dumb and as such I will not be engaging in further conversation with you on this topic.
>>
>>55222960
>I can't understand idiomatic C
you're are not entitled to an opinion anyway
>>
>>55222976
>you're are
>>
>>55222593
Is this a serious answer?
Is zero a pointer array of some sort?
>>
>>55222886
>give me
You don't seem capable of understanding anyway, m8, it would be pointless to explain it to a retard.
>>
>>55214118

I want to build a motion recognition program for the Pi zero with a camera.

I'm considering just doing it in ARM C and avoiding any operating system.

Does the Pi Zero use drivers to control the camera and GPIO outputs? Will I be missing out on these if I choose to avoid an OS?

How easy would it be to drive the camera myself with C?

How fast is Linux anyway? what kind of performance advantage will I gain from not using it?
>>
How do you guys write unit tests in C?

a seperate file with its own main to execute a series of tests on a specific functions in another file?
>>
>>55223053
It would be extremely painful.
>>
>>55223053
>avoiding any OS

enjoy losing the project to rewriting vital OS functionality
>>
>>55222997
>>55222997
0[array] is the same as array[0]. the first one calculates the address by 0 + array*sizeof(type) and the second one calculates it by array + 0*sizeof(type)
>>
>>55223087

Not really

All I need is to drive the camera, process the data (probably have to store a small buffer into the SD card), and shit it back out the HDMI cable

does anybody know how hard HDMI protocol is?
>>
>>55223094
>0 + array*sizeof(type)
wrong
>>
>>55223094
>0 + array*sizeof(type)
>array + 0*sizeof(type)
>array*sizeof(type) == array
anon...
>>
>>55223206
sigh

ok mongoloid shitposter, please educate me on why you mistakenly believe me to be wrong
>>
>>55223201
go ahead, go already seem to be dead set
>>
>>55223238
get rekt, webshit! >>55223236
>>
>>55223236
uh well, would you look at that, the mongoloid was actually right >>55223206

thanks anon
>>
>>55223258
>uh well, I got my mouth stretched
:^)
>>
>>55223064
>unit tests in C
rajesh...
>>
>>55223064
gdb nigga
>>
>>55223094
>calculates the address by 0 + array*sizeof(type)
Retards like you should end themselves.
>>
>>55223313
needlessly hostile mongoloids like you and >>55223270 should leave /dpt/

the quality of these threads is already low enough thanks to animeshitposters
>>
>>55223344
Oh my god, those quad dubs
>>
>>55223344
>needlessly hostile
are you saying you shouldn't be raped and shit on when you make literally retarded claims? but how will you ever learn to keep your fuck hole shut?
>quality of these threads is already low enough
that's why ignorants like you should be fucked in the ass on every occasion, maybe you won't spew worthless drivel as fact next time
>>
Thoughts?

http://coconut-lang.org/
>>
>>55223620
Meme
>>
any good books/res for parallel programming?
>>
>>55223620
Interesting ideas, but probably won't get too large. But I hope it does.
>>
What's a better way to increase readability on functions that take a lot of space than something like
foo(arg1,
arg2,
arg3,
arg4,
arg5)


All the whitespace to the left bothers me. It's a lot worse when it's heavily nested and the arguments are long.
>>
>>55223620
>compiles to Python
>compile resulting Python with Cython
>compile resulting C code
>
>>
>>55223665
>muh ADD
>>
>>55223643
By parallel programming, do you mean multicore?

C++ Concurrency in Action is great. Unfortunately I don't think you'll find many language-agnostic texts on parallel computing.
>>
Learning Opengl right now. Getting pretty hyped about being able to make guis and stuff with it.
>>
>>55223711
You don't make GUIs with OpenGL.
>>
>>55223620
Does it really optimize tail recursion?
>>
>>55223691
Do you mean OCD? Or autism or some other meme disorder?
>>
>>55223699
yes, thanks
>>
>>55223733
>increase readability
no
>>
>>55223776
How is wanting code to be easier on the eyes indicative of ADD? Do you fucking know what ADD is?
>>
>>55223728
I dont see a reason not too. Havent found a framework Im happy with so Ill just make my own.
>>
>>55223803
>easier on the eyes
foo(arg1, arg2, arg3,... ie. just written like a normal person would, without gimmicky alignment, is easy enough on the eyes; it's hard for you? you need to format it another way because otherwise it's difficult to follow? that's ADD
>>
Just finished writing a fake proxy server to view internal mechanism of certain applications.
I still can't belive there's no decent application like this so I have to make one myself.

Other alternatives :
- are really bloated and slow
- cut (censor) important parts that I need
- can't craft specific http header at one button click
- don't even have features I need

Heh, nothing beats custom application that you've made yourself.
>>
>>55222480
>>55222536

i'd recon the compiler will shorten
*ptr = thing;
++ptr;
anyway. If this is the case, go for the second one, because readability
>>
>>55224002
>delusion
>>
>>55223620
>>55223678
I laughed at first then saw
>pipeline style programming
I'm sold already. I've always wanted this
>>
>>55223966
When the arguments are short, like "arg0" that's fine, but when they're longer and the function is nested the line can go beyond the normal view, which makes things ugly and obscures information. Also holy shit, it's in the fucking name. Attention. It has nothing to do with not being able to pay attention, it's just about making information easier to parse.
>>
>>55224025
>because readability
how about learning the language instead?
>>
>>55224041
>easier to parse
if you find it hard, you have an attention problem; if only there was a name for it...
>>
>>55223665
function(
arg1,
arg2,
arg3,
arg4
);
>>
>>55224068
Attention has to do with focus over time. Readability is about the ease of differentiating between pieces of text.
>>
>>55224084
Hmm, this does look better. I'll try this out for a while.
>>
>>55223665
python
args = [arg1]

args.append(arg2)
args.append(arg3)
args.append(arg4)
args.append(arg5)

foo(*args)


>>55224031
pipeline programming ? what the fuck does that even mean ?
>>
>>55224084
how about wasting less vertical space? we're in 16:9 era and shit only looks like it will get even worse
function(arg1, arg2, arg3, arg4);
>>
>>55224108
>ease of differentiating between pieces of text
>totally unrelated to "focus over time"
>>
>>55224188
its an example of what to do when it cant fit on one line nicely.
>>
>>55224219
It is. I don't have trouble with maintaining focus; it's just ugly.
>>
>>55224229
>when it cant fit
press enter after the last comma that fits
>>
>>55224268
>ugly
nope
>>
>>55224300
>nope
Yep
>>
>>55224312
>mental illness
>>
>>55221898
>>55221898
>>55221898
>>55221898
>>55221898
>>
>>55224459
What?
>>
>>55224183
I hate python so much for its incompatibility with proper formatting using whitespace. I just fucking hate how fucking indents and line breaks are syntactic characters, who thought this is a good idea?
>>
>>55224500
>pyturd
>expecting anything about it to be a good idea
>>
Its been a few years since Ive programmed and Im trying to remember. If I want a class to use another class as variable or something. Shouldnt I just be able to make a pointer to it in the class header. Or do I need to go relearn inheritance.
Thread replies: 255
Thread images: 26

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

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.