Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.advocacy > #357590 > unrolled thread
| Started by | DFS <nospam@dfs.com> |
|---|---|
| First post | 2016-05-28 11:24 -0400 |
| Last post | 2016-05-31 17:48 -0400 |
| Articles | 20 on this page of 43 — 8 participants |
Back to article view | Back to comp.os.linux.advocacy
OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-05-28 11:24 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Sandman <mr@sandman.net> - 2016-05-28 16:19 +0000
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-05-28 12:40 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Sandman <mr@sandman.net> - 2016-05-28 19:17 +0000
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-28 12:43 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-28 12:49 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-30 09:53 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-05-30 13:11 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-30 10:22 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-05-30 21:09 +0000
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-30 14:32 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-05-30 21:48 +0000
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-05-30 17:34 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-30 14:57 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-05-31 13:57 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-31 11:21 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-06-01 10:05 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-06-01 08:48 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-06-01 13:12 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-06-01 17:19 +0000
Re: OT: Steve Carroll, how would you fix this minor blunder? vallor <vallor@cultnix.org> - 2016-06-01 17:32 +0000
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-06-01 10:45 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-06-01 18:07 +0000
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-06-01 10:41 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? tmelmosfire <tmelmosfire@gmail.com> - 2016-06-01 15:40 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-06-01 23:58 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-06-02 09:21 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-06-02 20:22 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? tmelmosfire <tmelmosfire@gmail.com> - 2016-06-02 17:32 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-06-03 10:03 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? Snit <usenet@gallopinginsanity.com> - 2016-05-31 11:34 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-31 11:45 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? tmelmosfire <tmelmosfire@gmail.com> - 2016-05-31 19:29 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-05-31 13:44 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-05-31 11:22 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-06-01 11:14 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-06-01 18:21 +0000
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-06-01 14:26 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-06-01 11:46 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-06-02 20:49 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? Steve Carroll <fretwizzer@gmail.com> - 2016-06-04 07:55 -0700
Re: OT: Steve Carroll, how would you fix this minor blunder? DFS <nospam@dfs.com> - 2016-06-04 17:49 -0400
Re: OT: Steve Carroll, how would you fix this minor blunder? flatfish+++ <flatfish4real@gmail.com> - 2016-05-31 17:48 -0400
Page 1 of 3 [1] 2 3 Next page →
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2016-05-28 11:24 -0400 |
| Subject | OT: Steve Carroll, how would you fix this minor blunder? |
| Message-ID | <nicd0l$usi$1@dont-email.me> |
https://www.navicat.com/products/navicat-for-sqlite-feature-matrix See how the columns in their table are narrow, and the labels at top Win^Win#Win*Mac^Mac#Mac*Linux^Linux#Linux* are separated from the table? Confusing and looks bad. You might suggest a fix to them and get a little job out of it!
[toc] | [next] | [standalone]
| From | Sandman <mr@sandman.net> |
|---|---|
| Date | 2016-05-28 16:19 +0000 |
| Message-ID | <sandman-206a0ed6774b0c53641f619d3af762f7@individual.net> |
| In reply to | #357590 |
In article <nicd0l$usi$1@dont-email.me>, DFS wrote: > https://www.navicat.com/products/navicat-for-sqlite-feature-matrix > See how the columns in their table are narrow, and the labels at top > Win^Win#Win*Mac^Mac#Mac*Linux^Linux#Linux* > are separated from the table? > Confusing and looks bad. > You might suggest a fix to them and get a little job out of it! That was really dumb. First off, since they're using a table, use the TH tags for table headers. Then trigger on when the TR with the TH's is outside the scrollview, then replicate them and set their position to fixed, and update their position, width and height to their "ancestors" when the view is resized. -- Sandman
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2016-05-28 12:40 -0400 |
| Message-ID | <nichef$f68$1@dont-email.me> |
| In reply to | #357594 |
On 5/28/2016 12:19 PM, Sandman wrote: > In article <nicd0l$usi$1@dont-email.me>, DFS wrote: > >> https://www.navicat.com/products/navicat-for-sqlite-feature-matrix > >> See how the columns in their table are narrow, and the labels at top > >> Win^Win#Win*Mac^Mac#Mac*Linux^Linux#Linux* > >> are separated from the table? > >> Confusing and looks bad. > >> You might suggest a fix to them and get a little job out of it! > > That was really dumb. > > First off, since they're using a table, use the TH tags for table headers. Then > trigger on when the TR with the TH's is outside the scrollview, then replicate > them and set their position to fixed, and update their position, width and > height to their "ancestors" when the view is resized. Notice you can scroll that page, and the header block stays in place. For whatever reason, they chose to put the labels in a weird position. The source for that simple page is around 4700 lines of HTML. Incredible. Isn't there a shorter way? Since it's not clickable anywhere, couldn't that entire table (with 9 columns and the dots) be one .gif or .jpg file, or some other '1-piece object'? Seems like that would make the HTML extremely simple.
[toc] | [prev] | [next] | [standalone]
| From | Sandman <mr@sandman.net> |
|---|---|
| Date | 2016-05-28 19:17 +0000 |
| Message-ID | <sandman-9b64989702a478090ce11de8a2568e1a@individual.net> |
| In reply to | #357598 |
In article <nichef$f68$1@dont-email.me>, DFS wrote: > > > DFS: > > > https://www.navicat.com/products/navicat-for-sqlite-feature-matrix > > > > > See how the columns in their table are narrow, and the labels at > > > top > > > > > Win^Win#Win*Mac^Mac#Mac*Linux^Linux#Linux* > > > > > are separated from the table? > > > > > Confusing and looks bad. > > > > > You might suggest a fix to them and get a little job out of it! > > > > Sandman: > > That was really dumb. > > > First off, since they're using a table, use the TH tags for table > > headers. Then trigger on when the TR with the TH's is outside the > > scrollview, then replicate them and set their position to fixed, > > and update their position, width and height to their "ancestors" > > when the view is resized. > > Notice you can scroll that page, and the header block stays in > place. It's actually two different "headers", one that stays in place, and one that is hidden and fixed but not displayed until you scroll the first one out of view. > For whatever reason, they chose to put the labels in a weird > position. It's because it's a separate table not related to the actual table with the data. It's just dumb. > The source for that simple page is around 4700 lines of HTML. > Incredible. Isn't there a shorter way? Of course there is. I'll wager that they're using some framework that just has a great deal of overhead. It's a shit tonne of query inline code on that page. > Since it's not clickable anywhere, couldn't that entire table (with > 9 columns and the dots) be one .gif or .jpg file, or some other > '1-piece object'? Seems like that would make the HTML extremely > simple. That would be even dumber. The data would be unavailable to a screen reader, to update the data, you'd have to recreate an image, and it couldn't possibly be made responsive (i.e. the image could only be scaled, not reflowed). Never ever present data as images. And one GIF of that table would be a *lot* more data to download than the HTML. -- Sandman
[toc] | [prev] | [next] | [standalone]
| From | Steve Carroll <fretwizzer@gmail.com> |
|---|---|
| Date | 2016-05-28 12:43 -0700 |
| Message-ID | <00a2336a-3ec6-4e33-9162-462b5de2c908@googlegroups.com> |
| In reply to | #357617 |
On Saturday, May 28, 2016 at 1:17:14 PM UTC-6, Sandman wrote: > In article <nichef$f68$1@dont-email.me>, DFS wrote: > > > > > DFS: > > > > https://www.navicat.com/products/navicat-for-sqlite-feature-matrix > > > > > > > See how the columns in their table are narrow, and the labels at > > > > top > > > > > > > Win^Win#Win*Mac^Mac#Mac*Linux^Linux#Linux* > > > > > > > are separated from the table? > > > > > > > Confusing and looks bad. > > > > > > > You might suggest a fix to them and get a little job out of it! > > > > > > Sandman: > > > That was really dumb. > > > > > First off, since they're using a table, use the TH tags for table > > > headers. Then trigger on when the TR with the TH's is outside the > > > scrollview, then replicate them and set their position to fixed, > > > and update their position, width and height to their "ancestors" > > > when the view is resized. > > > > Notice you can scroll that page, and the header block stays in > > place. > > It's actually two different "headers", one that stays in place, and one that is > hidden and fixed but not displayed until you scroll the first one out of view. > > > For whatever reason, they chose to put the labels in a weird > > position. > > It's because it's a separate table not related to the actual table with the > data. It's just dumb. They did it to keep from repeating it on every table but the implementation is wacky. I disagree with your suggested javascript fix earlier (IMO they have enough of that going on already). I would just use CSS and do what they didn't... sorta like this: <https://vid.me/Nuop> It's not like you're going to fix there otters issues anyway, right? <http://imgur.com/NoErJcu> <http://imgur.com/HxVZzFZ> <http://imgur.com/H8bjXHR> So just go with what they have and fix it as best you can. > > The source for that simple page is around 4700 lines of HTML. > > Incredible. Isn't there a shorter way? > > Of course there is. I'll wager that they're using some framework that just has > a great deal of overhead. It's a shit tonne of query inline code on that page. > > > Since it's not clickable anywhere, couldn't that entire table (with > > 9 columns and the dots) be one .gif or .jpg file, or some other > > '1-piece object'? Seems like that would make the HTML extremely > > simple. > > That would be even dumber. The data would be unavailable to a screen reader, to > update the data, you'd have to recreate an image, and it couldn't possibly be > made responsive (i.e. the image could only be scaled, not reflowed). > > Never ever present data as images. And one GIF of that table would be a *lot* > more data to download than the HTML. More data and another http request for the 'benefit' you're getting (which is not a benefit).
[toc] | [prev] | [next] | [standalone]
| From | Steve Carroll <fretwizzer@gmail.com> |
|---|---|
| Date | 2016-05-28 12:49 -0700 |
| Message-ID | <13a02ca5-63d7-4e50-9cde-e1983d7b0374@googlegroups.com> |
| In reply to | #357598 |
On Saturday, May 28, 2016 at 10:40:14 AM UTC-6, DFS wrote: > On 5/28/2016 12:19 PM, Sandman wrote: > > In article <nicd0l$usi$1@dont-email.me>, DFS wrote: > > > >> https://www.navicat.com/products/navicat-for-sqlite-feature-matrix > > > >> See how the columns in their table are narrow, and the labels at top > > > >> Win^Win#Win*Mac^Mac#Mac*Linux^Linux#Linux* > > > >> are separated from the table? > > > >> Confusing and looks bad. > > > >> You might suggest a fix to them and get a little job out of it! > > > > That was really dumb. > > > > First off, since they're using a table, use the TH tags for table headers. Then > > trigger on when the TR with the TH's is outside the scrollview, then replicate > > them and set their position to fixed, and update their position, width and > > height to their "ancestors" when the view is resized. > > > > Notice you can scroll that page, and the header block stays in place. > For whatever reason, they chose to put the labels in a weird position. > > The source for that simple page is around 4700 lines of HTML. > Incredible. Isn't there a shorter way? Each row is comprised of ~30 lines, many of them based on <tr> and <td> elements being shown in their own line. Figure: (~90 rows * 30 element) + (12 headers * 7 elements). Add to that, due to the inline javascript there are also ~200 lines before the body element. Now you're already at ~3k of the lines used. It's generally considered a good idea to keep your DOM depth (and use of truly extraneous elements) to a minimum. It sorta looks like a number of people have touched this page over the years and if they're not all on the 'same page' that doesn't help because there is only so much the next guy can do.
[toc] | [prev] | [next] | [standalone]
| From | Steve Carroll <fretwizzer@gmail.com> |
|---|---|
| Date | 2016-05-30 09:53 -0700 |
| Message-ID | <8b294312-a4d5-4eaa-b46a-a18f22dba640@googlegroups.com> |
| In reply to | #357590 |
On Saturday, May 28, 2016 at 9:24:35 AM UTC-6, DFS wrote: > https://www.navicat.com/products/navicat-for-sqlite-feature-matrix > > > See how the columns in their table are narrow, and the labels at top > > Win^Win#Win*Mac^Mac#Mac*Linux^Linux#Linux* > > > are separated from the table? > > Confusing and looks bad. > > > You might suggest a fix to them and get a little job out of it! Challenge for you... styling aside, (which is mainly there to help visually indicate functionality) how would you do this using Python... <http://imgur.com/P5pjSFt> ... to markup you were given (I changed venue names) that looked sorta like this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Calendar</title> </head> <body> <h1> Calendar Challenge </h1> <div id="message">Call us about our next gig!</div> <table> <thead> <tr id="h-row"> <th class="h-date">Date</td> <th class="h-venue">Venue</td> <th class="h-time">Time</td> </tr> </thead> <tbody> <tr> <td>Wed, Dec 30, 2015</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Toasty's</a></td> <td>4:00p - 8:00p</td> </tr> <tr> <td>Fri, Jan 8, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">The Glue Tavern</a></td> <td>8:00p - 12:00a</td> </tr> <tr> <td>Sat, Jan 9, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Denial Den</a></td> <td>No time limit</td> </tr> <tr> <td>Fri, Jan 15, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Advocate Alley</a></td> <td>6:00p - 10:00p</td> </tr> <tr> <td>Sat, Jan 30, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Spud's Spurtz Bar</a></td> <td>7:00p - 11:00p</td> </tr> <tr> <td>Fri, Feb 05, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Flatty's Flophouse</a></td> <td>8:30p - 12:30a</td> </tr> <tr> <td>Sat, Feb 06, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Crackhead Casino</a></td> <td>9:00p - 1:00a</td> </tr> <tr> <td>Sat, Feb 13, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Quax</a></td> <td>11:00p - 3:00a</td> </tr> <tr> <td>Sat, Feb 20, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Godhe's Ghetto</a></td> <td>8:00p - 12:00a</td> <tr> <td>Fri, Feb 26, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">The Rusty Bucket</a></td> <td>8:00p - 12:00a</td> </tr> <tr> <td>Fri, Mar 11, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Lady Luck</a></td> <td>6:00p - 10:00p</td> </tr> <tr> <td>Sat, Mar 19, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Johnny G's</a></td> <td>8:00p - 12:00a</td> <tr> <td>Sat, Mar 26, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Barf 'n' Bake</a></td> <td>4:00p - 8:00p</td> </tr> <tr> <td>Sat, Apr 09, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Advocate Alley</a></td> <td>11:00p - 3:00a</td> </tr> <tr> <td>Fri, Apr 22, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Salty's Sh*thouse</a></td> <td>No clock</td> </tr> <tr> <td>Fri, Apr 29, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">The Snake Room</a></td> <td>8:30p - 12:30a</td> </tr> <tr> <td>Sat, Apr 30, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Goblin Manor</a></td> <td>1:30p - 5:30p</td> </tr> <tr> <td>Thu, May 12, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Cowboy Cove</a></td> <td>6:00p - 10:00p</td> </tr> <tr> <td>Sat, May 21, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Snotley's Fungal Palace</a></td> <td>3:00p - 7:00p</td> </tr> <tr> <td>Thu, May 26, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">20 Mile House</a></td> <td>8:30p - 12:30a</td> </tr> <tr> <td>Fri, May 27, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Halfway House</a></td> <td>No power</td> </tr> <tr> <td>Fri, Jun 10, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">wHoleway House</a></td> <td>8:30p - 12:30a</td> </tr> <tr> <td>Sat, Jun 11, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Puke Park Benefit</a></td> <td>12:00p - 4:00p</td> </tr> <tr> <td>Sat, Jun 25, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Prescott Medicine Show</a></td> <td>10:00a to passout</td> </tr> <tr> <td>Fri, Sep 2, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Slimer's Joint</a></td> <td>8:30p - 12:30a</td> </tr> <tr> <td>Sat, Sep 24, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">DFS Lounge</a></td> <td>8:00p - 1:00a</td> </tr> <tr> <td>Sun, Sep 25, 2016</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">ED (excessive dishonesty) benefit - Cohost: Liagra</a></td> <td>3:00p - 7:00p</td> </tr> <tr> <td>Monday, Jan 2, 2017</td> <td><a href="https://www.google.com/maps/" title="Click for map" target="_blank">Hangover Party</a></td> <td>9:30p - 1:00p</td> </tr> </tbody> </table> </body> </html>
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2016-05-30 13:11 -0400 |
| Message-ID | <nihs96$i9j$1@dont-email.me> |
| In reply to | #357773 |
On 5/30/2016 12:53 PM, Steve Carroll wrote: > Challenge for you... styling aside, (which is mainly there to help visually indicate functionality) how would you do this using Python... > > <http://imgur.com/P5pjSFt> > > ... to markup you were given (I changed venue names) that looked sorta like this: Sorry, but I don't understand what you're asking. Do you mean how would I use python to create the table in the imgur link, starting from the HTML you listed?
[toc] | [prev] | [next] | [standalone]
| From | Steve Carroll <fretwizzer@gmail.com> |
|---|---|
| Date | 2016-05-30 10:22 -0700 |
| Message-ID | <9f1863b1-790f-430d-9e80-4bc157e7ab19@googlegroups.com> |
| In reply to | #357774 |
On Monday, May 30, 2016 at 11:12:09 AM UTC-6, DFS wrote: > On 5/30/2016 12:53 PM, Steve Carroll wrote: > > > > Challenge for you... styling aside, (which is mainly there to help visually indicate functionality) how would you do this using Python... > > > > <http://imgur.com/P5pjSFt> > > > > ... to markup you were given (I changed venue names) that looked sorta like this: > > > Sorry, but I don't understand what you're asking. > > Do you mean how would I use python to create the table in the imgur > link, starting from the HTML you listed? No (the HTML already has a table), I mean how would you target events from that markup based on their date so you can differentiate past dates from future dates and include the "Next Gig" line shown at the top.
[toc] | [prev] | [next] | [standalone]
| From | "Octavian W. Lagrange" <olagrang@perch.invalid> |
|---|---|
| Date | 2016-05-30 21:09 +0000 |
| Message-ID | <tueoag03.ag3@perch.invalid> |
| In reply to | #357776 |
Steve Carroll <fretwizzer@gmail.com> wrote: > On Monday, May 30, 2016 at 11:12:09 AM UTC-6, DFS wrote: >> On 5/30/2016 12:53 PM, Steve Carroll wrote: >> >> >> > Challenge for you... styling aside, (which is mainly there to help visually indicate functionality) how would you do this using Python... >> > >> > <http://imgur.com/P5pjSFt> >> > >> > ... to markup you were given (I changed venue names) that looked sorta like this: >> >> >> Sorry, but I don't understand what you're asking. >> >> Do you mean how would I use python to create the table in the imgur >> link, starting from the HTML you listed? > > No (the HTML already has a table), I mean how would you target events from that markup based on their date so you can differentiate past dates from future dates and include the "Next Gig" line shown at the top. Why would you do this after the markup? That would seem to be something you do before generating the markup.
[toc] | [prev] | [next] | [standalone]
| From | Steve Carroll <fretwizzer@gmail.com> |
|---|---|
| Date | 2016-05-30 14:32 -0700 |
| Message-ID | <f74a8897-de16-49fe-8507-17f67b161886@googlegroups.com> |
| In reply to | #357802 |
On Monday, May 30, 2016 at 3:09:16 PM UTC-6, Octavian W. Lagrange wrote: > Steve Carroll <fretwizzer@gmail.com> wrote: > > On Monday, May 30, 2016 at 11:12:09 AM UTC-6, DFS wrote: > >> On 5/30/2016 12:53 PM, Steve Carroll wrote: > >> > >> > >> > Challenge for you... styling aside, (which is mainly there to help visually indicate functionality) how would you do this using Python... > >> > > >> > <http://imgur.com/P5pjSFt> > >> > > >> > ... to markup you were given (I changed venue names) that looked sorta like this: > >> > >> > >> Sorry, but I don't understand what you're asking. > >> > >> Do you mean how would I use python to create the table in the imgur > >> link, starting from the HTML you listed? > > > > No (the HTML already has a table), I mean how would you target events from that markup based on their date so you can differentiate past dates from future dates and include the "Next Gig" line shown at the top. > > Why would you do this after the markup? That would seem to be something > you do before generating the markup. This was for someone who had a static web page, and this was (essentially) their markup. How would you do this prior to generating the markup on this page in Python (I've never used it)?
[toc] | [prev] | [next] | [standalone]
| From | "Octavian W. Lagrange" <olagrang@perch.invalid> |
|---|---|
| Date | 2016-05-30 21:48 +0000 |
| Message-ID | <ghfa03g.ajppi@perch.invalid> |
| In reply to | #357805 |
Steve Carroll <fretwizzer@gmail.com> wrote: > On Monday, May 30, 2016 at 3:09:16 PM UTC-6, Octavian W. Lagrange wrote: >> Steve Carroll <fretwizzer@gmail.com> wrote: >> > On Monday, May 30, 2016 at 11:12:09 AM UTC-6, DFS wrote: >> >> On 5/30/2016 12:53 PM, Steve Carroll wrote: >> >> >> >> >> >> > Challenge for you... styling aside, (which is mainly there to help visually indicate functionality) how would you do this using Python... >> >> > >> >> > <http://imgur.com/P5pjSFt> >> >> > >> >> > ... to markup you were given (I changed venue names) that looked sorta like this: >> >> >> >> >> >> Sorry, but I don't understand what you're asking. >> >> >> >> Do you mean how would I use python to create the table in the imgur >> >> link, starting from the HTML you listed? >> > >> > No (the HTML already has a table), I mean how would you target events from that markup based on their date so you can differentiate past dates from future dates and include the "Next Gig" line shown at the top. >> >> Why would you do this after the markup? That would seem to be something >> you do before generating the markup. > > This was for someone who had a static web page, and this was (essentially) their markup. How would you do this prior to generating the markup on this page in Python (I've never used it)? I don't know python, but the way to approach it would be something like: Get the dates, compare them to today's date, generate a <strike>/</strike> pair on the older dates, print the earliest date greater than or equal to today's date at the top with a "Next" label or whatever.
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2016-05-30 17:34 -0400 |
| Message-ID | <niibm6$ag8$1@dont-email.me> |
| In reply to | #357776 |
On 5/30/2016 1:22 PM, Steve Carroll wrote:
> On Monday, May 30, 2016 at 11:12:09 AM UTC-6, DFS wrote:
>> On 5/30/2016 12:53 PM, Steve Carroll wrote:
>>
>>
>>> Challenge for you... styling aside, (which is mainly there to help visually indicate functionality) how would you do this using Python...
>>>
>>> <http://imgur.com/P5pjSFt>
>>>
>>> ... to markup you were given (I changed venue names) that looked sorta like this:
>>
>>
>> Sorry, but I don't understand what you're asking.
>>
>> Do you mean how would I use python to create the table in the imgur
>> link, starting from the HTML you listed?
>
> No (the HTML already has a table), I mean how would you target events from that markup based on their date so you can differentiate past dates from future dates and include the "Next Gig" line shown at the top.
Generally: use the python lxml and requests library to retrieve and
parse the HTML, get the date strings, convert them to date objects,
compare them to the current date, and update the Next Gig line.
Pretty simple once you can parse the data from the HTML.
This is what your HTML looks like when I save it:
http://i.imgur.com/OC9OhaO.jpg
It won't parse. The table rows are:
<tr>
<td>Wed, Dec 30, 2015</td>
<td><a href="https://www.google.com/maps/" title="Click for map"
target="_blank">Toasty's</a></td>
<td>4:00p - 8:00p</td>
</tr>
Other sites I've scraped also have target="_blank" tags and they return
data. But they're live sites, not HTML files.
It's a PEBKAC issue I'm sure.
Can you point me to the live site for that data? I'll work against it
and hopefully give you a full solution.
[toc] | [prev] | [next] | [standalone]
| From | Steve Carroll <fretwizzer@gmail.com> |
|---|---|
| Date | 2016-05-30 14:57 -0700 |
| Message-ID | <3d87b9e8-bac2-4a03-ab66-06d526e42b12@googlegroups.com> |
| In reply to | #357806 |
On Monday, May 30, 2016 at 3:35:05 PM UTC-6, DFS wrote: > On 5/30/2016 1:22 PM, Steve Carroll wrote: > > On Monday, May 30, 2016 at 11:12:09 AM UTC-6, DFS wrote: > >> On 5/30/2016 12:53 PM, Steve Carroll wrote: > >> > >> > >>> Challenge for you... styling aside, (which is mainly there to help visually indicate functionality) how would you do this using Python... > >>> > >>> <http://imgur.com/P5pjSFt> > >>> > >>> ... to markup you were given (I changed venue names) that looked sorta like this: > >> > >> > >> Sorry, but I don't understand what you're asking. > >> > >> Do you mean how would I use python to create the table in the imgur > >> link, starting from the HTML you listed? > > > > No (the HTML already has a table), I mean how would you target events from that markup based on their date so you can differentiate past dates from future dates and include the "Next Gig" line shown at the top. > > > Generally: use the python lxml and requests library to retrieve and > parse the HTML, get the date strings, convert them to date objects, > compare them to the current date, and update the Next Gig line. > > Pretty simple once you can parse the data from the HTML. I just wanted to see what it'd look like in Python. > This is what your HTML looks like when I save it: > http://i.imgur.com/OC9OhaO.jpg I left the styling up to you, the only goal is to differentiate past dates from future. > It won't parse. ?? > The table rows are: > > <tr> > <td>Wed, Dec 30, 2015</td> > <td><a href="https://www.google.com/maps/" title="Click for map" > target="_blank">Toasty's</a></td> > <td>4:00p - 8:00p</td> > </tr> > > Other sites I've scraped also have target="_blank" tags and they return > data. But they're live sites, not HTML files. You can remove them... along with the map links... neither is important for this example. > It's a PEBKAC issue I'm sure. > > Can you point me to the live site for that data? I'll work against it > and hopefully give you a full solution. If I do that you won't have anything to do ;) You're probably want to (if you haven't already) use something like CherryPy. Here's another little challenge, from crackhead's 'non-database' of stuff about PK: <https://vid.me/ACaW> I created the file from here: <https://groups.google.com/forum/#!original/comp.os.linux.advocacy/Qu7kcCjtOaw/6oQASY5dCwAJ>
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2016-05-31 13:57 -0400 |
| Message-ID | <nikja8$7c5$1@dont-email.me> |
| In reply to | #357817 |
On 5/30/2016 5:57 PM, Steve Carroll wrote: > You're probably want to (if you haven't already) use something like CherryPy. Looks useful. > Here's another little challenge, from crackhead's 'non-database' of stuff about PK: > > <https://vid.me/ACaW> > > I created the file from here: > > <https://groups.google.com/forum/#!original/comp.os.linux.advocacy/Qu7kcCjtOaw/6oQASY5dCwAJ> Is the 'challenge' to use python to create an HTML page of Snit's Kohlmann quotes? How did you do it?
[toc] | [prev] | [next] | [standalone]
| From | Steve Carroll <fretwizzer@gmail.com> |
|---|---|
| Date | 2016-05-31 11:21 -0700 |
| Message-ID | <9e7aa627-6555-42dd-ba0c-29dba9d0f417@googlegroups.com> |
| In reply to | #357890 |
On Tuesday, May 31, 2016 at 11:57:31 AM UTC-6, DFS wrote: > On 5/30/2016 5:57 PM, Steve Carroll wrote: > > > > You're probably want to (if you haven't already) use something like CherryPy. > > > Looks useful. > > > > > Here's another little challenge, from crackhead's 'non-database' of stuff about PK: > > > > <https://vid.me/ACaW> > > > > I created the file from here: > > > > <https://groups.google.com/forum/#!original/comp.os.linux.advocacy/Qu7kcCjtOaw/6oQASY5dCwAJ> > > > Is the 'challenge' to use python to create an HTML page of Snit's > Kohlmann quotes? > > How did you do it? How else... using generous helpings of: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace>
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2016-06-01 10:05 -0400 |
| Message-ID | <nimq2p$e0k$2@dont-email.me> |
| In reply to | #357896 |
On 5/31/2016 2:21 PM, Steve Carroll wrote: > On Tuesday, May 31, 2016 at 11:57:31 AM UTC-6, DFS wrote: >> On 5/30/2016 5:57 PM, Steve Carroll wrote: >> >> >>> You're probably want to (if you haven't already) use something like CherryPy. >> >> >> Looks useful. >> >> >> >>> Here's another little challenge, from crackhead's 'non-database' of stuff about PK: >>> >>> <https://vid.me/ACaW> >>> >>> I created the file from here: >>> >>> <https://groups.google.com/forum/#!original/comp.os.linux.advocacy/Qu7kcCjtOaw/6oQASY5dCwAJ> >> >> >> Is the 'challenge' to use python to create an HTML page of Snit's >> Kohlmann quotes? >> >> How did you do it? > > How else... using generous helpings of: > > <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace> Code please.
[toc] | [prev] | [next] | [standalone]
| From | Steve Carroll <fretwizzer@gmail.com> |
|---|---|
| Date | 2016-06-01 08:48 -0700 |
| Message-ID | <a11899a9-1ba3-486e-b17c-af54a627656a@googlegroups.com> |
| In reply to | #358002 |
On Wednesday, June 1, 2016 at 8:05:16 AM UTC-6, DFS wrote:
> On 5/31/2016 2:21 PM, Steve Carroll wrote:
> > On Tuesday, May 31, 2016 at 11:57:31 AM UTC-6, DFS wrote:
> >> On 5/30/2016 5:57 PM, Steve Carroll wrote:
> >>
> >>
> >>> You're probably want to (if you haven't already) use something like CherryPy.
> >>
> >>
> >> Looks useful.
> >>
> >>
> >>
> >>> Here's another little challenge, from crackhead's 'non-database' of stuff about PK:
> >>>
> >>> <https://vid.me/ACaW>
> >>>
> >>> I created the file from here:
> >>>
> >>> <https://groups.google.com/forum/#!original/comp.os.linux.advocacy/Qu7kcCjtOaw/6oQASY5dCwAJ>
> >>
> >>
> >> Is the 'challenge' to use python to create an HTML page of Snit's
> >> Kohlmann quotes?
> >>
> >> How did you do it?
> >
> > How else... using generous helpings of:
> >
> > <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace>
>
>
> Code please.
Cheating?! I wasn't kidding, it's mostly simple statements using regex that replace his markings with elements and such, for example:
data = data.replace(/----/g,"<p class = \"my-class\" >");
The regex is in between the slashes and the replacement is after the comma. Should be easy, right?
One problem with separating out the quotes was his inconsistency, I was unable to get a 100% error free result wrt being able to italicize the quoted material from PK... it was mostly good but had issues, here's one (I think there were 2?):
<http://imgur.com/MHxU7uQ>
Maybe you can get a better result. This exercise is more dependent on regex and statement ordering than anything else (and I suck at regex). Maybe the stuff below is the part you're missing for web, it'll bring your text file in as an object, then just use it in javascript s I just showed, or tweak the file the way you want in Python on the server ahead of time. If you really wanna cheat you can bring it into the target div with:
document.getElementById('targetDiv').innerHTML = data;
That's a reference to the element shown in the HTML doc below and the javascript property used to replace the text currently in between the opening and closing tags: "This was the element you referenced above". As for getting the data from the text file, in between script tags, paste this:
'use strict';
var obj = new XMLHttpRequest(), fixed,data;
obj.onreadystatechange = function () {
if (obj.readyState === 4) {
data = obj.responseText;
}
};
obj.open('GET', 'data.txt');
function sendAJAX() {
obj.send( );
}
sendAJAX();
The above requires that the data.txt file be on the same hierarchical level as the your.html file that references it with script tags (and it won't handle errors very gracefully). The HTML document requires a target element with the CSS ID selector I specified above ("targetDiv"), so the entire HTML could be as simple as:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Challenge</title>
</head>
<body>
<div id="targetDiv">This was the element you referenced above</div>
</body>
<script>Place the above script here</script>
</html>
And the CSS as easy as:
#targetDiv {
background-color# #efefef;
border-left: 5px dashed #ccc;
}
Be careful using that CSS, though... crackhead may sue you for copyright infringement ;)
I cut out pretty much any legwork you'd have to do to get it into a web page. The question is: How good are your regex chops and replacement 'logic'? Don't overlook the simple stuff, Fabian is watching ;)
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2016-06-01 13:12 -0400 |
| Message-ID | <nin529$oci$1@dont-email.me> |
| In reply to | #358033 |
On 6/1/2016 11:48 AM, Steve Carroll wrote:
> On Wednesday, June 1, 2016 at 8:05:16 AM UTC-6, DFS wrote:
>> On 5/31/2016 2:21 PM, Steve Carroll wrote:
>>> On Tuesday, May 31, 2016 at 11:57:31 AM UTC-6, DFS wrote:
>>>> On 5/30/2016 5:57 PM, Steve Carroll wrote:
>>>>
>>>>
>>>>> You're probably want to (if you haven't already) use something like CherryPy.
>>>>
>>>>
>>>> Looks useful.
>>>>
>>>>
>>>>
>>>>> Here's another little challenge, from crackhead's 'non-database' of stuff about PK:
>>>>>
>>>>> <https://vid.me/ACaW>
>>>>>
>>>>> I created the file from here:
>>>>>
>>>>> <https://groups.google.com/forum/#!original/comp.os.linux.advocacy/Qu7kcCjtOaw/6oQASY5dCwAJ>
>>>>
>>>>
>>>> Is the 'challenge' to use python to create an HTML page of Snit's
>>>> Kohlmann quotes?
>>>>
>>>> How did you do it?
>>>
>>> How else... using generous helpings of:
>>>
>>> <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace>
>>
>>
>> Code please.
>
> Cheating?!
Never.
> I wasn't kidding, it's mostly simple statements using regex that replace his markings with elements and such, for example:
>
> data = data.replace(/----/g,"<p class = \"my-class\" >");
>
> The regex is in between the slashes and the replacement is after the comma. Should be easy, right?
In theory. In reality, you curse the day you were born.
> One problem with separating out the quotes was his inconsistency, I was unable to get a 100% error free result wrt being able to italicize the quoted material from PK... it was mostly good but had issues, here's one (I think there were 2?):
>
> <http://imgur.com/MHxU7uQ>
>
> Maybe you can get a better result. This exercise is more dependent on regex and statement ordering than anything else (and I suck at regex). Maybe the stuff below is the part you're missing for web, it'll bring your text file in as an object, then just use it in javascript s I just showed, or tweak the file the way you want in Python on the server ahead of time. If you really wanna cheat you can bring it into the target div with:
>
> document.getElementById('targetDiv').innerHTML = data;
>
> That's a reference to the element shown in the HTML doc below and the javascript property used to replace the text currently in between the opening and closing tags: "This was the element you referenced above". As for getting the data from the text file, in between script tags, paste this:
>
> 'use strict';
> var obj = new XMLHttpRequest(), fixed,data;
> obj.onreadystatechange = function () {
> if (obj.readyState === 4) {
> data = obj.responseText;
> }
> };
> obj.open('GET', 'data.txt');
> function sendAJAX() {
> obj.send( );
> }
> sendAJAX();
>
> The above requires that the data.txt file be on the same hierarchical level as the your.html file that references it with script tags (and it won't handle errors very gracefully). The HTML document requires a target element with the CSS ID selector I specified above ("targetDiv"), so the entire HTML could be as simple as:
>
> <!DOCTYPE html>
> <html lang="en">
> <head>
> <meta charset="utf-8" />
> <title>Challenge</title>
> </head>
> <body>
> <div id="targetDiv">This was the element you referenced above</div>
> </body>
> <script>Place the above script here</script>
> </html>
>
> And the CSS as easy as:
>
> #targetDiv {
> background-color# #efefef;
> border-left: 5px dashed #ccc;
> }
>
> Be careful using that CSS, though... crackhead may sue you for copyright infringement ;)
It looks very complex...
> I cut out pretty much any legwork you'd have to do to get it into a web page.
Why?
I didn't care about the mechanics. I just wanted to see how much code
was required to do the conversion.
Last night I looked at some of the python HTML libs, but I'm sure it
won't be quite as easy as they make it look.
> The question is: How good are your regex chops and replacement 'logic'?
My "regex chops" begin and end at:
'[^a-zA-Z]'
> Don't overlook the simple stuff, Fabian is watching ;)
As am I watching that simple-simon numbnut for any new weaknesses to
exploit (on top of the many he already revealed).
[toc] | [prev] | [next] | [standalone]
| From | "Octavian W. Lagrange" <olagrang@perch.invalid> |
|---|---|
| Date | 2016-06-01 17:19 +0000 |
| Message-ID | <gjvmbndjd83af.ji7@perch.invalid> |
| In reply to | #358078 |
DFS <nospam@dfs.com> wrote: > On 6/1/2016 11:48 AM, Steve Carroll wrote: > > >> The question is: How good are your regex chops and replacement 'logic'? > > My "regex chops" begin and end at: > '[^a-zA-Z]' > http://shop.oreilly.com/product/9780596528126.do
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | comp.os.linux.advocacy
csiph-web