Search Results

Search found 209 results on 9 pages for 'taps'.

Page 1/9 | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Detecting taps on a UIWebView

    - by dubbeat
    Hi, I'm trying to find a way to detect a double tap on a UIWebview. I want to use this action to close it. I however can't find and methods in the documentation for UIWebview taps. Whats the best to add taps to a uiwebview? I tried a tutorial here http://mithin.in/2009/08/26/detecting-taps-and-events-on-uiwebview-the-right-way/ But I don't know how to change my UIWindow to a tap detecting window. Does the above link seem like the best approach or could you suggest another way to remove my WebView?

    Read the article

  • Heroku taps push weirdness...

    - by holden
    I have the strangest experience using taps to move data between my machine and heroku. It works fine except that it seems to loose 0s directly behind the decimal place for my geo coordinates. Ie 50.0519322 for some reason gets set to 50.519322... no idea why. When I pull the data from the remote location ie. heroku db:pull... it works fine, all decimal places intact on my machine, however, when i push it back to the remote server it loses these zeros. Especially directly behind the decimal place, though I haven't noticed it elsewhere yet. At first I was storing the lat and lng as simply numeric but refined it to: change_column :places, :lat, :numeric, :precision => 15, :scale => 10 change_column :places, :lng, :numeric, :precision => 15, :scale => 10 With no result, any ideas what's going on? From the console on the remote server i get the lat as being: #<BigDecimal:2aebcc5967c0,'0.50519322E2',18(18)> and my machine as: #<BigDecimal:10232f7c8,'0.50519322E2',12(16)> which is also odd, the second one because it shows up as 50.0519322 when i edit it thru my view but when i do to_f via console it gives me 50.519322

    Read the article

  • Why do I get this error when I try to push my SQLite3 to Postgresql (via Taps) on Cedar Stack?

    - by rhodee
    I've done quite a bit of research on Heroku Dev Center and I am now looking to the community for help. Here is my problem. I can not push my db to Heroku Cedar Stack. I am trying to migrate a sqlite database to postgresql via Taps gem. When I am ready to deploy I run: bundle install --without production heroku run db:push I get the following result: Running db:seed attached to terminal... up, run.17 sh: db:seed: not found heroku run rake db:migrate And when I run the migration: heroku run rake db:migrate I get the following: Running rake db:migrate attached to terminal... up, run.18 rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) /usr/local/lib/ruby/1.9.1/rake.rb:2367:in `raw_load_rakefile' /usr/local/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile' /usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling' /usr/local/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile' /usr/local/lib/ruby/1.9.1/rake.rb:1991:in `run' /usr/local/bin/rake:31:in `<main>' Everytime I push to Heroku (git push heroku master) it fails because my gem file is attempting to install sqlite3 gem-even though its inside of the development and test groups in my Gemfile. My database.yml production environment still points to sqlite adapter even after I have run the following command successfully: heroku config:add BUNDLE_WITHOUT="test development" --app app_name_on_heroku Out of ideas. Please help. If its useful I can post results of my gemfile, heroku ps and logs. Cheers UPDATE: After following @John's direction I now receive the following terminal message. Sending schema Schema: 100% |==========================================| Time: 00:00:07 Sending indexes schema_migrat: 100% |==========================================| Time: 00:00:00 Sending data 4 tables, 6 records schema_migrat: 0% | | ETA: --:--:-- Saving session to push_201111070749.dat.. !!! Caught Server Exception HTTP CODE: 500 Taps Server Error: LoadError: no such file to load -- sequel/adapters/ And the following warnings: ["/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:in require'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:inblock in tsk_require'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:72:in block in check_requiring_thread'", "<internal:prelude>:10:insynchronize'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:69:in check_requiring_thread'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:intsk_require'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:25:in adapter_class'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:54:inconnect'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:119:in connect'", "/app/lib/taps/db_session.rb:14:inconn'", "/app/lib/taps/server.rb:91:in block in <class:Server>'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:incall'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in block in route'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:ininstance_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in route_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:500:inblock (2 levels) in route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:inblock in route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in each'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:inroute!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:601:in dispatch!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:inblock in call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in instance_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:inblock in invoke'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:ininvoke'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:399:incall'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/auth/basic.rb:25:in call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:inblock in call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in synchronize'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:incall'", "/home/heroku_rack/lib/static_assets.rb:9:in call'", "/home/heroku_rack/lib/last_access.rb:15:incall'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:47:in block in call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:ineach'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in call'", "/home/heroku_rack/lib/date_header.rb:14:incall'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:77:in call'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:76:inblock in pre_process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in catch'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:inpre_process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:57:in process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:42:inreceive_data'", "/app/.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in run_machine'", "/app/.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:inrun'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/server.rb:156:instart'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:inrun_command'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:143:in run!'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/bin/thin:6:in'", "/usr/ruby1.9.2/bin/thin:19:in load'", "/usr/ruby1.9.2/bin/thin:19:in'"]

    Read the article

  • can we use timer in taps??

    - by user317149
    i m working on app,in which user taps to shoot bullets, i want user to restrict their taps, like he next tap or touch should be counted after 1 or 3 seconds, is their any snippet,i can use to rtestrict user for continiously tapoping/touch? quick reply is aleways appreciated/ regards shishir

    Read the article

  • Iphone: UIWebview and double taps

    - by Eyal
    I would like to trap a double tap event in a UIWebView. I have derived a class from UIWebController. When I double tap it seams that the UIWebController itself is responding to my double taps instead of my class. The weird thing is that when I change the inheritance to inherit from UIView everything works just fine. Below are snippets from my code which is supposed to invoke a pop-up when double tapped. In the init function: //Setup action for double tap UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)]; tap.numberOfTapsRequired = 2; [super addGestureRecognizer:tap]; [tap release]; And Also: - (void)handleDoubleTap:(UIGestureRecognizer *)gestureRecognizer { UIAlertView *someError = [[UIAlertView alloc] initWithTitle: @"Network error" message: @"Hello" delegate: self cancelButtonTitle: @"Ok" otherButtonTitles: nil]; [someError show]; [someError release]; //[[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_FLIP_TO_PAGE_VIEW object:nil]; }

    Read the article

  • UISegmentedControl register taps on selected segment

    - by Jongsma
    Hi, I have a segmented control where the user can select how to order a list. Works fine. However, I would like that when an already selected segment is tapped, the order gets inverted. I have all the code in place, but I don't know how to register the taps on those segments. It seems the only control event you can use is UIControlEventValueChanged, but that isn't working (since the selected segment isn't actually changing). Is there a solution for this? And if so, what is it? Thanks in advance!

    Read the article

  • Double-tap or two single-taps?

    - by Jaka Jancar
    What is the time limit for two taps to be considered a double-tap, on the iPhone OS? // Edit: Why is this important? In order to handle single-tap and double-tap differently, Apple's guide says to do performSelector...afterDelay with some 'reasonable' interval on first tap (and cancel it later if the second tap is detected). The problem is that if the interval is too short (0.1), the single tap action will be performed even when double-tapping (if relying only on tapCount, that is). If it's too long (0.8), the user will be waiting unnecessarily for the single-tap to be recognized, when there is no possibility for a double-tap. It has to be exactly the correct number, in order to work optimally, but definitely not smaller, or there's a chance for bugs (simultaneous single-tap and double-tap).

    Read the article

  • android keylistener losing key taps

    - by miannelle
    I am using a keylistener to get key taps. The problem is that once you tap the delete key, the next key tap is not registering. The key tap after that keeps working. If I tap 2 deletes in a row, they work, just no other keys. They just disappear. I put in a log test before the "if (keycode" section and it shows nothing after the first delete is pressed, unless it is another delete. I am using the following code (Thanks Shawn).: itemPrice.setKeyListener(new CalculatorKeyListener()); itemPrice.setRawInputType(Configuration.KEYBOARD_12KEY); class CalculatorKeyListener extends NumberKeyListener { public int getInputType() { return InputType.TYPE_CLASS_NUMBER; } @Override public boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event) { if (keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9) { digitPressed(keyCode - KeyEvent.KEYCODE_0); } else if (keyCode == KeyEvent.KEYCODE_DEL) { deletePressed(); } return true; } @Override protected char[] getAcceptedChars() { return new char[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; } } With this problem the keylistener provides no value to me. There must be something that I am missing. Thanks,

    Read the article

  • Rapid taps on an OpenGL ES app introducing input delay

    - by Tim R.
    I am starting out writing a 2D game in OpenGL ES, and I have encountered an odd problem: if I rapidly tap the touchscreen, the input starts lagging behind the display. The more times I tap, the more delay it causes between the input and any indication of that input onscreen. It only happens if I intentionally tap very rapidly, but not from tapping and dragging with any number of fingers. What could be causing this? Excessive details follow: Both accelerometer input and taps are delayed by just tapping. The only events I am responding to are touchesBegan (below) in my EAGLView and accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration in my Game object. There doesn't seem to be any upper limit to the amount of delay: I've gotten up to 12 seconds of delay by tapping rapidly with five fingers. I have not seen any drops in framerate (it stays constantly at 60 fps) in the OpenGL ES tool in Instruments or by taking 1/the time between updates. Possibly relevant code: - (void) drawView:(id) sender { [game update:allTouches]; [renderer render:game]; } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { allTouches = [event allTouches]; } allTouches is a pointer that gets passed to my Game every update, which passes it to each GameObject in their update methods.

    Read the article

  • Event taps: Varying results with CGEventPost, kCGSessionEventTap, kCGAnnotatedSessionEventTap, CGEve

    - by kevingessner
    I'm running into a thorny problem with posting an event from an event tap. I'm tapping for NSSystemDefined at kCGHIDEventTap, then replacing the event with a new one. The problem I'm running in to is that depending on how I post the event, it's being seen only by some applications. My test applications are Opera, Firefox, Quicksilver, and Xcode. Here are the different techniques I've tried within my event tap callback, with results. I'm expecting an action (the "correct response") from each app; "system beep" means the nothing-is-bound-to-that-key system sound. Create a new event, and return it from the callback. Opera: no response/system beep, Firefox: no response/system beep, Quicksilver: correct response, Xcode: no response/system beep Create a new event, post to kCGSessionEventTap with CGEventPost, return null. Opera: no response/system beep, Firefox: no response/system beep, Quicksilver: correct response, Xcode: no response/system beep Create a new event, post to kCGAnnotatedSessionEventTap with CGEventPost, return null. Opera: correct response, Firefox: correct response, Quicksilver: no response/system beep, Xcode: no response/system beep Create a new event, post with CGEventTapPostEvent, return null. Opera: no response/system beep, Firefox: no response/system beep, Quicksilver: correct response, Xcode: no response/system beep Create a new event, post to kCGSessionEventTap with CGEventPost, and return new event. Opera: no response/system beep, Firefox: no response/system beep, Quicksilver: correct response, Xcode: no response/system beep Create a new event, post to kCGAnnotatedSessionEventTap with CGEventPost, and return new event. Opera: correct response and system beep, Firefox: correct response and system beep, Quicksilver: correct response and system beep, Xcode: no response/double system beep Create a new event, post with CGEventTapPostEvent, and return new event. Opera: no response/system beep, Firefox: no response/system beep, Quicksilver: correct response, Xcode: no response/system beep (6) is the best, but users are complaining about the extra system beep on correct responses, which I'm guessing is coming from the double-posting of the event. I'm not sure of other combinations to try, or where else to look. Can anyone offer any guidance? Is there any way to get the results of both returning the event from my callback and posting to the annotated tap without doing both? Sorry for the lengthy question; I've been doing a lot of experimenting. Thanks in advance Update: this is the code I use to create the event tap: CFMachPortRef eventTap; eventTap = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, 0,CGEventMaskBit(NX_SYSDEFINED) | (1 << kCGEventKeyDown) | (1 << kCGEventKeyUp), myCGEventCallback, (void *)hidEventQueue);

    Read the article

  • Error when pushing data to Heroku: time zone displacement out of range

    - by J. Pablo Fernández
    I run the following command to push the contents of my local database to Heroku: heroku db:push --app my-app and from my home computer it works flawlessly but from my work computer I get this error: Taps Server Error: PGError: ERROR: time zone displacement out of range: "2011-11-15 12:00:00.000000+5894114400" I'm not sure where that date is coming from, I can't find it in the data anywhere. Any ideas what's going on and/or how to fix it? Thanks.

    Read the article

  • Problem with heroku db:pull while at work.

    - by shopfiber
    When I try to pull down a database while at work I get the following error: :>heroku db:pull Auto-detected local database: sqlite://db/development.sqlite3 Bad credentials given for http://heroku:[hidden]@taps.heroku.com Note that when I am at home I am able to run this command just fine. I wanted to know if you have any suggestions for common reasons I would get this error.

    Read the article

  • Heroku Problem During Database Pull of Rails App: Mysql::Error MySQL server has gone away

    - by Rich Apodaca
    Attempting to pull my database from Heroku gives an error partway through the process (below). Using: Snow Leopard; heroku-1.8.2; taps-0.2.26; rails-2.3.5; mysql-5.1.42. Database is smallish, as you can see from the error message. Heroku tech support says it's a problem on my system, but offers nothing in the way of how to solve it. I've seen the issue reported before - for example here. How can I get around this problem? The error: $ heroku db:pull Auto-detected local database: mysql://[...]@localhost/[...]?encoding=utf8 Receiving schema Receiving data 17 tables, 9,609 records [...] /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/adapters/mysql.rb:166:in `query': Mysql::Error MySQL server has gone away (Sequel::DatabaseError) from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/adapters/mysql.rb:166:in `_execute' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/adapters/mysql.rb:125:in `execute' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/connection_pool.rb:101:in `hold' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/database.rb:461:in `synchronize' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/adapters/mysql.rb:125:in `execute' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/database.rb:296:in `execute_dui' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/dataset.rb:276:in `execute_dui' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/adapters/mysql.rb:365:in `execute_dui' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/dataset/convenience.rb:126:in `import' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/dataset/convenience.rb:126:in `each' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/dataset/convenience.rb:126:in `import' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/adapters/mysql.rb:144:in `transaction' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/connection_pool.rb:108:in `hold' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/database.rb:461:in `synchronize' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/adapters/mysql.rb:138:in `transaction' from /Library/Ruby/Gems/1.8/gems/sequel-3.0.0/lib/sequel/dataset/convenience.rb:126:in `import' from /Library/Ruby/Gems/1.8/gems/taps-0.2.26/lib/taps/client_session.rb:211:in `cmd_receive_data' from /Library/Ruby/Gems/1.8/gems/taps-0.2.26/lib/taps/client_session.rb:203:in `loop' from /Library/Ruby/Gems/1.8/gems/taps-0.2.26/lib/taps/client_session.rb:203:in `cmd_receive_data' from /Library/Ruby/Gems/1.8/gems/taps-0.2.26/lib/taps/client_session.rb:196:in `each' from /Library/Ruby/Gems/1.8/gems/taps-0.2.26/lib/taps/client_session.rb:196:in `cmd_receive_data' from /Library/Ruby/Gems/1.8/gems/taps-0.2.26/lib/taps/client_session.rb:175:in `cmd_receive' from /Library/Ruby/Gems/1.8/gems/heroku-1.8.2/bin/../lib/heroku/commands/db.rb:17:in `pull' from /Library/Ruby/Gems/1.8/gems/heroku-1.8.2/bin/../lib/heroku/commands/db.rb:119:in `taps_client' from /Library/Ruby/Gems/1.8/gems/taps-0.2.26/lib/taps/client_session.rb:21:in `start' from /Library/Ruby/Gems/1.8/gems/heroku-1.8.2/bin/../lib/heroku/commands/db.rb:115:in `taps_client' from /Library/Ruby/Gems/1.8/gems/heroku-1.8.2/bin/../lib/heroku/commands/db.rb:16:in `pull' from /Library/Ruby/Gems/1.8/gems/heroku-1.8.2/bin/../lib/heroku/command.rb:45:in `send' from /Library/Ruby/Gems/1.8/gems/heroku-1.8.2/bin/../lib/heroku/command.rb:45:in `run_internal' from /Library/Ruby/Gems/1.8/gems/heroku-1.8.2/bin/../lib/heroku/command.rb:17:in `run' from /Library/Ruby/Gems/1.8/gems/heroku-1.8.2/bin/heroku:14 from /usr/bin/heroku:19:in `load' from /usr/bin/heroku:19

    Read the article

  • Connection error with heroku db:push with postgresql

    - by Toby Hede
    I have suddenly started seeing this strange error when trying to push my database to heroku. > heroku db:push Auto-detected local database: postgres://infinity:infinity@localhost/infinity_development?encoding=utf8 Failed to connect to database: Sequel::DatabaseConnectionError -> TypeError wrong argument type String (expected Array) My app works fine - the credentials are all set locally.

    Read the article

  • Heroku: Postgres type operator error after migrating DB from MySQL

    - by sevennineteen
    This is a follow-up to a question I'd asked earlier which phrased this as more of a programming problem than a database problem. http://stackoverflow.com/questions/2935985/postgres-error-with-sinatra-haml-datamapper-on-heroku I believe the problem has been isolated to the storage of the ID column in Heroku's Postgres database after running db:push. In short, my app runs properly on my original MySQL database, but throws Postgres errors on Heroku when executing any query on the ID column, which seems to have been stored in Postgres as TEXT even though it is stored as INT in MySQL. My question is why the ID column is being created as INT in Postgres on the data transfer to Heroku, and whether there's any way for me to prevent this. Here's the output from a heroku console session which demonstrates the issue: Ruby console for myapp.heroku.com >> Post.first.title => "Welcome to First!" >> Post.first.title.class => String >> Post.first.id => 1 >> Post.first.id.class => Fixnum >> Post[1] PostgresError: ERROR: operator does not exist: text = integer LINE 1: ...", "title", "created_at" FROM "posts" WHERE ("id" = 1) ORDER... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. Query: SELECT "id", "name", "email", "url", "title", "created_at" FROM "posts" WHERE ("id" = 1) ORDER BY "id" LIMIT 1 Thanks!

    Read the article

  • iphone - grouping UIImageViews x blocking elements

    - by Mike
    I have to rotate several UIImageViews around a specific center. To accomplish this I am using the famous trick of putting these views as subviews of a larger one and rotating that one. The problem is that these subviews have to detect touches, because each one has buttons on it. The hierarchy is like this LARGE_VIEW | |_____ imageView1 | |_________ button1 | |_________ button2 | |_________ button3 | |_____ imageView2 |_________ button4 |_________ button5 |_________ button6 etc So, to make buttons respond to tap, I had to make this; [LARGE_VIEW setUserInteractionEnabled:YES]; [imageView1 setUserInteractionEnabled:YES]; [imageView2 setUserInteractionEnabled:YES]; ImageView1 and 2 are two vertical rows of buttons on each side of the screen. The problem is that there's another view below LARGE_VIEW and this view is not receiving the taps, because LARGE_VIEW is intercepting them first. I don't need LARGE_VIEW to detect any taps except on the two areas where imageView 1 and 2 are. LARGE_VIEW must let pass taps on the area defined by this rect (52, 0, 768-2*52, 1024). ImageView1 and 2 have this size: 52 pixels wide and 1024 pixels high (iPad). ImageView1's rect is: (0, 0, 52, 1024) and ImageView2's rect is: (768-52, 0, 52, 1024) LARGE_VIEW must let pass taps on the area defined by this rect (52, 0, 768-2*52, 1024). How to solve that? I need LARGE_VIEW detect taps on each rect defined on my previous paragraph and pass these taps to its subviews and just let pass taps outside these rects to the app, so other views BELOW, can detect taps too. thanks.

    Read the article

  • How to Get Search Bar in Tableview to Appear When User Taps Search Icon at the top of sectionIndex s

    - by Gorgando
    I have a tableview with an indexed scrollbar on the right side that shows the letters A-Z and has a magnifying glass icon at the top ({search}). All of the letters in the scrollbar appropriately take the user to the corresponding section except for the magnifying glass, which takes the user to "A" and keeps the searchBar hidden. I just want it to go to the very top of the table so that the searchBar shows up when the user taps the magnifying glass icon in the scroll bar. I've been looking all over for ways to do this, but I can't find any way shy of adding the searchBar to the first tableCell and it's own section, which I'd prefer not to do unless it's the only way. Thanks so much!

    Read the article

  • iPhone: Custom UITableViewCell with multiple areas that respond to taps?

    - by Nick
    I've been asked to create a custom UITableViewCell with multiple areas that can be tapped. These areas won't have buttons or any graphics - they'll be invisible. 3 different methods will be called depending on which third of the cell the user taps i.e. || decrementFooCount || viewFooDetails || incrementFooCount || The cell has a few labels on it that need to be visible at all times - the fooName and fooCount. I'm thinking perhaps three hidden UIButtons over the cell? I also need to maintain the swipe to delete default behavior.

    Read the article

  • iPhone - how to track touches and allow button taps at the same time?

    - by Jonathan Cohen
    I'm wondering how to track touches anywhere on the iPhone screen and still have UIButtons respond to taps. I subclassed a UIView, made it full screen and the highest view in the hierarchy, and overrode its pointInside:withEvent method. If I return YES, I'm able to track touches anywhere on the screen but the buttons don't respond (likely because the view is instructed to handle and terminate the touch). If I return NO, the touch passes through the view and the buttons respond, but I'm not able to track touches. Do I need to subclass UIButton or is this possible through the responder chain? What am I doing wrong? - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{ return NO; } //only works if pointInside:withEvent: returns YES. -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ NSLog(@"began"); [self.nextResponder touchesBegan:touches withEvent:event]; } //only works if pointInside:withEvent: returns YES. -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ NSLog(@"end"); [self.nextResponder touchesEnded:touches withEvent:event]; }

    Read the article

  • Linear feedback shift register?

    - by Mattia Gobbi
    Lately I bumped repeatedly into the concept of LFSR, that I find quite interesting because of its links with different fields and also fascinating in itself. It took me some effort to understand, the final help was this really good page, much better than the (at first) cryptic wikipedia entry. So I wanted to write some small code for a program that worked like a LFSR. To be more precise, that somehow showed how a LFSR works. Here's the cleanest thing I could come up with after some lenghtier attempts (Python): def lfsr(seed, taps): sr, xor = seed, 0 while 1: for t in taps: xor += int(sr[t-1]) if xor%2 == 0.0: xor = 0 else: xor = 1 print xor sr, xor = str(xor) + sr[:-1], 0 print sr if sr == seed: break lfsr('11001001', (8,7,6,1)) #example I named "xor" the output of the XOR function, not very correct. However, this is just meant to show how it circles through its possible states, in fact you noticed the register is represented by a string. Not much logical coherence. This can be easily turned into a nice toy you can watch for hours (at least I could :-) def lfsr(seed, taps): import time sr, xor = seed, 0 while 1: for t in taps: xor += int(sr[t-1]) if xor%2 == 0.0: xor = 0 else: xor = 1 print xor print time.sleep(0.75) sr, xor = str(xor) + sr[:-1], 0 print sr print time.sleep(0.75) Then it struck me, what use is this in writing software? I heard it can generate random numbers; is it true? how? So, it would be nice if someone could: explain how to use such a device in software development come up with some code, to support the point above or just like mine to show different ways to do it, in any language Also, as theres not much didactic stuff around about this piece of logic and digital circuitry, it would be nice if this could be a place for noobies (like me) to get a better understanding of this thing, or better, to understand what it is and how it can be useful when writing software. Should have made it a community wiki? That said, if someone feels like golfing... you're welcome.

    Read the article

  • How to load a UIView from a tap?

    - by balexandre
    Hi, I'm new to iPhone Development and I did some examples and seen code and code and more code but I still can't get the when the user taps here show this view using this animation, and go back after (user taps a back button) I did some Tab Bar examples, Utility examples, etc but when I start a project from scratch the code never does what I want :-/ every time I create a View (xib) I also create the controller (h and m files), as all examples are like this, and I have no idea if I can only create 4 Views and just have one controller :-( when a user taps a UITableCell how can I load a new view using an animation? and how can I go back to the UITableCell the user was? kind'a (in C#) myNewForm f = new myNewForm(); f.show(); ... this.Close(); If someone can share some knowledge or a tutorial or a screencast, I will greatly appreciate Thank you!

    Read the article

1 2 3 4 5 6 7 8 9  | Next Page >