Search Results

Search found 15021 results on 601 pages for 'location aware'.

Page 55/601 | < Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >

  • Android: various questions about GPS

    - by wei
    I'm writing my first location based android app, but got confused about some of the GPS service api. Here are some questions I have: 1) To get my current location, I called requestLocationUpdates() with a listener in the onCreate() method of one activity. But what happens when another activity starts and the current activity goes invisible? Is the GPS location update going to stop? If so, how do I keep it on after the activity is switched? 2) how accurate is the Location.getSpeed()? How is it computed? Can it tell the difference between on bicycle and on foot? 3) not really a question about android. How to calculate the coordinates of a location, say, 100m away from my current location? 4) To stop the GPS, I only need to remove all the listeners that have been registered to locationmanager? Thanks a lot!

    Read the article

  • <function> referenced from; symbol(s) not found.

    - by jfm429
    I have a piece of C code that is used from a C++ function. At the top of my C++ file I have the line: #include "prediction.h" In prediction.h I have this: #ifndef prediction #define prediction #include "structs.h" typedef struct { double estimation; double variance; } response; response runPrediction(int obs, location* positions, double* observations, int targets, location* targetPositions); #endif I also have prediction.c, which has: #include "prediction.h" response runPrediction(int obs, location* positions, double* observations, int targets, location* targetPositions) { // code here } Now, in my C++ file (which as I said includes prediction.h) I call that function, then compile (through Xcode) I get this error: "runPrediction(int, location*, double*, int, location*)", referenced from: mainFrame::respondTo(char*, int)in mainFrame.o ld: symbol(s) not found collect2: ld returned 1 exit status prediction.c is marked for compilation for the current target. I don't have any problems with other .cpp files not being compiled. Any thoughts here?

    Read the article

  • Merge two text files at a specific location, sed or awk.

    - by S1syphus
    I have two text files, I want to place a text in the middle of another, I did some research and found information about adding single strings: I have a comment in the second text file called STUFFGOESHERE, so I tried: sed '/^STUFFGOESHERE/a file1.txt' file2.txt sed: 1: "/^STUFFGOESHERE/a long.txt": command a expects \ followed by text So I tried something different, trying to place the contents of the text based on a given line, but no luck. Any ideas?

    Read the article

  • How do I get the current location of an iframe?

    - by studiothat
    I have built a basic data entry application allowing users to browse external content in iframe and enter data quickly from the same page. One of the data variables is the URL. Ideally I would like to be able to load the iframes current url into a textbox with javascript. I realize now that this is not going to happen due to security issues. Has anyone done anything on the server side? or know of any .Net browser in browser controls. The ultimate goal is to just give the user an easy method of extracting the url of the page they are viewing in the iframe It doesn't necessarily HAVE to be an iframe, a browser in the browser would be ideal. Thanks, Adam

    Read the article

  • How to move to a location in a web browser component?

    - by Mostafa Mahdieh
    I have a .NET windows form page and a WebBrowser component inside. I load a page inside the web browser using the Navigate method as in: webBrowser1.Navigate("http://www.stackoverflow.com"); The pages length is longer than the browsers height, so the vertical scroll bar appears. Now I want to move the scrollbar down to a specific position. More specifically I want to search for a specific peace of text inside the page, and scroll to that position. This behavior is implemented in the built-in "Find" function of the browser, but I can't figure out how to call the Find function from within my code, without the Find window appearing. Although I don't want the Find window to appear, if the text matches are highlighted it is welcome.

    Read the article

  • How to specify schema location in an xsd file?

    - by Manoj
    I have an xsd file Foo.xsd. I tried following ways to refer it in a WSDL file but it doesnt work. 1) placed the xsd file in local file system and imported it as <xsd:import namespace="http://ws.test.com/" schemaLocation="file:///D:/wsdl/Foo.xsd"></xsd:import> 2) Placed the xsd file in web root folder and imported as <xsd:import namespace="http://ws.test.com/" schemaLocation="http://localhost:8080/Xfire/Foo.xsd"></xsd:import> When I run the client I get null for the fields of response object. But this works when I embed the type definition inside the WSDL itself. How do we specify the path to external xsds? I am using xFire 1.2.6 for generating webservices. Client is generated using xFire WSGen ant task.

    Read the article

  • What should be proper location for sqlit3 database file?

    - by Elliot Chen
    Hi, Everyone: I'm using a sqlite3 database to store app's data. Instead of building a database within program, I introduced an existing db file: 'abc.sqlite' into my project and put it under my 'Resources' folder. So, I think this db file should be inside of 'bundle', so at my init function, I used following statement to read it out: NSString *path = [[NSBundle mainBundle] pathForResource:@"abc" ofType:"sqlite"]; if(sqlite3_open([path UTF8String], &database) != SQLITE_OK) ... It's ok that this db can be opened and data can be retrieved from it. BUT, someone told me that it's better to copy this db file into user folder: such as 'Document'. So, my question is: is it ok to use this db from main bundle directly or copy it to user folder then use that copy. Which is better? Thank you very much!

    Read the article

  • How to permanently leave a CALayer rotated at its final location?

    - by David
    Hello, I am trying to rotate a CALayer to a specific angle however, once the animation is done, the layer jumps back to its original position. How would I rotate the layer properly so that it stays at its final destination? Here is the code that I am using CABasicAnimation *rotationAnimation =[CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; //Rotate about z-axis [rotationAnimation setFromValue:[NSNumber numberWithFloat:fromDegree]]; [rotationAnimation setToValue:[NSNumber numberWithFloat:toDegree]]; [rotationAnimation setDuration:0.2]; [rotationAnimation setRemovedOnCompletion:YES]; [rotationAnimation setFillMode:kCAFillModeForwards]; Any suggestions? Thank you.

    Read the article

  • Android - How to launch Google map intent in android app with certain location, zoom level and marker

    - by umirza47
    Map Intent not working with specific zoom level as well as custom marker float lat = 40.714728f; float lng = -73.998672f; String maplLabel = "ABC Label"; final Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q="+lat+","+lng+"&z=16 (" + maplLabel + ")")); startActivity(intent); Anybody know what is wrong? or how to do so? I want to show map of certain (lat,lng) with a custom label-marker at a specific zoom level.

    Read the article

  • Question about [literally] mapping location based on an IP address.

    - by Andrew
    I've been bored lately and I want to start a new project. I was looking at a website mentioned in a different question (http://www.grapevinegame.com/), and I thought the map and how it plots a point based on someone's IP (I assume) is pretty nifty. I want to do something like that, but I have no idea how it's done. I know you can get latitude and longitude, city and state, and some more with some already-written scripts, but how would you plot those on a map of the world? I've seen it other places, like Google Analytics and such, as well. It seems like a neat thing to be able to do, so I was just wondering how exactly it works. :-p.

    Read the article

  • spoof mac address

    - by Cold-Blooded
    // macaddress.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <windows.h> #include <iostream> using namespace std; void readregistry(); void spoofmac(); void main(int argc, char* argv[]) { readregistry(); spoofmac(); } void spoofmac() { ////////////////////// ////////Write to Registry char buffer[60]; unsigned long size = sizeof(buffer); HKEY software; LPCTSTR location; char adapternum[10]=""; char numbers[11]="0123456789"; char editlocation[]="System\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\0000"; char macaddress[60]; cout << "\n//////////////////////////////////////////////////////////////////\nPlease Enter Number of Network Adapter to Spoof or type 'E' to Exit.\nE.g. 18\n\nNumber: "; cin >> adapternum; if (adapternum[0]=='E') { exit(0); } if (strlen(adapternum)==2) { editlocation[strlen(editlocation)-2]=adapternum[0]; editlocation[strlen(editlocation)-1]=adapternum[1]; } if (strlen(adapternum)==1) { editlocation[strlen(editlocation)-1]=adapternum[0]; } if (strlen(adapternum)!=1 && strlen(adapternum)!=2) { cout << "Invaild Network Adapter Chosen\n\n"; exit(0); } cout << "Please Enter the Desired Spoofed Mac Address Without Dashes\nE.g. 00123F0F6D7F\n\nNew Mac: "; cin >> macaddress; location = editlocation; //error line strcpy(buffer,macaddress); size=sizeof(buffer); RegCreateKey(HKEY_LOCAL_MACHINE,location,&software); //RegSetValueEx(software,"NetworkAddress",NULL,REG_SZ,(LPBYTE)buffer,size); RegCloseKey(software); cout << "\nMac Address Successfully Spoofed.\n\nWritten by Lyth0s\n\n"; } void readregistry () { //////////////////////////////////// // Read From Registry char driver[60]=""; char mac[60]=""; char numbers[11]="0123456789"; char editlocation[]="System\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\0000"; unsigned long driversize = sizeof(driver); unsigned long macsize = sizeof(mac); DWORD type; HKEY software; LPCTSTR location; int tenscount=0; int onescount=0; for (int x =0;x<=19; x+=1) { strcpy(driver,""); driversize=sizeof(driver); strcpy(mac,""); macsize=sizeof(mac); if (editlocation[strlen(editlocation)-1]=='9') { tenscount+=1; onescount=0; editlocation[strlen(editlocation)-2]=numbers[tenscount]; } editlocation[strlen(editlocation)-1]=numbers[onescount]; location=editlocation; //error line // cout << location << "\n"; // cout << "Checking 00" << location[strlen(location)-2] << location[strlen(location)-1] << "\n\n"; RegCreateKey(HKEY_LOCAL_MACHINE,location,&software); RegQueryValueEx(software,"DriverDesc",NULL,&type,(LPBYTE)driver,&driversize); //RegCloseKey(software); //RegCreateKey(HKEY_LOCAL_MACHINE,location,&software); RegQueryValueEx(software,"NetworkAddress",NULL,&type,(LPBYTE)mac,&macsize); RegCloseKey(software); cout << x << ": " << driver << "| Mac: " << mac << "\n"; onescount+=1; } } this program gives error as follows error C2440: '=' : cannot convert from 'char [83]' to 'LPCTSTR' why this error coming please explain

    Read the article

  • How to retrieve the location of a control on the view?

    - by amok
    I have a button on a view, I want to add another button next to it when the first button is touched. Therefore I need it's top left corner to do the math. Here's what is puzzling me greatly: // this code is executed when the button is pressed NSLog(@"X:%f",moreButton.frame.origin.x); that returns on the first and second click the followings: 2010-04-24 22:58:25.883 iPad PopOver[8095:40b] X:-1.999002 2010-04-24 22:58:25.884 iPad PopOver[8095:40b] Y:0.000000 why and how can I get the x,y of an existing button on the view? (button created via IB) Thanks! mE ps: I have looked at similar posts and my code looks fine but I keep getting zeros (it's an ipad app if matters in any way)

    Read the article

  • How do you convert bytes of bitmap into x, y location of pixels?

    - by Jon
    I have a win32 program that creates a bitmap screenshot. I am trying to figure out the x and y coordinates of the bmBits. Below is the code I have so far: UINT32 nScreenX = GetSystemMetrics(SM_CXSCREEN); UINT32 nScreenY = GetSystemMetrics(SM_CYSCREEN); HDC hdc = GetDC(NULL); HDC hdcScreen = CreateCompatibleDC(hdc); HBITMAP hbmpScreen = CreateDIBSection( hdcDesk, ( BITMAPINFO* )&bitmapInfo.bmiHeader,DIB_RGB_COLORS, &bitmapDataPtr, NULL, 0 ); SelectObject(hdcScreen, hbmpScreen); BitBlt(hdcScreen, 0, 0, nScreenX , nScreenY , hdc, 0, 0, SRCCOPY); ReleaseDC(NULL, hdc); BITMAP bmpScreen; GetObject(hbmpScreen, sizeof(bmpScreen), &bmpScreen); DWORD *pScreenPixels = (DWORD*)bmpScreen.bmBits, UINT32 x = 0; UINT32 y = 0; UINT32 nCntPixels = nScreenX * nScreenY; for(int n = 0; n < nCntPixels; n++) { x = n % nScreenX; y = n / nScreenX; //do stuff with the x and y vals } The code seem correct to me but, when I use this code the x and y values appear to be off. Where does the first pixel of bmBits start? When x and y are both 0. Is that the top left, bottom left, bottom right or top right? Thanks.

    Read the article

  • A quick way to map unordered list of longs to buffer location ?

    - by alhazen
    I have a large number of points (indexed by long) that are processed by multiple threads and I'm using a buffer to hold the output results in order. As the number of points processed is huge, what would be an efficient way to map the indexes of the points to the corresponding ordered position in the buffer ? Example: long bufferIndex bufferIndex index (if BufferSize = 2) (if BufferSize = 4) ---------------------------------------------- 2938 0 0 2939 1 1 2941 1 3 2940 0 2 Thanks.

    Read the article

  • Xcode: Is there a location/flag to prevent a Class from compiling?

    - by Meltemi
    Is there a place (or flag) in Xcode for files that you don't want to compile? There are some classes that are/may become part of a project but currently won't compile. The main project doesn't link to them but Xcode still tries to compile them. Is there a way to prevent blocking the rest of project from compiling until these new Classes are "ready"?

    Read the article

  • How to fetch managed objects sorted by calculated value

    - by Marcin Zbijowski
    Hello, I'm working on the app that uses CoreData. There is location entity that holds latitude and longitude values. I'd like to fetch those entities sorted by distance to the user's location. I tried to set sort descriptor to distance formula sqrt ((x1 - x2)^2 + (y1 - y2)^2) but it fails with exception "... keypath ... not found in entity". NSString *distanceFormula = [NSString stringWithFormat:@"sqrt(((latitude - %f) * (latitude - %f)) + ((longitude - %f) * (longitude - %f)))", location.coordinate.latitude, location.coordinate.latitude, location.coordinate.longitude, location.coordinate.longitude]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:distanceFormula ascending:YES]; [fetchRequest setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]]; NSError *error; NSArray *result = [[self managedObjectContext] executeFetchRequest:fetchRequest error:&error]; I'd like to fetch already sorted objects rather then fetch them all and then sort in the code. Any tips appreciated.

    Read the article

  • How to move file pointer to a particular location using fseek()?

    - by Noge
    My intention is to read every elements in the 2nd column into a buffer[] from the following .txt file: 9992891234 09.920 15.771 11.909 9992345971 07.892 12.234 09.234 9992348971 64.567 70.456 50.987 9992348231 89.234 85.890 58.982 I have know of a way to do it by using fscanf(): for (int i=0;i<4;i++) { fscanf(pFile, "%lld", &junk); fscanf(pFile, "%f", &buffer[i]); fscanf(pFile, "%f", &junk); fscanf(pFile, "%f", &junk); } However, since I'm doing parallel programing which requires me to use different Windows Threads to read different columns, so I'll need to read the elements in the 2nd column directly using fseek(). The question here is, what should I put in the 2nd argument in fseek() in the code below to move my file pointer to read the 2nd element of the 2nd line? fscanf(pFile, "%llf", &junk);//<------this is used to skip the 1st data for (int i=0;i<4;i++) { fscanf(pFile, "%f", &buffer[i]); fseek ( pFile , ??, SEEK_CUR );//<----how do I calculate this offset? }

    Read the article

< Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >