Latest posts of: Stoic Joker - DonationCoder.com
Welcome Guest.   Make a donation to an author on the site June 30, 2015, 12:17:17 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Read the full one-year retrospective report on DonationCoder.com.
   
  Forum Home Thread Marks Chat! Downloads Search Login Register  
  Show Posts
      View this member's profile 
      donate to someone Donate to this member 
Pages: Prev 1 ... 122 123 124 125 126 [127] 128 129 130 131 132 ... 213 Next
3151  Other Software / Developer's Corner / Re: SQL Query is Kicking my Ass. on: July 05, 2011, 06:43:59 AM
Have you tried using temporary tables? Joins can be very expensive. (Sorry -- I'd love to jump in and help more, but need to run out the door.) Multiple queries can sometimes help.

My understanding was that joins were less expensive than nested selects, so I went that route to keep the server from racing itself to death (had to kill it a few times). This isn't for something that has to be done frequently by multiple users. It's a one-shot report that has great potential to be useful going forward on a ~monthly basis. So if it took a few minutes to run...That's Okay...If it comes up with the right answer.

OTOH, if it could be done quickly, no-one would complain... Wink

Haven't tried temporary tables yet, but I have been slowly resigning myself to the possibility of their need. In a nutshell, the downside of being completely self taught, is that when you're stuck, you are stuck... smiley (e.g. I'm stuck'ed)


@Perry - At this point I'm game to try anything. I'll try your query later today and see what happens. Hopefully it'll give me a data set that's a bit less hellter skelter than what I have been getting.
3152  Other Software / Developer's Corner / Re: SQL Query is Kicking my Ass. on: July 04, 2011, 11:55:46 AM
It's very hard to help you without seeing an example database, but I think the problem is between line 5-7.
If you look at the
documentation on group by / having you see Having is used as a where on groups.

Having is something I just ran across the other day while Googling for an example of how best to get a list of max(dates) out of a table during/using a self join. So given that it has yet to create a result set that made complete sense it's quite likely I'm using it wrong...or expecting it to do more than it actually does (hell if I knew what I was doing I'd probably be done by now... (hehe)). Also that's just one of a multitude of things I tried none of which worked properly.

Not sure how well this will paste, but here's a small (cleaned) piece of the table's content.
Formatted for SQL with the GeSHI Syntax Highlighter [copy or print]
  1. INDEX  SerialNo ModelName ClientID   CurPageCount  OldPageCount   TimeStamp   TotalPP
  2. 29 CNBM044207 3380 mfp MIKLA01 2404 26 2005-10-27 09:04:17 2378
  3. 9 USLH039092 1100 CRITR01 39339 38834 2005-09-29 11:47:17 505
  4. 10 CNDIF23087 1160 CRITR01 7947 7632 2005-09-29 11:47:17 315
  5. 30 USBNL12704 4200 MIKLA01 199451 193626 2005-10-27 09:04:17 5825
  6. 12 CN09506649 4300 CRITR01 401922 383635 2005-09-29 11:47:17 18287
  7. 13 JPCG012675 4v CRITR01 449756 449206 2005-09-29 11:47:17 550
  8. 14 USBB019753 8000 series CRITR01 844310 839591 2005-09-29 11:47:17 4719
  9. 15 USBB020920 8000 series CRITR01 760125 756990 2005-09-29 11:47:17 3135
  10. 16 U61036C5J482752 Brother MFC8840D CRITR01 3271 2314 2005-09-29 11:47:17 957
  11. 18 USBB031505 3100 fax SNIFFERT_B 167316 167316 2005-10-02 11:47:23 0
  12. 19 USCC000104 4050 UFORA03 258810 255488 2005-10-04 08:50:26 3322
  13. 20 JPJB002010 Color 8550 series ECODE01 162675 160416 2005-10-18 16:27:32 2259
  14. 21 USLH039092 1100 CRITR01 39945 39339 2005-10-19 08:52:25 606
  15. 22 CNDIF23087 1160 CRITR01 9131 7947 2005-10-19 08:52:25 1184
  16. 24 CN09506649 4300 CRITR01 426537 401922 2005-10-19 08:52:25 24615
  17. 25 JPCG012675 4v CRITR01 450190 449756 2005-10-19 08:52:25 434
  18. 26 USBB019753 8000 series CRITR01 848516 844310 2005-10-19 08:52:25 4206
  19. 27 USBB020920 8000 series CRITR01 768063 760125 2005-10-19 08:52:25 7938
  20. 28 U61036C5J482752 Brother MFC8840D CRITR01 4225 3271 2005-10-19 08:52:25 954
  21. 31 USSC016017 4000 series OCLAD01 124823 124164 2005-10-27 13:25:31 659


I'm still not really sure what you want because the query you are posting is not the same as your description of the query in the starting post.

The relevant part is. There are just some other (device specific) values being pulled in from another (PiX) table.

Your query is trying to search for a Client that is Active where the billing date from pc1 historyical information is identical to the last billing date from some other place (pc2), then grouping by printer and timestamp. It doesn't make sense.

I had a feeling that might confuse thing, which is why I didn't lead with it. Just ignore all the PiX.* stuff. It's only verifying that the device with SN X is "active" to thin out the data set.

Also to me it's not clear how Pc2 is related to pc1 tongue in english? Without being clear how you want the query in english noone can translate that to SQL. hope that helps

Hm... (a bit sketchy on that myself), Best I can tell table is joined to itself on SN so that each SN can be searched for/aligned to its maximum date with a TotallPP of 0.

I'm at a point where the more I look at it the less sense it makes (forest for trees??) even after taking a break.
3153  Other Software / Developer's Corner / Re: SQL Query is Kicking my Ass. on: July 04, 2011, 09:53:05 AM
(you could try <1 in case the default value for TotalPP columns empty instead of 0)

Default column value is 0, so no NULLs to trip over/around.

What's wrong with something like:
SELECT Max(TimeStamp) As LastBillableDate,Index,SerialNo,ModelName, ClientID FROM <TableName> WHERE TotalPP=0.

That's along the lines of what I have been playing with ... But no *joy* as of yet.

* Split the problem up into small problems you can get working, don't try it all at once.

Sound advice, but it hasn't panned out yet. smiley

* Microsoft Reporting Services (if you can get your hands on it) is a great tool for making reports and it can connect to MySQL databases too, this might make it easier to create reports.

That may be handy for the future, but I'm not sure I want to introduce a new tools learning curve to the mix at this point.



Here's one of the Close-but-no-Cigar queries I've been playing with. Note it does include references to another table which is required for the final product. But isn't part of the current sticking point.
Formatted for SQL with the GeSHI Syntax Highlighter [copy or print]
  1. SELECT Pc1.ClientID, Pc1.SerialNo, Pc1.ModelName, PiX.CurLocation, Pc1.TimeStamp
  2. FROM PageCounts Pc1
  3. INNER JOIN PageCounts Pc2 ON Pc1.SerialNo = Pc2.SerialNo
  4. INNER JOIN Printer_Inv PiX ON Pc1.SerialNo = PiX.SerialNo
  5. WHERE Pc1.ClientID = 'Client X' AND PiX.Active = 1
  6. GROUP BY Pc1.SerialNo, Pc1.TimeStamp
  7. HAVING Pc1.TimeStamp = MAX(Pc2.TimeStamp)
  8. ORDER BY Pc1.TimeStamp DESC
  9. LIMIT 0, 300
3154  Other Software / Developer's Corner / [Solved] SQL Query is Kicking my Ass. on: July 04, 2011, 09:18:41 AM
Greetings
   So when the boss first asked me about doing this report it sounded simple enough. But after 4 days of hammering on it I've come to the conclusion that my initial assessment may have been (dead) wrong. I'm going to try to be both detailed and succinct ... So please bear with me if this gets a bit long.

   One of our internal billing systems contains historical information (Client, serial#, date, pages printed, etc.) about printers that are under contract. Circumstances being what they are (IT Happens), occasionally there are devices that don't get their counts collected. Now usually this gets caught up at a later date ... but some times certain devices slide long enough to start raising eyebrows as to their existence and condition. Which brings "us" to the report in question.

   I'm trying to create a SQL query (for a MySQL db) that will list all the devices for client X that:
1. Does not recently/currently have a billable count (Total Pages Printed = 0).
2. Shows the date of the last billable count (or the first zero count date in a contiguous historical block between then and now).


   Sound simple enough? Hopefully it is for some one here ... 'cause I'm getting my ass kicked by this thing. The relevant table structure and usage is as follows:

Columns:
Index - auto incremented (int).
SerialNo - of the device (string).
ModelName - of the device (string).
ClientID - Internal identified of customer (string).
TimeStamp - a.k.a. billing date / all devices for a given customer/date will have an identical time stamp (timestamp).
TotalPP - Total Pages Printed this will reflect the number of pages printed by that device for that billing cycle (int).

I've got close to 9 pages of failed queries and notes on what doesn't work. Nested selects tend to make the server race and die (neat trick with dual Xeons), so I've been concentrating on various self-join variations. But nothing is giving me a resultant data set that isn't either wrong or total garbage.


So I'm hoping to find a more informed opinion on how to approach this.

Thank you,
Slightly frazzled but still vaguely Stoic Joker
3155  Main Area and Open Discussion / General Software Discussion / Re: When your word processor begins openly mocking you, it's time to call it a day on: June 20, 2011, 07:44:09 PM
I have to say I like Word 2010 ... sorry.

It tries my patience at times, but I'm getting used to it.
3156  Main Area and Open Discussion / General Software Discussion / Re: When your word processor begins openly mocking you, it's time to call it a day on: June 20, 2011, 07:42:05 PM
Well that's a clever (and somewhat frightening) solution. I take it WordPad didn't quite do what she wanted?

Wordpad on Win98 vs the beta of AOL 6.0? No comparison! I know it's hard to believe but AOL's email formatting options were better, easier to use, and more reliable.

Makes sense (been a while since I used 98), I just have a bit of an aversion to all things AOL... smiley
3157  Main Area and Open Discussion / General Software Discussion / Re: When your word processor begins openly mocking you, it's time to call it a day on: June 20, 2011, 06:46:05 PM
I have a client that was having issues with Word files (.doc) self destructing after they'd been passed around the office a few times in the process of being finalized. The documents were quite large training event reports that contained several groups of pictures in the frequently over 50 pages of text. Office versions were all 2003 & 2007 (2010 wasn't out yet back then), but no common points were found for who was most guilty (think "Hot Potato") of breaking the document. After so many trips through the office it just went boom on who ever was unlucky enough to make the mistake of hitting save.

As it turns out Word Documents are extremely sensitive to formatting. While it doesn't matter how you choose to format the document ... It is extremely critical that you do it consistently. As it seems that it standard method of dealing with change is to react much as you described.

The client had a meeting, at which it was decided how everybody was going to deal with various formatting type instances ... And the problem has not resurfaced again in well over a year.

So given that you were stuck futzing with fanatical formatting fiats. That's probably what caused the problem.


That was when she discovered that AOL email windows are pretty good for formatting reports, as long as you didn't fill in the sendto and subject boxes. That's what she ended up using for the rest of her high school years. (she still hates Word and would rather use Notepad than to ever trust it again)

Well that's a clever (and somewhat frightening) solution. I take it WordPad didn't quite do what she wanted?
3158  Main Area and Open Discussion / General Software Discussion / Re: Compressing Outlook-Datafiles (PST) for free without Outlook? on: June 20, 2011, 02:44:36 PM
I included the PST-Files before the admin disabled the using of these files

Meaning it's listed in Account Settings as a seperate secondary storage location? Or did you just do import .pst file from the file menu?

If you did an import then it was actually just streamed into your Exchange mailbox. If it's a secondary storage location them you're at the Admin's mercy as to what can be done with it.

It possible depending on how it was done that you just need to right click-properties on the right Personal Files Folder parent to get to the compaction function for that file. I bring this up because I'm running Outlook 2010 with Exchange and have caching disabled. And the compaction functions are disabled on my machine when I go into properties. Being that I am the Admin I have access to everything ... So I do believe it's safe to assume that these are just/only disabled by Outlook due to there not being enabled/relevent.
3159  Main Area and Open Discussion / General Software Discussion / Re: Compressing Outlook-Datafiles (PST) for free without Outlook? on: June 20, 2011, 07:05:39 AM
If Exchange caching mode is enabled (in outlook) Outlook will create an .ost file which is used for (laptops mainly) offline access.

Either way the .ost/.pst files aren't compressed unless they are being exported. They can be compacted for maintenance/performance reasons, but that's not really the same thing. Your not going to gain more storage space on the Exchange server by compressing the local file regardless. Those limits are set by administrators for reasons... Wink
3160  Main Area and Open Discussion / Living Room / Re: New DVD Rewinding Service on: June 17, 2011, 10:10:40 PM
Perhaps I can interest you in ocean front property in Nevada. It's a fantastic investment! I'll even cut you a special deal.

You're trying to sell beach front property to a Floridian, and I'm the fool?  undecided

When the next big earthquake hits and California falls into the ocean, you'll wish you had taken me up on my offer.

 Wink

Oh sure, play to my cynical side...  smiley
3161  Main Area and Open Discussion / Living Room / Re: Scented USB Drives? on: June 17, 2011, 05:31:55 PM
If they had one in sandalwood the wife might go for it.
3162  Main Area and Open Discussion / Living Room / Re: New DVD Rewinding Service on: June 17, 2011, 05:17:55 PM
Yes indeed you're one smart cookie! Colorado doesn't fit you. I can see that now. Perhaps I can interest you in ocean front property in Nevada. It's a fantastic investment! I'll even cut you a special deal.

You're trying to sell beach front property to a Floridian, and I'm the fool?  undecided

No. ...And I'm not looking for any bridges or swampland either.

 Wink
3163  Main Area and Open Discussion / Living Room / Re: New DVD Rewinding Service on: June 17, 2011, 11:44:02 AM
I didn't say I was an idiot.

But Deo did

Hay, maybe kyrathaba was kidding, maybe he wasn't ...(don't know for sure do we)... But I've seen dumber shit make money so why not take a shot. Hell I'd rather chance looking foolish, than be to chicken shit to leave the porch.  Wink

@daddydave - Nice timing, good example. smiley
3164  Main Area and Open Discussion / Living Room / Re: New DVD Rewinding Service on: June 17, 2011, 11:06:25 AM
I know nothing of investing. But this is just too weird to pass up.

And I've got great ocean front property to sell you for cheap in Colorado!

Ocean front property in a landlocked state ... Nice. Investing is the part I'm unclear on...I didn't say I was an idiot.

 cheesy
3165  Main Area and Open Discussion / Living Room / Re: New DVD Rewinding Service on: June 17, 2011, 06:50:14 AM
My uncle is the man who actually owns and runs the Digital Velocity online rewinder service.  He's incorporated it and is selling shares.  I am his designated representative here on DC, so if anyone wants to purchase shares by sending me $$$ via PayPal, please don't hesitate to contact me.

O_o ...Okay, I'll bite ... What's a share going for??

I know nothing of investing. But this is just too weird to pass up.
3166  Main Area and Open Discussion / Living Room / Re: Friends: Brace yourselves for another economic turn. on: June 16, 2011, 10:20:55 AM
Well, Stoic Joker has his guns, time for the rest of us to stock up~!

Shopping List:
Bullets
Bullets
Bullets
 ...
3167  Main Area and Open Discussion / Living Room / Re: Friends: Brace yourselves for another economic turn. on: June 16, 2011, 10:19:39 AM
If you can sell otherwise civilized nations on the benefits of 'ethnic cleansing' for political or religious reasons, imagine how much easier it will be to get them to do it once those bloody "outsiders" are accused of "taking" the dominant tribe's food!

I can hear it now: "My fellow (insert collective name)! The time has come to make hard decisions and stand firm in a course of action. We do this, not by choice or out of malice, but to ensure the survival of our people. We do this not for ourselves. We do this for our children!" (Then comes a meaningful pause as the speaker closes his eyes, and appears to gather strength. He opens his eyes and looks directly at the somber crowd for a long poignant moment. Then, with a sad but resolved sigh, he raises his eyes towards the heavens.) "May god forigive us - and let history judge us." he intones. There is a silent moment before the cheering begins - and then grows louder.

Been practicing that speech have you? (hehe j/k)

Unfortunately, it wouldn't surprise me in the least to see that one on the news. I just wish at some point before it came to that folks would realize that the earth is all propagated up now - has been for a while actually - So it's time to back the hell off that little project before we start running out of stuff.
3168  Main Area and Open Discussion / Living Room / Re: More Copyright Nuttiness - 10 Strikes? Go to jail. Do not pass go... on: June 15, 2011, 10:43:06 PM
Going through a 3rd party would only result in them sending it to the same email address you could have in the first place, or possibly the wrong one, while the 3rd party gets some info about you and where to send the political spam in most cases. It won't give your message any extra power.

A simple no doesn't need "extra power", and as far as spam goes ... That's why I was/am inquiring about the site in questions reputability. Time is also a factor...


In fact, it would probably have a better chance of being read (and possibly responded to) if you sent it yourself. You will at least know it is going to the correct representative. (but don't count on the congressman himself doing it...probably will be handled by one of his aides.)


Given that most of congress is to busy, drunk, or stupid to use Email (or most technologies (Twitter...) properly)...It will assuredly be handled by an aid of some kind. In which case critical thinking skills are best left out of the requirements list. Better to repeatedly flash the same (exact) message in front of them for the purpose of it hopefully eventually sinking in. Just like training a dog; somewhere between to 1st and 5,000th time a command is repeated they catch on ... Trying to reason with them ($$$$$$$$) is simply foolish.

This is a big part of why dictators of old had to be lashed to a post and then set on fire before they realized that the people weren't "happy" with them (e.g. Not everybody likes cake.).


If everyone handles it themselves, then all of congress will receive messages from the citizens they represent, rather than a single congressman or some general info email address that nobody pays attention to.

If everyone handles it themselves, there will be a bunch of different messages, worded a bunch of different was, many of which will detract from or completely obscure the point. And if the site in question has the address wrong, or is failing to send said message to all of the necessary/relevant parties... Well, that would be a part of the reputation thing I was inquiring about.
3169  Main Area and Open Discussion / Living Room / Re: More Copyright Nuttiness - 10 Strikes? Go to jail. Do not pass go... on: June 15, 2011, 07:43:46 PM
...how safe is the signup to tell congress no bit on the top right of that page?? Do we know/trust the site well enough to all jump in and fire off a letter through it?

Good question. In this modern world, I'd expect someone to show up with a subpoena if you did.

This is actually of no concern, as I've made people regret finding me before... smiley


I don't think that was what Stoic Joker meant.

Quite Correct!

@Stoic Joker, if you are worried about going through that site to send a message to Congress, thinking you might end up spammed to death or something, then it's time to get familiar with who your representatives are and how to contact them. Info for where to send email, snail mail, phone calls shouldn't be too hard to find. It's considered public information. You don't need to use a 3rd party.

That distinction only dictates in what form and by whom you will be bothered going forward. Being that I run my own mail server, I've no problem blacklisting offenders. So I much prefer electronic communication whenever possible ... Assuming of course that the site in question is endorsed as being reputable by someone who's opinion I trust. Hence the question... smiley


Should that be something more like:

Do we know/trust Congress well enough?

 Grin  tongue

I trust congress about as far as I can throw the State of Florida.  cheesy

3170  Main Area and Open Discussion / Living Room / Re: Spam Viagra Operations (Harder to follow than I'd imagined) on: June 15, 2011, 07:10:26 PM
Scientist 2: "Nah, im gonna see how many peanuts i would need to shove up a pidgeons ass before it turns inside out"

Hahahaha!  Thmbsup
3171  Main Area and Open Discussion / Living Room / Re: Spam Viagra Operations (Harder to follow than I'd imagined) on: June 15, 2011, 11:34:25 AM
Um... Wow...40%?!? That's enough to make you want to vacation in Russia with a laptop mail server.

I wonder if the counterfeit Viagra is more or less potent - Do you call a doctor if it lasts more than 2 -or- 9 hours?

 undecided
3172  Main Area and Open Discussion / Living Room / Re: More Copyright Nuttiness - 10 Strikes? Go to jail. Do not pass go... on: June 15, 2011, 06:46:33 AM
Yeah... the lobbyists are at it again...

http://act.demandprogress.org/sign/ten_strikes/

Okay, sounds like a call to action... But, how safe is the signup to tell congress no bit on the top right of that page?? Do we know/trust the site well enough to all jump in and fire off a letter through it?
3173  Main Area and Open Discussion / General Software Discussion / Re: Avira - chases Uniblue affiliate scareware $ on: June 15, 2011, 06:34:33 AM
Thanks for the heads up. I have a half dozen clients that use Avira. I guess I can expect calls sooner or later because of some of this. Wonder if it affects the paid versions or is exclusively limited to the freebie.

Skimming the threads posted above it looks like they are doing a partnered push of the crapware across the board.


Makes me more convinced than ever if you want (or need) to use a free antivirus/antimalware product, your best bet is still Mucrosoft Security Essentials.  Thmbsup

(MSE) It ain't perfect, but at least it doesn't add to the problem. I'm stickin' with it too!
3174  Main Area and Open Discussion / Living Room / Re: Why ebooks are bad for you on: June 14, 2011, 07:26:10 PM
Gas prices, unemployment, inflation, and the simple fact there really hasn't been a real flood of truly great bands in the last decade have a hell of a lot more to do with declining sales that piracy ever did or will.

I can't agree. Do you know anyone under 30 who pays for recorded music? I don't. But they listen to music all the time. They love music. They just won't pay for it. They don't think it's in any way wrong not to buy it. They think "old people" are odd because they pay for music. But at least musicians can earn a living from live performance. That's the deal now. The money is spent at the gigs and festivals. No one pays for the recorded stuff. Except us old people.

I think that is an unfair generalization that reflects quite badly on the angst of youth. My son, and many of his friends, spent a good deal of their income on music. They also pirated some of the rest. All in all however I'd say they bought considerably more of their music collection then I did at their age back-in-the-day. Because back then I knew, and then was the guy with a dual cassette deck.

The thieving children boogieman is nothing more that RIAA propaganda trying to candlelight people into surrendering more of their rights in the name of "Protecting the Author's IP Rights. ...Which of course they haven't ever given two shits about.

Apple is making a boatload of cash with the iStore ... Do you really think it all only and just from people over 30?? That's not really a good demographic for getting fads started now is it? No the kids today have got money, and now that drugs are out of fashion, they spend most of it on media based entertainment.
3175  Main Area and Open Discussion / Living Room / Re: Backup Strategy: "The Threes" on: June 14, 2011, 06:27:02 PM
What? ...You don't think it's funny how they do that??

Damn spell check caught me napping ...So I decided to leave it and see how it took me to get nailed.

Can't you make it more effective by applying brute farce?

Brut?!? ...I thought you were an Old Spice man!

Hay, you reckon the Cologne would to cover the fact that you shit your pants when the array crashes long enough for you to make it to an exit?
Pages: Prev 1 ... 122 123 124 125 126 [127] 128 129 130 131 132 ... 213 Next
DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.123s | Server load: 0.14 ]


Share on Facebook
submit to reddit