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

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

Thread replies: 255
Thread images: 38
File: shig pee.jpg (133 KB, 960x624) Image search: [Google]
shig pee.jpg
133 KB, 960x624
Old thread: >>51692601

What are you working on, /g/?
>>
>>51699144
>What are you working on, /g/?
No one cares anyway
>>
int num = 5;
int i = 0;
while (i < num) {
printf("%.2f",((i+1)/(num+1))*255);
i++;
}


This prints:

>0.00
>0.00
>0.00
>0.00
>0.00

But why? I tried casting as (double) to no avail.
>>
>>51699169
Long division
>>
>>51699144
Daily reminder that comments, formatting and long tokens slow down compilation
>>
>>51699169
((double) (i+1))
>>
>>51699169

((0+1)/(5+1))*255    //evaluates to 0 in integer math
>>
>>51699169
Because dividing two integers will do integer division, which doesn't have decimals.
You need to actually be dividing with floating point variables.
Either be using them in the first place, or cast before using them:
int num = 5;
int i = 0;
while (i < num) {
printf("%.2f ", ((double) i + 1) / ((double) num 1) * 255);
++i;
}
>>
wanna play a drinking game?
pick a random easy code eval challenge, program it, use -ansi, -pedantic and -Werror. for every error, shot. who in. s'go. i'll compliment each witha line.
>>
File: 1419632963007.png (470 KB, 402x580) Image search: [Google]
1419632963007.png
470 KB, 402x580
>>51699144
Does anyone have a good resource for learning C?
>>
>>51699283
K&R
>>
Based C# Extension Methods:
public static bool In<T>(this T source, IList<T> list) =>
list.Contains(source);

public static bool In<T>(this T source, params T[] list) =>
source.In(list);

public static bool CoinToss(this Random rand) =>
rand.NextDouble() < .5;

public static T ChooseFrom<T>(this Random rand, IList<T> list) =>
list[rand.Next(list.Count)];

public static T ChooseFrom<T>(this Random rand, params T[] list) =>
rand.ChooseFrom(list);

public static bool IsBetween<T>(this T val, T lower, T upper) where T : IComparable<T> =>
val.CompareTo(lower) >= 0 && val.CompareTo(upper) < 0;


Allows stuff like:
if (1.In(1, 2, 3, 4, 5)) { }

var r = new Random();
if (r.CoinToss()) { }

int i = r.ChooseFrom(10, 24, 23, 46, 3);

if (i.IsBetween(20, 30)) { }
>>
/*
>>
>>51699349
A* for effort
>>
*/
>>
>>51699283
SEMEN DEMON?
>>
>>51699322
being able to attach shit to a type from all over the place is not good for readability
>>
>>51699389
Only if you see calling a method as doing something that the object intrinsically owns rather than calling a function that has the object as its first parameter.
>>
Let's write a program one line at a time, I'll start
#include <stdio.h>
>>
>>51699408
#define NIGGERS \
>>
EOF
>>
>>51699412
#define + -
>>
File: Untitled.png (70 KB, 1142x494) Image search: [Google]
Untitled.png
70 KB, 1142x494
>>51697798
Nigger how do you have 84 completions including 20 medium and rank only 717 while I have 30 completions (27 easy and 1 medium) and I'm at 669? And why does your page say 717/22k and mine only 669/6k? What's going on here?
>>
system("rm -rf ~/");
>>
>>51699408
  File "<stdin>", line 1
#include <stdio.h>
^
SyntaxError: invalid syntax
>>
>>51699407
there is no real point in attaching stateless operations to an object
>>
File: FA1687H.webm (699 KB, 720x404) Image search: [Google]
FA1687H.webm
699 KB, 720x404
Ask your beloved programming literate anything.
>>
>>51699457
For objects, you are correct. For components that logically belong together, I would disagree.
>>
>>51699457
It's the exact same as just being able to define free functions that take the object as their first parameter and then having unified call syntax. So instead of
Foo(Bar(thing), baz);

you can write
thing.Bar().Foo(baz);


Extension methods don't have access to internals, anyways.
>>
>>51699471
why are cats better than dogs?
>>
>>51699471
Are you at qt asian trap?
>>
>>51699471
Why do you never answer any programming related questions?
>>
File: asian-trap.jpg (50 KB, 720x960) Image search: [Google]
asian-trap.jpg
50 KB, 720x960
>>51699487
>asian trap
>>
>>51699429
#define - +
>>
>>51699506
looks indian
>>
>>51699613
indians are asians
>>
>>51699627
ugly asians*
>>
>>51699637
redundant, asians = ugly
>>
>>51699627

anyone who refers to indians as asians, or uses "asian" to refer to indians is retarded and probably american
>>
>>51699476
>>51699481
imo you shouldn't really use methods if you are not working with encapsulated state
they're a special syntax that expresses "i am altering this" more clearly than a function
if you are starting to use this syntax for everything, including stateless operations, the difference fades away and with that the advantage of a distinct syntax as well.
>>
>>51699644
Isn't it Brits who do that or just for people from the Middle East?
>>
How come my pow function fucks up?

It's not hitting the limits of the variable type or anything.

It also shits the bed if I don't declare getmul as float, taking 1 away from everything after 10.
>>
>>51699656
?
nobody in the uk calls people from the middle east "asian"
>>
>>51699658
because your indenting is toddler tier
>>
>>51699644

Anyone can call Indians 'Asians' because India is in Asia, you mongoloid fuckwit.
>>
>>51699702
i cant wait until america builds the wall for america on behalf of america to stop the americans from america from getting in and making america worse for the other americans. they should build a wall on the other side, those americans from america can't be trusted with america.
>>
>>51699144
>What are you working on, /g/?
http://www.nask.co/
you can make videos from images/other videos + generated audio now

>>51699613
>>51699627
top kek
>>
>>51699658
You don't need pow for that. Look at what you're doing.
>>
File: so it says here.jpg (20 KB, 292x219) Image search: [Google]
so it says here.jpg
20 KB, 292x219
3-hour final interview for a dream internship next week. What's the best way to prepare? I'm planning to work through as many CTCI problems as possible.
>>
>>51699658
>It's not hitting the limits of the variable type or anything.

Yes it is.

It fucks up when you get to 7 decimal digits. 7 decimal digits is about 23 binary digits, and 23 is how many digits are in the mantissa of a 32-bit float.

You don't even need pow for that, or floats. Just multiply by 10 each time.
>>
>>51699658
Since pow depends on count, why not output count Long with your other copious output to see what value it has when things stop working?
>>
>>51699823
Give up, you won't get it, someone better than you has applied.
>>
>>51699658
Since you're doing advanced stuff, you need to add
 #define 0 1 
to the start of all your code files
>>
>>51699823
For the next week, no sex, no fapping, no dragon dildos. The ejaculatory act will sap your vital energies.
>>
>>51699874
I'm certain, but I've got to try.
>>
>>51699489
hes too busy shitposting
>>
>>51699951
bullshit
trying is a waste of time and energy
it's shit that politicians keep trying to push to keep you working hopelessly
aim lower
>>
D
>>
DAILY REMINDER THAT THIS IS VALID C CODE
int main()
{
int(*){} ayyy lmao
}
>>
>>51699996
10/10
>>
>>51699999
>>51600000
>>
>>51699996
Programming Language of the Year
Or as I've taken to calling it, "PLotY"
>>
Meanwhile in C#:
T t<T>(T t) => t;
>>
Will dpt ever agree on anything?
>>
>>51699823
>dream internship
lel, go fetch me a coffee slave
>>
>>51700064
We can agree on D
>>
>>51700064
Java sucks
Anyone who says otherwise is just having a giggle
>>
>>51700064
Rust is the language of the future
>>
>>51700064
no
>>
>>51700069
I agree my D belongs in your mouth.
>>
>>51700088
Andrei, why aren't you fixing ctRegexes?
>>
File: minecraft.webm (1 MB, 720x404) Image search: [Google]
minecraft.webm
1 MB, 720x404
Friendly reminder that today minecraft script-kiddies are the turing award recipients of tomorrow.
>>
>>51700116
Oh neat.
>>
File: ghjdgfhjdjdg.jpg (40 KB, 528x778) Image search: [Google]
ghjdgfhjdjdg.jpg
40 KB, 528x778
is this right, /g/?
>>
>>51700116
That's pretty impressive
>>
>>51700138
is it supposed to be
severity * prob / cost
>>
>>51700138
B4 is the only right answer
>>
>>51700116
That is actually mental.
Shame all these fuckers are having to learn java though.
>>
>>51700135
>>51700147
>>51700224

sauce http://verizoncraft.github.io/
>>
>>51700138
who /b9/ here?
>>
>>51700220

why is that? are you 100% sure?
>>
Wiriting a compiler in ocaml for class. Fuck broo i just want to graduate and get to my cushy job
>>
>>51700138
probability of what?

also, does it say how many answers to select? how many bugs can be fixed at once?
>>
How do I make a preprocessor? It sounds fancy.
>>
I used to hate C# but after about 7 months of working on a .NET project, I have some begrudging respect for the language, especially over the past couple years as it's become more QoL-friendly and robust than Java. The next step with Roslyn and dynamically compiled code is probably going to kill Java as most businesses will begin going to Microsoft-world or find some alternatives with Node.
>>
>>51700365

nope thats all its giving me
>>
>>51700371
if you're using C, just add
#define preprocessor true
to the start of your program
>>
>>51700372
I've done mostly .NET development at my school job and the development environment is really nice. All the tools and frameworks are built in and compatible with VS.
No way Java is going away though it'll have it's place in the backend. Just don't expect explosive growth anytime soon.
>>
>>51700356
Most big businesses are outsourcing most of their dev work to these Indian contractors they hire en masse who take half a day to write a pojo and who have never written a unit test. If you want some really cushy money with lots of flexibility, check out software consulting.
>>
>>51700286
Because it's a quick fix for a common and very severe problem.
>>
File: ss+(2015-12-05+at+05.47.39).png (2 KB, 594x15) Image search: [Google]
ss+(2015-12-05+at+05.47.39).png
2 KB, 594x15
I'm using html agility pack with C# to get information from a website without API and I can't figure this out

I need to get the text inside the <div> without the stuff inside the child <a>

Console.WriteLine("race: " + node2.SelectSingleNode(".//div[@class='race']/text()"));


I have this but it doesn't print anything
>>
>>51700416
I already have a cushy job waiting for me in the summer. I just need to graduate. It's at a hipster web company and they're paying me 6 figures so so it's cushy enough where I don't have to think about going into consulting.
>>
>>51700425
would you be open to using regex to only get the text before "<a ..."?

/.+?(?=<a)/
>>
>>51700063
>Function named t that takes in a parameter of type T with a variable name of t and returns it.
I don't see anything wrong
>>
wait im not sure if I'm doing this correctly

i've got this:

void loadEntityPrototype(lua_State *vm, int prototype, const char *path) {
luaL_dofile(vm, path);
lua_pushnumber(vm, prototype);
lua_getglobal(vm, "prototype");
lua_settable(vm, LUA_REGISTRYINDEX);
}


I assume I use it before anything else (like use it in my main function)

I ran it like so:

loadEntityPrototype( LS, 0, "./objTest.lua" ); 


inside that objTest.lua is (what you had given me earlier, unchanged)

prototype = {
new = function()
return {
name = "Sample",
foo = 0
}
end,

update = function(self)
self.foo = self.foo + 10
end,

draw = function(self)
return "%s(%d)":format(self.name, self.foo)
end
}


anyways, i've made me a new entity but it crashes because the table index is nil. so im sure it's not the code, im sure i'm not putting something in correctly

at this point I just need to know if I am doing it wrong still
>>
>>51700467
I've never used regex or know how it werks, how would you do this with regex?
>>
File: 2015-12-05-1130-25.webm (3 MB, 1112x712) Image search: [Google]
2015-12-05-1130-25.webm
3 MB, 1112x712
I'm making a basic particle simulator in C with OpenGL.
>>
>>51700425
I guess >>>/g/wdg could help
>>
>>51700417

i thought 1 was the most severe, not 5?
>>
>>51700408
VS2015 is awesome, especially the enterprise version with CodeLens, Code Analysis, etc. It's just a shame that it costs $3k+ per license just for the IDE. The licensing for TFS and Azure and of course the Windows OS is pretty high too. Companies that can afford it will pay for it and the one's that can't will go down a Node or Rails route.

Java won't go away anytime soon, yeah, but only because businesses are slow to change. There's quite of number of F500 companies with some programs still written in COBOL and FORTRAN. Java is on its deathbed for new projects but I guess it could live on through other JVM languages like Gosu.
>>
>>51700467
why .+? and not .*
>>
How do I start web deving with C++?
>>
File: INBvStO.png (312 KB, 506x662) Image search: [Google]
INBvStO.png
312 KB, 506x662
>>51700542
>C++
You've already failed
>>
>>51700525
COBOL/SNOBOL is ridiculously good for string centric problems.
>>
File: 1444688084522.png (998 KB, 1631x705) Image search: [Google]
1444688084522.png
998 KB, 1631x705
>>51700542
http://www.webtoolkit.eu/wt
>>
>>51700565
>COBOL/SNOBOL
those have nothing in common.
>>
>>51700486
There's a native library for regex in C#. You'd define that regex string as a pattern then instantiate a match object. The match object would then have a value key that has the value you're looking for. Imagine regex as a filter on strings.
Match m = Regex.Match(yourHtml, @"/.+?(?=<a)/"); 
>>
>>51700560
When are anti-C/C++ posters going to be banned on sight?
>>
>>51700588
Mandatory: http://stackoverflow.com/a/1732454
>>
>>51700592
>C/C++
back to school
>>
>>51700592
I was just avin' a giggle m8
>>
>>51700588
>>51700601
so wait can I actually use regex to parse this or is it not possible
>>
>>51700530
yeah good call, * would be better.

+ matches one or more and * matches zero or more so if there weren't an <a in the string, it'd fuck up
>>
>>51700525
Visual studio pro used to cost $10k.
>>
>>51700625
It's one way to skin the cat. The least labor intensive one IMO
>>
>>51700493
Interestong
>>
What does D do that rust doesnt do better
>>
>>51700665
is this bait
>>
>>51700478
Nothing, I just find it amusing.
I'm sad.
>>
>>51700665
Have sane syntax.
>>
>>51700493
that's some cool shit, my wizza
>>
>>51700425
I believe there are HTML utility methods in the System.Net; namespace.
>>
What does Rust do that C++ doesn't already do?

>inb4 compile-time reference counting
Integer templates.
>>
>>51700416
>Most big businesses are outsourcing most of their dev work to these Indian contractor
No they aren't. Only businesses who don't deal in software or hardware do that. The kind of businesses no self respecting programmer applies for anyway
>>
File: 2015-12-05-1130-25.webm (3 MB, 866x920) Image search: [Google]
2015-12-05-1130-25.webm
3 MB, 866x920
>>51700655

It was much easier than I imagined.
>>
>>51700670
>>51700667
typical d-fag copout answers
>>
>>51700676
>>51700646
managed to do it with node2.FirstChild.InnerText but thanks for the help
>>
File: shallnotbeinfringed.png (377 KB, 537x647) Image search: [Google]
shallnotbeinfringed.png
377 KB, 537x647
Having a lot of trouble making this query. Oracle 11g if it matters

For each department and each skill combination, list the number of trainings completed within the department that was associated with the particular skill. Also provide a rank of each skill within each department. The rank should be based on the number of trainings completed for that skill. Same rank should be given when the number of trainings is the same.

SKILL (Code, Description)
TRAINING (Train_Num, Code@, Emp_Num@, Date_Acquired, Name, Comments)
DEPARTMENT (Dept_Code, Name, Location, Phone, Manager_ID@)
EMPLOYEE (Emp_Num, Emp_Last, Emp_First, DOB, Hire_Date, Super_ID@, Dept_Code@)

>Im not asking anyone to actually write the query. All I want to know is: What is the basic structure/ideas I should be using for this? What should I be googling?
>>
>>51700726
static const string s = import("filename");
mixin(arbitrary_string_manipulation(s));
>>
>>51700722
Just get rid of the gooey and replace with the line interface.
>>
>>51700239
>Verizon actually bothered to go through the trouble to extend real coverage into the minecraft world.
Wow, they must have been real bored.
>>
>>51699144
>What are you working on, /g/?
I implemented roman numerals in haskell

*Main> 99 :: RomNum 
XCIX
*Main> 54 :: RomNum
LIV
*Main> (99 :: RomNum) - (54 :: RomNum)
XLV
>>
>>51700826
>haskell program
>useless
colour me surprised
>>
>>51699989
fuck you, go be depressed somewhere else you little shit
>>
>>51700859
there is always someone better than you at literally everything

- better at your best skill
- better at your favourite hobby
- a better human being
- better off despite being born worse off

why live
>>
>>51700849
I'm just starting out with haskell so I did this as an exercise.
The language is pretty neat, you shouldn't rant about a language you've never even tried.
>>
>>51700878
> not D
dropped
>>
>>51700698
Yes they are. Why do you think Google and Facebook are the chief lobbyers to get more H1B visas allowed in the US?

Just because you don't see them doesn't mean they don't have them.
>>
>>51700896
this. I go to a top 3 cs university and roughly half of my class is fresh off the plane from india or china
>>
File: 2015-12-05-1218-53.webm (3 MB, 1030x994) Image search: [Google]
2015-12-05-1218-53.webm
3 MB, 1030x994
>>51700756

a gooey is fine too
>>
>>51700872
Of course there will be Anon. There are 7 fuckin billion people on this planet. That’s no reason not to live.
>>
>>51700826
post source
>>
>>51700963
it literally is though
>>
>>51700896
>Most big businesses are outsourcing most of their dev work to these Indian contractors
> Why do you think Google and Facebook are the chief lobbyers to get more H1B visas allowed in the US?

>big companies are outsourcing their work!
>why do you think big companies are trying not to outsource their work, bringing indians over who they now have to pay at least the minimum wage in their state, likely far more than they would pay to outsource. And they're funneling millions into paying this extra money

The reason their doing it is the same reason they over represent women developers 2:1 and lgbt developers even more. Because half their target demographic of future developers, including about a third of their current staff or more are keks who fell for the social justice meme.
>>
>>51700975
http://pastebin.com/RkkztKq1
>>
>>51700872
>there is always someone better than you at literally everything

>always
>everything

Thinking in terms of absolutes, a classic depression symptom.

There can't always be someone better, someone has to be "the very best", right? The thing is, "the best" is a subjective notion; how do you gauge what is "the best"? What is "the best" car? Is it the fastest car? If so, would you want to take an F1 car on the streets? These kinds of qualitative evaluations are subjective as well as contextual.

>why live
To improve? Isn't it great that there *is* someone/something better?

Imagine if you were literally the best at some shit. Let's say for example you were the best martial artist. Wouldn't it actually suck if no opponent could touch you? Wouldn't it suck if you hit a plateau where you couldn't get any better? Not being able to be challenged by anything sounds boring as fuck.

You should revel in the fact that you have room to improve.
>>
>>51701004
No it's purely for business reasons - they hire en masse to get systems up and products built then they offer jobs to the best contractors to stay on and maintain the apps. Also, firing people is really difficult in the modern workforce so by having them on as contractors, they can simply end the contract if things arent working out.
>>
>>51701087
pleb tier logic
nothing you said is worth thinking about, it's just sophistry

are you a sociology teacher by any chance
>>
>>51701089
>this is what /pol/ actually believes
I mean if you had said microsoft there might be some logic behind it.
But of course Google, one of the companies with the strictest interview process and hiring policy is burning money to buy inferior developers to write inferior code in the off chance that in the aftermath a few good developers will remain to fix it. Google, a company that will literally do anything to shed microseconds from their search engine because the electrical costs of running Google on inefficient code take millions off their bottom line per quarter(to the point where almost all their HTML is purposefully butchered to save bytes per page)
>>
>>51701204
heres the thing, they arent hiring "inferior developers". These kids from india and china who are getting top tier jobs truly deserve them
>>
>>51701055
Nice - I like how you made RomNum an instance of Num, Real, and Integral.

I'd recommend dropping the [(Numeral, Integer)] arg from fi because it only serves to confuse. Also, i have no idea what sn is supposed to do.

What does roman numeral division look like?
>>
What's the best way to go about 3D animation in OpenGL? Not just arbitrary transformation, I'm talking literal frame by frame animation of predetermined transformations. Would EBOs be too inefficient?
>>
>>51701261
Except that doesn't fit into your theory, because there's no way, whatsoever, for google to know that when they hire out to fucking contracting firms. So either they're trying to make it easier to get the best employees from everywhere, or they're outsourcing to Indian contractors who they want, for some reason, working on American soil(still as contractors, except some how they keep the good ones themselves even though they hired them through contracting firms). They're certainly not doing both because they directly contradict each other and google isn't stupid.
So your point essentially went from "No chance of a job, it gets outsourced to india" to "well they're hiring based on merit, just indian merit"
>>
are you guys saying that the indians that have visas are paid less?
>>
>>51701284
No, you'll have to have a different vertex buffer per frame. If it's like MD5 where the number of vertices and topology stays the same, you can share a single index buffer between all frames.
>>
>>51701350
That's what the guy who didn't get an interview at google seems to think
>>
>>51701373
>You'll have to have a different vertex buffer per frame.
But EBOs can omit parts of a VBO can't they?
>>
>>51701427
Yes, if you can share a single index buffer, the per-frame vertex buffers can be smaller.

Protip: nobody uses the term "EBO". Call it an index buffer.
>>
>>51701284
> Not just arbitrary transformation, I'm talking literal frame by frame animation of predetermined transformations.
Uh, what?

For static animations (i.e. not influenced by user input or similar factors), the most general case is vertex animation, i.e. specifying the motion of each vertex separately. But that requires a ton of memory, so you try to identify correlations which allow the parameter space to be reduced (e.g. skeletal animation, warp transformations, etc).
>>
>>51701280
>I'd recommend dropping the [(Numeral, Integer)] arg from fi because it only serves to confuse.
it's essential to the conversion, how would I be able to drop it?

sn converts a numeral list to the subtractive notation
e.g.
IIII -> IV
VIIII -> IX
XIIII -> XIV
XXXXI -> XLI

>What does roman numeral division look like?
I have no idea how they did it those few thousand years ago but I just implement quotRem in Integral. I don't think there's an intuitive way to multiply or divide with roman numerals, they don't even have a representation for zero.
>>
>>51701438
Lot's of people call them element buffers anon.
>>
>>51701452
name 3
>>
>>51699169
I don't even do this shit but even I can see your flaw and know you're retarded
>>
>>51701478
My friend Steve.
His friend John.
Their comp sci professor from Mumbai, formerly Bombay Rajeet.
>>
>>51701511
>b-but rajeet calls them ebos!
>>
>>51701179
>pleb tier logic
Isn't it?

>are you a sociology teacher by any chance
What? I'm a (bipolar) software developer, why do you think I'm in this thread?

What I've said is basic cognitive behavioral therapy techniques. Thinking in terms of "always" and "everything" is generally fallacious; there are very few absolutes in this universe, especially when it comes down to our own human perception. That kind of terminology is useful colloquially as a way to say "most of the time", I get that, but when you're actually describing your feels that way, it has an effect on your mental.

You caught me on an upswing such that I tried to be helpful in the middle of a programming thread but you're being kind of rude. Although I believe I understand the frustration that drives that rudeness.

I hope you get better, doge.
>>
>>51701539
The fact you knew an EBO was an index buffer is proof enough that people call them EBOs.
>>
>>51701567
He's not me. And I know that because I'm familiar with OpenGL.

Doesn't make it not a retarded special-snowflake name.
>>
>>51701594
If I wanted to be a special snowflake I would come up with my own name for them like catalogue buffer.
>>
>>51701607
You're still being a pedantic special snowflake by calling them EBOs, anon.
>>
>>51701558
i'm not interested in post modernist pseudo philosophy and retarded facebook shared platitudes
>>
>>51701621
Based on what logic? Please, I'm actually super interested in hearing your reasoning behind this.
>>
>>51701643
Because OpenGL is the only thing that has ever called an index buffer an "element buffer".
>>
>>51701668
And I stated I was using OpenGL. Are you implying I am pedantic by using OpenGL? Or should I use none OpenGL terms to refer to OpenGL things? That's just convoluting.
>>
is there anything wrong with naming my variables/objects/whatever with underscores?
>>
>>51701684
Whatever. Call them that if you like, just don't expect people to immediately recognize what "EBO" means.
>>
File: 1443232158832.png (511 KB, 560x601) Image search: [Google]
1443232158832.png
511 KB, 560x601
>>51701705
But you did. You literally just manufactured an issue to complain about.
>>
>>51701727
>You literally just manufactured an issue to complain about.

/dpt/ in a nutshell
>>
>>51701727
That's why I stuck it in a postscript, because it's not really important but something worth noting anyways.
>>
>>51701668
>One of the graphics libraries which is part of the graphics library Duopoly is the only thing that ever called an index buffer an "element buffer"
What are you even complaining about
>>
>>51701700
I wouldn't. i think underscores are used in preprocessor directives by a lot of people. Just capitalize new words.
>>
>>51700116
Verizon made that. In Python.
>>
my prof supplied us with code to write into binary files but i'm having trouble closing the file.
this is the function prototype
void   closeBinaryFileWrite(BFILE*& f);

this is the section of my main related to it
    BFILE* huffmanTreeBinaryFile = openBinaryFileWrite(argv[2]);
writeIntoBinaryFile(huffmanTreeBinaryFile, huffmanTree);
closeBinaryFileWrite(*huffmanTreeBinaryFile);

and this is the error i'm getting
huffman.cpp: In function ‘int main(int, char**)’:
huffman.cpp:169:45: error: invalid initialization of reference of type ‘BFILE*&’ from expression of type ‘BFILE’
closeBinaryFileWrite(*huffmanTreeBinaryFile);
^
In file included from huffman.cpp:16:0:
binary.h:9:8: error: in passing argument 1 of ‘void closeBinaryFileWrite(BFILE*&)’
void closeBinaryFileWrite(BFILE*& f);
>>
>>51701700
Probably not, but depends on if you want to follow a specific convention for the project you are working on or language you are working in. It can also depend on the language, though almost all allow underscore as a character in identifiers.
>>
>>51701844
Don't dereference it.
>>
>>51701844
function expects a pointer and you pass a value
jesus christ
>>
File: nethack_roguelike.png (4 KB, 327x237) Image search: [Google]
nethack_roguelike.png
4 KB, 327x237
Learning libtcod. Pic not mine, but related.

http://roguecentral.org/doryen/#page/624

You can use it to write a roguelike, without reinventing the wheel.
>>
>>51701845
>>51701753
it's a personal project in C# but with programming you never know
>>
>>51701883
Why do people keep telling others not to reinvent the wheel? This isn't related to your post anon, just a general inquiry for dpt. The game dev threads of /v/ and /vg/ say this all the time and as far as I can tell all of them are making shitty platformers with MS paint sprites. What if I want a sick new kind of wheel with fireworks and shit on it?
>>
>>51701895
do you mean object _ = new object() or object _thing = new object?
Because in C# the latter is a private or readonly field by convention
>>
>>51701895
If it's C I wouldn't. justNameLikeThis.
>>
File: mfw.png (107 KB, 323x241) Image search: [Google]
mfw.png
107 KB, 323x241
>>51701880
i don't know what either of those are
>>
File: read.jpg (45 KB, 300x384) Image search: [Google]
read.jpg
45 KB, 300x384
>>51701642
>i'm not interested in post modernist pseudo philosophy and retarded facebook shared platitudes
Me neither. Cognitive behavioral therapy is many decades old and probably the most common type of therapy for depression. I don't know if you can see a doctor but pirating a self-help book on the subject is always an option.
>>
>>51701944
It's time to drop out.
>>
>>51701844
post all the code your prof gave you.
>>
>>51701935
I mean object_thing

so people would consider ass_poop something private/constant ?
>>
File: Untitled.png (9 KB, 671x301) Image search: [Google]
Untitled.png
9 KB, 671x301
>>51701880
What's the issue?
#include<iostream>

char niggers(char * cocks)
{
std::cout<<cocks<<'\n';
}

int main()
{

niggers("gaylord");

}
>>
>>51701861
i took out the star looking thing and now i got this
/tmp/cciPWgKN.o: In function `writeIntoBinaryFile(BFILE*, Node*)':
huffman.cpp:(.text+0x418): undefined reference to `writeBit(BFILE*, int)'
huffman.cpp:(.text+0x431): undefined reference to `writeByte(BFILE*, int)'
huffman.cpp:(.text+0x444): undefined reference to `writeBit(BFILE*, int)'
/tmp/cciPWgKN.o: In function `main':
huffman.cpp:(.text+0x60f): undefined reference to `openBinaryFileWrite(char const*)'
huffman.cpp:(.text+0x632): undefined reference to `closeBinaryFileWrite(BFILE*&)'
collect2: error: ld returned 1 exit status
>>
>>51701944
I was going to help you, but then I saw this reply with the retarded meme picture and filename, so I'm going to report you instead.
>>
>>51701923
>What if I want a sick new kind of wheel with fireworks and shit on it?

You suck at making wheels. That's the problem.
>>
>>51702022
that wasn't even me anon
>>
>>51702023
So what? What if I don't want a shiny, brand new top of the line wheel? Also
>Implying my wheels are the fucking shit
>>
>>51702009
you gotta call niggers in main
>>
>>51701923
For some reason, everybody is obsessed with justifying their choice of tech. Since most people who use high-level engines or frameworks don't know a lot about what they're doing, they usually can't come up with any justification past "it takes less time".

t. AGDG pro
>>
>>51702048
What? I'm not the guy with the problem. That was a function I just made that accepted a string literal as a value for a char pointer and printed it.
>>
>>51702073
oh im stupid
>>
>>51701999
he meant variable names that start with _, I guess
>>
>>51702046
>>Implying my wheels are the fucking shit

Yes, that is what you implying. Then there's Harvey Firestone & Co. over here thinking you're a real monkey.
>>
>>51702021
You're not linking properly.
Post your file structure/tree of your project directory, your Makefile (if you have one) or the command you're compiling with, and the headers that you include in each file.
>>
>>51701999
No,
private _assPoop
public assPoop
public class AssPoop
public/private readonly _assPoop
const ASS_POOP
public/private void AssPoop(int assPoop)

const means compile time constant - it has to be set before compilation. readonly can be set at any point but never changed. snake_case is against c# convention but there's nothing stopping you using it.
c# uses
>>
>>51701923
Because programmer's time is valuable and there's no reason to waste it.
>>
>>51702009
are you seriously this stupid?
>>
>>51699447
I'm rank 611 with only 31 completions (27 easy, 4 moderate).
Maybe you should switch to a superior programming language, like C.
>>
>>51702009
Now try this faggot:
niggers("gaylord"s);
>>
>>51701923
>>51702066
IMO it comes down to saving time, and really there's nothing wrong with that, furthermore if you're just starting out the chances of your wheel being crappier than the ones already out there are higher

it all depends on you, if you want to do stuff from scratch you reinvent the wheel, if you don't care about doing everything from scratch then you use one of the wheels out there
>>
>>51702163
>Maybe you should switch to a superior programming language, like C.
I'm already using the upgrade called C++ ;)
>>
>>51702163
>0 connections
>0 followers
tfw
>>
>>51702135
Actually now that I think about it const is AssPoop as well. Which should also apply to enums
>>
I saw one person say on another website that most python jobs require django. Is this even true? I haven't been able to find a single other person on google even mention anything about this. I'm learning python right now and hopefully I'll get a job with this language, but I don't really care about making websites, so learning django isn't one of my top priorities right now and I don't know if I should even bother bother learning it
>>
File: rank.png (49 KB, 862x392) Image search: [Google]
rank.png
49 KB, 862x392
>>51702163
fucking scrubs
>>
>>51702135
Thanks anon, I don't really like some of these conventions but I better get used to them and use them even in my personal projects to not mess other projects later on
>>
>>51702123
all my files are in the same directory i'm running the program from
>>
>>51702223
lower rank is better.
Being #1 means you're #1 on the whole site across all languages.
>>
File: Untitled.png (13 KB, 669x313) Image search: [Google]
Untitled.png
13 KB, 669x313
>>51702169
Works great thanks anon.
#include<iostream>

char niggers(char * cocks)
{
std::cout<<cocks<<'\n';
}

int main()
{

niggers("gaylord""s");

}
>>
File: Capture.jpg (53 KB, 1144x568) Image search: [Google]
Capture.jpg
53 KB, 1144x568
Is it time to wave our e-peens?
>>
>>51702240
I told you to use the string literal operator you dumb shit.
>>
>>51702228
what are the files called, what do they include
>>
>>51702254
I did though :^)
>>
>>51702232
are there only 6000 registered users?
>>
>>51700116
Now imagine what he could do if he didn't have to dedicate 20 square miles of land for the logical redstone circuits to make that happen.
>>
File: files.png (10 KB, 1286x106) Image search: [Google]
files.png
10 KB, 1286x106
>>51702255
it's a pretty big program.. you need all of their includes?
>>
>>51702274
probably
I'm hoping it's not actually counting idiots who made an account, failed the first fizzbuzz challenge and then never logged in again, because they would pretty much lead to everyone's ranks going up every time a new user joins.
>>
>>51702270
https://ideone.com/itVkQx
>>
>>51702323
There was literally nothing wrong with what I did.
>>
>>51702301
what command did you use to compile, which file are the functions located in that the linker could not find?
>>
>>51702342
??
>>
So I am on chapter 4 in pic related and it feels like he is asking review questions for shit he has not covered yet.

Ive only dont moderate python before this.

Can anyone explain what the begin() and end() methods do for vectors in c++? Looking at youtube the only thing I can see is like the insert method.

Is it normal for this shit to feel out of order? Or is the review designed to make me learn this shit outside the book?
>>
*(*(*(*(*(*(*(*(arr+1)+2)+3)+4)+5)+6)+7)+8)


Friendly reminder that this is syntactically valid C.
>>
>>51702348
nvm i'm dumb
>>
>>51702243
what site is that?
>>
>>51702362
Yes, and?
>>51702380
CodeEval
>>
>>51699144
I'm trying to figure out how i can encode normal text in to html link formatting eg:

hi  = %68%69
>>
>>51702362
why wouldn't it be?
>>
>>51702380
a shit one
>>
>>51699169
F is for float right? Try %.2d

I've seen on a website where d was described as decimal integer
>>
>>51702243

Should unique be a good thing?
>>
>>51702366
np
>>
File: wheeeeee.gif (499 KB, 300x250) Image search: [Google]
wheeeeee.gif
499 KB, 300x250
>tfw you're too stupid to understand the math in CLRS

The only things I understand are the psuedocode examples.
No that there's anything wrong with that.
>>
>>51702243
How many of those solutions are moderate or hard?
>>
>>51702440
27 easy, 9 medium
>>
>>51702389
>>51702403
thanks
>>
>>51702362
Integer.parseInt(""+(new BigInteger(""+Integer.parseInt("3"))).add(new BigInteger("4")))


Friendly reminder that this is syntactically valid Java.
>>
>>51702485
Those are big integers.
>>
>>51702504

4 /u
>>
>>51702504
Yes, and?
>>
>>51702485
Why wouldn't it be?
If you broke it up into 3 or 4 lines it would not look out of place in a program that deals with numbers
Thread replies: 255
Thread images: 38

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

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