Search Results

Search found 2638 results on 106 pages for 'magic hat'.

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

  • Difference between normal and magic setters and getters

    - by Saif Bechan
    I am using a magic getter/setter class for my session variables, but I don't see any difference between normal setters and getters. The code: class session { public function __set($name, $value) { $_SESSION[$name] = $value; } public function __unset($name) { unset($_SESSION[$name]); } public function __get($name) { if(isset($_SESSION[$name])) { return $_SESSION[$name]; } } } Now the first thing I noticed is that I have to call $session->_unset('var_name') to remove the variable, nothing 'magical' about that. Secondly when I try to use $session->some_var this does not work. I can only get the session variable using $_SESSION['some_var']. I have looked at the PHP manual but the functions look the same as mine. Am I doing something wrong, or is there not really anything magic about these functions.

    Read the article

  • Eidetic memory: What magic numbers you still remember?

    - by Hao
    Long before you practice writing readable code, what "magic numbers" you still remember up to this day? here's some of my list: 72 80 75 77 13 32 27 - up down left right enter space escape 1 2 4 128 - blue green red blink 67h 33h 17h - interrupt for EMS, mouse, printer function AH 9, interrupt 21 alt+219 for block ASCII alt+164 ñ 90 NOP 13 10 carriage return, line feed ascii 1 and 2 face, ascii 3 heart. no not this heart: <3 :-) debug -o72,10 -o71,12 clears the BIOS password. I don't know what those numbers mean, it's like a trade secret that gets shared with each other during college days. ascii 7 sounds a beep P.S. Somehow, remembering some of these magic numbers can help you in some tech problems, your keyboard is broken, the office pal's keyboard doesn't have accented characters. An anecdote, during college, one of my friend asked me how to remove the newlines in his Word document. Not having used Word so much then, I somehow "intuitively" guessed to find ^013 and replace it with blank. Well it works :-)

    Read the article

  • Apple Magic Trackpad Gestures carried out as personalized Commands in Windows

    - by Adele
    I want to have the Apple Magic Trackpad to work on Windows, but NOT as a regular Mouse! I will need the normal Trackpad Gestures to work with a c# Application (i.e. when carring out a 2 finger swipe to the left, it will start playing a song...). I guess I´ll have to write my own driver? Is there a way to use Apples MAgic Trackpad Driver for Windows and re-write that one? OR is there any way (API, self-written driver), so that I could just hook the gestures to my Commands? Or any RAW Input examples? Does anybody know how to do that, or where to start? Thank you so much, I´m really lost.

    Read the article

  • Magic function `bash ` not found

    - by inspectorG4dget
    I have a bunch of simulations that I want to run on a high-performance cluster, on which I should make reservations to get computing time. Since the reservations are bounded by time, I am developing an automation script that I can scp into the cluster and run. This script will then download the relevant simulation files, run them, and upload the results. Part of this automation script is in bash (cp, scp, etc) and the rest is in python. In order to develop this automation, I am using an IPython notebook. So far, I've coded all the python automation stuff in my IPython notebook and am trying to write the bash part of it now. However, it seems that the magic %%bash doesn't work in my IPython notebook. I get the following error when I have this code in my cell: Cell %%bash echo hi Error File "<ipython-input-22-62ec98e35224>", line 3 echo hi ^ SyntaxError: invalid syntax On a whim, I tried this: Cell %%bash print "hi" Error hi ERROR: Magic function `bash` not found. So I tried this with %%system, %%! and %%shell. But none of those work; they all give me the same error. Why is this happening? How can I fix this? Metadata: IPython 0.13.dev Python 2.7.1 Mac OS X Lion

    Read the article

  • Using php's magic methods outside a class

    - by Greelmo
    Is it possible to use PHP magic methods (specifically __get()) outside a defined class? I'm wanting to use it in a configuration file for quick loading. The configuration file has a single array, $config, with many keys. Therefore, I'd like to override __get() to return the key in the array.

    Read the article

  • Magic quotes in PHP

    - by VirtuosiMedia
    According to the PHP manual, in order to make code more portable, they recommend using something like the following for escaping data: if (!get_magic_quotes_gpc()) { $lastname = addslashes($_POST['lastname']); } else { $lastname = $_POST['lastname']; } I have other validation checks that I will be performing, but how secure is the above strictly in terms of escaping data? I also saw that magic quotes will be deprecated in PHP 6. How will that affect the above code? I would prefer not to have to rely on a database-specific escaping function like mysql_real_escape_string().

    Read the article

  • Why does python use 'magic methods'?

    - by Greg Beech
    I've been playing around with Python recently, and one thing I'm finding a bit odd is the extensive use of 'magic methods', e.g. to make its length available an object implements a method def __len__(self) and then it is called when you write len(obj). I was just wondering why objects don't simply define a len(self) method and have it called directly as a member of the object, e.g. obj.len()? I'm sure there must be good reasons for Python doing it the way it does, but as a newbie I haven't worked out what they are yet.

    Read the article

  • [PHP] using the magic __set() method with 2D arrays

    - by Spoonface
    If I have the following registry class: Class registry { private $_vars; public function __construct() { $this->_vars = array(); } public function __set($key, $val) { $this->_vars[$key] = $val; } public function __get($key) { if (isset($this->_vars[$key])) return $this->_vars[$key]; } public function printAll() { print "<pre>".print_r($this->_vars,true)."</pre>"; } } $reg = new registry(); $reg->arr = array(1,2,3); $reg->arr = array_merge($reg->arr,array(4)); $reg->printAll(); Would there be an easier way to push a new item onto the 'arr' array? This code: 'array[] = item' doesn't work with the magic set method, and I couldn't find any useful info with google. Thanks for your time!

    Read the article

  • __toString magic and type coercion

    - by TomcatExodus
    I've created a Template class for managing views and their associated data. It implements Iterator and ArrayAccess, and permits "sub-templates" for easy usage like so: <p><?php echo $template['foo']; ?></p> <?php foreach($template->post as $post): ?> <p><?php echo $post['bar']; ?></p> <?php endforeach; ?> Anyways, rather than using inline core functions, such as hash() or date(), I figured it would be useful to create a class called TemplateData, which would act as a wrapper for any data stored in the templates. This way, I can add a list of common methods for formatting, for example: echo $template['foo']->asCase('upper'); echo $template['bar']->asDate('H:i:s'); //etc.. When a value is set via $template['foo'] = 'bar'; in the controllers, the value of 'bar' is stored in it's own TemplateData object. I've used the magic __toString() so when you echo a TemplateData object, it casts to (string) and dumps it's value. However, despite the mantra controllers and views should not modify data, whenever I do something like this: $template['foo'] = 1; echo $template['foo'] + 1; //exception It dies on a Object of class TemplateData could not be converted to int; Unless I recast $template['foo'] to a string: echo ((string) $template['foo']) + 1; //outputs 2 Sort of defeats the purpose having to jump through that hoop. Are there any workarounds for this sort of behavior that exist, or should I just take this as it is, an incidental prevention of data modification in views?

    Read the article

  • Oracle GRC in Leader’s Quadrant on Gartner’s Magic Quadrant for Enterprise Governance Risk and Compliance Platforms

    - by Di Seghposs
    Once again Gartner has recognized Oracle as a Leader in their Magic Quadrant for Enterprise Governance Risk and Compliance (EGRC) Platforms report, stating that “Oracle remains in the Leader’s quadrant based on overall corporate viability, proven execution against its road map, and advanced capabilities to integrate risk management and performance management.”  In the report, Gartner cited that Oracle clearly understands the GRC challenges faced by a number of verticals, and also the trends toward the integration of risk management and performance management.  Gartner produces Magic Quadrant reports to provide guidance to their clients on available solutions in specific categories. This Magic Quadrant reports takes a holistic view of EGRC solutions and based on selected criteria, places vendors in one of the four quadrants - leaders, challengers, visionaries and niche. We are proud to be in the leader category! Click here to read the full report. Congratulations to our product development, strategy, and marketing teams for creating a world-class, market-leading GRC solution! Oracle GRC: Designed to manage risk, improve controls and reduce costs

    Read the article

  • Oracle VM Moves into Challenger Position in the Latest Gartner Magic Quadrant

    - by Monica Kumar
    Oracle Innovations boost Oracle VM into Challenger Position in Gartner x86 Server Virtualization Infrastructure Magic Quadrant Oracle VM's placement in the just published Gartner x86 Server Virtualization Infrastructure Magic Quadrant affirms the Oracle strategy and is also supported by strong customer momentum gains. Optimizations delivered in Oracle VM releases during this last year along with easy software access and low cost licensing have moved Oracle’s placement into the Challenger quadrant in a very short time. Oracle continues to focus on delivering a strong integrated virtualization with Oracle VM and the managed stack in the following areas: Integrated management with Oracle VM and all layers of the Oracle stack from hardware to virtualization to cloud Application-Driven virtualization with Oracle VM templates for rapid enterprise application deployment Certified Oracle applications on Oracle VM Complete stack solution offering more values to customers Get a copy of the Magic Quadrant for x86 Server Virtualization Infrastructure report to read more about how Oracle VM rapidly moved up in its new position.

    Read the article

  • At Last, Red Hat Enterprise Linux 6

    <b>Linux Planet:</b> "Linux vendor Red Hat today released the first public beta of Red Hat Enterprise Linux 6 (RHEL 6), giving observers a look at what's to come in the next version of its flagship operating system platform."

    Read the article

  • How does NSValue do its magic?

    - by Paperflyer
    I have an MVC application. The model has a property that is a struct NSSize. It is writable like this: - (void)setSize:(NSSize)aSize; The view sets this NSSize using key-value-coding. However, you can not key-value-code a struct, so I wrapped it in an NSValue-object like this: [theView setValue:[NSValue valueWithSize:mySize] forKey:@"theModel.size"]; To my understanding, this should not work since the accessor expects a struct and not an NSValue. But it works perfectly. Magically. How is this possible?

    Read the article

  • Is 23,148,855,308,184,500 a magic number, or sheer chance?

    - by Roddy
    News reports such as this one indicate that the above number may have arisen as a programming bug. A man in the United States popped out to his local petrol station to buy a pack of cigarettes - only to find his card charged $23,148,855,308,184,500. That is $23 quadrillion (£14 quadrillion) - many times the US national debt.* In hex it's $523DC2E199EBB4 which doesn't appear terribly interesting at first sight. Anyone have any thoughts about what programming error would have caused this?

    Read the article

  • php 5.1.6 magic __toString method

    - by NachoF
    In codeigniter Im trying to use this plugin which requires I implement a toString method in my models. My toString method simply does return $this->name On my local machine with php 5.3 everything works just fine but on the production server with php 5.1.6 it shows "Object id#48" where the value of the name property of that object should appear..... I found something about the problem here but I still dont understand... How can I fix this?

    Read the article

  • Performance implications of using a variable versus a magic number

    - by Nathan
    I'm often confused by this. I've always been taught to name numbers I use often using variables or constants, but if it reduces the efficiency of the program, should I still do it? Heres an example: private int CenterText(Font font, PrintPageEventArgs e, string text) { int recieptCenter = 125; int stringLength = Convert.ToInt32(e.Graphics.MeasureString(text, font)); return recieptCenter - stringLength / 2; } The above code is using named variables, but runs slower then this code: private int CenterText(Font font, PrintPageEventArgs e, string text) { return 125 - Convert.ToInt32(e.Graphics.MeasureString(text, font) / 2); } In this example, the difference in execution time is minimal, but what about in larger blocks of code?

    Read the article

  • GDL Presents: Make Web Magic | Part III

    GDL Presents: Make Web Magic | Part III Make Web Magic: The Minds Behind the Most Popular Chrome Experiments Using the latest open web technologies, the developers creating some of the most inspired Chrome Experiments showcase their latest web experiments and discuss how they are making the web faster, more fun, and open in this 3-episode hangout. Host: Paul Irish, Developer Advocate, Chrome Guest: Hakim El Hattab From: GoogleDevelopers Views: 133 16 ratings Time: 30:35 More in Science & Technology

    Read the article

  • Open Your Desktop to Nature with the Magic Landscapes Theme for Windows 7

    - by Asian Angel
    Are you looking for a nature filled theme for your desktop? Then the Magic Landscapes theme may be just what you are looking for. This terrific theme comes with seventeen wallpapers showcasing the work of photographer Michael Breitung. Download the Magic Landscapes Theme [Windows 7 Personalization Gallery] How To Properly Scan a Photograph (And Get An Even Better Image) The HTG Guide to Hiding Your Data in a TrueCrypt Hidden Volume Make Your Own Windows 8 Start Button with Zero Memory Usage

    Read the article

  • Magic Mouse for Windows 7 (Touch Mouse)

    - by samsudeen
    Microsoft has unveiled the launch of the new product named “Touch Mouse” at the on going Consumer Electronic show (CES). This mouse allows us to do the normal mouse functions such as  Click, flick, scroll and swipe easily without using any buttons.The features of this mouse is similar to the “Magic Mouse” from Apple hence we can call this as “Microsoft’s Magic Mouse”. This mouse is designed specially for “Windows 7″ to expose the touch features of the OS as per the Microsoft’s below statement Touch Mouse brings a new dimension to Windows 7. By quickly responding to single finger gestures, it speeds up everyday tasks that are already fast in Windows 7: scrolling, panning, paging forward and back, docking, minimizing/ maximizing, showing desktop, and more. Touch Mouse also provides elegant touch functionality to non-touch Windows 7 PCs, so you can enjoy dynamic touch sensitivity at a fraction of the cost of a new PC. The below video clip explains the “Touch Mouse” features using the “Windows 7″ operating system   Touch Mouse This mouse will be launched only in June at an estimated price of $80. You can find more details about the “Touch Mouse” at the below  Microsoft web site. http://www.microsoft.com/hardware/touch-mouse/ This article titled,Magic Mouse for Windows 7 (Touch Mouse), was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Oracle ATG Ranked "Leader" Once Again In This Year's Gartner Magic Quadrant For E-Commerce

    - by Michael Hylton
    Oracle ATG Web Commerce is in the top portion of the Leaders quadrant once again in this year's Gartner Magic Quadrant for E-Commerce, and gained in “ability to execute” over the 2010 version. Leaders are defined in this Magic Quadrant as technology providers that demonstrate the optimal blend of insight, innovation, execution and the ability to "see around the corner." Oracle ATG Web Commerce is a Leader because it has broadened its e-commerce capabilities with multisite management, a broader range of mobile devices supported and other additions, and Gartner points out ATG’s steady growth in revenue, market share and market visibility. Gartner notes that Oracle made the announcement regarding its acquisition of ATG in November 2010 and this has helped ATG with additional sales, marketing, R&D and global partnerships.Oracle ATG's latest release, Oracle ATG Commerce 10, provides several important enhancements, including multisite management, cross-channel campaign management and support for a broader range of mobile devices, with the addition of merchandising (including updates to the user interface) and promotions applications. The Magic Quadrant focuses on e-commerce for B2B and B2C across industry verticals, including retail, manufacturing, distribution, telecommunications, publishing, media, and financial services. The product should be able to integrate with applications beyond traditional e-commerce channels to meet the emerging customer requirement to transact across channels with a seamless experience.

    Read the article

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