Friday, April 23, 2010

Do No Evil

If you haven't notice yet, I'm a huge fan of Google.

What started as simply respect for a search engine that did not clutter their main page, has evolved over time.

That was the original reason I used them for search. Every now and then someone's browser is defaulted to Bing or Yahoo, and I realize the other reason. Out of laziness I'll type a search, and find nothing in the results I was looking for. I'll type it in Google, and lo and behold, what I was looking for on the first page.

I never used Google for anything else until I got invited to Google Voice. Since then though, I have converted to them for everything.

Working at a company like Google would be a dream job. 20% of your time you can work on pet projects? SIGN ME UP! Unfortunately I don't have the language sets required. I am a .NET programmer, (and I love the .NET framework for many reasons). Sure Java is similar, but I honestly have personal preferences that Java does not implement and .NET does, so I stuck with .NET. That and my low level C/C++ skills are lacking. I've also never learned Python. Three main languages I've seen on Google's job postings.

Anyways, Google sets itself up as an idealistic company with ethics. A rarity I've noticed, as ethical motives often conflict with profit based motives. If it didn't, we wouldn't have all the labor laws, and customer protection regulations.

So, recently, Google backed out of China over censorship. There are many viewpoints on why. Here is a short list:

1. One being they pulled out because profits weren't worth the effort on censorship.

2. Revenge for hacking their servers.

3. Guilt from straying from "Do No Evil".

Honestly I believe it's a healthy mix of all. Number 3 was their primary reason for wanting to. 1 and 2 was justification to investors and executives with more profit motives.

Now I read about a new twist of events. YouTube has a thing called ContentID. It automates take downs of copyright infringing material. Any content creator can submit a DMCA take down notice to YouTube to have any video removed as well.

The problem has been, in the past, most ISPs/Web Hosts/Streaming Video companies will remove your content, and you have to e-mail them and deal with a whole bunch of legal crap, to have it put back up. Even if it was legitimate fair use!

Over past few days as I've gathered (didn't follow the story very well), a whole bunch of parodies of some movie about Hitler (called Downfall I think), showed up on YouTube.

Thanks to DMCA and over zealous take down notices/ContentID, most of them were removed. They are obvious parodies. One was even a parody of this whole situation. It got taken down.

Google's response? Add a button specifically for "Fair Use", so that when your video gets taken down, click the button, and your video gets put back up. (Content providers like YouTube only have to take it down if requested. If original uploader says it's fair use, they can put it back up pending court case).

As someone commented in this article: Google adds fair use defense to YouTube takedowns - Boing Boing

Google essentially added a "So Sue Me!" button.

If over zealous content creators want to DMCA take down fair use in a massive fashion without paying any attention to fair use, the people doing fair use can immediately put it back up without repercussion. If these companies decide to sue these people over obvious fair use... I will be very entertained.

Monday, October 19, 2009

Landlord Shenanigans Part 4

Well, it was approaching the 28th, Amanda and I were putting the odds at 50/50 the landlords wouldn't even show up to court.

They never filed any eviction papers either, so even though they gave us a notice, it was never enforced. My assumption is they knew they had no case and were just trying to scare us.

Anyways, I'm not one to be scared when I know what I'm doing.

So Amanda and I make our way to the court house, we arrive 15 minutes early, and wait and look for them.

No one we recognized showed up, but there were about 30 other people there, and probably that many other cases too!

About 10 cases were won by default judgement because someone failed to show before they even called my name.

"Plaintiff present"..."Is anyone here from Houses for Rent of OKC?"....no answer...he calls me up to show any evidence I may have, and I show him the eviction notice, the receipt, and I think the fact I was holding three folders of evidence, he entered default judgement in my favor in the amount of $1363 ($1300 sued for and court cost).

After all cases were called for attendance, we were allowed to leave. Once we left, we went to pay rent.

Of course they told us "Good luck garnishing".

So today I'm going to a collections attorney (who happens to be across the street from where I work) to have him draft the paperwork for garnishment in the form of a Till Tap.

For anyone that doesn't know what that is, we go up to their place of business with a Sheriff, and the Sheriff collects cash on the premises to pay us our judgement.

We're going on the 2nd of the month (1st is a Sunday). Basically we pay our rent, and the sheriff will take back that money, and the rest of the money we need from their till/cash drawers and give it to us. And since they are a cash or money order only company, and have plenty of tenants paying hundreds of dollars in rent, they will have it.

I love the legal system.

Oh, and for anyone looking for a collections attorney in Oklahoma City, check out Eliot R. Feiler, PC. Or if you live elsewhere, www.narca.org

Thursday, October 8, 2009

Inefficiencies of the TreeView

The primary application of my employer was suffering some slowness. And by slow, I mean 30 seconds to 2 minutes to load some forms.

He had one of his consultant friends pinpoint the bottlenecks in the application, and tasked me with fixing the issue.

While going through the program using a profiler (EQATEC Profiler by the way, is free and -very- useful for this), I noticed something interesting.

First off, the forms relied on Microsoft's TreeView control. Since we're using .NET 2.0 and don't have extensions, they originally created an ExtendedTreeNode which contained a Key property and looped through the tree's nodes looking for one with a given key to find the parent node to add a child too.

I was kinda shocked that TreeView wouldn't have a key based lookup, so first thing I did was research the control.

I found that it did indeed have a key based lookup, however since TreeView.Nodes[int] was an index based lookup, the implemented the key based lookup as TreeView.Nodes[string]. Doing this, they renamed the pretty standard "Key" property to "Name" and made it a string.

So first thing I did was change the process of finding the parent node from a for each key comparison, to a node lookup by name.

While this marginally improved performance, it still took very long. Long as in 20 seconds to add all the child nodes based for some 3800 parent nodes.

Despite this, I had other things to work on.

Then, the week before release of the update, I realized something. Perhaps the lookup time being so long was due to an inefficient lookup algorithim.

It was using strings to do the lookup, and the integer Id's had to be converted to a string before the lookup could even happen.

So I ran a test. I created a companion Dictionary<Int, OurDataClass> for the TreeViews.

Lo and behold, 20 seconds to place all the children objects under their parents went down to 55 milliseconds.

And nothing beats praises from the clients:

Have heard only positive comments today regarding the speed of the progress notes, and I know that opening the modules for me is much faster. Some people also really like the feature that shows the # of characters available in each field and the countdown as you type.



Thanks for your hard work.


Side note, the feature showing the # of characters available in the boxes, a user control I created to be added to all the text boxes needing it.

Feel good to be appreciated.

Tuesday, September 1, 2009

Landlord Shenanigans Part 3

Oh the hilarity.

So, when we went to them on the 19th, they told us (on voice recording) that we can only deduct up to $100. I knew this, I researched the law.

They received service of the small claims suit Thursday or Friday, so imagine my (lack of) surprise that the AC got fixed today, September 1st.

Anyways, we go up there today, voice recorder in hand unknown to them, to pay rent of $395 (rent of $495 deduct $100 for -two- Window AC units we bought. One for $80 in Wanette, a city east of Purcell, and one for $20 from our nice neighbor.)

And as expected, Landlord does something stupid. Says she is not "allowing" us to deduct it, and hands us an eviction notice for refusing to pay the full rent of $495. We get a receipt for our payment of $395 (I'm not about to have non-payment count against us, just because they want to be an ass), with a "remaining balance" of $175, for "late fees".

So, looks like we'll get to go to court sooner than September 28th!

Eviction small claims court has an 8 day waiting period, rather than a month waiting period like all other small claims.

I do hope it's Judge Glenn Jones.

Tuesday, August 25, 2009

Landlord Shenanigans Part 2

So, still no Air Conditioning.

We called housing inspector out, who found -several- housing code violations, took lots of photographs and filed a report.

We went up to our landlord and put in a notice that we were deducting $100 from next month's rent for the Window AC unit we bought, and our demand for a refund for the fair rental value for the previous 3 months with a broken AC. I deducted $100 per month, making a total of $300.

Their response? "You can deduct the $100 but we don't recommend it because the AC will be fixed in a few days." (told to us on the 19th, AC still not fixed) and yesterday in reference to the $300 refund "That's illegal, we're now shutting off your gas."

No big deal about the gas, was supposed to be in our name to begin with, however I find it quite humorous they are trying to retaliate against someone threatening a lawsuit.

So this morning I headed up to the county clerks office to file a small claim suit against them for the amount of $1300. $300 for the refund of fair rental value, and $1000 in punitive for the housing violations they have not fixed (including some they were cited for back in November), and their threat to turn off our gas which could constitute as an illegal lockout/shutoff (allowable damages up to 2 months worth of rent, or in our case, $1000).

Icing on the cake? The house we live in was given a provisional certificat of occupancy good for 60 days pending the fixing of housing code violations found in November.

Punishment for allowing people to live in property without a certificate of occupancy? $750 fine or 60 days in jail -per day-. Provisional certificate of occupancy expired on January 19th, so that would be $163,500 fine or ~36 years in jail as of today if I understand the law correctly.

That and our judge is Judge Glenn Jones, who has given speeches about landlord tenant laws, so I am assuming he will know what is and is not illegal; since they seem to know already.

Evidence:

Copy of report and photographs from Del City Housing Inspection, calling our house a health and fire hazard, with numerous code violations, some of which were cited in November and still have not been fixed.

Copy of receipts of payment to the landlord (in case they try and say we owe them money)

Copy of the lease (which also mentions we are responsible for their court costs, which is illegal in oklahoma statutes according to Title 41 Section 113 Subsection A.3 if my understanding is correct.)

Voice recording of property manager saying they will fix the broken back door lock and send an electrician out within 1 day for the laundry room dated August 19th, and suggesting we don't get the Window AC unit because it will be fixed shortly, and that us requesting a refund is "wrong and possibly illegal".

Copy of the certified letter I posted in my previous blog, along with the certified letter signature card.

Copy of the demand letter given to them in person (and while being voice recorded) on the 19th.

Will also be bringing with me notes of the laws I'm citing, and the laws recording voice recordings only requiring one party's knowledge unless a conversation has the understanding it would be a private one. Which I see no reason that would have been a "private" conversation.

Wish me luck, court date is September 28th, at 9 AM.

Monday, August 10, 2009

Landlord Shenanigans

Amanda and I moved into a rental home around November/December. It was right next door to her best friend Michelle, it had a car port, it had a backyard, and it was big enough to have our own bed rooms and a computer room.

Everything seemed great, that is, until we started having to deal with the landlords for necessary repairs.

For future reference, always check the BBB before you make a large financial committment. Had we done so, Houses for Rent of OKC's F rating and complaints about repairs never getting done (also found on review sites) would probably have warned us what was in store.

Anyways, I'll start from day 1. When we moved in, the deadbolt on the front door was missing. Missing as in there was a hole big enough to almost put your hand through. It was winter, and being winter, it was cold. We had the heater on and the heat would escape through the door until Amanda put a shirt through it to help stave off this heat loss.

This took them until about January to fix.

Next issue, stove. We had no stove when we moved in. Big deal, we didn't have much to cook anyways. However apparently this is a housing violation and makes a residence unfit for habitation. We received the citation when the Del City inspectors inspected the home on December 1st, saying we had 30 days to correct the problem.

Luckily they never came out to check again, because we didn't get a stove from the landlord until March.

Now, summer is rolling around and Amanda notices the AC doesn't work. She goes up to the landlords office to pay rent on the 1st and tells them about this.

It takes them until June 26th to fix our AC, their excuse, they have 80 homes without AC and they are doing the best they can....

Then, when the guy gets to our house, he spends 15 minutes, blames it on the cats chewing up a wire, and leaves.

Whatever, it worked, we were happy.

Then it broke again on July 4th. We call, and they get pissy because the last guy blamed the animal. They take a week to finally send out the repair guy. This time however, it's a new one, he spends 2 hours working on it, replacing/fixing lots of stuff, says we need a new air compressor and that the previous repair man did a crappy job.

So much for the cats jumping 3 feet in the air to chew a wire behind the washer theory.

So we have AC working again, but now our dryer electrical system is starting to shoot off blue sparks occassionally, and sometimes stops working all together. The fix? Shut off breakers, wait a minute, turn back on.

We reported this to the landlords, and nothing has been done yet. FIRE HAZARD!?! Nothing done!? What the hell, not the mention the pain it is to do laundry when your dryer randomly goes out without you noticing.

Then to top it all off, a few weeks ago, the AC goes out -again-, and the back door knob decides to stop working (I had to tape the thing in the open position in order to be able to open the back door...)

So, I sent them a certified letter which they received on August 4th, and have spoken to the Del City planning board for a housing inspection which is being done today or tomorrow and am considering taking them to small claims court.

We'll see where this goes.


ATTN: Houses for Rent of OKC

This is a written notice to request the following items be repaired at the residence of:

(Removed)
Del City, OK 73115

Repairs Necessary:
1. Laundry Room electrical system. Blue sparks are firing off occassionally when the dryer is turned on. Occassionally dryer will cease to work until breakers are flipped off then on again. This is a fire hazard and must be fixed immediately.
2. Air Conditioning system, which we verbally informed you of on June 1st, 2009. Some time around June 26th, a repairman spent only 15 minutes to fix this, and it broke down on July 4th. A week later sometime around July 11th, a second repairman spent 2 hours fixing the AC and told us and you it needed a new air compressor and he would be back. As of July 27th, the AC was once again no longer working. As of writing this (August 3rd, 2009), the repairman has not come back to replace the air compressor, and we are without AC again.
3. Back door in laundry room fails to open and lock correctly and needs to be repaired. This is a safety issue and needs to be repaired immediately.
4. In November we verbally informed you of the brush pileup in the backyard which is a violation of Section 13-108 of the Del City Code of Ordinances. We also request this be removed.

In accordance to Section 121 of the Oklahoma Residential Landlord and Tenant Act, this is a written notice of noncompliance with Section 118 of the Oklahoma Residential Landlord and Tenant Act.

If these issues are not resolved within fourteen (14) days of receipt of this notice, further actions may be taken allowed by Section 121 of of the Oklahoma Residential Landlord and Tenant Act.

Tuesday, August 4, 2009

Acrobat 7 and Silent Printing...

So after spending the past 3 hours attempting to solve this issue, I found the solution in an obscure place after an obscure search in google.

For those of you wishing to silently and programmatically print a PDF file and you have Acrobat Reader 7 installed, here is the code you can use!

Hopefully I can save someone else 3 hours of googling.

In VB.NET
Function GetAcrobatPath() As String
Dim key As RegistryKey = Registry.ClassesRoot.OpenSubKey("AcroExch.FDFDoc\shell\open\command", False)
Dim keyText As String = CType(key.GetValue("", ""), String)
Dim keyTextParts As String = Split(keyText, """")

For i As Integer = 0 To keyTextParts.GetUpperBound(0)
If (File.Exists(keyTextParts(i)) And keyTextParts(i).EndsWith("exe")) Then
Return keyTextParts(o)
End If
Next

Return ""
End Function

Sub PrintPDF(ByVal filePath As String) As String
Dim acrobat As String = GetAcrobatPath()
Dim startInfo As New ProcessStartInfo(acrobat, "/p /h" + filePath)
Dim process As New Process()

startInfo.RedirectStandardOutput = True
startInfo.UseShellExecute = False
startInfo.WindowStyle = ProcessWindowStyle.Hidden

process.StartInfo = startInfo
process.Start()
process.StandardOutput.ReadToEnd()
process.Close()
process.Dispose()
End Sub

In C#

String GetAcrobatPath()
{
RegistryKey key = Registry.ClassesRoot.OpenSubKey("AcroExch.FDFDoc\\shell\\open\\command", False);

string keyText = key.GetValue("", "").ToString;
string[] keyTextParts = keyTextParts.Split('"');

foreach (string s in keyTextParts)
if (File.Exists(s) && s.EndsWith("exe")) return s;

return "";
}

Void PrintPDF(string filePath)
{
string acrobat = GetAcrobatPath();
ProcessStartInfo startInfo = new ProcessStartInfo(acrobat, "/p /h" + filePath);
Process process = new Process();

startInfo.RedirectStandardOutput = True;
startInfo.UseShellExecute = False;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;

process.StartInfo = startInfo;
process.Start();
process.StandardOutput.ReadToEnd();
process.Close();
process.Dispose();
}