« first day (474 days earlier)      last day (4689 days later) » 

00:02
what keyword did you use to search for that?
@Xeo oh noes
not ponies
Reddit is full of it already
hihi, found two C++ people in my FB friends list tonight, whom I had no idea they were
Xeo
Xeo
0
Q: Add chat oneboxing support for comment links

XeoSince we have direct links to comments now, IMHO it would only be fair for comment links in the chat to be treated on the same level as question and answer links. (This question feels kinda empty, and I don't even have a pony picture handy to pad it...)

Anyways, my quest in the meta jungle!
one of them being female, makes it even better :)
1
Q: How to run my own program on UNIX/Linux

Ahmet TanakolI created my own program in C and I want to add it into this directory /usr/local/bin be able to run (execute) it. Actually I don't know the commands for this. Could someone help me?

> fixed up your question a bit so people will not chase you away. You seem to have a programming question after all :)
@Xeo why no pony pic?
Xeo
Xeo
00:07
@MooingDuck As I said, I didn't have one handy. :(
Maybe @RMartinho will draw one for me?
Xeo
Xeo
lawl
last one :)
lol @MooingDuck telling everyone the question changed here: stackoverflow.com/questions/9105090/…
rofl - I like that last one (took a second to register)
00:19
@RMartinhoFernandes how would they know otherwise? I'll remove them as they're addressed if I recall
@RMartinhoFernandes better than leaving misinformation up
Not complaining, I just find it funny.
Xeo
Xeo
Uhm... how does one center stuff in html?
<center>? No idea.
Conversion from string literals to char* was finally removed in C++11, right?
Xeo
Xeo
Yes.
@RMartinhoFernandes - that "it has to be a pointer" answer on the Q you just answered could use a few more downvotes
00:33
> Well I know it, but I need something like that: $myfork test. I have to call like this. – Ahmet Tanakol 7 mins ago
@RMartinhoFernandes Looks like we are going to see another shift in that question. Oh my.
I feel like a vet, with a question stuck in a birth canal. Pulling doesn't help much, it only makes the question come out in shreds
> I guess working on Objective-C all day is destroying my brain. – Tim just now
lol
@sehe perhaps he wants his program to be called myfork, with the argument test?
@RMartinhoFernandes I had exactly the opposite problem in objective-c: stackoverflow.com/questions/7753680/… - how do you live without RAII
@sehe I hope no one will suggest PATH=.:$PATH
Oh wait, you did.
sudo all_your_base_are_belong_to_us
00:39
Ah no, not exactly. Yours takes a snapshot of $PWD.
@awoodland Man, my eyes won't ever be able to read that syntax.
@RMartinhoFernandes I only did about 8 hours of objective-c but I never managed to shake the "this is really backwards" feeling when comparing it to C++
it's fairly cute how it's a superset of C
If I have an int array[1][1] = 0; and I want it to set to a space, how do I do this? In c
and properly a superset, without those "what is legal C but not legal C++?" tricks
@LearningC int is a number, a space is not a number. Can you clarify?
well, C and Smalltalk are orthogonal (at least in the Objective-C implementation) so they are better able to clearly separate the features, for better or worse
00:47
To add to confusion, a space is not not-a-number.
@RMartinhoFernandes you're going to break him :P
You know that array with the 0s,1s,2s I posted earlier? I need to change all the 0 to a space
if(the_board[i][j]=='0'){
the_board[i][j]= ' ';
}
@LearningC make it an array of char instead
It's an array of numbers.
will this work?
00:48
Spaces are not numbers.
@LearningC yes, if the_board is an array of characters
@LearningC It will compile and run, but it won't have the effect you want.
@RMartinhoFernandes debatable, depending on if he's consistant
@MooingDuck The reading code reads ints, and is supplied by his teacher.
So the array has zeros, not '0's.
well I use fscanf(inFile, "%d", &the_board[i][j]); so I need to change that to a %c?
00:49
@RMartinhoFernandes in that case it's the xy problem
@LearningC "%d" will only read numbers, it should ignore spaces
scanf with %c is rarely a good idea.
@LearningC you already have this code, why are you changing it?
@MooingDuck I need to to ignore spaces. But than how would I change all 0's to be space?
That makes no sense!
What is it you really want to do?
@LearningC why are you changing the 0s to spaces?
00:51
I have half the code the professor wants me to finish the other half
It is to print out a checker board
Ah. So you want to print spaces, not change zeros to spaces.
@LearningC if (fdsafd[ds] == '0') printf(" ");
is anyone here who remembers my problem? :)
Can I post screen shoot on here?
@renatofernandes got it
@LearningC ideone.com
@renatofernandes you were trying to read in a series of integers and then display them in the reverse order using a custom linked list that the school provided without recursion or arrays
01:01
yes
imm trying to make my second loop and u stated scaf should not be in it?
scanf*
Of course not. The first loop reads everything. The second loop only prints.
@renatofernandes correct the first loop should read in all the data, and prepare the list. The second loop should display the stuff in the list (and disassemble it)
Ok my assignment is to make this: ideone.com/1gbqi without the 0s,1s,2s, I need to put a space for every 0 and a r for every 1 and w for every 2.
ohh alrite ... so why do i need a loop? cant i just print x?
nee anther loop*
01:04
@renatofernandes you have to print x for each and every number in the linked list
@RMartinhoFernandes No I didn't. $PWD is decidedly different from .
so while the list is not empty, print x?
@sehe Yeah, I noticed.
@LearningC so right where you're about to print a zero, print a ' ' instead
or (first x)
01:04
@renatofernandes that's most of it yes
Xeo
Xeo
Dammit, I want modules.
@MooingDuck printf("%d", the_board[i][j] ); it won't work with %d will it?
For some dumb example I need an aggregate that has a vector of ints. I don't want a foo, I want something with some (even if minimal) meaning.
@LearningC sure, that'll print a number
let me show you the code I have so far
01:06
@RMartinhoFernandes ivec?
@LearningC that'd be good
struct name_here { std::vector<int> another_name_here; more_members; };
@RMartinhoFernandes my_int_container?
this is what I have ideone.com/u0hgz and this is a copy of hw1.3.in ideone.com/Gqhxh
01:07
@MooingDuck See, that's basically foo.
Xeo
Xeo
struct algo{ std::vector<int> operands; };?
@RMartinhoFernandes I don't know what you want then
@Xeo Ah, good.
Thanks.
Xeo
Xeo
@MooingDuck A meaningful name for a dumb struct
@Xeo but I don't know what the struct means
Xeo
Xeo
01:08
You should give it a meaning.
That's what he wanted. A struct with a meaning that contains an std::vector<int>
how come this doesnt work
It's a character for my move semantics comic.
int main(void){
    int number;
    ilist x = iempty();
    while (1 == scanf("%d",&number)) {
       x = icons(number, x);
    }
    while (empty_huh(x)){
    printf("%d\n",x);
    }
    return 0;
}
Xeo
Xeo
lol
@RMartinhoFernandes Linky?
@LearningC `if(the_board[i][j]=='0') printf(" ");
01:09
@Xeo, you still watching Mirai Nikki?
@Xeo I'm still working on it.
@RMartinhoFernandes I tend to use std::vector<T> vector;. I'm not sure whether that's unimaginative through laziness, or clever through simplicity.
Xeo
Xeo
@Mysticial I'm a bit behind (ep13), since I read the manga. Why?
@MooingDuck of that might work let me see
When I upload it somewhere, I'll link to it.
Xeo
Xeo
01:10
@LucDanton What does that vector represent?
@Xeo Just get to episode 15... :-)
Xeo
Xeo
@RMartinhoFernandes Ah, I thought it was for an existing answer / question.
@Xeo A sequence of int, duh.
@renatofernandes while list is not empty display x. while list is not empty, display x. (hint: x never changes when you do this.)
@renatofernandes also, empty_huh(il) returns 1 (true) if il is empty
i get a compliing error when i use empty_huh?
01:11
@Xeo DumbStruck
in the while loop... do i need to set it as a variable?
@renatofernandes what error? Looks fine to my eye
@renatofernandes shouldn't have to
implicit declaration of function ‘empty_huh’
@renatofernandes you misspelled it: iempty_huh (also, backticks for code, by the ~ on American keyboards)
sorry stupid me
:(
01:13
@renatofernandes we've all done it a million times, no worries
@renatofernandes had a bunch of pros in here earlier mix up getch and getchar
I changed it to this
if(the_board[i][j]=='0'){
printf(" ");
}else if (the_board[i][j]=='1' ){
printf("r");
}else if (the_board[i][j]=='2' ){
printf("w");
}
and I got :
0 1 2 3 4 5 6 7
|---|---|---|---|---|---|---|---|
0| | | | | | | | |
|---|---|---|---|---|---|---|---|
1| | | | | | | | |
|---|---|---|---|---|---|---|---|
2| | | | | | | | |
|---|---|---|---|---|---|---|---|
3| | | | | | | | |
|---|---|---|---|---|---|---|---|
4| | | | | | | | |
|---|---|---|---|---|---|---|---|
5| | | | | | | | |
|---|---|---|---|---|---|---|---|
6| | | | | | | | |
|---|---|---|---|---|---|---|---|
7| | | | | | | | |
@LearningC the array doesn't hold characters, compare against ==0 not =='0'
according to what you said
int main(void){
    int number;
    ilist x = iempty();
    while (1 == scanf("%d",&number)) {
       x = icons(number, x);
    }
    while (!iempty_huh(x)){
    printf("%d\n",x);
    }
    return 0;
}
i seem to get big numbers when i press control-d :(
01:16
'0' is the character zero, not the number zero.
It's an important distinction.
@Xeo I don't think so
Yes I got it!
Xeo
Xeo
Oh, wait, I was thinking '\0'
@MooingDuck man I really appreciate the help today.
01:16
@renatofernandes are you getting the same number over and over again?
yes
684000 something like tht
@renatofernandes is that because you never change x after you finish reading it? And print x over and over?
wait....
What's the algorithm you're trying to write?
@renatofernandes you can't print x, x is a list!
You can't print the ilist with %d.
01:18
check out the awesome results : ideone.com/vN43h
i have print list
Xeo
Xeo
I should really switch to functional languages, considering how lazy I am...
funciton
lemme try tht
@RMartinhoFernandes trying to read in a series of integers and then display them in the reverse order using a custom linked list that the school provided without recursion or arrays
@MooingDuck Oh I know. I was trying to get him to recap what the loop was supposed to do.
01:19
@LearningC WOO!
@RMartinhoFernandes I thought you rebooted
@LearningC Neat.
im giving this
static void iprint(char *label, ilist d){
   printf("%s ",label);
   while (!iempty_huh(d)) {
      printf(" %d",ifirst(d));
      d = irest(d);
   }
   printf("\n");
}
@renatofernandes well, time for me to go, but hopefully people here continue to assist you
ohh alrite
01:21
Should I use a switch for this part? `if(the_board[i][j]==0){
printf(" ");
}else if (the_board[i][j]==1 ){
printf("r");
}else if (the_board[i][j]==2 ){
printf("w");
}else if (the_board[i][j]==3 ){
printf("R");
}else if (the_board[i][j]==4 ){
printf("W");
}
`
thnks for you help !! :)
will be here tmmrw?
@LearningC yes please
@LearningC Ideally, yes.
@renatofernandes that looks good
If you can use a switch, then by all means do so.
01:22
@MooingDuck Thanks . Bye
@renatofernandes most likely
why is still repeating thou :(
okay bye mooing :)
@renatofernandes are you calling the print function in a loop still?
yes..
i shouldnt?
@renatofernandes how many times do you want to print the list?
01:23
Isn't the print function printing the whole list?
once ...
yea it print the list
@renatofernandes do you see what we're hinting at here?
yess ill try to figure it out :) ... thnks
should I post my source online so my professor won't think I plagiarize?
i have this now, i didnt use i print cause i want my function to print one line at a time
int main(void){
    int number;
    ilist x = iempty();
    while (1 == scanf("%d",&number)) {
       x = icons(number, x);
    }
    while(!iempty_huh(x)){
    printf("%d",ifirst(x));
    x = irest(x);
    }
    return 0;
}
i get interaction error's thou :(
01:31
Not sure what that means.
@renatofernandes Man that code looks complicated. I haven't even learn some of it
> Meet V. V is a vector of ints. Like others of her race, she likes to collect ints in a bag. She is very organized, so she never loses track of her bag, and she never forgets how many ints she keeps in there.
What do you think?
@LearningC yeaa i just started C too :(
@renatofernandes What's an interaction error?
Xeo
Xeo
01:35
@RMartinhoFernandes You don't want to know.
Woa, another Fernandes. Are you two related?
firstly i input 1 2 3 each on one line then click control-d, i see it prints 3 2 1 on one line but i want each integer on a separate line, after it prints the line horizontally it gives a big interaction error of heaps or something
@EtiennedeMartel Not that I know of.
@Xeo Well, I do want to know. That's why I asked.
@renatofernandes printf("\n"); is your friend...
oooo
kay i get it to print but after it prints i get a huge interaction error with heap summaries and such :(
01:40
Are you running your program with valgrind or something?
well, I assume your ilist isn't doing a good job somewhere...
im using it on a virtualbox ... on a linux
Not invoking valgrind?
==26870== HEAP SUMMARY:
==26870==     in use at exit: 0 bytes in 0 blocks
==26870==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==26870==
==26870== All heap blocks were freed -- no leaks are possible
==26870==
==26870== For counts of detected and suppressed errors, rerun with: -v
==26870== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Does the "error" look anything like this?
HEAP SUMMARY:
==4569== in use at exit: 24 bytes in 3 blocks
==4569== total heap usage: 3 allocs, 0 frees, 24 bytes allocated
==4569==
==4569== 16 bytes in 2 blocks are indirectly lost in loss record 1 of 2
==4569== at 0x4025BD3: malloc (vg_replace_malloc.c:236)
==4569== by 0x80485A5: icons (ilist.c:12)
==4569== by 0x804852E: main (example.c:24)
==4569==
==4569== 24 (8 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 2
==4569== at 0x4025BD3: malloc (vg_replace_malloc.c:236)
Xeo
Xeo
Valgrind is awesome.
01:43
Well, why are you running valgrind?
That's not an error, that's just the regular output of valgrind.
im useing gedit on a linux? O_O
(Well, but there are memory leaks, though these are not your fault...)
I'm guessing those list nodes never get freed and that's by design.
oh ok
ill ask the my prof's
@renatofernandes How do you execute your program?
01:45
by shooting it in the face!
so this is my code,
#include <stdio.h>
#include "ilist.h"


int main(void){
int number;
ilist x = iempty();
while (1 == scanf("%d",&number)) {
x = icons(number, x);
}
while(!iempty_huh(x)){
printf("%d\n",ifirst(x));
x = irest(x);
}
return 0;
}
and i just press contol-r to run and control-d when im done inputting?
Xeo
Xeo
@renatofernandes ctrl-r where?
on gedit?
on a linux..
so you don't use a compiler?
Well, I guess you have some setting on gedit that runs valgrind. I can't help you there, though, I never used gedit. Just know that is not printed by your program, so it's not bad.
01:49
alrite no worries, ill ask my profs whats wrong
Xeo
Xeo
I didn't know you could edit the keybindings in gedit oO
It is possible to write a checkers game in C within 2 weeks?
@LearningC Depends on how many hours per week you put on that.
It also depends on your actual skill.
@EtiennedeMartel let say I spend 4 hours a day
with very basic skills
I've found most things like that take 3 days
01:52
wow
You must be very experienced
Well, to get something working. 2 weeks to finish it
Xeo
Xeo
Ugh, C.
I have 3 other classes and I spend most of my time working on this just one programming class.
It takes 90% of the time to do 90% of the work. It then takes 90% of the time to do the remaining 10% of the work.
well, working in C is going to be a pretty mean hindrance
01:55
Yeah, talk about shooting yourself in the foot before the project has even started.
what does "mean hindrance" mean?
It's a serious obstacle.
posted on February 01, 2012

This week, I want to talk about sacrificing time to gain space.

it's a big problem that will significantly slow you down
Xeo
Xeo
@EtiennedeMartel If this was a C room, I'd totally set that as a title.
01:56
C is very tedious
@Xeo Ha, the current room description actually comes from one of my quotes.
Being mostly a C programmer myself, I will recommend that you don't write a checkers game in C.
can we request a C room?
Well the professor is making us
You can make one
you can make one
01:57
You can make one
(Rule of three)
@Pubby yes but I won't be able to run it. Very little C experience
@LearningC There's a way to make it run itself somehow. No room owners

« first day (474 days earlier)      last day (4689 days later) »