Skip to main content

Posts

Showing posts from March, 2009

Category: Development, C#, Things I want to remember

I find it frustrating how hard it B to remember all these syntaxes, when all you want to do is add some quick code into your html. So here is how you add some code into your HTML aspx file <script>  does not work but <% ...%&gt does. And here is some code which identifies the current page, path and strips them into separate parts: <%   string sPath = Request.ServerVariables["PATH_INFO"]; string sPage; string sWebPath;      //-- Before capitlaizing get the path from the string sWebPath = sPath; //-- Capitalize for easy searching sPath = sPath.ToUpper(); //-- Find the page name sPage = sPath.Remove(0,sPath.LastIndexOf("/")+1); //-- Find the webpath sWebPath = sWebPath.Remove(sPath.IndexOf(sPage)); if (sPath.Contains("DEFAULT.ASPX")){     Response.Write("do something on the home page"); } else {     Response.Write("do something on the other pages"); } %> Reference site worth a vi

Things I lerant to day about...

Provisional Tax I found out today what a provisional ax pay. If you understand the name then it makes sense. A provisional tax payer is someone who pre pays their tax, after estimating how much they will earn. The way the pre-pay just like a PAYE tax payer pre pays, but the employee pre-pays for them. A provisional tax payer still has to do a tax return, where they can do the normal deductions etc, and then get a credit for their tax. In fact SARS will pay interest on the moneys that were pre-taxed. If you have your own business then any reasonable item that can be associated to the cost of running that business can be a legitamate company expense. So Cell phone, internet connectivity, insurance for company items etc can be claimed. But Rates cannot since the business does not owne the premises, but electricity can A cool site I also found a cools site videojug . That can give you instructions on doing things. It is not as comprehensive as wiki but it is quite good

Rechargable batteries

How to re Rechargeable batteries Intro I may be no scientific expert but this is a summary of what I have learnt about rechargeable batteries in laptops and cell phones etc First use The first time you use a device that has a rechargeable battery make sure you charge it all the way to 100%, and even then if the device tells you it is full charge it for 8 hours at least, and 24 hours is even better Regular use When using the device makes sure that it is used up until it has fully discharged at least once every third time. If you charge when it is not flat over and over again it will develop a "memory" and start having less and less battery life. Extended Life If you want to extend the life, then make sure it goes completely flat every time and charge it fully every time and this will extend the life. I have also heard a myth (not proven) that placing the battery in the freezer once in a while helps. Irregular Charging if you a phone or laptop on charge for too long between run