:::: MENU ::::
Browsing posts in: Tips and Tricks

GIT vs TFS vs SVN

Just like you I have wonder what are the difference between the three Source Code top kind Repositories that are available online. So I have decided to create this article to enlighten myself and others who are looking into the distinguishing difference of each so let get started.

GIT
Git is recently very popular with, you guess it right, github.com as it is offering an online free public source code repositories that everyone can use absolutely free. One of the best highlight of this kind of repository is that “Your CLONED repository is actually the repository that can cloned by others with the history along it”. Thats why when you are getting the source code you get it using the command GIT CLONE with the clone on the command.

TFS
We all know that its a Mirsoft product so most user of TFS are Micorosft entusiasth with Licenses at hand. One of the primary reason of choosing this repo server is that it is thighlt integrated with Microsoft product on Visual Studio and some Office Apps. It is also good to point that it is best to use if you are looking into a source control that is not easily unbinable from its source control. Unbindable that you may not easily remove the binding of the Source code from TFS, well at least that is from my experience.

SVN
Previously popular with most users as it used on Google’s Code website and has plenty of server choices that you can freely download and deploy on your on server absolutely free. It has the build in ability to Easily unbind your source code (EXPORT). Though the only downside is that the only source of truth is on the server unlike GIT which you may trigger your CLONED repo as a source of truth and might be a primary reason that some user move from SVN to GIT.

Well this are all based from my experience and some reading. But still don’t limit ourself on this items as there are also some reasons that is not indicated on this article that might be the triggering point of developers on choosing this kind of repository.

God Bless!

Thanks,
Thomie


PhoneGap Installation Guide – Windows

Hi,

Since we need to have a guide for our teammate I have decided that instead of teaching how to install one by one to my colleagues I will create an online user guide so that any other person online that will be also looking for guide will also have the help that they need. So lets get started.

Prerequisites

 

Installation Guide

  1. Install JDK, just proceed with standard installation process.
  2. Install Android Studio, just proceed with standard installation process. Please note that during the installation phase it will also download the Android SDK with is more than 3GB. PLEASE NOTE OF THE SDK INSTALLATION FOLDER AS THIS WILL BE USED ON LATER PROCEDURE.
  3. Install Aptana, just proceed with standard installation process. Please also note that during installation phase it will also download some prerequisite application including Node.js& Git
  4. Go to START and look for Command Prompt and run it as Administrator.
  5. Type the command below and press enter and wait for the installation process to finish. It will take a while depending on your internet connection.
    npm install -g cordova
    npm install -g proto-list
    npm install -g os-tmpdir
    npm install -g os-homedir
    npm install -g are-we-there-yet
    npm install -g gauge
    npm install -g ansi
    npm install -g is-absolute
    npm install -g asap
    npm install -g minimatch
    npm install -g path-is-absolute
    npm install -g validate-npm-package-license
    npm install -g is-builtin-module
    npm install -g concat-stream
    npm install -g json-parse-helpfulerror
    npm install -g block-stream
    npm install -g fstream-ignore
    npm install -g readdir-scoped-modules
    npm install -g debuglog
    npm install -g lodash._baseflatten
    npm install -g lodash._baseuniq
    npm install -g lodash.restparam
    npm install -g unique-slug
    npm install -g phonegap
  6. After the installation close all window.
  7. Restart your Machine.
  8. Go to your SDK folder that is indicated during the installation of the Android Studio.
  9. Run SDK Manager and install most of the needed SDK, you may install all the SDK if you want to be sure. It will take a while to install depending on your internet connection.
  10. Run AVD Manager and create a virtual device.
  11. You may now proceed with the creation of your PhoneGap app.

 

You may also want to take note the following update on the Environment Variable if it is needed on your side.

ANT_HOME=C:\path\to\ant\folder\apache-ant-1.9.4
ANDROID_HOME=C:\path\to\the\folder\of\Android\sdk
JAVA_HOME = C:\Program Files (x86)\Java\jdk1.7.0_79

PATH
Append;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin;%ANT_HOME%\bin


Disable Copy and Paste on RDP

Hi,

I have given a task to research on the web on how to disable RDP’s Copy and Paste of files due to some security issues. The following Steps should be done with Administrator rights.

  1. Open GPEdit.msc on Windows by Pressing Window Key + R
  2. A Window named Local Group Policy Editor will be shown.
  3. Navigate to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Device and Resource Redirection
    step a
  4. On the Extended Tab double click Do not allow clipboard redirection
  5. A Window named Do not allow clipboard redirection will be shown.
  6. Click Enabled and Click Apply
    step b
  7. Make sure that all users will Log Off and then Login to implement this new settings.
  8. Done

Source
God Bless!

Thanks,
Thomie


Signalr – OnDisconnect(bool stopCalled)

Most of us who are using .Net as our Programming language use Signalr as our Real-Time Framework. And we implement OnDisconnect in most cases to catch clients that have been disconnected. Since then there were no parameter included as an Overload of the said method. Lately on the latest releases by the Signalr team they have included an Overload so that we can distinguish what triggers the disconnection and help us manage our Apps behavior to it.

With this said I have one experience that I want to share as this may also frustrate some people who are counting connected users and having a problem that when their app have multi workers (Web Garden) they app somehow always trigger OnDisconnect even if the user is still connect. So I want to share this findings on how to properly address it.

  1. Make sure that the App is using a Backplane to manage connection on your hub so that the connections are shared on all threads/servers. I use SQLServer.
  2. Make sure to use the Database on counting your list of connection and tagging who is who. Because in memory List even its static will not be shared on a different server (obviously).
  3. Make sure to trigger disconnection action when the OnDisconnect is called with the stopCalled is equal to true.

Let me highlight what is stopCalled is equal to true means.

  1. It returns true if the method on the connection to close is trigger
  2. It returns true if the browser is called
  3. It returns false if the timeout has been met

Hope this instructions will help you manage your site as it help me on our projects.

God Bless!

Thanks,
Thomie


Google’s My Maps

Many of us give other person direction by giving them the location in Google Maps by using a Pointer. But there is a more accurate way to give directions to our peers and love ones.

Introducing Google My Maps. Google My Maps allows you to create your own map with directions, pointers, and even allow collaborations among other Google users. 

In order to start here is a simple step:

  1. Go to Google Maps
  2. Login your Google Account
  3. Create a New Map
  4. Do mapping and pointing
  5. Save, Share, Collaborate

I have use this for my referrals so that they can know the exact way they need to go when they are invited for an interview. I hope this also help you as it help me.

God Bless!

Thanks,

Thomie


[How To] Contacts Online Sync for Reformatted and Lost Android Phone

Have you ever reformatted or lost your loving Android Mobile Phone or even upgraded to the latest model in the market then all of a sudden you’ve lost your precious Contact Number?

Then, you should do the Contacts Online Sync for Reformatted and Lost Android Phone.

  1. Hit the menu button on your phone and select “System Settings.
    Sync Google Contacts With Android Step 1.jpg
  2. Click “Accounts & Sync” in the Settings menu.
    Sync Google Contacts With Android Step 2.jpg
  3. Click on the “g” symbol for Google in the Sync screen once it appears.
    Sync Google Contacts With Android Step 3.jpg
  4. Check the box marked “sync Contacts. It will tell you the last time your contacts were synced to your phone underneath.
    Sync Google Contacts With Android Step 4.jpg
  5. Hit the menu button and click “Sync Now” to add and sync your contacts to your phone.
    Sync Google Contacts With Android Step 5.jpg

Or Follow This Video

Credits to the Steps, Images, and Video to WikiHow




Source Control with SVN Server

Hi There

It is a best practice to make your project versionized and in control. So I have look unto having a cost efficient way of controlling your code both Microsoft Project and PHP without having to think about licensing and making your project public on Github. Thus Setting up a Source Control with SVN Server will do the trick.

So here are the tools that you may use and I assume that you are using Windows 32/64-Bit as your Platform

  1. Subversion Edge by CollabNet This needs registration but its worth it as its all in one Server (APACHE + SVN Server + Https)
  2. Turtoise SVN This will serve as your client application that will integrate Context Menu Source control
  3. Internet Connection with Static IP (You can get it with some DSL Business Plan)

 That’s it you may want to Look on the given site as they are easy to follow.

Thanks,
Thomie 


Free ASP .NET Hosting

Hi There,

I have been wondering if there are any free ASP.NET hosting. This is best suites to students that needs to have this hosting to either their assignments, projects, or even thesis. Just a note that if there is FREE in a hosting there for they have limitations. So here goes:

  1. https://somee.com/FreeAspNetHosting.aspx
    1. Forced Advertisement
    2. Storage: 150MB
    3. Monthly transfer: 5GB/Month
    4. Web Domain: 1
    5. ASP .NET v1.1-4.0
    6. AJAX v1.0,3.5
    7. Silver Light
    8. MS Access 2003&2007
    9. 1 Mail domain Forwarder
    10. MS SQL(2003,2008,2012): 15MB

Still looking for other option. Will update you soon.


The Android Bug Factory Reset

Hi There,

Just want you to be aware of the Android Bug on some Samsung device, that is the android bug factory reset. This is most likely to happen to people who have TouchWiz Luncher on their loving Android phone. So how that happen? This happend due to the default dialing capability of our mobile phone that is if someone texted you *#06# and try to call that directly from your sms you will directly get your serial  number. 

The same process goes to any USSD codes that your mobile phone understand. So what is that USSD code that we are talking about, that code is *2767*3855#, remember that you should NOT test this if you are not ok to the consequence for having your phone Factory Reset.

So be aware of it. Its in andform, a browser base url, an sms, a QR code, and other else.

Thanks,


ASP Classic Show Their Error Message

Hi There!

Have you get a notifications when ever you experience an error on your script. Especially when you getthe error message:

An error occurred on the server when processing the URL. Please contact the system administrator

If you are developing ASP Classic in IIS 7.+ make sure that your ASP Classic show their error message and not the message above. This will help you in your development especially when an error occurs. This same situation happen to us when developing the said Scripting Language and IIS 7.+ default its error showing message to false. To modify this just follow this steps:

  1. Go to your IIS Manger.
  2. Select the ASP Icon.
  3. Under the Compilation Table open the Debugging Properties
  4. Make the Send Errors to Browser to TRUE
 
 

Android USB Reverse Tethering

Hi There!

This is Thomie and giving you another tip so you a tip. Do you want to use your computers internet to your android but you don’t have a wifi router? Then this Android USB Reverse Reverse Tethering is best for you. Just download this ReverseTethering_2.30.

 Just a quick tip this needs your Android Phone the following :

  1. It is Rooted
  2. USB Debugging is Enabled
  3. You have connected your phone via USB to your computer.
  4. You have Installed all prerequisite drivers of your android phone.
  5. And lastly you opened the said file you have download.

Credit to http://forum.xda-developers.com/showthread.php?t=1371345 for this  amazing software.


Increase Netbook Screen Resolution

Do you want to increase netbook screen resolution? The you can follow this simple steps but its only working on windows 7/Vista.

  1. Press WINDOW KEY + R this will open a Run Prompt
  2. On that Run Prompt type regedit
  3. Go find the registry for Display1_DownScalingSupported
  4. After find that change its value from 0 to 1
  5. FIN!

Just a note that the searching may take a little time. And remember that Increased resolution is just a software based emulation so expect that your screen will look somewhat funny after changing to a higher out of scope resolution.

Thanks,


Creating a file to Download dynamically in an https / SSL connection

Hi there, 

Here is a tip when you are programming something that you want your file’s path to be hidden. It’s specially when its under a secure connection or https or SSL connection.

  1. Remember the mime type ea. image/jpg
  2. Remember the file name ea. image.jpg
  3. Remember not to put expiration and no-cache on your header
  4. Remember to open it on another tab or window as much as possible
  5. When you are debugging you can remove the headers so the file won’t be downloaded

Hope this tips can help you specially #3 because your download will fail on lower version of IE.

Thanks,



A potentially dangerous Request.Form value was detected from the client

Have you ever experience the following error in ASP .NET?

A potentially dangerous Request.Form value was detected from the client 

Then you are one like me. Then you should now that one of the values of your elements (<inputs> or <button> or <textarea>) has html elements on it. Example is bellow:

<input type=’text’ name=’content’ value='<script language=”javascript”>alert(“Hello World!”);</script>’/>

Then you should also know that this error is persisting because the values given above might be an XSS attack. If you are sure that you want to accept this type of values on your dabatase you may explicitly remove this validation by adding this tag to your page’s masterpage or 1st line of tag.

validateRequest=”false”

If you are on ASP .NET MVC you can add this to your model, assuming that your model has the content variable.

[AllowHtml]
public string content = String.Empty;

Thanks hope it help you allot. Also if you are not familiar with XSS attacks, I will try to make an article for that so you can create your own script that is hack-able, be able to prevent it, and know what are it’s crons.

God Bless!


jStorage:An alternative for Cookies

Have you ever wondered if there is an alternative for Cookies? 

You should, because there are limitation and downsides in using Cookies on your website that massively use this feature.

  1. Cookies has limited size on most browsers
  2. Cookies is transfer to server every page load
  3. If you overload the size of the Cookies it will also eat up the space of session and might remove it

Introducing jStorage, a jQuery way of saving your data to the local client and I quote

jStorage is a cross-browser key-value store database to store data locally in the browser – jStorage supports all major browsers, both in desktop (yes – even Internet Explorer 6) and in mobile.

Yes it even support IE 6!

So how to use it in an easy way?

  1. Include the following references to your project
    1. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
      <script src="https://raw.github.com/andris9/jStorage/master/jstorage.js"></script>
  2. Use $.jStorage.set(key, value) to save a value 
  3. Use $.jStorage.get(key, “default value”) to get a value

And thats it you are now using jStorage. 

Reference : http://www.jstorage.info/


WCF in Different Domain or Server

Hi There,

Its bean a while since I have updated my blog so I will be posting one of the things that I have experience on my work. That is WCF in Different Domain or Server. One of the main error that you may experience is the same as bellow:

Server Error in ‘/’ Application.


The request for security token could not be satisfied because authentication failed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ServiceModel.FaultException: The request for security token could not be satisfied because authentication failed.

Source Error:

Line 87:         
Line 88:         public bool IsExisting(string domain, string username) {
Line 89: return base.Channel.IsExisting(domain, username); Line 90:         }
Line 91:         


Source File: D:\Projects\MobileWeb\MobileWeb\Service References\SykesAD\Reference.cs Line: 89

Stack Trace:

[FaultException: The request for security token could not be satisfied because authentication failed.]
   System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target) +8904771
   System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState) +203

[SecurityNegotiationException: The caller was not authenticated by the service.]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4729651
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725

 

This message or exeception happens in production (published files has been uploaded to IIS) and not when you are currently developing it on your Visual Studio. So what is the solution? Here is the simple solution that made me a little crazy upon gazing unto it.

//Let say here is your Instantiation of your WCF
ClassADClient ad = new ClassADClient();
//Then the solution is to add a credential that the system will use on using the said WCF
//Such as like this
ad.ClientCredentials.Windows.ClientCredential = new NetworkCredential(“domain\\username”, “password”);

That’s it thats the solution and you can now use the said service without the said error.

Hope I help you! 

 

Thanks,
Thomie Jose San Agustin, MCP 


Don’t Ever use Inline Database in MSSQL SP and Query

Hi there!

I have been modifying a source code from my work and it has been a little difficult to test the system in multiple instances of database. This is due the previous developers of the said source code used Inline Query Codes and Connection Strings. In addition to that this Inline Queries and even their Stored Procedure use Inline Database, an example is [Database1].[dbo].[tbl_tableName] which should not be in practice if it is using the same database on the whole coding system.

This kind of practice limits the system to use different database name. For an instance you have a web server that serves both Development and Production Environment. You have a project that needs to have Dev and Prod on the said server. If this practice is used you are limited to one Environment at a time nevertheless you modify each script to change that inline database name. So its better to use [dbo].[tbl_tableName]  than [Database1].[dbo].[tbl_tableName] 

Thanks,

Thomie


Pages:123