Skip to main content

Posts

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...

Free Event and Contact Management

Guide to Contact and Event Management Introduction This guide concentrates on two free internet products, which allow you to manage you contacts (using Google’s Contact system under GMAIL) and how to manage an invite system for you Events that appears to work with a large numbers of contacts, unlike the Goggle calendar.This is not a manual on how to use these products, merely a guide on what to do Google / Gmail contacts You need to log into to Gmail (www.gmail.com), you can use your existing email address, or create an account. Using the current product that you have get the contacts into a format that resembles a CSV file, follow the Google guide lines, and you will get great results. Note that it allows only one contact per email address, so make sure you have no duplicates. Once you have got you Contacts in the recommended format the in Gmail. Then: click on Contacts click Import I would recommend you import it into a new group, for ease of access next time It will then import, and...

More Things I have Learnt today 22 Feb 2009

Firstly let me state that I am an old school DOS and Mac programmer that is trying to learn these new school languages that seem to do eveything for you in some way as long as you know how. Since doing websites I always wondered if there was a way to do a website site it has a header, left, right and bottom. With ASPX there is a way. Using a master page Essentially design your page and where you want the body stuff then you add a content place holder there <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> Then in the data page add the MasterPageFile=" into the header I had been using include files now I will have to re-do my code Another thing I learnt is that there is a code library dumped in AppData, for ASPX and it MUST be in the root of the website, other wise it does not work

Things I have learnt to day 22 Feb 2009

That in the web.config file there is a line that tell the website where to find the SQL server. This line is  <add name="OnlineOrderSystemConnectionString" connectionstring="Data Source=SERVERXXXXX;Initial Catalog=DBXXXX;User ID=SAXXX;Password=PASSXXX" providername="System.Data.SqlClient"> now the serverXXXX can be the server name or I also learn just "." the catolog I belive is the database user and password are the use and password for the database This a learn since we were getting an error using a website something like this ASP.NET to identify an incoming user.  Line 28: --> Line 29: <authentication mode="Windows which was caused by there being two web.config files for one site

News – News - News?

Today I heard that another 24 hours news station is going to be opening. What is this obsession we have with other people’s news? Are news channels the ultimate gossip chain, no longer do we have to rely on the grape vine of disrupted fact, now we have people who can report form the scene. But what has happened to the real news, the news that is of significance for more than a day to two or at best a week. When was the last time you saw an item on the news that was taking the world forward. Solving a real problem, preventing multiple deaths of fauna, floral or people (I think we are fauna). Take global warming, the green movement or save the planet for example, who is doing anything besides producing documentaries and movies. When was the last time you heard about even a celeb installing solar power for their house, or how a real person actually did something to save the world on a news channel? And when was the last time anyone took action because of news? The biggest effect this news...