« first day (2497 days earlier)      last day (2677 days later) » 

mr5
mr5
01:12
o/
\o
o/
\o
 
1 hour later…
02:37
Is there anyway to apply a validation attribute to a winforms textbox? ... im quite confused about how its supposed to work.
hey guys was wondering if there I a room for C programmers ?
nop
oh damn :/ where do I go for help ?
stack overflow, tag C
yeah tried that but only found "C is for control" in the rooms
02:44
not helpful, i know
ask a question on the site
@ross.c And why didn't you go there?
@KendallFrey I did but it had nothing to do with C :/
That's odd, considering the name of the room is literally "C"
are you sure they weren't just talking about something else at the moment?
ill go back in the history of the chat haha
and check it out
mr5
mr5
I think you can ask it on C++ room
02:47
ill try that as well thanks lads
C:\ <-
mr5
mr5
but you can ask any language here afaik
how about Chinese ?
alright hope you guys are ready for my question because I'm pretty noob atm
ATM?
02:51
automatic teller machine
yes, indeed.
mr5
mr5
another tomato mate
- popular acronym for tomato harvesters
#truestory
pastebin.com/9Xag1AUq its on here. So I'm about to create a printThreadState() function which prints out the states and ID of the threads , the threads are located in threads1.c file under NUMTHREADS variable
maaaaaaate
mr5
mr5
u w0t m8?
@ross.c so what's the question?
02:55
so how do I create a doubly linked list in order to print out the states of the two threads and the ID of them
mr5
mr5
gcc -O3 ross.c -o ross -lcsharproom -L"https://chat.stackoverflow.com/rooms/7/c"
what does that do ?
mr5
mr5
it's a gcc command. don't mind that
alright haha I have to use gcc to run my C programs -.-
mr5
mr5
why do you think you need a double linked list in order to achieve what you want?
02:57
hmm because I read on the internet thats a way to do it but I'm not sure how else to do it
mr5
mr5
you could store in it array?
hmmm
so store all in array and then print it out ?
mr5
mr5
plain C array or ...(I don't think there's a standard library for collections in C)
yup
very straightforward\
alright ill try it now hold on
mr5
mr5
you already have Thread threads[NUMTHREADS]; why not just access it there?
03:05
wait so I don't create a seperate array in my function.
because I was thinking for linked list since my threads are already stored in an array, I could just iterate through this array, and initialize the prev and next pointers for each thread
@mr5
03:29
MeowMeowMeowMeowMeow
MeorlMeorlMeorlMeorlMeorl
mr5
mr5
03:48
yada yada yada yada
@ross.c just had a lunch sorry
thats alright :) !
@mr5 I don't know how to do it with an array so I'm trying it with a linked list :/
mr5
mr5
@ross.c what are you actually trying to achieve? iteration?
I can't think of any use of linked list besides memory management
Thread States
=============
threadID: 0 state:running
threadID: 1 state:ready
mr5
mr5
..where you do the low level allocation yourself
thats what I want it to look like
so to access the list
and pretty much print out the id and state
which is in NUMTHREADS
mr5
mr5
03:53
for(int i = 0;i < sizeof(threads) / sizeof(threads[0]); ++i) {
    Thread t = threads[i];
    printf("threadID: %i state:%s", t.id, t.state);
}
can't you do it like the above?
Would I replace threads with NUMTHREADS?
mr5
mr5
I don't know. Where did you store your threads?
in NUMTHREADS
mr5
mr5
no
NUMTHREADS is defined as int in your source code
*threads
mr5
mr5
04:00
and then?
wait so I'd need a parameter in my function ?
:/
sorry
mr5
mr5
😕
@ross.c
13 mins ago, by mr5
for(int i = 0;i < sizeof(threads) / sizeof(threads[0]); ++i) {
    Thread t = threads[i];
    printf("threadID: %i state:%s", t.id, t.state);
}
you can try this code except you need to replace t.id with t.tid
yeah I tried that but I get errors
mr5
mr5
04:07
oh
I think you need to use the -> operator
instead of .
yeah I was just going to try that :P ill do it now
mr5
mr5
for(int i = 0;i < sizeof(threads) / sizeof(threads[0]); ++i) {
    Thread t = threads[i];
    printf("threadID: %i state:%s", t->tid, t->state);
}
ftfy
okay that fixed that problem !
but I'm getting. problem with the [0] in threads
says
mr5
mr5
but you should double check what type is the Thread.state
subscrpited value is neither array nor pointer nor vector for(int i = 0;i < sizeof(threads) / sizeof(threads[0]); ++i)
and points at the "[" for the threads[0]
does the same for threads[I]
mr5
mr5
04:11
err
Thread *t = threads[i];?
yeah. that's it. I'm mixing up Java here
so it needs to be a pointer
still doesn't seem to solve It for some reason
2
Q: C - error: subscripted value is neither array nor pointer

matthewmpp/* * File: main.c * Author: matthewmpp * * Created on November 7, 2010, 2:16 PM */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> /* prime numbers. version4 should tell whether a number is prime or not prime. by using other prime numbers. */ int input_func...

I don't think you can access it since its not an array ? and its a single integer ?
mr5
mr5
where you calling that loop?
it should be inside main
you should read up more on arrays and variables in C
its in my void printThreadStates(threads) function
mr5
mr5
call it inside main then
what do I put inside the function then ?
mr5
mr5
04:21
huh?
I need to create a printThreadStates() function which I then call in the main() function
mr5
mr5
since threads is defined inside the main function, and you need to access it from other function, what do you need to do next?
hint: the word "pass"
okay I understand that part now so I've added it in , now I go back to printThreadStates(threads)
mr5
mr5
yessssssss
ssssss
do I just write scanf(threads) to pass it ?
mr5
mr5
04:26
whaaaat
nooooo
bloody hell
mr5
mr5
Description
The C library function int scanf(const char *format, ...) reads formatted input from stdin.
from tutorialspoints.com\
it's meant to be used with user input from console afaik
oh wait
void printThreadStates(threads);
thats it ?
mr5
mr5
you just pass it and you don't need to do any magic after that
noooo
wth
do you even C?
printThreadStates(threads);
nooooo
mr5
mr5
04:29
this is not JS room sorry
a JS question disguised as C huh. clever
do I pass the NUMTHREADS
mr5
mr5
nooooo!
hahaha unfortunately not just me being a noob
mr5
mr5
do you know how to declare functions in C?
yeah int I;
mr5
mr5
04:30
did you wrote that source code yourself you posted earlier?
@ross.c do you know what does a function look like in C?
yeah :) its like void function()
mr5
mr5
wrong
how :O
void function () { }
mr5
mr5
hows that wrong :(
mr5
mr5
04:32
I meant, ✔
oh god hahah
so printheads function pretty much has nothing in it
isn't this how you call in C , just printThreadStates();
mr5
mr5
yesssss
so to call the threads in main function can I do this printThreadStates(threads)
mr5
mr5
but in your case, you need to pass the soap threads
ohhh
mr5
mr5
04:39
yeah yeah
so outside of main I just go printThreadStates(threads);
it says parameter names (without types) in function declaration
oh
I just need to put Thread threads inside it
mr5
mr5
wth are you doing?
it should be inside main
it could either before the main exits or after the declaration/initialization of threads
yup I got it in main
for state it comes up with the number 2 instead of "running" or "ready" etc
thats in my other file under littleThread.h which has it all in an enum
pastebin.com/tmmehwuc like that , do I just reference to the state_t ?
mr5
mr5
you need to convert those enums into string
how are you going to do it?
give me like 2 minutes I'm trying to sort out the output of what we just did haha
mr5
mr5
04:51
RUNNING.toString() ? // you wish
its coming out weird
surely that would have worked in java haha
mr5
mr5
yeah. it will be weird since printf is anticipating a string but got an int instead
alright I've fixed it
Thread States
=============
threadID: 0 state:2
threadID: 1 state:2
this is what it prints
mr5
mr5
but it's not that original specs right?
why is the state coming up as 2 for both ?
mr5
mr5
04:57
char *toStateString(int state) {
    switch (state) {
    case SETUP:
        return "SETUP";
    case RUNNING:
        return "RUNNING";
    case READY:
        return "READY";
    case FINISHED:
        return "FINISHED";
    default: "";
    }
}
here ya go. freebies
oh I learnt this in java
that makes sense
would this go in main or outside
mr5
mr5
outside
cash me ouside how 'bou dat?
it's a function you ****
HAHAHHA
*sexy
nah but seriously thank you for all the help ! time to start my scheduler function :)
mr5
mr5
is it working now?
are you in uni?
I'm just typing it out I have to go back and forth because I'm running Mac so I got a virtual box which runs ubuntu
nah I'm at home
mr5
mr5
05:02
no you don't
I'm too sick today
I can't copy paste on virtual box
mr5
mr5
you cna
*can
ever heard of bi-directional copy-pasta?
HOW
im googling right now
mr5
mr5
I think you need to download this plugin or something
nah it's just under settings
it says its under settings in advance
but I tried it but it wasn't working ill try switch off state and turn it back on
nah still doesn't work ill look at other websites
I tried the code but it still says state:2
oh wait
@mr5 one of them should say running one of them should say ready
you can't have two threads running at the same time
mr5
mr5
05:15
you can
that's what threads are for
plays music in background
but why are they both 2 ? shouldnt one of them be like 1 and other 2
mr5
mr5
I don't know
we'll never know
because thread 1 and thread to have thread ids of 0 and 1
oh I think I know whats wrong
05:31
@mr5 for this line can I do it like this printf("threadID: %i state:%s", t->tid, t->toStateString(RUNNING));
mr5
mr5
05:42
@ross.c toStateString(t->state)
yop got it :)
idk why both the states are coming up as 2 -.-
mr5
mr5
06:02
ATM = ahooy! tomato mateee!
o/
\o/
mr5
mr5
/o
o\
/o\
....^
./.....\
-------
nevermind -_-
mr5
mr5
06:27
I'm clicking random ads on a website I frequently visit as a way to say thanks to them
I block random ads on websites I frequently visit because fucking ads man.
mr5
mr5
do you recommend adding . at the end of every sentences in a row description?
mr5
mr5
why can't I upload pictures
Click the upload button?
mr5
mr5
06:35
this is the response which was never shown in the UI
Failed to upload image, please try again!
@RoelvanUden ^
Adding dot at the end of every sentences. what ya think?
Yes please.
mr5
mr5
No
looks ugly?
morning :)
06:53
hi guys
regular expression for to accept letters and special charecters and spaces only?
nice one :D
ohayou
mr5
mr5
:D
07:04
@mr5 didnt get the solution
@MohanSrinivas its not that hard to combine the first to or three google results, just keep trying and don't move your workload onto others
@mr5 I think that a sentence without a dot looks ugly.
Preference, I guess.
is this pc any good?
the components are okay?
I don't read gibberish
you can see the components :'(
mr5
mr5
07:15
@RoelvanUden but this isn't about forming a correct sentence. I've seen some settings of common apps where their row descriptions don't have dots on the last sentence
AMD Ryzen 7 1700X (3.4GHz), 16GB DDR4, SSD 240GB, 1000GB, nVIDIA GeForce GTX 1070,
@mr5 It's a choice. I like with dots. You apparently don't.
Do what feels good.
dots are cool.
Roel dot Uden
@Proxy This is quite broad. AMD Ryzen 7 1700X is good, but it doesn't tell you what motherboard it is on. 16GB DDR4 is good, if it's the right speed, otherwise it's semi-crap (it doesn't say). Idem for SSDs, brand and read/write speed matters, as well as the connection to them (e.g. SATA1 and SSD500/500 is wasted). 1000GB HDD fine, but what RMP/access times/etc. GTX1070 is a good card, but who manufactured it? Or is it a reference card?
So many questions.
are there any major differences between different 1070 models?
mr5
mr5
07:19
@RoelvanUden u mad?
i thought they all should be same, just different branding? @RoelvanUden
@Proxy Not true. While they share the same architecture, the different makes vary in speeds, cooling, loudness, size, etc.
Some GTX1070 cards are faster than others, while others are more silent, etc.
They all match the reference card speed tho, that's a must.
oh, did not know that.
but yeah the site is pretty bad there are only vague component descriptions
though is the only one i have found that support my credit card
But hey, if you got a 10 year old PC now, it's sure as fuck better.
I'd just be a bit nervous about what I'd actually get.
For.. whatever price that is.
around 1600-1700 euros
07:27
GoOoOoOoOoOoOoOoOoOoOoOoD Mornin' negelcterionos!
good morning
although im not sure its is smart for me to bite... although i would like to get a new pc :/ @RoelvanUden
@Proxy thats hardly worth 1600€
here the prices are higher then in germany :)
and i need to pay for it in chunks so i cannot make an order from outside
1 x AMD CPU Desktop Ryzen 5 1600 (6C/12T, 3.4/3.6GHz Boost,19MB,65W,AM4) box, with Wraith Spire 95W cooler
1 x GIGABYTE Main Board Desktop AMD X370 (SAM4, 4xDDR4, HDMI, 1xPCIEX16/1xPCIEX4/3xPCIEX, USB3.1/USB2.0, 8xSATA III/2xSATA Express/M.2 socket3/RAID, 2xLAN) ATX retail
1 x Patriot Viper4, 2800Mhz, 16GB (2x8GB), CL16
1 x MSI GF GTX 1080 Gaming X, 8GB GDDR5X, DX12
1 x SSD Kingston 240GB, UV400 SATA 3
1 x Tvrdi Disk WD Caviar Blue 2TB SATA 3 WD20EZRZ
@Proxy i live there too ^^
07:34
i know this is why i said its a bit cheaper in germany :P
@Proxy ahhh thats what you meant ^^"
yeah here the tax is 25%
i'd pay no more than 1200€ for the configuration with the ryzen 1700x
how does this above sound like
that is impossible... gtx 1070 is around 600 euros
its around 450
here
07:36
sadly im not there :(
you are in the EU right?
yeah but i cannot pay in cash, i dont have enough money
@Proxy oh okay
and if i want to save enough money it would take me around 5 months to gather
@Proxy do it and wait for vega
there will be a pricedrop soon
07:38
i want to game now though
but you'd waste money
yeah i know but i have an old laptop for the last 4 years. would like to change it
@Proxy what games do you play?
not sure that i want to wait until winter
lol :')
i cannot play new games because they cannot run xd
if youre not playing 4k or VR you don't need a 1080 ^^
07:41
yeah later on i plan to get vr
though "later"
i will need time to recover
xD
i have a vive
why spending money, that You don't have?
and it's awesome
@ntohl @Proxy this. Just be patient
i know but i want to upgrade my pc. my laptop is dying
@Proxy you're stil in school/college or are you working?
07:43
it's a huge risk. Only thing I would consider to buy without enough money is a home.
and i would like to get something that would last for a long time then. dont want to buy a cheap pc now and then another one in 7-8 months.
no im working. if i were in college i would not waste money on it @SebastianL
although yeah im a bit bothered that i have to go with a monthly fee (i don't know what exactly is it called)
@Proxy depth
:)
i would have to pay around 180 euros for the next 10 months... which i can survive
but yeah
@Proxy You don't have the money to buy a PC but you still are going to buy the PC?
07:53
kind of yes
That doesn't seem too smart. Why?
my laptop is dying, i need a new pc and i would get a good one from the start
so i dont have to change it in the next few years
The fact that you can't use pointers with generics is all kinds of annoying ...

« first day (2497 days earlier)      last day (2677 days later) »