[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: 329
Thread images: 38

File: timetocode.webm (2MB, 1152x648px) Image search: [Google]
timetocode.webm
2MB, 1152x648px
This is /dpt/, the best subreddit of /g/

Umaru-chan edition, the best of all editions.

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

code of conduct:
no racism
no insult
no sexual harassment
no gender discrimination

wat r u working on, anon-chan ?
>>
Shit OP, delete this thread and feel shame, thanks.
>>
Nothing. Just learning C I guess.
>>
Nothing. Just unlearning C I guess.
>>
>>55848284
Fuck off sjw weabshit
>>
Rewriting C in B.
>>
First for D.
>>
File: initial d.jpg (358KB, 817x818px) Image search: [Google]
initial d.jpg
358KB, 817x818px
>>55848379
>>
>>55848284
Writing a custom allocator for C that takes another pointer as a parameter. It then returns memory as close as possible to the given pointer. It allows a programmer to optimize for locality without painful boiler plate.

Eventually I'll extend it so the program is profiled while it runs and the allocator keeps track of the usage of a set of memory areas in time and space. I will allow one to pass the set of pointers to an optimize() function which will move the memory around to better take advantage of locality. If this occurs several times throughout a program and over multiple sets of memory the cost overhead of memory access will steadily decrease. It will also dump a profile report which can be loaded by the allocator so that future runs of the allocator in that program exhibit the same allocation scheme the optimized usage had determined.

Profile-guided optimization applied to memory allocation. I think it will take a couple years in between classes and work, so I might use it for my PhD.
>>
>>55848379
I bet you like the D.

C'mon kid, why don't you stop wasting your time with gay hipster shit, and learn a real language like Java or C#? Nobody's going to give you a job using D.
>>
File: launchpack.webm (3MB, 960x540px) Image search: [Google]
launchpack.webm
3MB, 960x540px
dpt-chan, daisuki~~

Ask your much beloved programming literate anything (IAMA)

>>55848321
>2016
>learning C

Why ?

>>55848348
Good
>>
>>55848435
Say that to my face online not URL and see what happens, fucker
>>
Can someone post recent programming challenges?
Is it worth doing them to prove my skills?
>>
>>55848421
To learn the basics. I plan to move C++ later.
>>
>>55848458
Write a program to find programming challenges for you to do.
>>
>>55848480
>Move to C++ later
That's what I meant
>>
idea to catch pedophiles:

find code execution vulnerabilities in popular image/video viewing software, then upload malicious images/videos that exploit those vulnerabilities to onion sites

when can i claim my job at the nsa
>>
>he calls himself a programmer but he's not able to program for the most widely used operating system in the entire world: Android
>>
>>55848484
So markov chains and stack overflow posts?
>>
File: nesteros.png (551KB, 3680x5520px) Image search: [Google]
nesteros.png
551KB, 3680x5520px
>>55848480
If you want to learn the basics, you learn a decent programming language like Scheme. not c or c++.
>>
>>55848509
Yeah, why not. Or some kind of project Euler scraper.
>>
>>55848536
>sjws
stopped reading there
>>
>>55848510
>t. (((((((anon))))))
>>
File: spriter.webm (1MB, 1366x768px) Image search: [Google]
spriter.webm
1MB, 1366x768px
>>55848284
just finished this sprite sheet packer and animator i made for cocos2d-x. there were no free tools to pack sprite sheets. and no linux tools to animate them

the source code got out of hand so fast lol. it's the biggest thing I've ever written in javascript. 1 file has all the logic and UI with 1500 lines
>>
File: 9YmKi4i.jpg (319KB, 1506x2048px) Image search: [Google]
9YmKi4i.jpg
319KB, 1506x2048px
>>55848568
one ) is missing. yes, i am a lisper.
>>
>>55848536
No anon, every company must be made up of 25% whites, 25% blacks, 25% Asians and 25% Hispanics otherwise it is RACIST. Even then it is still bigoted because it is not employing affirmative action. The ideal split is 10:30:30:30.
>>
Anyone here use Codelite? It seems pretty decent.
>>
>>55848609
No, use a real editor, you nancy.
>>
>>55848590
Can it detect the size of individual sprites in a sheet? Looks like that's what it's doing. Also your sliders where I can't input values manually triggered me so bad I had to stop watching the gif.
>>
>>55848624
If you triple click it will let you input a value manually.
>>
>>55848618
No thanks. Code completion makes my life so much easier.
>>
>>55848635
Respect kind of restored, but that's very unintuitive. They should just be input boxes so it's immediately obvious. Anyway cool project anon.
>>
>>55848645
You can get that in a real editor.

Do you code while wearing a penis gag?
>>
>>55848657
What's a "real editor", then?
>>
>>55848655
It's straightforward, actually.

Single click: slide
Double click: lock/unlock
Triple click: input value manually
Quadruple click: reset to default

Thanks for the kind words, though.
>>
>>55848661
I write my code by flipping switches on an altair 8800, like real men.
>>
>>55848661
Visual Studio
Eclipse
IntelliJ IDEA
>>
>>55848624
hahaha, yes it detects all the sprites within any sprite sheets you give it. good point I'll add a number input to the frame duration slider
>>
>>55848661
echo
>>
Best Python IDE?
>>
>>55848772
you dont need an IDE for a childrens' scripting language
>>
>>55848772
apt-get remove python
>>
>>55848772
spyder
>>
File: 1.jpg (419KB, 1412x2020px) Image search: [Google]
1.jpg
419KB, 1412x2020px
i can use classes when they're in main, but when i split them in diff files i get this error. pic related
(file -> new -> class)

any idea how to fix this?

considering reinstalling code::blocks
>>
>>55848826
For some reason it doesn't see the main() function in your code, and cannot execute.
>>
>>55848784
>childrens'
>myeeeeh I learned a simple language first, but then learned C, so now I shit on anything easier to use

Got my first taste of code on a rusty Compaq, running a BASIC interpreter, the power and usability that python has, shits on basic all day long, despite basic being 'muh hardcore' when compared to it. Get a job and quit telling people your opinions on the internet when you're this wrong about them.

>python is for babbies meme
>>
>>55848826

You're trying to create a console application but it thinks you're compiling for GUI, so it expects WinMain.
Change the type of your program to console and it should work fine.
>>
>>55848826
je ne parlais du su plus plus, anon
>>
>>55848772
http://www.jetbrains.com/pycharm/download/#section=windows
>>
>>55848506
We have a guy for that
>>
Trying to see what more I can add to pic related before I make it "official" (as in, finished). Like, suggestions or changing difficulties
>>
>>55848952
YO
>>
>>55848863
Python is indeed for babbies. Its claim to fame is that non-programmers like it. It's a terribly-designed language, with no redeeming features.
>>
File: Capture.jpg (83KB, 711x552px) Image search: [Google]
Capture.jpg
83KB, 711x552px
>>55848909
do you mean from 'project -> properties' ?
because it's already set as console there.
>>
>>55848977
If you're not obliged to use this crappy IDE, switch to Visual Studio. It's 100 times better than this.
>>
File: 1465872324850.jpg (181KB, 1031x965px) Image search: [Google]
1465872324850.jpg
181KB, 1031x965px
>>55848681
>Eclipse
>>
>>55848993
it works just fine on dev-c
visual studio loads forever but i guess i'll just switch to it
thanks anyway
>>
>>55848284
Made a little mpv wrapper because I was bored.

let arguments = Process.arguments.dropFirst()
var mpv = "/usr/local/bin/mpv".cStringUsingEncoding(NSUTF8StringEncoding)!
var volume = Arg.volume(30)
var audioOnly: Arg? = Arg.audioOnly
var urls = [String]()

for arg in arguments {
let a = Arg.parse(arg)

switch a {
case .audioOnly:
audioOnly = a
case .video:
audioOnly = nil
case .volume:
volume = a
case let .url(urlString):
urls.append(urlString)
}
}

let audioOnlyCString = audioOnly?.cString ?? []
let volumeCString = volume.cString
var args = UnsafeMutablePointer<UnsafeMutablePointer<Int8>>.alloc(strideof(UnsafeMutablePointer<Int8>.self) * (3 + urls.count))

args[0] = cStringToUnsafePointer(mpv)
args[1] = cStringToUnsafePointer(volumeCString)
args[2] = cStringToUnsafePointer(audioOnlyCString)

for i in 0..<urls.count {
args[i+3] = cStringToUnsafePointer(urls[i].cStringUsingEncoding(NSUTF8StringEncoding)!)
}

execv(&mpv, args)
>>
>>55848976
What objective standard are you using to determine that python is terribly designed, the code you write in it does what you need it to, it's clean and easy to read. I'll admit it has numerous downsides but it's a fucking scripting language
I can't stand it when the neckbeards on /g/ tell 'lesser mortals' which language they should use

I've used C, C++, Z80 assembly, BASIC, Lua, Scheme, C-Lisp, Java, Python, Lua, shell scripting for bash, and just a touch of C# and every one of those languages did exactly what I wanted when I learned the syntax with no real downsides, because I knew what I wanted to use them for, you don't use a hammer to saw a board.

The one exception being Java, fuck that bloated bullshit, but every other language is fine. Fuck yourself if you judge someone based on the combination of letters they type to get their computer to do shit
>>
>>55849004
It's better than whatever retarded hipster shit he's using.
>>
>>55849039
>visual studio loads forever but i guess i'll just switch to it
People always say this, what the fuck kind of a toaster are you running that can't open visual studio in less than 3 seconds?
>>
Should I still be using regular makefiles for building latex documents?
All I'm doing is running pdflatex :\
>>
File: VstEcEi.jpg (52KB, 720x540px) Image search: [Google]
VstEcEi.jpg
52KB, 720x540px
>>55848976
https://news.ycombinator.com/item?id=1803815
>>
>>55849053
Why not, especially if you have a bunch of arguments, that way you can come back to the document later and compile with 4 letters instead of having to try to remember all the arguments.
>>
>>55849052
>took about 20 seconds to load
>told me i have to sign in or beat it
>crashed
. . .
>what kind of toaster
it's 4 years old, and it wasn't even new at the time. gonna get a new one when i start making money
>>
>>55849069
Yes, yes, one can compensate for any language's deficiencies simply by throwing more resources at it. That's not the point.
>>
>>55849114
You don't use python for resource intensive applications you dingus!
>>
>>55849122
I meant throwing people and development time at it.
>>
>>55849114
completely irrelevant to Norvig's argument. can you even read ?
>>
File: vape keanu.jpg (45KB, 523x476px) Image search: [Google]
vape keanu.jpg
45KB, 523x476px
I developed a program written in Bash to enable system settings for CSGO and desktop usage.

#!/bin/bash

# CSGO settings

cp ~/.config/openbox/csgo.xml ~/.config/openbox/rc.xml
openbox --reconfigure
pactl set-sink-volume 0 50%
pkill compton
sudo cpupower frequency-set -g performance
sudo gpu-performance
xrandr --output DisplayPort-0 --gamma 1.3:1.3:1.3



#!/bin/bash

# Desktop settings

compton &
cp ~/.config/openbox/desktop.xml ~/.config/openbox/rc.xml
openbox --reconfigure
pactl set-sink-volume 0 100%
sudo cpupower frequency-set -g schedutil
sudo gpu-balanced
xrandr --output DisplayPort-0 --gamma 1.0:1.0:1.0
>>
rate my sudoku generator guys

http://pastebin.com/pCp6Hmck

please don't take into consideration the time it takes to finish
>>
>>55849046
I don't think of you as a lesser mortal. I think you've been failed by the education system, which has progressively lost rigor in favor of making students more 'employable'.
>>
File: spriter.webm (735KB, 1366x768px) Image search: [Google]
spriter.webm
735KB, 1366x768px
>>55848655
>>55848665
>>55848689
doubleclick to lock, triple click to input value manually, quadruple click: reset to default
krogank9.github.io
>>
>>55849155
I did read it. He misses the point, as usual.
>>
how do you get better at programming/solving problems? doing leetcode, but some of these problems are fucking hard.
>>
>>55849146
What kind of jackass develops a non web based app in Python? The languages deficiencies come from it's interprreter having to run on top of the system it's installed into. Unless you absolutely need the code to be portable RTFS you shouldn't fucking do that.
So don't use the idiocy of a fucking developer to bash an entire god-damned language, it runs into problems when people do shit with it that it wasn't designed to do. You don't make 3d apps in fucking java for a reason, and if anyone did and their program ran like shit (cough, minecraft) it'd be really fucking obvious why.
God damn you motherfuckers are stupid

>>55849186
I'm self taught you fucking pavement ape, and I shit out more quality code in one night then you will in your whole fucking career
>>
>>55849198
Quintuple click to enlarge?
>>
>>55849156
not programming, go away
>>
>>55849178
Absolutely disgusting, and let me show you why:
Project requirements just changed, you need now need to make this work for a 16x16 board as well.

And just like that you now have to rewrite the entire thing because you relied on so many magic numbers.
>>
>>55849201
>as usual.
explain
>>
>>55849227
>magic numbers
i could give them a formula, but i just wanted a sudoku
>implying that would be an actual project change of scope
lol ok senpai
moreover, this is my own project, and i know the scope of my project will never change
>>
>>55849214
find yourself something you want to do (make a hentai game, etc) and get to it. gonna make you better, solve real problems, and i even get a hentai game at the end
>>
>>55849270
You should follow best practice in everything you write, it makes you a better programmer but more importantly

STOP WRITING SHIT CODE
>>
>>55849270
You asked for a r8, m8. With slightly more effort you could have made a general solution that looks better and is easier to read.
>>
>>55849215
>I'm self taught you fucking pavement ape
Touched a nerve, did I?

>and I shit out more quality code in one night then you will in your whole fucking career
I don't disagree that you write more code than me in general, Python (and C, C#, Lua, go, and most other mainstream languages) force you to write far, far more code than better languages because their capacity for reuse is so limited.
>>
>>55849289
>Touched a nerve, did I?
Actually yes, I had a series of negative experiences within the academic circle, that if someone accuses me of being institutionally taught I actually get really pissed.

>their capacity for reuse is so limited
There's a concept called black-box abstraction wherein you can write a module that gets reused across multiple areas in the program, acting as a self contained unit. You use the black boxes you have to make bigger boxes, until you have a program that does whatever you need it to, this helps keep code modular, reusable and maintainable.

I usually dump functions I like to a header file that I can call whenever I'm writing something else, I can boiler plate it in later, but I've got my own little library of code running
I only write good code because there was a time I wrote really shit code, and developed good habits to compensate
>>
>>55849284
>implying i don't have other things to do with my day
senpai if you don't understand scope then you're the shit programmer
i wrote a (very slow) sudoku generator. i was not seeking nor planning for a general solution. further, if you can't see how easy it is to generalize that code, you're the asshat. those magic numbers are hardly magic.

>>55849287
>easier to read
seems easy enough to read, but then again i just wrote it
>>
Trying to implement RAFT consensus protocol. I've watched 3-4 lectures on it, is there a nice statemachine diagram showing how a single computer in a RAFT network behaves?
>>
File: spriter.webm (941KB, 1366x768px) Image search: [Google]
spriter.webm
941KB, 1366x768px
>>55849216
>>
>>55849352
Why did you post it if you didn't want feedback?
>>
>>55849048
>It's better than whatever retarded hipster shit he's using
That would honestly be a miracle. Eclipse is trash. It's written in Java and it runs like shit (I guess that's redundant).

>>55849052
It doesn't take a toaster for Visual Studio to run like shit, and you don't and shouldn't need a high-end machine to program. I do all my dev work on a $180 machine and it runs like a dream because I don't run shitty bloated software.

>>55849106
Visual Studio is bloated as fuck. You could try Qt Creator, turning off the plugins you don't need (you probably don't need the vast majority of them). It runs a lot better.
>>
>>55849352
> typedef for uint ==> use uint32_t or whatever standard way
> Methods badly named (validate what?)
> Useless variables such as "counter"
> Not parametric => Magic numbers
> Put fucking spaces after commas please
> fillBoardSquare called in square, no just no
> Computes stuff twice (such as i%3)
> Sudoku sudoku; sudoku.print(); ==> Sudoku().print()
>>
>>55849464
Sweet

And to think I was just trolling
>>
>>55848661
i have always used code blocks for c/c++ i love it
>>
>>55848661
Eclipse, for general development, Visual Studio for Windows specific shit software

>>55848772
PyCharm
>>
>>55849156
>CSGO
terriburu taste, fuck off
>>
>>55849598
You fuck off, CS:GO is the shit. Get back to your League garbage.
>>
>>55849069
> In terms of programming-in-the-large, at Google and elsewhere, I think that language choice is not as important as all the other choices: if you have the right overall architecture, the right team of programmers, the right development process that allows for rapid development with continuous improvement, then many languages will work for you; if you don't have those things you're in trouble regardless of your language choice.

This is important.
>>
File: madokami.png (193KB, 1327x699px) Image search: [Google]
madokami.png
193KB, 1327x699px
I make a program to download manga from Madokami in command line
>>
File: 1469316285508.jpg (92KB, 808x960px) Image search: [Google]
1469316285508.jpg
92KB, 808x960px
>>55849215
>I'm self taught you fucking pavement ape, and I shit out more quality code in one night then you will in your whole fucking career
wew

This right here is premium mad.
>>
>>55849537
Code::blocks seems nice, I've been using it for a little while now. However, it feels like it lacks some common editor features like starting a new indented code block when entering a newline after {. Also I'm not sure if it has Sublime-like multi-line editing, I can seem to enter multiple cursors but when entering text it removes all the other ones.
>>55849583
I don't really like Eclipse. I tried using it with Java a few years back and it didn't really stick with me.
>>
>>55849289
>Python (and C, C#, Lua, go, and most other mainstream languages) force you to write far, far more code than better languages because their capacity for reuse is so limited.

...then what languages do you like?

Is this a Haskellite?
>>
>codeblocks
i just use notepad++ and gcc
>>
>>55849469
>Visual Studio is bloated as fuck.
No, it's feature rich. Just because you don't use all of its features doesn't mean that other people don't.
>>
>>55849673
>notepad++
Use emacs. Notepad++ belong to the stone age.
>>
>>55849685
What's so good about emacs?
>>
File: russian hygiene.gif (575KB, 280x211px) Image search: [Google]
russian hygiene.gif
575KB, 280x211px
>>55849637
>Powershell
>>
>>55849215
>The languages deficiencies come from it's interprreter having to run on top of the system it's installed into.
>confusing a programming language with its implementations.

that's not even cs101 level.
>>
>>55849467
i thought it would be funny

>>55849480
oh for fucks sake
>implying uint doesn't automatically default to 32 bits when possible
>implying helper function validate could mean anything else in the context it was in
>implying i don't know what fucking magic numbers are, implying those wouldn't be easy as fuck to make parametric, implying i will ever go back to this stupid 10min project and ever need to generalize it
>implying fillBoardSquare being called in a square isn't aesthetic as fuck
>implying % is expensive here
>implying making a sudoku a function object has any tangible benefit over it not being one
you got me with the counter though, that was a remnant of some debug stuff i forgot to remove
>>
>>55849608
CS:GO is shit. Hackers abound and no cs_office in official rotation get fucked pls
>>
>>55849703
Works and not bloated. And it can indent (notepad++ is still unable to do that).
>>
>>55849727
Are you fucking retarded?
The only downside to python is that it's not resource efficient, you can bet your ass that if it ran at the same level as C it'd be all anyone would ever use.
>>
File: Screenshot 2016-07-31 11.55.47.png (293KB, 1177x522px) Image search: [Google]
Screenshot 2016-07-31 11.55.47.png
293KB, 1177x522px
Daily reminder that Rust is wonderful!
>>
>>55849653
I feel you, I hate Eclipse as much, but it's still the best option, even for C/C++ because of its extensibility and wide adoption in various companies. To be honest, it might not be the best experience it could be, but it still has all the features needed (fast indexing, auto-formatting, versionning tool support, test suite support, etc.) for a good IDE, it's free and customizable (although the basic setup should be pretty much ok).

My team has done a search for a better option as a general purpose IDE, and it came first after we tried almost all other (free) solutions. I've never tried CLion from JetBrain, but it's proprietary and cost something so...
>>
>>55849770
Did you try emacs?
>>
>>55849683
Actually the GUI-builders are fucking useless if you're developing cross-platform software, IIRC.

Unless you can configure them to build GUIs for non-Microshit libraries. Can you do that?
>>
>>55849469
just tried codelite, it's a pain to run files from

>You could try Qt
i most likely will for GUI

say whatever you guys want, i'm switching to dev-c for now
>>
>>55849751
python is already a lot more used than C. there are several implementations of python (pypy, nuitka, numba, microsoft's one, ...).
what you are referring to is CPython, an implementation of the Python programming language.

With your reasoning, i could implement X on javascript then say "Look, X is a inefficient programming language."

a programming language and it's implementation are two very different things.

you fail at programming language theory. you fail at everything.
>>
>>55849737
You asked for feedback, they're all good points. I hope I never get you in code review, jeez.
>>
Should I use django or node.js??

node seems more widespread but python devs seem less cancerous
>>
>>55849738
Da fuck server do you play on?

>>55849774
I was hoping
>>
>>55848284
> reddit
> code of conduct
either bait or dumbfuck, GTFO anyway
>>
>>55849828

He's been posting this OP for a while now. It shouldn't surprise you.
>>
>>55849828
newfag
>>
>>55848592
Does your pic actually happen in pokemon?
>>
>>55849828
you just got epically trolled
>>
>>55849774
Sorry replied posted automatically.
I wanted to say I was hoping to get the chance to try it, but a friend of mine who is also a free software elitist has tried it (after being fucked in the ass by vim) and said it was ok, but was impractical as a stable setup (you have to configure it and it takes lots of time). So far I don't mind too much about the IDE I use, as long as I can write text and navigate in code Eclipse fits my needs, when I code in C/C++. Usually use JetBrain's suite for Java and Python in community edition since I write research and free software.
>>
>>55848284
First for rebol
>>
>>55849768
and what editor and colorscheme might this be?
>>
File: sondad.jpg (66KB, 900x675px) Image search: [Google]
sondad.jpg
66KB, 900x675px
>>55849849
http://bulbapedia.bulbagarden.net/wiki/Level#Disobedience
>>
>>55848284
Is python worth learning? I've already some experience in C#, java, and html (if you want to count that).
But I've seen a lot of programms are using python, mainly bots. Is it easy to learn?How should go about it ?
>>
>>55849799
The language doesn't let you manually manage memory, which means that a garbage collector is an implied part of the language spec.

Because of this, every implementation of Python will have long pauses at unpredictable times, making them unsuitable for soft or hard real-time applications.

...right up until somebody implements hardware GC. That'll be interesting.
>>
>>55849908
Yes you should learn it.

[spoiler]I said learn, not use.[/spoiler]
>>
>>55849924
Don't you know about the del function?
>>
>>55849858
It's Visual Studio Code (no bully) with the default color scheme.

It's breddy good. There's no actual relationship with Visual Studio, apart from the brand name.
>>
>>55849799
I'm not the one confusing those dumbass, I'm saying that there's nothing wrong with python other than how it's traditionally implemented, read the fucking post god damn
You automatically assumed I was confusing a language with it's method of implementation because you have to maintain your fragile sense of superiority. Get the fuck off this message board if you can't parse basic english you pretentious asshole, maybe someone with an IQ over 65 can show you how to read.
>>
>>55849949
>VSC

lol
>>
File: ?.png (7KB, 120x120px) Image search: [Google]
?.png
7KB, 120x120px
What is better:

two monitors or one big ass monitor?
>>
>>55849924
>a garbage collector is an implied part of the language spec.
cpython actually uses reference counting. gc is optional.

https://docs.python.org/3.6/library/gc.html

>>55849924
>making them unsuitable for soft or hard real-time applications.
micro python
>>
>>55848284
>code of conduct:

end yourself
>>
>>55850019
two monitors hands down

only autists want big monitors anyway
>>
>>55850003
I said no bully ;_;
>>
>>55850030
[deleted]
>>
>>55849683
"Feature-rich" and "bloated" are synonymous when none of the features are optional. They used to have it right, with Express editions and, you know, actual options in the installer. Now it's just "fuck you, you get everything". Don't know what the hell they were thinking.

>>55849788
>Unless you can configure them to build GUIs for non-Microshit libraries. Can you do that?
Haha, I wish, but fuck no. It's Microsoft.

>>55849798
This seems to be a common misunderstanding, but Qt Creator is not just for writing Qt applications. It's a full-featured general-purpose C/C++ IDE with some *completely* optional (as in they can be fully disabled) extra features and support for developing Qt applications. It can load the project/make files from numerous build systems (including excellent CMake support), and can easily be configured to use MSVC/GCC/etc, and the relevant debuggers. I use it with CMake/GCC/GDB to write OpenGL applications. In fact, I've never written a Qt application.
>>
C is a FP lang. prove me wrong, functional fags.

>>55848661
ed
or just use "cat << EOF"
>>
>>55850301
>C is a FP lang
prove it
>>
>>55850301
>C is a FP lang. prove me wrong, functional fags.

Unrestricted access to mutable state.

t. not a functional fag, just know what the fuck I'm talking about.
>>
File: umaru happy ending - no sound.webm (511KB, 1280x720px) Image search: [Google]
umaru happy ending - no sound.webm
511KB, 1280x720px
>>55850301
>prove me wrong
Prove yourself right
>>
File: crybr.webm (2MB, 852x480px) Image search: [Google]
crybr.webm
2MB, 852x480px
>>55850301
There is no such thing as functions in C, there is only procedures. Functions are the most important axiom of FP.

>>55848421
>tfw no questions
>>
C is functional as it can only describe an unpure program. Think of the IO monad.
>>
>>55848480
But C++ is shit anon.
>>
>>55850570
>There is no such thing as functions in C, there is only procedures.
What's a function proper, then?

>>55848421
>>2016
>>learning C
>Why ?

A. he wants to know more about computer internals
B. He wants to write drivers, operating systems, or hard-real-time code that runs on pacemakers and such.
>>
>>55849626
It's bullshit, though. Unless he's so myopic that he thinks the choice is between Java and C#, or between Python and Ruby. Scheme, Haskell, OCaml, and friends are massively more productive than mainstream languages.
>>
>>55849583
>>55848681
0/10
>>
>>55850625
A: C does not teach you about computer internals
B: C is not the only language that can do these.
>>
>>55850649
>Scheme, Haskell, OCaml, and friends are massively more productive than mainstream languages.

Only if you're already a mathematics PHD. :^)
>>
>>55850570
>there is only procedures

Procedures don't return values, though.

t. ADA
>>
>>55850679
No, that is a pernicious myth.
>>
>>55850682
Who says so?
>>
>>55850625
>What's a function proper, then?

A function is an expression (very important because, with declarative programming, everything must be an expression) takes one argument and returns one object. If the function is referentially transparent, then it's a pure function.

A functional programming language must have syntax and semantics devoted to functions (eg: ocaml, haskell, fortran)
>>
>>55850734
>takes one argument
Why the mandatory currying?
>>
>>55850725

Nik "Big Dik" Wirth
>>
>regular PL
Well I think you might have fucked up here because that function needs something with this interface, and the thing you're passing doesn't have an instance of it defined

>Python, Ruby, other dynamic trash
maybe it'll work, maybe it won't! I'm just the compiler, not my job
>>
>>55850734
>takes one argument
This is bullshit.
You are an idiot who tries to pretend to be a holier than thou nigger but in reality you know shit,
>>
>>55850753
You can trivially make it take more by using tuples.
>>
File: 1469166491823.png (860KB, 809x747px) Image search: [Google]
1469166491823.png
860KB, 809x747px
>tfw finishing my degree
>tfw still have no idea how the fuck pointers work
>>
>>55850734
>takes one argument

That's not even a requirement of mathematical functions.
>>
File: 94fMJPU.jpg (105KB, 734x960px) Image search: [Google]
94fMJPU.jpg
105KB, 734x960px
>>55850784
>This is bullshit.
no, it's correct and that's why currying is a thing.
>>
>>55850812
What's your degree in?
>>
>>55850824
pointers
>>
>>55848952

Monster raising / breeding simulator.

Hard mode: Differing species (Sprites), and color patterns that can be combined / passed to offspring.

Hell Mode: Full trainable ai (Neural network) and genetics added to the monsters (Regulatory genes (Hormones / Chemicals?), base behavior, Appearance, Dominant & Recessive traits, random mutations) with editor to make base breeds..
>>
>>55850822
You put your own artificial requirements and consider them as factual ones.
>>
>>55850828
You don't deserve to graduate, you wretched cretin.
>>
>>55850812
>Learned how pointers work at age 12
>not sure if that's because I'm smart or if that's because I tried it while I still had a bunch of brain plasticity to learn weird new shit with.
>>
>>55850829
Not him but I always wanted to make that.
Any tips or pointers?
>>
>>55850847
You're just smart anon, I learned them when I first had to use C, which was when I was 20.
>>
>>55850847
Everybody know what are pointers. But some are too stupid to use them correctly.
>>
>>55850812
Think of it like the whole program's memory space is one big giant array of bytes, and pointers are something you use to index that array of bytes (like array[ptr] = 5 or something similar)

A pointer isn't magic, it just tells you where something lives in memory.
>>
>>55850812
It's a variable that holds an arbitrary memory address meaning you can make it point to anything without worrying about locality of reference.

Most people use them to modify data structures directly.
>>
>>55850812
>These are the people I will have to work with
Jesus fucking christ.
>>
>>55850906
>tfw self-taught
>these are the people that are being hired over me

fuck everything
>>
>>55850812
Pointers to pointers are gonna fuck you up.

char ***out_strings;
>>
>>55850929
Triple indirection is so satisfying in C.
>>
>>55850812
>pointers r so hard

It's a fucking reference to a memory location. That's it. That's literally all it is.
>>
>>55850929
They're also going to fuck your performance up, senpai. Don't write that unless CPU cache misses are your favorite thing in the world.
>>
>>55850922
Maybe you should have gone to college instead of being smug, anon. People with five or six figures of non-dischargable debt tend to be good workers who don't want to get fired.
>>
>>55850820
it is in lambda calculus which is the base of functional programming.
>>
>>55850950
I know, but's very occasionally necessary.
>>
>>55850957
>lambda calculus ... is the base of functional programming
"No"
>>
>>55850972
What is, then?
>>
>>55850972
http://www.dbnet.ece.ntua.gr/~adamo/languages/books/p359-hudak.pdf
>>
>>55850851

Get a decent grasp on the basic concepts of neural networks and genetic algorithms. Play the creatures game series for a while.

Realize that if you do the simplest version it's not going to be too bad (Just apply weights and a fitness function to actions (Fight, Breed, Eat, Travel) / foods (Poisonous, Healthy, Junk, etc). It'll end up optimizing over time.) and that will make up the learned behavior of your creatures.

As for genetics a simple way is applying a colored shader effect base on a gene, applying the sprites / models that make up the creatures by genes, and controlling default behaviors genetically. In a simple version each gene just has a boolean value (Dominant or Recessive). In a complex version each gene has a table of other genes that it overwrites. When you mate creatures it just grabs random genes from both of them until you have a full genome and then mutates some of them a small percentage of the time.

This is a bare minimal version of that system though :P. If you really get interested it can get immensely complex really fast.
>>
>>55850957
>lambda calculus

Is a fucking meme to pure mathematicians, who make 300k starting.
>>
>>55851041
>pure mathmos
>300k starting
If they went to Cambridge (or equivalent), then maybe. For a few of them. Otherwise you're having a right giggle.
>>
>>55850990
Nothing
If it was the base of functional programming then all functional programming languages would have lambdas, yet none of them do.
(no, what most languages call lambdas are anonymous functions, not actual lambdas)
>>
>>55851041
yeah yeah we get it, big dicked alpha mathematicians do stuff way more complex than anything a computer scientist or a software engineer does. discrete math is easy, etc...

now fuck off
>>
File: dijkstra.jpg (70KB, 450x600px) Image search: [Google]
dijkstra.jpg
70KB, 450x600px
>>55851041
>pure mathematicians

Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.

guess who said that.
>>
>>55851080
If they're lucky, a pure mathematician will see somebody else find a use for his or her work before they die.
>>
File: jWWPolf.jpg (138KB, 702x768px) Image search: [Google]
jWWPolf.jpg
138KB, 702x768px
>>55851041
>pure mathematicians
>>
should i use boost?
>>
>>55851181
no
>>
>>55851181
fuck no
>>
>>55851181

Depends on what you're doing and if it is actually necessary.

If you need portability never use boost. It is never guaranteed to not break on some random platform and ruin your day.
>>
>>55850972
>>55851074
lambda calculus is the basis of most programming languages
>>
Can one implement monads in go?
>>
>>55851237
wrong
>>
recommend me good books for learning C#

I've already read Microsoft.Press.Microsoft.Visual.C.Sharp.2010.Step.by.Step.Mar.2010 and I pretend to read Head First C# next
>>
File: drag and drop programming2.jpg (96KB, 811x493px) Image search: [Google]
drag and drop programming2.jpg
96KB, 811x493px
Do you think that drag and drop programming will replace the arcane entry of text to describe logical structures?
>>
>>55851069
>>55851080
>>55851121
>>55851142

I had truly forgotten how easy it was.
>>
>>55851251
Perhaps

Perhaps one day we will program in terms of ASTs
>>
>>55851240
>no second order types
>no third order types
No.

>>55851245
wrong

>>55851251
Eventually.
>>
>>55851237
>programming languages
declarative programming languages.

languages based on statements like C, Fortran, ... are based on logical computing machine.
>>
>>55851251
we sell a scratch-like IDE at work, and let me tell you: no
>>
>>55851271
>wrong
Prove it
>>
>>55851253
Fuck you SharpShill

Go learn a functional language for once instead of your usual webshit

Even your mother is disappointed with your microshilling
>>
>>55851290
>>>wrong
>>wrong
>prove it

prove it
>>
>>55851296
Not interested, Pedro
>>
>>55851303
Done >>55848284
>>
>>55851271
Can one do anything in go? It seems to be impossible to implement any form of abstraction in it
>>
>>55851294

But I know lisp, and as we all know, it's functional.
>>
>>55851290
turing's computing model is based on statements (the infamous turing machine) while alonzo church's lambda calculus is based on expressions (declarative).

The creator of fortran made a famous paper about this when he received his turing award.
>>
>>55851327
It's like C but less pretty and more convoluted
>>
>>55851327
>go has pointers
>NO POINTER ARITHMETIC

what's the point then?
>>
>>55851337
It's dysfunctional
>>
>>55850812
I blame C/C++ syntax. Especially C++ that uses same symbol for references as for getting a pointer to a variable (referencing).

And it's the fault of C for using same symbol for dereferencing a pointer and specifying a pointer/creating a pointer variable.

Once you get used to stupid C/C++ syntax, it starts to make much more sense.
>>
>>55851350
According to its creator Rob Pike, it was created for people who aren't good enough to use real programming languages.
>>
>>55851337
Many don't consider lisp to be a FPL but its level of declarativeness (Dunno if it's a word) favor functional programming way more than the usual statement based PLs.
>>
>>55851374
that is the problem you have with C++ syntax?
that's dumb
there are plenty of good problems to have with it
why pick your inability to differentiate between references and addressing
>>
File: 1457218139896.png (340KB, 492x475px) Image search: [Google]
1457218139896.png
340KB, 492x475px
>>55848681
>Eclipse
>hangs when attempting to autocomplete
yeah no thanks

>>55850301
>C is a FP lang. prove me wrong, functional fags.
It doesn't even have list semantics. Actually, it doesn't even have list.
>>
>>55851381

When you realize lisp was designed by John McCarthy. Your validity drops exponentially.
>>
>>55851397
Im already comfortable with C++ now that I can write any program I want. Im just stating the biggest issue I had with C++ that shouldn't have to be an issue at all, which confuses many new programmers about pointers.
>>
>>55851419
What relevance has that to anything?
>>
>>55851452
>>55851381

>According to its creator Rob Pike

This section being invalid actually invalidates the whole post.
>>
>>55851505
It wouldn't matter if it was created by Fred fucking Flintstone, if he said the same things about why it was created. The point is that go was deliberately designed for use by lesser programmers.
>>
>>55851528

It does indeed matter who says it if you're claiming your statement was said by the designer.
>>
>>55851381
didn't ken thompson state that he made it because "c++ REEEEEEE"
>>
>>55851547
I'm paraphrasing what he said, but the message is the same. Go was created for programmers incapable of using regular languages
>>
>>55851181
That depends. You have to realize that Boost is a collection of libraries, not a single library written and maintained by the same people. Some parts of it are already somewhat obsolete with the new c++ standards, some of them are pretty useless outside of a niche cases and some of them are quite useful. It really depends on what you're trying to do.
>>
>>55851577

Anon it is very sad that you haven't realized I've completely substituted Go for lisp in these posts..

I believe in you though!
>>
>>55851603
>backpedaling and making shit up
>>
>>55851620

Not quite the intention was to troll from the start.
>>
The only reason not to use a functional language is if you're being paid based on how much code you write.
>>
>>55851652
or how fast it runs
>>
>>55851639
>I was only pretending to be retarded! lel epic master troll win
>>
Anyone got github links to some neat java projects?
I like checking out people's code to learn a little about good coding practices.
>>
>>55851661
OCaml runs as fast as C these days, try again loser
>>
>>55851661
Unless you're working on embedded systems you'll never get to make use of the time you spent learning C. Sorry mate.

Modern hardware means writing reliable software quickly is far more valuable than taking several years to achieve a similar result for borderline non-existant performance returns.

Next time learn a worthwhile language.
>>
>>55851652

Contrary to what many believe.. Overhead is still a existing problem.

Sometimes you really don't want or can't afford the extra memory overhead and the extra processing time.

>>55851672
> Green texting in anger. Goal clearly accomplished. You're feeding a troll anon.
>>
>>55851711
Fuck you, I'm enjoying my anger.
>>
>>55851689
>OCaml runs as fast as C
Nice bait

>>55851705
Holy shit, were you really this triggered?
>>
>>55851705
but you can learn Rust and have the best of both worlds: A cool systems programming language AND useful.
>>
>>55851743
>LOL u mad bro?

Nice retort, quality stuff.
>>
>>55851729

That is very nice anon. I'm enjoying my music and beverage. While I watch someone who clearly has frustration issues that needs healing.

Don't worry I'm sure that life will give you what you need to overcome the rage problems!
>>
>>55851761
>>or how fast it runs
>OMG
>ITS NOT FULLY USED UNLESS YOU'RE ON EMBEDDED
>ITS NOT EVEN WORTH IT BECAUSE RELIABLE SOFTWARE

but you're right
i forgot to add

>or how large it is
>or how much memory it uses
>>
>>55851764
>music
>beverage
What are you listening to and drinking?

Also rate yourself/10
>>
>>55851794

A mixture of meditation music and Coca-Cola. It's a nice combination for getting inn a mood to sleep after a long night.

10 / 10 I'm living by my choices without inflicting any non-trivial harm on others and that is all that matters.
>>
>>55849828
no insult plz
>>
>>55851843
How will you sleep after drinking branded sugar, salt and caffeine water?

Why not something gentle to ease you into dreamless, restful slumber, like a shot of vodka?

Also: I checked, posting that message caused the deaths of 10 polar bears due to their homes melting as a result of global warming caused by emissions from the power plants generating electricity that powers your computer.
>>
I have a circular buffer implemented with an array of size N.
I also have a counter C that counts how many times the circular buffer has been accessed.
Every time i access the buffer, i write to array[C % N] and increment C by one.

Does this mean if i increase N by resizing the array, the counter C will no longer point to the same value?
>>
>>55851887

Alcohol is for degenerates.
>>
>>55851964
Yes. Just plug in some values and check for yourself. 3 % 3 == 0, 3 % 4 == 3.
>>
>>55851964
Yes, if C >= N and you then increase N, in general C % N will now have a different value
>>
>>55851991
I am of European heritage. My body is designed to process alcohol.
>>
>>55852034

Your body is designed to resist a variety of poisons that you put in it.
>>
>>55851887

Anonn how do you know that I'm not running off solar right now? It is a real possibility.

As for animals dieing it could also be related to the polar shift we're slowly moving closer to that is a naturally occurring geological event that typically causes mass extinctions.

I enjoy the my sugar, salt, and caffeine water. Generally though I've been trying to eat as much natural preferably organic non gmo fruits, veggies, beans, and grains as I can afford. I've been trying to reduce my meat intake and keep it mostly to white meat.

Gotta get ready for when the economy goes boom. There isn't going to be very many sources of income.
>>
Is static linking bad?
>>
>>55851995
>>55852011
Is there any way of counting that doesn't depend on N?
>>
>>55852043
My ancestors derived a significant portion of their daily calorific intake from alcohol.
>>
>>55848284
>no racism
>no insult
>no sexual harassment
>no gender discrimination

how are you different from redd1t, faggot?
>>
>>55852084
Yes, it's the worst thing you can do.
>>
>>55852109
Why?
>>
>>55848284
Fuck off
>>
>>55852136
Bloat, slow, you need to replace all the programs when you update a library, etc
>>
>>55852091
I'm not 100% sure what you're doing but I think in general you want to keep track of where you are in the cycle by keeping a pointer to the object and using .next, .previous? Otherwise you could simply do:
C++;
if (C > N - 1) C = N - 1;
>>
>>55852107
>>55852142
>he still gets triggered by it
>>
>>55848412
>Interpreted language
>Any use of variables must request memory from the OS
>Must reinterpret loops every iteration
>Can't feasibly heavily optimize
>Using .NET
>Relying on large runtime frameworks and bytecode

Just learn C++ or some other compiled language. Java and C# have their uses, but people should at least understand what their computer is doing on a rudimentary level, eventually.

This should be required reading as far as I'm concerned.
https://people.freebsd.org/~lstewart/articles/cpumemory.pdf
>>
Working with JDBC
I have three SQL tables, Class, Student, and Class_Student.
Class_Student is a junction table.

First, I insert a new entry into Class. However, I also need to update the junction table to reflect a student that is in that new class.

Which means I need update Class_Student with the PK of the entry in class where class_name == a variable (name of the newly added class), and also the PK of the entry in Student where student_name == a variable.

I already have both of the variables loaded with the proper names so that's not the issue here. I'm just not sure what the actual SQL would look like to get this to work. I assume I need innerjoins but it's a while since I've done SQL
>>
>>55849828
epically memed on
>>
>>55852209
Any users understand 3d model formats.
Im trying to create a 3d model viewer but Im stuck at the last parsing step. Which is how do I create a transformation matrix from multiple weights.
Like do I just multiple the transformation matrices in order of the weights, or multiply their dot product their scale rotation and location.
>>
File: 1466236131822.png (211KB, 371x377px) Image search: [Google]
1466236131822.png
211KB, 371x377px
>>55851267
>asts
>not heterogeneous polymorphic abts
>>
>>55852326
I only know memes
>>
>>55852372
[MEME][++MEME];
>>
>>55852348
ASTs ARE heterogeneous polymorphic ABTs
>>
>>55852147
>Bloat
Space isn't an issue, nor is bandwidth.
>slow
That's not true. Static faster. In fact this is one of the benefits compared to dynamic linking.

What do you mean with your 3rd point?
>>
>>55848367
>Rewriting C in B.
Hardcore!

Speaking of rewriting. Does anyone please know where to get the old books with listings in BASIC? It would be cool to rewrite the gaems for C.

>>55848348
>>55848421
>hating on C

Here is your daily Java code example:

struct.def.mainchart.vrmm main()
poke.limit = pokelimit1
set:start_condition to === start.condition
{
{
{.
to screen.outdata -> text
prefix.start.memory.data.limit x01254-34(1)
garbage.collector = null
write.screen.outdata: ("Hello World!")\t\o\e
}
}
}


Enjoy!

>>55848506
>implying some *nixfag isn't already running all the in and out data via an Xbox server who analyzes evverything
>>
>>55851887
>defending against the soda jew
good lad
>drinking the alcohol jew
maybe not so much...
>>
well, C-ucks? >>55852552
>>
File: logically-fallacious.jpg (13KB, 201x301px) Image search: [Google]
logically-fallacious.jpg
13KB, 201x301px
>>55852659
What the fuck does C have to do with Docker? It was written in Go, you retard.
>>
>>55852708
Try reading the post again, cretin. Carefully this time.
>>
>>55852659
>Go
It's trash
Also, try libressl instead
>>
File: 1408698264354.jpg (24KB, 300x300px) Image search: [Google]
1408698264354.jpg
24KB, 300x300px
>>55852727
>javafags hating on C
>some shit program for logistics that no one cares about
>also Misfortune 50 companies
Who cares?
>>
File: arrrrrrrrrgll.png (11KB, 748x148px) Image search: [Google]
arrrrrrrrrgll.png
11KB, 748x148px
Perfectly calm...
>>
>>55852172
SELECT s.student_name, c.class_name
FROM Class_Student cs
INNER JOIN Student s ON cs.student_id = s.student_id
INNER JOIN Class c ON cs.class_id = c.class_id


Add any WHERE and ORDER BY clauses as necessary.
>>
>>55852912
Well maybe learn to ask questions then... You're probably one of those people that just paste a piece of code and scream "pls help it doesn't work"
>>
I wonder what would happen if stack overflow just suddenly disappeared.

All webdevs would suddenly be unable to do their fucking jobs because they're so incompetent.
>>
>>55853095
>>
>>55853178
that's the most basic thing you learn/are taught when learning some programming language. if you can't even google it, you should think about your interests
>>
File: 952.jpg (12KB, 203x303px) Image search: [Google]
952.jpg
12KB, 203x303px
>>55852912
http://xyproblem.info/
>>
>>55853178
This is the absolute most basic operation you can perform in pretty much any language ever designed.

It's ludicrously simple, especially in a babby's first language like Python. Either get your ass on Google and get a clue or find a new hobby.
>>
>>55853256
>>55853285
yeah well I did manage to google it, has to do with list comprehension

welp
>>
>Get new job
>A million lines of spaghetti code with no tests or consistent architecture
A sure way to make my love of programming go sour.
>>
>>55853178
Haskell
map (("This is "++) . (++"'s seat."))
>>
>>55853301
You can also do it in a loop if you think list comprehensions are too complicated, but I would assume list comprehensions or map to be the best method.
>>
>>55853178
let sentenes = ["Erik", "Bob", "Cindy", "Sally"].map({ "This is \($0)'s seat" })
>>
>>55853381
Pointless
>>
>>55853411
Is this Swift?
>>
>>55853423
Yes
>>
>>55853411
Hey everyone write something that does just this in your favourite language as long as it isn't Python.

string[] nameArr = new string[] { "Tom", "Dick", "Harry" };
string[] seatStringArr = nameArr.Select(x => $"This is {x}'s seat.").ToArray();
>>
How do I use an octree to optimize a tile based game?

Is it basically just a depth-1 octree with each node storing a "chunk" of tiles or is it some more complicated work involving only storing tiles at a certain depth?

Each tile is 8x8 in size and a chunk would have maybe 16x16 tiles
>>
>>55853451
see >>55853381

(("This is " ++).(++ "'s seat.")) <$> words "Tom Dick Harry"
>>
NEW THREAD NOW!

>>55853487
>>55853487
>>
>>55853451
let names = [ "Pajeet", "Deepak", "Ashish", "Pradeep", "Poo"]
let messages = names.map { "This is \($0)'s seat" }

I guess it's too similar to the other one. I really wouldn't do it differently.
>>
>>55853472
>tile based
Is it 2d or 3d?
If it's 2d you should be using a quad tree

Basically you have your whole world

xoxoxoxo
oxoxoxox
xoxoxoxo
oxoxoxox


and split it like this

xoxo|xoxo
oxox|oxox
---- ----
xoxo|xoxo
oxox|oxox


xo|xo| |xo|xo
-- -- . -- --
ox|ox| |ox|ox
-- -- . -- --

-- -- . -- --
xo|xo| |xo|xo
-- -- . -- --
ox|ox| |ox|ox
>>
What does sizeof(int) return? This is in C:
void show_int(int x)
{
show_bytes( (byte_pointer) &x, sizeof(int));
}

Is it the size of the memory address allocated for a type int?

I tried doing this in main:
printf("%i", sizeof(int));


But it doesn't like that because sizeof returns type long unisgned int, I guess.
>>
>>55853512
It's the number of bytes an int occupies
>>
>>55853451
You already posted it, mate. Or that looks just like C# 6 at least.
>>
>>55850301
the preprocessor is
>>55850679
not really, you'd be surprised. all those languages have great metaprogramming that helps eliminate repetitive code more than OOP can
>>
>>55853520
Thanks. If I wanted to print sizeof(int), how would I do that?
>>
>>55853622
print("%d", sizeof(int));
i'd imagine
>>
>>55853653
It gives a warning
warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
printf("%d", sizeof(int));


But it prints 4, which kind of confuses me. I use a 64-bit machine, so I thought int would occupy 8 bytes?
>>
>>55853512
>because sizeof returns type long unisgned int
sizeof returns a size_t.
%zu
>>
>>55853870
In your system int is probably 32 bit and long int is probably 64 bit.
Usually 64-bit refers to the size of an address.
On 64-bit systems, while int could be 64 bit, it is not in any system I know. Also, windows considers long as 32-bit even on 64-bit systems systems like FreeBSD, GNU/Linux, etc use 64-bit for long on 64-bit systems.
>>
File: 3lGw9Sx[1].jpg (143KB, 1324x364px) Image search: [Google]
3lGw9Sx[1].jpg
143KB, 1324x364px
>>
>>55853969
Fun as fuck.
>>
>>55853969
to be fair, calling the function that shows a line of text on the standard output "print" is something that very few people aged 14-20 would guess on the first try. Back when the term was invented and the standard output was literally a line printer it made sense, but nowadays it's a legacy term just like "core dump" (from the times when core memory was in use, and you dumped out those little core memory units to debug your program), or "user space" (from the time when mostly astronauts used computers)
>>
>>55854344
> "user space" (from the time when mostly astronauts used computers)
subtle bait, i like it
>>
>>55853411
>>55853178
I'm assuming the list is predefined, so try this -
["This is "+x+"'s seat" for x in nameList]


Make sure you set your own nameList variable.
>>
File: 1463640589054.jpg (6KB, 259x194px) Image search: [Google]
1463640589054.jpg
6KB, 259x194px
>doing a java swing application for uni
>want to place rectangles(JPanels) of different height directly underneath each other to adequately display a complex state of the software to the user
>find out that this is an unsolved problem in swing
>>
File: poorkaguya.jpg (49KB, 620x500px) Image search: [Google]
poorkaguya.jpg
49KB, 620x500px
>>55853875
>>55853936
Thanks, guys.
Thread posts: 329
Thread images: 38


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