Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Allan Thomas

@Allan Thomas
About
Posts
17
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQL Server Environments - How far back do you test?
    A Allan Thomas

    This is the code I found ages ago to check the compatability level for the databases (good old 80 compatability messed a few things up for some reports I was doing) and if your using stored procedures for a login/access check this could be part of the result where your front end checks the data and goes 100 is the minimum compatability required for the successful running of this application, so if it breaks it's your fault (technically 100 is SQL 2008 but at least it's not SQL 2000). Unfortunately this doesn't seem to be widely know (or checked for) since where I work we use a few different programs that I'm involved in and once I had set the compatability level to 80 on the wrong database (on my machine for testing) otherwise another program would behave really weirdly. The front end software suddenly broke the next day but nothing was coming up that there was anything incorrect with the system and configuration, which took about 30 minutes to track down all the stuff I had changed in the last few days.

    SELECT compatibility_level
    FROM sys.databases
    WHERE name = DB_NAME()

    The Lounge database sql-server sysadmin sales help

  • I've actually found something Edge does better than Chrome.
    A Allan Thomas

    I use this all the time for my non-DRM ebooks and pin the current book I'm reading to the start menu. But the only annoying thing is it doesn't show the cover on the start menu :( (which makes trying to work out if the pinned book is the current one I'm reading or not annoying) while explorer shows the cover when it's displaying files as tiles just fine.

    The Lounge com learning

  • I've actually found something Edge does better than Chrome.
    A Allan Thomas

    I use that all the time (with my non-DRM ebooks) and the fun thing with MS is you can pin the web page to your start menu so you have your current book on the start menu but it doesn't show the cover

    The Lounge com learning

  • nULL OR nOT?
    A Allan Thomas

    Here, Here. You should always allow nulls unless you logical reasons backed up by specifications and have default values backed up by processes to ensure nothing goes wrong. The example about the sell price defaulting to zero is a great example of where it will bite you in the butt. I can understand you ask for a full name and no middle name was given so in a database containing a first, middle and last name there is a blank middle name. I see someone saying you shouldn't allow nulls in an address field because the person in the database has an address but it isn't known yet. But what if you have a job seeker database and have homeless people sign up? Also if you suspect the person has an address but don't know it then it is an UNKNOWN address which a null value represents which code can identify and prompt someone to get the information. So unless you know everything you are always going to have some sort of null value in a database somewhere and instead of trying to pretend you know everything (and cause more hassles for everyone else) leave it null. One database I know of uses 2019 as a default date for some records so if I want to look for data entry errors in the date field I have to start filtering out other records because they have not been completed yet.

    The Lounge wpf csharp database com sales

  • Reputation graph is 'slightly off'
    A Allan Thomas

    Nothing major but I was just looking at a the reputation graph for ryanb31[^] with a negative score for debating. Acording to the profile he has a total of 390 points but the orange line shows about 1100.

    Site Bugs / Suggestions com data-structures tools question

  • Another new record.
    A Allan Thomas

    It's now 45,986 but it was 355,462 online about 10 minutes ago. Does this count as a record or did lots of people leave :laugh:.

    The Lounge question

  • Office Communicator
    A Allan Thomas

    Communicator has a federation ability to connect office communicator across multiple sites (i.e. multiple DNS records). To do this you need a server that is publically accessable with the appropriate OCS service running (I hear it was a pain for the tech to work out the appropriate certificates that needed to be installed on the right servers to get it working). Once that is done you enter their email address and wait for them to add you to their list. You can also add hotmail/live email addresses to the list using this interesting formula my.email(domain.com)@msn.com (my.email@domain.com).

    The Lounge tutorial question

  • Simply not Normalisation Cricket.
    A Allan Thomas

    While I agree that the database design is less than optimal point number 2 might actually be a good database design (despite who implemented it). There are a lot of times that information is duplicated in other records because it's that important for the smooth running of the system. Lets take the number enrolled students and consider what happens if someone removes one student from the database. First if you were just counting the number of records then anyone accessing the records would have the results change on them and if you are running KPI's or any sort of reporting function over this information it will lead to inconsistant information from the system (i.e. you print a report last week and it says x students attended exams and this week it says y you then go WTF). Secondly from an auditing point of view there are probably legal or regulation requirements on keeping track of the number of students attending exams (assuming the processes keep that information up to date) and once that information is entered it's locked. A great example is tax. Would you like it if the tax that gets taken out of your pay to be a calculated value? 'Hey Keith I know you did a bit of overtime this week so your tax rate went up, oh and by the way you won't get paid next week because the tax department says you have an outstanding amout that you owe them.'. The last reason is if there are two fields that are supposed to hold the same information but don't then people will start asking a lot of questions. Since this will occur immediately after a process has failed you have the ability to trace the issue while people can still remember what they have been doing recently. Trying to track down a problem way, way after the time it has occured it a real pain in the butt. PS: I feel your pain but I've had to 'upgrade' a few critical systems built in access where code for directly changing the database was embedded in each form and if there was two processes for entering information then there was two different forms with the code copied and pasted. Trying to reduce it to one logical process was interesting since there were a lot of if statements with multiple places where it reads and writes to the database was ..... interesting.

    The Weird and The Wonderful design csharp database com

  • Another GoTo Hell
    A Allan Thomas

    Pfft. That's nothing I'm currently 'fixing' an email service in c# that was somewhat similar except the person who coded it was doing logical checks before data checks. They were checking a from address (in a nice if tree) to determine how it fit into the system and then checking the content of the email (the same code used multiple times). Then to top that off there were goto statements so after certain sections of testing was completed then move on to the next 'step'. This also has no comments, documentation, etc so I'm having a fun time refactoring it.

    The Weird and The Wonderful security help announcement career

  • Needed a series of random numbers
    A Allan Thomas

    That was my first thought when I saw the post. The only difference is that he needs to roll the dice 9 times :laugh:.

    The Weird and The Wonderful lounge workspace

  • Commenting code...
    A Allan Thomas

    Considering that your boss asked you to write something up (who should have some knowledge of coding) and you gave him a one liner to get what he wanted working and couldn't understand that really does raise questions about his compentency. But there are two things you can learn from this. First you said that it's the default microsoft functionality (for the dot net framework I'm assuming you are saying here) which is really good but what if the person hasn't programmed using the dot net framework or didn't even know that function existed. I self teach myself a lot of stuff but unless you get training covering every functionality of each object model you can't know everything that's 'default' unless you have heard of it. You can't know that your boss knows about it and even if he did how does he know your extending the functionality or writing something totally seperate. Secondly not all people are good at reading things and having a code comment explaining the end result of the function call is a good idea especially with a single word like select is used to execute an action (i.e. select an open form, closed form, some magical form, some specific class form). My boss recently asked me to extend functionality on an existing system and then said that I had to use a specific table despite the fact I started designin it using a new table. Over the weekend I went through the system to see the impact of using that table instead of creating another one specifically designed for the purpose. I then sent an email with a list of what was needed to do to get either option working (i.e. change this, do that, etc). When I went into the office he said to see him because he didn't understand the email and after spending a bit of time talking and drawing on a whiteboard he got the idea and went yeah I can see your point and create a new table for it for now. Had I given him a few screen shots and some pictures with a few explinations it he would have been able to understand what I was saying easier. P.S. Also intellisense isn't everywhere. If you, oh I don't know, say paste the code on the web where is my intellisense :-D? I suppose it's a good think we install spell checking on our whiteboards to make sure we find typos when people write things down :laugh:.

    The Weird and The Wonderful visual-studio com debugging question

  • Windows 8: Pushing hated UI elements
    A Allan Thomas

    This is the only thing that really annoys me about the way microsoft operates. There is one little feature from microsoft labs that can solve this delemma http://www.officelabs.com/projects/searchcommands/Pages/default.aspxwhich I found when I first started using office 2007 and had trouble finding a few buttons. All I did was a quick search on google and found the plugin but for some reason people don't seem to be interesting in doing a bit of research to see if this problem has been solved. When searching for a command it will list the top 10 results where the user can click it straight away to fire the action or hover over the result to find it normally. Another plugin I like is the save as PDF/XPF which is also free but not intergrated with the office suite for some reason. Personally I love the ribbon and in terms of customising it's second to none. I've developed a few small plugins and being able to extend the microsoft default ribbon tabs or adding your own personal ribbon tab is excellent. One client wanted to insert their electronic signatures so I literally extended the insert tab to add an extra section which had one button called add signature. From a training point of view telling a user to click insert and then click add signature is logical and easy. If we still had those stupid tool bars then you have to make sure the user has the toolbar activated, then find where the toolbar has been moved to (incase it's being hidden behind another toolbar, etc) then click the button just to get one image showing (it would probably be easier to do keyboard shortcuts to open the insert picture command).

    The Lounge com design question

  • Online Software Purchases
    A Allan Thomas

    I suspect that there is an Australian division in Microsoft which is making this money from the sales of the MSDN and probably registered on the Australian stock exchange (which would require an Australian registered company). The real annoying thing about this is that since Australia/New Zealand population is very small and the companies have their overheads we have a tendency to pay more for the same product from overseas. Unfortunately this is the direction larger online services seem to be taking which probably helps isolate the risk but it means that us as customers have price difference (basically a tax) because the other overseas division is not legally allowed to sell the same product at their price. I know AVG and paypal have ‘recently’ started an Australian version of their websites but where it will end who knows. One really bad case I was made aware of was a kitchenaid mixer which could be bought from amazon.com with an adaptor so the American product can use the Australian power supply was about $350 all up (including shipping) but in Australia I think it was on special for about $700 online (don't know about shipping). This issue has been around in the book/ebook market for ages because whoever has the rights to the product are then making contracts with the different regions at the most money they can but then making it really annoying for customers. And because Australia is classed as its own region so when the local printing companies make the book we end up paying about double the price because of the low population purchasing that particular product. If it was just limited to the print versions of the book I could sort of understand but it’s the same with the eBooks. I find that most major ebook sites (US) have most of the titles I want to buy marked as geographically restricted to the US (despite the fact I can buy other books without issues). This means I then have to go through the local book websites to find who has the rights to sell it to Australian customers (at an increased price for the same stupid product) and makes keeping track of who has what quite annoying (and don't get me started on the ebook formats). :mad:

    The Lounge com sales collaboration question

  • Every line makes me die a little more...
    A Allan Thomas

    How about a 13 month KPI that has code that has logic to work out the summary values to be displayed for each month, storing values used elsewhere in seperate variables (not an array) and then having that code duplicated 13 times (with a slight change in variables/controls). It would have been at least 10 pages and all embedded in the click event of the button :( . After checking the code to see if anything else was buried in there I refactored this (with the help of a few functions) into two loops with about a dozen lines total. It helped because a bit later I found two other places where the same thing happened and while the code was different I was able to copy and paste the code and update the loop for the different KPI's.

    The Weird and The Wonderful

  • Redundancy Peaking
    A Allan Thomas

    Unfortunately this is the biggest issue I have about vb. It's too easy to be deep in thought and literally code what you are thinking and make the code more annoying to read. i.e. If control x visible property is true then do this and this and this. I usually pick it up after I have written it and clean it up afterwards but sometimes I've come across code a few months later and go whoops. Hopefully the compiler is smart enough to fix the extra redundancy I've added so it doesn't effect performance.

    The Weird and The Wonderful question

  • Question For Our Local Visual Studio Apologist
    A Allan Thomas

    It's all about the .sln file, that contains the list of 'active' files in the website, last open files and if you use vss also the checked in/out files. If you have created a web site but use the open web site option to open the 'project' it isn't loading a .sln file (with your last opened items) but just opening the directory that contains the website in the solution explorer. I had this problem when I had another developer give me a zipped website and took a few shots to get the .sln file and have it appear in the recent project list.

    The Lounge csharp visual-studio question

  • Rnd() values are changing everytime in ASP.NET
    A Allan Thomas

    You could just open the page and scroll all the way to the bottom. For some reason the always leave the answers down the bottom so I don't have to pay a cent :laugh: .

    The Lounge csharp c++ html asp-net com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups