Search Results

Search found 270 results on 11 pages for 'todd webb'.

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

  • What's the best way to return stuff from a PHP function, and simultaneously trigger a jQuery action?

    - by Jack Webb-Heller
    So the title is a tad ambiguous, but I'll try and give an example. Basically, I have an 'awards' system (similar to that of StackOverflow's badges) in my PHP/CodeIgniter site, and I want, as soon as an award is earned, a notification to appear to the user. Now I'm happy to have this appear on the next page load, but, ideally I'd like it to appear as soon as the award is transactioned since my site is mostly Ajax-powered and there may not be page reloads very often. The way the system works currently, is: 1) If the user does something to trigger the earning of an award, CodeIgniter does this: $params['user_id'] = $this->tank_auth->get_user_id(); $params['award_id'] = 1; // (I have a database table with different awards in) $this->awards->award($params); 2) My custom library, $this->awards, runs the award function: function award($params) { $sql = $this->ci->db->query("INSERT INTO users_awards (user_id, award_id) VALUES ('".$params['user_id']."','".$params['award_id']."') ON DUPLICATE KEY UPDATE duplicate=duplicate+1"); $awardinfo = $this->ci->db->query("SELECT * FROM awards WHERE id = ".$params['award_id']); // If it's the 'first time' the user has gotten the award (e.g. they've earnt it) if ($awardinfo->row('duplicate') == 0) { $params['title'] = $awardinfo->row('title'); $params['description'] = $awardinfo->row('description'); $params['iconpath'] = $awardinfo->row('iconpath'); $params['percentage'] = $awardinfo->row('percentage'); return $params; } } So, it awards the user (and if they've earnt it twice, updates a useless duplicate field by one), then checks if it's the first time they've earnt it (so it can alert them of the award). If so, it gets the variables (title of the award, the award description, the path to an icon to display for the award, and finally the percentage of users who have also got this award) and returns them as an array. So... that's that. Now I'd like to know, what's the best way to do this? Currently my Award-giving bit is called from a controller, but I guess if I want this to trigger via Ajax, then the code should be placed in a View file...? To sum it up: I need the returned award data to appear without a page refresh. What's the best way of doing this? (I'm already using jQuery on my page). Thanks very much everybody! Jack

    Read the article

  • Bug: files uploaded via desktop or web client have hidden tag when listed via API

    - by Jon Webb
    Files uploaded to Google Drive sometimes incorrectly have a hidden tag when listed via the Document List v3 REST API: <category scheme='http://schemas.google.com/g/2005/labels' term='http://schemas.google.com/g/2005/labels#hidden' label='hidden'/> This happens if: a subfolder is created via the Google Drive desktop client and files are copied in, or a folder is uploaded via the Google Drive web client. The folder does not have the hidden tag, but the files that were uploaded do. The files do not have this tag if: they are individually uploaded via the Google Drive web client to the subfolder, or they are uploaded via the REST API to the subfolder, or they are uploaded via the desktop client to the My Drive root. The files and folders show up in Google Drive whether they have the hidden tag or not. We're using the API with the following scope: https://docs.google.com/feeds/ https://spreadsheets.google.com/feeds/ https://docs.googleusercontent.com/ I have verified and can recreate this with the OAuth 2.0 playground. Google Drive desktop client version 1.3.3209.2600 on Win7 32-bit I guess these must be bugs in the API...

    Read the article

  • A question about writing a background/automatic/silent downloader/installer for an app in C#.

    - by Mike Webb
    Background: I have a main application that needs to be able to go to the web and download DLL files associated with it (ones that we write, located on our server). It really needs to be able to download these DLL files to the application folder in "C:\Program Files\". In the past I have used System.Net.WebClient to download whatever files I wanted from the web. The Issue I have had a lot of trouble downloading data in the past and saving to files on a user's hard drive. I get many reports of users saying that this does not work and it is generally because of user rights issues in the program. In the cases where it was an issue with program user rights every user could go to the exact file location on the web, download it, and then save it to the right place manually. I want this to work like all the other programs I have seen download/install in this fassion (i.e. Firefox Pluign Updates, Flash Player, JAVA, Adobe Reader, etc). All of these work without a hitch. The Question Is there some code I need to use to give my downloader program special rights to the Program Files folder? Can I even do this? Is there a better class or library that I should use? Is there a different approach to downloading files I should take, such as using threads or something else to download data? Any help here is appreciated. I want to try to stay away from third-party apps/libraries if at all possible, other than Microsoft of course, due to licensing issues, but still send any suggestions my way. Again, other programs seem to have the rights issues and download capability figured out. I want this same capability.

    Read the article

  • Are Tuples a poor design decision in C#?

    - by Jason Webb
    With the addition of the Tuple class in .net 4, I have been trying to decide if using them in my design is a bad choice or not. The way I see it, a Tuple is a shortcut to writing a result class (I am sure there are other uses too). So this: public class ResultType { public string StringValue { get; set; } public int IntValue { get; set; } } public ResultType GetAClassedValue() { //..Do Some Stuff ResultType result = new ResultType { StringValue = "A String", IntValue = 2 }; return result; } Is equivalent to this: public Tuple<string, int> GetATupledValue() { //...Do Some stuff Tuple<string, int> result = new Tuple<string, int>("A String", 2); return result; } So setting aside the possibility that I am missing the point of Tuples, is the example with a Tuple a bad design choice? To me it seems like less clutter, but not as self documenting and clean. Meaning that with the type ResultType, it is very clear later on what each part of the class means but you have extra code to maintain. With the Tuple<string, int> you will need to look up and figure out what each Item represents, but you write and maintain less code. Any experience you have had with this choice would be greatly appreciated.

    Read the article

  • Saving the modified contents of a pdf

    - by Anthony Webb
    I've got a form that I downloaded, I'd like to prefill some content on the form (this is easy using cfpdfform). Where it gets tricky is I would like to allow the user to modify the contents of that form, and then somehow have those modified contents accessible to me. I didnt build the source PDF so I dont know how to allow the user to "save" the new contents so they can be read. Any ideas on where I might start on this one?

    Read the article

  • Combinationally unique MySQL tables

    - by Jack Webb-Heller
    So, here's the problem (it's probably an easy one :P) This is my table structure: CREATE TABLE `users_awards` ( `user_id` int(11) NOT NULL, `award_id` int(11) NOT NULL, `duplicate` int(11) NOT NULL DEFAULT '0', UNIQUE KEY `award_id` (`award_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 So it's for a user awards system. I don't want my users to be granted the same award multiple times, which is why I have a 'duplicate' field. The query I'm trying is this (with sample data of 3 and 2) : INSERT INTO users_awards (user_id, award_id) VALUES ('3','2') ON DUPLICATE KEY UPDATE duplicate=duplicate+1 So my MySQL is a little rusty, but I set user_id to be a primary key, and award_id to be a UNIQUE key. This (kind of) created the desired effect. When user 1 was given award 2, it entered. If he/she got this twice, only one row would be in the table, and duplicate would be set to 1. And again, 2, etc. When user 2 was given award 1, it entered. If he/she got this twice, duplicate updated, etc. etc. But when user 1 is given award 1 (after user 2 has already been awarded it), user 2 (with award 1)'s duplicate field increases and nothing is added to user 1. Sorry if that's a little n00bish. Really appreciate the help! Jack

    Read the article

  • Passing an array of data to a private function in CodeIgniter/PHP? [facepalm]

    - by Jack Webb-Heller
    So I thought this should be easy, but, I'm n00bing out here and failing epicly (as they say on teh interwebz). So here's my code: function xy() { $array['var1'] = x; $array['var2'] = y; echo $this->_z; } function _z($array) { $xy = $x.$y; return $xy; } So, why doesn't that seemingly simple code work? I know with views you can pass arrays and the variables are accessible in the views with just their array title, but, why doesn't it work in this case? Jack

    Read the article

  • Best direction for displaying game graphics in C# App

    - by Mike Webb
    I am making a small game as sort of a test project, nothing major. I just started and am working on the graphics piece, but I'm not sure the best way to draw the graphics to the screen. It is going to be sort of like the old Zelda, so pretty simple using bitmaps and such. I started thinking that I could just paint to a Picture Box control using Drawing.Graphics with the Handle from the control, but this seems cumbersome. I'm also not sure if I can use double buffering with this method either. I looked at XNA, but for now I wanted to use a simple method to display everything. So, my question. Using the current C# windows controls and framework, what is the best approach to displaying game graphics (i.e. Picture Box, build a custom control, etc.)

    Read the article

  • What are Class methods in Python for?

    - by Dave Webb
    I'm teaching myself Python and my most recent lesson was that Python is not Java, and so I've just spent a while turning all my Class methods into functions. I now realise that I don't need to use Class methods for what I would done with static methods in Java, but now I'm not sure when I would use them. All the advice I can find about Python Class methods is along the lines of newbies like me should steer clear of them, and the standard documentation is at its most opaque when discussing them. Does anyone have a good example of using a Class method in Python or at least can someone tell me when Class methods can be sensibly used?

    Read the article

  • Hide JQueryUI Accordion Items with View All Option

    - by Dominic Webb
    I have a JqueryUi Accordion that is dynamically generated. However I need it to show only the first 8 items with the rest viewable by clicking a "View All" link. The code is simply a series of: <h2>Title</h2> <div>....</div> The jquery is all of: $(function() { $("#sidebar").accordion({autoHeight: false}); }); Thanks

    Read the article

  • Is Using Tuples in my .NET 4.0 Code a Poor Design Decision?

    - by Jason Webb
    With the addition of the Tuple class in .net 4, I have been trying to decide if using them in my design is a bad choice or not. The way I see it, a Tuple can be a shortcut to writing a result class (I am sure there are other uses too). So this: public class ResultType { public string StringValue { get; set; } public int IntValue { get; set; } } public ResultType GetAClassedValue() { //..Do Some Stuff ResultType result = new ResultType { StringValue = "A String", IntValue = 2 }; return result; } Is equivalent to this: public Tuple<string, int> GetATupledValue() { //...Do Some stuff Tuple<string, int> result = new Tuple<string, int>("A String", 2); return result; } So setting aside the possibility that I am missing the point of Tuples, is the example with a Tuple a bad design choice? To me it seems like less clutter, but not as self documenting and clean. Meaning that with the type ResultType, it is very clear later on what each part of the class means but you have extra code to maintain. With the Tuple<string, int> you will need to look up and figure out what each Item represents, but you write and maintain less code. Any experience you have had with this choice would be greatly appreciated.

    Read the article

  • Parsing SQLIO Output to Excel Charts using Regex in PowerShell

    - by Jonathan Kehayias
    Today Joe Webb ( Blog | Twitter ) blogged about The Power of Regex in Powershell, and in his post he shows how to parse the SQL Server Error Log for events of interest. At the end of his blog post Joe asked about other places where Regular Expressions have been useful in PowerShell so I thought I’d blog my script for parsing SQLIO output using Regex in PowerShell, to populate an Excel worksheet and build charts based on the results automatically. If you’ve never used SQLIO, Brent Ozar ( Blog | Twitter...(read more)

    Read the article

  • Parsing SQLIO Output to Excel Charts using Regex in PowerShell

    - by Jonathan Kehayias
    Today Joe Webb ( Blog | Twitter ) blogged about The Power of Regex in Powershell, and in his post he shows how to parse the SQL Server Error Log for events of interest.  At the end of his blog post Joe asked about other places where Regular Expressions have been useful in PowerShell so I thought I’d blog my script for parsing SQLIO output using Regex in PowerShell, to populate an Excel worksheet and build charts based on the results automatically. If you’ve never used SQLIO, Brent Ozar ( Blog...(read more)

    Read the article

  • Greatest Hits : A reflection on my 2010 blog posts

    - by AaronBertrand
    Okay, I'm following the lead of Joe Webb ( blog | twitter ), who recently posted " My Most Popular Posts From 2010 ." I think it can be a very useful exercise to back and look at what blog posts were popular and, arguably more importantly, which posts were most thought-provoking and generated the most dialog (whether it is praise, heckling, or a mixture). I think you can a learn a lot about your blogging habits and perhaps where to focus energy in the future/ You can also be quite surprised at which...(read more)

    Read the article

  • #MDX in London and speculation about future books

    - by Marco Russo (SQLBI)
    Chris Webb, who wrote the Expert Cube Development with Microsoft SQL Server 2008 Analysis Services book with me and Alberto , is preparing another Introduction to MDX course in London, this time from October 26th to 28th. It is now a three day course (previously it was two day) and you can find every other detail here . You might be wondering whether we are writing something else... well, we don't have plan to release a new edition of the Analysis Services book - after all, all the content of the...(read more)

    Read the article

  • SQL Server Training in the UK–SSIS, MDX, Admin, MDS, Internals

    - by simonsabin
    If you are looking for SQL Server training they there is no better place to start than a new company Technitrain Its been setup by a fellow MVP and SQLBits Organiser Chris Webb. Why this company rather than any others? Training based on real world experience by the best in the business. The key to Technitrain’s model is not to cram the shelves high with courses and get some average Joe trainers to deliver them. Technitrain bring in world renowned experts in their fields to deliver courses written...(read more)

    Read the article

  • March 2012 - SSIS Training in London!

    - by andyleonard
    I am honored to announce I will be delivering From Zero To SSIS! in London, England 5-9 Mar 2012. This course is delivered in cooperation with my friends at TechniTrain who provide awesome training by talented technologists like Chris Webb ( Blog ), Gavin Payne ( Blog ), and Christian Bolton ( Blog ). This opportunity grew out of conversations at SQLBits 9 in Liverpool in September 2011. I had an awesome time at SQLBits and encourage everyone to attend the conference if you have the opportunity to...(read more)

    Read the article

  • How to implement eCommerce susbscription service with multiple products

    - by Todd Brooks
    I've been researching eCommerce payment gateways and service offerings, but I'm an eCommerce novice, so please excuse my ignorance. I wish to set up an eCommerce solution with the following requirements: User "subscribes" to the service on a yearly basis. This service includes a single product subscription for a set amount (let's say $50/yr). User can "subscribe" to additional product services for a lesser rate per year (let's say $25/yr). I will need to store a product service unique Id of some sort for each product subscription the user subscribes to in order to show them product unique information. I also need to prevent duplicates...for example, user can subscribe to product ABC and XYZ, but not 2 of ABC. Is PayPal the best solution for something like this? Is there a better solution? Any assistance is greatly appreciated, even if just links to specific tutorials or examples. Update: It looks like Chargify could be the perfect solution.

    Read the article

  • MSI Log Debug Log Sink

    - by Todd Kobus
    I have an InstallShield MSI project. When I pass an MSIHANDLE from an InstallScript custom action to a managed assembly initialized via DotNetCoCreateObject(), the value received within my managed code is -2. Does anyone know if it is possible to access an MSIHANDLE from an InstallScript custom action that calls into managed code via DotNetCoCreateObject()? I'd like to log my custom action results to the same log file as the rest of the installation. I am using InstallShield 2010, Windows Install 4.5 and .Net 3.5.

    Read the article

  • How to find strong name signature without calling LoadAssembly

    - by Todd Kobus
    When reading a Windows PE file directly, I can't seem to find the strong name signature of a delay signed assembly. I can get to the CLR Header and read all those entries. Is the information in the MetaData directory specified within the CLR header? If so does anyone have an example of how to read this table? I am not interested in calling SN.exe or loading the assembly.

    Read the article

  • Multiple rows with a single INSERT in SQLServer 2008

    - by Todd
    I am testing the speed of inserting multiple rows with a single INSERT statement. For example: INSERT INTO [MyTable] VALUES (5, 'dog'), (6, 'cat'), (3, 'fish) This is very fast until I pass 50 rows on a single statement, then the speed drops significantly. Inserting 10000 rows with batches of 50 take 0.9 seconds. Inserting 10000 rows with batches of 51 take 5.7 seconds. My question has two parts: Why is there such a hard performance drop at 50? Can I rely on this behavior and code my application to never send batches larger than 50? My tests were done in c++ and ADO.

    Read the article

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