Search Results

Search found 300 results on 12 pages for 'ted simpson'.

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

  • Custom Django Field is deciding to work as ForiegnKey for no reason

    - by Joe Simpson
    Hi, i'm making a custom field in Django. There's a problem while trying to save it, it's supposed to save values like this 'user 5' and 'status 9' but instead in the database these fields show up as just the number. Here is the code for the field: def find_key(dic, val): return [k for k, v in dic.items() if v == val][0] class ConnectionField(models.TextField): __metaclass__ = models.SubfieldBase serialize = False description = 'Provides a connection for an object like User, Page, Group etc.' def to_python(self, value): if type(value) != unicode: return value value = value.split(" ") if value[0] == "user": return User.objects.get(pk=value[1]) else: from social.models import connections return get_object_or_404(connections[value[0]], pk=value[1]) def get_prep_value(self, value): from social.models import connections print value, "prep" if type(value) == User: return "user %s" % str(value.pk) elif type(value) in connections.values(): o= "%s %s" % (find_key(connections, type(value)), str(value.pk)) print o, "return" return o else: print "CONNECTION ERROR!" raise TypeError("Value is not connectable!") Connection is just a dictionary with the "status" text linked up to the model for a StatusUpdate. I'm saving a model like this which is causing the issue: Relationship.objects.get_or_create(type="feedback",from_user=request.user,to_user=item) Please can someone help, Many Thanks Joe *_*

    Read the article

  • How to extract the last name from [email protected] using Oracle?

    - by Simpson
    Hello - I know this can't be too difficult, but I've tried everything I can think of and cannot get it to work. I need to compare the value of a column (LASTNAME) with a system variable (:VARIABLE), but the variable is an email address, so I need to trim off the "@email.com" and "firstname." Some things I've tried: select * from TABLENAME where LASTNAME LIKE :VARIABLE select * from TABLENAME where LASTNAME IN :VARIABLE I've been able to trim off the @email.com, can't figure out how to trim off FIRSTNAME. at the same time. Thanks!

    Read the article

  • jQuery to store data for sessions

    - by Ted
    I am trying to use jQuery AJAX. What my requirement is, i wish to load user names from DB in dataset, convert it to JSON format and store it in memory or using jQuery data for use while a user is browsing my site, i.e for a session. This way I can use autocomplete or my own code to display data to user. Can anyone help me design such a scenario?

    Read the article

  • Page loading effect with jquery

    - by Andy Simpson
    Hello all, Is there a way to use jquery (or other method) to display a loading div while page loads? I have a table that is populated using PHP/MySQL and can contain several thousand rows. This is then sorted using the tablesorter plugin for jquery. Everything works fine, however the page can sometimes take 4-5 seconds to fully load and it would be nice to display a 'loading...' message within a div which automatically disappears when whole table is loaded. I have heard of loadmask plugin for jquery - would this be suitable for my needs and if not any alternative? No AJAX calls are being made while loading this table if thats relevant. Thanks in advance Andy

    Read the article

  • Does the order of columns in a query matter?

    - by James Simpson
    When selecting columns from a MySQL table, is performance affected by the order that you select the columns as compared to their order in the table (not considering indexes that may cover the columns)? For example, you have a table with rows uid, name, bday, and you have the following query. SELECT uid, name, bday FROM table Does MySQL see the following query any differently and thus cause any sort of performance hit? SELECT uid, bday, name FROM table

    Read the article

  • What are possible/good ways to prototype iPhone applications?

    - by Ted Johnson
    This is intentionally left broad. If you wanted to show users what iPhone/mobile applications could to for them. The more interactive the better, but it must be quick to build as you can't code up every idea. Let us assume real-time games are out of scope. Throw out ideas or state which approach would be best. Here are some of my ideas, what are yours? Hack a app that loads mostly web or image content, but has hyperlinks to get around in. This would mean static data. Build screens which look great but can only be navigated in a story board type fashion. Load the web version or equivalent on the iPhone and say: now image the buttons and navigation is better. A paper based prototype. Flash or video walk through running on the phone. String existing iPhone apps and web pages together with minimal glue just to convey the idea. Can anyone share prototyping methods for other mobile devices? Ex: The palm prototype was just a block of wood and note pad that was carried around.

    Read the article

  • Assembly Load and loading the "sub-modules" dependencies - "cannot fild the file specified"

    - by Ted
    There are several questions out there that ask the same question. However the answers they received I cannot understand, so here goes: Similar questions: http://stackoverflow.com/questions/1874277/dynamically-load-assembly-and-manually-force-path-to-get-referenced-assemblies ; http://stackoverflow.com/questions/22012/loading-assemblies-and-its-dependencies-closed The question in short: I need to figure out how dependencies, ie References in my modules can be loaded dynamically. Right now I am getting "The system cannot find the file specified" on Assemblies referenced in my so called modules. I cannot really get how to use the AssemblyResolve event... The longer version I have one application, MODULECONTROLLER, that loads separate modules. These "separate modules" are located in well-known subdirectories, like appBinDir\Modules\Module1 appBinDir\Modules\Module2 Each directory contains all the DLLs that exists in the bin-directory of those projects after a build. So the MODULECONTROLLER loads all the DLLs contained in those folders using this code: byte[] bytes = File.ReadAllBytes(dllFileFullPath); Assembly assembly = null; assembly = Assembly.Load(bytes); I am, as you can see, loading the byte[]-array (so I dont lock the DLL-files). Now, in for example MODULE1, I have a static reference called MyGreatXmlProtocol. The MyGreatXmlProtocol.dll then also exists in the directory appBinDir\Modules\Module1 and is loaded using the above code When code in the MODULE1 tries to use this MyGreatXmlProtocol, I get: Could not load file or assembly 'MyGreatXmlProtocol, Version=1.0.3797.26527, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. So, in a post (like this one) they say that To my understanding reflection will load the main assembly and then search the GAC for the referenced assemblies, if it cannot find it there, you can then incorparate an assemblyResolve event: First; is it really needed to use the AssemblyResolve-event to make this work? Shouldnt my different MODULEs themself load their DLLs, as they are statically referenced? Second; if AssemblyResolve is the way to go - how do I use it? I have attached a handler to the Event but I never get anything on MyGreatXmlProctol... === EDIT === CODE regarding the AssemblyResolve-event handler: public GUI() { InitializeComponent(); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); ... } // Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { Console.WriteLine(args.Name); return null; } Hope I wasnt too fuzzy =) Thx

    Read the article

  • Efficiently compute the row sums of a 3d array in R

    - by Gavin Simpson
    Consider the array a: > a <- array(c(1:9, 1:9), c(3,3,2)) > a , , 1 [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 , , 2 [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 How do we efficiently compute the row sums of the matrices indexed by the third dimension, such that the result is: [,1] [,2] [1,] 12 12 [2,] 15 15 [3,] 18 18 ?? The column sums are easy via the 'dims' argument of colSums(): > colSums(a, dims = 1) but I cannot find a way to use rowSums() on the array to achieve the desired result, as it has a different interpretation of 'dims' to that of colSums(). It is simple to compute the desired row sums using: > apply(a, 3, rowSums) [,1] [,2] [1,] 12 12 [2,] 15 15 [3,] 18 18 but that is just hiding the loop. Are there other efficient, truly vectorised, ways of computing the required row sums?

    Read the article

  • How can I generate a git diff of what's changed since the last time I pulled?

    - by Teflon Ted
    I'd like to script, preferably in rake, the following actions into a single command: Get the version of my local git repository. Git pull the latest code. Git diff from the version I extracted in step #1 to what is now in my local repository. In other words, I want to get the latest code form the central repository and immediately generate a diff of what's changed since the last time I pulled.

    Read the article

  • Advanced queries in HBase

    - by Teflon Ted
    Given the following HBase schema scenario (from the official FAQ)... How would you design an Hbase table for many-to-many association between two entities, for example Student and Course? I would define two tables: Student: student id student data (name, address, ...) courses (use course ids as column qualifiers here) Course: course id course data (name, syllabus, ...) students (use student ids as column qualifiers here) This schema gives you fast access to the queries, show all classes for a student (student table, courses family), or all students for a class (courses table, students family). How would you satisfy the request: "Give me all the students that share at least two courses in common"? Can you build a "query" in HBase that will return that set, or do you have to retrieve all the pertinent data and crunch it yourself in code?

    Read the article

  • Vimperator and scripts directory on Windows 7

    - by Ted
    Just trying out Vimperator for the first time. For the life of me however, I can't figure out how to add a script (specifically for delicious bookmarks). Running Windows 7 x64. No plugin directory: C:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles\dgj7o1s1.default\extensions\[email protected] No plugin directory in default location: C:\Users\username\vimperator If I create the "plugin" directory, the script is still not available. Any suggestions? I'm really liking Vimperator, but when you can't figure something out, you really CAN'T figure it out.

    Read the article

  • Just for fun (C# and C++)...time yourself [closed]

    - by Ted
    Possible Duplicate: What is your solution to the FizzBuzz problem? OK guys this is just for fun, no flamming allowed ! I was reading the following http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html and couldn't believe the following sentence... " I've also seen self-proclaimed senior programmers take more than 10-15 minutes to write a solution." For those that can't be bothered to read the article, the background is this: ....I set out to develop questions that can identify this kind of developer and came up with a class of questions I call "FizzBuzz Questions" named after a game children often play (or are made to play) in schools in the UK. An example of a Fizz-Buzz question is the following: Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". SO I decided to test myself. I took 5 minutes in C++ and 3mins in c#! So just for fun try it and post your timings + language used! P.S NO UNIT TESTS REQUIRED, NO OUTSOURCING ALLOWED, SWITCH OFF RESHARPER! :-) P.S. If you'd like to post your source then feel free

    Read the article

  • JSTree select_node event and checkbox

    - by Ted Mosbey
    Hi there! I have a jstree in which I used the select_node event to toggle nodes(expand), and have therefore removed the toggle arrows in the tree since they look ugly and I've no need for them. Now I've added the checkbox plugin to use within the tree, but have found the select_node event is disabled when the plugin is active. How would I toggle my nodes with the checkbox plugin active, without re-adding the ugly toggle arrows? I could do it in the check/uncheck event, but I don't want to check/uncheck everytime I expand a node.

    Read the article

  • HTML tables in JTextPane showing weird "form" boxes

    - by Ted
    import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextPane; import javax.swing.border.EmptyBorder; import javax.swing.text.Document; import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.StyleSheet; public class htmlEditor2 extends JFrame { private JPanel contentPane; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { htmlEditor2 frame = new htmlEditor2(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } public htmlEditor2() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); setContentPane(contentPane); Foo f = new Foo(); f.setText("<html><body><table border=\"1\" width=\"985\" cellpadding=\"3\" cellspacing=\"0\" style=\"table-layout: fixed; border-collapse: collapse; border-width: 0px; border-color: #010101; \"><colgroup><col width=\"328\"></col> <col width=\"328\"></col> <col width=\"328\"></col> </colgroup><tr><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><font face=\"Arial\"><span style=\"font-size:8pt\">row 1</span></font></div></td><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><font face=\"Arial\"><span style=\"font-size:8pt\">row2</span></font></div></td><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><font face=\"Arial\"><span style=\"font-size:8pt\">row3</span></font></div></td></tr><tr><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><span style=\"font-size: 8pt;\">&nbsp;</span></div></td><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><span style=\"font-size: 8pt;\">&nbsp;</span></div></td><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><span style=\"font-size: 8pt;\">&nbsp;</span></div></td></tr><tr><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><span style=\"font-size: 8pt;\">&nbsp;</span></div></td><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><span style=\"font-size: 8pt;\">&nbsp;</span></div></td><td align=\"left\" valign=\"top\" width=\"321\" style=\"border: solid #010101 1px; \"><div align=\"left\"><span style=\"font-size: 8pt;\">&nbsp;</span></div></td></tr></table><div align=\"left\">&nbsp;&nbsp;</div></body></html>"); contentPane.add(f); } class Foo extends JTextPane { public Foo() { super(); HTMLEditorKit kit = new HTMLEditorKit(); setEditorKit(kit); StyleSheet styleSheet = kit.getStyleSheet(); styleSheet.addRule(""); //in case I need to add a CSS Document doc = kit.createDefaultDocument(); setDocument(doc); } } } I would paste a nicely formatted version of the html, but I'm not sure how to do it on here... So yeah.. I just want to know how to get rid of those weird colgroup and col boxes in my table and how to make the table work normally! Thanks yall!

    Read the article

  • Enabling ProGuard in Eclipse for Android

    - by Ted Hopp
    The new documentation on ProGuard for Android says to add a line to the default.properties file in the project home directory. However, on opening this file, I read at the top: # This file is automatically generated by Android Tools. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! Am I missing something? Also, is there a way to enable ProGuard only for a production build from Eclipse (i.e., when exporting the finished product)?

    Read the article

  • Get more error information from unhandled error

    - by Andrew Simpson
    I am using C# in a desktop application. I am calling a DLL written in C that I do not have the source code for. Whenever I call this DLL I get an untrapped error which I trap in an UnhandledException event/delegate. The error is : object reference not set to an instance of an object But the stack trace is empty. When I Googled this the info back was that the error was being hanlded eleswhere and then rethrown. But this can only be in the DLL I do not have the source code for. So, is there anyway I can get more info about this error? This is my code... in program.cs... AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { try { Exception _ex = (Exception)e.ExceptionObject; //the stact trace property is empty here.. } finally { Application.Exit(); } } My DLL... [DllImport("AutoSearchDevice.dll", EntryPoint = "Start", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)] public static extern int Start(int ASD_HANDLE); An I call it like so: public static void AutoSearchStart() { try { Start(m_pASD); } catch (Exception ex) { } }

    Read the article

  • Canvas Animation Kit Experiment... ...how to clear the canvas?

    - by Ted Wong
    I can make a obj to use the canvas to draw like this: MyObj.myDiv = new Canvas($("effectDiv"), Setting.width, Setting.height); Then, I use this to draw a rectangle on the canvas: var c = new Rectangle(80, 80, { fill: [220, 40, 90] } ); var move = new Timeline; move.addKeyframe(0, { x: 0, y: 0 } ); c.addTimeline(move); MyObj.myDiv.append(c); But after I draw the rectangle, I want clear the canvas, but I don't know which method and how to do this... ... O...one more thing: it is the CAKE's web site: Link

    Read the article

  • How to handle dynamic site localizations?

    - by James Simpson
    I've got a website that is currently all in english. It is an online game, so it has a bunch of different pages with static text, as well as a lot of content in a database. I am trying to expand more globally and am gearing up to release some localizations of the site. However, I'm not sure about the best way to go about setting this up so that it'll be the easiest for me to manage and the easiest for users to use as well. Should I be storing the translated texts in a database, or should this be done in a completely different way? If it matters at all, the site is written in PHP and uses MySQL.

    Read the article

  • Expose JSON as queryable for jQuery

    - by Ted
    I am trying to expose some data, user names, as json format on my server. I want to use jQuery.getJSOn() method to query data. I can get my data converted to json with newtonsoft.dll on server and save it in a file. But as far as I know it is not queryable. I want something like http://search.twitter.com/search.json?callback=?&q=abc Can anyone help me out to expose my data ion the above format.

    Read the article

  • Validation and Firefox's input caching

    - by Chris Simpson
    When you refresh/reload a page or use the back button, Firefox is kind enough to repopulate your inputs with what was entered before you navigated away. Though this is a nice feature it does not trigger my jquery validation and the unsaved changes warning I add to my pages. Is there a way to either disable this feature in Firefox (without renaming every control every time) or capture the firefox events?

    Read the article

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