Search Results

Search found 1862 results on 75 pages for 'matt varblow'.

Page 44/75 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • Do I correctly understand what a class is?

    - by Matt
    I've had trouble finding a clear, concise laymans definition of a class. Usually, they give general ideas without specifically spelling it out, and I'm wondering if I'm understanding this correctly. As I understand it, a class is the set of code that controls an object. For example, in an app that has a button for 'Yes' and a button for 'No', and a text box for output, the code that tells the computer what to do when the user uses the Yes button is one class, the code for hitting No is another class, and an object is the two buttons and what they do together to influence the output box. Am I right, or am I confusing terms here? Thanks

    Read the article

  • R counting the occurance of similar rows of data frame

    - by Matt
    I have data in the following format called DF (this is just a made up simplified sample): eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0 random 1 1 1500 1500 100 120 40 232342 2 2 1000 1250 100 120 40 11843 3 3 1250 1250 100 120 40 981340234 4 4 1000 1187.5 100 120 40 4363453 5 1 2000 2000 200 100 40 345902 6 1 3000 3000 150 90 10 943 7 1 2000 2000 90 90 100 9304358 8 2 1800 1900 90 90 100 284333 However, the eval.count column is incorrect and I need to fix it. It should report the number of rows with the same values for (green.h.0, green.v.0, and offset.0) by only looking at the previous rows. The example above uses the expected values, but assume they are incorrect. How can I add a new column (say "count") which will count all previous rows which have the same values of the specified variables? I have gotten help on a similar problem of just selecting all rows with the same values for specified columns, so I supposed I could just write a loop around that, but it seems inefficient to me.

    Read the article

  • Error trying to use rand from std library cstdlib with g++

    - by Matt
    I was trying to use the random function in Ubuntu compiling with g++ on a larger program and for some reason rand just gave weird compile errors. For testing purposes I made the simplest program I could and it still gives errors. Program: #include <iostream> using std::cout; using std::endl; #include <cstdlib> int main() { cout << "Random number " << rand(); return 0; } Error when compiling with the terminal sudo g++ chapter_3/tester.cpp ./test ./test: In function _start': /build/buildd/eglibc-2.10.1/csu/../sysdeps/i386/elf/start.S:65: multiple definition of_start' /usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/crt1.o:/build/buildd/eglibc-2.10.1/csu/../sysdeps/i386/elf/start.S:65: first defined here ./test:(.rodata+0x0): multiple definition of _fp_hw' /usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/crt1.o:(.rodata+0x0): first defined here ./test: In function_fini': (.fini+0x0): multiple definition of _fini' /usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/crti.o:(.fini+0x0): first defined here ./test:(.rodata+0x4): multiple definition of_IO_stdin_used' /usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/crt1.o:(.rodata.cst4+0x0): first defined here ./test: In function __data_start': (.data+0x0): multiple definition ofdata_start' /usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/crt1.o:(.data+0x0): first defined here ./test: In function __data_start': (.data+0x4): multiple definition of__dso_handle' /usr/lib/gcc/i486-linux-gnu/4.4.1/crtbegin.o:(.data+0x0): first defined here ./test: In function main': (.text+0xb4): multiple definition ofmain' /tmp/cceF0x0p.o:tester.cpp:(.text+0x0): first defined here ./test: In function _init': (.init+0x0): multiple definition ofinit' /usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/crti.o:(.init+0x0): first defined here /usr/lib/gcc/i486-linux-gnu/4.4.1/crtend.o:(.dtors+0x0): multiple definition of `_DTOR_END' ./test:(.dtors+0x4): first defined here /usr/bin/ld: error in ./test(.eh_frame); no .eh_frame_hdr table will be created. collect2: ld returned 1 exit status

    Read the article

  • How can I script the deployment of a Visual Studio database project?

    - by Matt
    How can I script the deployment of a Visual Studio database project? I have a DB project in visual studio and I would like to use it in order to deploy on remote machines via a script. I notice that when I 'deploy' from visual studio, it generates a .sql file. I intercepted this file and tried running it from the command line with osql.exe, but I didn't have any success. Should this work, is there a better way to deploy a database programatically from a database project, may be by referencing in another project and calling some method to deploy it?

    Read the article

  • Scripting window positioning in OS X

    - by Matt Trent
    My primary computing setup is a macbook pro with a large external monitor. I'm looking for a convenient way of moving a number of the windows of open programs from the laptop screen to the external monitor when I plug it in. I've seen a few partial scripts for accomplishing this, but nothing comprehensive. Ideally I'd like to specify the laptop screen location and external monitor location for each window and be able to toggle between them. Is anyone aware of any existing utility or Applscripts that can perform this?

    Read the article

  • How to make sure that Parameters have been updated in a Dataset Provider

    - by Matt
    In a Delphi app we have assigned a dataset provider with a TADOQuery, passing parameters to the Query. When the TADOQuery is refreshed with new parameter values these are not being passed to the Dataset Provider. This seemed to work ok in Delphi 5, but we are migrating our application to Delphi 2010 and it seems to have broken this link. Is there a way of refreshing the parameters against the dataset provider with the new values?

    Read the article

  • C/C++ Allegro program causes Windows 7 to switch to Aero Basic

    - by Matt H
    Hi SO, I'm just trying out the allegro library, and here is the code which I've got so far: #include <allegro.h> int main(int argc, char *argv[]) { allegro_init(); // initialize the allegro libraries install_keyboard(); // initialize keyboard functions set_color_depth(16); // set the color depth set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); // set up 640*480px window BITMAP *pic = NULL; pic = load_bitmap("C:/picture.bmp", NULL); // load the picture blit(pic, screen, 0, 0, 0, 0, 1000, 1000); readkey(); destroy_bitmap(pic); return 0; } END_OF_MAIN() It works fine, but when I run it, while the program's window is open, Windows 7 changes the theme from Aero to Aero basic. If you aren't sure what I mean, this pops up (I got this from Google, which is why it says Vista rather than Windows 7): 1) Why? 2) How can I ensure that this doesn't happen?

    Read the article

  • Reliable way to get the "ancestor" of an object with a specific classname, using jQuery

    - by Matt Dawdy
    I've got a javascript function that gets called on change event of a select form element. So, the "this" variable in js refers to the select element. This select element is in a td tag, in a tr tag. The tr tag has a classname of "FilterDetailsRow". Now, I've tested, and if I use this syntax: var filterRow = $(this).parent().parent(); it gets me what I want. However, is there a better way to tell jQuery, "starting with "this" can you please go up my tree of parents until you find one with a classname of "FilterDetailsRow"? Here's what I came up with, but I want to make sure I"m not reinventing the wheel. function GetFilterDetailsRowOfObject(o) { if (o) { if (o.parent()[0].className.indexOf("FilterDetailsRow") != -1) return o; else return GetFilterDetailsRowOfObject(o.parent()); } else { return null; } } Thanks for any advice.

    Read the article

  • Yield only as many are required from a generator

    - by Matt Joiner
    I wish to yield from a generator only as many items are required. In the following code a, b, c = itertools.count() I receive this exception: ValueError: too many values to unpack I've seen several related questions, however I have zero interest in the remaining items from the generator, I only wish to receive as many as I ask for, without providing that quantity in advance. It seems to me that Python determines the number of items you want, but then proceeds to try to read and store more than that number. How can I yield only as many items as I require, without passing in how many items I want?

    Read the article

  • iPhone sdk can't get Mobclix to work

    - by Matt S.
    I followed the guide here, and when I build my application the ad (or anything for that matter) doesn't show up. Nothing, nada. I followed the guide very carefully. I know that it is trying to retrieve an ad (thanks to little snitch), but it doesn't display. Has anybody experienced this and do you know of a fix?

    Read the article

  • ODBC vs MySQLClient

    - by Matt
    I'm currently using ODBC to connect to my MySQL database, using C#. I've been told that using the MySql Connector would be better, and faster, and not dependent on Windows. Can someone shed some light on this please? I've been unable to find anything on the net so far

    Read the article

  • PHP templating challenge (optimizing front-end templates)

    - by Matt
    Hey all, I'm trying to do some templating optimizations and I'm wondering if it is possible to do something like this: function table_with_lowercase($data) { $out = '<table>'; for ($i=0; $i < 3; $i++) { $out .= '<tr><td>'; $out .= strtolower($data); $out .= '</td></tr>'; } $out .= "</table>"; return $out; } NOTE: You do not know what $data is when you run this function. Results in: <table> <tr><td><?php echo strtolower($data) ?></td></tr> <tr><td><?php echo strtolower($data) ?></td></tr> <tr><td><?php echo strtolower($data) ?></td></tr> </table> General Case: Anything that can be evaluated (compiled) will be. Any time there is an unknown variable, the variable and the functions enclosing it, will be output in a string format. Here's one more example: function capitalize($str) { return ucwords(strtolower($str)); } If $str is "HI ALL" then the output is: Hi All If $str is unknown then the output is: <?php echo ucwords(strtolower($str)); ?> In this case it would be easier to just call the function (ie. <?php echo capitalize($str) ?> ), but the example before would allow you to precompile your PHP to make it more efficient

    Read the article

  • PHP templating challenge (optimizing front-end templates)

    - by Matt
    Hey all, I'm trying to do some templating optimizations and I'm wondering if it is possible to do something like this: function table_with_lowercase($data) { $out = '<table>'; for ($i=0; $i < 3; $i++) { $out .= '<tr><td>'; $out .= strtolower($data); $out .= '</td></tr>'; } $out .= "</table>"; return $out; } NOTE: You do not know what $data is when you run this function. Results in: <table> <tr><td><?php echo strtolower($data) ?></td></tr> <tr><td><?php echo strtolower($data) ?></td></tr> <tr><td><?php echo strtolower($data) ?></td></tr> </table> General Case: Anything that can be evaluated (compiled) will be. Any time there is an unknown variable, the variable and the functions enclosing it, will be output in a string format. Here's one more example: function capitalize($str) { return ucwords(strtolower($str)); } If $str is "HI ALL" then the output is: Hi All If $str is unknown then the output is: <?php echo ucwords(strtolower($str)); ?> In this case it would be easier to just call the function (ie. <?php echo capitalize($str) ?> ), but the example before would allow you to precompile your PHP to make it more efficient

    Read the article

  • Best practice. Do I save html tags in DB or store the html entity value?

    - by Matt
    Hi Guys, I was wondering about which way i should do the following. I am using the tiny MCE wysiwyg editor which formats the users data with the right html tags. Now, i need to save this data entered into the editor into a database table. Should I encode the html tags to their corresponding entities when inserting into the DB, then when i get the data back from the table, not have the encode it for XSS purposes but I'd still have to use eval for the html tags to format the text. OR Do i save the html tags into the database, then when i get the data back from the database encode the html tags to their entities, but then as the tags will appear to the user, I'd have to use the eval function to actually format the data as it was entered. My thoughts are with the first option, I just wondered on what you guys thought.

    Read the article

  • Programmatic Bot Detection

    - by matt
    Hi, I need to write some code to analyze whether or not a given user on our site is a bot. If it's a bot, we'll take some specific action. Looking at the User Agent is not something that is successful for anything but friendly bots, as you can specify any user agent you want in a bot. I'm after behaviors of unfriendly bots. Various ideas I've had so far are: If you don't have a browser ID If you don't have a session ID Unable to write a cookie Obviously, there are some cases where a legitimate user will look like a bot, but that's ok. Are there other programmatic ways to detect a bot, or either detect something that looks like a bot? thanks!

    Read the article

  • Securely persist session between https://secure.yourname.com and http://www.yourname.com on rails ap

    - by Matt
    My rails site posts to a secure host (e.g. 'https://secure.yourname.com') when the user logs into the site. Session data is stored in the database, with the cookie containing only the session ID. The problem is that when the user returns to a non-https page, such as the home page (e.g. 'http://www.yourname.com') the user appears to have logged out. I believe the reason for this is that a separate cookie is stored for each host (www vs. secure). Is this correct? What is the best secure way to persist the session between both the http and https sections of the site? Does anyone know of any plugins that address this problem? The site runs on Heroku.

    Read the article

  • Pass variable to Google Custom Search Engine

    - by Matt
    Is it possible to pass a search variable into the Google Custom Search Engine that I have embedded on my website? I can get the search engine to work, but I can't pass it a term via POST (it's coming from a search button on other pages of the website) I tried to hack the code I found here: http://code.google.com/apis/ajax/playground/?exp=search#hello_world And this is what I have so far... ($q is the term I am passing to it) <script type="text/javascript"> google.load('search', '1', {language : 'en'}); function OnLoad() { var customSearchControl = new google.search.CustomSearchControl('***my key****'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); customSearchControl.draw('cse'); searchControl.execute("$q"); } google.setOnLoadCallback(OnLoad); </script> Thanks

    Read the article

  • Problems with asp:Button OnClick event...

    - by Matt
    Hi, Here is my button <asp:Button ID="myButton" Text="Click Me" OnClick="doSomething(10)" runat="server" /> Here is the server function public void doSomething(int num) { int someOtherNum = 10 + num; } When I try to compile the code I get the error "Method Name Expected" for the line: <asp:Button ID="myButton" Text="Click Me" OnClick="doSomething(10)" runat="server" /> What am I doing wrong? Am I not allowed to pass values to the server from an OnClick event?

    Read the article

  • Google Translate translates Javascript Code

    - by Matt
    Hi, I have some PHP code that sends a section of html code including some inline Javascript code by curl to google. When i get it back from Google translated into the language that i chose, the Javascript code has been translated too. Any ideas as to how i can stop Google translating my inline JavaScript code? Thanks, M

    Read the article

  • How to obtain the root of a tree without parsing the entire file?

    - by Matt.
    I'm making an xml parser to parse xml reports from different tools, and each tool generates different reports with different tags. For example: Arachni generates an xml report with <arachni_report></arachni_report> as tree root tag. nmap generates an xml report with <nmaprun></nmaprun> as tree root tag. I'm trying not to parse the entire file unless it's a valid report from any of the tools I want. First thing I thought to use was ElementTree, parse the entire xml file (supposing it contains valid xml), and then check based on the tree root if the report belongs to Arachni or nmap. I'm currently using cElementTree, and as far as I know getroot() is not an option here, but my goal is to make this parser to operate with recognized files only, without parsing unnecessary files. By the way, I'm Still learning about xml parsing, thanks in advance.

    Read the article

  • send keystrokes from iphone to PC

    - by Matt Facer
    hi guys. I'm looking to create a simple app which will send keystrokes from an iphone to a PC. I understand that I will need to have a program on my PC "listening"... I've been looking in to AsyncSocket and NSStream, but there are no tutorials which really make it clear to understand. Does anyone know if this is right? I basically want to interact with a program on my PC which listens for keystrokes to control it. Does anyone know of a tutorial or place where I could start to learn this? (I've written iphone apps before, but I am new to networking)

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >