Skip to main content

Posts

Compile Postgres in Windows with GSSAPI

Configuration Phase Install the 64 bit versions of OpenSSL and MIT Kerberos Get the professional version of Visual Studio 2010 or 2012. Open the 64Bit of the Visual Studio Command Prompt (not the 32 bit version) cd to src\tools\msvc in the folder that contains Postgres’ source code Change the config_default.pl: add these lines: includes => 'C:\\Program Files\\MIT\\Kerberos\\include:C:\\OpenSSL-Win64\\include', libraries => 'C:\\Program Files\\MIT\\Kerberos\\lib\\amd64:C:\\OpenSSL-Win64\\lib', after  “iconv   => undef,” change the krb5 and ssl lines to: krb5    => 'C:\\Program Files (x86)\\MIT\\Kerberos',    # --with-krb5= openssl => 'C:\\OpenSSL-Win64',    # --with-ssl= Build Phase in the vs command prompt, type Build When done, if no errors, then type Install C:\PathWhereYouWanToInstallPostgres Go to the folder where OpenSSL is installed Search in the folder and subfolders for libeay32 and ssleay.dll a...

How to use Windows SSO with OpenXava

One of the nice things about the .NET web environment is the dead easy way to implement Single Sign On in your web apps through Active Directory authentication. In the Java world there are multiple alternatives to use Windows’ Single Sign On with Java based web apps. One of those alternatives is Waffle . Waffle allows your Java web app to authenticate against Active Directory groups (and users). The only caveat is that your web server needs to be running in Windows, which kind of makes sense. In this article, you will learn the steps required to have your OpenXava web application use Waffle to authenticate your Windows users. The first step is to download Waffle from their site and then copy the JAR files outlined in https://github.com/dblock/waffle/blob/master/Docs/tomcat/TomcatSingleSignOnValve.md to the OpenXava’s tomcat server. In your OpenXava project, create servlets.xml in the Web-inf, containing the following: <!-- the role name (the domain gorup) must be e...

Data Science for Business by Foster Provost & Tom Fawcett O’Reilly Media

Data Science for Business is a book that makes a phenomenal job teaching the fundamental concepts of Data Science (a.k.a. Data Analysis and Data Mining). Foster Provost and Tom Fawcett explain in plain English, clear examples and beginner-level math the processes surrounding Data Science and the basics of its algorithms. The authors go over the various steps of the CRISP method using situations found in the real world such as Customer Churn and Online Advertising. The most common data analysis models are reviewed and explained in detail such as Clustering, Decision Trees and Support Vector Machines. Extensive explanation is given to the difference between supervised and unsupervised methods. Even if you use software tools that create those models, this book will help you understand how to use/test them correctly and how to avoid over-fitting. Multiple examples are given in each chapter and most of the math is visually aided with graphs. The authors explain step by step any eq...

How to make MS SQL integrated security work in Spoon

How to make Micorsoft SQL Server's integrated security (SSPI) work in Spoon: Download the MS SQL JDBC sql drivers Copy enu\auth\x64\sqljdbc_auth.dll to {spoon installtion folder}\libswt\win64 Copy enu\auth\x64\sqljdbc_auth.dll  to {spoon installtion folder}\libswt\win32 Copy C:\sqljdbc_4.0\enu\sqljdbc4.jar to {spoon installtion folder}\libext\JDBC Open Spoon When creating the data source, make sure to check "Use integrated authentication" Please note that you are copying the 64 bit version of sqljdbc_auth.dll to both \libswt\win64 and \libswt\win32 if you have a 64 bit processor.

Alert if file missing using Powershell

The following Powershell script can be used to send an email alert when a file is missing from a folder or it is the same file from a previous check: $path_mask = "yourfile_*.txt" $previous_file_store = "lastfileread.txt" $script_name = "File Check" ###### Functions ########## Function EMailLog($subject, $message) {    $emailTo = "juanito@yourserver.com"    $emailFrom = "alert@yourserver.com"    $smtpserver="smtp.yourserver.com"       $smtp=new-object Net.Mail.SmtpClient($smtpServer)    $smtp.Send($emailFrom, $emailTo, $subject, $message) } Try {    #get files that match the mask    $curr_file = dir $path_mask |  select name    if ($curr_file.count -gt 0)    {        #file found        #check if the file is differe...

Thoughts on how to prevent Abortions

I would like to first set the scope of this article; this is about abortions in cases where the couple had consensual sex and there is no life-or-death health risk to the pregnant mother. In regards to cases of rape or life-or-death risks to the mother, I think it is best for a panel of women (both pro-choice and pro-life) to discuss it. The panel should include people who have gone through those situations and who have taken either direction. No man (pro-choice or pro-life) should be included in that panel and meetings. I also want to clarify before we being that I am pro life in that I believe life begins as soon as the baby starts forming in the womb. Having set the scope of this article, it is important to address the fact that it is very important to point out that when a baby is conceived, the couple is pregnant  not just the mother. The responsibility falls to both the man and the woman. Paying child sup...

How to easily import data from SQL Server into PostgreSQL

I was looking for an ETL software similar to SSIS that would allow me to easily move data from SQL Server to PostgreSQL. I tried using SSIS, but I was never able to make BIDS generated the schema of the destination table automatically like it would do with a SQL server destination table. I downloaded Pentaho’s Spoon data integrator and it surpised how easy it was to do it there. The designer is somewhat similar to BIDS. You drop your input tables (from SQL Server) and then you drop your destination tables (PostgreSQL tables). The good thing is that you do not need to create the tables in PostgreSQL beforehand. You just need to create the destination database. When you open the properties of the Table Output, you can enter the name of the new table and then do the following to create the table based on the data input: Click “Database Fields” Click “SQL” Click “Execute” That’s it. Your table will be created in PostgreSQL using the correct data types. Pentaho’s Spoo...

Authenticate OpenXava users with ActiveDirectory

The following allows you to use JNDIRealm 's LDAP authentication to authenticate users of OpenXava application with Active Directory. The users will be prompt to enter their windows credentials, when entering the usernames they need to avoid entering the domain name; they just need to enter the username. If you have multiple Active Directory domains to authenticate against, you can use  org.apache.catalina.realm.CombinedRealm to allow Tomcat to search on both. In the web.xml you will need to specify the security-constraint setting. This will force the user to authenticate when they reach any OpenXava module. in role-name, you have to enter the Windows Group name of that is allow to access the application. If you need finer restrictions, you can use OpenXava's Users.getCurrent() to get the username of the current user in your Java code. For example, you could have a validation logic to prevent a certain user from creating a new record. Please note that you must use a ...

A Solution to the Marriage Dilemma

In the midst of the raging battle between those who want to legalize homosexual marriages and those who oppose it, a solution could be implemented that would fit the goals of both sides. The problem with the traditional marriage constitutional amendment is that it asks the Government for the wrong thing. Asking the Government to define marriage as one man and one woman is a huge mistake because it takes away that power from religion and puts that power in a Government that is already taking too much power. It is extremely important for the survival of the Church that the government stays away from her . If we let the Government take that power,  not only would break the first amendment, but it also would teach future Christians generations that it does not matter what the Bible says what marriage is, all it matters is what the Government says it is. The definition of marriage belongs to culture and religion and it should stay there.  Instead, I would like to propose the...

Construct2: surpassing GameMaker and Multimedia Fusion

I a few years ago, I posted an article about why I preferred GameMaker over Multimedia Fusion. A lot has happened since then, Clickteam released many exporters for MMF (Flash, IOS and others) and YoYo Games have made HTML5 gaming GameMaker’s new target. Another product has been in the works too, Scirra produced Construct2 as a HTML5 game maker. Just like I reached my conclusion back then through spending time on GameMaker, I have come to the conclusion that Scirra’s Construct2 is a very worthy contender to both by spending some time using it and writing plugins for it. Construct2’s main target is HTML5 gaming, however, it is straight forward to create exporters for it and I am actually working on a XNA exporter for it. I have also created plugins that allow Construct2 games to create simple 3D games (WebGL via Copperlicht), online multiplayer games (through websockets) and isometric games (through a Z sorter plugin).   Construct2 enjoys an easy-to-use event-driven inter...

How to create online multiplayer HTML5 games in Contruct2

  Construct2 can use websockets to send and receive messages between games. By using socket-io , we can use a Node.js script as the server and my modification to the socket-io plugin for Construct2 to allow the games to synchronize data between them in real-time. There are two parts to this design: the Node.js server and the Construct2 clients (the games playing). The main part of building an online multiplayer HTML5 game is to plan: how the clients will communicate how often and what to communicate how much of the logic will go into the server and how much to the client. In my sample game, I chose to have each client own a player and have the server just relay messages: Use string messages in the form TypeOfMessage, Parameter1, Paremeter2, Parater3, etc to communicate. Have the clients send their player position about 16 times a second. Whenever their player shoots, the client needs to send a message immediately. Almost all of the game logic will...

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