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

What are you working on, /g/?

Previous thread: >>60067042
>>
File: baka.png (510KB, 782x1238px) Image search: [Google]
baka.png
510KB, 782x1238px
first for OOP is shit
>>
first for D
>>
>>60071724
"raise an error" is okay but "lower an error" sounds stupid
>>
File: esr_portrait.jpg (207KB, 500x500px) Image search: [Google]
esr_portrait.jpg
207KB, 500x500px
>grokking

fuck you esr and your retarded legacy and forced memes you fucking down syndrome lolbertarian deformed adult fetus reject nigger faggot
>>
>>60071776

raise / check?
>>
>>60071791
panic
>>
>>60071787
Who?

>grok
>Origin
>1960s: a word coined by Robert Heinlein (1907–88), American science fiction writer, in Stranger in a Strange Land .
>>
>>60071791
>>60071776
there is absolutely nothing wrong with throw/catch
>>
>>60071791
"raise an error" and "handle an error" maybe?
>>
this is kicking my ass

>There are two sorted arrays nums1 and nums2 of size m and n respectively.
>Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

it either infinitely would recurse when it had two arrays of length 2, or it just doesn't work in some cases when the first list has values that range on both sides of the other

import math

class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
l1 = len(nums1) # length 1
l2 = len(nums2) # length 2

# check ending conditions
# if list 1 is empty, return the median of list 2
if nums1 == [] and nums2 != [] > 0: return median(nums2)
# if list 2 is empty, return the median of list 1
if nums2 == [] and nums1 != []: return median(nums1)
# if list 1 and list 2 have the same median, return it
if median(nums1) == median(nums2): return median(nums1)
# if list 1 = [x] and list 2 = [y], return (x+y)/2
if l1 == 1 and l2 == 1: return math.floor((nums1[0] + nums2[0])/2)

# List 1's midpoint is less than list 2's midpoint
if nums1[l1//2] < nums2[l2//2]:
# use the upper half of list 1
lst1 = nums1[(l1//2):l1]
# and the lower half of list 2
lst2 = nums2[0:math.ceil(l2/2)]
print(lst1, " :: ", lst2)
# and use them in a recursive call
return Solution.findMedianSortedArrays(0, lst1, lst2)
else:
lst1 = nums1[0:(l1//2)]
lst2 = nums2[(l2//2):l2]
print(lst1, " :: ", lst2)
return Solution.findMedianSortedArrays(0, lst1, lst2)

def median(x):
if len(x) % 2 == 0:
return (x[len(x) // 2] + x[(len(x)//2)-1]) / 2
return x[len(x)//2]
>>
I got some great advice in last thread and I made changes and pushed them to github https://github.com/nickwilliamsnewby/ephemGravityWrapper if you guys could help make my plotting script less shitty too I would be grateful
>>
Anyone got the book in OP?
>>
>>60071828
Eric Raymond was a fan of Heinlein's and repeatedly tried to force that word as "hacker slang".
>>
>>60071865
http://gen.lib.rus.ec/search.php?req=Grokking+Algorithms&lg_topic=libgen&open=0&view=simple&res=25&phrase=1&column=def

It's kinda meh, though.
>>
>>60071865
If you ever need to find ANY book go there
http://gen.lib.rus.ec/
>>
>>60071847
Can you elaborate what "median of two arrays" means?
Is it the median of a union of both arrays or the average of both medians?
>>
>>60071745
OOP had ADT (interfaces) for decades, what's your point?
>>
>>60071954

nums1 = [1, 3]
nums2 = [2]

The median is 2.0


nums1 = [1, 2]
nums2 = [3, 4]

The median is (2 + 3)/2 = 2.5
>>
>>60071964
wrong kind of adt
>>
File: c++.jpg (555KB, 1000x669px) Image search: [Google]
c++.jpg
555KB, 1000x669px
I found an excellent car metaphor representation of C++. This is more accurate than the Reliant Robin.
>>
>>60072034
DELETE THIS
>>
>>60071943
Where do i go to pirate ISO standards documents?
>>
>>60072059
You can pretty easily find the working drafts with Google.
>>
>>60072080
I've tried finding the standard for MP3 file encoding (IEC 11172-3), but the best i found was half the document on piratebay.
>>
It's time to stop tolerating most dynamic languages. The vast majority of them offer no benefits. Writing wrong code quickly is not a benefit.

Unless a dynamic language is

>simple
>consistent
>powerful

and furthermore more powerful than the most advanced static languages, then there can be NO JUSTIFICATION FOR ITS USE.

This essentially restricts the set of acceptable dynamic languages to the lisps.

Static languages enable much more powerful, concise, verifiable, and maintainable code than most dynamic languages.

IF YOU ARE USING A DYNAMIC LANGUAGE THAT IS NOT A LISP, THEN YOU ARE A POOR PROGRAMMER. IF YOU DEFEND A DYNAMIC LANGUAGE THAT IS NOT A LISP, THEN YOU ARE INTELLECTUALLY WANTING.
>>
>>60071847

im a noob but

why not just combine both lists and sort the combined list again ? or am I retarded?
>>
>>60071964
ADTs are closed. Interfaces generally aren't. Scala's sealed traits are an exception.
>>
>>60072207
>IF YOU ARE USING A DYNAMIC LANGUAGE THAT IS NOT A LISP, THEN YOU ARE A POOR PROGRAMMER
my salary disagrees
>>
File: 1486580347095.png (210KB, 500x348px) Image search: [Google]
1486580347095.png
210KB, 500x348px
>>60072207
who gave this guy a marker and piece of cardboard?

>>60072253
found the guy who knows what counts
>>
>>60072239
that would be a lot worse than O(log(n+m)) since sorting by itself takes (n+m) * log(n+m)
>>
>>60072280


I see
>>
>>60072253
Having a particular salary does not imply that you have any particular level of programming ability.

Also:
>being a wageslave
>>
>>60072355
so you're just a neet producing nothing of value?
knew your opinion didn't matter
>>
>>60072355
>programming for free
>>
>>60072034
a better metaphor would be if it was a bunch of trailers that you could optionally attach as desired and also most of the trailers are weightless
>>
>>60072375
>working on other peoples' dreams instead of your own

>>60072371
Oh, I'm not a NEET. I'm always learning (i.e. the education part of NEET), but to better myself rather than to become a cubicle cuck.
>>
>had to buy FPGA for class
>class is switching to different platform next semester
>can't sell mine to any students

FUCK
>>
File: ss.jpg (257KB, 720x1214px) Image search: [Google]
ss.jpg
257KB, 720x1214px
What did they mean by this?
>>
>>60071726
I just finished my last project in my Ideas list and I am out of things to work on. I can't think of shit.

I am a jack of all trades type fag. My list of projects right now is
>IRC Bot with a command system, all in Python
>A C++ Tool which patches the memory of a game to disable mouse acceleration
>A web site written in Django with the Bulma CSS framework

Been programming for about 3 years now, and I've been learning as much as I possibly can from books for a long while now, so I guess I have experience enough to start contributing to open source shit.

So, how do you FIND shit to contribute to?

I once tried to contribute to GZDoom, the open source DooM engine recreation, in the hopes I could find a way to add mod profiles to make it easier to load up mods.

Couldn't even fucking find where the UI was handled. It was way too dense.
>>
>>60072404
Which literal trash school, senpai?
>>
File: anal beads.png (214KB, 1024x576px) Image search: [Google]
anal beads.png
214KB, 1024x576px
>Java
>>
>>60072398
you don't know what NEET stands for. (NOT in education, employment or training)
>>
Watching java tutorials on Lynda while in bed with my android held up by a bedside phone holder

Gonna make fart apps soon!
>>
>>60072443
java/python/cpp programmers = hacks
art of war = flamewars
>>
>>60072398
Not sure if troll, or if you've actually deluded yourself into thinking you're not a NEET.
>>
>>60072443
>He reads programming books
Nigger.
The only thing you need to do to learn to program well is to program. That's it. You'll learn 100x faster through experience than you will through reading.

It's better for you to write shitty code and then understand why the things you did were shit and how its all fucked up, and then to refactor and make it better, and keep doing that than it is to read
>"o le blah blah bad :^)"
That shit never works. It tells you it's bad, but not why or how. I read that global variables were bad, but I didn't understand how or why, so I kept using them in a particular program, until it just fucking broke. Then I re-wrote it and it was 10x more readable and better. Learn through experience.

The only comp sci books worth reading are security ones and interview ones.
>>
>>60072398
everybody is always learning, more or less. the "education" part of NEET refers to institutional education
>>
>>60072558
Thanks for the advice. I don't just follow the examples though I take a modular approach to applying what I learn. So I have been taking your advice before you said it but it is still good advice for anyone else who reads your post. These books are a reference for what works so that I can always have a jumping point to start from.
>>
>>60072564
Institutional education is a scam invented by the 13 dark lords to coerce young people into drinking at parties and giving up their souls.
>>
File: c-3-2.png (30KB, 1620x774px) Image search: [Google]
c-3-2.png
30KB, 1620x774px
>>60072034
I still think this is the top metaphor for C++.
>>
>>60072603
that could be entirely true and it wouldn't matter. it doesn't change what NEET means
>>
>>60072603
>coerce young people into drinking at parties
Yes, because there is so much coercion required for that.
>>
How would I go about dragging a browser tab into a program I've made and having it do something?
>>
cracked open k&r, getting lost pretty quick, 3rd or 4th example when they introduce the for loop
 #include <stdio.h>
/* print Fahrenheit-Celsius table */
main()
{
int fahr;
for (fahr = 0; fahr <= 300; fahr = fahr + 20)
printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));
}


just not getting how this loop is working

they descibe it like

fahr = 0
is initalization (ok so far fahr = 0)
fahr <= 0
test condition -if true go to print
fahr = fahr + 20
stepping it up

but how is it skipping ahead to the print statement, then going back to the step ?
>>
>>60072490
I don't even like java, but that's just a retarded complaint. Why don't you try overwriting malloc fences in C and see how well that works for you.
>>
>>60072645
theres plenty of programs to grab porn videos already

what language?
>>
>>60072511
>>60072524
>>60072564
Yes, I know what NEET stands for. I am in education (yes, a formal program, although I read voraciously on the side too), so I am not a NEET.

>>60072603
I'm teetotal.
>>
File: 1465377359880.png (268KB, 800x430px) Image search: [Google]
1465377359880.png
268KB, 800x430px
>>60072034
delete this now
>>
>>60072645
Check the drag-and-drop interfaces on whatever OS you're using.
>>
>>60072646
It's basically the same as saying
int fahr = 0;
while (fahr <= 300) {
printf(......)
fahr += 20;
}
>>
>>60072646
A few things:

Is the test condition fahr <= 0 or <= 300?

Make fahr += 20 instead of fahr = fahr + 20 (to make it easier to read)

To answer your question, it prints, and then since there's nothing left, it adds 20 to fahr. Then it checks to see if it's under 300, and if so, it prints again. It does this until fahr is over 300.
>>
is there EVER a situation when you need a triple pointer or higher?
>>
>>60072737
Yes.
>>
>>60072668
Why is it possible to break math in Java?
>>
>>60071847
I would do it like this.
Compare the 0th index of both arrays to find which to start with, lets say nums1 has the lowest valued term so start with that. Then go through nums1 until you find a term larger than the 0th term in nums2, at which point record the index you got to and go through nums2 etc. until you get to the ( len(nums1) + len(nums2) )/2th term, which is the median of the two arrays.
Remember to get the next term along as well if the combined length of the arrays is even.
>>
>>60072737
If you use a linked list you have to store the address of the first element of the list ( first pointer ) .
If you need to change in that list you need another pointer (two pointers)
If you need to pass your list that you are changing in two pointers and change it in another function you need another pointer(three pointers )
If you need to write a sparse multi-level table
>>
>>60072668
C is shit, too.
>>
what i have now, still doesn't give the correct answer though i think it's more on track
import math

class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
l1 = len(nums1) # length 1
l2 = len(nums2) # length 2

# check ending conditions
# if list 1 is empty, return the median of list 2
if nums1 == [] and nums2 != [] > 0: return median(nums2)
# if list 2 is empty, return the median of list 1
if nums2 == [] and nums1 != []: return median(nums1)
# if list 1 and list 2 have the same median, return it
if median(nums1) == median(nums2): return median(nums1)
# if list 1 = [x] and list 2 = [y], return (x+y)/2
if l1 == 1 and l2 == 1: return (nums1[0] + nums2[0])/2

m1 = median(nums1)
m2 = median(nums2)

if m1 > m2:
i = l1 - (l1//2)
del nums1 [(l1//2):l1]
del nums2 [0:i]

else:
i = l2 - (l2//2)
del nums2 [(l2//2):l2]
del nums1 [0:i]

return Solution.findMedianSortedArrays(self, nums1,nums2)

def median(x):
if len(x) % 2 == 0:
return (x[len(x) // 2] + x[(len(x)//2)-1]) / 2
return x[len(x)//2]

>>60072780
if you're iteratively stepping through one of the lists it's not O(log(n+m))
>>
>>60072558
I think "programming book" is kind of a bad ambiguity here. Especially more broad books with topics like "compiler design" can be a good read and teach you algorithms as tools for you to use.
It honestly sounds more like your personal bad experience.

>>60072737
Triple pointer for c-strings.
A function takes a ***char and sets a pointer to a string.
>>
>>60072737
If you need to ask, you're not good enough at C yet
t. 10 star programmer
>>
>>60072828
>only 10

plebs out
>>
>>60072626
this belittles actual abominations. if the dog man from the fly 2 could have been fixed by commenting out a couple of includes, he wouldn't have really had much of a problem
>>
>Is the test condition fahr <= 0 or <= 300?

300, mistyped that


so after the conditional it will do whats under, go back and do evrything else after it?


for ( init_something_1; init_som_2;

test_this == test_that;

after_something_1 = 100; aft_some_2 = 50;)

print("body of loop");


it will initialize 1 and 2 first, then its done with those?

then it will test the conditional, if true go to body(print in this case)

then it will do the after somethings? will it do them every time, or only if true?
>>
/dpt/
Please forgive me for I do not know jack shit about programming.

Is it really hard to program a game over to another OS or is it just time and effort that most programmers don't want to do?

I've always wondered why so many games that could work on say a Nintendo product VS just a PS4 or an Xbox.

all considering that Vice city on Android
>>
>>60072772
Because you're not breaking math, but the libraries that make ints polymorphic for passing to printf. Also it's possible to break anything with arbitrary access. With the same thing in C, you can overwrite machine code in functions and "break" their math too.

>>60072785
Any non-shit language will at least have the ability to do arbitrary machine-level things, and then you can break it.
>>
>>60072983
You're implying that it's fine because you can do it in C, too.

C is not fine, and neither is Java.
>>
>>60072939
Are you a cat?

When porting between consoles, it's not just about porting to a different OS. It's about porting to completely different hardware.
>>
>>60072995
See >>60072983
>Any non-shit language will at least have the ability to do arbitrary machine-level things, and then you can break it.
>>
>>60073022
>muh language can break math so it's good
>>
>>60072995
>waaah the gun triggered even when i pointed it at my foot!
>>
>>60073031
There's a big difference between "it's good because you can break math in it", and "it doesn't prevent me from doing anything I want with it".
>>
>>60073038
>not using a gun that won't fire when you point it at yourself or loved ones
>>
>>60072939
Okay, so OS ports in the sense of windows to linux to mac:
That depends completely on the codebase of the game.
Some programmers already code with multi-platform in mind, choosing portable libraries, containing platform specific code to certain files etc. and others don't.

In case of console ports (console to console or console to pc):
This is much harder since you have different input-devices, (if you use the modern controller features), you have the issue that games for consoles are usually tuned for that specific hardware and graphics options etc. don't exist. Other consoles like nintendo's have significantly less graphics power, so that you have to think about using different rendering routines.
>>
File: faggot-10.jpg (72KB, 800x893px) Image search: [Google]
faggot-10.jpg
72KB, 800x893px
>>60073054
I bet you're the kind of manlet who would love a welded hood on your car so that it forces you to bring it to the dealer when something's wrong instead of risking that you might get the idea to fix it yourself.
>>
How are you supposed to learn a new language? I dont want to be told all over again what a integer and stuff is, and I tried codeacademy and that shit is annoying.

What is the best way to learn a new language (not new paradigm) while knowing all the basics? Just doing projects and googling problems?
>>
>>60071776
raise Error;
...
lower Error; //Aka ignore

Looks fine to me. I would also suggest "rise in", as in "rise in rebolution"
>>
>>60073124
>while knowing the basics
Let me guess, you're one of those "all languages are the same!" types?
>>
>>60073092
Why wouldn't you want a gun that allows you to accomplish its intended task, and prevents you from causing yourself harm?
>>
>>60072939
To begin with, it's generally more difficult to port between console than between different PC operating systems, because on PCs you're forced to use an abstraction layer for stuff like GPU access, such as DirectX or OpenGL. If you used the latter, that's much less work when porting. Whereas if you write for consoles, those libraries are generally not available, and even if they are you generally don't want to use them since half the purpose of writing for consoles is to wring everything you can out of the hardware. Porting between DirectX/OpenGL/console hardware can be a major task since it can affect every aspect of your game engine. The "big" engines that support several are severely much more complex for it.

On the other hand, once you've done the work of porting between two different platforms, it's usually much easier to add support for another one, since you've already done the work of abstracting the basic shitthat differ between platforms.
>>
>>60073137
No im the type who knows C, some high level languages and some functional stuff, that i learned in college.

And they pretty much are all the same, except for the functional ones.
>>
>>60073158
you realize how silly that sounds right? Sure anybody would want that but it goes against the very nature of what the gun is. That's why people take classes to learn how to properly handle a gun. It's not the gun's responsibility to make sure you use it right.
>>
>>60073158
>Why wouldn't you want a gun that allows you to accomplish its intended task, and prevents you from causing yourself harm?
There's a reason those don't exist in reality,and it's much the same reason why you don't want it in programming languages. In reality, they end up preventing you from doing things that you want to be able to do, and have good reason to.
>>
>>60073137
NIt him, but all languages are pretty much the same (except pure functional, those are just gilgamesh <-- I wanted to say somthing that sounds like this, not the actual character from Fate)
>>
>>60073158
>>60073170
>>60073172
>>60073173
I think what he means is he'd prefer a nerf gun
>>
>>60073124
>Just doing projects and googling problems?
That usually the most effective, yes. Check out samples and stuff.
>>
>>60073187
Are you that Rust shill?
>>
>>60073124
>>60073192
Also, find the "reference manual" or equivalent of the new language, which deals with a technical description of the language instead of nub tutorials.
>>
>>60073004
I figured as much as well

>>60073080
I saw someone tweet out about I think Dishonored and the graphics in comparison of BOTW are lower than I expected for an Xbox game. Is it the programming or is it just lower res I'm looking at?
>>60073163
The way you make it sound is as if we can port it over but as the first guy said, hardware is the main concern
>>
>>60073187
Then run Java in sandbox mode. In that case, the example from >>60072490 wouldn't have worked either.
>>
>>60073194
Nah, just a reasonable guy who realizes all languages are merely a means to an end. Go ahead and redpill me on haskell or whatever though
>>
>>60073172
>>60073173
>>60073187
It wasn't my analogy, dipshits.

see >>60073038
>>
>>60073223
I came here to flame and incite people--not get things right. the onus is on you here.
>>
>>60073219
it doesn't even support type level lambdas
>>
>>60073209
>The way you make it sound is as if we can port it over but as the first guy said, hardware is the main concern
What do you mean? It is possible to port things between consoles. It's just a lot of work, just as I described.
>>
Reading the book The Best Software Writing I, a collection of good articles curated by Joel Spolsky and his readership, the guy who co-founded Stackoverflow.

It's really good collection
>>
>>60073223
So what? It was still applicable all the way through.
>>
>>60071885
It's a good word. The fact you're complaining about words you don't even get to hear reveals your luser status.
>>
There is no reason to ever use Python or Ruby or Go.
>>
>>60072646

A for loop signature isn't a statement.
It doesn't go from `fahr = 0` to `fahr < 300` to `fahr += 20` and then the body runs.

It does the initialization, then the condition, then the body. Once the entire body is ran, the step is then ran. This repeats with the condition, body, and then step till the condition is false.
>>
>>60073158
The intended task of a gun is to kill whatever is in front of it when you pull the trigger.

>you make it sound is as if we can port it over
Newsflash, games are being ported between consoles (and pc) for almost a decade now.
>>
>>60071791
Signal a condition. Handle the condition.

It doesn't have to be limited to just erroneous conditions. Any case whose handling the system wishes to defer to the caller is a condition.
>>
>>60073258
>>60073295
The intended task of my gun is not to kill me or something I don't intend to shoot.

If your gun could prevent you from shooting something you didn't want to shoot, wouldn't that be desired behavior?
>>
>>60072059
>Where do i go to pirate ISO standards documents?

Fuck. I have the exact same need.

I wanted to write some programs that would have to adhere to specifications but the standards cost like $500 for an up-to-date copy. This is ridiculous.

I wish there was a torrent tracker for these things.

>>60072080
Maybe for stuff like the C language standard. but the industry throws a paywall in front of any relatively obscure stuff.
>>
>>60073316
>If your gun could
But that's exactly the thing. See >>60073173
again.
>>
Defend a sleep function not being in C++. I'll wait.
>>
>>60073247
yeah I know anon. but as the first anon said, it has to do a lot with hardware considering that the Wii U, Switch, PS4 and Xbone have very different hardware, so having to down scale would be a bit of an annoyance, which is why I could see a lot of devs going "No I don't want to porn to so many. Just the main 2"
>>
>>60073349
It's in C, and therefore you can use it in C++.
>>
>>60073349
kys retard

std::this_thread::sleep_for(std::chrono::milliseconds(x));
>>
File: lol-18-2.png (64KB, 305x330px) Image search: [Google]
lol-18-2.png
64KB, 305x330px
>>60073361
>No I don't want to porn to so many
Nice to know where your muscle memory lies, Anon.
>>
>>60073376
>std::this_thread::sleep_for(std::chrono::milliseconds(x));
That's almost at the level of AbstractSingletonProxyFactoryBean.
>>
>>60073349
C++ works very hard and has no time to rest
>>
>doing hard drugs like speed or cocaine just to program
absolutely degenerate
>>
>>60072772
>unleashes all four dogs of reflection
>goes out of the way to access implementation details
>complains about things breaking

You're like the retarded pajeets who starts using Microsoft's internal structures, resulting in them having to support that shitty code forever and rendered unable to ever, ever change it. You're the reason shitty legacy code can't be improved.
>>
>>60073337
> but the standards cost like $500 for an up-to-date copy
rise in revolution;

I knew it would be useful
>>60073125

No but seriusly I feel you.
>>
File: download_2.jpg (8KB, 206x156px) Image search: [Google]
download_2.jpg
8KB, 206x156px
>>60073376
>>
>>60073392
so?
>>
>>60073387
I wasn't paying attention anon. like jeeze.

>>60073402
yeah MT dew and dorritos all the way :^]
>>
>>60073414
dumb redditor
>>
File: 299 errors.png (149KB, 957x1045px) Image search: [Google]
299 errors.png
149KB, 957x1045px
just end my fucking suffering
>>
>>60073209
BOTW has fucking garbage graphics fucking retarded druggie /v/ namefag
>>
>>60072558
STFU retard. Don't give shitty pajeet advice.

Reading GOOD code is the most important thing you can possibly do as a software developer. It trains your mind, teaches it what good code looks like. It improves your vocabulary, your ability to construct your own sentences. For every line written, a good writer reads a thousand more due to research, leisure and curiosity. Software is not different.
>>
>>60073466
wow anon, you're salty. What's the matter anon? Do you need a hug?

Sorry anon, I don't do drugs and I don't travel to /v/
>>
>>60073376
TWO LIBRARIES
W
O
>>
>>60072737
Beyond one star, it's all the same. You're always pointing to another pointer.
>>
>>60073488
POO
O
O
>>
>>60073412
>rise in revolution;

What are you talking about?
>>
>>60073437
Why do you highlight the code from line 205 and the error of line 332?
>>
>>60073488
just one, actually. commonly referred to as the standard library
>>
>>60073437
dumbass
>>
File: 1483503524342.jpg (283KB, 1920x1080px) Image search: [Google]
1483503524342.jpg
283KB, 1920x1080px
>>60073437
BAKA
>>
File: ShinyKanbe.png (2MB, 1281x720px) Image search: [Google]
ShinyKanbe.png
2MB, 1281x720px
Is it a bad idea to learn C++ and then learn C?
>>
>>60072490
What's wrong with anal beads
They feel so good
>>
>>60073563
>>60073609
>>60073536
I was about to right-click-> comment on that section.
Basically, I'm starting on rewriting my MMU, because operator overloading fucked me with mmio, the error is because i removed an overload.
Also, big or little endian?
>>
I wonder what Python would look like as an anime girl
>>
>>60072490
>>60072772
you're breaking it on purpose with reflection fucking retard
>>
File: 1475849412181.jpg (95KB, 1096x688px) Image search: [Google]
1475849412181.jpg
95KB, 1096x688px
>>60073681
>>
File: 1436716300-574407.jpg (106KB, 1280x720px) Image search: [Google]
1436716300-574407.jpg
106KB, 1280x720px
>>60073681
>>
>>60073637
learn C++ and you'll know C more or less automatically. C is a brainlet version of C++
>>
File: 1491404625718.jpg (321KB, 676x888px) Image search: [Google]
1491404625718.jpg
321KB, 676x888px
>>60073759
>C is a brainlet version of C++
>>
copy/paste now works in my text editor
>>
>>60073759
Depends if you just want to know C syntax, or if you want to be able to read code written by C fanatics.
>>
>>60073813
properly written C code is easy to read. in fact most C code is split into many tiny little files with a very "flat" structure with simple little functions
>>
studying the basics of decaf
https://github.com/decaf-emu/decaf-emu

and learning more about x64 reverse engineering

>there are people defending cemu being closed source, making 40k$/month

disgusting. as a member of the church of emacs I will do everything in my power to render it obsolete, however little I may accomplish.
>>
>>60072034
This isn't zero cost abstractions, fag.
>>
>>60071745
>public static private
wew
>>
>>60073637
Not necessarily, but it's probably easier to learn C first and then C++. The features specific to C++ pretty much require you to know C anyway.
>>
>>60073899
>implying only runtime cost matters
>>
>>60073955
It does though.
>>
>>60073929
Kate Gregory disagrees.
https://www.youtube.com/watch?v=YnWhqhNdYyk
>>
>>60071954
concat arrays, sort, then find the median
>>
>>60073969
>some random faggot disagrees
Wow, I'm going to change now
>>
>>60074057
Why do you reply to me?
And he has to do it in O(log(n+m)), where n and m are the array sizes.
>>
>>60073969
Yes, but only because if you actually watch the video, the title is mostly clickbait and the actual issue is the slow transition from traditional C to enterprise c++ and the huge amount of c++ tutorials set somewhere in between.
>>
how long does it take to become a programmer ?

i want to hear numbers
>>
>>60074165
10 years.
>>
File: 1492052016048.png (39KB, 200x200px) Image search: [Google]
1492052016048.png
39KB, 200x200px
>>60074165
>i want to hear numbers
aplay -c 2 -f S16_LE -r 44100 /dev/random

listen to that for 2 straight hours and you'll know how to program anything you want. it's a promise friend.
>>
In C, when using strtok() to split a buffer into an array of words using \n as a delimiter, how can I tell strtok() to count \n as a word also?
>>
>>60074204
you could just run it with a counter if you don't need to know the values and are just counting. idk if thats viable for what you need
>>
>>60074204
int count = 0;
char *ptr = s;
while((ptr = strchr(ptr, ' ')) != NULL) {
count++;
ptr++;
}
>>
>>60073857
>cemu
>making 40k$/month
is this even legal? surely it would be illegal if they charged money for the emulator, but releasing it for free and taking donations from "fans" is ok?
>>
>>60074189
Fun thing: As long as your kernel supports OSS emulation (which I believe is still standard), you can even more easily to stuff like "ps aux >/dev/dsp". It's fun to try different programs and see what sounds they make.
>>
>>60074306
>surely it would be illegal if they charged money for the emulator
Have you checked google play store? There are plenty of emulators that charge money.
>>
>>60074358
Tis indeed true! I just sort of assume people are gonna have (s)alsa running on stuff lol
>>
>>60074306
>surely it would be illegal if they charged money for the emulator
?
>>
>>60072034
DELID THIS
>>
>>60074373
>>60074381
"You can save a lot of time if you ‘cheat’ and look at proprietary documentation (console SDKs, leaks, etc.) while trying to understand how a console works," Bourdon explained. "This is in general frowned upon in many emulation projects: it puts the whole project at the risk of a lawsuit. It's one of the things where we have no doubts about the legality: it's clearly illegal. With open source projects the development process is usually very open. If I were to take Dolphin as an example, we talk about everything in public, we do code reviews in public, etc. That doesn't guarantee that our contributors don't look at this documentation in secret, but it makes it harder to do so. And we have a clear stance against it: I've personally banned multiple people from interacting with us because they made it clear when talking with us that they based their work on illegally obtained documentation."

This is what makes Cemu controversial, even in the emulation community. We don't know what the source code looks like, or what kind of information the developers have used to reverse-engineer the Wii U. And the developers aren't talking (a Cemu dev declined an interview for this story).

"For a closed source project, the only thing that can be seen from the outside is the end result," Bourdon said. "The process is completely opaque. And this leads to a lot of concern about whether these projects end up taking shortcuts by looking at proprietary documentation. After all, who is going to notice? This puts the project at risk: if they were to get sued, the lack of diligence in the process would almost certainly be found through discovery (which would expose their source code, communication logs, etc.). But also it is bad for the ecosystem because closed source alternatives could end up having an advantage on the open source alternatives. Users tend to not care about long term problems like 'is this emulator going to still work 5 years from now.'"
>>
>>60074420
This post is a non-sequitur.

It doesn't address anything you're responding to.
>>
>>60074420
It is illegal to base your code off proprietary documentation. This is true in almost every single industry even those not related to software engineer (technical manuals, repair processes) etc. We already know this. Nothing you posted mentions anything about charging or taking donation for emulators being illegal
>>
>>60074454
ok then i'll sell wii u clones from my garage nothing wrong with that
>>
>>60074492
Provided that your Wii U clone is not based off stolen documents from Nintendo and built by your own code, there is nothing wrong with that.
>>
>>60074492
Are you retarded? Nintendo consoles are the most cloned consoles in history. It's fully legal and there's not even a hint of copyright infringement in that practice. As far as the court goes, it's just another console that happens to run the same Wii U games. A competing product.

Sony went after emulator authors like Bleem! in the past, for total bullshit reasons like using screenshots from actual games for comparison advertising. They got literally raped in court. Only reason they "won" is because they got an injunction that stopped the company from selling the software, temporarily stopping them from making money.

Before that, Sega sued other clone manufacturers over their use of the trademarked word "SEGA" in their console's memory. They thought it was some kind of legal weapon against copiers but they too got raped in court. It was ruled that the manufacturers lawfully reverse engineered their product and produced a competing product, and that it was Sega's own retardation that forced them to infringe their trademarks in the course of exercising their own rights.

You have to realize that China's been reverse engineering their shit for so long it's not even funny. Do you even know how Chinese manufacturing works? Americans go to them and literally hand the Chinese factories their original designs, which they mass produce for a good price. However, an extremely important source of profit for these factories is selling their client's products to countries the client don't care about, like South America, Africa and the rest of Asia. Ironically, these markets are willing to pay more money for the products than Americans are, even though they are theoretically poorer.

So copying and emulating products is not even remotely a new thing and is an extremely profitable practice. It's basically Chinese culture. If you ask me, the real retards are the penny-pinching executives who gave the conniving Chinese their own IP on a silver platter.
>>
File: 1491402204619.gif (2MB, 201x137px) Image search: [Google]
1491402204619.gif
2MB, 201x137px
>>60074676
>>60074420
>>
>>60074742
tl;dr as long as you don't violate patents or look at internal source code/documentation you're free to plagiarize whatever you want
>>
File: Reading_af903e_402102.jpg (64KB, 550x550px) Image search: [Google]
Reading_af903e_402102.jpg
64KB, 550x550px
>>60074742
>can't read 2000 words and be informed

I guess that's why you're fucking retarded. Stop posting any time.
>>
>>60074790
I read it I just wanted to push your buttons first.

I'm actually right there with you bud--used to work for companies that pumped out atrocity after atrocity all under the guise of using the GPLv3 (never of course committing to a single upstream resource ever or helping in any way)

I also used to do ITAR and had to field things from going to China all the time :-/. They're actively trying to steal IP from private corp's around the clock
>>
File: 1491074183554.png (946KB, 1400x5552px) Image search: [Google]
1491074183554.png
946KB, 1400x5552px
>>60074454
Also keep in mind that Nintendo doesn't even exist as a company on most countries on the planet. They don't even officially sell consoles much less games on most countries, numerically speaking. You think Nintendo is going to internationally sue some Russian hacker who made some playstation emulators? Russia literally doesn't give a shit. The only reasons to be afraid: (1) you live in the USA, or (2) you live in Japan. Nobody else gives two shits about Nintendo. Especially not China.

>>60074844
>They're actively trying to steal IP from private corp's around the clock
>trying

They're succeeding at it. These factories literally ask their clients to bring a sample of what they want. They just clone it and deliver a 100% identical product. And then they start tinkering with it behind the client's back to save money, introducing imperceptible changes in the product, the quality fading over time until the products they make literally fall apart after some use. They pocket the savings and pass the product risk to their clients and they don't even know about it. They know it's expensive to switch to another factory, so they make the first orders correctly and then start fucking Americans in the ass.
>>
>>60074936
>The only reasons to be afraid: (1) you live in the USA
so it's not so legal after all if you live in a real country
>>
anyone have good resources on dynamic programming?
>>
>>60074972
Nintendo doesn't have enough clout to go after anyone in USA. Reggie is a huge cuck that is forced to beg for scrapes from Nintendo JPN. You think NOA is going to be sueing anyone? The most they can do is throw some DMCA at Youtube.
>>
I want to write a python script that can test a list of free proxies and check each one if its banned on 4chan, then use said proxy and post (have this last part covered already). I dont want any code I just want a hint or some modules that will help me accomplish this.
>>
File: 318.gif (228KB, 400x250px) Image search: [Google]
318.gif
228KB, 400x250px
I want to develop a small proof of concept GUI program for Window's, looking at doing it in Visual Studio/C# via WPF, is there another better way? Only just starting to get into VS/.NET and have 0 idea what is worthwhile to use/learn and what isn't.
>>
>>60075017
https://pypi.python.org/pypi?%3Aaction=search&term=vpn
>>
>>60074972
>so it's not so legal after all if you live in a real country

It's 100% legal. It's just that companies have a lot of money and an army of lawyers, and it's easier for them to sue you than it is for you to win against them. The legal expenses involved make it extremely unlikely that any random American emulator developer would challenge them. This bullying tactic has been used by all sorts of companies, from Blizzard against WoW bot operators to patent trolls and scammers against literally anyone. They make it ceasing & desisting or paying some small amount of cash up a financially attractive proposition. The free market at work.

In order countries it's common for people to be able to request state attorneys to represent them for free as in taxes, so it's trivial to challenge these companies. In my own country, EA Games has repeatedly lost many lawsuits customers pursued against them. It just isn't able to use the legal system as a weapon against people.
>>
>>60074972
https://retrocomputing.stackexchange.com/q/1950
>>
>>60074936
>that pic
Dear lord
>>
>>60075144
If you want more stories like that, read this book. I did, and now every time I see the Chink Shit General on the /g/ catalog I cringe really hard. I'm really glad my country has its own industry and that foreign goods are taxed to hell and back in order to protect that fucking industry.
>>
>people shitting over all languages

i bet all of you are webdevs gtfo
>>
If I have two int arrays, how can I find an integer that occurs the same number of times in both? without using a data structure such as a hashmap
>>
File: 1492237565277.jpg (90KB, 1280x720px) Image search: [Google]
1492237565277.jpg
90KB, 1280x720px
>>60075183
Thanks for the recommendation, anon; I love reading about this kind of shit.
>>
>>60075212
for loop + counter
c'mon anon, this is easy shit.
>>
>>60073846
No that's horrible 90s university style code and its absolutely retarded. Proper modern C code has its functions be as long as they need to be to contain the sequential instructions they describe.
And its not harder to read.
>>
>>60075277
but what if you don't know the sizes of the arrays
>>
>>60075305
You use an amortised growth structure. An equivalent to C++ std::vector for instance.
It's very unlikely that you don't actually know.
>>
>>60075305
???
what is your application doing?
>>
>>60075350
do you really think I'm making something?
I'm just looking at a list of various algorithmic problems
anyways, I think the answer is some dynamic programming bs, but I can't figure how
>>
>>60075392
the reason I ask is because why wouldn't you know the lengths of the arrays?
>>
>>60075407
so you have to think more creatively on how to solve it
>>
>>60075392
>dynamic programming
Are you certain that's what you mean?
https://en.m.wikipedia.org/wiki/Dynamic_programming
>>
>>60075260
One of the coolest chapters is about a paper recycling business some enterprising Chinese motherfucker came up with. He was friends with some American trash industry guy and made him send all the paper his way.

He paid some Chinese women peanuts to sort the paper. He told his "friend" he had a few categories based on how good/thick the paper fibers were or something. In reality, there were like 30 categories based on the paper's worth. So in reality, he was making a LOT more money than he was telling his friend, who was losing money. The best paper would come from Wall Street, complete with written contents like private mail from big industry players. This motherfucker would literally stash those, probably hoping someone would be interested in the information. Also, that paper was often brand new and could be recycled multiple times, something he didn't tell his "friend". Guy went every mile to make lots of money behind his "friend"s back and screw him, including trying to bribe the author of the book into silence.

The Chinese are so conniving, they out-jewed a jew in one of the chapters.
>>
my idea to make a hangman game is to make a hashmap with booleans and the characters inclusive whitespace and line breaks and switch the required booleans from false to true 1 by 1.

does that sound good?
>>
import sys

def maxCSS(x):
maxes = {}
maxes[0] = x[0], [0]
maxl = 0
tmax = x[0]
for i in range(1, len(x)):
prevmax, prevlist = maxes[i-1]
if prevmax + x[i] > x[i]:
prevlistcpy = list(prevlist)
prevlistcpy.append(i)
maxes[i] = (prevmax+x[i]), prevlistcpy
else:
maxes[i] = x[i], [i]
if maxes[i][0] > tmax:
tmax = maxes[i][0]
maxl = i
list(map(lambda i: sys.stdout.write(str(x[i]) + " "), maxes[maxl][1]))
print()

maxCSS([5,-6,8,2,-13,0,4,-2, -1,8,-5,6,-2,3])


i did it
>>
>>60075418
That's hardly a step up. Adding that constraint is just a minor inconvenience. As long as you know that the both input arrays do end at some point you haven't really increased how complicated the problem is.
If you allow yourself a full 32bit int of input space you might need some more fancy solutions for practical reasons because storing ~24gb of counters (1 for each array to garauntee no overflow) for each value might be prohibitively expensive.

For instance you might want to have one array subtract and one add to the counters. If they end at 0 they have the same number of appearances (or none at all which is the same thing, can use a flag field to catch that).

But is this a problem worth considering? Would you not rather throw yourself at more real issues than make simple problems hard?
>>60075477
I'd just make an array of bools for each of the letters and special case the access to the whitespace (reconsider having line break in your hangman, please).
It's very easy to index into without an associative array. Just take the ascii character - 65 and you have your index.

The hash table lets you handle more general character sets though.
>>
>>60075546
maximum value contiguous subsequence is what it is
>>
>>60075212
if you can't use a data structure, then you have to go through each value that occurs one by one. O(n^2), with hash table it'd be O(n)
>>
>/dpt/ thinks they're superior to Indian software engineers who have studied 12 hours a day, 5 days a week for 4 years with state-of-the-art equipment at top universities
>/dpt/ doesn't realize (or is willfully ignorant of the fact that) an Indian computer science freshman will have to write a bootloader and a compiler IN THEIR FIRST SEMESTER or fail their degree
>/dpt/ considers themselves better than such engineers... and it's all because the engineers have brown skin
Inferiority-superiority complex much?
>>
>>60075612


is the second one true?
>>
>>60073367

There actually isn't a sleep function in the standard C library.

>>60073392

Technically these aren't OOP abstractions at all. They are just namespaces. std is the parent namespace for all C++ STL functions and types. std::this_thread is for functions that operate on the current thread, including sleeping and yielding. std::chrono is for functions and types that concern time.
>>
>>60075427
This both intrigues me and disgusts me. I feel really bad for the victims of the chinamen. I've got to wonder how many /csg/ anons have been burned.
>>
>>60075632
I highly doubt it, and even if it were they would all just cheat and copy others anyway. And I don't even mean good cheating, I mean like downloading GCC source code and claiming it as their own tier cheating.
>>
>>60075649
>There actually isn't a sleep function in the standard C library.
Didn't C11 added one with the thread shit?
>>
>>60075302
how about some examples then. everything i've seen on github is brainlet garbage
>>
>>60075612
No I consider these people inferior based on my interactions with them.
I haven't had as much as a friend of a friend speak well of Indian efforts on their teams while outsourcing was considered this amazing idea everyone should get behind.

Regardless of their supposed accomplishments (I doubt they are required to write what you claim from what I've seen) the results are bad. That's all I care about. Sure their situation doesn't help much (turnover rates are massive) but I've had the displeasure of working with many pompous Indians who think they're doing good shit throughout the project but they can't even push functioning code half the time. It seems to be code that fits their one initial test case and then they turn it in as complete. Any outside scrutiny would immediately find issues.
>>
File: 1493132242701.jpg (162KB, 1920x1080px) Image search: [Google]
1493132242701.jpg
162KB, 1920x1080px
>>60075632
>>60075703
>>60075656
what did you say about java, bastard son of bitch? trump will not deport us, we are too strong for america to leave us
>>
>>60075632
No. Just shilling all day every day.
>>
>>60075693
I find the stb libraries to have a very aesthetic style. But there's multiple writers now.
https://github.com/nothings/stb/blob/master/stb_sprintf.h
Quake 3 source has been touched up for the GPL release, so there's plenty of dumb comments and Whitespace but if you ignore that and look at the code it's a fine example
https://github.com/id-Software/Quake-III-Arena/blob/master/code/cgame/cg_draw.c
>>
>>60075681

Ah, right. Now we just need it to actually be implemented in glibc :(
>>
>>60075720
how to be become maximum fit like that
>>
>>60075756
that looks pretty good tbqh
>>
>>60075787
lift eat sleep and take roids
>>
OOP sucks, whether it's Java, C#, C++, Python, Ruby, or any other shitlang.
>>
>>60075818
not an argument
>>
>>60075651
“Wait a minute,” Doug said. “It says here 1.99 renminbi.”
“That’s not right. We already confirmed 1.9,” I said.

The factory had quoted 1.9 renminbi per foot, which was roughly 25¢ at the current exchange. When I asked the factory owner what had happened, he scratched his scalp, tilted his head, and suggested it must have been a mistake on my part.

“Ni ting cuo le,” he said. “You heard me wrong. ‘One-point-nine,’ you know, sounds very much like ‘one-point-nine-nine.’”

But we had been quoted on other products to one-tenth of a renminbi, I pointed out.
One renminbi was worth a little more than a dime, and a tenth of a unit was equal to about a penny. Doug said that he also could not see the logic in quoting to the tenth of a penny.

“If they wanted to quote 1.99, why didn’t they just call it ‘two’?”
“I am pretty sure we were quoted one-point-nine.”
“That’s what I have in my notes,” Doug said.

He laughed at the absurdity of the discussion we were having. The difference between 1.9 and 1.99 was almost 5 percent though, and it was a problem. His anticipated gross profit had been closer to 10 percent.
While I worried about Doug, I could not help but be impressed by what this industrialist had done. Nearly half of the expected margin had been wiped out with just a single turn of phrase—you heard me wrong.
>>
>>60075183
Which country do you live in anon?
>>
what are the benefits of learning B?
>>
>>60075818
>sucks
>is super common and great once you understand polymorphism
eat a dick you ol' bitch!
>>
Where can I get help with my homework and not get laughed at? Last homework of the semester and I can't figure out one part and it's fucking everything up.
>>
>>60075876
I understand polymorphism, that's part of the reason I know OOP sucks.
>>
>>60075651
“Hey, look at this,” Doug said. He was inspecting the invoice further.
The factory had offered the lengths in meters. “I told them we needed everything in feet.”

Ten-foot lengths that had been ordered were listed as being three meters long.

“We always measure in meters,” said the factory boss.
“But you quoted us in feet.”
“Only because you wanted to be quoted in feet.”
“But the invoice is in meters.”
“Because we must use the metric measurement.”

This also made no sense, and I protested. The factory boss defended himself by saying that 10 feet was just about three meters anyway.

“Chabuduo,” he said. “The lengths are nearly the same.”

I didn’t have to reach for a calculator to know on which side of chabuduo we would end up. The difference between the two measurements would represent another 1.5 percent loss in margin.
When I pointed this out, the factory man tilted his head the other way this time and scratched at his scalp some more.
Doug had been counting on 10 percent and that was a gross figure. We were down to only 3.5 percent profit now and had not yet taken into account inland transportation and other expenses. At the current price, it was unlikely that there would be any profit at all for Doug’s company.
>>
>>60075880
>>>/g/wdg
>>
>>60075651
with the type of stuff they buy in /csg/ you usually have a good idea what you're getting and there's a lot of competition when it comes to price and quality. it's mainly if you're trying to do business in china (or in other countries for that matter) that you risk getting screwed
>>
>>60075897
>>60075842
Why not just refuse to pay the fucker?
>>
File: 1445232539765.jpg (99KB, 540x540px) Image search: [Google]
1445232539765.jpg
99KB, 540x540px
>>60075783
>Library issue
What the fuck are the hacks at GNU doing?

>>60075842
>>60075897
Jesus christ. So why do companies and traders still do business with these slant-eye turbojews?

>>60075909
I see.
>>
>>60075546
>>60075565
How retarded would it be to simply enumerate every subsequence and find the max according to the total.
>>
>>60075925
>So why do companies and traders still do business with these
Learning is hard.
>>
>>60075910
>>60075925

The visit was a complete waste of time, Doug said, once we were in a taxi. My only defense was that I could not have seen any of it coming. We had contacted a number of suppliers. This one had seemed just as good as any other, and the pricing was favorable. My client said it was all right in the end, but I was bothered by the way things had turned out for him.

Cross-cultural negotiations were supposed to be about creating understanding and mutual respect. International trade was tough enough, what with inherent language barriers and great distances between buyers and sellers. I was feeling embarrassed, not so much for myself as much as for the way Doug had been treated. He was new
at the China game and a lot nicer than other importers I had worked with; certainly, I thought, he deserved better than this.

Some described Chinese business style as “soft,” though I never knew what to make of such commentary. Factory owners were aggressive more than anything else, and perhaps even a bit cruel. This one factory owner had encouraged his prospective customer to board a plane in the United States and fly all the way to China. Once
the investment in time and money had been made, the factory took advantage.

On the way to our next stop, Doug said that he would probably end up giving the factory the order anyway. He had an important customer back home that was already counting on the shipment of tubing. Even if he made no money at all on the order, there was some value, he said, in keeping his customer satisfied.
>>
>>60075857
You get to type niBBas on twitter
>>
>>60075939
>Even if he made no money at all on the order, there was some value, he said, in keeping his customer satisfied.
This shit needs a documentary film.
>>
>>60075939
>>60075971
It took several months for Bernie to secure an order with a major retailer. Styles and quantities had to be determined, and labels were often custom made. In some cases, customers wanted formulations adjusted. Decisions were made by committee, and prices were always agreed to in advance of any green light for a production run. Bernie was sure to confirm prices with the factory before confirming his own pricing with his customers, but then right after Johnson Carter received its order from the retailer—often just days before he planned to wire transfer funds to China—the factory would notify Bernie of a slight price increase.

Because large retailers made decisions by committee, it was next to impossible to make any changes once an order had been firmed up. Retailers expected that commitments made would be honored, so Johnson Carter was not likely to go back to the retailer just a week or two after all of the paperwork had been signed and risk upsetting the business relationship.
Of course, Sister denied that she was dealing in tactics; she claimed they had no choice. “Price go up!” she said, sounding urgent. It was one of the few phrases that she took the time to learn how to say in English, and she repeated it often.

Bernie said that he could appreciate the claim about rising prices, but how could the factory give notice of a price increase only after Johnson Carter had confirmed pricing with King Chemical and initiated the order with the retailer?

Increasing prices at the last moment was about moving profit margin from the importer to the manufacturer, and Bernie was not buying Sister’s excuses in part because he had been the victim of eleventh hour attempts rather often. Every time Johnson Carter placed a particularly large order, the factory made the same move. It waited until just after the orders were secured, and only then did it announce the increase.
>>
>>60075792
Carmack is very good at being a project lead it seems.
http://number-none.com/blow/john_carmack_on_inlined_code.html
Here's an internal pm to his development team. It's a very good read.
>>
>>60075971
>>60075939

After a long day of negotiations at King Chemical, Bernie promised that it would be the end of the business relationship. He gave the standard line that Americans give when jerked around. “Don’t they understand if they screw me like this, I’m never coming back?”

Threats were of no use in our case. The factory had managed to increase prices on a number of items on Bernie’s last visit, and he had similarly complained. He had raised his voice then and threatened that he would never return. Not only did he come back, but he brought even more orders with him this time.

What frustrated Bernie was that he had counted on a certain profit margin, but King Chemical had managed to cut right into that expected income. Bernie had done his part by going out and developing business. Having done this, he was now being told that his share would be diminished.

In certain parts of China, there were fishermen who trained birds to catch fish. They tied the necks of the cormorant, a bird which looked a bit like a pelican, with a piece of string so that it could not swallow the fish that it caught from the river. Just as soon as the bird had a fish in its bill, the fisherman yanked it back with a rope attached to its foot.

These fishermen could be seen in action on the Li River near the town of Yangshuo. What struck me most about the thing when I saw it was the bird’s incredible optimism. It didn’t realize that it was a sucker, and no matter how many times it was sent out into the water, this gullible bird had its quarry taken away.

Watching King Chemical’s last-minute pricing tactics, I came to understand: Johnson Carter was the bird; the factory was the fisherman.

Bernie flew around the United States and signed up new clients, customers who would enable him to send millions of dollars worth of business to China. He created a margin for himself, and just as soon as he was about to enjoy the fruits of his labor, the factory came and took them away
>>
File: 1457794098321.png (79KB, 250x250px) Image search: [Google]
1457794098321.png
79KB, 250x250px
>>60076056
>Bernie flew around the United States and signed up new clients, customers who would enable him to send millions of dollars worth of business to China. He created a margin for himself, and just as soon as he was about to enjoy the fruits of his labor, the factory came and took them away
YAMEROOOOOOOOO
>>
>>60076056
Sounds like this Bernie should look for who the Chinese factory compete with. Make it clear he has contingency plans but make it vague enough that they can just wonder. Instead of thinking the Chinese is naive enough to just take his word for it that he'd be leaving.

Bernie hasn't had to negotiate with children it seems.
>>
>>60075857

Being able to understand a little bit of computing history maybe? It's not exactly a good language. Think C, but even more limited. Also, it's got a couple of odd quirks, like not actually having types. A "character" is technically four chars stuck together inside of an int, and so yes, you can do this in B:

auto blarg = 'ab';
putchar(blarg);


Oh by the way, it was designed for machines with 36-bit words, not 32-bit. A char (again, no types, so really this is just auto) is technically 9 bits. Obviously, if there were a modern compiler for this language, one would need to adjust this.
>>
>>60076117
>>60076162

On the last day of our meetings with the factory, Bernie said that he was at the end of his rope. He did not want to change suppliers because of the time it would take to get an alternate up to speed. There was another reason that he had not wished to quit the relationship—and it had to do with how King Chemical knew too
much about his business.

The promise of continued orders had kept the factory from engaging in broader, unscrupulous acts. Once the manufacturing relationship ended, who knew how the factory might respond. King Chemical might approach Johnson Carter’s largest customers and try to take them away, or maybe the factory would court some of the importer’s competitors. Johnson Carter was growing fast enough that others would want to know how Bernie had done it.

King Chemical had access to all aspects of the product line. It had the molds for bottles as well as the label designs and the formulations. Since quitting the business would potentially create losses for King Chemical, they would likely be motivated to fill the income gap in some way.

One thing Bernie worried about was that King Chemical would counterfeit his product line. If it did so, Johnson Carter would be in no position to learn about such activities once the relationship was dissolved. Johnson Carter leaving the relationship might change motivations in ways that we didn’t even understand.

Bernie said that he felt that the factory left him with no choice. Quality was a continued question mark, and the pricing games were now too much to bear. We had to find another supplier, he said. A new supplier might be just as bad as the current one, which was another argument against leaving, but at this point it was a chance worth taking.

After our last pricing meeting with the factory, Bernie pulled me aside. He told me that it was time to chase down another opportunity. “Be discreet. Make a few appointments. Show them the catalog.”
>>
>>60071745
hi karen
>>60072207
what is a dynamic language?
>>60072983
no, you're changing the values of integers. this is like saying "1" is just shorthand for "8" and the language will believe you because of stupid design
>>60073402
>cocaine is a hard drug
>alcohol is not
>>
>>60076162
The first manufacturer was a surprising disappointment. The factory owner told me that he knew all about Johnson Carter. Just looking at the catalog and seeing the company name, he knew that we were tied with King Chemical. He knew what we manufactured, and he added that he was friends with Sister, as well.

Like many other sectors, the health and beauty care industry was
one that existed in a tight network.

[...]

China’s tight networks were a part of its advantage. They were one of the reasons that manufacturers were able to get things done so quickly. Factories were connected not just to subsupplier networks, but also to other manufacturers. They shared information, contacts, and resources. But these networks were also a threat—to importers. While it remained illegal for companies to collude, it was difficult to monitor such activities from abroad.

Critics of globalization talk about how we have outsourced our values by allowing overseas firms to make products under conditions that Americans would never allow at home. One of the other things that we gave up with global trade would inevitably be the opportunity to prevent marketplace collusion.

Sister found out about my visit almost immediately after the meeting was finished. It actually pleased her to know that I had been to see one of her competitors, and she seemed to enjoy that the news had traveled back to her so quickly and that we were having little luck in finding an alternate supplier.

In pricing negotiations, Bernie had hinted on occasion that he might take his business elsewhere. When he made these veiled threats, Sister was inclined to soften her position in response. Now that Johnson Carter had actually taken action and the plan had backfired, our bluff was called, leaving Sister in an even better negotiating position.
>>
>>60076210
>After our last pricing meeting with the factory, Bernie pulled me aside. He told me that it was time to chase down another opportunity. “Be discreet. Make a few appointments. Show them the catalog.”
Holy shit this is better than my animu
>>
>>60076214
Cocaine is 10 times more addictive and destructive than alcohol. People get addicted to alcohol as a coupling mechanism. No one takes a sip of beer and ends up injecting alcohol into their veins on the streets a year later. Coke has ruined people's life with one taste.
>>
>>60076214
>what is a dynamic language?
Probably shit.
>>
>>60076239
>Sister
What the fuck is up with this name?
>>
>>60076310

China was exotic, but it was not bizarre. Chinese did not dress in native costumes, they wore no headdresses or long robes, they did not go around in sandals. They did not have the habit of sitting on the floor. Chinese did not bow or require that a visitor make unfamiliar hand gestures, and the people were pleasantly irreligious. Though there were holidays, meetings were not interrupted by frequent prayer times. The Chinese were traditional, but not fanatical. They did not paint their faces or tattoo or pierce their bodies. Such colorful native traditions made for interesting tourism, but people on business were not vacationers.

Some of this cultural flattening was a conscious attempt by the Chinese to appeal more easily to Westerners and appear more up to date. Seeming modern and sophisticated was a source of face, and many Chinese went to great lengths to look comfortable in a rapidly globalizing world. Factory owners dressed like their foreign business partners—slacks, collared shirts, and shoes—and they took English names for themselves.

Despite China’s insistence on having a unique culture that stretched back for millennia, there is no other country in the world whose citizens have given themselves alternate English names in such numbers and with so much enthusiasm. In places like Japan, India, and Mexico, you were forced to learn how to pronounce the real names of the people with whom you were doing business.
>>
File: mosaic.jpg (16KB, 311x376px) Image search: [Google]
mosaic.jpg
16KB, 311x376px
How hard would it be to connect Gnubik to IMDB? My idea is basically this:

>user selects a genre, actor etc. for the cube
>Gnubik pulls six random posters matching said criteria from imdb
>Gnubik crops them onto the cube
>user solves the cube

It can already crop images to the cube, so I'd just need to hook it up to the 'net somehow?
>>
>>60076264
??? who the fuck has ever injected cocaine? and who takes it orally for that matter?
alcohol is definitely more addictive than cocaine HCl, probably more addictive than freebase/crack too. in terms of withdrawals, cocaine does very little in comparison and is much easier to kick. people get addicted to any drug as a coping mechanism (why do u think heroin is so high up there?). the only reason people talk about cocaine being so addictive is because it's so common for people to drink alcohol daily that nobody really notices anymore. the only more destructive part of cocaine is the price, which would not be an issue if it were legal.
>>
>>60076416
Please stop posting before you embarrass yourself any further.
>>
>>60076444
please stop posting before you talk about injecting cocaine again lol
>>
>>60076416
People take heroin because it is fucking addictive and not because it is a coping mechanism you fucking moron.
>>
is clojure the best lisp flavor?
>>
>>60071787
ESR is cancer but he was right about SJWs in OSS
>>
>>60076529
>C++
>Einstein
You're trying to be ironic, right?
>>
>>60076466
that's not the consensus scientists seem to have. regardless, alcohol is addictive in the exact same sense heroin is (withdrawals, tolerance, & reinforcement). in fact, alcohol has more severe withdrawals and the regular usage patterns (drinking every weekend, having wine with dinner, etc.) cause you to become addicted more often.
http://www.reuters.com/article/us-drugs-alcohol-idUSTRE6A000O20101101
http://www.nbcnews.com/id/39938704/ns/health-addictions/t/alcohol-more-dangerous-heroin-cocaine-study-finds/
>>
File: smart.jpg (253KB, 1200x1467px) Image search: [Google]
smart.jpg
253KB, 1200x1467px
/* Copyright 2017 anon42
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <iostream>

using namespace std;

int main()
{
for(int i=0; i<=100; i++)
{
if (i%3==0 && i%5==0)
{
cout << "fizzbuzz\n";
}
else if (i%3==0)
{
cout << "fizz\n";
}
else if (i%5==0)
{
cout << "buzz\n";
}
else
{
cout << i <<endl;
}
}
return 0;
}
>>
File: 1493141130329.jpg (898KB, 1570x1876px) Image search: [Google]
1493141130329.jpg
898KB, 1570x1876px
>>60072034
>Rust fag doesn't know about zero abstraction cost
>>
>>60076544
Not saying I don't believe you but
>New study
>No link to study
Every fucking time.
>>
File: 1483903663990.png (501KB, 739x931px) Image search: [Google]
1483903663990.png
501KB, 739x931px
>>60076553
It's beautiful, anon-kun~
>>
>>60076562
http://thelancet.com/journals/lancet/article/PIIS0140-6736(10)61462-6/abstract
here's the study i think it's talking about, sadly they require an account to view the PDF
>>
>>60073955
>implying you're forced to use templates
>>
>>60076575
Sad. Would have been an interesting read. Thanks anyway.
>>
>>60076602
https://docs.google.com/file/d/0B6qPrO00oPnZRmRTX2lxOEx3UmFrcjBXbkFUbzg5UEZHN25J/edit
i actually found (some of?) the study here if you still want to read it
>>
Any algorithm books you guys would recommend? I'm a freshman and I'm having a little bit of trouble thinking like a programmer.
>>
>>60075561
I know that this problem has a simple solution, but I don't know what that solution is. I was wrong when I said earlier that we don't know the size of the array, it's the max value that we don't know, so can't do a counting sort style solution.
>>
>>60076635
Sedgewick, only down side is he uses Java.
For more algorithms, CLRS.
If you want to lose your sanity, Knuth.
>>
>>60072490

Enterprise Grade though
>>
>>60076610
it's one of multiple related studies. 2 more from the same dude (can't find PDFs): https://www.ncbi.nlm.nih.gov/pubmed/17382831, https://www.thevespiary.org/rhodium/Rhodium/Vespiary/talk/files/6416-615_Pharmacology_Therapeutics_NUTT_Rational_Scale_Harm_Drugs_Misuse07ea.pdf
>>
File: feel.png (58KB, 645x773px) Image search: [Google]
feel.png
58KB, 645x773px
print("I am lonely")

MySelf.destroy()
>>
>>60076707
forgot your semi-colons
>>
>>60076382
Use libcurl to do the queries to IMDB and get an image; it uses gdkpixbuf and the actual image stuff is done in cubeview.c by the looks of it. Just plug in your curl-downloaded image as if it was a regular file.
Would be cool to port it to programmable pipeline and glfw with stb_image to do image loading; would be blazing fast and no more shitty gdk/gtk deps. Would also get rid of those jaggies since glfw can do multisample buffering out of the box.
>>
how do I become a c++ code artisan?
>>
Is react-native a meme? Can you build a 4chan app with it?
>>
>>60076904
Start by not pooing in the loo
>>
>>60076553
>curly braces for main at mid indentation
>curly braces for other blocks at the start of the block

My eyes
>>
File: Fridgebike.jpg (166KB, 1280x529px) Image search: [Google]
Fridgebike.jpg
166KB, 1280x529px
>>60072034

Nah mate. Try FridgeBike.
>>
>>60071726
Should I read Art of programming? Is the 4 volumes worth it?
>>
You people engage in your waifu^Wlanguage wars but what are you working on in said language?
>>
>>60077010
a programming language
>>
>>60077010
First, they're called langfus. Second, I program completely useless shit I find on /g/.
>>
I got tired of doing
source ~/.virtualenvs/[project]/bin/activate
so I wrote this script called `activate` and symlink it in to new project directories.

#!/bin/bash
venvpath="$HOME/.virtualenvs/"
project=`basename $(pwd)`
activate="/bin/activate"

echo $venvpath$project$activate


And I call it with
source $(./activate)
since using `source` inside a script just sources it for that scope then it's gone when the script exits. Is there a way to call `source` inside a shell script and have it apply to the shell the script is called from?
>>
>>60076904
Start by dissing c and laughing at rust
Then shit on go and pity on python
Then laugh a little more at Java
Finally, ROFLayyLMAO on C#

And you become a c++ code artisan
>>
>>60077053
so every /g/entooman on /dpt/ is a c++ code artisan?
at last I truly see
>>
>>60077040
There's a project called workon already.

It even has autocompletion, so you just write
workon project
>>
>>60077076

lul fuck me
>>
>>60077073
Most likely, otherwise they should feel really embarrassed.

>>60077053
I forgot you have to forget D, like everybody else does
>>
>>60077085
Oh wait, the project is actually called virtualenvwrapper, workon is the command it comes with
>>
>>60076948
you must be a really good c++ code artisan
>>
>>60076972
>and then there's java
nicely meme'd
>>
>>60077053
i like how you didn't even mention haskell/idris

that's how irrelevant they are
>>
>>60072558
>my name is pajeet and I smell like sheet >what are concepts
>>
File: 1486442287438.jpg (58KB, 560x560px) Image search: [Google]
1486442287438.jpg
58KB, 560x560px
>>60077107
>I forgot you have to forget D, like everybody else does
no bulli d-chan pls
>>
File: net.jpg (22KB, 579x386px) Image search: [Google]
net.jpg
22KB, 579x386px
How do I learn .NET?
I've done heaps of programming in Java, C++, C#(Desktop), VBA, HTML, JavaScript, PHP, Java Servlets.

I want to learn some .NET
how do I do that?
>>
>>60077347
Does it really count as bullying if they're dead?
>>
File: 1488944294986.jpg (29KB, 497x480px) Image search: [Google]
1488944294986.jpg
29KB, 497x480px
>>60077488
s-she's not dead! she's just in a coma!
>>
New thread:

>>60077582
>>60077582
>>60077582
>>
>>60077487
msdn I guess
>>
>>60073414
Dumb frogposter
Thread posts: 314
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.