Search Results

Search found 265 results on 11 pages for 'zack warren'.

Page 10/11 | < Previous Page | 6 7 8 9 10 11  | Next Page >

  • Macro to improve callback registration readability

    - by Warren Seine
    I'm trying to write a macro to make a specific usage of callbacks in C++ easier. All my callbacks are member functions and will take this as first argument and a second one whose type inherits from a common base class. The usual way to go is: register_callback(boost::bind(&my_class::member_function, this, _1)); I'd love to write: register_callback(HANDLER(member_function)); Note that it will always be used within the same class. Even if typeof is considered as a bad practice, it sounds like a pretty solution to the lack of __class__ macro to get the current class name. The following code works: typedef typeof(*this) CLASS; boost::bind(& CLASS :: member_function, this, _1)(my_argument); but I can't use this code in a macro which will be given as argument to register_callback. I've tried: #define HANDLER(FUN) \ boost::bind(& typeof(*this) :: member_function, this, _1); which doesn't work for reasons I don't understand. Quoting GCC documentation: A typeof-construct can be used anywhere a typedef name could be used. My compiler is GCC 4.4, and even if I'd prefer something standard, GCC-specific solutions are accepted.

    Read the article

  • Selecting items from events, as evenly spaced as possible

    - by Matt Warren
    If I have an event that happens 15 times a second (numbered 1 - 15), but I only want to process it 3 times I can choose [1], [6] and [11],. It's important that the events I process are as evenly spaced as possible and take into account wrap-around, i.e. the events are continuous 13, 14, 15, 1, 2, 3 etc. If I want 4 items the best I can do is [1], [5], [9] & [13]. Is there a general algorithm that will calculate which events I need to process given the total number of events (total) and the number to process (processAmount).

    Read the article

  • Can I move the order of XCode, Cocoa, and User Templates around in XCode 3.1?

    - by Warren P
    I followed the other questions on StackOverflow and made custom User Templates. Instead of replacing the factory default Cocoa class template, I have to pick a new user template. The order that is shown in XCode's New File dialog box is: iPhone templates first (great if you mostly do iphone development) Second the User templates Third the default Mac OS templates. I want my user stuff first, Mac OS templates second, and I want to bury iPhone templates in third and last place. The sort is obviously not alphabetical. And you can't drag/drop reorder. (At least not in xcode 3.1.3)? From stackoverflow

    Read the article

  • How to 'insert if not exists' in MySQL?

    - by warren
    I started by googling, and found this article which talks about mutex tables. I have a table with ~14 million records. If I want to add more data in the same format, is there a way to ensure the record I want to insert does not already exist without using a pair of queries (ie, one query to check and one to insert is the result set is empty)? Does a unique constraint on a field guarantee the insert will fail if it's already there? It seems that with merely a constraint, when I issue the insert via php, the script croaks.

    Read the article

  • Delphi component you can't live without?

    - by Warren P
    Most delphi developers have a list of delphi components they wouldn't live without. Not including anything that ships with Delphi (standard VCL or included third-party software like Rave or Indy), what are the components you can't live without, be they commercial or open-source? I will refrain from adding my own answers unless this becomes a community wiki. One component name, or product name, per answer please. Please vote up on components and do not post duplicates.

    Read the article

  • Exemplars of large document-centric applications with COM/XPCOM/.NET interfaces.

    - by Warren P
    I am looking for exemplars (design examples) showing the use of interfaces (aka 'protocols' for you smalltalkers) to design a document management architecture in a large Word Processor, Spreadsheet, vector graphic or publishing package, or office-productivity (non-database) application with support for as many of the following as possible: any open source project, will be ideal, and language of implementation is unimportant since I am looking for design examples, however an object oriented language with support for "interfaces" is a must. I know at least a dozen languages, and I'm willing to study any application's source. use of "interface" could loosely be applied to either XPCOM or COM interfaces, or .NET interfaces, or even the use of pure-virtual (virtual+abstract) base-classes for OOP languages that lack the ability to declare an interface distinct from a class. I am mostly looking for a robust, thorough and flexible implementation for a document, IDocument, various document views (IDocumentView), and whatever operations make sense in that case. I am particular interested in cases where the product in question is a real-world product. For example, if anybody familiar with OpenOffice can tell me if the code contains a good sample design. I am looking for design documentation that outlines the design of the interfaces for such an application. So for example, if the openoffice spreadsheet has such an interface design, then that might be the best case, because it is a widely used real-world design, with millions of users, rather than a textbook example, which is minimal, and contrived. I know that the Mozilla platform uses XPCOM, and its design is heavily "interface" oriented, but I am looking more for a "word processor" or "spreadsheet" type of document design, rather than a web-browser. I am particularly interested in the interfaces used to access to data and meta-data such as markup (attributes like bold, and italics, and font size), and the ability to search and look up named entities within a document.

    Read the article

  • Force an object to be allocated on the heap

    - by Warren Seine
    A C++ class I'm writing uses shared_from_this() to return a valid boost::shared_ptr<>. Besides, I don't want to manage memory for this kind of object. At the moment, I'm not restricting the way the user allocates the object, which causes an error if shared_from_this() is called on a stack-allocated object. I'd like to force the object to be allocated with new and managed by a smart pointer, no matter how the user declares it. I thought it could be done through a proxy or an overloaded new operator, but I can't find a proper way of doing that. Is there a common design pattern for such usage? If it's not possible, how can I test it at compile time?

    Read the article

  • Typedef equivalence in function arguments

    - by Warren Seine
    Hi guys, The question is kind of hard to ask without an example so here it is: #include <vector> struct O { }; struct C { template <typename T> void function1(void (C::*callback)(const O*)); template <typename T> void function2(void (C::*callback)(const typename T::value_type)); void print(const O*); }; int main() { C c; c.function1< std::vector<O*> >(&C::print); // Success. c.function2< std::vector<O*> >(&C::print); // Fail. } The error that I am given is: error: no matching function for call to ‘C::function2(void (C::*)(const O*))’. Basically, the only difference between calls is that in function2, I'm more generic since I use the typedef std::vector<O*>::value_type which should resolve to O*, hence similar to function1. I'm using G++ 4.2.1 (I know it's old), but Comeau confirms I'm wrong. Why does the compilation fail?

    Read the article

  • Delphi components you can't live without

    - by Warren P
    Most Delphi developers have a list of Delphi components they wouldn't live without. Not including anything that ships with Delphi (standard VCL or included third-party software like Rave or Indy), what are the components you can't live without, be they commercial or open-source? One component or product name per answer, please. Please do not post duplicates.

    Read the article

  • does a git repository have its own local value for core.autocrlf that overrides the global one?

    - by Warren P
    As per this question, I understand that core.autocrlf=true in git will cause CRLF to LF translations. However when I type : git config core.autocrlf I see: false However, when I stage modified files that are already in the repo, I still get these warnings: Warning: CRLF will be replaced by LF in File1.X. The file will have its original line endings in your working directory. My guess is that the repo copy of the file is already set to "autocrlf=true". Questions: A. How do I query whether a file or git repo is already forcing AutoCrlf? B. How do I turn it autocrlf off?

    Read the article

  • An Array returned by a model association is not an Array?

    - by Warren
    We have a model association that looks something like this: class Example < ActiveRecord::Base has_many :others, :order => 'others.rank' end The rank column is an integer type. The details of these particular models are not really important though as we have found the same problem with other has_many associations between other models. We have also added to the Enumerable module: module Enumerable def method_missing(name) super unless name.to_s[0..7] == 'collect_' method = name.to_s[8..-1] collect{|element| element.send(method)} end end This adds a collect_id method that we can use to get an array of record ids from an array of ActiveRecord objects. So if we use a normal ActiveRecord find :all, we get a nice array which we can then use collect_id on but if we use Example.others.collect_id, we get NoMethodError: undefined method `collect_id' for #<Class:0x2aaaac0060a0> Example.others.class returns "Array" so is it lying or confused? Our solution thus far has been to use it this way: Example.others.to_a.collect_id This works but this seems a bit strange. Why would you have to do that? We are on Ruby 1.8.7 and Rails 2.3.4

    Read the article

  • How to access property in sub method after it runs?

    - by Warren
    I'm having a hard time working this one out but I think it should be pretty simple. Basically, I have this method which talks to a webservice and I need to return some data from the sub method, the "authCode". What am I doing wrong? How can I get the authCode out of the manager, or can I create a block or something to to ensure that the manager block runs first? Am I even using the right words - blocks, sub methods??? Please help :) - (NSString *)getAuthCodeEXAMPLE { __block NSString *returnString = @"nothing yet!"; NSURL *baseURL = [NSURL URLWithString:BaseURLString]; NSDictionary *parametersGetAuthCode = @{@"req": @"getauth"}; AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL]; manager.responseSerializer = [AFJSONResponseSerializer serializer]; [manager POST:APIscript parameters:parametersGetAuthCode success:^(NSURLSessionDataTask *task, id responseObject) { if ([task.response isKindOfClass:[NSHTTPURLResponse class]]) { NSHTTPURLResponse *r = (NSHTTPURLResponse *)task.response; if ([r statusCode] == 200) { self.returnedData = responseObject; NSString *authCode = [self.returnedData authcode]; NSLog(@"Authcode: %@", authCode); returnString = authCode; } } } failure:^(NSURLSessionDataTask *task, NSError *error) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alertView show]; }]; //this currently returns "nothing yet!" return returnString; }

    Read the article

  • Best way to randomly select rows *per* column in SQL Server

    - by LesterDove
    A search of SO yields many results describing how to select random rows of data from a database table. My requirement is a bit different, though, in that I'd like to select individual columns from across random rows in the most efficient/random/interesting way possible. To better illustrate: I have a large Customers table, and from that I'd like to generate a bunch of fictitious demo Customer records that aren't real people. I'm thinking of just querying randomly from the Customers table, and then randomly pairing FirstNames with LastNames, Address, City, State, etc. So if this is my real Customer data (simplified): FirstName LastName State ========================== Sally Simpson SD Will Warren WI Mike Malone MN Kelly Kline KS Then I'd generate several records that look like this: FirstName LastName State ========================== Sally Warren MN Kelly Malone SD Etc. My initial approach works, but it lacks the elegance that I'm hoping the final answer will provide. (I'm particularly unhappy with the repetitiveness of the subqueries, and the fact that this solution requires a known/fixed number of fields and therefore isn't reusable.) SELECT FirstName = (SELECT TOP 1 FirstName FROM Customer ORDER BY newid()), LastName= (SELECT TOP 1 LastNameFROM Customer ORDER BY newid()), State = (SELECT TOP 1 State FROM Customer ORDER BY newid()) Thanks!

    Read the article

  • Best way to randomly select columns from random rows of SQL results.

    - by LesterDove
    A search of SO yields many results describing how to select random rows of data from a database table. My requirement is a bit different, though, in that I'd like to select individual columns from across random rows in the most efficient/random/interesting way possible. To better illustrate: I have a large Customers table, and from that I'd like to generate a bunch of fictitious demo Customer records that aren't real people. I'm thinking of just querying randomly from the Customers table, and then randomly pairing FirstNames with LastNames, Address, City, State, etc. So if this is my real Customer data (simplified): FirstName LastName State ========================== Sally Simpson SD Will Warren WI Mike Malone MN Kelly Kline KS Then I'd generate several records that look like this: FirstName LastName State ========================== Sally Warren MN Kelly Malone SD Etc. My initial approach works, but it lacks the elegance that I'm hoping the final answer will provide. (I'm particularly unhappy with the repetitiveness of the subqueries, and the fact that this solution requires a known/fixed number of fields and therefore isn't reusable.) SELECT FirstName = (SELECT TOP 1 FirstName FROM Customer ORDER BY newid()), LastName= (SELECT TOP 1 LastNameFROM Customer ORDER BY newid()), State = (SELECT TOP 1 State FROM Customer ORDER BY newid()) Thanks!

    Read the article

  • What Should PASS Be?

    - by andyleonard
    Introduction As he does so well, Andy Warren ( Blog | @sqlAndy ) has issued a challenge to the community: What Should PASS Be? I'm sure lots of people have responded already, but I've been struck by two: Grant Fritchey's ( Blog | @GFritchey ) What Should PASS Be? and Robert Matthew Cook's ( Blog | @sqlmashup ) [blog] What Should PASS Be? #sqlpass . They're... Different I don't know Robert well. That doesn't mean there's something wrong with Robert. It simply means he's one of hundreds of the cool...(read more)

    Read the article

  • Sun2Oracle: Hub City Media Webcast Reminder - Thursday, September 13, 2012

    - by Darin Pendergraft
    Our Sun2Oracle webcast featuring Steve Giovanetti from Hub City Media is this Thursday, September 13th at 10:00 am PST.  If you haven't registered yet, there is still time: Register Here. Scott Bonell, Sr. Director of Product Management will be talking to Steve about their recent project to upgrade a large University from Sun DSEE Directory to Oracle Unified Directory.  Scott and Steve will talk through details of the project, from planning through implementation. In addition to this webcast, Steve Giovanetti will also be participating in two sessions at Oracle OpenWorld 2012: CON9465 - Next-Generation Directory: Oracle Unified Directory  Etienne Remillon, Principal Product Manager, Oracle  Steve Giovanetti, CTO Hub City Media  Warren Leung, Sr. Architect, UCLA  Tuesday, Oct 2, 5:00 PM – 6:00 PM  Moscone West – 3008 CON5749 - Solutions for Migration of Oracle Waveset to Oracle Identity Manager Steve Giovanetti, CTO Hub City Media Kevin Moulton, Senior Sales Consulting  Manager, Oracle Thursday, Oct 4, 11:15 AM - 12:15 PM Moscone West - 3008

    Read the article

  • Google I/O 2012 - Developing for a Global Audience: Tools for Localization and Internationalization

    Google I/O 2012 - Developing for a Global Audience: Tools for Localization and Internationalization C. Andrew Warren, Manish Bhargava As internet and mobile penetration continue to rise, developers face a unique and challenging opportunity: billions of new users speaking dozens of distinct languages. English has often been considered a lingua franca for apps and websites, but fewer than half of the current online population now speaks it - success in the global web will require a more nimble approach. This tech talk will explore some of the tips, tricks, and tools that can make internationalization (i18n) and localization (L10n) simpler for web and mobile app developers (with a focus on Chrome, Android, and App Engine apps). For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 9 0 ratings Time: 50:24 More in Science & Technology

    Read the article

  • 3rd Annual South Florida SQL Saturday - August 13th!

    - by ScottKlein
    The 3rd annual South Florida SQL Saturday event will be help August 13th, 2011 at Nova Southeastern University in Davie, FL. This is a change in venue from last year as DeVry is in the middle of a major remodling project. We has almost 450 last year, and we expect to have over 500 this year with great speakers such as Andy Warren, Herve Roggero, and more! As always, we our goal is to feed you well, so we are shooting for some hot lunch food this year. We are working on that now and will update you as soon as we firm it up. One of the things we will be trying this year is 90-100 minute sessions on a couple of tracks. We strongly feel that several topics are just getting warmed up in 45 minutes, so we are going to experiment with 90-100 minute sessions on some of the BI topics. We would love to see you there!

    Read the article

  • question about books

    - by davit-datuashvili
    i have question how good is this book? http://www.amazon.com/Concrete-Mathematics-Foundation-Computer-Science/dp/0201558025/ ? and can anybody advise good books about bit manipulations? for example how good is this book? http://www.amazon.com/Hackers-Delight-Henry-S-Warren/dp/0201914654/

    Read the article

  • WPB .Net User Group 11/29 Meeting - Kinect SDK with Joe Healy - New Meeting Location

    - by Sam Abraham
    We are excited to share great news and updates regarding the West Palm Beach .Net User Group. Our upcoming meeting will feature Joe Healy from Microsoft as speaker for the November 29th, 2011 6:30 PM meeting.   He will be covering the Kinect SDK and answering all our questions regarding the latest Windows Phone 7 Release. We will be also raffling many valuable items as part of our usual free raffle and hope each of our members leaves with a freebie.   We are also honored to share that we will be hosting our special meeting at a new location:   PC Professor 6080 Okeechobee Blvd.,  #200 West Palm Beach, FL 33417 Phone: 561-684-3333.   This is right by the Florida Turnpike entrance on Okeechobee Blvd.   PC Professor will be also providing our free pizza/soda and some additional surprise items for this meeting to mark the debut of our meetings at their location!   We would like to use this opportunity to thank our current host, CompTec, for its generous support and for hosting us for the past 2 years and look forward to their continued support and sponsorship.   A lot of work and effort is put into hosting a meeting that we hope translates into added value and benefit for our membership. We always welcome your feedback and participation as we strive to continuously improve the group.   Special thanks to our group member, Zack Weiner, for helping us find this new location.   For more details and to register please visit: http://www.fladotnet.com/Reg.aspx?EventID=536   Hope to see you all there.   --Sam Abraham & Venkat Subramanian Site Directors – West Palm Beach .Net User Group

    Read the article

  • Modify MDT wizard to automate computer naming

    - by Jeramy
    I originally posted this question to StackOverflow, but upon further consideration it might be more appropriate here. Situation: I am imaging new systems using MDT Lite-Touch. I am trying to customize the wizard to automate the naming of new systems so that they include a prefix "AG-", a department code which is selected from a drop-down box in the wizard page (eg. "COMM"), and finally the serial number of the computer being imaged, so that my result in this case would be "AG-COMM-1234567890" Status: I have banged away at this for a while but my Google searches have not turned up answers, my trial-and-error is not producing useful error messages and I think I am missing some fundamentals of how to get variables from the wizard page into the variables used by the lite-touch wizard. Progress: I first created the HTML page which I will include below and added a script to the page to concatenate the pieces into a variable called OSDComputername which, for testing, I could output in a msgbox and get to display correctly. The problem with this is I don't know how to trigger the script then assign it to the OSDComputername variable that is used throughout the rest of the Light-Touch process. I changed the script to a function and added it to DeployWiz_Initization.vbs then used the Initialization field in WDS to call it. I'll include the function below. The problem with this is I would get "Undefined Variable" for OSDComputername and I am not sure it is pulling the data from the HTML correctly. I tried adding the scripting into the customsettings.ini file after the "OSDComputername=" This resulted in the wizard just outputting my code in text as the computer name. I am now trying adding variables to "Properties=" (eg.DepartmentName) in the customsettings.ini, pulling thier value from the HTML Form and setting that value to the variable in my function in DeployWiz_Initization.vbs and calling them after "OSDComputername=" in the fashion "OSDComputername="AG-" & %DepartmentName%" in customsettings.ini I am rebuilding right now and will see how this goes Any help would be appreciated. The HTML page: <HTML> <H1>Configure the computer name.</H1> <span style="width: 95%;"> <p>Please answer the following questions. Your answers will be used to formulate the computer's name and description.</p> <FORM NAME="TestForm"> <p>Departmental Prefix: <!-- <label class=ErrMsg id=DepartmentalPrefix_Err>* Required (MISSING)</label> --> <SELECT NAME="DepartmentalPrefix_Edit" class=WideEdit> <option value="AADC">AADC</option> <option value="AEM">AEM</option> <option value="AIP">AIP</option> <option value="COM">COM</option> <option value="DO">DO</option> <option value="DSOC">DSOC</option> <option value="EDU">EDU</option> <option value="EPE">EPE</option> <option value="ITN">ITN</option> <option value="LA">LA</option> <option value="OAP">OAP</option> <option value="SML">SML</option> </SELECT> </p> <p><span class="Larger">Client's Net<u class=larger>I</u>D:</span> <INPUT NAME="ClientNetID" TYPE="TEXT" ID="ClientNetID" SIZE="15"></p> <p>Building: <!-- <label class=ErrMsg id=Building_Err>* Required (MISSING)</label> --> <SELECT NAME="Building_Edit" class=WideEdit> <option value="Academic Surge Facility A">Academic Surge Facility A</option> <option value="Academic Surge Facility B">Academic Surge Facility B</option> <option value="Caldwell">Caldwell</option> <option value="Kennedy">Kennedy</option> <option value="Roberts">Roberts</option> <option value="Warren">Warren</option> </SELECT> </p> <p> <span class="Larger">Room <u class=larger>N</u>umber:</span> <input type=text id="RoomNumber" name=RoomNumber size=15 /> </p> </FORM> </span> </HTML> The Function: Function SetComputerName OSDComputerName = "AG-" & oEnvironment.Item("DepartmentalPrefix_Edit") ComputerDescription = oEnvironment.Item("DepartmentalPrefix_Edit") & ", " & oEnvironment.Item("ClientNetID") & ", " & oEnvironment.Item("RoomNumber") & " " & oEnvironment.Item("Building_Edit") End Function

    Read the article

  • Twitter Feeds in Umbraco using XSLT

    - by Vizioz Limited
    There are currently two packages tagged on the Umbraco forum that can be used to add a twitter feed to your website. I was playing around with "Twitter for Umbraco" by Warren Buckley and noticed a bug in the way it converted twitter @names to links, so I thought I would try and solve this using XSLT.It may also be useful for those of you using Darren Ferguson's "Feed Cache" package as the demo on Darren's site does not add links to the tweets.To use this XSLT you simple call the XSLT Template passing in your Twitter message:<xsl:call-template name="formaturl"> <xsl:with-param name="url" select="text"/></xsl:call-template>Then add the XSLT template to your XSLT macro (outside of the main template)<xsl:template name="formaturl"> <xsl:param name="twitterfeed"/> <xsl:variable name="transform-http" select="Exslt.ExsltRegularExpressions:replace($twitterfeed, '(http\:\/\/\S+)',ig,'<a href="$1">$1</a>')"/> <xsl:variable name="transform-https" select="Exslt.ExsltRegularExpressions:replace($transform-http, '(HTTps\:\/\/\S+)',ig,'<a href="$1">$1</a>')"/> <xsl:variable name="transform-AT" select="Exslt.ExsltRegularExpressions:replace($transform-https, '(^|\s)@(\w+)',ig,' <a href="http://www.twitter.com/$2">@$2</a>')"/> <xsl:variable name="transform-HASH" select="Exslt.ExsltRegularExpressions:replace($transform-AT, '(^|\s)#(\w+)',ig,' <a href="http://www.twitter.com/search?q=$2">#$2</a>')"/> <xsl:value-of select="$transform-HASH" disable-output-escaping="yes"/> </xsl:template>You should find that this now replaces all the @names, #names and URL's with links!

    Read the article

  • Using a "local" S3 emulation layer as a replacement for HDFS?

    - by user183394
    I have been testing out the most recent Cloudera CDH4 hadoop-conf-pseudo (i.e. MRv2 or YARN) on a notebook, which has 4 cores, 8GB RAM, an Intel X25MG2 SSD, and runs a S3 emulation layer my colleagues and I wrote in C++. The OS is Ubuntu 12.04LTS 64bit. So far so good. Looking at Setting up hadoop to use S3 as a replacement for HDFS, I would like to do it on my notebook. Nevertheless, I can't find where I can change the jets3t.properties for setting the end point to localhost. I downloaded the hadoop-2.0.1-alpha.tar.gz and searched the source without finding out a clue. There is a similar Q on SO Using s3 as fs.default.name or HDFS?, but I want to use our own lightweight and fast S3 emulation layer, instead of AWS S3, for our experiments. I would appreciate a hint as to how I can change the end point to a different hostname. Regards, --Zack

    Read the article

< Previous Page | 6 7 8 9 10 11  | Next Page >