November 14, 2014

link: absolute, relative, root

Filed under: info — Tags: , , , , — admin @ 1:25 am

There are three ways to define the destination of a hyperlink (where “destination” is a webpage, image, css…).

absolute link
An absolute link is created when the href value is a fully qualified URL, including:
the transfer protocol: http://
domain name: e.g. www.nuneworld.net
and filename: e.g. yourpage.html
An absolute link to the Nune homepage looks like this:

<a href="http://www.nuneworld.net/index.php">NUNE homepage</a>

An absolute href value must be used when linking between websites; when the source and destination anchors are under different domain names.

relative link
A relative link is created when the destination href value is relative to the location of the current webpage or source anchor.
A relative link to the Nune homepage, from this webpage, looks like this:

<a href ="../index.php">Nune homepage</a>

The ../ directs the browser to move (up) out of the current directory and open the file index.php.
A relative link can only be used when linking within a website; when the source and destination anchors are under the same domain name.

When the path does not include a filename, for example: href=’../’, the server attempts to open the directory index, or default file.
To determine which file to open, the server compares names of the files in the current directory with a prioritised list of default filenames. For example, a server may be set up (configured) to look for a file named (in order): index.htm, index.html, or default.htm. If a file named index.htm cannot be found, it will attempt to open index.html; if index.html cannot be found, it will attempt to open default.htm, etc.
If a default file match is not made, then either all files in the directory will be listed, or access to the directory will be denied (Forbidden).
A relative link to the Nune contact information, from this webpage, looks like this:

<a href ="../about/contact.php">Nune contact details</a>

The browser moves (up) out of the current directory, (down) into the about directory and opens the file contact.php.
Relative links may need to be updated if a website’s structure is changed. For example, if the about directory were renamed about-us, or contact information was moved to a new, separate contact directory, then the href value above would need to be changed.

root-relative link/root link/web-root relative link
A root-relative link is created when the href value is relative to the website root.
On the Nune website, a root-relative link to the homepage (from any webpage) is:

<a href ="/index.php">Nune homepage</a>

Beginning the href value with / (forward slash) begins the path from the root directory of the current website. The forward slash is automatically replaced with the transfer protocol and domain name of the current website. For the Nune website, the forward slash is replaced with http://www.Nuneworld.net

Root-relative href values are often used to link to files that are common to a number of webpages. For example, a root-relative href value may be used to link to a stylesheet or include file. A destination link specified using root-relative href values will continue to work, even if the source webpage is moved.

A root-relative link can only be used when linking within a website; when the destination anchor is under the same domain name.

September 23, 2014

how to access a localhost website from android device problem/solution

Filed under: Software — Tags: , , , , , , , , — admin @ 1:26 am

You may receive connection timeout or connection refused when you try to load your website from android or you are trying to access some service hosted on your local web server, so you can try this steps:

1. Check if in your manifest you have INTERNET permissions

2. Check if you accessing your website try the web site  http://YOUR_LOCAL_COMPUTER_IP_ADD/YOUR_SITE not http://localhost/yoursite because if you are using localhost you actually trying to access your phone loop-back interface

3. if you are using xamp  an you recieve this error   Access to the requested object is only available from the local network phpmyadmin then open your http.conf file vim /opt/lampp/etc/extra/httpd-xampp.conf and comment  ”Deny from all” or comment Require local depending of your version and Don’t forget to restart your XAMPP Server
4. if you are using Windows and still receiving error timeout or connection refused then your windows firewall is playing with you, for start you can turn your firewall to off,  also try to open your web site with mobile browser if your mobile browser cant access your site then there are big chances that your firewall is blocking your request to your web page, and you can try to fix like described here: http://www.mobitechie.com/android-2/how-to-access-localhost-on-android-over-wifi/ in my case firewall was the problem.

September 22, 2014

jQuery(function ($) does not work in update panel and repeater

Filed under: info — Tags: , , , — admin @ 1:38 pm

Jquery function:

$(function () {
$(”.sortableFull, .sortableEmpty”).sortable(
connectWith: “.sortableFull, .sortableEmpty”
$(”.sortableFull, .sortableEmpty”).disableSelection();});

After each update all scripts are removed, you have to bind them again, first place  your jquery function in javascript like function:

function init() {

$(function () {

$(”.sortableFull, .sortableEmpty”).sortable(


connectWith: “.sortableFull, .sortableEmpty”


$(”.sortableFull, .sortableEmpty”).disableSelection();



and make call with jquery in head :

jQuery(function () { init(); });
after that in your your update panel call each time like this:

<asp:UpdatePanel ID=”UpdatePanel1″ runat=”server”>


<script type=”text/javascript”>




or if you don’t use repeater you can register your script on page load on code behind like this:

ScriptManager.RegisterStartupScript(this, typeof(Page), Guid.NewGuid().ToString(), "init();", true);

September 19, 2014

Detect enter pressed ASP.Net on textbox

Filed under: info — Tags: , — admin @ 2:02 pm

In code behind add attributes to your text box like this:

txtSearch.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnTest.ClientID + "').click();return false;}} else {return true}; ");

September 3, 2014


Filed under: info — Tags: , — admin @ 12:40 pm

Unable to find connection ‘your_conection_string’ for object  ’Web.config’. The connection string could not be found in application settings, or the data provider associated with the connection string could not be loaded.

Here’s what you need to do to start trouble-shooting the problem.

  • Close the dataset window with the error.
  • Right click the dataset in the solution explorer
  • Select “Open with…” from the context menu
  • Select “Source Code (Text) Editor” from the list and press the “OK” button

Your code will now be opened in text mode so you can view the XML. Near the top of the file, you’ll see a <connections> element with several <connection> elements within it.  Most datasets should only have one <connection> element.

If you have two <connection> elements when you remove one of them then also   change element DataSource DefaultConnectionIndex=”1″ to DataSource DefaultConnectionIndex=”0″

also in your web config your connection string should have providerName=”System.Data.SqlClient”

August 21, 2014

Disable a button control during postback in ASP.Net

Filed under: Software — admin @ 3:09 pm

Button disable technique for full .NET postbacks.

<asp:Button runat="server" ID="BtnSubmit"
  OnClientClick="this.disabled = true; this.value = 'Submitting...';"
  Text="Submit Me!" />

July 1, 2014

Write binary file Windows phone 7

Filed under: info — Tags: , , , , — admin @ 8:34 am

using (MemoryStream stream = new MemoryStream())

stream.Seek(0, SeekOrigin.Begin);
String datum = “zzza-” + DateTime.Now.ToString(”ddMMyyyyhhmmss”) + “.txt”;
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
BinaryWriter Writer = new BinaryWriter(new IsolatedStorageFileStream(datum, FileMode.OpenOrCreate, fileStorage));                         Writer.Write(stream.ToArray());

June 12, 2014

File contains Microsoft.Xna.Framework.Media.Song but trying to load as Microsoft.Xna.Framework.Audio.SoundEffect

Filed under: Software — Tags: , , , — admin @ 11:39 pm

Click on your media (.mp3) file in Content folder and in properties file set content processor to sound effect.
Content importer: MP3 AUDIO FILE
Content processor: Sound effects
Right click your project, clean solution and now run your project …
be happy ;)

May 27, 2014

Conversion to Dalvik format failed with error 1

Filed under: Software — Tags: , , , — admin @ 1:08 pm

Conversion to Dalvik format failed with error 1 when exporting and signing apk in Eclipse:

Disable “Build Automatically” on “Project menu” and rebuild it manually (Right click on project -> Build project). Then try export the application again.

This should fix your problem

May 21, 2014

All major shortcuts for eclipse

Filed under: info — Tags: , — admin @ 11:07 pm
Ctrl + SHIFT + L which will open a list of all major shortcuts for eclipse.
  • For single line java code comment : Ctrl + / (Forwards Slash) and
  • Single line uncomment : Ctrl + \ (Backslash)
  • For multiple line java code comment : Ctrl + Shift + / (Forwards Slash) and
  • Multiline uncomment : Ctrl + Shift + \ (Backslash)
  • For single line xhtml code comment/uncomment : Ctrl + Shift + c
  • For multiple line xhtml code comment : Ctrl + Shift + / (Forwards Slash)
  • For multiple uncomment : Ctrl + Shift + \ (Backward Slash)

May 14, 2014

C# a generic error occurred in GDI+ Solution

Filed under: Software — Tags: , , — admin @ 3:13 pm

check permissions to folder where your file is hosted. This problem is mostly occurred for the security reasons, you may not enough permission to write file and so on

May 12, 2014

Show line numbers in Eclipse java code

Filed under: Software — Tags: , , — admin @ 12:15 pm

Window Menu -> Preferences -> General -> Editors -> Text Editors -> check Show line numbers

Eclipse hangs at the Android SDK Content Loader

Filed under: info — Tags: , , — admin @ 9:56 am

when opening eclipse, your eclipse loading proces hangs at Android sdk content loader stuck at 0%, and loading is stoped than you should try this:

  1. Make sure that eclipse is not active. If it is active kill eclipse from the processes tab of the task manager
  2. Open %USERPROFILE%/(in Windows C:\users\YOURLOGINNAME\.android)
  3. Go to .android folder (This may be a hidden folder)
  4. Delete the folder “cache” which is located inside .android folder
  5. Delete the file ddms.cfg which is located inside .android folder
  6. Start eclipse
  7. Be happy :)

May 9, 2014

Corner radius Android get flipped

Filed under: Software — Tags: , , , — admin @ 12:12 pm

There is a bug in earlier versions of android, where they have incorrectly implemented ‘corners’ attribute of ‘Shape’ class. When specifying the corners separately, the bottom left and right corners get flipped.

So you can create separate folder for resource and place with identification of version or you can write a condition which checks the target version and accordingly you can set the correct background.

private void getPreICSButtonBackground() {
    if(Build.VERSION.SDK_INT >= 3.0){

Where in ‘R.drawable.btn_rounded_left’ corners are implemented like

<corners android:topLeftRadius="5dp" android:topRightRadius="0dp"
    android:bottomLeftRadius="5dp" android:bottomRightRadius="0dp" />

and if it is running on earlier versions, then set the background having corners as

<corners android:topLeftRadius="5dp" android:topRightRadius="0dp"
    android:bottomLeftRadius="0dp" android:bottomRightRadius="5dp" />

April 14, 2014

Create and write file Windos phone

Filed under: Software — Tags: , , , — admin @ 11:05 am

String datum = "infoFile-" + DateTime.Now.ToString("ddMMyyyyhhmmss") + ".txt";
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
StreamWriter Writer = new StreamWriter(new IsolatedStorageFileStream(datum,FileMode.OpenOrCreate, fileStorage));

Older Posts »

Powered by WordPress