Search Results

Search found 56 results on 3 pages for 'lachlan mcdonald'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Are some data structures more suitable for functional programming than others?

    - by Rob Lachlan
    In Real World Haskell, there is a section titled "Life without arrays or hash tables" where the authors suggest that list and trees are preferred in functional programming, whereas an array or a hash table might be used instead in an imperative program. This makes sense, since it's much easier to reuse part of an (immutable) list or tree when creating a new one than to do so with an array. So my questions are: Are there really significantly different usage patterns for data structures between functional and imperative programming? If so, is this a problem? What if you really do need a hash table for some application? Do you simply swallow the extra expense incurred for modifications?

    Read the article

  • Can I make clojure macro that will allow me to get a list of all functions created by the macro?

    - by Rob Lachlan
    I would like to have a macro which I'll call def-foo. Def-foo will create a function, and then will add this function to a set. So I could call (def-foo bar ...) (def-foo baz ...) And then there would be some set, e.g. all-foos, which I could call: all-foos => #{bar, baz} Essentially, I'm just trying to avoid repeating myself. I could of course define the functions in the normal way, (defn bar ...) and then write the set manually. A better alternative, and simpler than the macro idea, would be to do: (def foos #{(defn bar ...) (defn baz ...)} ) But I'm still curious as to whether there is a good way for the macro idea to work.

    Read the article

  • What's the easiest way to parse numbers in clojure?

    - by Rob Lachlan
    I've been using java to parse numbers, e.g. (. Integer parseInt numberString) Is there a more clojuriffic way that would handle both integers and floats, and return clojure numbers? I'm not especially worried about performance here, I just want to process a bunch of white space delimited numbers in a file and do something with them, in the most straightforward way possible. So a file might have lines like: 5 10 0.0002 4 12 0.003 And I'd like to be able to transform the lines into vectors of numbers.

    Read the article

  • When and how should independent hierarchies be used in clojure?

    - by Rob Lachlan
    Clojure's system for creating an ad hoc hierarchy of keywords is familiar to most people who have spent a bit of time with the language. For example, most demos and presentations of the language include examples such as (derive ::child ::parent) and they go on to show how this can be used for multi-method dispatch. In all of the slides and presentations that I've seen, they use the global hierarchy. But it is possible to put keyword relationships in independent hierarchies, by using (derive h ::child ::parent), where h is created by (make-hierarchy). Some questions, therefore: Are there any guidelines on when this is useful or necessary? Are there any functions for manipulating hierarchies? Merging is particularly useful, so I do this: (defn merge-h [& hierarchies] (apply merge-with (cons #(merge-with clojure.set/union %1 %2) hierarchies)) But I was wondering if such functions already exist somewhere. EDIT: Changed "custom" hierarchy to "independent" hierarchy, since that term better describes this animal. Also, I've done some research and included my own answer below. Further comments are welcome.

    Read the article

  • When and how should custom hierarchies be used in clojure?

    - by Rob Lachlan
    Clojure's system for creating an ad hoc hierarchy of keywords is familiar to most people who have spent a bit of time with the language. For example, most demos and presentations of the language include examples such as (derive ::child ::parent) and they go on to show how this can be used for multi-method dispatch. In all of the slides and presentations that I've seen, they use the global hierarchy. But it is possible to keyword relationships in custom hierarchies. Some questions, therefore: Are there any guidelines on when this is useful or necessary? Are there any functions for manipulating hierarchies? Merging is particularly useful, so I do this: (defn merge-h [& hierarchies] (apply merge-with (cons #(merge-with clojure.set/union %1 %2) hierarchies)) But I was wondering if such functions already exist somewhere.

    Read the article

  • Parse JSON into a ListView friendly output

    - by Thomas McDonald
    So I have this JSON, which then my activity retrieves to a string: {"popular": {"authors_last_month": [ { "url":"http://activeden.net/user/OXYLUS", "item":"OXYLUS", "sales":"1148", "image":"http://s3.envato.com/files/15599.jpg" }, { "url":"http://activeden.net/user/digitalscience", "item":"digitalscience", "sales":"681", "image":"http://s3.envato.com/files/232005.jpg" } { ... } ], "items_last_week": [ { "cost":"4.00", "thumbnail":"http://s3.envato.com/files/227943.jpg", "url":"http://activeden.net/item/christmas-decoration-balls/75682", "sales":"43", "item":"Christmas Decoration Balls", "rating":"3", "id":"75682" }, { "cost":"30.00", "thumbnail":"http://s3.envato.com/files/226221.jpg", "url":"http://activeden.net/item/xml-flip-book-as3/63869", "sales":"27", "item":"XML Flip Book / AS3", "rating":"5", "id":"63869" }, { ... }], "items_last_three_months": [ { "cost":"5.00", "thumbnail":"http://s3.envato.com/files/195638.jpg", "url":"http://activeden.net/item/image-logo-shiner-effect/55085", "sales":"641", "item":"image logo shiner effect", "rating":"5", "id":"55085" }, { "cost":"15.00", "thumbnail":"http://s3.envato.com/files/180749.png", "url":"http://activeden.net/item/banner-rotator-with-auto-delay-time/22243", "sales":"533", "item":"BANNER ROTATOR with Auto Delay Time", "rating":"5", "id":"22243"}, { ... }] } } It can be accessed here as well, although it because it's quite a long string, I've trimmed the above down to display what is needed. Basically, I want to be able to access the items from "items_last_week" and create a list of them - originally my plan was to have the 'thumbnail' on the left with the 'item' next to it, but from playing around with the SDK today it appears too difficult or impossible to achieve this, so I would be more than happy with just having the 'item' data from 'items_last_week' in the list. Coming from php I'm struggling to use any of the JSON libraries which are available to Java, as it appears to be much more than a line of code which I will need to deserialize (I think that's the right word) the JSON, and they all appear to require some form of additional class, apart from the JSONArray/JSONObject script I have which doesn't like the fact that items_last_week is nested (again, I think that's the JSON terminology) and takes an awful long time to run on the Android emulator. So, in effect, I need a (preferably simple) way to pass the items_last_week data to a ListView. I understand I will need a custom adapter which I can probably get my head around but I cannot understand, no matter how much of the day I've just spent trying to figure it out, how to access certain parts of a JSON string..

    Read the article

  • Creating webpage on form submit?

    - by Joachim Mcdonald
    How is it possible to allow a user to create a webpage containing some html, based on their entries in a form? ie. I would want them to be able to input a name and when the button is clicked, a webpage called that name would be created. I imagine that this must be possible in php, but what functions/code would I be using? Thank you!

    Read the article

  • svn from console - how to save password?

    - by john mcdonald
    Hi all, I was wondering if there is a way to save my svn password when doing svn operations from the console. The console is the only option that I have. When I try to do any svn action "eg svn commmit," it prompts for the account password every time. Is there a way to save this password somehow so that I don't have to retype it every time? Thanks.

    Read the article

  • Looking for fast "Find in Files" program

    - by Josh McDonald
    I currently have a directory with 98,000 individual archive transaction files. I need to search those files for user input strings and have the option to open the files as it finds them or at the end of the search. I'm using Notepad++ currently and, while functional, it's quite slow. I thought about writing my own, but I am only familiar with .NET and I'm a beginner. Also, I'm not sure how efficient that would be compared to NP++. This tool would be used again and again so the dev time would definitely be worth it if it came to that. Is there some other tool out there that's already developed that would accomplish this?

    Read the article

  • There's @interface in my @implementation — why is that?

    - by Mark McDonald
    This is a pretty noobish question – I'm looking at some Cocoa sample code and there's @interface blocks in the .m files as well as the headers. For instance, in the AppDelegate class header, a UIWindow and UI navigation are defined as instance variables, but the @property declarations are actually made in the implementation file. Is there a functional reason for this, is it a stylistic choice, or… ?

    Read the article

  • SQL Server Installation Checklist

    - by Jonathan Kehayias
    The other night I was asked on Twitter by Todd McDonald (Twitter), for a build list for SQL Server 2005 and 2008.  My initial response was to provide a link to the SQL Server Build List Blog , which documents all of the builds of SQL Server and provides links to the KB articles associated with the builds.  However, this wasn’t what Todd was after, he actually wanted a reference for an installation checklist for SQL Server.  I have a number of these that I use in my job, and they vary...(read more)

    Read the article

  • GDL Presents: All the Web's a Stage

    GDL Presents: All the Web's a Stage All the Web's a Stage: Building a 3D Space in the Browser Thursday, October 11 - 10:30AM PDT Meet the designers and creative team behind a new sensory Chrome experiment, Movi.Kanti.Revo, in a live, design-focused Q&A. Learn how Cirque du Soleil and Subatomic Systems worked to translate the wonder of Cirque into an environment built entirely with markup and CSS. Host: Pete LePage, Developer Advocate Guests: Gillian Ferrabee, Cirque du Soleil | Nicole McDonald, Director/Creative Director, Subatomic Systems From: GoogleDevelopers Views: 0 0 ratings Time: 00:00 More in Science & Technology

    Read the article

  • Solving Diophantine Equations Using Python

    - by HARSHITH
    In mathematics, a Diophantine equation (named for Diophantus of Alexandria, a third century Greek mathematician) is a polynomial equation where the variables can only take on integer values. Although you may not realize it, you have seen Diophantine equations before: one of the most famous Diophantine equations is: We are not certain that McDonald's knows about Diophantine equations (actually we doubt that they do), but they use them! McDonald's sells Chicken McNuggets in packages of 6, 9 or 20 McNuggets. Thus, it is possible, for example, to buy exactly 15 McNuggets (with one package of 6 and a second package of 9), but it is not possible to buy exactly 16 nuggets, since no non- negative integer combination of 6's, 9's and 20's adds up to 16. To determine if it is possible to buy exactly n McNuggets, one has to solve a Diophantine equation: find non-negative integer values of a, b, and c, such that 6a + 9b + 20c = n. Write an iterative program that finds the largest number of McNuggets that cannot be bought in exact quantity. Your program should print the answer in the following format (where the correct number is provided in place of n): "Largest number of McNuggets that cannot be bought in exact quantity: n"

    Read the article

  • Oracle OpenWorld - 3 Days and Counting!

    - by Theresa Hickman
    If you haven’t set your schedule for OpenWorld yet, here’s your chance to reserve a seat at some of the key Financial Management sessions. There’s over 120 sessions specific to our Financials audience that will not only focus on Oracle’s financial product lines, but will also discuss controls and compliance, as well as analytics, budgeting/planning, and financial reporting and the close process. For a complete list of sessions, view any of the Focus on Documents located on the OpenWorld site. Key Sessions: Day Time Session Location Monday 3:15 Oracle Fusion Financials: Overview, Strategy, Customer Experiences, and Roadmap Moscone West - 2003 Monday 3:15 Oracle Financials: Strategy, Update, and Roadmap Moscone West - 3006 Tuesday 11:45 General Session: What’s Next for Financial Management Solutions at Oracle? Moscone West - 3002/3004 Tuesday 1:15 Exploring Oracle Preventive Controls Governor’s Features Through Real-Life Examples Palace Hotel - Presidio Weds 10:15 Oracle Hyperion Enterprise Performance Management: A Bridge to Oracle Fusion Financials Palace Hotel - Concert Weds 1:15 Oracle Fusion Financials Coexistence with Oracle E-Business Suite Moscone West - 2011 Weds 3:30 McDonald’s Adopts Financial Analytics to Increase Business Performance Moscone West - 2011 Thursday 12:45 User Panel: Reducing Upgrade Errors and Effort While Improving Compliance Palace Hotel Palace Hotel - Presidio

    Read the article

  • How to fix Google 404 not found Crawl Errors?

    - by Freeme
    I was checking on Google webmater tool for my blog site to see if there's any indication on why my blog traffic decreased to half in one day and i saw 43 Not Found crawl errors and 5 in Sitemap Not Found errors. The 5 Not Found errors in Sitemap were the links to categories. I guess I renamed categories that's why google can't find the links. As for the 43 other Not Found errors, I see blog post titles that contains (' .) EX: McDonald's, O.N.E. They weren't found by google crawler. Blog post with /CachedYou at the end and blog posts with /www.example.com attached at the end, they weren't found by Google crawlers either. My question is how do I correct those Not Found Errors? Thanks

    Read the article

  • Diophantine Equation [closed]

    - by ANIL
    In mathematics, a Diophantine equation (named for Diophantus of Alexandria, a third century Greek mathematician) is a polynomial equation where the variables can only take on integer values. Although you may not realize it, you have seen Diophantine equations before: one of the most famous Diophantine equations is: X^n+Y^n=Z^n We are not certain that McDonald's knows about Diophantine equations (actually we doubt that they do), but they use them! McDonald's sells Chicken McNuggets in packages of 6, 9 or 20 McNuggets. Thus, it is possible, for example, to buy exactly 15 McNuggets (with one package of 6 and a second package of 9), but it is not possible to buy exactly 16 nuggets, since no non- negative integer combination of 6's, 9's and 20's adds up to 16. To determine if it is possible to buy exactly n McNuggets, one has to solve a Diophantine equation: find non-negative integer values of a, b, and c, such that 6a + 9b + 20c = n. Problem 1 Show that it is possible to buy exactly 50, 51, 52, 53, 54, and 55 McNuggets, by finding solutions to the Diophantine equation. You can solve this in your head, using paper and pencil, or writing a program. However you chose to solve this problem, list the combinations of 6, 9 and 20 packs of McNuggets you need to buy in order to get each of the exact amounts. Given that it is possible to buy sets of 50, 51, 52, 53, 54 or 55 McNuggets by combinations of 6, 9 and 20 packs, show that it is possible to buy 56, 57,..., 65 McNuggets. In other words, show how, given solutions for 50-55, one can derive solutions for 56-65. Problem 2 Write an iterative program that finds the largest number of McNuggets that cannot be bought in exact quantity. Your program should print the answer in the following format (where the correct number is provided in place of n): "Largest number of McNuggets that cannot be bought in exact quantity: n" Hints: Hypothesize possible instances of numbers of McNuggets that cannot be purchased exactly, starting with 1 For each possible instance, called n, a. Test if there exists non-negative integers a, b, and c, such that 6a+9b+20c = n. (This can be done by looking at all feasible combinations of a, b, and c) b. If not, n cannot be bought in exact quantity, save n When you have found six consecutive values of n that in fact pass the test of having an exact solution, the last answer that was saved (not the last value of n that had a solution) is the correct answer, since you know by the theorem that any amount larger can also be bought in exact quantity

    Read the article

  • Capitalization of Person names in programming

    - by Albert
    Hey all, Is anyone aware of some code/rules on how to capitalize the names of people correctly? John Smith Johan van Rensburg Derrick von Gogh Ruby de La Fuente Peter Maclaurin Garry McDonald (these may not be correct, just some sample names and how the capitalization could be/work) This seems like a losing battle... If anyone has some code or rules on when and how to capitalize names, let me know :) Cheers, Albert

    Read the article

  • Arrays of Objects: For each element in array 1, does an object value exist as a value in any of the objects in array 2

    - by DevOtts
    I have two arrays which contain objects in each element of the array. var array1 = [{firstName: "John", lastName: "McDonald"}, {firstName: "Sandy", lastName: "Johnson"},....,] var array2 = [{userName: "Donald"}, {userName: "John"},....,] In psuedo-code, I want to do the following: for each element in array1, is array1[i].firstName == to any of the userName's in array2. In plain english I want to look at each firstname in array1 and see if it exists at all in array2 as the value associated with the userName property.

    Read the article

  • Expertise Location [closed]

    - by Alexey Shatygin
    Is there some really working implementations of the expertise location systems exist? It is very hard to find anything about it. What sources to use, what to read, where to look? I've started with reading David W. McDonald's, Mark S. Ackerman's overview "Just talk to me" and now need just something more detailed. For those, who voting this question to be closed for off-topic: it is connected to IT sphere, if you don't know what it is - why ever vote? http://en.wikipedia.org/wiki/Expertise_finding http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.40.4654&rep=rep1&type=pdf

    Read the article

  • Push or Pull Mobile Coupons?

    - by David Dorf
    Mobile phones allow consumers to receive coupons in context, which increases their relevance and therefore redemption rates. Using your current location, you can get coupons that can be redeemed nearby for the things you want now. Receiving a coupon for something you wanted last week or something you might buy next month just isn't as valuable. I previously talked about Placecast and their concept of pushing offers to mobile phones that transgress "geo-fences" around points of interest, like store locations. This push model is an automatic reminder there are good deals just up ahead. This model works well in dense cities where people walk, but I question how effective it will be in the suburbs where people are driving. McDonald's recently ran a campaign in Finland where they pushed offers to GPS devices when cars neared their restaurants. Amazingly, they achieved a 7% click-through rate. But 8coupons.com sees things differently. They prefer the pull model that requires customers to initiate a search for nearby coupons, and they've done some studies to better understand what "nearby" means. It turns out that there are concentric search circles that emanate from your home and work. From inner to outer, people search for food, drink, shopping, and entertainment. Intuitively, that feels about right. So the question is, do consumers prefer the push or pull model for offers? No doubt the market is big enough for both. These days its not good enough to just know who your customers are -- you also need to know where they are so you can catch them in the right moment. According to Borrell Associates, redemption rates of mobile coupons are 10x that of traditional mail and newspaper coupons. One thing is for sure; assuming 85% of consumers regularly spend money within 5 miles of home and work, location-based coupons make tons of sense.

    Read the article

  • Facebook Stories for Retailers

    - by David Dorf
    Getting people to "like" a brand is important because it opens the door to a possible B2C relationship. Once a person likes that brand, the brand can post to their newsfeed with promotions, announcements, and surveys. At least for me, I "hide" the noisy brands and just monitor the ones that keep posts under 4 times a week. I see lots of people, especially with fashion brands, comment on postings at which point the posting is seen by their network. A metric I've heard (but not verified) is that for every person that comments, ten of their friends see the original posting. That's a pretty cheap way to communicate to potential customers in a viral way. Over at mainstreet.com they compiled the a list of the top liked retailers on Facebook as of Feb 1, 2011. They are listed below: 19,414,892 Starbucks 11,302,939 Victoria's Secret 7,925,184 Zara 7,032,398 McDonald's 6,117,222 H&M 5,400,586 Taco Bell 4,665,760 Subway 4,494,849 Lacoste 4,185,570 Hollister 3,973,181 Forever 21 So I guess the public likes their fast-food and fashion. To take this to the next level, Facebook is now displaying Sponsored Stories, which I saw for the first time on my page this weekend. I found this picture at the Wall Blog that depicits Sponsored Stories very well. Over on the right-hand column of a person's page, where they see advertisements and such, Facebook will post stories involving their network of friends and their interaction with sponsored brands. Now their "likes" can suddenly become your ads. "Jessica and Philip like Starbucks. What are you waiting for?" This is another great way to take messages viral by accessing social graphs. As usual there will be a certain level of outcry from privacy advocates, but given the other more iniquitous issues, I believe this will fall by the wayside. Retailers should consider using Sponsored Stories to increase their Likes, and thus increase their voice in the social world.

    Read the article

  • How to represent an agile project to people focused on waterfall [closed]

    - by ahsteele
    Our team has been asked to represent our development efforts in a project plan. No one is unhappy with our work or questioning our ability to deliver, we are just participating in an IT cattle call for project plans. Trouble is we are an agile team and haven't thought about our work in terms of a formal project plan. While we have a general idea of what we are working on next we aren't 100% sure until we plan an iteration. Until now our team has largely operated in a vacuum and has not been required to present our methodology or metrics to outside parties. We follow most of the practices espoused in Extreme Programming. We hold quarterly planning meetings to have a general idea of the stories we are going to work on for a quarter. That said, our stories are documented on 3x5 cards and are only estimated at the beginning of the iteration in which they are going to be worked. After estimation we document the story in Team Foundation Sever. During an iteration, we attach code to stories and mark stories as completed once finished. From this data we are able to generate burn down and velocity charts. Most importantly we know our average velocity for an iteration keeping us from biting off more than we can chew. I am not looking to modify the way we do development but want to present our development activities in a report that someone only familiar with waterfall will understand. In What Does an Agile Project Plan Look Like, Kent McDonald does a good job laying out the differences between agile and waterfall project plans. He specifies the differences in consumable bullets: An agile project plan is feature based An Agile Project Plan is organized into iterations An Agile Project Plan has different levels of detail depending on the time frame An Agile Project Plan is owned by the Team Being able to explain the differences is great, but how best to present the data?

    Read the article

  • A New Home for E-Business Suite Customer Adoption Information

    - by linda.fishman.hoyle
    Phew! I made it! A new home with my name. Let's talk about E-Business Suite. So much is going on and more and more customers are upgrading and implementing the latest release. I think I will highlight in this blog entry the most recent press release we issued 2 weeks ago about our Applications Unlimited success but in the release, we name several customers who are live on E-Business Suite Release 12.1 and then have a fabulous quote from a customer who is doing great things with our product.   Here is a link to the press release To make it easy for you, I am pulling out just the E-Business Suite information Oracle E-Business Suite: Oracle® E-Business Suite Release 12.1 provides organizations of all sizes, across all industries and regions, with a global business foundation that helps them reduce costs and increase productivity through a portfolio of rapid value solutions, integrated business processes and industry-focused solutions. The latest version of the Oracle E-Business Suite was designed to help organizations make better decisions and be more competitive by providing a global or holistic view of their operations. Abu Dhabi Media Company, Agilysis, C3 Business Solutions, Chicago Public Schools, Datacard Group, Guidance Software, Leviton Manufacturing, McDonald's, MINOR International, Usana Health Sciences, Zamil Plastic Industries Ltd. and Zebra Technologies are just a few of the organizations that have deployed the latest release of the Oracle E-Business Suite to help them make better decisions and be more competitive, while lowering costs and increasing performance. Customer Speaks "Leviton Manufacturing makes a very diverse line of products including electrical devices and data center products that we sell globally. We upgraded to the latest version of the Oracle E-Business Suite Release 12.1 to support our service business with change management, purchasing, accounts payable, and our internal IT help desk," said Bob MacTaggart, CIO of Leviton Manufacturing. "We consolidated seven Web sites that we used to host individually onto iStore. In addition, we run a site, using the Oracle E-Business Suite configurator, pricing and quoting for our sales agents to do configuration work. This site can now generate a complete sales proposal using Oracle functionality; we actually generate CAD drawings - the actual drawings themselves - based on configuration results. It used to take six to eight weeks to generate these drawings and now it's all done online in an hour to two hours by our sales agents themselves, totally self-service. It does everything they need. From our point of view that is a major business success. Not only is it a very cool, innovative application, but it also puts us about two years ahead of our competition."

    Read the article

< Previous Page | 1 2 3  | Next Page >