C#: Simple Way to Upload a File

In this example, I will show you how to easily upload a file to your web server via FTP. You’d need to add using System.Net; Make a FTP connection and read a file into stream, then writes to FTP. Important Note: because you’re casting WebRequest to a FtpWebRequest, your Address need to start with ftp://www.hostname.com, […]

C#: Simple way to parse XML string to get Value from the tag

C# makes it very easy to parse a xml file or string. For example, if you want to parse the following xml file, looking just for the value of the tag called “score”: <?xml version=”1.0″ encoding=”UTF-8″?> <results> <status>OK</status> <url>http://www.monkeycancode.com/</url> <totalTransactions>1</totalTransactions> <language>english</language> <mixed>1</mixed> <score>0.111642</score> <type>positive</type> </results> This will work even with tag element that is in […]

Python: Simple Function example

In Python, to define a function is very easy. use the def to define a function, you can then call the function directly by name. For example:   #function example def mod_string(msg): msg += " modified! " return msg   test_str = "this is a test" print(mod_string(test_str)) The example function simply append ” modified” to […]

Android Studio: emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed!

When you first tried to run your Android Virtual Device to startup, you might run into this error message: emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed! You need to: 1. Install the Intel HAXM emulator. In […]

ORACLE: Show Statistic Updates

The following Oracle SQL command allows you to see the statistics information, grouping by the last analyzed date (the is the name of schema you need to substitute into the SQL query: select to_char(last_analyzed,’MON-DD-YYYY’), count(*) from dba_tables where owner=” group by to_char(last_analyzed,’MON-DD-YYYY’) order by to_char(last_analyzed,’MON-DD-YYYY’); The output looks like this: TO_CHAR(LAST_ANALYZED,’MON-DD-YYYY’) —————————————————————————— COUNT(*) ———- FEB-01-2016 […]

Ubuntu: how to install Android Studio on Ubuntu 15.10

Install the Open JDK8 on Ubuntu. Go to terminal, type: sudo apt-get install openjdk-8-jdk. Install the lib32stdc (you only need lib32tdc++6 for Ubuntu 15.10, without it, you will see android studio show an error unable to run mksdcard-sdk…) To install, in terminal type: sudo apt-get install lib32stdc++6 Go to browse and open link:¬†http://developer.android.com/sdk/installing/index.html?pkg=studio Click on […]