|
So what is the clue ?
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
|
I can see Turnabout is fair play! in one post and nine letters in another it's like a treasure hunt before you even start on the clue
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
I try to avoid web work. It's just not my cup of tea. I don't like duck typing. I don't like scripting. I don't really like markup - it's too much typing.
But now I'm faced with the daunting task of shoehorning a "good enough" CSS processor onto an ESP32.
The trouble is, I don't know what constitutes good enough and the internet isn't giving up the goods on that where epubs are concerned.
The trouble is this - EPUB readers are typically running on relatively "fat", android capable devices and use a webkit browser component to display content.
I can't run webkit. I just can't. It's just not going to happen in the RAM and CPU that I have.
So far, I 've gotten away with wedging everything into a 512kB system (with 200kB reserved for the system) by streaming content directly from flash wherever possible rather than using RAM. I have 4MB of NVS flash for program and data, so I lean on it.
Streaming works great when you can do it but CSS presents a challenge.
CSS Selectors Reference - this is my Everest[^]
1. Clearly, I have to load the entire CSS content into some sort of hopefully compact, normalized data structures. I won't be able to stream because of the number of times I'd have to reparse from the beginning to implement the selection.
2. Aside from the selector challenges I have the issue of styles overriding other styles (for example if you have both class and style attributes. That means maybe? a stack of hashtables. I'm not sure if I can afford that?
3. I can't find a working subset of CSS that EPUB routinely expects, I think because everything just uses webkit. That means even if I solve 1 and 2, I have to ... i don't know, somehow figure out what subset of CSS I can reasonably get away with supporting, because supporting it all just isn't going to happen on a device like this.
4. This is where I wish I was a web developer. I don't know what most of these style attributes do. I don't understand the CSS box model. I don't know for example, why you might use padding instead of margins aside from being able to venture a guess. Every single thing I have to support I'm going to have to learn first.
This is daunting. By the time I'm done I suppose if I still have any of my sanity left I could expend it on doing web development for people, because after this I'll be a CSS and HTML expert.
Real programmers use butterflies
|
|
|
|
|
Margins are the space between elements, padding is the space within an element.
So you might have two label elements with different fonts using a margin to give them some horizontally separation, and vertical padding to, say, shift them vertically because you want them horizontal-center-aligned.
Of course, the nightmare that I always encounter is that not all style attributes work the same for elements, like centering and text alignment I think, which have sometimes, and sometimes not, to be handled by an outer div.
CSS is a nightmare. I doubt you'll have any sanity left.
|
|
|
|
|
That's why the middle "S" stands for "SNAFU" ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
If I granted your wish, I'd probably be looking for a job in a boys' choir.
|
|
|
|
|
honey the codewitch wrote: Wishing I was a web developer suddenly
May God have mercy on your soul...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
honey the codewitch wrote: I can't find a working subset of CSS that EPUB routinely expects ..you have Winforms?
A "rich" client. And now you voodoo with HTML??
Why?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Because winforms doesn't run on a system that costs $1.60
Real programmers use butterflies
|
|
|
|
|
Runs on anything that supports Mono.
Specs?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
LOL
Try 300kB of RAM except 120kB is off limits because it's needed to hold a couple of frame buffers.
You have a 240MHz 32bit cpu backing it up. No significant superscalar architecture.
Box or class overhead is 80 bytes in .NET
Nah. I think I'll pass.
Real programmers use butterflies
|
|
|
|
|
I feel bad posting his - like I'm in Q&A or something, but it worked for me: CSS Tutorial[^]. In particular, the Try It option lets you modify the initial content and see the damage.
When I first got started in web dev I had a problem: FireFox and some version of IE had to both be supported and IE was amazingly non-compliant. Ultimately, the solution was to position things with "absolute". Although the IE went away I kept with the methodology. A style sheet with horizontal positioning makes alignment very easy.
Box model - think of this as a container. Positioning within the container is relative to the container so blocks of things can be set up and conveniently moved without messing up internal alignment. It is, as you have observed, quite nuanced: a div vs. a span and how some CSS doesn't work in a span (for example). It makes sense - but there's even a CSS style to modify that if you need it. Also one that, should you "pad" something, it doesn't change the size of the surrounding element (which normally it does).
The rest of the insanity I leave in your capable hands
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Is a sea-cow shoplifter a Klepto-Manatee?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'd be more concerned about a sea-bull in a china shop.
|
|
|
|
|
You're making a crockery of this thread ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Do I detect a ray of hope in this new grouper ToD themes? I porpoise we fin-ish this on a grand scale.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Holy mackerel! I don't like the shark of this thread, but I'm sure it will get the seal of approval from the admins.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
You guys must be on something or desparate to come up with this stuff.
Hell is vacation with your family.
|
|
|
|
|
Mission accomplished!
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
For goodness hake, I'm floundering with this carp, I need to mullet over.
|
|
|
|
|
So I got an email from a potential client who wanted a quotation for some software.
Bit weird, called them, had a conversation on who they are, who I am, what I can do and what they want exactly.
I mean, this isn't like ordering a new TV, we're talking serious money and a long term commitment here.
Not to mention custom software, so I really need to know what they want me to write (they did send a functional design, but it never hurts to talk to the people behind it).
So anyway, I was able to send them a quotation and they immediately rejected it because they don't agree to my terms and conditions because they had their own conditions for suppliers.
They usually order mechanical parts and their conditions were geared (pun intended) towards parts suppliers.
Stuff like they're not responsible for damages and they can cancel orders when the delivery is late or when they want to change their order and the additional costs seem unreasonable to them...
Called them and said I can't agree to those terms since this is software were talking about, not mechanical parts.
Heck, my insurance won't even cover any damages if I agree to their terms.
We're now looking for conditions that work for both parties, so I'm hoping we can work it out and I get a new customer.
Did you ever get asked to work for a client on their conditions?
I can imagine it being standard in some industries, but I've never heard about it for software (unless you're a freelance contractor, in which case you practically always sign an employer's contract).
For the record, I'm not a freelance contractor, I take on the entire project, develop it in-house and deliver it when it's done (or in parts).
When it's done I deliver support and maintenance at an hourly rate (or fixed price if a change is big enough).
|
|
|
|
|
The most common condition was a non-disclosure agreement. Most of these were OK, but some were too broad and had to be narrowed down, particularly if they wanted rights to software that you developed later, just because it could be seen as useful to their business.
A few expected there to be liability insurance. Most of these contracts are written by lawyers who try to cover every possibility, and then the contract gets used for everything, whether it makes sense or not. Get them to agree that liability is limited to the amount of the contract unless you do something malicious, like putting a back door in their software. And that disagreements must resolved through private arbitration, not government courts.
|
|
|
|
|
My previous employer tried to get me to sign a non-compete agreement that was so broad that it wouldn't have allowed me to work as an IT professional in any industry. This was after I had been working there for over a decade and a half. I put it in a cross cut shredder.
|
|
|
|