C’mon beneath the bottles and cans there is a lot of work going on.
Quick and Dirty Stripping
Quick and dirty way to strip characters from a NS(Mutable)String
-(NSString *)SanitizeString:(NSString *)input
{
NSCharacterSet *charactersToRemove =
[ NSCharacterSet characterSetWithCharactersInString:@"$,+" ];
NSString *trimmedReplacement =
[[ input componentsSeparatedByCharactersInSet:charactersToRemove ]
componentsJoinedByString:@"" ];
return trimmedReplacement;
}
Call it like this
[self SanitizeString:MyNastyString];
You can add or remove the characters you want to strip by modifying the @”$,+” string. Or if you want to remove all BUT the characters you can use the invertedSet modifier.
Damn GPT Protected Partition…
From Wikipedia…
As of 2010, most current OSs support GPT, although some (including Mac OS X and Windows) only support it on systems with EFI firmware.
Usually you will run into this when you use a disk that has been formatted on a *nix system and try to mount it under windows. You will notice in Disk Management that it will be labeled “GPT Protected Partition” and be unreadable and even unmountable.
If you don’t care about the data on the drive you can use the “clean” command in the windows “diskpart” program.
- Type in “diskpart” on a command line.
- Then do a “list disk” to identify the disk you want to work with.
- Then “select disk x” (in my case it was “select disk 1″).
- Finally bust out with then “clean” command.
- Head back to Disk Management, and find the now “unallocated” disk. Right click on disk info, select “Initialize Disk”.
What this will do is zero out sectors that are part of the MBR or GPT partition map. Oh yeah all data will be lost… Did I forget to mention that? Your disk will now be mountable and usable in both *nix and Windows systems.
Exchange 2010 OWA login issue (reason=0)
Anyone ever get this?
https://exchange.jasoniscool.com/owa/auth/logon.aspx?url=https://exchange.jasoniscool.com/owa/&reason=0
And end up with a blank browser?
Yeah….. It seems that even when you follow the instructions step by step for exchange2010 you still have to do some manual steps to make the damn thing to work!!! Or at least in my case I did. Here is what I had to do.
After installing exchange from the CD, open up a PowerShell and…
[sourcecode language="objc"]
Import-Module ServerManager[/sourcecode]
Press enter and then…
[sourcecode language="objc"]Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,RPC-Over-HTTP-Proxy -Restart[/sourcecode]
And BOOM!! OWA is working now. Whether it was an oversight or screw up in the installer. I don’t know and really don’t give a shit. After 2 re-installs I’m just glad it wasn’t something i was doing wrong.
Simple Facebook feed view for iOS
Here is a simple feed viewer for facebook that seems to work pretty well. There are still a few areas that need some attention as far as error handling and memory management goes but this should give you a pretty good idea as to what I’m going for.
Auto Scrolling a UIScrollview.
I have a project that I currently am working on that called for a “ticker” type scrollview. I wanted it not to loop and loop but to reach the end and the go in reverse, this is what I have came up with after tearing thru many other peoples ideas and code.
float w;
w = 1;
[NSTimer scheduledTimerWithTimeInterval:.025 target:self selector:@selector(scrollThatThing) userInfo:nil repeats:YES];
-(void)scrollThatThing {
CGPoint scrollPoint = MyScrollView.contentOffset;
scrollPoint.x= scrollPoint.x+w;
if(scrollPoint.x >= MyScrollView.contentSize.width -(MyScrollView.frame.size.width -100) || scrollPoint.x <= -MyScrollView.frame.size.width +924)
{
w *= -1;
}
[MyScrollView setContentOffset:scrollPoint animated:NO];
}
Pretty Simple. A timer fires off 40 times a second and scoots the scrollview over 1 px. this makes for a fairly nice and smooth motion. there are a few “buffers” that allow it to “over-scroll” so there in a little time to see the last item instead of just changing direction right when the far edge is reached.
My sprinklers don’t work!!
Well they haven’t since I moved in. And well… It’s Saturday, the girl is at work so I guess there is nothing better to do than quickly do my few chores and geek out a bit.
The old sprinkler timer was a mess and with my “home brew is the best” frame of mind I decided to not do the normal thing most level headed people would do…
Ya see, I’m not normal.
Example…
Normal person: look online to find the guide to program the existing sprinkler timer. Program the timer and drink a beer.
Me: Take apart the timer throw away the logic board (drink a beer) and try to hook up a spare arduino to the left over control / relay circuitry (drink another beer). Burn fingers with soldering iron (and try to cool them off with a cold beer bottle).
Read more
Kicking it ol’ school.. well as far as the interface goes.
I recently just received my Freeduino V2 Serial kit from NKC Electronics. First off I must say that i’m soo freekin happy with how quickly i received it!! NKC Rocks!! The kit came with everything needed, aside from solder and burnt fingers… I provided those. Yeah I know, you are all like “Serial?? WTF??”. Well you can all goto hell with your FTDI based boards!! I wanted to save the $4.00!!
ok, I’m sorry about that..
anywhoooo… I got right to soldering this bad boy up. As soon as it is done I can get to writing the communication sketch for it to talk to my other Arduino. Plans are to have relays driven from the digital pins and a temp sensor or two in the analog pins.




