Search Results

Search found 295 results on 12 pages for 'chad sellers'.

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

  • In Clojure - How do I access keys in a vector of structs

    - by Nick
    I have the following vector of structs: (defstruct #^{:doc "Basic structure for book information."} book :title :authors :price) (def #^{:doc "The top ten Amazon best sellers on 16 Mar 2010."} best-sellers [(struct book "The Big Short" ["Michael Lewis"] 15.09) (struct book "The Help" ["Kathryn Stockett"] 9.50) (struct book "Change Your Prain, Change Your Body" ["Daniel G. Amen M.D."] 14.29) (struct book "Food Rules" ["Michael Pollan"] 5.00) (struct book "Courage and Consequence" ["Karl Rove"] 16.50) (struct book "A Patriot's History of the United States" ["Larry Schweikart","Michael Allen"] 12.00) (struct book "The 48 Laws of Power" ["Robert Greene"] 11.00) (struct book "The Five Thousand Year Leap" ["W. Cleon Skousen","James Michael Pratt","Carlos L Packard","Evan Frederickson"] 10.97) (struct book "Chelsea Chelsea Bang Bang" ["Chelsea Handler"] 14.03) (struct book "The Kind Diet" ["Alicia Silverstone","Neal D. Barnard M.D."] 16.00)]) I would like to sum the prices of all the books in the vector. What I have is the following: (defn get-price "Same as print-book but handling multiple authors on a single book" [ {:keys [title authors price]} ] price) Then I: (reduce + (map get-price best-sellers)) Is there a way of doing this without mapping the "get-price" function over the vector? Or is there an idiomatic way of approaching this problem?

    Read the article

  • A Wonderful Comment From a Very Inflential Microsoft Technology Company's Owner

    - by TheSilverlightGroup
    The Silverlight Group has been so very busy taking on state-of-the-art Silverlight development with huge, Fortune 500 companies! We have a great pool of talent, & if any of you Silverlight &/or Blend/UI/UX people are interested in joining us, our toll-free number is 1-888-863-6989. I'd like to point out that Nubifer, Inc.'s CEO, Chad Collins, http://channel9.msdn.com/posts/sureshs/Nubifer-cloud-solution-on-Windows-Azure/ , called our company "The Flagship Company for Silverlight Development"...thank you, Chad, as I see you at the same level for Cloud Computing. -See the SilverLIGHT!

    Read the article

  • Programmatic DNS

    - by Chad
    I'm a long time developer but not very experienced with DNS. Here's my problem: Our app launches servers on Amazon EC2 for clients. One client wants to use custom DNS's for every server launched instead of the normal long public DNS provided by AWS: for example server-5.demo.ourclient.com, server-6.demo.ourclient.com. What's the easiest/cleanest/best way to solve this challenge from inside our application that launches the servers and knows the Amazon public DNS? We can probably get control of demo.ourclient.com as well.... Are there nice hosted solutions with API's? Would we need to manage a DNS server for *.demo.ourclient.com? Thanks! Chad

    Read the article

  • Get the maximum value out of an complex class

    - by iTayb
    I have the following class: class Seller { private string sellerName; private decimal price; } ~propreties for SellerName and Price goes here~ I also have a list of sellers: list<Seller> s = new list<Seller>(); How can I get the maximum value of price out of all the sellers? Thank you very much.

    Read the article

  • Will Ubuntu break my RAID 0 array?

    - by Chad
    I am upgrading an older machine today with new Motherboard, RAM, and CPU. Then I am going to do a fresh install of Ubuntu 64bit. Currently the old machine has an 80gb system drive, and a 4TB RAID 0 array. The old Motherboard has no SATA ports, so I used a SATA card. Ubuntu set up the old RAID array, will it still recognize the array on a newer machine? Are there any steps I should take to ensure the array isn't damaged? It's non-crucial data, but I would rather not start over if it can be avoided. Thanks.

    Read the article

  • Is this a secure solution for RESTful authentication?

    - by Chad Johnson
    I need to quickly implement a RESTful authentication system for my JavaScript application to use. I think I understand how it should work, but I just want to double check. Here's what I'm thinking -- what do you guys think? Database schema users id : integer first_name : varchar(50) last_name : varchar(50) password : varchar(32) (MD5 hashed) etc. user_authentications id : integer user_id : integer auth_token : varchar(32) (AES encrypted, with keys outside database) access_token : varchar(32) (AES encrypted, with keys outside database) active : boolean Steps The following happens over SSL. I'm using Sinatra for the API. JavaScript requests authentication via POST to /users/auth/token. The /users/auth/token API method generates an auth_token hash, creates a record in user_authentications, and returns auth_token. JavaScript hashes the user's password and then salts it with auth_token -- SHA(access_token + MD5(password)) POST the user's username and hashed+salted password to /users/auth/authenticate. The /users/auth/authenticate API method will verify that SHA(AES.decrypt(access_token) + user.password) == what was received via POST. The /users/auth/authenticate will generate, AES encrypt, store, and return an access token if verification is successful; otherwise, it will return 401 Unauthorized. For any future requests against the API, JavaScript will include access_token, and the API will find the user account based on that.

    Read the article

  • Launch a real install of Ubuntu already on another hard-drive in Windows 7 like a VM

    - by Chad M
    I'm not too familiar with VMs and the like so this may not even be possible. Here is what I have: A real, full install of Windows 7 on hard drive A. A real, full install of Ubuntu 10.04 on hard drive B. Grub allowing me to select what I want to launch when I start up my computer. It would be Amazing if I could do one of two things. Within Windows 7, launch my real install of ubuntu as if it were a VM. That means i would get all the installed software, all of the files, and all of the settings. Launch a VM copy of ubuntu 10.04 but some how make it use all of the installed software and settings from my real copy. Thanks!

    Read the article

  • How do I redirect www and non but not IP

    - by Chad T Parson
    I am trying to redirect www.domain.com or domain.com to www.domain.com/temp.html I am using the following code: RewriteCond %{HTTP_HOST} ^.*$ RewriteRule ^/?$ "http\:\/\/www\.domain\.com\/temp\.html" [R=301,L] That works however I do not want to redirect IP. So if someone types in the static IP of the domain then I do not want them to be redirected to www.domain.com/temp.html Anyone have the code to take care of this?

    Read the article

  • Making an interactive 2D map

    - by Chad
    So recently I have been working on a Legend of Zelda: A Link to the Past clone, and I am wondering how I could handle certain map interactions (like cutting grass, lifting rocks, etc). The way I am currently doing the tilemap is with 2 PNGs. The first is the "tilemap" where each pixel represents a 16x16 tile and the (red, green) values are the (x, y) coords for the tile in the second PNG (the "tileset"). I am then using the blue channel to store collision data. Each tile is split into 4 8x8 tiles and represented by a 2 bit value (0 = empty, 1 = Jumpdown point, 2 = unused right now, 3 = blocking). 4 of these 2 bit values make up the full blue channel (1 byte). So collisions work great, and I am moving on to putting interactive units on the level; but I am not sure what a good way is to do it. I have experimented with spawning an entity for each grass and rock, but there are just WAY to many; FPS just dies even if I confine it to the current "zone" the user is in (for those who remember LTTP it had zones you moved between). It does make a difference that this is a browser-based JavaScript game. tl;dr: What is a good way to have an interactive map without using full blown entities for each interactive item?

    Read the article

  • Shadows shimmer when camera moves

    - by Chad Layton
    I've implemented shadow maps in my simple block engine as an exercise. I'm using one directional light and using the view volume to create the shadow matrices. I'm experiencing some problems with the shadows shimmering when the camera moves and I'd like to know if it's an issue with my implementation or just an issue with basic/naive shadow mapping itself. Here's a video: http://www.youtube.com/watch?v=vyprATt5BBg&feature=youtu.be Here's the code I use to create the shadow matrices. The commented out code is my original attempt to perfectly fit the view frustum. You can also see my attempt to try clamping movement to texels in the shadow map which didn't seem to make any difference. Then I tried using a bounding sphere instead, also to no apparent effect. public void CreateViewProjectionTransformsToFit(Camera camera, out Matrix viewTransform, out Matrix projectionTransform, out Vector3 position) { BoundingSphere cameraViewFrustumBoundingSphere = BoundingSphere.CreateFromFrustum(camera.ViewFrustum); float lightNearPlaneDistance = 1.0f; Vector3 lookAt = cameraViewFrustumBoundingSphere.Center; float distanceFromLookAt = cameraViewFrustumBoundingSphere.Radius + lightNearPlaneDistance; Vector3 directionFromLookAt = -Direction * distanceFromLookAt; position = lookAt + directionFromLookAt; viewTransform = Matrix.CreateLookAt(position, lookAt, Vector3.Up); float lightFarPlaneDistance = distanceFromLookAt + cameraViewFrustumBoundingSphere.Radius; float diameter = cameraViewFrustumBoundingSphere.Radius * 2.0f; Matrix.CreateOrthographic(diameter, diameter, lightNearPlaneDistance, lightFarPlaneDistance, out projectionTransform); //Vector3 cameraViewFrustumCentroid = camera.ViewFrustum.GetCentroid(); //position = cameraViewFrustumCentroid - (Direction * (camera.FarPlaneDistance - camera.NearPlaneDistance)); //viewTransform = Matrix.CreateLookAt(position, cameraViewFrustumCentroid, Up); //Vector3[] cameraViewFrustumCornersWS = camera.ViewFrustum.GetCorners(); //Vector3[] cameraViewFrustumCornersLS = new Vector3[8]; //Vector3.Transform(cameraViewFrustumCornersWS, ref viewTransform, cameraViewFrustumCornersLS); //Vector3 min = cameraViewFrustumCornersLS[0]; //Vector3 max = cameraViewFrustumCornersLS[0]; //for (int i = 1; i < 8; i++) //{ // min = Vector3.Min(min, cameraViewFrustumCornersLS[i]); // max = Vector3.Max(max, cameraViewFrustumCornersLS[i]); //} //// Clamp to nearest texel //float texelSize = 1.0f / Renderer.ShadowMapSize; //min.X -= min.X % texelSize; //min.Y -= min.Y % texelSize; //min.Z -= min.Z % texelSize; //max.X -= max.X % texelSize; //max.Y -= max.Y % texelSize; //max.Z -= max.Z % texelSize; //// We just use an orthographic projection matrix. The sun is so far away that it's rays are essentially parallel. //Matrix.CreateOrthographicOffCenter(min.X, max.X, min.Y, max.Y, -max.Z, -min.Z, out projectionTransform); } And here's the relevant part of the shader: if (CastShadows) { float4 positionLightCS = mul(float4(position, 1.0f), LightViewProj); float2 texCoord = clipSpaceToScreen(positionLightCS) + 0.5f / ShadowMapSize; float shadowMapDepth = tex2D(ShadowMapSampler, texCoord).r; float distanceToLight = length(LightPosition - position); float bias = 0.2f; if (shadowMapDepth < (distanceToLight - bias)) { return float4(0.0f, 0.0f, 0.0f, 0.0f); } } The shimmer is slightly better if I drastically reduce the view volume but I think that's mostly just because the texels become smaller and it's harder to notice them flickering back and forth. I'd appreciate any insight, I'd very much like to understand what's going on before I try other techniques.

    Read the article

  • How do I change the Creation/Mod Date of all folders on a USB drive using Touch command?

    - by Chad--24216
    I've got a USB drive with mp3 music on it that I play in my car. My car has a USB drive port. Problem is that the car sorts the music by Creation/Modification Date (and not alphabetically). This makes it a pain to find what artist I'm looking for. To solve this problem, I need a way to "update" the Creation/Modification Date for all folders on the USB drive every time I add a new folder of music to the USB drive. Anyone know how I can do this? The Touch command works great, but the format touch <filename> would take forever to do on each folder on the drive. Anyway to select all folders on the drive and then touch <all folders>? On my USB drive I have a folder for each album and the songs within each respective folder, like so: Album-1-folder Album-2-folder I need to apply the Touch command to each of the "album" folders on the drive. I stumbled upon a simple solution to solve this issue:touch /media/USB_Drive/*

    Read the article

  • How can I get H.264 support?

    - by Chad--24216
    Canonical Limited is shown as a licensee of H.264. I am interested in being able to play H.264 video online when using the Chrome web-browser in Ubuntu (and in the future on Firefox when Firefox supports H.264). Is H.264 support enabled on self-installs of Ubuntu? If not, is there some way I can buy H.264 support for my Ubuntu install? Assume a scenario where I self-installed Ubuntu on a computer that came pre-installed with Windows OS. I'd like to know any and all options available to me for getting H.264 to work on Ubuntu.

    Read the article

  • Name of web design technique with vertically contiguous but separate screen-sized blocks?

    - by Chad Schultz
    I don't know the proper name for this, which makes it hard to Google it or describe this. On a site like http://p2theme.com/ as you scroll down you see that content is arranged into screen-sized chunks, each with its own chunk of content, each with a different background color, making them visually distinctive. I've seen this used more and more frequently on websites, but don't know what it's called. People have tried telling me "responsive design" or "flat UI" or "infinite scroll" or "parallax" -- but those are completely different things. What do you call this technique?

    Read the article

  • Unable to download torrents when using a VPN

    - by chad
    I am running Ubuntu 13.04 and using OpenVPN and vpnbook. When I am using a VPN I am unable to download torrents. I have tried it on 3 different torrent clients (qBittorrent, Deluge, and Transmission). Deluge just says "Checking" and never begins downloading. qBittorrent says "stalled" next to the torrent and Transmission does not say anything and just doesn't download. Is there some network setting I am missing or some OpenVPN config I need to do?

    Read the article

  • How to change FAT32 sort order on drive?

    - by Chad--24216
    I use a USB drive to play music in my car. Unfortunately, the car does not sort the music alphabetically and relies on how the music is sorted on the FAT32 drive. This Windows software here solves the problem. Anything comparable available for me on Ubuntu? PS: at first I thought it was a file creation date problem askubuntu question. But although I figured out the answer to that question, it didn't solve the problem like I thought it would.

    Read the article

  • why is emacs allowing multiple instances?

    - by Chad
    Around the time I fresh installed Ubuntu 12.04, I noticed that I can start multiple instances of Emacs. I find this annoying because I will think that a buffer should be open, but I'm in the wrong Emacs window. I may have changed something in .emacs, but I really don't think I did. I also reverted all of my customizations that are stored in ~/.emacs.d/custom.el. Emacs previously would give some error about another emacs server being open when I would attempt to start an additional instance of it, but it no longer does this. Any ideas on how to restore this behavior?

    Read the article

  • ubuntu 12.04 returns to login screen on resume from suspend. Is there a fix?

    - by Chad
    When I resume from a suspend, Ubuntu 12.04 will come back ok for about 10 seconds, and then the screen blanks out. After about another second or so, it returns to the login screen for Unity 2d. It normally runs Unity 3d. How can I fix this? I've lost a lot of work from this problem. I sometimes get a error report window asking me to report a Compiz crash after rebooting. I think it may be Compiz or the Xorg server causing the problem. I'm not really sure. Thanks if you can provide help.

    Read the article

  • WatiN SelectList Methods - Page not refreshing/actions not being fired after interacting with a sele

    - by Chad M
    Preface: If you don't care about the preface, skip down to the section marked "Question." Hi, Recently my company has upgraded to the latest version of WatiN for its test automation framework. We upgraded to avoid a problem where interacting with a select list would cause an ACCSES DENIED error. This error seems to be a product of the fact that our web application reloads the page it is on (which sits in a frame which sits in a frameset) with new fields after certain select lists options are selected. It could also be that our framework, which wraps around WatiN, often does actions on the same SelectList after the page refresh (I'm still looking into this, I'm new to the framework). The new version of WatiN does solve the ACCESS DENIED error, but also seems to stop select lists from firing the action that causes the page to reload w/ its new options. In fact, if you use WatiN to make the selection, the select list won't work correctly, even if manually interacted with, until the page has been forced to refresh. Question: When selecting an option in a SelectList using the newest WatiN code, the event that causes our web app's page to reload with new fields/values does not execute. What are some possibilities that could cause this? The term i've seen used most often to describe the refreshing that occurs when our select lists are used is "double post-back". Many thanks, Chad

    Read the article

  • Rails ActiveRecord friendly code from a Complex Join, Sum, and Group query

    - by Chad M
    PROBLEM Hello, I am having no luck trying to break down this SQL statement into ActiveRecord/Rails friendly code and I'd like to learn how I can avoid a find_by_sql statement in this situation. Scenario I have users that create audits when they perform an action. Each audit is of a specific audit_activity. Each audit_activity is worth a certain number of points, based on score_weight. I need to find the total scores of each user, based on their total accumulated audit_activity score_weights. Eventually I'll need to rank them which means adding a sort to this as well. My Code Here is my sql and simplified versions of the tables in question. Any thoughts? SQL with full column names (for clarity) SELECT users.id, u.email, SUM(audit_activity.score_weight) FROM users JOIN audits ON users.id = audits.user_id JOIN audit_activities ON audit_activities.id = audits.audit_activity_id GROUP BY users.id; Models: User, Audit, AuditActivity User fields: id, email class User < ActiveRecord::Base include Clearance::User has_many :audits end Audit fields: id, user_id, audit_activity_id class Audit < ActiveRecord::Base belongs_to :user belongs_to :audit_activity end AuditActivity fields: id, score_weight class AuditActivity < ActiveRecord::Base has_many :audits end Example Data Here is a set of SQL statements so you can play with similar data I'm working with and see what comes up when the concerned query is run. You should just be able to copy/paste the whole thing into a database query browser. CREATE TABLE users( id INTEGER NOT NULL, email TEXT (25), PRIMARY KEY (id) ); CREATE TABLE audits( id INTEGER NOT NULL, user_id INTEGER, audit_activity_id INTEGER, PRIMARY KEY (id) ); CREATE TABLE audit_activities( id INTEGER NOT NULL, score_weight INTEGER, PRIMARY KEY (id) ); INSERT INTO users(id, email) VALUES(1, "[email protected]"); INSERT INTO users(id, email) VALUES(2, "[email protected]"); INSERT INTO users(id, email) VALUES(3, "[email protected]"); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(1, 1, 1); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(2, 1, 2); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(3, 1, 1); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(4, 1, 3); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(5, 1, 1); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(6, 1, 4); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(7, 2, 4); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(8, 2, 4); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(9, 2, 4); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(10, 3, 3); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(11, 3, 2); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(12, 3, 2); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(13, 3, 2); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(14, 3, 3); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(15, 3, 1); INSERT INTO audits(id, user_id, audit_activity_id) VALUES(16, 3, 1); INSERT INTO audit_activities(id, score_weight) VALUES(1, 1); INSERT INTO audit_activities(id, score_weight) VALUES(2, 2); INSERT INTO audit_activities(id, score_weight) VALUES(3, 7); INSERT INTO audit_activities(id, score_weight) VALUES(4, 11); The Query Again, here is the query. SELECT u.id, u.email, SUM(aa.score_weight) FROM users u JOIN audits a ON u.id = a.user_id JOIN audit_activities aa ON aa.id = a.audit_activity_id GROUP BY u.id; Many Thanks, Chad

    Read the article

  • Library to parse ERB files

    - by Douglas Sellers
    I am attempting to parse, not evaluate, rails ERB files in a Hpricot/Nokogiri type manner. The files I am attempting to parse contain HTML fragments intermixed with dynamic content generated using ERB (standard rails view files) I am looking for a library that will not only parse the surrounding content, much the way that Hpricot or Nokogiri will but will also treat the ERB symbols, <%, <%= etc, as though they were html/xml tags. Ideally I would get back a DOM like structure where the <%, <%= etc symbols would be included as their own node types. I know that it is possible to hack something together using regular expressions but I was looking for something a bit more reliable as I am developing a tool that I need to run on a very large view code base where both the html content and the erb content are important. For example, content such as: blah blah blah <divMy Great Text <%= my_dynamic_expression %</div Would return a tree structure like: root - text_node (blah blah blah) - element (div) - text_node (My Great Text ) - erb_node (<%=)

    Read the article

  • Working with .NET Project Files and Schemas?

    - by Mitchel Sellers
    I'm working on a project that will require me to take various .vbproj and .csproj files and determine which version of Visual Studio they were built with and then to get information such as the output dll name etc. Does anyone know if there is a schema available for these files? Google and MSDN searches are coming up a bit blank.

    Read the article

  • Casting Error with Reflection

    - by Mitchel Sellers
    I have an application that uses plugins that are managed via an interface I then dynamically load the plugin classes and cast them to the interface to work with them. I have the following line of code, assume that IPlugin is my interface. IPlugin _plugin = (IPlugin)Activator.CreateInstance(oInfo.Assembly, oInfo.FullyQualifiedName) This should be pretty simple, create the instance and cast it to the interface. I know that the assembly and fully qualified name values are correct, but I am getting the following exception. Exception= System.InvalidCastException: Unable to cast object of type ‘System.Runtime.Remoting.ObjectHandle’ to type ‘MyNamespace.Components.Integration.IPlugin’. at MyNamespace.Components.Integration.PluginProxy..ctor(Int32 instanceId) Any ideas what could cause this?

    Read the article

  • Working with Pop/IMAP Email and .NET?

    - by Mitchel Sellers
    .NET provides a great library for working with SMTP for sending messages, however, there is not an implementation of a Pop3 client, or IMAP client for working with receiving e-mail from a mail host. Does anyone know of a good component that can provide Pop, IMAP, or both support? I know that code project has implementations, but from my experience finding a "good" one is hard.

    Read the article

  • Working with ieee format numbers in ARM

    - by Jake Sellers
    I'm trying to write an ARM program that will convert an ieee number to a TNS format number. TNS is a format used by some super computers, and is similar to ieee but different. I'm trying to use several masks to place the three different "part" of the ieee number in separate registers so I can move them around accordingly. Here is my unpack subroutine: UnpackIEEE LDR r1, SMASK ;load the sign bit mask into r1 LDR r2, EMASK ;load the exponent mask into r2 LDR r3, GMASK ;load the significand mask into r3 AND r4, r0, r1 ;apply sign mask to IEEE and save into r4 AND r5, r0, r2 ;apply exponent mask to IEEE and save into r5 AND r6, r0, r3 ;apply significand mask to IEEE and save into r6 MOV pc, r14 ;return And here are the masks and number declarations so you can understand: IEEE DCD 0x40300000 ;2.75 decimal or 01000000001100000000000000000000 binary SMASK DCD 0x80000000 ;Sign bit mask EMASK DCD 0x7F800000 ;Exponent mask GMASK DCD 0x007FFFFF ;Significand mask When I step through with the debugger, the results I get are not what I expect after working through it on paper. EDIT: What I mean, is that after the subroutine runs, registers 4, 5, and 6 all remain 0. I can't figure out why the masks are not working. I think I do not fully understand how the number is being stored in the register or using the masks wrong. Any help appreciated. If you need more info just ask. EDIT: entry point: Very simple, just trying to get these subroutines working. ENTRY LDR r1, IEEE ;load IEEE num into r1 BL UnpackIEEE ;call unpack sub SWI SWI_Exit ;finish

    Read the article

  • Restart of Master Postgres DB with unconsumed Wal files

    - by Douglas Sellers
    We have a situation where walmanager is being used to ship wal files between a master and a slave Postgres database. The slave machine has failed and has had to have been rebuilt. This has caused a lot of unconsumed wal files to build up on the master. If a reboot is issued to the Postgres master, and there are 24 hours worth of unconsumed wal files hanging around, will the master be effected at all or will it start clean?

    Read the article

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