Search Results

Search found 5942 results on 238 pages for 'total starnger'.

Page 142/238 | < Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >

  • Placing an background image with padding in h2 tag

    - by Cedar Jensen
    I want to create a headline (h2) with an image at the right-most area of the bounding box. I have the layout almost right except I can't push the image a little bit to the right of the element's bounding box -- how would I tweak my css so it is displayed correctly? I'm trying to do something like this: [{someHeadLineText}{dynamic space }{image}{5px space}] where the [] indicate the total available width of my content. Html: <div class="primaryHeader"> <h2>News</h2> </div> Css: .primaryHeader h2 { background-color: green; /* the header looks like a box */ color: black; background: transparent url(../images/edit.png) no-repeat right center; border: 1px solid red; } I am placing the image to the right of my h2 element and centered vertically -- but how do I adjust the placement of the background image?

    Read the article

  • What's the best way to convert a .eps (CMYK) to a .jpg (RGB) with Image Magick

    - by Slinky
    Hi All, I have a bunch of .eps files (CMYK) that I need to convert to .jpg (RGB) files. The following command sometimes gives me under or over saturated .jpg images, when compared to the source EPS file: $cmd = "convert -density 300 -quality 100% -colorspace RGB ".$epsURL." -flatten -strip ".$convertedURL; Is there a smarter way to do this such that the converted image will have the same qualities as the source EPS file? Here is an example of the source file info: Image: rejm.eps Format: PS (PostScript) Class: DirectClass Geometry: 537x471 Base geometry: 1074x941 Type: ColorSeparation Endianess: Undefined Colorspace: CMYK Channel depth: Cyan: 8-bit Magenta: 8-bit Yellow: 8-bit Black: 8-bit Channel statistics: Cyan: Min: 0 (0) Max: 255 (1) Mean: 161.913 (0.634955) Standard deviation: 72.8257 (0.285591) Magenta: Min: 0 (0) Max: 255 (1) Mean: 184.261 (0.722591) Standard deviation: 75.7933 (0.297229) Yellow: Min: 0 (0) Max: 255 (1) Mean: 70.6607 (0.277101) Standard deviation: 39.8677 (0.156344) Black: Min: 0 (0) Max: 195 (0.764706) Mean: 34.4382 (0.135052) Standard deviation: 38.1863 (0.14975) Total ink density: 292% Colors: 210489 Rendering intent: Undefined Resolution: 28.35x28.35 Units: PixelsPerCentimeter Filesize: 997.727kb Interlace: None Background color: white Border color: #DFDFDFDFDFDF Matte color: grey74 Page geometry: 537x471+0+0 Dispose: Undefined Iterations: 0 Compression: Undefined Orientation: Undefined Signature: 8ea00688cb5ae496812125e8a5aea40b0f0e69c9b49b2dc4eb028b22f76f2964 Profile-iptc: 19738 bytes Thanks

    Read the article

  • NetBeans IDE 6.8 not working nicely with cygwin 1.7.5.1

    - by Milktrader
    I'm trying to use NetBeans to compile C code and have the following versions from cygwin gcc 3.4.5 g++ 3.4.5 GNU Make 3.81 GNU gdb 6.8.0 Here are the messages from trying to compile the Welcome program /usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf make[1]: Entering directory `/cygdrive/c/Users/Milktrader/Documents/NetBeansProjects/Welcome_1' /usr/bin/make -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/welcome_1.exe make[2]: Entering directory /cygdrive/c/Users/Milktrader/Documents/NetBeansProjects/Welcome_1' mkdir -p build/Debug/MinGW-Windows make[2]: mkdir: Command not found make[2]: *** [build/Debug/MinGW-Windows/welcome.o] Error 127 make[2]: Leaving directory/cygdrive/c/Users/Milktrader/Documents/NetBeansProjects Welcome_1' make[1]: * [.build-conf] Error 2 make[1]: Leaving directory `/cygdrive/c/Users/Milktrader/Documents/NetBeansProjects/Welcome_1' make: * [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 1s)\ Is it worth downloading a previous cygwin version (1.5)? Blog tutorials (including the NetBeans site) have this older version in their examples.

    Read the article

  • Need help with displaying the message correctly in the pole display

    - by SA
    Hi, I am using an HP RS232 pole display with the following setting: Char type: USA/Europe (default) Command mode: EPSON (default) Baud rate: 9600, n , 8, 1 (default?) Passthru None (Default) Here's the code using System.IO.Ports; private SerialPort port; port = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One); port.Handshake = Handshake.None; Port.WriteLine("Welocome to something something"); It has 2 lines consisting of 20 characters each with a total of 40 characters. I have no control how and where the characters get displayed. I have set it to accept ASCII char set and so I am able to type as is visble in the Writeline message

    Read the article

  • Error while trying to parse a website url using python . how to debug it ?

    - by mekasperasky
    #!/usr/bin/python import json import urllib from BeautifulSoup import BeautifulSoup from BeautifulSoup import BeautifulStoneSoup import BeautifulSoup def showsome(searchfor): query = urllib.urlencode({'q': searchfor}) url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&%s' % query search_response = urllib.urlopen(url) search_results = search_response.read() results = json.loads(search_results) data = results['responseData'] print 'Total results: %s' % data['cursor']['estimatedResultCount'] hits = data['results'] print 'Top %d hits:' % len(hits) for h in hits: print ' ', h['url'] resp = urllib.urlopen(h['url']) res = resp.read() soup = BeautifulSoup(res) print soup.prettify() print 'For more results, see %s' % data['cursor']['moreResultsUrl'] showsome('sachin') What is the wrong in this code ? Note all the 4 links that I am getting out of the search , I am feeding it back to extract the contents out of it , and then use BeautifulSoup to parse it . How should I go about it ?

    Read the article

  • Placement of defensive structures in a game

    - by Martin
    I am working on an AI bot for the game Defcon. The game has cities, with varying populations, and defensive structures with limited range. I'm trying to work out a good algorithm for placing defence towers. Cities with higher populations are more important to defend Losing a defence tower is a blow, so towers should be placed reasonably close together Towers and cities can only be placed on land So, with these three rules, we see that the best kind of placement is towers being placed in a ring around the largest population areas (although I don't want an algorithm just to blindly place a ring around the highest area of population, sometime there might be 2 sets of cities far apart, in which case the algorithm should make 2 circles, each one half my total towers). I'm wondering what kind of algorithms might be used for determining placement of towers?

    Read the article

  • What's happening between onResume and the activity is really displayed?

    - by Johnny
    I didn't nothing in the onResume of my Activity, but it still takes about 5 seconds between the onResume is called and the activity is really displayed. What's happening under there? Here is the code snip: onResume: @Override protected void onResume() { Log.d(TAG, "on resume >>>"); super.onResume(); } logcat: 05-28 10:36:05.621 D/LoginDialogActivity( 447): on resume >>> 05-28 10:36:06.231 I/ARMAssembler( 52): generated scanline__00000077:03010104_00000004_00000000 [ 22 ipp] (41 ins) at [0x3e3358:0x3e33fc] in 5646001 ns 05-28 10:36:10.690 I/ActivityManager( 52): Displayed activity com.aimi.appstore/.ui.activity.LoginDialogActivity: 5169 ms (total 5331 ms) AndroidManifest.xml: <activity android:name=".ui.activity.LoginDialogActivity" android:theme="@android:style/Theme.Dialog" />

    Read the article

  • What does the Facebook Ads API link_click metric indicate in adcampaignstats

    - by Michael Baird
    I would love to get a definitive answer or a glossary that defines the data returned from the Facebook ads api adcampaignstats. Specifically the difference between the actions and inline_actions. Below is the result for a dark post, and I like to know what the "link_click" metric in actions and inline_actions actually counts. i.e. Does this tell me that in total the campaign had 342 links clicked, or does "link_click" in "actions" and "inline_actions" indicate something else? act_{ad_account_id}/adcampaignstats?campaign_ids=[123456] { "is_completed": false, "social_unique_clicks": 0, "topline_id": 0, "unique_impressions": 0, "start_time": null, "campaign_id": 123456, "actions": { "offsite_conversion.registration": 14, "post_like": 2, "like": 5, "photo_view": 1, "link_click": 180 }, "clicks": 301, "inline_actions": { "comment": 0, "video_play": 0, "title_clicks": 0, "like": 10, "rsvp_maybe": 0, "post_like": 13, "photo_view": 0, "rsvp_yes": 0, "link_click": 162, "question_vote": 0 }, }

    Read the article

  • JQuery/JavaScript div tag "containment" approach/algorithm?

    - by Pete Alvin
    Background: I've created an online circuit design application where div tags are containers that contain smaller div containers and so forth. Question: For any particular div tag I need to quickly identify if it contains other div tags (that may in turn contain other div tags). I've searched JQuery and I don't see any built-in routine for this. Does anyone know of an algorithm that's quicker than O(n^2)? Seems like I have to walk the list of div tags in an outer loop (n) and have an inner loop (another n) to compare against all other div tags and do a "containment test" (position, width, height), building a list of contained div tags. That's n-squared. Then I have to build a list of all nested div tags by concatenating contained lists. So the total would be O(n^2)+n. There must be a better way?

    Read the article

  • Flex 4.6 Mobile - Scrolling to the last added item in a dataGrid with variableRowHeight

    - by user1305331
    I'm trying to set the scroll vertical position of a spark dataGrid to show the items as I add them to the grid. I know you can set the scroll position like this: dataGrid.scroller.viewport.verticalScrollPosition = itemPosition*rowHeight; The problem is that the dataGrid have variableRowHeight, as each row word wraps their name labels, and I don't know how to get each row height. I though of getting the itemRenderer associated with every item as I add it to the grid, and keep the total row height value in a variable, but don't know how to achieve that. Is there any way to set the scroll position of a dataGrid with variableRowHeight to show the last added item?

    Read the article

  • .Net OutOfMemory on Server but not Desktop

    - by Jörg Battermann
    Is it possible that the .Net framework behaves differently when it comes to garbage collection / memory limitations on server environments? I am running explicitly x86 compiled apps on a 64bit server machine with 32gbs of physical ram and I am running out of memory (SystemOutOfMemoryException) even though nothing but that particular app is running and the server/all other apps utilize 520mb total.. but I cannot reproduce that behaviour on my own (client win7) machine. Now I know that the app -is- memory intensive, but why is it causing problems on the server and not on the client?

    Read the article

  • Little Employee/Shift timetable HELP!!!

    - by DAVID
    Morning Guys, I have the following tables: operator(ope_id, ope_name) ope_shift(ope_id, shift_id, shift_date) shift(shift_id, shift_start, shift_end) here is a better view of the data http://latinunit.net/emp_shift.txt here is the screenshot of a select statement to the tables http://img256.imageshack.us/img256/4013/opeshift.jpg im using this code SELECT OPE_ID, COUNT(OPE_ID) AS Total_shifts from operator_shift group by ope_id; to view the current total shifts per operator and it works, BUT if there was 500 more rows it would count them all aswell, THE QUESTION is, anyone has a better way of making my database work, or how can i tell the system that those rows are a whole month, i remember i friend said something about count then devide by 30 but im not sure, what if the month isnt finished? and you want to show the emp with highest shifts to date

    Read the article

  • counting number of new entries in guest book

    - by Lucka
    I want to display the number of new(unseen) guest entries in the guest book of a user. I was thinking to count it so that, total number of entries in guestbook minus entries in guestbook at time of last login. However, I think that is not a good approach, because if the user logs in but does not go to his guestbook, in that case, the entries should be still "new", also if some new entry is posted in the user while he is online, it does not work in that case too. Any suggested please?

    Read the article

  • Computer graphics: programatically create duotone (or separations)

    - by TarGz
    There are special kind of images called "duotone" which have just two channels. It is mostly used when you want to achive higher quality reproduction - have a printing press with two colors (black , gray). My question is, I have normal gray-scale image, how to convert it to duotone? I know I can tweak the curves in Photoshop - this is not what I'm asking, rather than how to do it programmatically? Perhaps there is a library which can do just that? What about "dot gain compensation"? "Total ink coverage"?

    Read the article

  • java System.nanoTime is really slow. Is it possible to implement a high performance java profiler?

    - by willpowerforever
    I did a test and found the overhead of a function call to System.nanoTime() is at least 500 ns on my machine. Seemed that it is very hard to have a high performance java profiler. For enterprise software, suppose a function takes about 350 seconds and has 12,500,000,000 times of method calls. Therefore, the number of calls to System.nanoTime() is: 12,500,000,000 * 2 = 25,000,000,000 (one for start timestamp, one for end timestamp) And the overhead of System.nanoTime in total is: 500 ns * 25,000,000,000 = 500 * 25000 s = 12500000s. Note: all data from real case. Any better way to acquire the timestamp?

    Read the article

  • adding up value of array and getting the average

    - by sea_1987
    I have an array that looks similar to this, [4] => Common_Model Object ( [id] => 4 [name] => [date_created] => [last_updated] => [user_id_updated] => [_table] => [_aliases] => Array ( [id] => 4 [name] => [date_created] => [date_updated] => [user_id_updated] => [rating] => 3 [recipe_id] => 5 ) [_nonDBAliases] => Array ( ) [_default] => Array ( ) [_related] => Array ( ) [_enums] => [_alsoDelete] => Array ( ) [_readOnly] => Array ( [0] => date_updated ) [_valArgs] => Array ( ) [_valArgsHash] => Array ( [default] => Array ( ) ) [_valAliases] => Array ( ) [_extraData] => Array ( ) [_inputs] => Array ( ) [_tableName] => jm_ratings [_tablePrefix] => [_niceDateUpdated] => 1st Jan 70 [_niceDateCreated] => 1st Jan 70 [_fetchAdminData] => [_mCache] => [_assets] => Array ( ) ) [3] => Common_Model Object ( [id] => 3 [name] => [date_created] => [last_updated] => [user_id_updated] => [_table] => [_aliases] => Array ( [id] => 3 [name] => [date_created] => [date_updated] => [user_id_updated] => [rating] => 1 [recipe_id] => 5 ) [_nonDBAliases] => Array ( ) [_default] => Array ( ) [_related] => Array ( ) [_enums] => [_alsoDelete] => Array ( ) [_readOnly] => Array ( [0] => date_updated ) [_valArgs] => Array ( ) [_valArgsHash] => Array ( [default] => Array ( ) ) [_valAliases] => Array ( ) [_extraData] => Array ( ) [_inputs] => Array ( ) [_tableName] => jm_ratings [_tablePrefix] => [_niceDateUpdated] => 1st Jan 70 [_niceDateCreated] => 1st Jan 70 [_fetchAdminData] => [_mCache] => [_assets] => Array ( ) ) [2] => Common_Model Object ( [id] => 2 [name] => [date_created] => [last_updated] => [user_id_updated] => [_table] => [_aliases] => Array ( [id] => 2 [name] => [date_created] => [date_updated] => [user_id_updated] => [rating] => 1 [recipe_id] => 5 ) [_nonDBAliases] => Array ( ) [_default] => Array ( ) [_related] => Array ( ) [_enums] => [_alsoDelete] => Array ( ) [_readOnly] => Array ( [0] => date_updated ) [_valArgs] => Array ( ) [_valArgsHash] => Array ( [default] => Array ( ) ) [_valAliases] => Array ( ) [_extraData] => Array ( ) [_inputs] => Array ( ) [_tableName] => jm_ratings [_tablePrefix] => [_niceDateUpdated] => 1st Jan 70 [_niceDateCreated] => 1st Jan 70 [_fetchAdminData] => [_mCache] => [_assets] => Array ( ) ) I wanting to add up the [rating] and get the mean average. But I dont know how do this with PHP, my attempt looks like this, <?php foreach ($rt as $rating) { $total = $rating->rating + $rating->rating } $total / count($rt); ?>

    Read the article

  • How to Sum calulated fields

    - by Nazero Jerry
    I‘d like to ask I question that here that I think would be easy to some people. Ok I have query that return records of two related tables. (One to many) In this query I have about 3 to 4 calculated fields that are based on the fields from the 2 tables. Now I want to have a group by clause for names and sum clause to sum the calculated fields but it ends up in error message saying: “You tried to execute a query that is not part of aggregate function” So I decided to just run the query without the totals *(ie no group by , sum etc,,,) : And then I created another query that totals my previous query. ( i.e. using group by clause for names and sum for calculated fields… no calculation here) This is fine ( I use to do this) but I don’t like having two queries just to get summary total. Is their any other way of doing this in the design view and create only one query?. I would very much appreciate. Thankyou: JM

    Read the article

  • Doctrine_Table_Exception: Unknown relation alias shoesTable [closed]

    - by Sadiqur Rahman
    I am getting following error message: Doctrine_Table_Exception: Unknown relation alias shoesTable in /home/public_html/projects/giftshoes/system/database/doctrine/Doctrine/Relation/Parser.php on line 237 My Code is below: ------------BaseShoe------------ <?php // Connection Component Binding Doctrine_Manager::getInstance()->bindComponent('Shoes', 'sadiqsof_giftshoes'); /** * BaseShoes * * This class has been auto-generated by the Doctrine ORM Framework * * @property integer $sku * @property string $name * @property string $keywords * @property string $description * @property string $manufacturer * @property float $sale_price * @property float $price * @property string $url * @property string $image * @property string $category * @property Doctrine_Collection $Viewes * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $ */ abstract class BaseShoes extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('shoes'); $this->hasColumn('sku', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'primary' => true, 'autoincrement' => false, 'length' => '4', )); $this->hasColumn('name', 'string', 255, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '255', )); $this->hasColumn('keywords', 'string', 255, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '255', )); $this->hasColumn('description', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('manufacturer', 'string', 20, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '20', )); $this->hasColumn('sale_price', 'float', null, array( 'type' => 'float', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('price', 'float', null, array( 'type' => 'float', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('url', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('image', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('category', 'string', 50, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '50', )); } public function setUp() { parent::setUp(); $this->hasMany('Viewes', array( 'local' => 'sku', 'foreign' => 'sku')); } } --------------ShoesTable-------- <?php class ShoesTable extends Doctrine_Table { function getAllShoes($from = 0, $total = 15) { $q = Doctrine_Query::create() ->from('Shoes') ->limit($total) ->offset($from); return $q->execute(array(), Doctrine::HYDRATE_ARRAY); } } ---------------Shoes Model----------------- <?php /** * Shoes * * This class has been auto-generated by the Doctrine ORM Framework * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $ */ class Shoes extends BaseShoes { function __construct() { parent::__construct(); $this->shoesTable = Doctrine::getTable('Shoes'); } function getAllShoes() { return $this->shoesTable->getAllShoes(); } }

    Read the article

  • Partial Git deployment strategy?

    - by MatW
    I need to setup a Kohana dev environment that allows me to make full use of shared module / system classes across separate applications. Each application typically belonging to a different client. I use Git for source control, but am struggling to come up with a clean deployment method that will allow me to pull only those parts of the dev environment specific to a client / app down into that client's production environment (assuming that the client's production environment will have Git installed). Dev enviroment: - kohana - applications - clientapp1 - clientapp2 - modules - public_html - clientapp1 - clientapp2 - system - 3.0.1 - 3.0.5 Client 1's production environment: - / - applications - clientapp1 - modules - public_html - client_app1 - system - 3.0.5 Naturally, I want to have total control over each client "sub repo" as if it were an independent repo (in terms of gitignore, etc). I have seen topics that cover Git's sparse checkout feature, but it seems like it may cause a few problems down the line from a maintenance point of view, and I don't like the idea of the entire repo's metadata existing in client's production environment repo. As you can probably tell, I'm not exactly a Git poweruser, so any suggestions / wisdom are very welcome!

    Read the article

  • How many instructions to access pointer in C?

    - by Derek
    Hi All, I am trying to figure out how many clock cycles or total instructions it takes to access a pointer in C. I dont think I know how to figure out for example, p-x = d-a + f-b i would assume two loads per pointer, just guessing that there would be a load for the pointer, and a load for the value. So in this operations, the pointer resolution would be a much larger factor than the actual addition, as far as trying to speed this code up, right? This may depend on the compiler and architecture implemented, but am I on the right track? I have seen some code where each value used in say, 3 additions, came from a f2->sum = p1->p2->p3->x + p1->p2->p3->a + p1->p2->p3->m type of structure, and I am trying to define how bad this is

    Read the article

  • Displaying build times in Visual Studio?

    - by Roger Lipscombe
    Our build server is taking too long to build one of our C++ projects. It uses Visual Studio 2008. Is there any way to get devenv.com to log the time taken to build each project in the solution, so that I know where to focus my efforts? Improved hardware is not an option in this case. I've tried setting the output verbosity (under Tools / Options / Projects and Solutions / Build and Run / MSBuild project build output verbosity). This doesn't seem to have any effect in the IDE. When running MSBuild from the command line (and, for Visual Studio 2008, it needs to be MSBuild v3.5), it displays the total time elapsed at the end, but not in the IDE. I really wanted a time-taken report for each project in the solution, so that I could figure out where the build process was taking its time. Alternatively, since we actually use NAnt to drive the build process (we use Jetbrains TeamCity), is there a way to get NAnt to tell me the time taken for each step?

    Read the article

  • google maps v3 distance

    - by Shane
    Trying to create a new version of the map functions seen here: http://www.daftlogic.com/projects-google-maps-distance-calculator.htm but using the v3 api. So far I am able to set markers on click and can draw the geodesic polyline. The issues I am currently running into are: Updating the poly-line on marker drag I'm pretty sure I have to put each marker in an array and do a for loop so that I can keep clicking and adding points that will add to the total distance. Properly displaying distance. I have created a jsfiddle: http://jsfiddle.net/wyZyS/ EDIT: I realize I have nothing calling the "update" function. I am trying to create the array for each marker currently. The calculation you see is converting meters to nautical miles.

    Read the article

  • How to get a reference to a method's caller object from within the method in Objective-C

    - by shakeelw
    Hi guys. I have a few text fields and text views on my application's view. The keyboard comes up when I click in anyone of them. I have a method that gets called when any one of these objects is tapped in. However, I would like the method to execute its code only if the a certain Text Field(s) or a certain Text View(s) is tapped in. I would therefore like to have something like this in the method body: { if(currentField != mySpecialField) {return;} //Rest of the method code... } Now, my question is, how do I get a reference to the currently tapped in field so that I can perform the if-check. Thanks guys. I'm a total noobee in Objective-C. :(

    Read the article

  • iphone moving direction using accelerometer

    - by Ruchir Shah
    Hi, I want some help on UIAccelerometer class. I want to find some way to find out or distinguish when I wave iphone device from right-to-left and the left-to-right. I am getting x,y,z values as well as interval value. I am also getting velocity and distance calculated from normal physics rule. Distance = (prevDist + sqrt(pow((prevx - acceleration.x), 2) + pow((prevy - acceleration.y), 2) + pow((prevz - acceleration.z), 2))) Velocity = (Distance * timeintercal) { here distance means newdistance-prevdistance and timeinterval for that distance } When I am moving iphone device right-to-left then left-to-right I am getting total distance traveld in both direction and velocity at regular intervals. Can you help me how I can find out that I am moving iphone device left-to-right or right-to-left? Help would be appreciated. Thanks.

    Read the article

  • algorithm advice for finding maximum items within a time period

    - by darren
    Hi everyone. I have a database schema that is similar to the following: | User | Event | Date |--------|---------------|------ | 111 | Walked dog | 2009-10-1 | 222 | Walked dog | 2009-10-2 | 333 | Fed Fish | 2009-10-5 | 222 | Did Laundry | 2009-10-6 | 111 | Fed Fish | 2009-10-7 | 111 | Walked dog | 2009-10-18 | 222 | Walked dog | 2009-10-19 | 111 | Fed Fish | 2009-10-21 I would like to produce a query that returns the maximum number of times a user performs some action within a time period. For example, given a time period of 5 days, what is the maximum number of times user 111 walked the dog? The most obvious solution would be to start at some zero point and move forward each day, summing up 5 day periods along the way, then taking the maximum total out of all the 5 day windows. the approach seems incredibly costly however. I would appreciate any suggestions you may have.

    Read the article

< Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >