www.nuneworld.net

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));
Writer.WriteLine(resultXml);
Writer.Close();

February 20, 2014

Invalid length for a Base-64 char array or string.

Filed under: Software — Tags: , , — admin @ 2:32 am

If you are using encryption for the string, you probably passing string to the url and when you are passing your string you dont use Server.UrlEncode. Use Server.UrlEncode(string) before redirecting and that will properly escape the + into a %urlchar .

Decoding the querystring values is done already when it’s parsed into the Request.QueryString collection so you dont need to use Server.UrlDecode(String)

January 17, 2014

Object cannot be cast from DBNull to other types.

Filed under: Software — admin @ 3:06 pm

When using sqlDatasource  when Retrieving the Just-Inserted ID with SqlDataSource  like is described in this post and if you receiving Exception Details: System.InvalidCastException: Object cannot be cast from DBNull to other types. first thing you should do is to check if you have initialized connection string to your  sqlDatasource like this:

<asp:SqlDataSource ID=”SqlDataSource1″
ConnectionString=”<%$ ConnectionStrings:someConnectionString %>” runat=”server” InsertCommand=”insert test_value (sodrzina) values(@Sodrzina) SELECT @NewProductID = SCOPE_IDENTITY()” oninserted=”SqlDataSource1_Inserted”>

January 16, 2014

How to unlock Android phone after too many pattern attempts without factory reset

Filed under: Software — Tags: , , , , , , — admin @ 10:45 pm

So you or somebody were playing with your phone pattern now, you have black screen saying: To unlock sing in with your google account, but your wifi is disabled and you are unable to confirm your account.

One thing to tell you : No you can’t do anything with ADB if USB debugging is turned off… That setting must be on in order to execute any ADB commands. if your usb debugging is turned off go and do hard reset to your phone else you can try some of methods listed below.

There are lot of methods on net  how to enable wifi on android phone.

http://en.miui.com/thread-5684-1-1.html
http://biznet.gotdns.org/how-to-unlock-android-after-too-many-pattern-attempts-with-airplane-mode-switch-on/

but for my phone  i was receiving errors like:

sqlite3 not found , permissions denied, killed (adb shell svc wifi enable)

I was desperate so one thing that  i can  think off  was to try make simple android app that will enable my wifi , (if you install sdk you will be able to upload apk, but another thing shout be enabled in your phone is  Allow installation of non-Market apps) because i was sure that this option is enebaled i start eclipse and make simple apk that will just enable wifi. I upload  my apk to phone and voila wifi was ON . Here you can find how to upload .apk from adb

Here is code used for the apk.

Start your eclpse and in manifest add this permissinos:

<uses-permission android:name=”android.permission.ACCESS_WIFI_STATE” />
<uses-permission android:name=”android.permission.CHANGE_WIFI_STATE” />

and in your onCreate method after setContentView add this two lines:

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(true);

and build your app on telephone directly or make .apk and upload to the phone.

if you cant wait to unlock your phone here download my apk, hope someone will help.


Retrieving the Just-Inserted ID of an IDENTITY Column Using a SqlDataSource asp.net

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

On aspx page we have :

<asp:Button ID=”Button1″ runat=”server” Text=”Button” onclick=”Button1_Click” />
<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox>
<asp:SqlDataSource ID=”SqlDataSource1″
ConnectionString=”<%$ ConnectionStrings:someConnectionString %>”    runat=”server” InsertCommand=”insert test_value (sodrzina) values(@Sodrzina) SELECT @NewProductID = SCOPE_IDENTITY()” oninserted=”SqlDataSource1_Inserted”>

<InsertParameters>
<asp:Parameter Direction=”Output” Name=”NewProductID” Type=”Int32″ />
<asp:ControlParameter ControlID=”TextBox1″ Name=”Sodrzina” PropertyName=”Text” />
</InsertParameters>

</asp:SqlDataSource>

and on code behind we have :

protected void SqlDataSource1_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
int bla = Convert.ToInt32(e.Command.Parameters["@NewProductID"].Value);
Response.Write(bla.ToString());
}

for the button :


protected void Button1_Click(object sender, EventArgs e)
{
SqlDataSource1.Insert();
}

add .json handler support in IIS 7

Filed under: Software — Tags: , — admin @ 10:31 am

set IIS 7.5 to return JSON so you will need to do two things,

1. add a .json extension and
2. add a json handler.

1.—

Open IIS Manager
Display properties for the IIS Server
Click MIME Types and then add the JSON extension:
File name extension: .json
MIME type: application/json

2. —-

Go back to the properties for IIS Server
Click on Handler Mappings
Add a script map
Request path: *.json
Executable: C:\WINDOWS\system32\inetsrv\asp.dll
Name: JSON

January 8, 2014

Reset auto number (IDENTITY) column in MS SQL Server

Filed under: Software — admin @ 11:05 am

You can reset the auto number (IDENTITY) column in SQL Server using DBCC CHECKIDENT command

dbcc checkident (TABLE_NAME,reseed,1)

and as result you will receive something similar to this if command is successful:

Checking identity information: current identity value '22', current column value '1'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

or if command is not successfull you will recieve something similar to this:

Msg 7997, Level 16, State 1, Line 1
'TABELE_NAME' does not contain an identity column.

December 31, 2013

SqlDataSource .Net connection timeout

Filed under: Software — Tags: , — admin @ 10:34 am

If you are using SqlDataSource and your receiving Error code: Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
To avoid this error use:

protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
e.Command.CommandTimeout = 0;
}

Setting timeout to 0 means no timeout. Default is 30 second.

December 25, 2013

Android dex gives a BufferOverflowException

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

Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.

Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.

Make sure that the value of android:targetSdkVersion in AndroidManifest.xml matches target=android- in project.properties.

December 18, 2013

Compile zxing library

Filed under: Software — Tags: , , , , , — admin @ 2:52 pm

1. Download maven here
2. Right click my computer ->Properties -> Advanced system settings click on Environment variables
3. Add new user variable MAVEN_HOME and place maven path example “C:\apache-maven-3.1.1″
4.Edit System variable Path and at the end add home of maven\bin example “C:\apache-maven-3.1.1\bin” click OK
5. Download the latest release of ZXing.
6. Extract zxing zip archive
7. Open cmd and navigate to zxing core folder example “C:\zxing-2.3.0\core” and execute command mvn -DskipTests -Dgpg.skip=true install
8. Wait a minute and you should receive BUILD SUCCESS message, now you can find your compiled library in zing home directory/target example ” C:\zxing-2.3.0\core\target”

For more info please check here

December 16, 2013

The VPN client agent was unable to create the interprocess communication depot. CISCO

Filed under: Software — Tags: , , , — admin @ 2:26 pm

The VPN client agent was unable to create the interprocess communication depot

Solution of this error while installing Cisco Any Connect VPN on windows machine.

Go to run
Type: services.msc and press ENTER
Find Internet Connection Sharing (ICS)
Stop the Service then
Change Startup Type to Disabled
Reboot the computer

Then try installing the Cisco Any Connect VPN installer again.

December 11, 2013

Project has no project.properties file! Edit the project properties to set one.

Filed under: Software — Tags: , , — admin @ 9:29 am

Probably you are missing some Reference in your project.
Right click on your project ->properties (alt+enter) -> navigate to Android and check if you have red mark in the reference section.
If you have click remove and click add navigate to project and add your missing lib. After that click apply, right click on the project -> android tools -> fix project properties.

December 2, 2013

Event Viwer The process exit code was ‘0×800703e9′.

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

0×800703e9 - “Recursion too deep; the stack overflowed.”

A process serving application pool ‘www.yourdomain.com’ terminated unexpectedly. The process id was ‘SOMEID’. The process exit code was ‘0×800703e9′.

So check your code or database, some item probably pointing to same item or some loop is never ending.

November 14, 2013

Windows 2008 Scheduled tasks result codes

Filed under: Software — Tags: , , , , — admin @ 2:26 pm

0 or 0×0: The operation completed successfully.
1 or 0×1: Incorrect function called or unknown function called.
2 or 0×2: File not found.
10 or 0xa: The environment is incorrect.
0×41300: Task is ready to run at its next scheduled time.
0×41301: Task is currently running.
0×41302: Task is disabled.
0×41303: Task has not yet run.
0×41304: There are no more runs scheduled for this task.
0×41306: Task is terminated.
0×8004130F: Credentials became corrupted (*)
0×8004131F: An instance of this task is already running.
0×800704DD: The service is not available (is ‘Run only when an user is logged on’ checked?)
0xC000013A: The application terminated as a result of a CTRL+C.
0xC06D007E: Unknown software exception.

Batch script to delete files greater than a certain size

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

Save this script in .cmd or .bat file and make scheduler in your window to execute periodical, or execute from command line.

:: BATCH SCRIPT START
@ECHO OFF

:: Set following variable for file size in Bytes (1024 Bytes=1KB, 1024KB=1MB, 1024MB=1GB)
SET /A FileSize=90122

:: Set following variable for file extensions to check (*.* = all files)
SET Filter=*.*

:: Set following variable with path to check insided for files
SET Folder=C:\MyFolder

FOR /R "%Folder%" %%F IN (%Filter%) DO (
IF %%~zF GTR %FileSize% (
ECHO Deleting "%%F"
DEL /F "%%F"))
EXIT /B /0
:: BATCH SCRIPT END
Older Posts »

Powered by WordPress