[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 364 KB, 1024x768, Pelles_C.png [View same] [iqdb] [saucenao] [google] [report]
61919998 No.61919998 [Reply] [Original] [archived.moe] [rbt]

What are you working on, /g/?

Previous thread: >>61915702

>> No.61920029

Productivity tips? Currently:

>Having a sleep schedule (rise at 6 and go to bed at 10)
>Alternating between focused-work and rest (60 min for work, 30 min for rest) sessions
>Using Python and Make (free multithreading) for scripts (level generation from image) and C11 (need performance and too much of a brainlet for C++) for the game engine
>Sometimes using physical work (splitting logs) as rest from programming, but longer (90 min session for a full trailer). I think it's working just as well, maybe just as good as good as just resting, but you get perspired so that sucks.
>Reading random excerpts from C11 standard, OpenGL ES 2.0 guidebook, OpenGL ES 2.0 standard, GLSL 1.0 standard on free time when just can't think about programming anymore (it gets too much, maybe I don't like it as much as I thought I did, but it's too late to "search for myself" now, I'm fucking 20 already)
>Using Code::Blocks svn build (much fewer bugs and much faster) and IDLE as IDEs
>Dropped Lua because Python does its job (except for high-performance embedded game-engine scripting, but my little turd is very far from that) and focusing on Python
>Thinking about starting drinking coffee, maybe it improves focusing on code (or maybe I should look into aderall for a real thing?). So far not having any major bad habits (smoking, drinking, drugs) but this one might actually be beneficial.
>Got ~3.5 years to start my own company because then I get my university degree (software engineer) and if I'm not good enough to sell my own shit by then I'm officially a failure
>So far got some primitive matrix/vector math that I'm really using, nothing else, even algorithms (only BFS, DFS, backtracking and shit I have probably re-invented when I needed) in my head, maybe that's enough. Can't wrap head around physics with angular velocity (haven't really tried yet), for know I'm fine with "minecraft-like bit-array using primitive physics", access is O(1)

>> No.61920080
File: 19 KB, 242x320, 517856Y9FKL._AC_UL320_SR242,320_.jpg [View same] [iqdb] [saucenao] [google] [report]

Read PSP.

>> No.61920103

yeah physical work/exercise is good

stay hydrated

i drink coffee everyday BUT i would not recommend it unless you need to be focused for a specific activity at a specific time at the cost of getting more tired at other times

>> No.61920113
File: 309 KB, 801x511, 10.png [View same] [iqdb] [saucenao] [google] [report]

Trying to implement fresnel reflections in my c++ raytracer

Pic related is what I have so far, the triangle has a custom glossy BRDF

>> No.61920167

Learn Go:

>> No.61920221

what are the best php books out there? i hate php, but if i don't learn it i won't find a job

>> No.61920223
File: 121 KB, 1200x915, DHI3ogxXsAAvrRE.jpg [View same] [iqdb] [saucenao] [google] [report]

Learn Nim:

>> No.61920225

Rate my abstract Fizzbuzz:
#![feature(conservative_impl_trait, inclusive_range_syntax)]

use std::borrow::Cow;

fn fizzbuzz(until: usize) -> impl Iterator<Item = Cow<'static, str>> {//'
(1...until).map(|x| match (x % 3, x % 5) {
(0, 0) => "FizzBuzz".into(),
(0, _) => "Fizz".into(),
(_, 0) => "Buzz".into(),
_ => format!("{}", x).into(),

fn main() {
for fb in fizzbuzz(100) {
println!("{}", fb);

>> No.61920234

Any books that aren't specifically about a programming language but instead are more about more general computation such as algorithms, math (and programming too).

>> No.61920303

the chinese are better programmers than you and there's hordes of them, and they're cheaper. they're far from unintelligent, they just don't have a creative bone in their body. your webdev job isn't secure

>> No.61920336


-- if empty, just insert it
insert_last x [] = [x]
-- if not empty, insert it at the end
insert_last x (y : ys) = y : insert_last x ys

Haskell is cute! CUTE!

>> No.61920356

How do you pronounce clang, /dpt/? Cee-lang? Clang?

>> No.61920375


>> No.61920390

a bunch of Access VBA and SQL

i need a cup of coffee.

>> No.61920392


>> No.61920446

Try Sedgewick's Algorithms, Bhargava's Algorithms, Goodrich and Tamassia's Algorithm Design, Ron Rivest et al.'s Introduction to Algorithms, Knuth's The Art of Computer Programming, Kernighan and Pike's The Practice of Programming, Scott's Programming Language Pragmatics, Lang's A First Course in Calculus, Rorres and Anton's Elementary Linear Algebra with Application, Ross' Probability Models for Computer Science, Wiley and Wilson's Much about Calculus, Lax's Calculus with Applications and Computing.

>> No.61920451

What esoteric programming language is this?

>> No.61920462

You asked this in the other thread already

>> No.61920469

It's, may Allah forgive me for uttering such a word, Rust

>> No.61920479
File: 2.11 MB, 480x480, 1483552949697.webm [View same] [iqdb] [saucenao] [google] [report]

a good chinese programmer is going to move to a first world country or stay in china at a high tech company and take a large salary, the ones that would do outsourcing work for cheap would be the uneducated and malnourished peasants

you get what you pay for, as >>>/g/csg is very well aware of, you naive summer fuck

>> No.61920529

What's the best statically typed, compiled and portable language for general purpose stuff and interfacing with?

>> No.61920532
File: 6 KB, 321x321, 6fb707a35ccb7ae108a6c5e5a444df1b5f83731ec42cfcfa468c5a56e9781bff.png [View same] [iqdb] [saucenao] [google] [report]


>> No.61920534

Just use the W3Schools tutorial:

>> No.61920539

>No generics

No. Mastering C++ makes you the most productive, because it's the most versatile language. It can literally do everything.

>> No.61920541

sicp and hacker's delight

>> No.61920543

that's not true, though. the cost of living in china is much lower, and there's plenty of code monkeys who are quantitatively smarter than the average american coder. it doesn't pay much because creativity isn't valued there, so all of them do boring jobs like programming even if they don't like it. in america, generally only people who are drawn to programming do it. everything you say is fueled by emotion and what you want to be true

>> No.61920551


>> No.61920555

ok have fun outsourcing your website to the chinks

>> No.61920558


>> No.61920568

Who here working on machine learning implementations on any of their projects?

>> No.61920603

i'm not the one outsourcing anything. why are you angry at me? i'm just telling you the truth. there will still probably be web dev jobs, but it's going to be dealing with designing the website & requirements, maintaining, and testing the code written by other people. knowing a couple programming languages doesn't make you invaluable in the long term

>> No.61920610

R8 mine:
interface FizzBuzzable {
public int value();
public String doFizzBuzz();
final class FizzBuzzableNumber implements FizzBuzzable {
private final int num;
public FizzBuzzableNumber(int n) { this.num = n; }
public final int value() { return this.num; }
public final String doFizzBuzz() { return new Integer(this.num).toString(); }
abstract class DivisibleNumber implements FizzBuzzable {
protected final FizzBuzzable original;
public DivisibleNumber(FizzBuzzable origin) { this.original = origin; }
public final int value() { return this.original.value(); }
public final String doFizzBuzz() {
String fizzBuzzed;
if (this.isDivisible()) fizzBuzzed = this.fizzBuzzing();
else fizzBuzzed = this.original.doFizzBuzz();
return fizzBuzzed;
protected abstract boolean isDivisible();
protected abstract String fizzBuzzing();
final class NumberDivisibleByThree extends DivisibleNumber {
public NumberDivisibleByThree(FizzBuzzable origin) { super(origin); }
protected final String fizzBuzzing() { return "Fizz"; }
protected final boolean isDivisible() { return ((this.value() % 3) == 0); }
final class NumberDivisibleByFive extends DivisibleNumber {
public NumberDivisibleByFive(FizzBuzzable origin) { super(origin); }
protected final String fizzBuzzing() { return "Buzz"; }
protected final boolean isDivisible() { return ((this.value() % 5) == 0); }
final class NumberDivisibleByThreeAndFive extends DivisibleNumber {
public NumberDivisibleByThreeAndFive (FizzBuzzable origin) { super(origin); }
protected final String fizzBuzzing() { return "Fizz Buzz"; }
protected final boolean isDivisible() { return ((this.value() % 15) == 0); }

public class Main {
public static void main(String[] args) {
for (int i = 1; i <= 100; ++i) {
System.out.print(new NumberDivisibleByThreeAndFive(new NumberDivisibleByFive(new NumberDivisibleByThree(new FizzBuzzableNumber(i)))).doFizzBuzz());
if (i < 100) System.out.print(", ");

>> No.61920616

You're hired!

>> No.61920617

>i'm not the one outsourcing anything
ok have fun sharing your deep insight with us

>> No.61920622

Communists do better work because labor is appropriately valued in a Communist society.

>> No.61920640

the chinese aren't communists, they will gladly do the bare minimum that would be considered a website, and charge you more than it's worth

>> No.61920660

the best person to ask for an unbiased assessment of the future of an industry is surely someone who's just starting a career in that industry

>> No.61920682

you're naive like a child, you think a chinese slave laborer can do as good of a job in a high tech industry as an educated first-worlder

>> No.61920694

Yes they are, you dumb faggot.

>> No.61920701


>> No.61920748


fuck off clueless antifa scum

>> No.61920800

Also don't jerk off.

>> No.61920803
File: 44 KB, 650x366, zdgjtrsrtst.jpg [View same] [iqdb] [saucenao] [google] [report]

>businessinsider dawt cawm
>he actually thinks that's a credible source about foreign political economy

>> No.61920823

why, it's like 10 mins/days max if you're not too picky

>> No.61920824

you're going to get unmasked fag


>> No.61920836

you don't know much about china, watch the last half or so of this video

programming isn't a special, super difficult job which only white people with a 4 year degree can do well. ESPECIALLY web or app development. small children can learn how to do both of those proficiently, let alone chinese people who have to learn college level calculus and trigonometry in high school to pass their university admission exam

>> No.61920839

As opposed to?

>> No.61920843

LOL stay delusional

>> No.61920857

What website is that? I don't pointlessly march in the streets to get political shit done. I'm a dagger in the dark kinda guy, not one of the thousand swords at dawn.

You fags' problem is that you thought that we were playing chess.

>> No.61920877
File: 225 KB, 373x327, c9a.png [View same] [iqdb] [saucenao] [google] [report]


>> No.61920933

Not really, but little pussies like you won't ever understand real politics. You still believe that Trump was your victory.

>> No.61920939
File: 113 KB, 720x720, BnlzkhU.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.61921155


>> No.61921165


>> No.61921171

Do you have any more tired memes to share kiddo?

>> No.61921178


>> No.61921222


>> No.61922349
File: 13 KB, 375x375, 1490799370836.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.61922415

Hey /g/

I want to learn to program. Thinking about c# or java. Which of those should I pick?

>> No.61922442


>> No.61922456

between those 2? C#

>> No.61922511

C# is a better language but .NET core isn't very mature yet, so cross-platform support is limited unless you use something like Mono.

>> No.61922565

...you joke but there is a reason enterprise code is heavily layered and abstracted.

>> No.61923219

Anyone experience with CCXT crypto lib?
Or bittrex api?

Currently fetching data from bittrex and another exchange and very often run into urlopen timeouts, suspecting the api server are just overloaded but some other experience would be good

>> No.61924212

do i really have to use the stdint.h types

>> No.61924263


>> No.61924311


>> No.61924350


>> No.61924398

time to go back to /r/programmingcirclejerk with your nogenerics lulz

>> No.61924710
File: 924 KB, 600x336, govnocode.webm [View same] [iqdb] [saucenao] [google] [report]

>> No.61924771

t. buttplasted gopher

>> No.61924865

/g/ I have about one month before my first C/assembly class, which in my university is taught by a very hard grading, cunt teacher.

What is the best video tutorials I can go for C, pointers, etc. that can help me go through the class more easily? I have time. Thanks!

>> No.61924968

Just fucking go for it and if you have questions go to /sqt/. C isn't a hard language, it's just error prone if you're inexperienced.

>> No.61924983

Should I use GPLv3 or AGPLv3 for a library?

>> No.61924993
File: 95 KB, 1440x900, ida.png [View same] [iqdb] [saucenao] [google] [report]

Disassembling my mobo BIOS^WUEFI

>> No.61925041

You may as well not release it if you're going to use a shitty cuck license.

>> No.61925043

The Art of Computer Programming

>> No.61925073

anyone familiar with using glibc in assembly can tell me how to fix this segfaulting?
; Source name : BOILER.ASM
; Executable name : BOILER -- though this isn't intended to be run!
; Version : 2.0
; Created date : 10/1/1999
; Last update : 5/26/2009
; Author : Jeff Duntemann
; Description : A "skeleton" program in assembly for Linux, using NASM 2.05,
; demonstrating the necessary code to preserve and restore EBP, EBX, ESI,
; and EDI. The program does nothing and is provided as boilerplate for
; assembly projects that link to functions written in C.

[SECTION .data] ; Section containing initialised data
StartMsg: db "Start",0

[SECTION .bss] ; Section containing uninitialized data

[SECTION .text] ; Section containing code
extern puts
global main ; Required so linker can find entry point

push rbp ; Set up stack frame for debugger
mov rbp,rsp
push rbx ; Program must preserve ebp, ebx, esi, & edi
push rsi
push rdi
;;; Everything before this is boilerplate; use it for all ordinary apps!
push StartMsg
call puts
pop rax
;;; Everything after this is boilerplate; use it for all ordinary apps!
pop rdi ; Restore saved registers
pop rsi
pop rbx
mov rsp,rbp ; Destroy stack frame before returning
pop rbp
ret ; Return control to Linux

i stepped through with gdb and it gets to call puts fine. this is my makefile
timer: timer.o
gcc -o timer timer.o
timer.o: timer.asm
nasm -f elf64 -g timer.asm

i'm really fond of this assembly book i'm going thorugh, but he uses 32 bit and i can't find anything about this online. all the results are people trying to compile glibc binaries. i'm on the final chapter of the book

>> No.61925089

>shitty cuck license
>waaahhh I can't just take it for free and sell it in a proprietary product

>> No.61925125

You are absolutely delusional if you think big corporations give even the slightest fuck about your license. If your code is public, it's getting stolen. The chinks in particular give zero fucks.

>> No.61925140

The abi for x86_64 is different then x86, you can't just replace e with r. Parameters get passed in registers not on the stack.

>> No.61925161


>> No.61925166
File: 73 KB, 610x624, ulamspiral.png [View same] [iqdb] [saucenao] [google] [report]

I got SDL to draw an Ulam spiral.

keen eyes will notice that the pattern is mirrored & inverted, this is because I'm dyslexic...

>> No.61925168

do you have anything i can read about it?

>> No.61925184

>some people will try to steal your work
>so you shouldn't even bother trying to discourage it or give yourself a chance of legal recourse
what am I even reading

>> No.61925188

cool, thanks!

>> No.61925191
File: 767 KB, 950x536, Screen Shot 2017-08-01 at 8.10.41 AM.png [View same] [iqdb] [saucenao] [google] [report]

alexy pls

>> No.61925195

i wonder how hard programming actually is for dyslexics

>> No.61925218

why is there no real open-source alternative to ida
radare2 is awful

>> No.61925223

easier than for the blind and harder than for those with normal vision i assume

>> No.61925226

then help improve it

>> No.61925233

I'd prefer to start from scratch

>> No.61925237

If your goal is for lots of people to use your library then GPL actively harms it as many people do not want to use poorly licensed code that infringes on their freedom.

>> No.61925247


do you think so many game devs would be using ogg if it was GPL? no, they wouldn't

>> No.61925257

>b-b-but a P-PROPRIETARY program might u-use it!! m-m-muh free s-software!!!

>> No.61925260


good shit anon

>> No.61925286

If you want to use software I wrote in a proprietary product then pay me.

>> No.61925296

no thanks, i'll just take it anyway

>> No.61925319


>> No.61925323

The Chinese will take your code without paying for you anyway.

Might as well give American corporations the opportunity to do so as well. Unless you are a filthy chink.

>> No.61925332
File: 15 KB, 400x400, ulam.png [View same] [iqdb] [saucenao] [google] [report]

i did this in python long time ago too

>> No.61925346

>literally only six(6) cases of litigation being brought against someone who stole GPL code in ten(10) years
Please tell me you don't think that is even a miniscule fraction of the real number of proprietary software that uses GPL code.

>> No.61925371

Should I go back to school and get a degree in computer science? I don't know how to do shit and need to start making money but I got Joe Computer in my ear telling me that degrees are essentially useless. Help /g/

>> No.61925381
File: 13 KB, 758x155, GPLvBSD.png [View same] [iqdb] [saucenao] [google] [report]

We've already established in a previous thread that GPL is the real cuck license, not BSD.

>> No.61925390


>> No.61925399

I never thought about it this way

>> No.61925409

>opt to get fucked by twice as many entities

>> No.61925434

The obvious solution is to never get fucked at all and never open source anything. "Free" software is a form of political correctness designed to shame Americans into releasing their property so the Chinese can get easy access to it.

>> No.61925451

What is the difference between MIT and BSD?

>> No.61925466

>helping your country
>helping a foreign country

>> No.61925469

>caring about who uses your code
>not just releasing it into the public domain where possible

>> No.61925474

>not taking it from anybody who will give it to ya

>> No.61925488

Too poor to buy tools, too lazy to write one's own tool, and proud to admit to that state of affairs is a very unappealing combination, thief-wannabe anon.

>> No.61925493

the ISC license is almost this

literally the only thing it says is "don't claim you made it and don't sue us"

>> No.61925498

Has anyone ever used TinyXML in C++? I'm getting a weird error, and it only happens after I use TinyXML. The error is completely unrelated to the actual TinyXML code, but if I don't call any TinyXML functions, the error doesn't happen.

>> No.61925500

Any assemblyfags here? Which one was the most interesting to you: x86, MIPS, ARM,PPC or Sparc?

>> No.61925501

The part you don't understand is copyright laws are actually enforced here, unlike in China.

>> No.61925508
File: 297 KB, 1200x1500, wtfpl-strip.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.61925517


>> No.61925522

Yeah, but where is MIT in that?

>> No.61925530

i don't care, moralfag

>> No.61925533
File: 9 KB, 190x200, what the fuck am i reading.jpg [View same] [iqdb] [saucenao] [google] [report]

>only Chinese businesses can steal your code

>> No.61925565

It's the same as BSD, but sharply dressed and with the filter of the cig on the proper side.

>> No.61925566

6502 is too simple. I want to learn a modern powerful processor.

>> No.61925596
File: 176 KB, 1000x1000, adv-china.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.61925624

dumb frogposter

>> No.61925647

Do I need to include the javadoc-like comments, which describe what a function is and does, both in the header file and in the source file of a single header library? or do I only need to include these in the header file?

>> No.61925650

US copyright law doesn't hold in China

>> No.61925679

Do you think the US is the only country with copyright laws?

>> No.61925692

China doesn't care about any of them

>> No.61925700

China doesn't adhere to any copyright laws

>> No.61925730

So China's a writeoff. That leaves Canada, Europe, Australia, and lots of other countries besides the US.

>> No.61925754

Unpopular confession: I don't count Python or JS experience as real programming experience when looking at resumes

>> No.61925755

Is Erlang useful for anything if you don't have a large number of data centers?

>> No.61925764


>> No.61925765

We need more people like you. Only a small portion of Python code isn't pajeet-tier.

>> No.61925772

If you care about writing correct code that fucking works.

>> No.61925796
File: 701 KB, 1361x888, adv-china-1.png [View same] [iqdb] [saucenao] [google] [report]

>not getting a chinese wife

>> No.61925870
File: 7 KB, 142x352, VirtualBox_ASM_15_08_2017_20_17_09.png [View same] [iqdb] [saucenao] [google] [report]

I'm still trash at asm /g/. Can someone tell me why it's not printing? Using nasm

>> No.61925876

This is fucking awesome

>> No.61925900

Pray tell

>> No.61925910

is this AT&T syntax?

>> No.61925916

what's your environment even

>> No.61925917

That's Intel syntax.

>> No.61925932

because it looks to me like you're jumping to the end if 40 is greater than 20

>> No.61925934


64 bit Ubuntu virtual box vm w/ nasm

>> No.61925950

what even are you?


>> No.61925955

>The first rule of C is don't write C if you can avoid it.

>If you must write in C, you should follow modern rules.

stopped reading there. bet he shills for rust. you're not going to fuck anything up by writing bad C code when learning, and if you have a job writing C, you're going to be writing C how THEY want with THEIR style guide, not what this dickhead says is the right way

>> No.61926081

oh shit I'm stupid let me try again. ASM is hard to get used to.

>> No.61926183

i think that's what your problem was, because cmp op1,op2 does the equivalent of op1 - op2. you can use gdb to test this type of stuff. i use ddd as a graphical interface

>> No.61926184

this may sound retarded but i looked at the stdint.h file on linux and i saw that it redefines most of the types to be the "correct" ones anyway

is it safe to assume this will be true for stuff that doesn't use glibc?

>> No.61926188

Wrote a program to scan every IP in my country for vulnerable printers

lel, prepare yourselves normies

>> No.61926192

Your response times are getting worse, NSA.

>> No.61926196

i'm not in the NSA asshole

>> No.61926199

The reason you should avoid C is because a bug in any other language is just that, a bug, while in C a bug means a massive security breach.

>> No.61926208

you've drank koolaid if you believe that

>> No.61926216

shodan exists dude

>> No.61926218

>p-pls keep using innately insecure software, anon
>trust me, I'm t-totally not NSA
Sure you aren't.

>> No.61926229

I don't believe that, I KNOW that for a fact.

>> No.61926234

I'm making a game using SDL. I have a TextField class for displaying text. TextField contains a member variable fontFile, which is a string containing the path to the font.
After I use TinyXML, I get errors where the fontFile variable will become null, and also the text will randomly disappear and reappear. These errors do NOT occur if I skip using TinyXML.

>> No.61926243

when you 'know' something untrue it's called delusion, not fact

>> No.61926282

I know, and the corollary of that is that you are either deluded or, like I said before, an NSA disinformant shill. Stay mad, NSA shill.

>> No.61926350
File: 505 KB, 707x1000, astolfo 920.jpg [View same] [iqdb] [saucenao] [google] [report]

Can you write a program that generates all possible IP addresses in the IPv4 address space?

>> No.61926400
File: 153 KB, 321x290, will_summer_ever_end?.png [View same] [iqdb] [saucenao] [google] [report]

>can you write 4 nested loops?

>> No.61926407

You'd be surprised how many people can't pull this off.

>> No.61926422

Just like Fizzbuzz right?

>> No.61926427

I for one am developing a language on top of a freestanding environment. No dependencies other than Linux system calls.

The stdint types are a godsend. Since I don't have to deal with junk like libc's functions, I don't have to use legacy crap types like int, ever. I don't have to deal with printf. I'm free. I'm like a god, erecting even the most basic features out of nothing. Freedom from the legacy of libc, of stupid str* functions. I typedef'd them to shorter, linux kernel style names like u8, u64, but that's just cosmetics.

Linux's system call interface uses long, but really, deep down its just whatever type whose sizeof == the processor's native register size. Why? Because the system call arguments get shoved into a bunch of specific registers, so any type with at most that amount of bits will work. On x86_64 it's 64 bits, so I simply used uint64_t for the system call interface. It works beautifully.

>> No.61926452
File: 7 KB, 229x349, VirtualBox_ASM_15_08_2017_21_08_26.png [View same] [iqdb] [saucenao] [google] [report]

Heck yeah I understand now. Thanks anon. I misunderstood now cmp does comparing. It's Dest - Source not source - dest

>> No.61926462

dst, src will almost always be the order in asm (and even c)

>> No.61926475

yeah I don't know why I thought otherwise

>> No.61926479

good now that's enough assembly for you. C is unsafe enough

>> No.61926490

except for AT&T syntax you'll find in c programs assembled by gcc

>> No.61926497

As expected of a degenerate trap poster.

>> No.61926512

Has anybody here ever written a compiler?
Show it!

>> No.61926514

not using
>objdump -d --disassembler-options=intel
like a sane person.

>> No.61926530

My professor said software engineering is not about programming.

is he right?

>> No.61926565

Very. Now take in the idea that programming isn't about learning programming languages.

>> No.61926566

Computer programming languages are just one tool in your arsenal for building software.
Claiming that software engineering is about programming is like claiming construction is about hammering nails.

>> No.61926576


I used to date a girl who was half Chinese. She was manipulative and emotionally abusive, and turned into a lunatic in the end.


Actually, bugs in other languages are just as easily capable of being security vulnerabilities. There are plenty of ways to gain access to a machine other than corrupting memory. Last year I participated in the International Capture the Flag -- which involves patching up vulnerabilities in some machine you are given while exploiting those of other teams -- with a cybersecurity class I was taking. I finding and patching up 2 vulnerabilities for my class during our timeslot, both of which were in Python programs.


It can be done in a single loop!

(0..IP_MAX).each do |ip|
d = ip & 0xFF
c = (ip >> 8) & 0xFF
b = (ip >> 16) & 0xFF
a = (ip >> 24) & 0xFF
puts "#{a}.#{b}.#{c}.#{d}"

>> No.61926587


>I finding and patching
Meant to say "ended up finding and patching"

>> No.61926601

he said software engineering is not about programming in the sense that as a SE you'll work with requirements, diagrams who describe code, etc.

programmers convert those diagrams into code, that's the task of coding, which isn't the same as programming.

programming was more common in the 80's when out software wasn't that complex, and we didn't need SE

>> No.61926603

Did she eat dogs?

>> No.61926629

this sounds like grasping at straws

you're still a goddamn code monkey at the end of the day unless you're the lead dev and in charge of architecture

>> No.61926669


No. Fortunately she was very much a dog person and thus would not eat one.

>> No.61926688

>very much a dog person
ah yes the infamous 'dog woman'.

>> No.61926693

literally bestiality.

>> No.61926701

What about hotdogs?

>> No.61926737

he's right
people are already outsourcing code and it'll just keep increasing. why pay a monkey $60k/y instead of $12k?

>> No.61926801


Probably. I don't think I've seen her eat one though.

>> No.61926903

>why pay a monkey $60k/y instead of $12k?
At least at my old company, because the 12k/y code monkeys threw enough shit around while screaming to drive them into bankruptcy. I'm not saying keeping the in-house team would have saved them, but the software components didn't start dragging them down until after they started saving money on monkey chow.

>> No.61926908

I've seen this no less than five times and I still have no idea what govnocode means

Is it an 'Ello, Govna! reference? I have no fucking clue

>> No.61926920

Looking to learn coding from scratch to find work (without diplomas) and also creating games in the future.
Best languages to learn? (Java, C, Javascript and HTML?)

Best sites to learn+exercises for beginners? Is Sololearn ok?

>> No.61926943


Govno is Russian for shit.


>> No.61926990

in china, 12k usd is a well paying job

>> No.61927008

in china woman is for rape

>> No.61927009

Too bad that's 1/2 the poverty line in the US.

>> No.61927038

This kind of site would never work in the west, codemonkeys refuse to admit they're shit programmers and would never post snippets of their own code to make fun of themselves.

>> No.61927039

costs less to live in china and labor is cheap

>> No.61927062

>in china woman is for abortion or given away for adoption

>> No.61927069

Someone post the "you dont want to learn mandarin" pic

>> No.61927086

..the daily wtf was popular for years and years..

>> No.61927126

what language is this? care to explain?
t. noob

>> No.61927132

It may have been a well paying job, but that payment got the company neither a good job, nor a job well done.
It's only one data-point, but "penny wise and pound foolish" didn't become a cliche by never being applicable.

>> No.61927136


>> No.61927159
File: 946 KB, 1400x5552, DontLearnMandarin.png [View same] [iqdb] [saucenao] [google] [report]


Hunted around on RebeccaBlackTech just for you

>> No.61927338

Makes me rage every single time
If you guys want more read "poorly made in china" book, it's literally the "work yourself into a rage" book

>> No.61927402

r8 mine

flist = [1..100]

fb n | mod n 3 == 0 && mod n 5 == 0 = "FizzBuzz"
| mod n 3 == 0 = "Fizz"
| mod n 5 == 0 = "Buzz"
| otherwise = show n

main = do mapM_ putStrLn (map fb flist)

>> No.61927404

James, you shouldn't take about your ex-gf like that.

>> No.61927417


>> No.61927455
File: 9 KB, 200x224, 1502215668338.jpg [View same] [iqdb] [saucenao] [google] [report]

>mod n 3 == 0 && mod n 5 == 0

>> No.61927492

whats the most sane data types for working with arrays of images and associated filenames in java, /dpt/?

>> No.61927639
File: 388 KB, 435x437, miku cock.png [View same] [iqdb] [saucenao] [google] [report]

If you value space efficiency, you'll make a flat array of pixel structs and access individual pixel data like so
img->arr[(img->height * i) + j]

>> No.61927648

how to write this javascript code in less lines or a functional way
function handleQuery(e, q, s) {
if ((e.keyCode || e.which) == 13) {
window.location = "https://" + s + ".com/" + q;

>> No.61927682

>Image[] images
>String[] filenames
>same index for both filename and image

>> No.61927683

I meant packed shorts containing pixel data

>> No.61927735

i value my time more, this code wont ever be used for anything

also my main concerns are simply reading and writing them from network locations to local storage.

sorry, should have specified im working with images on a network location i need to read. its been years since i last wrote anything in java.

>> No.61927871

You can't, it's all object oriented from the get go. I'd say return the URL instead of changing window.location from the function so that the caller can decide where the URL goes.

>> No.61927929

it's for a small box that you input the twitter user name click enter and goto to that twitter user page
changed to

function handleQuery(e, q, s) {
window.location = "https://" + s + ".com/" + q;

i think this way you can write a one liner, but now sure how

>> No.61927955

Hi I fixed your code for you!

*((*img).arr + ((*img).height * i) + j)

>> No.61927967

are you running low on newlines? why do you want that to be a one liner?

window.location = `https://${s}.com/${q}`;

>> No.61927972

congratulations it's the same thing

>> No.61928000

congratulations, it's uglier and harder to read!

>> No.61928005

test.c: In function ‘main’:
test.c:9:41: error: invalid operands to binary % (have ‘double’ and ‘double’)
printf("%f\n", (((2.0*pi)/360.0)*i) % (2.0*pi));
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~

how do I make a float map between say [0, 2pi] if it rolls over or under the endpoints?

>> No.61928020

meh. i always write js functions like that and saw people writing shit like


and wanted to write this way too

>> No.61928038

% is an integer operator - use fmod or fmodf for doubles or floats.

>> No.61928043

>are you running low on newlines?
This so much. Once you realize that no one is charging you per line printed any more, code gets so much easier to read.

>> No.61928110

should not the compiler be able to tell that I wanted to use the floatfloat operator?

>> No.61928151

C, with rare exceptions, doesn't fix shit for you. One cost of getting only what you ask for is that you have to spell out what you want.

>> No.61928261

To add onto this: In a strictly type language, the compiler can/will assume more about your code because of the strict contracts. C is weakly typed (and most legacy C is barely typed..) so the compiler doesn't know if you wanted an implicit truncating conversion or an actual fmod. Would it fine if it truncated your two doubles to ints (or coerced them..) because you used an integer infix operator? What if you had two floats and it promoted them to doubles (to be used with fmodf?) even if you wanted to use an integer mod to coerce / truncate to ints? (because your architecture can't do hardware doubles, etc).

Its better to have it as an error, than a subtle bug.

>> No.61928281

>still believing this meme
lmao goes to show you what crazy shit people will believe

>> No.61928324

Where's the best place to host my personal website?

>> No.61928333


>> No.61928337

github gives you free web space so long as you make it a public repo

>> No.61928345

digital ocean or ovh

>> No.61928347


>> No.61928375


>> No.61928554

well I suppose that makes sense. Thanks.

>> No.61928654

>decorator that replaces behavior
3/10 at least it works

>> No.61928697

ovh, cheap servers with unlimited* bandwidth and decent specs

* I believe you get 10TB of bandwidth in practice because your speed gets capped afterwards

>> No.61928752

Yes. The reason is enterprises measure developer productivity in number of lines of code written.

>> No.61928829

lmao, this does not actually happen. Even the most incompetent of management realizes that metric is goddamn awful

>> No.61928836

You clearly haven't worked in this industry long enough.
Code is expendable, developers are a liability, developer time is expensive.

>> No.61928842

>expecting anyone in the dpt to not be a NEET

>> No.61928874

How is overproducing/bloating to meet an inflated SLOC metric beneficial for >WE NEED TO GO TO PRODUCTION NOW
That doesn't sound agile or _extreme_ to spend an order of magnitude more time writing fizzbuzz enterprise edition than it would to do it in a naive fashion.

(I think you missed the GP stating that the industry doesn't measure productivity as SLOC but rather features (poorly) implemented/shipped)

>> No.61928908

if your company starts using total lines of code as a software metric, it's time to leave.

>> No.61928924

Admittedly, my work was in embedded code on DSPs and some systems that coordinated the DSP based boards work, but productivity was always measured by how much progress had been made in implementing the requirements, not by how many lines of code had been written.
There's never time to do it right, but there's always time to do it over, after we ship it. Scotty is the only engineer who ever made under promise over deliver actually work.

>> No.61929149

Everything he says in that article is correct.

>> No.61929362


> made a shitty chatbot for omegle
> people spend 10+ minutes talking to it
> it's better than me at this
> I could be harvesting kik/skype contacts if I wanted

>> No.61929377

whats the least painful way to read the contents of a text file in local storage on android? this is taking the piss

>> No.61929392

get a real computer

>> No.61929443

android dev senpai, doing anything in java is a fucking pain

>> No.61929465

Is PyQt good?

Is it difficult to insert old school desktop UI widgets like field-sortable tables in Kivy?

>> No.61929518
File: 334 KB, 2472x820, Screen Shot 2017-08-15 at 11.23.32 PM.png [View same] [iqdb] [saucenao] [google] [report]

Alright... I'm stumped.

I am able to dereference the pointer to a "Digit" (data structure containing a short and two pointers, a doubly linked list) -- I print out the pointer in the call to "PrintAddresses(L_Int)", but when I do the call to printf, I get a seg fault, despite the pointer being able to be used.

I have no fucking clue what to do anymore

>> No.61929640
File: 70 KB, 514x648, 0321133048.jpg [View same] [iqdb] [saucenao] [google] [report]

Pic related. A background in calculus and linear algebra is recommended.

>> No.61929652

Is anyone good with C++?

I'm writing something like an interpreter (symbolic execution) and I have a template 'SymbolicVariable' class that the different types inherit from (i.e. 'SymbolicDouble : public SymbolicVariable<double>)

My problem is now that I need to have different types in the same map. I thought you could just have a map of the template superclass but this is not allowed.

I know this is a longshot. Thanks in advance for any advice!

>> No.61929685

Does anyone have much experience with Win32 API (no MFC, ATL, WTL, etc.)?
I have an application that is behaving strangely. I reduced it down to a test application and it works perfectly there.
It just resizes a listview (report) with two columns, and has the right column align to the right.

(sample code)
void Fit(const HWND parent, const HWND hwnd) {
RECT rc{0};
GetClientRect(parent, &rc);
MoveWindow(hwnd, 0, 0, rc.right, rc.bottom, true);

GetClientRect(hwnd, &rc);
LVCOLUMN lvc{0};
lvc.mask = LVCF_WIDTH;
ListView_GetColumn(hwnd, 1, &lvc);

ListView_SetColumnWidth(hwnd, 0, rc.right - lvc.cx);
ListView_SetColumnWidth(hwnd, 1, LVSCW_AUTOSIZE_USEHEADER);

switch (msg) {
case WM_CLOSE: PostQuitMessage(0); break;

case WM_SIZING: Fit(hwnd, GetWindow(hwnd, GW_CHILD)); break;

default: return DefWindowProc(hwnd, msg, wp, lp);

return 0;

And in my real code (which is in C++ -- this was working last night, but today, after moving some stuff around and running a formatter over the code it broke.):
void FileList::FitListView() const {
RECT rc{0};
GetClientRect(hwnd_, &rc);
MoveWindow(listview_, 0, 0, rc.right, rc.bottom, true);

GetClientRect(hwnd, &rc);
LVCOLUMN lvc{0};
lvc.mask = LVCF_WIDTH;
ListView_GetColumn(listview_, 1, &lvc);

ListView_SetColumnWidth(listview_, 0, rc.right - lvc.cx);
ListView_SetColumnWidth(listview_, 1, LVSCW_AUTOSIZE_USEHEADER);

LRESULT FileList::DispatchEvent(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
switch (msg) {
case WM_SIZING: this->FitListView(); break;
// ...
default: return DefWindowProc(hwnd, msg, wp, lp);
return 0;

ListView_SetColumnWidth is returning false in my real code, and I can't find anything on the internet that explains why it'd return that.

>> No.61929723
File: 152 KB, 400x400, co.png [View same] [iqdb] [saucenao] [google] [report]

In C++, you cannot have well-typed hetrogenous containers.
You have 3 choices:
Ensure the classes you want to store together have a base class, and store a collection of pointers to that, dynamically casting as needed.
Cast to/from void * and kill yourself.
Use a different language.

Personally I'm a big fan of 3, but since I have to use C++ at work you generally just work with the design and introduce a bunch of useless classes.

>> No.61929734

..ran out of spaace
And using that C Fit() method in the C++ code doesn't work either. It'll resize the listview to fit the parent window, but it won't resizes the columns.

..actually, disregard. Its something wrong with the code in the //.. part of the wndproc. Namely in my WM_NOTIFY.. Does anyone know why this WM_NOTIFY will cause the Listview to not resize its columns?

case WM_NOTIFY: {
const auto pnmlv = reinterpret_cast<LPNMLISTVIEW>(lp);
if (pnmlv->hdr.hwndFrom != listview_) {
return 1;
switch (pnmlv->hdr.code) {
case NM_CLICK:
auto item = reinterpret_cast<LPNMITEMACTIVATE>(lp);
if (item->iItem != -1 && (item->uNewState ^ item->uOldState) & LVIS_SELECTED && index_ != item->iItem) {
index_ = static_cast<size_t>(item->iItem);
default: break;
} break;

(that just runs a callback and stores the index of a selected item in the list)

>> No.61929737

Graham, Knuth & Patashnik’s Concrete Mathematics

>> No.61929787

And disregard again. It seems like this was basically a case of rubber duck debugging. The return '1' from WM_NOTIFY was intercepting LVN_GETDISPINFO or LVN_SETDISPINFO. I don't actually know which message was being blocked, but since the column's (was it the row?) hwnd didn't equal the listview hwnd something was getting blocked. Making that a break fixed it all.

Win32api is shit.

>> No.61929982

Anyone here like Go?>I kinda like it.

>> No.61930314
File: 30 KB, 1012x646, ignorance_is_strength_by_kitten_boy.png [View same] [iqdb] [saucenao] [google] [report]

I am trying to add a gui to my alarm clock.

Whats the best option for me here?

>> No.61930334

>using golang
It's like you enjoy getting cucked.

>> No.61930373

Creating console apps is so much more comfy. I used to make a GUI for all my shit even though i'm the only one who ends up using the app anyway usually and GUI making is a fucking tedious nightmare
feels good to be free

>> No.61930415

>emily [email protected]
I think you need to fuck off

>> No.61930430
File: 44 KB, 636x616, smug_haskell_programmer.jpg [View same] [iqdb] [saucenao] [google] [report]

>being this mad

>> No.61930438

>not really

>> No.61930444

>lying this badly

>> No.61930447

>An aggressive attitude on 4chan means that they're mad
Get lost, newfag.

>> No.61930458

>being this new
I think you're the new fag

>> No.61930465

Sorry. It was a joke from yesterday. It was my first time in the general and I couldnt get the code thingy to work. Some one told me to "register my user" by posting my email+name+password in the name field.

I never removed it.

I hope this is better now, though not really a reason to get so angry.

>> No.61930477

Hang yourself, stupid animelover.

>> No.61930510
File: 29 KB, 257x320, smug_loli.jpg [View same] [iqdb] [saucenao] [google] [report]

>being this mad
You guys really are new

>> No.61930817

And if you're interested, the Laravel framework gives you things like ORM, MVC.

Very easy to build shitty web apps with it.

>> No.61930836
File: 83 KB, 960x768, blue fish.jpg [View same] [iqdb] [saucenao] [google] [report]

I like programming, it is fun.

>> No.61930857

How do wait for async function in c# to finish?

Like let's say i have var poo = GetListOfPoopTypesAsync();

And i need the rest of the code to execute after i get the list, since i need to work with that list. And I looked at the thing doesn't provice non-async variant of that function

>> No.61930863
File: 144 KB, 1176x1000, 1446975741254.jpg [View same] [iqdb] [saucenao] [google] [report]

Is this the proper way to generate WAVE files?
I feel like I'm doing this in a backwards way.
#define SAMPLES 10000000
#define RATE 44100
#define CHANNELS 2
#define BITS_PER_SAMPLE (sizeof(short) * CHAR_BIT)

struct wave {
char id[4];
int size;
char fmt[4];

struct fmt {
char id[4];
int size; /* size of everything below */
short fmt;
short channels;
int samplerate;
int byterate;
short blockalign;
short bitspersample;

struct data {
char id[4];
int size;
short *bytes;

int main(void)
struct fmt subchunk1 = {
"fmt ", sizeof(struct fmt) - 8, 1, CHANNELS, RATE,
struct data subchunk2 = {
struct wave header = {
"RIFF", (subchunk1.size + 8) + (subchunk2.size + 8) + 4, "WAVE"
fwrite(&header, sizeof(struct wave), 1, stdout);
fwrite(&subchunk1, sizeof(struct fmt), 1, stdout);
fwrite(&subchunk2, sizeof(struct data) - sizeof(short *), 1, stdout);

>> No.61930871

I don't like you.

>> No.61930882

call await?

>> No.61930895

Thanks a lot!

>> No.61930914

Do i look like stallman? I have no idea how to do that shit yet

>> No.61930943

You've basically got the right idea. You could generate those fields more programatically, and handle shit like multiple channels and different sample rates and bitrates more easily, but if you don't need it, don't bother.
Also, using the stdint.h types might be more appropriate.

>> No.61931069

async/await is very simple to use:
// ignore this, just waits for 5 seconds then returns an int
public Task<int> GetAsync() => Task.Delay(5000).ContinueWith(task => 42);

// for you
public async void Work() {
var foo = await GetAsync();
// this'll wait for 5 seconds then print 42

The rest of the method context technically will be placed in a continuation and won't run until the previous await is done.

>> No.61931092

Is there an efficient way to ger averages over multiple dicts in Python?

I have a few dicts, all of which have the same structure:
{6: float, 7: float, ... 23: float

now i want to get the average for each Key in all of the dicts. is there some easy way for this?

>> No.61931122

You mean you want to average the keys or the values?

>> No.61931143


I want to average the values of each key
I found something on stackoverflow though

>> No.61931394
File: 40 KB, 620x413, 1501869639061.jpg [View same] [iqdb] [saucenao] [google] [report]

How do I use php to send a get request to Google Images (say the first 3 images) based on the values of an address field in a contact form and then show those images inline in an e-mail ?

Note: I need to do this within Wordpress...

>> No.61931707
File: 186 KB, 362x560, ruby_waifu.png [View same] [iqdb] [saucenao] [google] [report]

>not using Ruby
It's like you don't want to be productive. Python is shit.

>> No.61931804

>tfw can't free myself from the botnet

>> No.61931828

It's a barrier people need to overcome to start using your software.

>> No.61931837

How do you make your non-malicious apps not be blocked by AV?

>> No.61931860

That's a question that security researchers have been trying to answer for decades.

>> No.61931877

Python has more concise syntax and richer ecosystem, but to each its own i guess

>not making your shit a separate lib and make cli or gui as needed

>> No.61931885

>have it OS or distributed through a reputable source
>most people know its a false positive

Didnt know people still used AV's

>> No.61931893

How does Python have conciser syntax than Ruby? Python's philosophy is literaly "Explicit is better than implicit", while Ruby is all about being /comfy/ for the programmer, so you don't need to do a lot of syntactic bullshit like Python does.

>> No.61931902

>just making libs
I approve of making libs but for software releases you need to give people opportunity to trial it.

>> No.61931921

Haven't released popular software then. I get emails. It's annoying.
I was more thinking about the less general case. Is there something common that in general triggers them? I'm not doing any self-modifying code or other 'suspicious' behavior at all to my eyes. So I'm wondering if anyone knows what common pitfalls are.

>> No.61931922

so you relase lib with one interface with possibility to add other in future

a g i l e

>> No.61931954

Does this mean anything specific or is it just stating the obvious, that having code be malleable is good.

>> No.61931959

Most consumer AVs are just signature-based garbage.
The AV companies have seen the malware before, so they just flag it if they see it again.

>> No.61931981

just reminding the obvious

>> No.61931991
File: 136 KB, 1244x927, 1502847807281.jpg [View same] [iqdb] [saucenao] [google] [report]

>> No.61932003
File: 18 KB, 630x325, Agile-model.jpg [View same] [iqdb] [saucenao] [google] [report]

I prefer to say code malleability because it's less confusing. Agile has connotations like agile development model.

>> No.61932015

Doesn't windows let you switch to Japanese localization for specific apps only?

>> No.61932043


>> No.61932120

Trying to get back into assembly. What is wrong with my code( yes this is running in real mode). It just won't print anything.

; boot.asm
mov ax, 0x7c00
mov ds, ax
mov ss, ax ; stack starts at 0
mov sp, 0x9c00 ; 200h past code start
mov si, msg
call print
jmp hang
print: ; si is string
mov ah, 0x0E
mov bx, [si]
or bx, 0
je return
mov al, [si]
int 0x10
add si, 1
jmp print_main
jmp hang

msg db "Print Hello", 13, 0
times 510-($-$$) db 0
db 0x55
db 0xAA

>> No.61932145

I just saw the typo. It is jz not je. I changed it but it still didn't work.

>> No.61932340

How would I start learning programming windows applications?

I'm a completely beginner.
I've tried several tutorials but I find it very hard.

Languages i've tried are: Java and Python.

>> No.61932355

Forgot to add this.
I want to implement a GUI in the programs I want to create.

>> No.61932357

Learn C#. It doesn't differ from Java much.

>> No.61932366 [DELETED] 

new thread:

>> No.61932368

New thread:


>> No.61932373

nvm use this >>61932368

>> No.61932382

Why? Java is cross-platform and has a native GUI library.

>> No.61932442

AL = Character, BH = Page Number, BL = Color (only in graphic mode)
bx should be zero (if you did not change the page that is).
You putting word into bx anyway, not a byte.
je and jz is the same thing.
Also what makes you think that your data is at 0x7c00?

>> No.61932485

Even on such a short program, your code is messy.

Also, I don't think "or bx, 0" does what you want it to do.That is, if you want to test if bx is zero, do "or bx, bx". The zero flag is raised only if bx is zero. But even then, bx is 2 bytes, you'd rather test one byte only, use a one-byte register for that purpose.
Moreover, int 10h takes two arguments in bx, the page number in bh (usually 0) and the color in bl (7 for the default light gray). You should also set a video mode compatible with text beforehand (look up int 10h ah=0).

>> No.61932510

>Also what makes you think that your data is at 0x7c00?
It's obvious, it's loaded as bootsector code, so the entry point is forcibly 0x7c00.

>> No.61932634

Why not use IP to be sure.

>> No.61932676

IP is not really easy to read. Don't confuse the poor guy already.

>> No.61932783
File: 30 KB, 540x540, 1502800113051.jpg [View same] [iqdb] [saucenao] [google] [report]


>This summer, we got into beginner Python. The boy can’t stop taking on problems while the girl has declared that she hates it. She’s very ready to take on Photoshop and create filters and stickers for UrbanAMA though!

>> No.61932813

>requires nightly compiler
>always starts from 1
>only usize is supported
>heap allocation
noob detected. i have ~3 years of rust experience. see how a real pro solves fizzbuzz in rust:

use std::fmt::{self, Formatter, Display};

macro_rules! impl_from_fizzbuzz {
($ty:ty) => {
impl From<$ty> for FizzBuzz<$ty> {
fn from(t: $ty) -> Self {
match (t % 3, t % 5) {
(0, 0) => { FizzBuzz::FizzBuzz }
(0, _) => { FizzBuzz::Fizz }
(_, 0) => { FizzBuzz::Buzz }
_ => { FizzBuzz::Number(t) }

enum FizzBuzz<T> {

trait IterExt<I, T> {
fn fizz_buzz(self) -> std::iter::Map<I, fn(T) -> FizzBuzz<T>>;

impl<I, T> IterExt<I, T> for I where I: Iterator<Item=T>, FizzBuzz<T>: From<T> {
fn fizz_buzz(self) -> std::iter::Map<I, fn(T) -> FizzBuzz<T>> {


impl<T> Display for FizzBuzz<T> where T: Display {
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
match *self {
FizzBuzz::FizzBuzz => { write!(fmt, "FizzBuzz") }
FizzBuzz::Fizz => { write!(fmt, "Fizz") }
FizzBuzz::Buzz => { write!(fmt, "Buzz") }
FizzBuzz::Number(ref x) => { write!(fmt, "{}", x) }

fn main() {
for v in (1..101).fizz_buzz() {
println!("{}", v);

>> No.61932833

Shit. You are right. The bios(legacy) loads the program at segment 0x07c0 not 0x7c00. It works now.

>> No.61933435

Isn't it the address if the next instruction?

>> No.61933898

Pointer a points to object A.
I set a point b = a.
What this means is b now points to object A.
So, if I do b = new Object B, then b -> B and a still -> A.

Noobs will think that a = b sets the pointers equal, meaning if b points to some other address than a follows suit. This is wrong, but is there a language concept for this?

>> No.61933949

Traditionally, yes, as x86 CPUs fetch the instruction before incrementing the IP (since instruction size can vary). Still, it's pretty much a write-only register. You can only modify it in code through jumps or calls. Calling a subroutine will put the IP in AX, as the return address of the subroutine, so that's pretty much the only way to read it, and it does not actually correspond to the address of the call instruction, but the following one, which can be very misleading.

tl;dr don't try to read IP.

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.