Computer Magic
Software Design Just For You
 
 

Change for change sake - Console is now Admin for MSTSC

August 3rd, 2008

For those who use MSTSC (Remote Desktop Client), you may want to know that as of Vista Service pack 1, XP Service Pack 3, and Windows 2008, you need to replace the -console switch with -admin.

What does -console do?
Console is a parameter that you give to MSTSC to tell it to connect to the main desktop when logging into your server via remote desktop. It is very useful when you want to see the same desktop that you would see when you are sitting in front of the computer physically. I have used it repeatedly for years to ensure that I see the same apps that were open when I am away.

I get frustrated when technologies that are several years old are changed for no apparent reason. Switching to the -admin flag serves no real purpose but to force people to spend time googling for answers for problems that have been solved for years. Quit making arbitrary changes for the sake of making changes. There is no reason you have to constantly break things in the name of progress. If you have to reinvent the wheel again, at least use the same damn lug wrench. We computer professional who have to use your software are tired of watching things that used to work break.

Just so no one thinks I am just picking on Microsoft, switching to Linux doesn’t help. This is a geek wide issue, though MS has been especially bad the last few years.

Ruby Tutorial

June 26th, 2008

I found a crazy tutorial on the Ruby language. The guy is totally nuts, but the tutorial is quite good. Take a look at http://poignantguide.net/ruby/index.html

For those interested in writing Ruby, you might consider downloading the latest NetBeans IDE as it has Ruby support. You can get NetBeans at http://www.netbeans.org

Dynamically Loading Python Modules

May 30th, 2008

Python is a great language. One of the projects that I am using Python for is on a game server. The Python engine is embedded into a C++ server. One of the main advantages to this is that you can change the Python code without having to re-compile the C++ code.

An even bigger advantage is that Python code can be reloaded without even shutting the Python engine down. Python can reload changed code on the fly.

Python can load code in two different ways.
> Load a string
> Load a module

Loading a String
To load a string, you simply put your code into a string variable and tell Python to run it. In this way you can run a function or class declaration without actually having it execute (unless you place a call to it). This will cause the Python engine to replace the current definitions (if there are any) with the new code.

The Pros: This is very easy. We used this for a while. Our server stores the Python code in a database, so this was the easiest way to extract the code and load it into the Python engine. To reload the changes, you simply re-ran the same load code.

The Cons: This method will over write global variables in your code which began to cause some tricky bugs after a reload. Also, there is no way to UNLOAD the code. It is loaded into the global name space and therefore writing an unload function would be quite difficult. Lastly, because everything is loaded in the same name space, you end up with possible name conflicts.

Load a module
With this method, you tell python to load the module. The only problem is that Python likes to look to the file system for modules. This makes it impossible to load a module from a database. That is what this article is about. We had to override some of the functionality to get it to pull from our database. By doing so, we can now load modules from both the file system (e.g. built in modules) and the database.

The Pros: We can now put our code in one or more modules. The modules have their own name space and can be loaded and unloaded completely with ease. Since modules have their own name space, they don’t trash global variables in the main area. Most importantly, we can have our modules stored in a database. This is important as it allows us to keep all our changes and code in one spot and makes the install and backup easier and allows us to have multiple people work remotely through our custom GUI interface.

The Cons: Reloading on the fly always has the potential to introduce bugs. I am sure we will find more as we go.

The code
Here is the code I use. Note that there is a function called GetModuleCode() that loads the module. This is just a stub here, so replace its code with the code you need to load the module. If you have no problem loading from modules on the hard drive, you might consider just putting them in the Python folder and saving yourself the trouble.

компютри втора употреба
# ========================================================================
# Custom Module Loader
# ========================================================================
# Install the custom module loader, this loader can pull DB modules from the server
import __builtin__
bi = __builtin__.__import__ # Save old import function
import new
import sys
import StringIO

#module loader code references
# http://svn.python.org/projects/python/trunk/Lib/ihooks.py
# http://www.thescripts.com/forum/thread23917.html

# Redefine the __import__ function
# (self, name, globals=None, locals=None, fromlist=[]):
def __import__(name, *args):
# Has this module already been loaded? If so, move on
for mod in sys.modules.keys():
if (mod == name):
# module found
#print “Module already loaded (” + mod + “)”
return sys.modules[mod]

code = GetModuleCode(name)
if code == ”:
# Didn’t find the module in the database, look for it in the normal python system
return bi(name, *args)

# Found code in the database, load it here
mod = new.module(name)
try:
exec code in mod.__dict__
except:
# Module failed to load? Unload it?
#a=1
#d = self.hooks.modules_dict()
#if name in d:
# del d[name]
del sys.modules[name]
#raise
return mod

#Set __import__ to our __import function
__builtin__.__import__ = __import__

def LoadModule(name):
# Call the import function
__import__(name)

def ReloadModule(name):
UnloadModule(name)
LoadModule(name)
#print “Reload Module (” + name + “)”

def UnloadModule(name):
if (sys.modules.has_key(name)):
#print “Remove Module (” + name + “)”
del sys.modules[name]

def ReloadAllModules():
# Get the list of modules from the database and load them all
sql = “SELECT * FROM your_module_table”
rs = database.Query(sql)
for i in rs:
ReloadModule(i[”module_name”])

def GetModuleCode(name):
# Check the database for this module - put your code to retrive your module here
return “python code”

MSSQL 2000 - Merge Replication Errors

November 14th, 2007

The ProblemOn a recent project, merge replication was required. Any one who has seriously tried to use MSSQL Merge replication knows that it can be a total pain. It sounds nice, but in practice it can be a real bear. It gets worse if you have had to break the replication manually for any reason.Replication le poker en ligne françaistexas holdem casinotélécharger jeux poker gratuitstexas holdem pocket pctelecharger world pokerstrip poker gratuitementtélécharger le jeu de poker gratuiteswam pokerlegislation poker en lignetexas holdem poker onlinesalle de poker onlinejuego texas holdemjuegos poli pokerpoker roompoquer comworld series of pokerstrep poker on linedraw pokerjugar omaha poker en lineawww poquerjugar poquer webcaribbean stud pokercartas poker gratisjugar omaha pokercartas onlineencuentros pokercaribbean poker pagina internetreglas poker texas holdem,poker texas holdem gratis,poker texas holdemcomo jugar poker texasinformatica pokerjuego del poker librestrep poker gratisstreap poker onlinetexas holdem gameonline poker gamedescarga de juegos de pokerjugadas de pokerpoker paginas internetpai gow poker internetjuegos de poker para descargarjugadas pokerjugar poker texasreglas poker juegojugar poker sin dineroreglas texas holdemjugar poker omahapolly pokertorneos de pokerpoker pc gamespoker gratis descargar doesn’t clean up nice. We used sp_removedbreplication ‘dbname’ on the subscriber to clear out all replication settings. It did a fairly nice job, but there were still a few things left behind.Once merge replication was setup again properly, updates would flow from the publisher but not from the subscriber. There was an error: “tsvw_FB…”What happend?There were leftovers in the database. When you setup replication, the system adds triggers to your replicated tables. When those triggers fire, they add the changes to your replication queue so that they get pushed to the other servers. The TSVW and CSVW errors are generally leftovers from past replication configurations.The SolutionWhen you setup replication, a new set of TSVW and CSVW triggers are created. You could end up with multiple triggers (e.g. 2 update triggers). To find out which one you SHOULD keep, look in your views and you will see some TSVW and CSVW views created. Look at those numbers. They are followed by big hashes. Now go back to the problem table and remove the triggers that do NOT have those numbers. After that, your problem should be solved.Ray PulsipherInstant approval online credit cards
Credit report .com
Free instant credit report
Verizon Lg Vx6000 Free Ringtones
No anual fee instant approval credit cards
Download Ringtones Sprint
Low interest apr credit cards
Download Free Midi Ringtones
Zero interest balance transfer credit cards life
Copy of my credit report
Creditreport.org
Instant approval credit cards
Zero percent balance transfer credit cards
Canadian credit cards instant approval online
Free online credit report check
Feat Lil Lloyd Ringtones Wayne
Low apr interest credit cards
Guaranteed instant approval credit cards for poor
Free instant credit reports
How do i get a free credit report
Dont Eminem Know Ringtones
Free credit report on line
Annual credit report request
Free instant credit report status
Online credit report
Free credit report no card
Consumer credit report
Instant approval low apr credit cards
Credit report dispute
Mosquito Ringtones Silent
Free Phone Real Ringtones Sprint
Uk credit reports online
Free Verizon Ringtones
Instant approval credit cards fair
0 balance transfer credit cards
My credit report com
Trw free credit report
Fair credit reporting act litigation settlement
Time instant approval credit cards
Instant online approval credit cards fleet
Explaining credit report scores
Fixed apr business credit cards
Allstate fair credit reporting act
No interest ever balance transfer credit cards
Free credit reports without a credit card
Instant approval credit cards for people
Improve credit report
Balance transfer credit cards uk
Compare credit cards instant approval
Download Free Hindi Ringtones
Freecreditreport
Loans instant approval credit cards
Low interest fixed apr credit cards
Free Pink Floyd Ringtones
Free annual credit report
Polyphonic Spree Ringtones
Credit bureau reporting
Get a credit report
Free Lil Wayne Ringtones
Repair credit improve credit get aaa credit report
Real Music Ringtones For Verizon Wireless
Instant approval credit cards for bad
Annualfreecreditreport.com
Absolutely free online credit reports
Free Music Nextel Ringtones
Clean credit report
Best credit cards for balance
Verizon Wireless Lg Vx3100 Ringtones
Credit rating reports
Credit reporting act litigation settlement
Credit reports no
Get a free credit report
Credit reporting service
Instant credit reports uk
0 interest balance transfer credit cards
Immediate credit cards balance transfer
Get your credit report

CSS positioning made easy

September 25th, 2007

I saw this page the other day. It is great. It shows you very simple examples of CSS positioning in an easy to understand format with visible examples.


Home | My Blog | Products | Edumed | JParks Design | About Us | Portfolio | Services | Location | Contact Us | Embedded Python | College Courses | Quick Scan | Web Spy | EZ Auction | Web Hosting
This page has been viewed 89324 times.

Copyright © 2005 Computer Magic And Software Design
(360) 417-6844
computermagic@hotmail.com
computer magic