[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: 321
Thread images: 41

File: tmp_5539-1492877389035962826659.jpg (436KB, 520x1187px) Image search: [Google]
tmp_5539-1492877389035962826659.jpg
436KB, 520x1187px
What are you working on, /g/?

Old thread: >>60071726
>>
File: best_book.jpg (103KB, 483x632px) Image search: [Google]
best_book.jpg
103KB, 483x632px
>>60077582
Reading the best book ever
>Also first for AS3 is best language
>>
File: 400c.jpg (36KB, 650x650px) Image search: [Google]
400c.jpg
36KB, 650x650px
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
>>
>>60077602
>Pajeet
public String loo implements poo
>>
File: Window.png (17KB, 868x256px) Image search: [Google]
Window.png
17KB, 868x256px
>>60077582
Can't apt recv-keys. dirmngr says my libksba version 1.3.3 is too old but dpkg -l says I have version 1.3.5.
Pic related.
How fix this?
>>
>>60077602
>C#
You know .NET
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
>>60077582
Threadly reminder that D-chan is not dead, and she's super duper cute! Say something nice to her, anons!

>>60077595
I see you've finally succumb to Stockholm Syndrome, norway-kun.
>>
>>60077638
Obviously he means he wants to learn the framework, not a specific .NET language
>>
>>60077672
honestly I'm not 100% sure what I mean

what's in the framework that I might not know from making desktop apps in C#?
>>
I've never met a single woman in my entire life that uses lisp or has ever used lisp.
>>
>>60077687
Why would you want to meet 3DPD at all?
>>
>>60077687
>>
>>60077669
>Arbitrarily labelling a cute tomboy anime girl
You D(ead)lang fags sure are desperate.
>>
>>60077680
>typical C# programmer
>>
>>60077669
Too late, I started picking up Rust lately. D will always be my trusty sidekick language for prototyping though
>>
>>60077687
>caring about what women are using
>implying women are programmers
>>
Silly question:
I was making a quick interface for an experiment I was doing, and I wanted to make a user input, so I could classify the data.
I didn't want to use a big library for this, so I thought I could do it with STL.
But how do you quit a std::cin?
Is there a way to send data to it from another thread or something?
I want something similar to opencvs waitkey, check for input, if no input has been given before a deadline, give up and check if I should still check for inputs.
Do I really need to make a gui for this?
>>
>>60077687
I have met a woman with a lisp though.
>>
I failed my class in C++, should I give up on programming or selfteach c#/java and try to get a job this way?
>>
>>60077792
that wasn't a woman, anon
>>
>>60077785
http://stackoverflow.com/questions/19185958/wait-only-5-second-for-user-input
>>
>>60077803
If you couldn't handle C++, what makes you think you'd be able to handle C# or Java?
Python might be more your speed.
>>
File: C0BRqZeXcAAn0fq.jpg (27KB, 640x360px) Image search: [Google]
C0BRqZeXcAAn0fq.jpg
27KB, 640x360px
>>60077767
>Too late, I started picking up Rust lately
Enjoy your permanent training wheels
>>
>>60077785
Stop with your silly sepples memes.
#include <poll.h>
#include <unistd.h>
#include <stdio.h>

int main()
{
struct pollfd pollfd = { .fd = STDIN_FILENO, .events = POLLIN };

printf("Enter something within 5 seconds:\n");

if (poll(&pollfd, 1, 5000) > 0) {
char buffer[1024];
fgets(buffer, sizeof buffer, stdin);

printf("You entered: %s\n", buffer);
} else {
printf("You fucked up\n");
}
}
>>
File: 1492895317203.jpg (59KB, 846x1024px) Image search: [Google]
1492895317203.jpg
59KB, 846x1024px
>>60077803
do c++ again . Why would you jump ship to c#/java. You need to stick to c++ until you get it down. There are so many resources to learn it, find a good book from amazon on C++. Then torrent it and read it, dont listen to /g/ books, these retards dont know how to help beginners. Not everyone gets programming on their first try, just keep at it. Make sure you go through each part of the book and do the exerices if they have any. Watch youtube aswell
>>
>>60077837
I bet you think people who drive motorcycles with helmets on are "pussies".
>>
>>60077860
dumb frogposter
>>
File: 1461837969459.jpg (99KB, 908x714px) Image search: [Google]
1461837969459.jpg
99KB, 908x714px
>>60077828
dont make him do python, that is such a bad language to learn as your first. It makes everything too easy, too high and you dont learn shit. Its better to learn c++/java first then reward him with python.
>>
>>60077870
They are. People wearing helmets drive/ride more recklessly, thinking they are more safe, and leads to them getting into more accidents.
People who are riding around without one realise what danger they're in and are more cautious.
>>
File: 1452122793059.jpg (85KB, 580x563px) Image search: [Google]
1452122793059.jpg
85KB, 580x563px
>>60077875
>>
>>60077860
>>60077884
Can you please just fuck off? You're shitting the place up.
>>
File: languages.jpg (883KB, 1570x1876px) Image search: [Google]
languages.jpg
883KB, 1570x1876px
>>60077870
>>
>>60077881
sure. let me ask you something else - would you drive an automobile with no air bags, no seat belts, and no emergency break?
>>
>>60077899
Stop being a pussy, mate.
>>
>>60077896
this implies that Rust is somehow lacking in performance, which we all know is not the case. it doesn't pay for it's increased safety. also zero cost abstractions.
also thank you Mozilla for the 0.05 cents!
>>
File: 1474948339628.jpg (33KB, 396x385px) Image search: [Google]
1474948339628.jpg
33KB, 396x385px
>>60077887
a person who actually gives feedback to a question is asked to fuck off. Suck my nuts
>>
>>60077909
>this implies that Rust is somehow lacking in performance
It is. Don't kid yourself, a few synthetic benchmarks aren't going to fix that. We saw the same shit with java, with some idiots claiming its faster than C.

Only problem I have with that image is it implies Rust is somehow light, which it isn't.
>>
Can the Rust faggots please leave the thread for good? It used to have a friendly atmosphere until you came along with your socialist agenda.

Seriously fight the "cis white het males" somewhere else.
>>
>>60077933
FAKE BENCHMARKS
>>
>>60077635
Please respond.
>>
>>60077887
you're the one shitting it up. imagine if people replied to anime images or w/e with that kind of comment
>>
>>60077933
>same shit with java, with some idiots claiming its faster than C
ah I remember you! it was actually C# (actually Java is marginally faster than C# generally). Only a complete fool would try to argue that Java is faster than C or C++.
>>
>>60077909
lol idiot, rust is significantly slower than C, and rust is a shitty language overall with a cancerous mozilla/webfag community
>>
>>60077946
Is there any actual argument left except for edgy /pol/ buzzwords for C tards such as yourself?
>>
>>60077837
What is the permanent training wheel you are referring to?
>>
File: 1459125726463.png (276KB, 1280x720px) Image search: [Google]
1459125726463.png
276KB, 1280x720px
>>60077969
the difference between anime and frogposting is that the former is part of the culture (anime website) and the latter is represents what's wrong with 4chan (normalfaggotry and /pol/).
>w/e
I suggest you return to whatever social media hellhole you came from. thanks
>>
>>60078008
don't reply to them, anon. whenever you see an offending post, just report and hide.
>>
>>60078033
lol, you are are normal fag just for simply posting on 4chan. all of the real deals left long ago. my fucking grandmother knows about 4chan. my 14 yr old nephew browses /g/.
>>
>>60078067
this

https://www.youtube.com/watch?v=j_Z1_7iay3I
>>
>>60078067
This actually. 4chan is now home to edgy social outcasts who think they are some special snowflake alt-emo garbage
>>
>>60078067
>>60078079
>>60078084
>this projecting
how cute. now please leave
>>
>>60078067
>lol
Is this what it has really come to?
Please anon, for the sake of everybody: just kill yourself.
>>
>>60078088
this is what happens when people fail to lurk and mods and jannies don't do their damn job. god I hope hiro just shuts this shithole down so I can move on with my life.
>>
>>60078113
Trump won, congratulations. Get cucked permanently by z**nists. Good job.

How pathetic.
>>
>>60078113
What's your favourite anime, reddit-kun?
>>
>>60077625
well no, it's more like
var loo = awaits pajeet.PooAsync();
>>
>all these people getting mad at the people getting mad at frog pictures
you guys like getting trolled, dont you?
>>
>>60078197
I'm sorry Reddit-kun, but who are you quoting?
>>
File: drank.jpg (53KB, 787x478px) Image search: [Google]
drank.jpg
53KB, 787x478px
>>60077777
>>
File: GON2.webm (1MB, 359x622px) Image search: [Google]
GON2.webm
1MB, 359x622px
So I'm trying to use C# reflection to determine whether or not an object has a certain annotation, and then get the data from said annotation. The annotation is this fucked up corequisite thing for designers so that they don't fuck your shit up, and it's completely broken (which is why I'm reflecting to get its info). It stores types that are required to be on the class.
        /// <summary>
/// Returns the [RequiredComponent] annotations of a given type in the form of a list.
/// </summary>
/// <param name="type">The type to check</param>
/// <returns>a list of all RequiredComponents for this Type</returns>
public static List<System.Type> DependanciesOf(System.Type type){
IEnumerable<RequireComponent> requiredComponents = type.GetCustomAttributes(typeof(RequireComponent), true).Cast<RequireComponent>();
var requiredTypes = new List<System.Type>();
foreach (RequireComponent r in requiredComponents)
{
if(r.m_Type0 != null)
requiredTypes.Add(r.m_Type0);
if (r.m_Type1 != null)
requiredTypes.Add(r.m_Type1);
if (r.m_Type2 != null)
requiredTypes.Add(r.m_Type2);
}
return requiredTypes;
}



This works for ALMOST everything. However, there are a few inbuilt classes like
https://github.com/MattRix/UnityDecompiled/blob/82e03c823811032fd970ffc9a75246e95c626502/UnityEngine/UnityEngine/GUILayer.cs
for which it does not function whatsoever. Does anybody know why it might be failing to get this attribute on this class, but work for almost all others? (the attribute is the [RequireComponent(typeof(Camera))])
>>
>>60077954
>Please respond.
hi!
>>
in php when doing something like
// code
while (condition) {
$array[] = array(key=>value);
}
//code


Does it add a new element to the array or does it replace the content ?
>>
If C didn't have a for loop, how would you write a macro for it?
>>
>>60078334
Try it!
>>
>>60078394
Unfortunately it relies on unhygienic macros and won't work in all contexts.
#include <stdio.h>

#define my_for(init, cond, post) _Bool _first = 1;\
while ((_first ? (init) : (post)), _first = 0, cond)

int main()
{
int i;
my_for(i = 0, i < 10, ++i) {
printf("%d\n", i);
}
}

If you don't mind the statement going inside the macro arguments, then
#include <stdio.h>

#define my_for(init, cond, post, stmt) { \
init; \
while (cond) { \
stmt \
post; \
} \
}

int main()
{
int i;
my_for(i = 0, i < 10, ++i, {
printf("%d\n", i);
})
}

works better.
>>
>>60078334
http://sandbox.onlinephpfunctions.com/code/52764570310e22d7ce8d8677982549e8ce79db49
>>
>>60077582
#include <stdio.h>

int main(){

int c = 5, d;
d = ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c;

printf("%d\n", d);

return 0;

}


How much is d?
>>
>>60079038
138 i think,
not that it matters since you shouldn't write code like this anyways.
>>
>>60079067
It isn't 138.
>>
>>60079038
undefined
>>
>>60079038
The result is undefined and completely meaningless.
>>
whats a good name for "internal" that are used to add the implement the actual behavior?
bit hard to explain, heres an example:
interface IMailService
{
void Send(Mail mail);
}

abstract class BaseMailService implements IMailService
{
// Prevents having to duplicate error handling across all implementations
void Send(Mail mail)
{
try
{
SendInternal(mail);
}
catch(Error e)
{
log(e);
}
}

// Implements the actual send behavior
abstract void SendInternal();
}

class RealEmailService extends BaseMailService
{
void SendInternal(Mail mail)
{
// Send mail
}
}

what would you call "SendInternal" in this case?
>>
>>60079281
holy fuck i meant "whats a good name for internal methods that are used to implement the actual behavior"
>>
in c++, when I allocate space using new, I get 5 additional space I haven't asked for.

For example

char * string = new char[10]

then I get with

strlen[string]

15

Why is that?
>>
>>60079281
inline it?
>>
>>60079309
you need to initialize it. strlen looks for a null terminator
>>
>>60071964
Any turing-complete instruction set can be translated into any other turing-complete instruction set. So yes, Megaman runs on Lisp OS.
>>
File: Untitled.png (20KB, 2676x269px) Image search: [Google]
Untitled.png
20KB, 2676x269px
I just completed the settings pipeline from file to option to employing the option!
>>
>>60079309
>
char * string = new char[10]

don't do that, that's legacy c code. use std::string.
>>
>>60079374
>new
>that's legacy c code
You sure are stupid.
>>
>>60079281
OOP: solving problem that it itself created.
>>
>>60079152
It is 138 on Clang, TCC and PCC. It is 139 on GCC.

That's what you get for trying to bait people with undefined behaviour.
>>
>>60077860
> learn C++
fuck off faggot, assembly is what REAL man learn
>>
Implicit dereferencing is cancer
>>
>>60079642
symlinks?
>>
Anyone here has experience with MongoDB?

I have to make some queries for Mongo on Python, and right now I have this query

        cursor = self.db.blocks.find({"transactions.to" : None},{"transactions.from" : 1, "_id": 0 ,"transactions.to": 1})


But this also returns me transactions who have not "none" in the "to" field and happen to be in the same arrays from those who do
How do I filter these out?
>>
>>60079642
manual pointers are cancer.
>>
>>60079662
No. You're stupid.
>>
>>60079348
>*could run on Lisp OS if anyone cared about Lisp OS
>>
>>60079666
>oh god please let me do more menial work c-sama~
>>
Hey was wondering if there was anything wrong with having multiple return statements. How would I fix that in something like this?

def hasCycles(G):
S = set()
for root in G.nodes():
Q = list()
Q.append(root)
while Q:
u = Q.pop(0)
S.add(u)
for v in G[u]:
if v in Q:
return True
elif v not in S:
Q.append(v)

return False
>>
>>60079657
2 separate queries maybe?

Disclamer: I don't know MongoDB
>>
>>60079673
Are you arguing for those cancerous C++ references or something?
>>
>>60079688
Absolutely nothing wrong with having multiple return statements.
>>
>>60079699
Good auto-pointers with the option to take control should be standard.
C++ is not in this discussion.
>>
>>60079688
Not at all m8, this is a fine example of short-circuiting the rest of the nodes as long as you find a counterexample. Here's an example of the official python docs doing it: https://docs.python.org/3/library/functions.html#any

If you were to finish the iterations you'd just waste CPU time
>>
>>60079688
>with having multiple return statements
There is a very outdated and stupid sentiment that some programmers (especially older ones) where they think functions and programs should only have a single exit point.
It's pretty fucking stupid though, and almost always leads to unnecessary logic where you have to pass an error to the end of the function, and just clutters the code up.
So pretty much, multiple returns are completely fine.
>>
>>60079695
Sadly, I can't query a cursor item further
>>
I want to make a program that takes a 2d picture as input at makes a 3d picture using ray techniques.

Is there a good book/tutorial on the topic.
>>
>>60079722
No idea wtf this means. Good luck m8
>>
I am learning COBOL.
Am I become insane.
>>
>>60077687
I taught some hot girl lisp once, walking her through SICP.

Then she became too busy programming to have sex.

Lisp turns girls into neckbeards.
>>
>>60079762
No, insanity is when you develop your own hardware and software environment.
>>
>>60079792
My next step is COBOL 2
>>
>>60079824
Just make CNOL.
common neet-oriented language.
>>
>>60077582
>reinterpret_cast
>not std::mem::transmute
>>
>>60079855
JUST
>>
File: cone.png (5KB, 252x486px) Image search: [Google]
cone.png
5KB, 252x486px
>Auto generated classes
JUST
FUCK
MY
SHIT
UP
at least it's done
https://hastebin.com/lijoxugomi.cs
>>
>>60079700
>>60079716
>>60079717
Yeah thanks, my teacher who used to be in the industry a long time ago commented a pseudocode algorithm I wrote.
>>
>>60079737
anybody ?
>>
File: 1410792416378.jpg (266KB, 640x640px) Image search: [Google]
1410792416378.jpg
266KB, 640x640px
What is the most popular coding challenge site out there?
>>
>>60079978
Project euler
>>
>>60079978
theyre all shit.
PE is heavily math-focused which can be boring.
>>
>>60079991
euler is boring as fuck because you can look up all the solutions to every problem on wikipedia.
how is that interesting? even codeeval is better than that
>>
>>60079850
But how....


A functionl compiler oop non-typed language with a way to solve the square rectangle via mutable classes.


Yes. The meme to rule them all.
>>
>>60077687
I met a cute girl at a meetup who was all about FP, with Clojure as her language of choice at the time.
>>
File: 12435456427.jpg (39KB, 600x387px) Image search: [Google]
12435456427.jpg
39KB, 600x387px
>>60080045
>double reddit spacing
holy shit get out get out get out get ooooouut
>>
File: 1461349002364.jpg (89KB, 580x767px) Image search: [Google]
1461349002364.jpg
89KB, 580x767px
>>60080009
Then don't look up the answers?
>>
File: 1485916146891.jpg (17KB, 317x379px) Image search: [Google]
1485916146891.jpg
17KB, 317x379px
>He doesn't write idiomatic (((Rust)))
What gives?
fn main() {
let players: [&'static str; 4usize] = ["Mitch", "Ron", "Nick", "Levi"];
for (number, player) in players.iter().enumerate() {
println!("Player no. {} is {}", number, player);
}
}


In all seriousness though, I don't think it's half bad. Made me rethink how I usually program 2bh. It really demands you to write correct code. I can get used to it.
>>
File: 602.jpg (49KB, 640x640px) Image search: [Google]
602.jpg
49KB, 640x640px
>>60080052
>met
>cute
>girl
>language of choice
>>
>>60080061
>just like reinvent the wheel for every euler problem lol what's your problem man?
I'd rather solve unique challenges that boring been-done-before math shit.
>>
>>60080062
good != verbose
>>
>>60080062
Thanks to type inference, you don't need any type declaration for players, fyi.
>>
>>60080009
>I want a challenge that no-one has solved before.
I guess you can always try the millennium prize problems
>>
>>60080062
such an ugly language wow
>>
>>60080087
good != concise either, what's your point except not understanding >>60080062 at all?
>>
>>60080114
The word you are looking for is "verbose"
verbose
>>
>>60080077
Then don't fuck around with programming challenges m8.

Think of a really stupid idea and then come up with the most technically elegant implementation you can think of and build it.
>>
>>60080135
That if you unironically believe idiomatic rust is good or makes your code better, or you a better programmer.
Then you're a straight baka.
And you have a tinge of Stockholme.
>>
File: fragezeichenmädchen.png (307KB, 500x500px) Image search: [Google]
fragezeichenmädchen.png
307KB, 500x500px
>>60080158
What would you do different?
>>
>>60080167
not use rust
ezpz
>>
>>60080158
>rust is good
>define this "good" term. Sounds euphoric
*tips*
>>
>>60080062
lol that fucking apostrophe like what the fuck
>>
>>60080224
The 'static means the maximum possible lifetime :)
>>
>>60080224
>lol that fucking apostrophe like what the fuck
are you a bimbo
>>
>>60080234
yes but why the apostrophe, such a shitty choice of syntax, they could have picked any syntax (not like C++ which has the baggage of C) and they chose this abomination, just look at >>60080062 with the fucked up syntax coloring
>>
File: 1482728821931.png (25KB, 810x162px) Image search: [Google]
1482728821931.png
25KB, 810x162px
>>60080253
>with the fucked up syntax coloring
That's just 4chan, anon. It doesn't support Rust's syntax highlighting.
>>
>>60080253
The fucked up syntax coloring is a failure of the syntax highlighter on this site, on github it's not fucked up, for example: https://github.com/rust-lang/rust/blob/master/src/libcore/str/mod.rs#L414
>>
>>60080288
thats still pretty shitty syntax 2bh.
Id rather a property tag.
>>
>>60080288
>>60080307
it's still fucking disgusting
>>
struct BigStruct *p  = malloc(sizeof *p);
if (p == NULL) {
// wat do?
}
>>
>>60080396
>// wat do?
It depends on the program, but most of the time, exiting is the only sensible option.
>>
>>60080396
errorf("No memory left!");
exit_gracefully();


Just like any sane higher-level lang does under the hood.
>>
>>60080062
iforM_ ["Mitch", "Ron", "Nick", "Levi"] (printf "Player no. %d is %s\n")
>>
>>60080396
if(!p) is a fine abbreviation.
>>
>>60080429
What's your point?
>>
>>60080438
It's pointfree
>>
>>60080437
Hes checking for a null. !p might not return false if its a null
>>
>>60080396
throw std::bad_alloc;

>:^)
>>
>>60080489
Not according to the standard faggot.
>http://en.cppreference.com/w/c/types/NULL
>>
>>60080492
what is that meme language?
>>
>>60080489
>!p might not return false if its a null
NULL has the value of 0, even if that's not how it's actually represented in memory.
So !p will always evaluate to true with a NULL pointer.
>>
Programming newbie here.

I need to subtract dd days from a date and display the updated date. I managed to make the addition of days like this:

while (*d2 > days_of_month(*m2, *y2)) {
*d2 -= days_of_month(*m2, *y2);
*m2 = *m2 + 1;
if (*m2 > 12) {
*y2 = *y2 + 1;
*m2 = 1;
}
}


How can I make the subtraction of days using a similar logic?
>>
>>60080889
Forgot to mention that:
*d2 = d + dd // day of month + days to add
>>
>>60080889
You can make the subtraction of days using a similar logic.
>>
>>60080889
>>60080902
You could really stand to give your variables better names, and indent your code properly.
Anyway, you just need to "flip" your calculartions (excluding things involving d2).
while (*d2 > days_of_month(*m2, *y2)) {
*d2 -= days_of_month(*m2, *y2);
*m2 = *m2 - 1;
if (*m2 == 0) {
*y2 = *y2 - 1;
*m2 = 12;
}
}
>>
>>60080889
Why do you work with dereferenced pointers?
>>
>>60080889
check if d2 is less than 1, if so subtract 1 of m2, and again if m2 is less than 1, subtract one of y2

That being said, this is really low performing and using a unix like timestamp would be much faster.
Or better yet, just use a library if you really want to use this in a project and this isn't just an exercise.
>>
>>60080954
*d2 = d - dd
while (*d2 <= 0) {
*m2 = *m2 - 1;
*d2 += days_of_month(*m2, *y2);
if (*m2 == 0) {
*y2 = *y2 - 1;
*m2 = 12;
}
}
ftfy
>>
File: ibm-cognos.png (39KB, 350x157px) Image search: [Google]
ibm-cognos.png
39KB, 350x157px
>>60077582
Fucking IBM Cognos.
>>
>>60080954
Actually, the stuff with d2 does need to be changed.
I realised I was wrong after I thought about it.

>>60080992
Yeah, like that.
>>
>>60080954
Thanks. These are actually the variables named by the professor. He's rather strict and I must follow his guidelines.

>>60080960
It's just a portion of the program. It makes sense in the whole picture.

>>60080974
I certainly would use a library if I could, but it's an assignment in an introductory course on C, so...
>>
>>60081022
day2, delta-day, makes sense if you have a mathy background indeed.
>>
>>60081022
> It makes sense in the whole picture.
Well, I can think that date is represented by three integer variables, and you pass references to them.
>>
>>60080992
Yeah, it's working. I was doing something similar but my while condition was wrong. I'm dumb as fuck, Jesus.

>>60081050
Precisely.
>>
>>60080997
What's wrong with Cognos?
>>
>>60077954
>>>/fglt/
>>
File: 1480783131154.jpg (1MB, 1280x1024px) Image search: [Google]
1480783131154.jpg
1MB, 1280x1024px
>Boss asks me if I know anyone interested in our summer internship program

>Email Discrete Structures class telling everyone to apply, and to email me resumes and if I like their resumes I'll forward to boss and give recommendation

>Every single resume has:

>> Stupid useless cover letter
>> "Volunteer work: ..."
>> "Experience: Cashier at Kroger"
>> NOT A SINGLE FUCKING GITHUB

All these resumes go in the trash. YOU NEED YOUR GITHUB IN THE HEADER OF YOUR RESUME. YOUR BACHELOR'S DEGREE IN COMPUTER SCIENCE IS USELESS TO ME; I HAVE NO IDEA IF YOU CAN CODE
>>
>>60081408
Even if I have a shitty github with useless scripts and exercises from textbooks?
>>
>>60077635
Maybe move the one from /usr/local/lib somewhere not in LD_LIBRARY_PATH and try again
>>
>>60081435
Depends how shitty they are and if they're in the language/technology that we use at our company. Also you need to have good content on your github. Nobody it going to hire someone who can't code
>>
>>60081408
I hope you use 'github' as a surrogate here.
>>
>>60081455
How deeply do you tend to look at someones github when determining if they're the right fit?
Do you just browse over their work to make sure it's readable?
Do you go into detail?
Do you even check if the programs work?
>>
>>60081408
Who said this?
>>
>>60081408
It's a fucking internship. Why would you be interested in their Githubs? Sure, it's a plus, but it's not like it's a lifetime job.

Students seek internship precisely because they have little experience with programming things outside the theoretical scope.
>>
>>60081408
>programming for free
Not in this life.
>>
>>60080062
meh
players = ['Mitch', 'Ron', 'Nick', 'Levi']
print('\n'.join([
'Player no. {} is {}'.format(index, player)
for (index, player, ) in enumerate(players)
]))
>>
>>60081468
idc if it's a personal site, bitbucket, or even fucking sourceforge. I just need to see code

>>60081497
I will kind of evaluate it based on the complexity of the project they're working on, if it indicates that they can adapt their knowledge to a new technology/code base (any job you start you'll have to learn how to get started on what they're doing; there's no way for your to be 100% prepared for a new job beforehand).

If all your repos are just homework assignments and exercises, then I have no idea if you can think critically, learn quickly, etc. The QUALITY of the code is not something I look for in internships/jr dev positions, since we're going to try to get you to adhere to our practices anyways, and I don't do recruiting for Senior Dev positions.
>>
>>60081598
players = 'Mitch', 'Ron', 'Nick', 'Levi'
print('\n'.join(
'Player no. {} is {}'.format(index, player)
for index, player in enumerate(players)
))

ftfy
>>
>>60081578
Our internships have you working on company code. I need to know if you can do C# at the very least. The important thing is showing an ability to learn, and a baseline of programming ability. I don't need you to be an expert in Data Science, but you will have to be working with our technology.

The most important skill is not C# or JavaScript, it's the ability to learn FAST and ask the right questions to be able to learn fast.
>>
>>60080350
>>60080364
The only ugly thing there is the retarded """"m*thod"""" syntax, everything else is fine.
>>
>>60081598
>>60081637
Unreadable. This is better:
players = ['Mitch', 'Ron', 'Nick', 'Levi']
for number, player in enumerate(players):
print('Player no. {} is {}'.format(number, player))
>>
>>60081598
>>60081637
So rust uses
' '
for chars and strings?
>>
>>60081670
That's Python, and yes it does, much like any other dynamic language where there are no char types, just strings of length 1.
>>
>>60081665
Is this kind of code without type signatures really common in Rust?
>>
>>60081649
What's wrong with the method syntax?
>>60081670
That's python. Rust uses "" for string literals and '' for char literals.
>>
>>60081073
>Precisely.
But that's awful, you've got structs for such things.
>>
>>60081686
It being m*thod syntax in the first place.
>>
Kotlin looks so comfy. Please give me a reason to use it. I know it's used often for Android development. Anything cool I should try to build in Kotlin?
>>
>>60081684
That's python. Rust does have type inference however so >>60080062 could be written like this:
fn main() {
let players = ["Mitch", "Ron", "Nick", "Levi"];
for (number, player) in players.iter().enumerate() {
println!("Player no. {} is {}", number, player);
}
}
>>
>>60081717
I hope that isn't usual practice.
>>
>>60081698
We haven't learned structs yet, so even if I learned it beforehand I wouldn't be able to use it in my code.
>>
Is it possible to create a n number of functional elements in winforms?
I am making a program that reads user input, and upon that, it displays a n amount of elements (one element includes 1 label, 2 radio buttons, 1 image which should change upon the selected radio button and 1 static image), all with different data.

I alrady made it so, that the static picture displays n amount of times, but I dont know if it's possible to create usable radio buttons for the other image.
Please help, I've been working on this for the last week.
>>
>>60081738
Why?
>>
>>60081408
I'd also like to add to this: I will give precedence to people with social skills. I've had to work with social shut-ins and they're just impossible to deal with. They can't communicate when they have a problem, they're afraid to ask questions, and they're overall much slower than the rest of the team. If you're socially retarded, either work on that or make up for it by being a coding god.
>>
>>60081618
If I were to write a rudimentary OS from assembly and primitive interpreters on something like Arduino, but had to drop out of college for financial reasons, would I be someone you'd hire?
>>
>>60081748
It leads to more confusion in any remotely non-shit type system.
>>
>>60081646
>it's the ability to learn FAST
>tfw your neetdom has severely impacted your attention span (which also fucks up your learning ability)
>>
>>60081646
>ask the right questions
I hope you actually mean "know how to ask a question"
http://www.catb.org/esr/faqs/smart-questions.html

Asking the "right" questions carries the meaning that someone has to play 20 questions to judge what the right question could possibly be any time they want to ask something or they have to have extensive prerequisite knowledge before asking, defeating the point. If that's what you want, you, your company, and your company's internship are retarded.

Learn FAST also sounds like you're just a codemonkey shop or some one-off finance company with close to no development department. The words you use anywhere - on job postings or even here - matter.
>>
>>60081779
No, you were just born a retard. This has nothing to do with your neetdom.
>>
>>60077595
ActionScript 3.0 Design Patterns...
no mention
but If I would come in here and name drop or post the gang of four book, I would get >9000 (You)s
>>
>>60081771
Types are required in function signatures, they're only allowed to be omitted inside function bodies.
In practice, that's a good trade-off.
>>
>>60077669
If you can't beat em, join em!
>>
>>60081769
Well our job is relatively high level and doesn't require C or Assembly, but in principle, YES. As someone who HAS a bachelor's degree in CS, I know just how little practical skills they teach in college and how much you're required to teach yourself. I've seen so many people who think that CS degree = meal ticket and graduate without knowing how to code, and I know that there are probably hundreds of overqualified people on /g/ without degrees.

But I think I'm not typical in the industry; many recruiters go to colleges to do their recruiting because it's easier to find CS people there, and lots of HR people won't consider you without a degree.
>>
>>60081815
>how to code
Wrong thread.
>>>/g/wdg/
>>
>>60081787
What I mean is that I have coworkers/interns who are perfectly capable of learning, but are either afraid to ask questions, or don't know how to frame a question correctly to get the information they need. Maybe "right questions" is the wrong word, yeah. I'll answer any question you have, but some questions will be more helpful than others.
>>
>>60081815
Thanks for the reply.

I've already encountered the "HR won't consider someone without a degree," and my shit employment history doesn't help. Low level stuff is what interests me, and I'm trying to validate the truthiness of having cool code up on Github would actually get me hired at least somewhere.
>>
Warning: Variable `Loo` defined but unused.
>>
File: 8c3.jpg (146KB, 496x496px) Image search: [Google]
8c3.jpg
146KB, 496x496px
>implying im going to share my game idea with you fat fucks
>>
>>60081869
Whom quotest thou?
>>
>>60081869
>>>/vg/agdg/
>>
>>60081861
not that guy but I can tell you there is a distinction between cool code in github and code that is utilized on github.

One of my friends has a github full of beautifully written proof of concept programmer-challenge type code and nobody really cares.

My other friends wrote a simple python utility for encrypting/decrypting files in aws s3 with native methods that is downloaded all the time and he gets his dick sucked by recruiters daily.
>>
File: 1482959881161.jpg (57KB, 495x700px) Image search: [Google]
1482959881161.jpg
57KB, 495x700px
Is arduino a good way for a computer scientists to learn about microprocessors?
>>
>>60081902
it sure fucking is friendo. Get yourself an Uno and have at it. I love my cheap uC's
>>
>>60081869
how do you even get the wrong tab with a block above
>>
>>60081893
>simple python utility for encrypting/decrypting files in aws s3 with native methods
where does the inspiration for these types of projects come from? I can only ever think of super-contrived bullshit that's already been done 1000 times or stupid games. how do you make something that people will use?
>>
>>60081971
>lurk tech fora to figure out what the flavor of the month technology is
>make a bunch of shitty wrappers for the tech before others do
>you're set for a few months
>>
>>60081902
Yes. But there are other options you'd probably prefer to pursue. TI's Launchpad series of boards are probably better if you're interested in microcontrollers/microprocessors in general.

IME the limiting factor or Arduino is it's so heavily tried into the Arduino IDE/libraries, and amazingly not much beyond that. It's just a fucking cliff.

Or get both. Arduino is probably #1 versatile board out there.

I'm also going to shill for the SiFive HiFive1 here. Arduino compatible, but based on an open source chip. There's also the Propeller but that one's a little weird.
>>
>>60081971
I work in a consultancy so most of the things I develop I have a genuine need for. Necessity is the mother of invention as they say. That being said there are a few things I tell people who are looking for a project that don't necessarily have a fire under their ass like continued employment :-D

Find something you are passionate about, sports, video games, space travel, etc. now see if there is an API or public data set for that thing you are passionate about. Make something that interfaces with that API or make the data set relational and ask your own questions of it.

If you're out there looking for things you can do that will be applicable to people, take a look at cloud providers, and the shortcomings those providers have due to maintaining a generic platform. Find something complicated or contrived, and make it simple--you'll get hits.

/g/ will flame this to the ground but the real world doesn't give a fuck about fancy code--it wants stuff that does things and does them reliably. We've interviewed kids who are like "yeah and I used RECURSION to solve the problem" and the room is like "cool..." (right before the sr. engineer ripped him apart for using memory intensive functions)
>>
>>60081971
Having a good idea isn't something you can teach.

Here's my advice: Think of something you want to be able to do, but either can't do it right now, or it's difficult to do it. Write some software that does that thing. Make something that's useful
>>
>>60081879
thanks for reminding me to check if anyone has made progress
>>
>>60082127
The answer is probably no, wait for DD14 if you really care.
>>
>>60081746
Please help me.
>>
What language will let me type check by hand? I don't trust machines.
>>
>>60082215
Javascript
>>
>>60082215
Javascript typeof
>>
>>60082215
You can't say what type raw bytes have most of times.
>>
>>60082226
>>60082230
I don't trust Javascript's type system to produce valid results either.
>>60082242
Machines can do that pretty easily, which means that something better than them can do that as well.
>>
>>60082312
>Machines can do that pretty easily
Because programs in high-level languages have tables of variables, which contain information about types of all variables.
>>
File: work.png (196KB, 1261x739px) Image search: [Google]
work.png
196KB, 1261x739px
I'm down from 299 errors to 6.
>>
>>60082312
>Javascript
>type system
>>
>>60082413
>measuring progress in errors
Sounds like a world I don't want to live in.
>>
>>60082413
do you have any reason to believe it'll work after you fix all the errors?
>>
File: worried operators.png (151KB, 235x230px) Image search: [Google]
worried operators.png
151KB, 235x230px
>>60082413
>line 700 in a non-container class
>extremely commonly used constant (0xe0) not a variable
>(stackptr - 1]
>>
>>60082413
>1gb/s of error messages
>>
>>60082413
wut are you emulating my man?
>>
>>60082215
C++ typeof or if( dynamic_cast<type>( object ) )
>>
>>60082484
>>60082487
>>60082494
>>60082500
>>60082505
It's my own cpu architecture. I'm changing how the mmu works, which broke the entire thing, and now I'm making it work again with the new interface.
For the (], it's because I used find and replace.
>>
>>60081997
>>60081946
any recommended reading?
>>
>>60077687
>>60077715
does that mean you've met a few and they are all married/in a relationship or does that mean you have not one time met a woman who uses Lisp
>>
>>60082546
any more details on this
>>
>>60082385
So? Why would I not be able to hold a table in my head as well?
>>60082432
Yes, I should have called it something different.
>>
>>60082585
all of the arduino standard library is available function by function on their website--I most times just refer to that. It really depends what I'm doing though. To be honest when I use my uC boards its usually with some task in mind and not just learning about uCs themselves so I write some C and pay little mind to what is happening at the machine level as long as my stepper motor turns like it should, etc.

Believe it or not instructables has some good stuff I go on there all the time for uC projects. If you really really wanna understand how uC's work there is even a few tutorials on instuctables for building 2-bit 4-bit 8-bit 16-bit, and even 32-bit 'computers' from scratch (i'm talking a vew IC's, and tons of wire/bb)
>>
>>60082622
It's a 32-bit, almost RISC, and I just changed it from big to little endian.
>>
>>60082656
cool

what do you actually use these things for btw?
>>
>>60082696
>I just changed it from big to little endian.
that is definitely a design choice to account for rofl
>>
File: 1477349339216.jpg (31KB, 638x540px) Image search: [Google]
1477349339216.jpg
31KB, 638x540px
>>60082696
>and I just changed it from big to little endian.
sounds like something you'd want to settle on during the design phase
>>
>>60082626
>Why would I not be able to hold a table in my head as well?
Alright, then your choice is C.
>>
>>60082736
I use them as a hobbyist, and when I'm lucky I get to work with a client who is using uC's/embedded systems for something.

On the hobbyist side I just like to do fun shit as the ideas come to me. I've made my own Hue lights, a Plowbot (remote controlled mobility scooter w/ a snowplow), I bridged a SNES to an MQTT broker to make a physical 'twitch plays' platform. I made my own version of the 'knife weilding tentacle' bot.

on the business side I've done aggregation and ML on thermal imaging networks, automating beer pours from taps (DIY bar), ML to determine faulty turbines in some critical civic power infrastructure.
>>
>>60082740
>>60082754
It's relatively easy for me to change it back(byte swap when storing and loading), but I think I might make it selectable.
>>
>>60082791
god damn you're making me feel old. I remember when SPARC was a thing and Big Endian/Little Endian implementation was dependent upon the hardware
>>
Where can I find the homoiconicity I crave, but without so many goddamn (((brackets)))?
Pls advise
>>
>>60082807
Elton John?
>>
>>60082823
this is a bad post
>>
>hurr i want to get into programming, whats the best for a beginner
No, Im well aware of my ineptitude and apathy for learning anything that requires dedication and does not include instant gratification.

What is the simplest language to learn. We're talking close to or less than 100 unique commands.

>inb4 brainfuck
>Pic not related
>>
>>60082850
>What is the simplest language to learn. We're talking close to or less than 100 unique commands.
assembly. you'd think i'm joking, but if you think low # of commands == ease of use then it's the one you're looking for
>>
>>60082922
Unless you're talking x86 which has well over a hundred
>>
>>60082850
Lisp, Pascal
>>
>>60082850
>>60082922 's suggestion is unironically a good one, but given the other constraint (instant gratification) I'm not sure it is the best route.
Lua is small, simple, and given its inclusion in a large number of host applications, would be pretty easy to quickly become productive in.

Plus Lua a cute
>>
>>60082946
>>60082922
https://en.wikipedia.org/wiki/X86_instruction_listings hmm, yeah, looks simple enough
>>
>>60082850
>>60082922
brainfuck, it's literally just 8 different characters and commands.
>>
>>60082850
C
>>
File: 1490761562480.png (372KB, 954x768px) Image search: [Google]
1490761562480.png
372KB, 954x768px
will just reading a bunch of solutions for different dynamic programming problems make me better at them? i've been just banging my head against the wall and getting nowhere. i feel kind of like someone trying to teach himself french without knowing it or having any reference material
>>
>>60083002
Seconded. C has very few "commands", but can be pretty difficult for nomies to understand.
>>
>>60083125
C is not hard to learn.
Lisp is hard to learn. Haskell is hard to learn. Idris is hard to learn.
>>
>>60082974
I'm glad I'm buying a MIPS board right now.
>>
>>60083191
CL is pretty hard, because it has so much old thinking wrapped up in it and an entire (aging, but still great) ecosystem, but Scheme is super easy.
>>
File: Virulence_(large).jpg (25KB, 248x248px) Image search: [Google]
Virulence_(large).jpg
25KB, 248x248px
recursive descent parser is almost finished
>>
Hey guys

I decided that I'm going to learn how to program

I was thinking of learning Python
i've been told to begin with C, but i've also been told that C++ is superior to C, so why not to go straight to C++?

majoring in stem btw if that matters
>>
>>60083271
FUCKING

GOOGLE IT

Pick what sounds cool and learn it you faggot. Programmatic thinking doesn't change between languages.
>>
>>60083271
>I was thinking of learning Python
Good for scientific stuff.

>i've been told to begin with C, but i've also been told that C++ is superior to C, so why not to go straight to C++?
C++ was based on C so a lot of core concepts apply and are simplier in C so the transition may be easier but C also has a lot of useless stuff that's not worth learning (like half of its standard library).
>>
>>60083271
Python is a nice way to get familiar with programming. You should pick up C next.
>>
>>60083302
>Programmatic thinking doesn't change between languages.
>t. Never left Algol derivatives.
>>
>>60083271
Python to learn the basics.

Once you can program a Tetris, then learn C/C++.

No reason to go hard mode first time around. Programming is hard enough as it is.
>>
>>60083336
Who cares, he's dumb and gay, you're dumb and gay, it's become one of the easiest subjects to google these days.
>>
what do I do if I want to make a program in JAVA where OOP is needless ?
>>
>>60083369
give up?
>>
>>60083336
To be fair, any language you're likely to use on things other than your own project is probably an Algol derivative. :(

Rust might change that, but only as an Algol-ML hybrid.
>>
>>60083369
You use Clojure.
>>
>>60082803
SPARC is one of my favorite architectures, I own a Sparc T2 based machine.
>>
>>60083369
Make everything static?
>>
>>60083419
>On December 11, 2007, Sun made the UltraSPARC T2 processor design publicly available under the GNU General Public License via the OpenSPARC project

wow I didn't know this I have not been keeping up with SPARC at all. Thats really awesome you're into SPARC don't let niche architecture die!
>>
>>60083369
Same as in C#:
>make everything static
>make classes as immutable as you can
>use lambda constructs a la LINQ
>use functional paradigms when creating your methods
>use extension methods judiciously

And then Bob is your proverbial uncle: you're basically using an imperative/functional-light hybrid with massive community, toolset, and framework support.
>>
File: 2017-04-26-180002_601x246_scrot.png (35KB, 601x246px) Image search: [Google]
2017-04-26-180002_601x246_scrot.png
35KB, 601x246px
>>60077582
I'm working on dash script
>>
>>60083471
I'm so hard right now
>>
>>60083483
>st-256color
my nig
>>
>>60083463
Same thing should be for POWER9 which is 6 times faster than best Intel 24 core cpu.
>>
>>60083369
Implement everything inside one class. Make everything static.
Never use the this pointer.

It'd be interesting to see just what the JIT does with this. The performance standard for oop languages is normally low because transforming it into something efficient is very hard. If you avoid all that perhaps you can get somewhere decent.
>>
>>60083369
C programming language is way to go.
>>
>operator overloading
Yay or nay?
>>
File: IMG_20170426_100242_001.jpg (1MB, 4160x3120px) Image search: [Google]
IMG_20170426_100242_001.jpg
1MB, 4160x3120px
im having difficulty starting question 34 can some one help please?
>>
>>60083619
Yes. It results in a cleaner API.
>>
>>60083642
take your time, break it down first.
translate func(a,b), then func( that, c+d)
and finally build f
also, I recognize that font...computer organization? was a fun class. MIPS is interesting. our professor made us write a MIPS interpreter as a final project. good luck
>>
>>60083514

POWER has had a few changes over the past couple of years. You can now also run it as little endian.

Too bad there are no low end modern POWER CPUs that can be purchased by enthusiasts.
>>
>>60083642
Break it down first into:
int f(int a, int b, int c, int d)
{
int sum = c + d;
int res1 = func(a, b);
int res2 = func(res1, sum);

return res2;
}


Then break it down further by expanding func, then translate that to assembly.
>>
File: anal beads.png (4KB, 471x57px) Image search: [Google]
anal beads.png
4KB, 471x57px
>>60083619
Of course.

How else would you add your swords together?
>>
>>60083678
No one know wtf they're doing in that class.
>>60083711
how does func work? i don't know C language.
so im guessing for
>int f(int a, int b, int c, int d)
i have to make an array.

add C+D by
addi $t0, $S2, $S3

im not usre about func(a,b) for both res lines
>>
>>60083619
Here's an experienced programmer resolving a performance issue. Guess what was to blame.
http://www.youtube.com/watch?v=Y2fxi_lFwE0&t=50m20s
(50:20) (may contain traces of heartcrushing realisations and tremendous disappointment)

With operator overloading most of the time you _rely_ on your compiler to fix your code for you (applies generally, not just C++). Same with other C++ features but operator overloading is one of those things that hide performance issues from you very easily.
It's almost never worth is because the code you do operator overloading on is performance intensive parts.
Constantly checking for if the compiler is doing what it should is very time consuming. So only use operator overloading when the performance of the code is of no concern. And stick to that rule.

Good luck with that when you have all your code done with operator overloading. You will most certainly just call the overloads. Without thinking even. An alternative is to force inline (most compilers have attributes for this). Because it's probably better in most cases. But again, you just changed the odds to your favor.
>>
>>60083619
Is a strongly typed language where you can define types more advanced than just renaming them, it's extremely useful.
>>
>>60083619
Yes, but ONLY if you know you won't be having any API changes, because it's harder to replace operators than a function.
>>
>>60083804
sepples, not even once
>>
do you guys know any good resources for learning c# relatively quickly? I know c/c++ and some java, but I've never seen any c# code before, so I have no idea where the c/c++ ends and the c# begins. I'm asking because the programmer at my dad's business needs somebody else to help him handle their dotnetnuke shit, and he wants me to be that person so they don't have to hire Pajeets again.
>>
>>60084024
>I've never seen any c# code before
https://learnxinyminutes.com/docs/csharp/
>>
>>60082215
I liked Jon Skeet's book, though I've read it 5 ago.
>>
>>60082807
Prolog
>>
>>60084094
thank you desu senpai
>>
>>60083804
>With operator overloading most of the time you _rely_ on your compiler to fix your code for you (applies generally, not just C++). Same with other C++ features but operator overloading is one of those things that hide performance issues from you very easily.
I'm a bit of a shitter but isn't operator overloading just creating a custom function for an operator?
Like overloading +, you still need to write the + function code.
>>
>>60084224
Yes. Most real-world C code avoids function calls precisely because they incur runtime overhead. It's better to keep as much of your logic as possible all in the same function and jump around with goto.
>>
>>60079476
Why is it not just 17?
>>
>>60084251
I believe you have a typo. "Autistic" is how you spell "real-world".
>>
>>60084251
As someone who pretty near uses functions as a way to comment code, that sounds terrible.
>>
New thread:
>>60084350
>>60084350
>>60084350
>>
>>60084345
That's irresponsible and I would fire you.
>>
File: unkown pleasures.png (1MB, 1366x768px) Image search: [Google]
unkown pleasures.png
1MB, 1366x768px
noob question for Java

public class OriginalPoster{
public boolean isAFag;

public OriginalPoster(){
//this?
this.isAFag = true;
//or this?
isAFag = true;
}
}


is there a difference between using this.attribute = X or attribute = X in the constructor?
>>
>>60084394
Haven't used java in a while but I'm pretty sure this. just refers to the class scope so it'd go to isAFag.

It's so you can do
public class OriginalPoster{
public boolean isAFag;

public OriginalPoster(boolean isAFag){
this.isAFag = isAFag;
}
}

As for specific specifics, probably some difference.
>>
>>60084380
I was meaning separating parts into functions and commenting on the functions by the way (having the function names make it more readable is a bonus).
Hopefully that's not as bad as what you were thinking.
>>
>>60083642

This should be rather trivial so long as you have the requisite knowledge. You will need to know of the following:

1. How to use the jal (jump and link) instruction. This is used for function calls
http://chortle.ccsu.edu/assemblytutorial/Chapter-26/ass26_4.html

2. What registers are used for what purpose.
http://www.cs.uwm.edu/classes/cs315/Bacon/Lecture/HTML/ch05s03.html

Remember that there are two types of registers to be aware of -- caller saved and callee saved. Registers that are callee saved, have to be saved onto the stack before you use them, and then restored before the function concludes. Registers that are caller saved need to be saved onto the stack before you make a function call, or they may be trashed. Note that you don't need to save caller saved registers if you aren't using them at that point. For MIPS, the $s0-$s7 registers are callee saved, while the temporary registers, argument registers, and return value registers, are all caller saved. You shouldn't need to use any others.

3. How to use the add instruction and move pseudo instruction.

Once you know these, the problem is trivial.
>>
>>60084251
>>60084345
>>60084380
>>60084663
http://number-none.com/blow/john_carmack_on_inlined_code.html
This is a worthwhile read for you.
>>
>>60084251

As someone who works on C quite a bit, this is a load of shit. Compilers can inline things if it would be more efficient. And function call overhead isn't that fucking expensive.
>>
>>60084790
Thanks Ruby ill look into it.
>>
>>60083642
>the function declaration for 'func' is 'int f(...'
This is why you name things properly, even in trivial examples.
Thread posts: 321
Thread images: 41


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