Thursday, 3 October 2013

how to intreacting with database in asp.net without interfering and frezzing for page

how to intreacting with database in asp.net without interfering and
frezzing for page

In asp.net
How to run sql command in background and still play with controls and user
interface does not freeze until result for command return ...
I read about web worker in java script is that the best solution .. and
how to attach it with asp.net

Wednesday, 2 October 2013

Save BinaryWrite to Server Path

Save BinaryWrite to Server Path

I am saving files to SQL Server on remote hosted server. I can upload
them. But I need to download a file to the remote servers path. The code
below extracts the file but saves it to the client.
I tried replacing Response.BinaryWrite(bytes) to Response.TransmitFile(
Server.MapPath("~/App_Data/DS/sailbig.jpg") but I get an error file not
found.
I simply want to extract the file I stored in sql and place it a the
directory on the server so I can use it in code later, but I cannot figure
it out. Any help is appreciated, this is a hobby for me.
Dim filePath As String =
HttpContext.Current.Server.MapPath("~/App_Data/DS/")
Dim bytes() As Byte = CType(dt.Rows(0)("Data"), Byte())
response.Buffer = True
response.Charset = ""
response.Cache.SetCacheability(HttpCacheability.NoCache)
response.ContentType = dt.Rows(0)("ContentType").ToString()
Response.AddHeader("content-disposition", "attachment;filename=" &
dt.Rows(0)("FileName").ToString())
Response.BinaryWrite(bytes)
Response.Flush()
Response.End()

Get a resource string based on javascript value

Get a resource string based on javascript value

Is it possible to accomplish something like this?
<script type="text/javascript">
function getValues( keysArray ) {
var valuesArray = new Array(keysArray.length);
for (var i = 0; i < keysArray.length; i++) {
valuesArray[i] = @this.LocalResources(keysArray[i]);
}
return valuesArray;
}

Servlet-Applet communication

Servlet-Applet communication

I have an applet successfully signed and deployed in my application.
I have a index.html which loads the applet correctly if I make a call like
/myApp
However,if I try to forward to index.html from a servlet, I´m getting a
ClassNotFoundException.
Here are the code that loads the applet.All these jars are in the
WebContent folder.
index.html
<applet code="com.griaule.grFingerSample.FormMain"
archive="fingerAssinado.jar,SignedGrFingerJavaAppletSampleAssinado.jar,postgresql-8.4-701.jdbc4Assinado.jar"
What am I doing wrong?

how to sync the perforce client to a particular change list using p4 sync command

how to sync the perforce client to a particular change list using p4 sync
command

let us assume depot contains change lists :
change lists : 300 299 280 270 260
I would like to sync my client at change list 280.
if i do p4 sync : my client will be updated with cl : 300 (latest one)
which i'm not looking for.
How can we achieve this ?

Tuesday, 1 October 2013

iOS Core Data: How do I add subsequent records to the 'many' of 1:many relationships?

iOS Core Data: How do I add subsequent records to the 'many' of 1:many
relationships?

I am writing an GPS running app that I want to store multiple locations
per 'Path' or run. I am having a little trouble understanding the new
concepts of ORM style DBs. (I know Core Data uses SQLLite as the
underlying mechanism and isn't a true ORM, but that aside..,) I have two
entities setup, 'Path' and 'Location', with a 'To-Many' relationship going
from Path>>Location with Cascade Deletion, and an inverse that just has
nullify for Delete.

I am doing:
//SEND TO CORE DATA
bdAppDelegate *appDelegate =
[[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context =
[appDelegate managedObjectContext];
// get GPS lat/lng
double lat = newLocation.coordinate.latitude;
double lng = newLocation.coordinate.longitude;
// insert Path
Path *currentPathInfo = [NSEntityDescription
insertNewObjectForEntityForName:@"Path"
inManagedObjectContext:context];
currentPathInfo.name = currentPathName;
currentPathInfo.createddate =[NSDate date];
// insert location/GPS point
Location *currentPathLocation = [NSEntityDescription
insertNewObjectForEntityForName:@"Location"
inManagedObjectContext:context];
currentPathLocation.lat = [NSNumber numberWithDouble:lat];
currentPathLocation.lng = [NSNumber numberWithDouble:lng];
// insert 'Location' relationship to 'Path'
[currentPathInfo addLocationsObject:currentPathLocation];
NSError *error;
if (![context save:&error]) {
NSLog(@"Whoops, couldn't save: %@", [error
localizedDescription]);
}
This is on initial startup (button press) but then how do I continue to
add more 'Locations' that relate to the initial 'Path' without continuing
to add more 'Path's as a result of repeating the above code?
In SQL, I'd have a PathID integer (identity) that I'd use for a foreign
key in a 'Locations' table to insert locations... I'm having a
disconnect...

setting css styles usign jQuery

setting css styles usign jQuery

I need to set the css styles to the following elements as follows using
jQuery
#hdr-nav-wrapper ul li:hover a{
background-color:#0294ca;
}
#hdr-nav-wrapper ul a:hover{
background-color:#00aeff;
}
Except that the actual color will have to be dynamic based on whatever the
background color of a div with id of "TestDiv". This site has a theme
engine where users can change colors using a color theme palette. I am
appending a nav bar to the top of the site but I want to have the
background of the nav bar as the same as whatever "TestDiv" currently has.
How do I convert the above css to jQuery with that dynamic logic?

Connecting to Ubuntu using Remote Desktop Connection on Windows 7

Connecting to Ubuntu using Remote Desktop Connection on Windows 7

I'm trying to connect to a machine with Ubuntu from a different machine
running Windows 7 using the Windows Program Remote Desktop Connection.
I used the command:
sudo apt-get install xrdp
which worked, except that when I connect from my Windows I can only see
the blank desktop background of the remote Ubuntu. The taskbar, icons etc
are all missing. Does anyone know how to fix this?
Thanks

Please help identify on which partition I have ubuntu installed

Please help identify on which partition I have ubuntu installed

I need to reinstall my GRUB since I cannot boot windows 8 anymore
(something happened with my installation of Ubuntu). I want to follow this
advice - Boot error > no such device: grub rescue in order to re-install
the grub but I made the stupid mistake of allocating half of the size of
the partition to windows and half to Ubuntu lol. So now I need to know on
which partition I have Linux could someone help me out ? Thanks. Here is
the partition list
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 718847 358400 7 HPFS/NTFS/exFAT
/dev/sda2 718848 1025779711 512530432 7 HPFS/NTFS/exFAT
/dev/sda3 1025779712 1851121663 412670976 7 HPFS/NTFS/exFAT
/dev/sda4 1851121664 1953521663 51200000 f W95 Ext'd (LBA)
/dev/sda5 1851123712 1953521663 51198976 7 HPFS/NTFS/exFAT