<sicelo>
i saw it when i made my recent MR to dorian, but did not have time to attempt a fix. i will only start to have time at the beginning of December (I hope) ... but my TODO list is already packed.
<sicelo>
i'm clueless with C++, but I could add this task on my todo as well if it'll still be useful
<freemangordon>
pere: I understand your frustration, but yes, we are basically 3-4 (at most) devs working in our spare time on the project and yes, things like working audio, conversations, contacts, phone calls, phone settings, etc are considered with higher prio than book reader. Believe me, it is not that we don;t want patches, but day is only 24 hours.
<pere>
sure.
<freemangordon>
maybe you can become maintainer of the said book reader
<freemangordon>
dunno, now I see Wizzup being maintainer, but I guess that's because he imported it in the repos
<freemangordon>
Wizzup: ^^^ what do you think
<pere>
at the moment maemo do not have any relevant usecases for me, have been considering using it as a ebook reader, but it is not working well, so my motivation for maintaining any of the packages is low.
<pere>
did also consider it as a address book, but lacked the time to figure out how to get my old dongle connected to my ical server.
<freemangordon>
I understand, however, could you elaborate on what is missing (besides the book reader that fits your needs, obviously :) )
<freemangordon>
hmm, I think we have instructions on wiki in regards to ical
<pere>
It has been a while since I looked at it, but I have vague memories of having no way to keep the ical connect password only in memory, only found a way to store it on disk, and I do not want that.
<sicelo>
pere: you use Leste on N900? or different device?
<sicelo>
ah, my other message was lost ...
<pere>
I got a old N900 which I might use as a simple PDA, not as a phone.
<n900>
i'm biased, but its also great for running weechat and lurking in this channel...
* n900
goes back to lurking
<sicelo>
so I was saying I can look at the open dorian issues and fix whatever I can. perhaps mid Dec, since early Dec I really need to focus on the L5 port
<freemangordon>
sicelo: want a short lesson on pointers etc? mow I have 10 minutes free
<freemangordon>
*now
fmg_leste_vm has quit [Quit: fmg_leste_vm]
<sicelo>
yes, let's do it :-)
<freemangordon>
ok, so...
<freemangordon>
imagine, for simplicity, a 16bit processor that supports only real addresses (no virtual addressing)
<freemangordon>
and lets assume it has 64KB of memory attached to its address bus
<freemangordon>
that's the maximum amount of memory this CPU can address without hacks (like shadow mem , virtual addresses, etc)
<sicelo>
yes, following
<freemangordon>
also, assume linear addressing (no paging)
<freemangordon>
so, each byte of that memory will have address from 0000 to FFFF
<freemangordon>
ok?
<sicelo>
yes, am with you
<freemangordon>
so, consider this C code:
<freemangordon>
void main() {
<freemangordon>
int a = 2;
<freemangordon>
int *pa = &2;
<freemangordon>
}
<freemangordon>
*pa = 3;
<freemangordon>
what we do here is:
<freemangordon>
we declare a var and assign 2 to it
<sicelo>
yes. understandable
<freemangordon>
it the 'real life', i.e. the memory of the CPU, this will mean that on some address (in the stack, as this is local variable) we will have value of 0x0002 stored
<freemangordon>
for simplicity, lets assume that int is 16 bits on that platform
<freemangordon>
oops, I made a typo
<freemangordon>
int *pa = &2; should be int *pa = &a;
<freemangordon>
this line gets the *address* of the memory where the value of a is stored
<sicelo>
stack and heap I'm also not too clear about, but I guess that's not too relevant for this
<freemangordon>
it is not
<freemangordon>
those are just different parts of memory
<freemangordon>
so, do you get the idea of "gets the *address* of...' statement?
<sicelo>
&a is the address. yes I get that
<sicelo>
so *pa is what stores that address
<freemangordon>
so, if the value of a (0x0002) is stored at address 0xBEEF, then pa will have a value of 0xBEEF
<freemangordon>
exactly
<freemangordon>
so, '&' means 'take the address of'
<freemangordon>
is it clear so far?
<sicelo>
yes,
<freemangordon>
BTW, the *value* of pa is also stored in the memory, lets assume on address 0xDEAD
<sicelo>
right, yes make sense
<freemangordon>
another thing - pa is *pointer to int*
<freemangordon>
which means 'this variable is of such a type, that it holds and address of a memory block that contains int value'
<freemangordon>
s/and/an
<freemangordon>
we can take the address of pa as well, with int **ppa = &pa;
<freemangordon>
mind those '**'
<freemangordon>
this is pointer-to-poiner-to-int
<sicelo>
right, yes
<freemangordon>
and we can do that as many times as we want, but in practice it stops at '***'
<freemangordon>
any questions so far?
<sicelo>
i completely understand
<freemangordon>
great
<freemangordon>
no, what we can do if we want to assign 3 to a
<freemangordon>
we can simply do a=3;
<sicelo>
a = 3 :-)
<freemangordon>
right
<freemangordon>
but we can cheat, and do '*pa = 3' instead ;)
<freemangordon>
that's called de-referencing
<freemangordon>
pa 'references' a as it hold a address
<sicelo>
store 3 in the location specified by pa?
<freemangordon>
exactly
<freemangordon>
'*' operator when used with pointer means:
<freemangordon>
do the next operation ( = in our case) with the *memory* that is pointed by the pointer
<freemangordon>
we can do pa = (int *)3 as well
<freemangordon>
operation in the brackets is called 'casting'
<freemangordon>
otherwise compiler will spit on us
<sicelo>
yes, i know casting
<freemangordon>
so pa = (int *)3 will put 3 at memory address 0xDEAD instead of 0xBEEF
<freemangordon>
clear?
ceene has quit [Ping timeout: 255 seconds]
<freemangordon>
read the backscroll for which var is stored where in the memory
<sicelo>
this one's a bit confusing because it sounds like put the address of 3 in pa?
<freemangordon>
look at it like pa = 3
<freemangordon>
(int *) is to make compiler happy
<freemangordon>
if we want to 'take the address of 3' (which is not allowed), we shall do &3
<sicelo>
ah right
<freemangordon>
one may ask why we need pointers at all?
<sicelo>
that i understand ...
<freemangordon>
ok
<sicelo>
so we can, for example, modify variables in place, e.g. strings
<freemangordon>
2 of the main reasons are - dynamic memory allocation and parameters passing
<freemangordon>
one note: C have no idea what 'string' is ;)
<sicelo>
yes, i recall :-)
<freemangordon>
cool
<freemangordon>
ok, so far anything unclear?
<sicelo>
it's clear.
<freemangordon>
cool
<freemangordon>
now, about . and ->
<freemangordon>
those are used with structs
<sicelo>
of course the `pa = (int *)3` example i'll need to revisit :-)
<freemangordon>
lemme elaborate on it
<freemangordon>
it will assign 3 to pa, and if you try to dereference pa by doing *pa = 5, most - probably you'll get segfault, as it will try to store 0x0005 at memory address 0x0003
<sicelo>
i see
<freemangordon>
usually addresses at the beginning of the address space are reserved for the OS, or interrupt vectors, etc. but that's irrelevant here - what is relevant is that you access address that does not belong to your program, simply to speak
<sicelo>
ignoring the (int *) part, so it's pa = 3 ... i.e. make pa hold 3, so the pointer points at 0x0003?
<freemangordon>
exactly
<sicelo>
ok. i was hung up on the (int *)
<freemangordon>
that's just for the compiler
<sicelo>
i think i get it properly now
<freemangordon>
now, you cans see things like char *s = NULL; all over the place
<freemangordon>
usually pointers are initialized with 0 (NULL is defined as (void *)0 most of the times)
<freemangordon>
this is done so if we use that pointer to hold address of a dynamically allocated memory, we can later on check if we need to free it or not
<freemangordon>
if (s != NULL)
<freemangordon>
free(s);
<freemangordon>
no, . and ->
<freemangordon>
those are used to access structure members
<freemangordon>
-> is used when you have a *pointer* to structure
<sicelo>
we need to free it if it's non-NULL?
<freemangordon>
well, usually is it more complicated:
<freemangordon>
yeah, that's why I made that note at the very beginning ;)
<freemangordon>
sicelo: so, any specific questions you want to ask?
<sicelo>
sorry, got disconnected for a moment
<sicelo>
let me re read
<sicelo>
I think I still understand so far,
<sicelo>
when is -> used
<sicelo>
sorry, I mean .
<freemangordon>
so, it is not clear to you when '.' and when '->' are used?
<freemangordon>
see this:
<freemangordon>
struct struct1 {int a;};
<freemangordon>
struct struct1 s1;
<freemangordon>
struct struct1 *ps1;
<freemangordon>
s1.a = 5;
<freemangordon>
ps1->a = 8;
<freemangordon>
(*ps1).a = 9;
<freemangordon>
so, when you have a struct variable, you use '.' to access its members
<freemangordon>
when you have a *pointer* to struct variable you use -> to access it members
<sicelo>
makes perfect sense
<freemangordon>
or, you can *de-reference* that pointer and use '.' to access its members
<freemangordon>
the last 3 lines ^^^ all do the same - assign a value (5,8,9) to 'a' member of 's1' variable, which is of type 'struct struct1'
<freemangordon>
sicelo: do you see anything wrong with my code ^^^
<sicelo>
nowhere do you set ps1 to the address of s1, I think
* freemangordon
:claps:
<freemangordon>
how would you write that?
<sicelo>
struct struct1 *ps1 = &s1;
<freemangordon>
great
<freemangordon>
2 more things and I think we are ready:
<freemangordon>
in the ^^^ example ps1 was 'uninitialized pointer', pointing to some random address of the memory, so noone knows what happens when you de-reference it
<freemangordon>
the same case at with pa = (int *)3
<freemangordon>
uninitialized pointers are very bad, so you should be extremely careful, they are one of the reasons why people don;t like C
<freemangordon>
but, what is even worse, are the so-called 'dangling pointers'
<freemangordon>
see:
<freemangordon>
char *s = malloc(128);
<freemangordon>
s[10] = 'a';
<freemangordon>
free(s);
<freemangordon>
s[12] = 'b';
<freemangordon>
after 'free(s);' line, s becomes 'dangling', and de-referencing it again leads to memory access of a memory that does not belong to us, but, the ugly thing is that memory *might* still contain valid data
<freemangordon>
'dangling pointer' bugs are usually very hard to catch
<sicelo>
must first set it to NULL?
<freemangordon>
will not help
<sicelo>
just manually keep track of what you're doing?
<freemangordon>
basicly :)
<freemangordon>
my point was - one should be very careful when using pointers
<sicelo>
i need to play with this some more
<freemangordon>
sure
<freemangordon>
let it settle, please ask if anything is still unclear
<sicelo>
what was the second thing? <<< freemangordon> 2 more things and I think we are ready:>> ... or it's uninitialized pointers, and dangling pointers?
<freemangordon>
yes
<freemangordon>
those 2 types for 'bad' pointers
<Wizzup>
yes please take over maintainership
<Wizzup>
@ dorian
<Wizzup>
(if you want)
<sicelo>
i can take it ... i think pere said he can't
<sicelo>
anyway i guess who maintainer is doesn't matter too much ... MRs will be merged as and when they become available
<dsc_>
C is good if you have unlimited time for a project
<dsc_>
but in the real world... :D
<sicelo>
isn't it on par with C++ though?
<sicelo>
or what would make C++ dev faster?
<pere>
heh. C got a lot of rope to hang oneself in, and C++ got all of that in addition a lot of guns to shoot yourself in the foot with. :)
carpincho has joined #maemo-leste
alphazone_ has quit [Ping timeout: 244 seconds]
<dsc_>
sicelo: I would say the same about c++ tbh ^^
<dsc_>
the reason everyone uses Electron is time-to-market
xmn has quit [Read error: Connection reset by peer]
xmn has joined #maemo-leste
<pere>
note, I like both C and C++, and regularly program in both. :)
<dsc_>
my point was that both C and C++ take more effort, which is a useless statement to make because everyone knows already :D
<freemangordon>
dsc_: well, if TTM is the only thing one cares about, then in wrong hands c/++ might take more time
<freemangordon>
but, if you want to make your customer happy with what you do, then there are other things to consider
<freemangordon>
also, c/++ is programming language, and what really matters are libraries
<freemangordon>
so, I don;t think TTM for a Qt project is much (if at all) longer than any other language
<freemangordon>
dsc_: on a abook side: did you see what I pasted ^^^
<freemangordon>
*an
<dsc_>
yes thank you :)
<freemangordon>
does it work?
<dsc_>
did not try
<freemangordon>
ok
arno11 has joined #maemo-leste
<dsc_>
about TTM, i am passionate about making GUI development more accessible/faster for programmers, I do think Qt is quite slow overall in terms of productivity compared to e.g web technology
<dsc_>
so I integrated Qt into a game engine and provide some high level API
<freemangordon>
OTOH, what I do for living is mostly backend development, and there are things we developed 20 years ago that are still in production, running 24/7
<freemangordon>
so it really depends on what relations with the customer you have
<freemangordon>
if it is about 'grab the money and run', then yeah, TTM is the most important
<freemangordon>
if you want to establish long-term relations, not so
<freemangordon>
not to say that it still matters if you require 16 CPUS/64GB RAM vs 2 CPUS/4 GB RAM, with the qt implementation running 10 times faster than the same thing running tomcat/java etc
<dsc_>
hmm yeah so generally speaking I disagree with you, but the context also matters. For Maemo it is good to make use of robust software, or however you want to classify it
<dsc_>
but for a commercial company, its best to focus on productivity, TTM, that kind of thing
<dsc_>
else you just get ran over by a competitor
<dsc_>
who uses Electron :D
<freemangordon>
no, it is not that simple
<freemangordon>
trust me, we basically run out of competitors here for the last 20 years, while using c/++ as main language
<dsc_>
hehe
<freemangordon>
no, really
<freemangordon>
programming language is just a techology
<freemangordon>
usually, for big commercial project, 1 or 2 moths mean nothing
<freemangordon>
*months
<dsc_>
but again, the context matters. Your sector absolutely requires robust/stable software. Not software made by college students on adderall, which is what sillicon valley runs on.
<freemangordon>
sure
<freemangordon>
and I agree that there is no "one size to fit them all"
<freemangordon>
yeah, we must read that couple of times :)
<dsc_>
xD
<dsc_>
this removal is another thing I wanted to bring up, because I dont think I get signals when the remote does that
<dsc_>
but not now
<freemangordon>
I think you shall get some 'remote-rejected' state
<freemangordon>
ok, there is something wrong with the sever, I was seeing presence before requesting authorization
<freemangordon>
*server
<dsc_>
I delete stevejobs (maemo) from my friendlist and the only thing that seems to change is online->offline, it will still say X-TELEPATHY-SUBSCRIBED:yes\r\nX-TELEPATHY-PUBLISHED:yes
<dsc_>
well ok, this is from perspective of local
<dsc_>
but still, I expect a signal
<freemangordon>
you have contact-changed signal, no?
<freemangordon>
or rather - contacts-changed
<dsc_>
yes, this fires because status change (online->offline)
<dsc_>
but still X-TELEPATHY-SUBSCRIBED:yes\r\nX-TELEPATHY-PUBLISHED:yes
<freemangordon>
yes, that's the local state, no?
<dsc_>
yes
<freemangordon>
so I see no issue
<dsc_>
true
<freemangordon>
on a side note - I am really glad abook/eds plugin handle all this properly
<freemangordon>
this code was never tested outside fremantle
<dsc_>
yes :) it works well
<freemangordon>
mhm
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #maemo-leste
carpincho has quit [Quit: Leaving.]
System_Error has quit [Remote host closed the connection]
<Wizzup>
sicelo: icon for OTP? :D
System_Error has joined #maemo-leste
<sicelo>
still on the way 🤭
<Wizzup>
:D
alphazone_ has joined #maemo-leste
<sicelo>
Wizzup: maybe give me access to dorian repo already
alphazone has quit [Ping timeout: 255 seconds]
<Wizzup>
sure
<Wizzup>
btw guys, work really caught up with me, which I haven't been too active
<Wizzup>
I'm getting back into the all of this soon
<dsc_>
Wizzup: website :)
<Wizzup>
sicelo: you should have access now
<Wizzup>
dsc_: ok, after this mtg I will do it :)
arno11 has joined #maemo-leste
<sicelo>
thanks!
akossh has joined #maemo-leste
Livio has quit [Remote host closed the connection]
Livio has joined #maemo-leste
<dsc_>
im finished but needs some testing
<dsc_>
will continue tomorrow
<Wizzup>
dsc_: on the website or something else?
<dsc_>
on Tp stuff
<dsc_>
website is OK
<sicelo>
Wizzup: btw addition in github repo also automatically grants on Jenkins side?
<sicelo>
seems not. Please also add me Jenkins side when you find a chance.
<arno11>
is it a new repo or ?
<pere>
sicelo: look like I will have to dig out my n900 tomorrow to test the new dorian. :)
<pere>
sicelo: do you use dorian yourself to read books?
<sicelo>
i used to read them a lot on fremantle. nowadays no, not really. and the search function i had never used even under Fremantle
<sicelo>
i still have dorian installed on leste for whenever i get an epub to read, hence i fixed the volume key based page navigation about a week ago since i was so used to that from fremantle days
<sicelo>
arno11: no, old repo, and i've just taken up maintainership.
<sicelo>
dorian e-book reader, in case you do use it :-)
System_Error has quit [Remote host closed the connection]