Search Results

Search found 1872 results on 75 pages for 'magic trackpad'.

Page 6/75 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Write magic bytes to the stack to monitor its usage

    - by tkarls
    I have a problem on an embedded device that I think might be related to a stack overflow. In order to test this I was planning to fill the stack with magic bytes and then periodically check if the stack has overflowed by examining how much of my magic bytes that are left intact. But I can't get the routine for marking the stack to work. The application keeps crashing instantly. This is what I have done just at the entry point of the program. //fill most of stack with magic bytes int stackvar = 0; int stackAddr = int(&stackvar); int stackAddrEnd = stackAddr - 25000; BYTE* stackEnd = (BYTE*) stackAddrEnd; for(int i = 0; i < 25000; ++i) { *(stackEnd + i) = 0xFA; } Please note that the allocated stack is larger than 25k. So I'm counting on some stack space to already be used at this point. Also note that the stack grows from higher to lower addresses that's why I'm trying to fill from the bottom and up. But as I said, this will crash. I must be missing something here.

    Read the article

  • Avoiding CheckStyle magic number errors in JDBC queries.

    - by Dan
    Hello, I am working on a group project for class and we are trying out CheckStyle. I am fairly comfortable with Java but have never touched JDBC or done any database work before this. I was wondering if there is an elegant way to avoid magic number errors in preparedStatement calls, consider: preparedStatement = connect.prepareStatement("INSERT INTO shows " + "(showid, showtitle, showinfo, genre, youtube)" + "values (default, ?, ?, ?, ?);"); preparedStatement.setString(1, title); preparedStatement.setString(2, info); preparedStatement.setString(3, genre); preparedStatement.setString(4, youtube); result = preparedStatement.executeUpdate(); The setString methods get flagged as magic numbers, so far I just added the numbers 3-10 or so to the ignore list for magic numbers but I was wondering if there was a better way to go about inserting those values into the statement. I also beg you for any other advice that comes to mind seeing that code, I'd like to avoid developing any nasty habits, e.g. should I be using Statement or is PreparedStatement fine? Will that let me refer to column names instead? Is that ideal? etc... Thanks!

    Read the article

  • What does drag lock do in boot camp?

    - by MacBookNewb
    In the control panel for my mac book pro I have an icon called Boot camp. Inside there and inside the trackpad tab I have an option called drag lock. It sounds useful to me as I sometimes find it awkward dragging long distances. I can't figure out how to use it though. Can someone explain how I can find out more info on drag lock? I can't find any references on google. Also even without the dragging option on I can drag.

    Read the article

  • Any "Magic Tricks" For Getting Data Back After Windows 7 Install

    - by user163757
    My old man installed Windows 7 without making a proper backup, and now realizes he left behind some important data. He did a true "clean install", so there is no Windows.old folder in the root directory. However, I believe the format performed on the hard drive was only a quick format, so I am hoping there is some chance at data recovery. I took his hard drive out, and have spent a majority of the weekend researching data recovery options. I paid $70 for the GetDataBack software, but have had little success with it. I can see all of the files I want to restore, however they appear corrupt when I try to open them. With that all being said, does anyone know of a viable way to recover some of this data, or is it a lost cause all together?

    Read the article

  • How can I install an Apple Magic Trackpad on a PC without Boot Camp?

    - by rymo
    I have a Apple Magic Trackpad and I'd like to use it with my PC. I have no other Apple hardware besides the Trackpad. I do not have OSX and thus no Boot Camp CD. The Trackpad uses Bluetooth and will pair with Windows 7 without specific drivers (appears as an HID-Compliant Mouse), but all it will do is point and left click (physical click, no touch tap). With Apple's Windows driver update, I should be able to achieve: Tap to click Dragging Drag lock Secondary click Two-finger scrolling Two-finger secondary tap/click But how can I obtain this driver without Boot Camp installed? Apple's Boot Camp update EXE will not install on my PC (non-Apple hardware).

    Read the article

  • Is -1 a magic number? An anti-pattern? A code smell? Quotes and guidelines from authorities

    - by polygenelubricants
    I've seen -1 used in various APIs, most commonly when searching into a "collection" with zero-based indices, usually to indicate the "not found" index. This "works" because -1 is never a legal index to begin with. It seems that any negative number should work, but I think -1 is almost always used, as some sort of (unwritten?) convention. I would like to limit the scope to Java at least for now. My questions are: What are the official words from Sun regarding using -1 as a "special" return value like this? What quotes are there regarding this issue, from e.g. James Gosling, Josh Bloch, or even other authoritative figures outside of Java? What were some of the notable discussions regarding this issue in the past?

    Read the article

  • Using php's magic function inside another function does not work

    - by Sirber
    I want to use magic function __set() and __get() for storing SQL data inside a php5 class and I get some strange issue using them inside a function: Works: if (!isset($this->sPrimaryKey) || !isset($this->sTable)) return false; $id = $this->{$this->sPrimaryKey}; if (empty($id)) return false; echo 'yaay!'; Does not work: if (!isset($this->sPrimaryKey) || !isset($this->sTable)) return false; if (empty($this->{$this->sPrimaryKey})) return false; echo 'yaay!'; would this be a php bug?

    Read the article

  • Is it magic or what ??

    - by STRIDER
    I am writing a big C code... The code includes recursive bactracking function named Branch() that is called so much... My goal is to write the fastest code to get the best running time... I also have another function Redundant() void Redundant() { int* A; A=(int*)malloc(100*sizeof(int)); } I created two versions. Version A: Redundant() is included in Branch(). Version B: Redundant() is not included in Branch() A run 10 times faster than B !!!! Is is Magic or is it kind of process scheduling or what ??

    Read the article

  • PHP Magic methods not working

    - by user991047
    I am trying to create a registry class with magic __set and __get my class looks like class Registry { private $vars = array(); public function __set($key, $value) { $this->vars[$key] = $value; dump($key, $value); } public function __get($index) { $this->vars[$index]; } } but if i try to save some variable in registry class in gets only the $key the $value is alway NULL. here is the sample code how I am try to call this class $registry = new registry; $registry->router = $router; $registry->title = "Welcome ";

    Read the article

  • Reference table values in a war against magic numbers

    - by Alex N.
    This question bugged me for years now and can't seem to find good solution still. I working in PHP and Java but it sounds like this maybe language-agnostic :) Say we have a standard status reference table that holds status ids for some kind of entity. Further let's assume the table will have just 5 values, and will remain like this for a long time, maybe edited occasionally with addition of a new status. When you fetch a row and need to see what status it is you have 2 options(as I see it at least) - put it straight ID values(magic numbers that is) or use a named constant. Latter seem much cleaner, the question though is where those named constants should leave? In a model class? In a class that uses this particular constant? Somewhere else?

    Read the article

  • Use an audio/video file from a Linux laptop via USB to be played by Magic Sing ET-23H

    - by AisIceEyes
    I am one of the technical directors of a regular karaoke contest event. For the karaoke contest itself, due to tight budget, we are using what one of the sponsors are providing - Magic Sing ET-23H . The video output of the Magic Sing ET-23H are broadcasted at two big screens that are being shown to the audience and event attendees. When a karaoke contestant provides his / her karaoke video, the video itself is in a readable USB flashdrive and is attached to the USB input of Magic Sing ET-23H. What really bugs me is that the interface of Magic Sing ET-23H are also being broadcasted at the big screen video feeds. The interface of choosing the video file is being seen in the Magic Sing ET-23H - also to the big video screens that are seen by the audience and event goers. I will post in the comments ( if my less than 10 reputation would allow me) the picture of Magic Sing ET-23KH USB input of the device. I always bring my laptop, Acer AS5742-7653, during the regular karaoke event. I'm using my laptop also for tallying of scores from the judges, and also playing audio files from contestants that did not provide a karaoke video. I personally am using different Linux distros, but I next to all the time use my Ubuntu Studio 12.04.3 64bit partition during the regular karaoke contest event. My question is this: Is there a way I can share a temporary video/audio file directly from the laptop I'm using, going to the Magic Sing ET-23H that can broadcast both the video/audio file? Just like how in Window's Avisynth AVS files, or VirtualDub's temporary avi file, or like using ffplay (of ffmpeg), etc. I have researched somewhat the matter and found links in SuperUser.com. Though I can only provide the links at the comments section of this post if my reputation of less than 10 would allow me. I have a hunch it is possible, but I have not fully understood the device being used at the event, Magic Sing ET-23H, if there are other ways for it to broadcast video and audio files besides its USB input. Any help to my current predicament is highly appreciated. Thank you. PS: Since I need at least 10 reputation to post more than 2 links and also post images, I will try to post the image & links at the comments (if my below 10 reputation would allow me).

    Read the article

  • Built-in trackpad and keyboard stopped working on my MacBook when I paired with Bluetooth keyboard a

    - by Daveyjoe
    I paired the magic mouse and keyboard from my iMac with my MacBook, now I can't use the built-in trackpad and keyboard anymore. I've tried deleting them from the Bluetooth preference pane but that doesn't fix the issue. I've used other bluetooth mice and keyboards with this MacBook before and not had this problem. My only thought is that possibly it's related to the fact that the peripherals came with the iMac and my MacBook now thinks that it's an iMac and doesn't have a built-in trackpad/keyboard.

    Read the article

  • What is a good way to comment if-else-clauses?

    - by acme
    Whenever I'm writing a typical if-else-construct in any language I wonder what would be the best way (in terms of readability and overview) to add comments to it. Especially when commenting the else clause the comments always feel out-of-place for me. Say we have a construct like this (examples are written down in PHP): if ($big == true) { bigMagic(); } else { smallMagic() } I could comment it like this: // check, what kind of magic should happen if ($big == true) { // do some big magic stuff bigMagic(); } else { // small magic is enough smallMagic() } or // check, what kind of magic should happen // do some big magic stuff if ($big == true) { bigMagic(); } // small magic is enough else { smallMagic() } or // check, what kind of magic should happen // if: do some big magic stuff // else: small magic is enough if ($big == true) { bigMagic(); } else { smallMagic() } What are your best-practice examples for commenting this?

    Read the article

  • Is it possible to configure Apple's Magic Mouse to be recognised on start up?

    - by Dave
    This question may apply more roundly to all bluetooth mice but in my case I am dealing with an Apple Magic Mouse. I have followed the set up instructions here; https://wiki.ubuntu.com/Multitouch/AppleMagicMouse closely. I have even removed the mouse and started from scratch more than once repeating each step described carefully. Every time the computer is started it does not see the Magic Mouse by default. I need to keep a wired mouse connected to the computer at all times which I use to log in with then connect the Magic Mouse, in a somewhat counter-intuitive exercise! Any help would be greatly appreciated.

    Read the article

  • Magic squares, recursive

    - by user310827
    Hi, my problem is, I'm trying to permute all posibilities for a 3x3 square and check if the combination is magic. I've added a tweak with (n%3==0) if statement that if the sum of numbers in row differs from 15 it breaks the creation of other two lines... but it doesn't work. Any suggestions? I call the function with Permute(1). public static class Global { //int[] j = new int[6]; public static int[] a= {0,0,0,0,0,0,0,0,0}; public static int[] b= {0,0,0,0,0,0,0,0,0}; public static int count = 0; } public static void Permute(int n) { int tmp=n-1; for (int i=0;i<9;i++){ if (Global.b[i]==0 ) { Global.b[i]=1; Global.a[n-1]=i+1; if ((n % 3) == 0) { if (Global.a[0+tmp]+Global.a[1+tmp]+Global.a[2+tmp] == 15) { if (n<9) { Permute(n+1); } else { isMagic(Global.a); } } else break; } else { Permute(n+1); } Global.b[i]=0; } } }

    Read the article

  • Mac Mini Wake on Lan

    - by ILMV
    My Mac Mini has a setting in the Energy Saver category called Wake for Ethernet network access. Now the way I read this option is that any network access to the Mac whilst it is asleep will wake it up, but it doesn't. I have read that I have to send it the magic packet to wake it up, but what I really want to do is be able to simply attempt to access the Mini over the network and it wake up on demand without sending a magic packet. Can this be done? If it helps I am using a Netgear router.

    Read the article

  • Ask How-To Geek: Rescuing an Infected PC, Installing Bloat-free iTunes, and Taming a Crazy Trackpad

    - by Jason Fitzpatrick
    You’ve got questions and we’ve got answers. Today we highlight how to save your computer if it’s so overrun by viruses and malware you can’t work from within Windows, install iTunes without all the bloat, and tame a hyper-sensitive trackpad. Once a week we dip into our mailbag and help readers solve their problems, sharing the useful solutions with you I the process. Read on to see our fixes for this week’s reader dilemmas. Latest Features How-To Geek ETC The Complete List of iPad Tips, Tricks, and Tutorials The 50 Best Registry Hacks that Make Windows Better The How-To Geek Holiday Gift Guide (Geeky Stuff We Like) LCD? LED? Plasma? The How-To Geek Guide to HDTV Technology The How-To Geek Guide to Learning Photoshop, Part 8: Filters Improve Digital Photography by Calibrating Your Monitor Deathwing the Destroyer – WoW Cataclysm Dragon Wallpaper Drag2Up Lets You Drag and Drop Files to the Web With Ease The Spam Police Parts 1 and 2 – Goodbye Spammers [Videos] Snow Angels Theme for Windows 7 Exploring the Jungle Ruins Wallpaper Protect Your Privacy When Browsing with Chrome and Iron Browser

    Read the article

  • Wake on Lan Remote not waking PC while the PC does receive the packet.

    - by Nycrea
    Over the last couple of weeks, I have been trying to set up WOL from a remote location. When I use my laptop to wake the machine locally, it works just fine. (for some reason, when I try to wake from my phone with an app called "WOL wake on lan" it does not work locally either, but I'll get to that later) Anyway, when the machine is turned on, and I let it 'listen' for incoming magic packets (with a program called "WOL magic packet sender") on my specified port, it does receive them, though when turned off, the machine does not wake. When sending from phone, either locally or via 3G remotely, it does receive but does not wake as well. Because the machine does receive them when turned on and listening, but does not wake when turned off, I am convinced the cause of the problem is my receiving PC, rather than the router or the sender. Some extra info: The receiving machine is a PC running Windows 7 64bit. My router is the Netgear JWNR2000v2. I have the port I use forwarded to my PC's static IP in the router. If anyone could help, or just share your own story with the same problem, maybe we can work this out. Thanks a lot in advance.

    Read the article

  • Rails Associations - Callback Sequence/Magic

    - by satynos
    Taking following association declaration as an example: class Post has_many :comments end Just by declaring the has_many :comments, ActiveRecord adds several methods of which I am particularly interested in comments which returns array of comments. I browsed through the code and following seems to be the callback sequence: def has_many(association_id, options = {}, &extension) reflection = create_has_many_reflection(association_id, options, &extension) configure_dependency_for_has_many(reflection) add_association_callbacks(reflection.name, reflection.options) if options[:through] collection_accessor_methods(reflection, HasManyThroughAssociation) else collection_accessor_methods(reflection, HasManyAssociation) end end def collection_accessor_methods(reflection, association_proxy_class, writer = true) collection_reader_method(reflection, association_proxy_class) if writer define_method("#{reflection.name}=") do |new_value| # Loads proxy class instance (defined in collection_reader_method) if not already loaded association = send(reflection.name) association.replace(new_value) association end define_method("#{reflection.name.to_s.singularize}_ids=") do |new_value| ids = (new_value || []).reject { |nid| nid.blank? } send("#{reflection.name}=", reflection.class_name.constantize.find(ids)) end end end def collection_reader_method(reflection, association_proxy_class) define_method(reflection.name) do |*params| force_reload = params.first unless params.empty? association = association_instance_get(reflection.name) unless association association = association_proxy_class.new(self, reflection) association_instance_set(reflection.name, association) end association.reload if force_reload association end define_method("#{reflection.name.to_s.singularize}_ids") do if send(reflection.name).loaded? || reflection.options[:finder_sql] send(reflection.name).map(&:id) else send(reflection.name).all(:select => "#{reflection.quoted_table_name}.#{reflection.klass.primary_key}").map(&:id) end end end In this sequence of callbacks, where exactly is the actual SQL being executed for retrieving the comments when I do @post.comments ?

    Read the article

  • Is there anything magic about ReadOnlyCollection

    - by EsbenP
    Having this code... var b = new ReadOnlyCollection<int>(new[] { 2, 4, 2, 2 }); b[2] = 3; I get a compile error at the second line. I would expect a runtime error since ReadOnlyCollection<T> implements IList<T> and the this[T] have a setter in the IList<T> interface. I've tried to replicate the functionality of ReadOnlyCollection, but removing the setter from this[T] is a compile error.

    Read the article

  • WinAPI magic and MONO runtime

    - by Luca
    I'm trying to get the same result of a .NET application (see the link Hide TabControl buttons to manage stacked Panel controls for details), but using the MONO runtime instead of the MS .NET runtime. Pratically, when the custom control is executed using the MONO runtime, the underlying message is not sent to the control, causing the tab pages to be shown... Is there a portable solution which is elegant as the linked one? If it is not possible, what are possible workarounds (apart from removing/adding tabs at runtime)?

    Read the article

  • Magic behind R.java file

    - by LambergaR
    Hi! Recently I have been having quite some problems with R.java file. Now I have decided to do a backup and delete the file to see what happens. Nothing happened, so I created an empty R.java file and hopped for the best. Now Eclipse seems to figure out that the file was tempered with and even issues a warning: R.java was modified manually! Reverting to generated version! And that's all there is. I tried building it manually but got no results. So, I have two questions: 1. what should I do to force Eclipse to generate the file 2. what is happening here? How is the file created, where is the code that is generating the file? I would appreciate any help. As usual the problem occurred just a few days before the deadline :)

    Read the article

  • Return pre-UPDATE column values in PostgreSQL without using triggers, functions or other "magic"

    - by Python Larry
    I have a related question, but this is another part of MY puzzle. I would like to get the OLD VALUE of a Column from a Row that was UPDATEd... WITHOUT using Triggers (nor Stored Procedures, nor any other extra, non-SQL/-query entities). The query I have is like this: UPDATE my_table SET processing_by = our_id_info -- unique to this instance WHERE trans_nbr IN ( SELECT trans_nbr FROM my_table GROUP BY trans_nbr HAVING COUNT(trans_nbr) > 1 LIMIT our_limit_to_have_single_process_grab ) RETURNING row_id If I could do "FOR UPDATE ON my_table" at the end of the subquery, that'd be devine (and fix my other question/problem). But, that won't work: can't have this AND a "GROUP BY" (which is necessary for figuring out the COUNT of trans_nbr's). Then I could just take those trans_nbr's and do a query first to get the (soon-to-be-) former processing_by values. I've tried doing like: UPDATE my_table SET processing_by = our_id_info -- unique to this instance FROM my_table old_my_table JOIN ( SELECT trans_nbr FROM my_table GROUP BY trans_nbr HAVING COUNT(trans_nbr) > 1 LIMIT our_limit_to_have_single_process_grab ) sub_my_table ON old_my_table.trans_nbr = sub_my_table.trans_nbr WHERE my_table.trans_nbr = sub_my_table.trans_nbr AND my_table.processing_by = old_my_table.processing_by RETURNING my_table.row_id, my_table.processing_by, old_my_table.processing_by But that can't work; "old_my_table" is not viewable outside of the join; the RETURNING clause is blind to it. I've long since lost count of all the attempts I've made; I have been researching this for literally hours. If I could just find a bullet-proof way to lock the rows in my subquery - and ONLY those rows, and WHEN the subquery happens - all the concurrency issues I'm trying to avoid disappear... UPDATE: [WIPES EGG OFF FACE] Okay, so I had a typo in the non-generic code of the above that I wrote "doesn't work"; it does... thanks to Erwin Brandstetter, below, who stated it would, I re-did it (after a night's sleep, refreshed eyes, and a banana for bfast). Since it took me so long/hard to find this sort of solution, perhaps my embarrassment is worth it? At least this is on SO for posterity now... : What I now have (that works) is like this: UPDATE my_table SET processing_by = our_id_info -- unique to this instance FROM my_table AS old_my_table WHERE trans_nbr IN ( SELECT trans_nbr FROM my_table GROUP BY trans_nbr HAVING COUNT(*) > 1 LIMIT our_limit_to_have_single_process_grab ) AND my_table.row_id = old_my_table.row_id RETURNING my_table.row_id, my_table.processing_by, old_my_table.processing_by AS old_processing_by The COUNT(*) is per a suggestion from Flimzy in a comment on my other (linked above) question. (I was more specific than necessary. [In this instance.])

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >