Skip to main content

Posts

Showing posts from March, 2012

Prevent Visual Studio from using SQLEXPRESS when using Webparts

To prevent Visual Studio from using SQLEXPRESS when using Webparts and WebPartManger, you will need to override the "LocalSqlServer" connection string from your machine.config into your web.config file. To do that, add the following to the <connectionstrings> sections in your webconfig file: <remove name="LocalSqlServer"> <add connectionstring="data source=.\YOURINSTANCENAME;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" name="LocalSqlServer" providername="System.Data.SqlClient"> </add> Othwerise, if you do not have an instance named SQLEXPRESS in your machine, the page containing your WebPartManager will fail with the following error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is co

Using GAE OData from C#: Authentication

The last post about ODATA in the Google App Engine (python) allowed anyone to create, update or delete the models. Google App Engine (GAE) can authenticate Google users or users of you Google Apps domain. Using this feature, we can authenticate users of our C# application and use the authentication token when submitting calls to our OData service. The following class is based on the work found in  here . class GAEAuthentication { public string Authenticate(string gaeAppBaseUrl, string googleUserName, String googlePassword, string yourClientApp, string is_admin, bool is_dev_env) { string googleCookie; String gaeAppLoginUrl = gaeAppBaseUrl + "_ah/login"; String yourGaeAuthUrl = gaeAppBaseUrl + "odata.svc/"; String googleLoginUrl; if (is_dev_env) { googleLoginUrl = gaeAppLoginUrl; } else {
I am working on a plugin for Scirra's Construct2 that would allow users to present their C2 levels as 3D levels in copperlicht. Here is a demo so far: http://mathbattlegame.appspot.com/static/copperlicht/tutorial2/index.html I synchronize the positions and rotations between C2 and copperlicht, so copperlicht is just a "screen" for C2's logic. In the demo you see that you actually move and rotate the C2 sprite, and copperlicht is just being told to imitate the pos and rotation. This will allow you to use all the nice things from C2 and show them in 3D. You move by using the arrow keys and you can shoot "bullets" by pressing 'Q'.  I added the download to both the plugin and the demo at: https://sites.google.com/site/jptarqu/downloads  The name of the download is  copperlicht-c2-plugin-v-0.9.zip .  Please note that to run the sample capx, you will need to export it to your web server (either local server like IIS express, apache, etc. or to a external

Uh???

I am so confused with the Ms. Fluke situation, I have no clue what is going on. Limbaugh says she is asking taxpayers to pay for her contraceptives; but then I read that she (as a customer) was actually asking her private insurance to cover them and not the Government, which is her right as a customer to ask from a private company. But the, if it is a private business issue, I don't understand why is the Federal Government getting involved? Then I also read that most private insurance cover Viagra, is this why medical bills are so expensive? is it because Insurers can't pay for them because the insurance pool money is being used to pay for Viagra pills? I also read that this all started when the federal government added the free-contraceptives requirement to insurance carries as part of the Universal health care plan. I still remember during the health care debate a few years ago, Hillary Clinton was asked how the plan was going to protect itself from bankruptcy by the peop

Using GAE as a OData service for the data layer

One of the many challenges of software development is to allow your application to save its data into a reliable repository from anywhere in the world. With Google App Engine ( GAE ) and its cloud service, you can put the data layer of your application in the cloud and still use your preferred programming language to create your business and presentation layers. By exposing your GAE database using OData ( http://www.odata.org/ ), you get a flexible way of storing and retrieving your data from any desktop client or mobile application including C# based applications. The best thing is that GAE offers free quotas unlike Microsoft Azure's offerings. One OData library that I know works in GAE is odata-py (  http://code.google.com/p/odata-py/ ). After downloading the latest version (using SVN), you can start using the sample GAE application that comes with it. There is however, one small fix you need to make. Modify core.py to prevent an exception when getting the Key from the url when

Convert PDF files to TIFF using power shell

You can use the following ps script to convert PDF files into TIFF files: $tool = 'C:\Program Files\gs\gs9.01\bin\gswin64c.exe' #the path to your Ghostscript program. $files_folder = 'c:\youfolderwithpdfs' $pdfs = get-childitem $files_folder -recurse | where {$_.Extension -match "pdf"} foreach($pdf in $pdfs) {     $tiff = $pdf.FullName.replace('.pdf','').replace('.pdf','') + '_-_p%03d.tiff'     if(test-path $tiff)     {         "tiff file already exists " + $tiff     }     else             {            'Processing ' + $pdf.Name                 $param = "-sOutputFile=$tiff"         & $tool -q -dNOPAUSE -sDEVICE=tiffg4 $param $pdf.FullName -c quit     } } The script creates one Tiff file per PDF page. There are other options inGhostscript that you can use. To get Ghostscript for windows Go to http://sourceforge.net/projects/ghostscript  .