« first day (537 days earlier)      last day (3108 days later) » 

12:11 AM
@PeterVaro saw this on mailing list couple of days... kind a... debate on wording.
sigh can't get used to new Haris avatar... :D
 
@DrorK. ello :^)
 
@Insane We do not condone insanity.
 
@DrorK. I don't condone DorKs >:)
 
You are one- we are many! :)
@Insane So, the issue with the terminology is clearer now?
 
@Insane 'pus
 
12:22 AM
Yes I think we're all good now. I understand now but I still think my prof should update her lectures since there is an actual meaning of pass-by-reference in C++ and other languages :P
Rather than confuse all her students even though she's technically correct :P
 
@Insane I don't think it's fair to judge your professor's terminology from the POV of other languages but the targeted one
 
@DrorK. Meh, fair or not it's what I think.
 
Then you should adapt!
Personally I think it's much more funnier to debate definitions/terminology/conventions from within the C standard itself
 
True that
 
Here's another basic one:
int i; i = 123; ... how would you describe it?
 
12:34 AM
i is a variable which stores 123? or i is a reference to the number 123?
 
Well actually I was going after the difference between an initializer/initial value/assignment... although the standard doesn't define 'reference' within this context of referring to an object/identifier, I suppose it makes sense
 
yeah, i'm not familiar enough with C or programming in general to be able to hold my own in these types of conversations lol
also I guess italicize doesn't work if the underscores are right next to another_word_.
 
12:55 AM
@Insane BTW, if you ask me, the funniest thing about this matter is... the vast majority of the programmers would describe: int *p; *p; as dereferencing ... while dereference has no such term/definition, while they'll object to the concept of referencing objects... that's ironic if you ask me
 
Hah; didn't know that.
 
Oh, you didn't?
* is the indirection unary operator
Here's another one: the ?: operator... commonly called: "ternary operator", is actually the conditional operator.
Another one: the % operator... is the remainder operator...
 
1:14 AM
I knew about the ternary operator & modulus (duh) but the whole dereferencing thing I didn't.
 
You knew that the name of the so-called ternary operator is the conditional operator, but you didn't know about dereferencing?
Now that's interesting!
 
1:26 AM
Yeah I was looking at some lua code from a friend and asked what it was and he told and explained it. But that was as far as it got. I've never used it
 
2:14 AM
Hey, @R.Yoder
ok just listen then. :)
btw the rep is rolling in for your question, you could hit 40 soon enough
So here's the scoop -- you will probably learn more about this kinda stuff if your school offers an Operating Systems course. But with concurrent programming, ultimately there's a thing called a scheduler that decides which programs get to run.
and it looks at all of the tasks which are not waiting on something
and it can see how many schedulable resources it has (CPU cores, e.g.)
and it typically has a timing resolution which dictates how often it re-evaluates this list
these things will vary between computers, which may explain why you see different results
try your C program on multiple OSs, multiple computers, you'll find different results
you can specify how many threads in your OMP pragma instead of defaulting to the CPU core count
so you can probably create a program that demonstrates breakage
if you can't it might mean that your implementation of printf() on that computer does grab a lock/exclusion, like was suggested in comments.
but there's no guarantee that it will do that from the language
so some implementations probably won't
ok, so each OS and/or compiler has a library that supports the C language, with all of the functions that are defined by the C language.
built-in utilties like printf()
so on linux, the most popular one is called glibc
and you can look at the source and it might be challenging to decipher for printf() but you can look at it to see what it does
but ultimately there's a different C library for windows, and iOS, etc.
so each of them can have slightly different behavior so long as they still do all of the things in the language standard (and none of the things that are barred by the standard)
and occasionally they have bugs too. But this one's not a bug.
so lookup how to do mutexes for your operating system
and see if you can make an OMP with tons of threads to make printf() break on anyone's computer
if you can make a reproducible breaks-anywhere example and show how to fix it, you're well on your way to your CS degree
good luck
 
2:36 AM
@BrianCain Usually it's easier to demonstrate such concerns with stdout and stderr
 
2:54 AM
yeah, that's pretty much where we came from
the asker was wondering why the output was interleaved when his professor claimed that printf() is an effective mitigation for the interleaved output he saw with std::cout
so he's got the example but was afraid it was confined to his code/computer
so I suggested he create an example that breaks on anyone's computer
and then show the class how to fix it (not with printf() but with real mutual exclusion)
 
 
2 hours later…
4:45 AM
@BrianCain if I may, the story about std::cout vs. printf and the standard output being mangled by multi-threading is something I experienced myself
and indeed, there's no guaranty whatsoever that printf will e atomic
nor that some buffering somewhere won't mess-up all your attempts to make it clean anyway
but the thing is that when you use std::cout (I know, that's C++ and I'm in a C chat room here, but please bear with me)
you usually write it like this: std::cout << "This " << thing << is << "actually" << made << "of many different" << calls << to << "operator<<()" << std::endl;
and even if, by chance, operator<() happens to be atomic, your entire line isn't at all
which give plenty of opportunities for the standard output to get mangled
whereas printf won't suffer this "flaw" and will give less chances of messing things up
 
5:06 AM
@PeterVaro Yup, there is always different ways to look at concepts. :)
 
@Haris Morning
@Gilles Given a function which is based on multiple fwrite() calls, would you consider it to be any different?
 
@DrorK. you mean, if internally printf was implemented with many small fwrite calls, rather than building up the final output internally with a buffer and calling once unique fwrite?
 
@DrorK. Morning
 
then no, that wouldn't be any different
 
@Gilles Yes
 
5:14 AM
but that said, I never looked at how printf is written internally
 
@Gilles As far as I remember, all the fprintf implementations I've read, were about utilizing as little buffers as possible
 
my experience is simply that, in the context of an OpenMP code, you get less chances of mangling your stdout with printf than with cout
the OP of the initial question was despaired than everyone else was having well behaved outputs where he had all it mangled stackoverflow.com/questions/33663123/…
so some extra explanations were welcome to give him more confidence in explaining why the assumption that printf will never mangle the output is wrong
 
 
2 hours later…
7:38 AM
helloc all
 
7:48 AM
@Kotshi helloc
 
8:00 AM
anyone around to answer a simple thingy :P
 
@Insane Yup :)
 
if I declare a global array int myA[5] then use a function to initialize it to 0 as such: int myA[5] = { 0 } does that redefine the array or create a new array only under the function with the same name (my suspicions)?
 
It will create a new array, whose scope will be just that function
 
(If I remote int in the function part it gives me an error)
That's what I thought. Gah!
 
I guess it creates a new array so you can"t do that because myA isn't a pointer
You can use memset
 
8:03 AM
My assignment forces me to create a function to initialize my array which I guess I could just do with a for loop and set all the values to 0 instead?
 
For exemple
 
@Kotshi Then this lied to me (Snippet 3)
 
{ 0 } There is only one int in this array, what you meant was {0, 0, 0, 0, 0}
 
Woah oops didn't mean to edit my previous message
It claims = { 0 } does the same as {0, 0, 0, nth}
 
Then it must be true
I'll try it
 
8:07 AM
Probably works only when declaring, i.e. why I get an error when I do: myA[5] = { 0 } by itself in the function.
 
@Insane Yup, that works only while declaring..
 
What error?
 
/cry
 
You can do that while declaring it globally also right?
 
You can but like you said only when declaring. This is the error: i.imgur.com/UBtc04u.png
By the way @Kotshi you weren't about to explain memset up there when you said "For example" before I interrupted you, were you? :P
 
8:10 AM
Nope
I was about to let you search about memset
 
>:)
 
As this is an assignment, I suggest that you recode it by yourself
 
I really need to stop telling people it's an assignment.
 
Come on, it takes only one loop
 
I actually was using a for loop to set all values to 0 before
But then I saw that SU question and thought I'd try
 
8:14 AM
So, you're done?
 
Well that's not using memset
That's using a for loop right
And I just did myArray[i] = 0
 
I guess memset is a for loop
This is basically what memset does
 
@Insane What is the purpose of setting it to 0?
 
@DrorK. Honestly; no idea. I just know I'll get marks off if I don't..
 
@Insane Earlier we were discussing terminology and definitions, so technically there is no 'global'
 
8:16 AM
@DrorK. LOL, shut up ;)
 
@Insane I'm not joking
 
Now I'm confused
 
@DrorK. How would you arrive at that
 
@Haris In C there's file scope
 
@DrorK. And thats what is global
 
8:19 AM
That question actually ends up saying to just do what I did before with the for loop
 
But this is a bad idea for an assignement
 
Yeah I'll just stick to the for loop
 
Alright ;)
 
@Insane If you want to assign 0, you can do it.. stackoverflow.com/a/7202474/1795279
 
@Haris Oh, thanks.
 
8:22 AM
What I'm trying to explain is that the your assignment is to recode a int equivalent for memset
 
@Kotshi Oh, well dang I thought you meant I had to work on my own assignment myself or something since what I'm working on is an assignment for school
Guess @Haris' link gave me the answer then. Ohhh wellll
 
Creating a function with only one line which is a memset call won't be appreciated I guess
 
@DrorK. I think what you meant was, if declared "static int" it will have file scope, and if declared "int" it will have global scope (Both are declared outside all the functions).
This goes for functions also
 
I think he meant that there is no real global in C, a variable used as global in a file can't be used from another file.
But forget about it for now
 
9:27 AM
@Haris Both declarations you've mentioned would have file scope, and there's no global scope
When it comes to file scope, static storage duration and external linkage are implicit, while using the static storage class we affect the implicit external linkage- making it internal linkage
(bbl)
 
10:10 AM
@DrorK. won't "int a;" when declared outside all functions be visible to other C programs who include that file
 
 
3 hours later…
12:50 PM
 
sorry @Apoorv, but you are never here :/
 
:(
Can't remember exactly, where did he go...
 
@Kamiccolo He was active when i joined this room
 
@Haris Yup, I remember that... Now, 55 days no seen...
 
@Kamiccolo Is he active on SO?
 
12:59 PM
Reminds me some Open Source MMORPGs... in which some well respected elderly couple just disappeared from game. Like... half an year ago their son came to tell us, that both died. Cancer.. and cancer. So, since then there are couple of dragons named by those two fellows...
@Haris >" Last seen Oct 17 at 13:30"
 
@Kamiccolo Ya,
 
blargh. I was sad enough already >_<
 
What's the game?
 
@Kamiccolo Anything major?
 
1:24 PM
helloc @Dmitry;
 
2:14 PM
@Haris not really. Just... rant about women not having any sense of logics.
 
@Kamiccolo Thats not true actually.. My best friend is a girl and she is one of the best coders i know. :)
 
@Haris You are talking about a different specie ;)
 
@Haris I know some pretty good engineers as well. Not only software ones...
but one example makes sad.
 
@Kotshi haha..
 
The specie that makes us feel dumb^^
 
2:26 PM
One of my favorite ones, actually quite famous - Jeri Ellsworth. Agggh... I guess, I've already mentioned her here...
helloc @tristan;
 
user559633
helloc
 
sigh Wikipedia seams down. Or is it just me?
 
Works fine for me
 
user559633
Up for me.
 
helloc @tristan
 
2:29 PM
@Kamiccolo working here too, m reading your friends page :D
 
@Haris nah, don't know her personally... but still. Basically, having guts to screw mayor Physicists community and prove that You can actually make pretty tiny electronic components in Your garage...
 
@Kamiccolo Yup, a whole system in a joystick, its good..
 
That's badass
In my school there is a girl that doesn't give a fuck about anything
 
If I am talking about programming style, will the whole topic be opinion based. Or are there any fixed rules to follow with legitimate reasons that is accepted universally.
 
But is better than us
 
2:41 PM
@Haris how would You define a good coding style? :}
 
@Kamiccolo Thats my point. There are few things that are accepted almost universally like indentation, but does that make it anything more then a general opinion.
Why I am asking this because. I know SO does not entertain opinion based questions. In fact there is a reason dedicated entirely to that which one can choose while voting to close a question.
So, i was wondering why is there a dedicated tag stackoverflow.com/tags/coding-style/info for questions that would usually spark a opinion based argument
 
@Haris still, I'm curious, do You have generic rule(s) for any good coding style? :} Whatever language it's for.
 
I wonder if project euler is for programmers or for mathemathecians who can code. Because many of the non trivial questions require knowledge of some field of mathemathics unless one decides to solve the problem by brute force. What do you say?
 
@RegisteredUser Personally, I'm not mathematician at all. But I enjoy solving Project Euler problems, because it makes me google and find plenty of neat things. Like... a lot. There are enough problems which are less into math and more into algorithms.
 
@Kamiccolo One task/function, proper 4 space indentation, descriptive variable names... I dunno, it comes as i code.. :D
 
2:54 PM
@RegisteredUser also, there is a project called Rosalind, which is even more into Bionformatics....
@Haris this is language and technology dependent. But do You have any generic rule? :}
 
@Kamiccolo May be i don't have.. I didn't get you..
 
@Kamiccolo thanks, didn't knew of rosalind. I agree that project euler requires lot of googling.
 
A website where I enjoyed practising algorithms is codingame.com/start
 
3:21 PM
@Haris personally, I skip most of coding styles without reading much if it doesn't have proper motivation. I mean... Basic guideline which doesn't say "why You should or shouldn't do something" for me doesn't sound usable at all.
Also this kind of lacking guidelines are just a food for endless debates and agreeing to disagree. Because original mindflow and motivation isn't stated anywhere. So...
@RegisteredUser and that's a skill, also :} Digging through all the papers of some graph theory to implement some algorithm... to rule'em'all...
 
3:41 PM
@Kamiccolo Yup thats true. But i was asking in context with the SO tag. Why is it there if opinion based questions are not eligible
 
Haha
 
@PeterVaro Thats what I am talking about :D
 
4:36 PM
@Haris Morning, I hope that you've read a bit and answered your question from earlier?
 
user4651282
what do you say about this article? link text
 
5:06 PM
@Atomic_alarm I agree with it, though I'm missing the C and C++ listings
the question is: why are you interested in this topic/what are you lookng for?
 
user4651282
I was wondering the opinion of other people. I have not found arguments why,Go,Rust or D should to replace C and/or C++
 
C stand for "cannot be replaced" :D
 
user4651282
I assumed it was due to insufficient knowledge of the English language
 
user4651282
hence the question
 
@DrorK. I was a little busy, and its almost 11 at night in India. So will continue this discussion tomorrow
 
5:14 PM
@Atomic_alarm IMO C is is very hard to replace and it will be for a long time -- not only, because of the extreme amount of legacy code, and not only because it is so easy to interface with other languages -- but also because it is so pure and minimalistic, and so well mapped to the hardware
 
good night than, @Haris :}
 
do we need safer alternatives? yeah, why not, but that also means the language will be way more complex -- at least we can see this if we look at the alternatives we already know
so IMO unless someone invent a very similar language to C, which will be only a tiny bit more complex because of the overheadless safe/automatic memory management, C won't go away
 
Night guys.
goto bed;
 
free @Haris;
 
Morning @PeterVaro
So you've understood the approach they've taken?
They keep the link with both the id of the note, and the id of the group
And when you 'call' links, it first lookup the id within the local group
(notes have 'strong' ids, so collisions are virtually impossible)
 
5:55 PM
@DrorK. ofc I understood -- though it was way harder to underalstand without the proper explanation of what a group really is
 
A group of notes? A container of notes?
 
personally I don't like "smart" systems for note taking -- I prefer plain text stuffs
 
Plain text is indeed the 'format' I use, but the luxury of referencing specific notes or even specific paragraphs within notes, that's nice
 
but that is just how you interpret plain texts -- I mean it is totally doable without any fancy heavy application
 
How do you have references with such plain text?
 
6:00 PM
you place "anchors" in text those need to be referenced and then you reference them
(or maybe I misunderstood the question)
 
I meant, the ability to place a <link> to a specific paragraph from multiple places, is very handy and organized
Let's say that you have multiple documents and some of them may refer to a 'shared' document/paragraph, you can write about it briefly, and provide a link to it
There are maybe 3 things that I need out of OneNote
References, search, and hierarchy
 
well if I had to implement such system in plain text, I would do it like this: each file is a document, and each project is made of dirs and files and have a single database (very likely sqllite)
I would create an easy to parse yet hard to write unwillingly syntax for references
and each time I update the documents I had to "commit" the changes so the db would update the reference list of its own
at the end it would be quite easy to search or follow a reference path and it would be also very easy to create any kind of hierarchy
I don't know.. maybe this is way too complex -- maybe I would use an existing wiki engine
yepp. I would definitely do that!
 
:)
Simple is always better
 
wikis are pretty nice and well tested things, can be read as plain texts, also can be rendered as rich HTML text in browsers, have search options, can be published easily, etc.
(designed for collaboration.. they are cool)
:)
 
6:20 PM
@PeterVaro or existing semantic W̶E̶B̶ solution....
 
6:42 PM
@Kamiccolo or that, yeah.. or some super heavy NLP framework which understands my free-word references and generate links for me on the fly ;)
(or did you refer to that when you mentioned semantic?)
@Haris if you will get back here in the morning, will you be so kind and ping me on facebook messages? (my name and avatar are the same as here)
 
7:00 PM
@DrorK. Viva la Occam's Razor!
 
@PeterVaro NLP would be next step :} For starters maybe some lightweight mark-up would be enough...
 

« first day (537 days earlier)      last day (3108 days later) »