Search Results

Search found 1976 results on 80 pages for 'grab'.

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

  • Python grab class in class definition.

    - by epochwolf
    I don't even know how to explain this, so here is the code I'm trying. class Test: type = self.__name__ #self doesn't work, how do I get a reference to Test? class Test2(Test): pass #Test2.type should return "Test2" The reason I'm even trying this is I'm working on creating a base class for an orm I'm using. I want to avoid defining the table name for every model I have. Also knowing what the limits of python is will help me avoid wasting time trying impossible things.

    Read the article

  • Django dictionary in templates: Grab key from another objects attribute

    - by Jordan Messina
    I have a dictionary called number_devices I'm passing to a template, the dictionary keys are the ids of a list of objects I'm also passing to the template (called implementations). I'm iterating over the list of objects and then trying to use the object.id to get a value out of the dict like so: {% for implementation in implementations %} {{ number_devices.implementation.id }} {% endfor %} Unfortunately number_devices.implementation is evaluated first, then the result.id is evaluated obviously returning and displaying nothing. I can't use parentheses like: {{ number_devices.(implementation.id) }} because I get a parse error. How do I get around this annoyance in Django templates? Thanks for any help!

    Read the article

  • In SVG is there a way to grab a shape anywhere when it has fill = "none"

    - by Shaunwithanau
    I have a series of shapes that I want the user to be able click anywhere on the shape to pick up as part of a drag and drop feature. All of these shapes are bounded by a rectangle. For example: <g id="shape1" fill="none" stroke="black"> <rect x="0" y="0" width="100" height="100"/> <circle cx="50" cy="50" r="50"/> </g> <g id="shape2" fill="none" stroke="black"> <rect x="0" y="0" width="100" height="100"/> <line x1="0" y1="0" x2="50" y2="100"/> <line x1="100" y1="0" x2="50" y2="100"/> </g> I already have all of the drag and drop parts working, the problem is all of these shapes have to have fill="none" so you can see anything that may be underneath of them. This means that even though they are bounded by the rectangle, at the moment users have to physically click on one of the lines in order to pick it up instead of being able to click anywhere on the shape like I want. My original idea was to use fill="white" and then set opacity="0" or some really low value but this applies to the stroke as well so this didn't work out. Any ideas on how I can get this working?

    Read the article

  • How to grab all cookies in Flash

    - by Leticia Meyer
    For a site I'm developing with a user login that uses cookies to store the session ID, a separate section of it uses Flash to provide content and such. Is there some way it can access the cookies that were set the by login? The name of the cookie will not the be same every time, as it is randomly generated, as well as its value. I then need to send the name and value of the cookie back to a page on the server to do additional stuff. Anyone know how to do this? Note that I didn't write the Flash interface, an the person who did doesn't know how to do this. Please help me, and thanks in advance!

    Read the article

  • Regex Question to Grab Keys

    - by Braveyard
    Hello, I have this kinda template text : Hello {#Name#}, Thanks for coming blah on {#Date#} and we love to see you again here with {#President#} So I am trying to get {#...#} templates parts and put them into an array. But my expression didn't work : \b(?<=\{\#)(.*)(?=\#\})\b The result became something like this for this sample text : {#Something#} Hello {#Brand#} Result : Something#} Hello {#Brand

    Read the article

  • Creating a function to grab data from an Oracle database (array by ID)

    - by Nick
    I'm trying to create a function that will simply allow me to pass an SQL statement into it, and it will generate an array based on a unique ID I pass it: function oracleGetGata($query, $id="id") { global $conn; $sql = OCI_Parse($conn, $query); OCI_Execute($sql); OCI_Fetch_All($sql, $results, null, null, OCI_FETCHSTATEMENT_BY_ROW); return $results; }   For example I'd like this query $array = oracleGetData('select * from table') to return something like: [1] => Array ( [Title] => Title 1 [Description] => Description 1 ) [2] => Array ( [Title] => Title 2 [Description] => Description 2 ) [3] => Array ( [Title] => Title 3 [Description] => Description 3 )   Rather than what it's returning at the moment: [0] => Array ( [ID] => 3 [TITLE] => Title 3 [DESCRIPTION] => Description 3 ) [1] => Array ( [ID] => 1 [TITLE] => Title 1 [DESCRIPTION] => Description 1 ) [2] => Array ( [ID] => 2 [TITLE] => Title 2 [DESCRIPTION] => Description 2 )   I'd really appreciate any help with this, as the function would save me lots of time! Thank you.

    Read the article

  • How to do grap data between two file in Linux?

    - by user28167
    I have two .rtf file.... The first one have this content: Apple, Orange, Banana, Noodle, Chip The Second File is something like this: Apple I love eat Apple. Banana I hate Banana. Zoo I want to go Zoo. Noodle Noodle can be a very very very very very very very very very very very long, but still is one line. Chip Don't eat so many chip. Orange Orange is great, not Apple plx. Noodle Water Drinking water is boring. The first file is a "key" of second file. In the second file, the first word is the key of each line. Each key and sentence in second file ONLY have one line. The Second File have many lines with key, but not all the key is shown on file1, but file1's key MUST in the second file. How can I get the result like this: (Need to sort by the key from File1) Apple, Apple I love eat Apple. Orange, Orange is great, not Apple plx. Banana, I hate Banana. Noodle, can be a very very very very very very very very very very very long, but still is one sentence. Chip, Don't eat so many chip.

    Read the article

  • Is there any better way to capture the screen than PIL.ImageGrab.grab()?

    - by user1474837
    I am making a screen capture program with python. My current problem is PIL.ImageGrab.grab() gives me the same output as 2 seconds later. For instance, for I think I am not being clear, in the following program, almost all the images are the same, have the same Image.tostring() value, even though I was moving my screen during the time the PIL.ImageGrab.grab loop was executing. >>> from PIL.ImageGrab import grab >>> l = [] >>> import time >>> for a in l: l.append(grab()) time.sleep(0.01) >>> for a in range(0, 30): l.append(grab()) time.sleep(0.01) >>> b = [] >>> for a in l: b.append(a.tostring()) >>> len(b) 30 >>> del l >>> last = [] >>> a = 0 >>> a = -1 >>> last = "" >>> same = -1 >>> for pic in b: if b == last: same = same + 1 last = b >>> same 28 >>> This is a problem, as all the images are the same but 1. 1 out of 30 is different. That would make for a absolutly horrable quality video. Please, tell me if there is any better quality alternative to PIL.ImageGrab.grab(). I need to capture the whole screen. Thanks!

    Read the article

  • Grab a Copy of Plants vs. Zombies for Free; Courtesy of the ADA

    - by Jason Fitzpatrick
    In a rather unlikely pairing, PopCap Games and the American Dental Association have teamed up to give away copies of PopCap’s smash hit game Plants vs. Zombies; grab a copy for yourself and print off some game coupons to hand out at Halloween. At StopZombieMouth.com they explain the pairing: This Halloween, the ADA and PopCap Games are redefining what a Halloween “treat” can be… by giving FUN instead of candy. We’re giving away Plants vs. Zombies™ download games as a sugar-free alternative, and you can join in the fun. Ask if your local dentist has the limited-edition, collectible Plants vs. Zombies trading cards with the code for a free Plants vs. Zombies download game. Or, download printable free-game coupons here. Now go out and give PvZ fun as a Halloween treat to kids of all ages. And thanks for helping Stop Zombie Mouth! 7 Ways To Free Up Hard Disk Space On Windows HTG Explains: How System Restore Works in Windows HTG Explains: How Antivirus Software Works

    Read the article

  • Solution to grab text from page and display it elsewhere?

    - by GaryW
    I am trying to find a solution how to grab a text from one part of the page to be displayed on a different part of the same page (not stored). To explain this easier. I have this: <div id="test"> hello world </div> I want to grab the text "hello world" and display it somewhere else on the website as well. Im thinking that there might be a javascript code that could grab that specific div text? Any help would be very appreciated.

    Read the article

  • Grab your popcorn and watch the latest AutoVue Movie. Now available on YouTube!

    - by [email protected]
    Just released is: Oracle's AutoVue Visualization Solutions and Primavera P6 integration Movie Watch it now (9:24). This is sure to be a box office sensation. And if you have time for a double, triple or even quadruple feature don't forget these other AutoVue movies available on YouTube: AutoVue Work Online and Offline movie Watch it now (5:01). AutoVue 3D Walkthrough movie Watch it now (6:01). AutoVue 2D Compare Movie Watch it now (4:14). Enjoy the movies.

    Read the article

  • Is there any simple C++ code to grab video from UVC webcam and display it simultaneously?

    - by mShero
    I'm very very new to Linux and programming! I'm using ubuntu 11.10 - 64 bits with gcc 4.6.1 I've been searching online for an example C++ code that simply grabs video from a compliant UVC webcam and displays it simultaneously.. I need to compile it on gcc. In OpenCV, it's a very simple code less than 20 lines as I remember! I found this: http://v4l2spec.bytesex.org/spec/capture-example.html But it's very huge code relative to OpenCV code ?! and even when I tried to compile it using gcc.. I got many errors! I copied the code into a cpp file: cap.cpp then wrote in the terminal: gcc cap.cpp -o cap and the errors showed up... same errors with g++ I hope if someone can help me and tell me where can I find another simpler code? and how can I test it ? Thank you :)

    Read the article

  • How to Grab MAC Address of Active Ethernet Connection in Bash Script?

    - by Huy Tran
    Simple Question: How do I grab the MAC address of the active Ethernet connection in a bash script? I currently have: set - `/sbin/ifconfig eth0 | head -1` MAC=$5 Which outputs the MAC address of the eth0, but if it's eth1 that's active, I want that instead. Could I beforehand execute ifconfig | grep inet but that wouldn't tell me which interface is active, just that one is active. I need to grab the line above it to tell me which one is the active connection. Any help would be much appreciated. Thank you!

    Read the article

  • How do I grab and use a variables coming back through ValueList from an AJAX call?

    - by Mel
    I'm trying the following code to execute a search and it's not working. On the search.cfm page, the only value coming back is the value I input into the search field (even if I click an autosuggest value, it's not coming back; only the letters I actually type myself come back). <cfform class="titleSearchForm" id="searchForm" action="search.cfm?GameID=#cfautosuggestvalue.GameID#" method="post"> <fieldset> <cfinput type="text" class="titleSearchField" name="TitleName" onChange="form.submit()" autosuggest="cfc:gz.cfcomp.search.AutoSuggestSearch({cfautosuggestvalue})"> <input type="button" class="titleSearchButton" value=" " /> </fieldset> </cfform> Query in CFC: <cfquery name="SearchResult" datasource="myDSN"> SELECT CONCAT(titles.TitleName, ' on ', platforms.PlatformAbbreviation) AS sResult, games.GameID FROM games Inner Join platforms ON games.PlatformID = platforms.PlatformID Inner Join titles ON titles.TitleID = games.TitleID WHERE UCase(titleName) LIKE Ucase('#ARGUMENTS.SearchString#%') ORDER BY titleName ASC; </cfquery> Two things: First of all, I would like to get the GameID back to the page making the AJAX request; I know why it is not coming back: Because I'm only returning sResult var, which does not include the GameID. Is there a way to return the GameID value without displaying it? The second thing: How to I grab a value from the auto-suggest once it is returned? Say I want to grab the GameID, or if I can't do that, the "TitleName" to use that in my query? I tried passing it to the form this way: action="search.cfm?GameID=#cfautosuggestvalue.GameID#" - but that does not work. How do I reference the autosuggestionvalue varaibles for use? Thanks

    Read the article

  • Trying to grab several random videos from database, but it just shows the same one all the time.

    - by Birk
    Hi guys, I'm trying to grab several random videos from my database, and have them show on a page. However, it just keeps on grabbing the same video rather than several different ones. So I end up with 5 of the same video rather than 5 different ones. Here's the grab random PHP code file... and after it is the template output file. //===================================================== // Random | Previous | Next //===================================================== $show['random'] = $db->quick_fetch( "SELECT file_id, title, title_seo, category_id, thumb FROM files WHERE files.category_id = '".$show['main']['category_id']."' AND files.verified=1 ORDER BY RAND() LIMIT 0,1; "); Here's the template CSS html thingy code I have this pasted 5 times to show 5 random videos <td valign="top" width="53%"><? $sql="select * from files ORDER BY rand() limit 0,5"; $res=@mysql_query($sql); $data=@mysql_result($res,0,'filename'); $id=@mysql_result($res,0,'file_id'); $title=@mysql_result($res,0,'title'); $title2=str_replace(" ", "-",$title); $path="{$siteurl}/media/{$file.random.file_id}/{$file.random.title_seo}/"; $img="{$siteurl}/thumbs/{$file.random.thumb}"; echo " {$file.random.title}"

    Read the article

  • Gridview - Is it necessary to grab data from database every time a filter, sort, or paging event occ

    - by hamlin11
    Regarding gridviews that are not bound to a Data Source Control: In most GridView tutorials that I have seen, when just about any GridView event occurs, the end of the event handler will include BindDataGrid(). In some form, these BindDataGrid() functions 1) Grab data from the database 2) Assign any Filter or Sort expressions to the data, and 3) Bind the gridview to that data source (usually a DataView or DataTable. Is there a better way to provide filterable & sortable data to a GridView without having to hit the database so often? Thanks

    Read the article

  • Grab remaining text after last "/" in a php string.

    - by Roeland
    So, lets say I have a $somestring thats holds the value "main/physician/physician_view". I want to grab just "physician_view". I want it to also work if the passed string was "main/physician_view" or "site/main/physician/physician_view". Hopefully my question makes sense. Any help would be appreciated!

    Read the article

  • How should I grab pairs from a list in python?

    - by tomaski
    Say I have a list that looks like this: ['item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7', 'item8', 'item9', 'item10'] Using Python, how would I grab pairs from it, where each item is included in a pair with both the item before and after it? ['item1', 'item2'] ['item2', 'item3'] ['item3', 'item4'] ['item4', 'item5'] ['item5', 'item6'] ['item6', 'item7'] ['item7', 'item8'] ['item8', 'item9'] ['item9', 'item10'] Seems like something i could hack together, but I'm wondering if someone has an elegant solution they've used before?

    Read the article

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