« first day (1007 days earlier)      last day (2638 days later) » 

12:03 AM
good evening
 
Morning
 
how are you @DrorK.?
 
Nothing much
What's with you
 
just a second @DrorK., my folks called me :p
 
12:34 AM
@DrorK. Sorry, I'm back now! I've been in a bit of a rush, moving to the new place, finally got the keys and have been cleaning it up for the last couple days! :)
now I'm trying to find some friend with a car to get my stuff there on the weekend
and trying to get the energy reactivated
I'm going to have to live a very simplistic life on the first days, remembering how people used to live without electricity haha
 
12:46 AM
Whoa, no electricity is harsh
 
I'm trying to think of foods I can keep outside the refrigerator haha
bread, butter and canned tunfish?
 
Why don't you have electricity?
Can't you borrow from near-by neighbors?
 
@Stargateur haha, it's gotten better
 
the previous owner deactivated it, and it takes up to 5 days for them to reactivate it (and that's if the unfortunate of them not finding anyone to open the building door happens :p)
 
The memory issues were fixed in 5.3 or something iirc.
 
12:49 AM
@DrorK. so at least for a couple of days I might not have any electricity, but if I'm very lucky, they might activate it tomorrow already :)
 
of course it's just a joke :p but this is the philosophies of many people.
 
No neighbors to borrow from?
 
@DrorK. I don't know how I'd borrow it, like with a big extension?
 
Yes
 
I guess it will be fun to have no electricity for a couple of days, it will be like camping! :D
until you need to take a cold shower, or eat
 
12:51 AM
Just tell them that you're from the cable company, and you need to check something
 
or sleep on the heat
 
Camping in 2017 with no electricity?
 
@DrorK. hahaha, "I just need to check something, let me get that extension and bring it to the next door, which I do not live in just for your information.."
"I'll be back in like 4 days to uninstall this extension"
 
"Do Not Touch" ... "High Voltage" ... "Danger!!!"
 
I'll also have no internet except the one from my phone for a while
 
12:55 AM
You can't even borrow WiFi?
 
'password123'
maybe someone there uses this as a password? haha
 
When you're plugging the extension cord, just look at the model of the router and check its defaults. Or better yet, quick reset.
 
lol
 
On second thought, it might be considered rude to borrow both electricity and WiFi from the same neighbor, so make a second visit
 
that's like "Mission Impossible: Operation friendly-neighboor"
 
12:58 AM
It would be mission impossible, because friendly neighbors get nothing. You should be the rude cable guy
 
you reminded me, I can find a third neighbor so I can get an extension of some cable TV :D
 
Can't you use the WiFi for tv channels?
 
"How to give your neighbors a good impression: Free lessons by @DrorK."
@DrorK. not TV channels I guess, only netflix and HBO sign I think
 
Here it's common to have internet-accessible streaming of tv channels, radio, etc
 
I think most radios have internet broadcast, but I don't think many tv channels do too
 
1:48 AM
How can I do this?
gist: a73b0f501df41cb2d01d7b72249959d5, 2017-02-24 01:48:05Z
int main(void) 
{   
	char name1[256] ;
	char name2[256] ;
	int n = 0;
	int p ;
	int z ;

  printf("1st name:");
	scanf("%s", name1);
	printf("2nd name:");
	scanf("%s", name2);
		
	for(p=0; name1[p] != '\0';++p);
	{
	}
	for(z=0; name2[z] != '\0';++z);
	{
	}
				
	while(n == 0){
 		if(name1[p] > name2[z] && name2 != '\0' && name1 != '\0')
		{
			printf("The Name %s its bigger than the name %s",name1,name2);
			n = n+1;
		}	
		if(name1[p] < name2[z] && name2 != '\0' && name1 != '\0')
		{
			printf("The Name %s ots bigger than the name %s",name2,name1);	
			n = n+1;
		} 
		else
		{
			printf("Names are the same");
			n = n + 1;
		}
	}
return (0);
}
 
@rockethon just post the gist... and you want do what?
 
@Stargateur I want to make the variables p and z to work and go through each of the 2 names
caracters
 
@rockethon That doesn't tell me what you want to do. copy and past your code here and solve all warnings.
 
@rockethon I think it's going to print "Names are the same" every time, you're comparing the characters on the indexes p and z, and not the actual offsets
also, you're comparing a pointer with a character on name2 != '\0', I think you meant name2[0] != '\0'
you didn't need the while loop for that, since you're always going to iterate only once
 
@IanC in fact I´m having that problem of "Names are the same" every time
how can I make it search for both if conditions implemented?
 
2:05 AM
@rockethon have a read about arrays, it doesn't help you much if I just tell you how the statement should be if you don't understand why it was wrong in the first place. As I said, you're comparing the values in the indexes p and z, when what I think you want to do is actually compare p and z, which will indicate the offset of the terminating null character in the arrays
 
@IanC shouldn´t the for cycle guarantee that?
 
@rockethon it would look something like if( p > z && name2[0] != '\0' && name1[0] != '\0'), though I think it would be better to check if the strings are empty before comparing their sizes
 
@IanC I had that before but that represents a problem when strings have same size
And I want to order them in that way alphabetically
 
if they have the same size p will be equal to z
and you will reach the last else statement
 
George and Marian per example
 
2:12 AM
ordering the names is a completely different task, what this code you posted was trying to do is to check which name is bigger (ignoring the mistakes)
 
 
7 hours later…
8:59 AM
@AnttiHaapala is this answer to your concerns? ^
 
Morning @PeterVaro
It's surprising by his response is reasonable to me.
 
it is not reasonable to me
 
So a new hash, a new collision, a new hash, a new collision, ... that's not really news- that's the cycle of life
 
The full working code will be released in three months, following Google’s vulnerability disclosure policy, and it will allow anyone to create a pair of PDFs that hash to the same SHA-1 sum given two distinct images and some, not yet specified, pre-conditions.
the thing is one needs to increase the number of bits.
cutting a hash isn't exactly safe.
linux is not a cryptographer
 
The people that already have such computing power are likely to already have this capability 3 months ago, not 3 months from now
 
9:12 AM
0
Q: Reducing size of hash function

HarryIf I have some data I hash with SHA256 as hash=SHA256(data) and then copy only the first 8 bytes of the hash instead of the whole 32 bytes. How easy is it to find a hash collision with different data? Is it $2^{64}$ or $2^{32}$? And uf I need to reduce a hash of some data to a smaller size ($n$ ...

With an output of 8 bytes (n=64 bits) from (for example) SHA-256 you have first-preimage and second-preimage resistance of 264 and collision resistance of 232
 
Hashing = collisions. Sooner or later, it will become more accessible/easier to achieve
 
so cut 160 bits from sha-256, it is still 2^80, but as attacks against sha-256 are done, breaking git is much closer
 
That's not the question one should be asking- the relevant question is what the compromise of this or that hash, is going to achieve, and what are you willing to 'pay' for mitigation or prevention
 
well, with md5 used in certificates, the attack meant that a black hat can get a root tls certificate.
now, with sha1, it is the same, but for parties that accept sha1 certificates.
On the desktop, Windows XP introduced SHA256 in Service Pack 3. Users running SP2 should be able to upgrade to SP3. Depending on a site’s profile, a significant chunk of the user base might be running XP. This operating system is still very popular in China and there is also strong anecdotal evidence that it remains widely used in some large organizations.

Among the mobile platforms, Android added SHA256 support in version 2.3. Earlier versions—still used in large numbers—support only SHA1.
well, that's no https for android 2.2 :D
 
Are there still working 2.2 androids? :) That's impressive!
 
9:19 AM
probably :d
I had android 2.3 new in 2013
lol
 
A few years back I've written a storage-archiver, where data integrity and deduplication was key
 
cv pls ^
 
At first I tried to do anything to mitigate collision-concerns, I even applied a simple algorithm to store lists of hashed-chucks of data files
At the end of the day it was a complete mess, performance degradation, bloated index, too much to pay for
 
:d
well, the solution is to use a better hash functoin
now that sha1 is broken for this, then assume your usage of sha1 would be broken
it is good only for checksumming your own data :D
 
I've decided to do the bare minimum, and make a manual routine for 1 to 1 data integrity test, which can be done periodically, manually obviously
 
9:25 AM
basically, now sha1 should be considered a more collision resistant variant of adler-32
 
If I remember correctly, I think that rsync is using a fairly simplistic rolling hash for their "remote" delta-encoding of chucks
I wonder if after the reconstruction of the whole object they bother to re-hash it again
 
9:43 AM
-1
Q: equality of datatype as well as value

arup nath<?php { $a=2; $b='2'; if($a===$b) { echo "they are equal"; } ?> in php, by "===" operator we can check the value as well as the data type.Is it possible to check two values equality as well as datatype in c or java by any fuction or some operator??

eww
 
Well he has a point!
Some people don't like the current promotion rules, or implicit conversions
Somebody there said that in C, all comparisons will work like "===" ... so I guess he's one of the some people who dislike ^
 
added
@DrorK. the guy wants to have typed memory in c <3
 
Well to be fair, his profile doesn't even suggest that he's familiar with said languages
 
@DrorK. then he should stop asking.
 
I was referring to the one answering :)
 
9:55 AM
if (var1.getClass().getName() == var2.getClass().getName())
wat?
wat??
this explicitly is not the way to do this in java
 
I love people who code in object without understand anything about object.
Like robot they write a class, write member, write get/set. While I am crying.
Worst when I code and one of my teammate say "omg, you don't know code in object you made a member public"
 
10:21 AM
@Stargateur IOW, most of them?
 
Snif
 
10:36 AM
@AnttiHaapala if that would be a possibility without sacrificing speed -- we all want to have typed memory :)
 
Yeah we all need them performances
 
@DrorK. helloc;
I was on the train, I posted from there, sorry for the late reply
helloc @BartekBanachewicz; // nice avatar update
 
Most people who program in C++ and Java and other static languages, or even Python, really don't understand OOP at all..
and how could they :D
 
@PeterVaro thanks :)
 
playing with fireworks hardly makes you an expert in rocket science.
3
 
10:38 AM
OOP is overrated
 
programming in general is overrated :)
but I still love both :P
 
haha, that's a good analogue really... OOP in the hands of those people is: flashy, hardly useful, creates lots of noise and can really blow in your hand, or can be used to shoot oneself in the foot.
 
^ you've just realised how great your previous sentence was, haven't you?
:)
 
if people were taught FP as the first paradigm the world would be a much better place
 
if there were no such thing as "world", and sideeffects, the people would program in FP :)
 
10:42 AM
@PeterVaro IDGI why do people still perpetuate the myth that FP and side efects are somehow incompatible
 
think about Monads, and you will understand how ridiculous the entire idea of purity is
 
@PeterVaro is it?
 
@AnttiHaapala oldie but goldie, yeah :)
 
Monads aren't impure. Hell, I got a few votes for saying they aren't
16
A: Aren't Monads essentially just "conceptual" sugar?

Bartek BanachewiczNo. Monads have nothing to do with purity or impurity in principle. It just so happens that IO models impure code nicely, but Monad class can be used perfectly right for instances like State or Maybe, which are absolutely pure. Monads also allow expressing complex context hierarchies (as I cho...

 
10:45 AM
@BartekBanachewicz interesting!
relevant tweet alongside with xkcd:
holy crap it's an explanation of monads that actually makes sense am i dreaming https://t.co/Wgb1r0HeT3
 
@PeterVaro that's also incorrect :)
People often confuse the idea of monads with ideas of particular monad instances.
State and IO in particular.
 
I never learn haskhell, someone said to me, monad are box where you can secure sone operation that can't be made in normal function.
 
@Stargateur "Monad" is an interface describing a set of functions { return, >>= }.
the "box" analogy holds pretty much only for Functors, and even there it's often a stretch
@Stargateur you should look in here /cc @PeterVaro
2
 
@BartekBanachewicz great one, cheers, unfortunately, I will only have time to read it during the weekend
 
no rush :P
 
10:53 AM
right now, I have to produce impure code in this rotten world :P
 
When I started learning Haskell I basically spent two weeks on nothing but that
just rolled through LYAH example by example
and now three years later I know some of it :)
 
cbj
 
I should learn Haskell some day.
 
whats the good practice to write class name
 
The most functional PL I've learnt is Oz.
 
10:57 AM
class Get_Roi
or class get_Roi
 
@littlepootis it's funny when I think about how much of my Haskell code is actually imperative
 
or class getRoi
 
getPostTitle <$> (findPost 1) that look like "typedef int i" because I'm lazy.
 
@SohaibAsif none of the above
 
than
class get roi
 
10:58 AM
GetRoi
 
@SohaibAsif why would a class name have a verb in it?
 
how can i write it
 
@Stargateur "because I'm lazy"?
 
basically i need to make two Handlers or classes
for get
 
@BartekBanachewicz this is a very strange operator
 
10:58 AM
and for post
 
helloc @SohaibAsif; // in C?
 
@Stargateur <$> is simply an infix version of fmap
 
so any suggestion
 
@SohaibAsif oh
 
how do i name it
 
11:00 AM
@SohaibAsif since when did C have classes?
 
@SohaibAsif so it's like a HTTP pattern?
 
@BartekBanachewicz this is not explicit to my eye, it like macro when you read it, it hard to follow when you are new.
 
I tend to use the native common naming convention, or lifting naming conventions from a particularly well-known project
 
@SohaibAsif Do you follow a style guide?
 
@Stargateur do you consider fmap getPostTitle (findPost 1) easier to follow? I don't.
 
11:01 AM
my C naming conventions are now pretty close to those used by linux kernel
 
any guidance
to write the class name
 
@SohaibAsif you've provided way too little information
there are only two hard things in computing remember
 
Linux kernel writes "class" names in lower_case
struct lock_class_key *key
 
I'd object to GetRoi as a pattern name anyway
it's unclear
 
struct class_attribute
 
11:02 AM
yes its the pattern
 
Also what framework uses separate classes for HTTP patterns
 
in any case...
 
what language and fw is that?
 
classes are nouns
 
What's the convention there?
 
11:02 AM
python
 
n. getroi ?
@SohaibAsif room/6
 
there is no one in that room
:p
 
Python convention would suggest GetRoi, but again not sure about the name itself
 
thanks
 
@SohaibAsif There are over 30 in that room.
 
11:03 AM
but not
online
thanks@BartekBanachewicz
 
They are
online
 
fmap (+3) (+1), this is why I like FP
 
in Python, 10 secs ago, by Antti Haapala
class names are in CamelCase in Python (usually). However, classes are nouns. get roi is a phrase that starts with a verb. It is not a name of a class.
@SohaibAsif happy now?!
 
thanks @AnttiHaapala
 
@BartekBanachewicz if roi stands for Rotten Oyster Internals, then the suggestion is GetROI
 
11:05 AM
@Stargateur why not (+3) . (+1)
 
@PeterVaro return on investment
 
@AnttiHaapala mine is better :)
 
class GetROI:
    def __call__(self):
         return 0
 
@BartekBanachewicz I just read your link :p, I suppose that both do the same result.
 
but anyway my point is, if it is an abbreviation, then it should be all uppercase
 
11:06 AM
meanwhile I'm implementing a for loop
 
 
2 hours later…
12:48 PM
Anybody knows how can I get a variable int to go through a words lenght but only unitil it reaches the end \0?
 
@rockethon you mean how to split a string?
 
@rockethon for (size_t i = 0; str[i] != '\0'; i++) { }
 
not working for me
 
@rockethon you'll have to elaborate
 
I want to be able to use the value of "i" in a word in order for it to go compare each letter to another word letter
so i and f per example would be the length of word 1 and word 2
 
12:53 PM
@rockethon there's strcmp for that
 
I dont want to use that
 
Im trying to learn C
 
int
strcmp(const char *s1, const char *s2)
{
    for ( ; *s1 == *s2; s1++, s2++)
	if (*s1 == '\0')
	    return 0;
    return ((*(unsigned char *)s1 < *(unsigned char *)s2) ? -1 : +1);
}
that's Apple's implementation vOv
you'll note you don't need to use an index variable at all
it's pretty clever actually
 
missing one "if" condition on s2
 
12:55 PM
@rockethon no, it's not. that's the clever thing.
 
I just don´t understand why they do this: ? -1 :
 
@rockethon ternary op
 
my way is the following
for(p=0; word1[p] != '\0';++p);
for(z=0; word2[z] != '\0';++z);
both p and z are int
 
a) you don't need to use indices, you can increment the pointers directly
b) you don't need that second check
 
then to compare both strings
 
12:57 PM
I know what your code is doing
 
while(n == 0){
if(word1[p] > word2[z] && word2[0] != '\0' && word1[0] != '\0' && z !=0 && p!=0)
{
printf("word %sbigger than word %s",word1,word2);
n = n+1;
z = z-1;
p = p-1;
}
 
somehow p and z are not working
 
what's the n for again
also you should return the value of the comparison, not print it. Don't mix concerns in that function
 
just a thing to make it break once the comparing operation is done
 
12:59 PM
you just need one loop
 
i tried that but did not work also nobody guarantees that word 1 has the same length has word 2
Am I right @BartekBanachewicz?
 
@rockethon doesn't matter
 
why
I figured
 
@rockethon because the comparison with \0 takes care of that
 
I can only compare the words when characters are the "same" length right
 
1:08 PM
@rockethon not necessarily, if you consider \0 a character to compare to
that way shorter words come out ahead
 
yes but not alphabetically
the words that you cannot compare like Tree and Shadow, you forget about the "o" and "w". Since you cannot compare it because they don´t exist
on Tree
 
@rockethon but they will break out of the loop before it even gets to that, since S < T
 
ok, so why isn´t my code working
 
@rockethon your one-loop one? You haven't posted it
 
for(p=0; word1[p] != '\0';++p);
{
}
for(z=0; word2[z] != '\0';++z);
{
}


while(n == 0){
if(word1[p] > word2[z] && word2[0] != '\0' && word1[0] != '\0' && z !=0 && p!=0)
{
printf("The word %s its bigger than word %s",word1,word2);
n = n+1;
z = z-1;
p = p-1;
}
if(word1[p] < word2[z] && word2[0] != '\0' && word1[0] != '\0' && z !=0 && p!=0)
{
printf("The word%s its bigger than the word%s",word2,word1);
n = n+1;
z = z-1;
p = p-1;
}
else
{
printf("The words are the same!");
n = n + 1;
}
}
@BartekBanachewicz there it is
 
1:15 PM
@rockethon I see 3 loops there
 
I did it in order to the 3 possibilities
 
@rockethon unnecessarily
read the code I posted again
is it clicking? :)
 
@BartekBanachewicz I can´t figure it out how that code would work for evry condition I have
 
@rockethon then write those conditions out and go step by step
12 mins ago, by Bartek Banachewicz
@rockethon not necessarily, if you consider \0 a character to compare to
this is crucial
 
why do they use this bit: "strcmp(const char *s1, const char *s2)" I don´t want to do it since it´s already an implemented function
 
1:23 PM
@rockethon this is the implementation of that function
it's how it is (was) in the library
 
are s1 and s2 int´s?
 
@rockethon it's stated there, as plainly as day, that they are const char*
 
the way they act in the function states different
 
@rockethon does it?
29 mins ago, by Bartek Banachewicz
a) you don't need to use indices, you can increment the pointers directly
b) you don't need that second check
 
@rockethon It's preferred to learn C by following a C book
 
1:31 PM
the problem is that I don´t understand how they increment a char
 
@rockethon they increment the pointer
 
thats what I´m doing with my code also ain´t it true?
@BartekBanachewicz if I leave the word1[p]>word2[p] per example and in that loop I implement a p=p+1 while p != '\0' it would be the same right?
 
@rockethon pretty much, but you're introducing a variable for no reason
 
@BartekBanachewicz since I´m using while I´m having an headlock of how I can get it to work the way you say. Can you throw an example?
 
1:46 PM
@rockethon I already gave you one, half an our ago
I don't think I could implement it better than that
 
Where
 
54 mins ago, by Bartek Banachewicz
int
strcmp(const char *s1, const char *s2)
{
    for ( ; *s1 == *s2; s1++, s2++)
	if (*s1 == '\0')
	    return 0;
    return ((*(unsigned char *)s1 < *(unsigned char *)s2) ? -1 : +1);
}
an hour ago actually
what book are you learning from?
 
Thats code I need a real-life example
 
@rockethon what do you mean by a real-life example?
this is as real-life as it gets
 
A Book on C
 
1:49 PM
what
I'm losing you there
 
Is the name of the book
lol
 
well then, it should cover everything in that function
read the book, read the function, put it into your code, step into with a debugger and see how it works
 
 
1 hour later…
2:54 PM
please, use the proper code indentation:
fixed font button on the right OR ctrl+k
 
 
1 hour later…
4:12 PM
A java coder who clearly not have the concept of memory management :p
-1
Q: pthread_create: cannot allocate memory

user2224350I wrote a small tcp server, which creates a new thread for each incoming connection: while (server_running) { client_sock = accept(server_sock, (struct sockaddr *)&client_name, &client_name_len); if(!server_running) break; if (client_sock == -1) ...

 
5:22 PM
Reasons under Cloudflare potential leakage --- buffer overrun bug:
/* generated code */
if ( ++p == pe )
    goto _test_eof;
and relevant Ragel piece:
script_consume_attr := ((unquoted_attr_char)* :>> (space|'/'|'>'))
>{ ddctx("script consume_attr"); }
@{ fhold; fgoto script_tag_parse; }
$lerr{ dd("script consume_attr failed");
       fgoto script_consume_attr; };
 
nice improve of warning.
 
5:38 PM
How do I sum 1 unit to 2 variables on a for cycle?
@Stargateur can I do this: for(n=0; p == z; p++ && z++)?
 
this don't make sense but you can do for(n = 0; p == z; p++, z++)
 
Thanks
It returns that p value is «null», any tips
@Stargateur?
 
@rockethon I will only answer clear question
 
I´m building a counter
for two words
so until p and z are the same it just runs through the letters in the word
comparing it to show you in the end which one is bigger like word1[p] < word2[p]
printf("Word e &c its smaller than word &c",word1,word2);
Got it @Stargateur?
So why does the p value comes out has null?
 
5:55 PM
What you said don't make sense to me. First there is no null in C maybe you want NULL. Second, p can't be a pointer in your context so it can't be NULL.
 
char word1[15] ;
char word2[15] ;
int n = 0;
int z ;
int p ;
@Stargateur The variables and they´re values
 
I confirm that p is not a pointer and that "So why does the p value comes out has null?" is no possible. I understand that you are beginner but if you can't communicate properly that is going to be a problem. We already, tell you to use <kbd>Ctrl</kbd>+<kbd>k</kbd> when you write code. Plus, you spam the chat, seeking help but you are not listening. This is maybe a chat but I recommend you to read How to Ask and [mcve].
 
@Stargateur can´t see the point of the chat if nobody its here to help people who are novices in this language. So when they become advanced they leave and maybe that´s the reason of the low points on noob questions
 
6:24 PM
@rockethon Show the entire code. It's hard to understand what you're trying to do from the snippets you've pasted here.
Also, what do you mean by p being NULL?
 
6:47 PM
@Stargateur Well, a null pointer != NULL ... so C does have null :)
 
 
3 hours later…
10:10 PM
Hey girls.
 
10:34 PM
... and boys
 
10:45 PM
Trying to figure out how to distribute a bag of items evenly.
By value. Pretty hard.
At least to do it efficiently. I'm trying to make it work in O(c*n) time. Might get it eventually. :(
It's basically a "knapsack" problem. But I don't want to use an algorithm online. Trying to figure it out myself.
 
11:29 PM
Is it just me, or pretty much ALL torrent clients fail to understand what a "proxy" means, and go ahead and make remote connections with and without the proxy?
 
11:59 PM
@DrorK. I think it has to do with the torrent protocol itself, I don't think it works well with proxies
only with VPNs I think
 
@IanC Well, if you write a client for such a protocol, and then you introduce a feature for "proxy", and then you go ahead and bypass said proxy
 

« first day (1007 days earlier)      last day (2638 days later) »