Search Results

Search found 3479 results on 140 pages for 'chris vasselli'.

Page 110/140 | < Previous Page | 106 107 108 109 110 111 112 113 114 115 116 117  | Next Page >

  • trouble setting up TreeViews in pygtk

    - by Chris H
    I've got some code in a class that extends gtk.TreeView, and this is the init method. I want to create a tree view that has 3 columns. A toggle button, a label, and a drop down box that the user can type stuff into. The code below works, except that the toggle button doesn't react to mouse clicks and the label and the ComboEntry aren't drawn. (So I guess you can say it doesn't work). I can add rows just fine however. #make storage enable/disable label user entry self.tv_store = gtk.TreeStore(gtk.ToggleButton, str, gtk.ComboBoxEntry) #make widget gtk.TreeView.__init__(self, self.tv_store) #make renderers self.buttonRenderer = gtk.CellRendererToggle() self.labelRenderer = gtk.CellRendererText() self.entryRenderer = gtk.CellRendererCombo() #make columns self.columnButton = gtk.TreeViewColumn('Enabled') self.columnButton.pack_start(self.buttonRenderer, False) self.columnLabel = gtk.TreeViewColumn('Label') self.columnLabel.pack_start(self.labelRenderer, False) self.columnEntry = gtk.TreeViewColumn('Data') self.columnEntry.pack_start(self.entryRenderer, True) self.append_column(self.columnButton) self.append_column(self.columnLabel) self.append_column(self.columnEntry) self.tmpButton = gtk.ToggleButton('example') self.tmpCombo = gtk.ComboBoxEntry(None) self.tv_store.insert(None, 0, [self.tmpButton, 'example label', self.tmpCombo]) thanks.

    Read the article

  • Representing parent-child relationships in SharePoint lists

    - by Chris Farmer
    I need to create some functionality in our SharePoint app that populates a list or lists with some simple hierarchical data. Each parent record will represent a "submission" and each child record will be a "submission item." There's a 1-to-n relationship between submissions and submission items. Is this practical to do in SharePoint? The only types of list relationships I've done so far are lookup columns, but this seems a bit different. Also, once such a list relationship is established, then what's the best way to create views on this kind of data. I'm almost convinced that it'd be easier just to write this stuff to an external database, but I'd like to give SharePoint a shot in order to take advantage of the automated search capabilities.

    Read the article

  • Get Python 2.7's 'json' to not throw an exception when it encounters random byte strings

    - by Chris Dutrow
    Trying to encode a a dict object into json using Python 2.7's json (ie: import json). The object has some byte strings in it that are "pickled" data using cPickle, so for json's purposes, they are basically random byte strings. I was using django.utils's simplejson and this worked fine. But I recently switched to Python 2.7 on google app engine and they don't seem to have simplejson available anymore. Now that I am using json, it throws an exception when it encounters bytes that aren't part of UTF-8. The error that I'm getting is: UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0: invalid start byte It would be nice if it printed out a string of the character codes like the debugging might do, ie: \u0002]q\u0000U\u001201. But I really don't much care how it handles this data just as long as it doesn't throw an exception and continues serializing the information that it does recognize. How can I make this happen? Thanks!

    Read the article

  • Returning JSON from JavaScript to Python

    - by Chris Lacy
    I'm writing a simple App Engine app. I have a simple page that allows a user to move a marker on a Google map instance. Each time the user drops the marker, I want to return the long/lat to my Python app. function initialize() { ... // Init map var marker = new GMarker(center, {draggable: true}); GEvent.addListener(marker, "dragend", function() { // I want to return the marker.x/y to my app when this function is called .. }); } To my (admittedly limited) knowledge, I should be: 1). Returning a JSON structure with my required data in the listener callback above 2). In my webapp.RequestHandler Handler class, trying to retrieve the JSON structure during the post method. I would very much like to pass this JSOn data back to the app without causing a page reload (which is what has happened when I've used various post/form.submit methods so far). Can anyone provide me with some psuedo code or an example on how I might achieve what I'm after? Thanks.

    Read the article

  • How to calculate median of a Map<Int,Int>?

    - by Chris
    For a map where the key represents a number of a sequence and the value the count how often this number appeared in the squence, how would an implementation of an algorithm in java look like to calculate the median? For example: 1,1,2,2,2,2,3,3,3,4,5,6,6,6,7,7 in a map: Map<Int,Int> map = ... map.put(1,2) map.put(2,4) map.put(3,3) map.put(4,1) map.put(5,1) map.put(6,3) map.put(7,2) double median = calculateMedian(map); print(median); would result in: > print(median); 3 > So what i am looking for is a java implementation of calculateMedian.

    Read the article

  • Calling a function when a scrollbar appears in an IFrame

    - by chris
    I got an IFrame, in the onload event i set the height of the frame: function resizeFrame() { $("#iframeID").height($("#iframeID").contents().find("body").outerHeight(true)); } Problem is: When the content of the frame is increasing without a postback (javascript or Async Postback with Ajax), a scrollbar appears. I found a solution for Firefox: document.getElementById("iframeID").contentWindow.addEventListener("overflow", resizeFrame, false); But i can't find a solution for IE 7+8 Anyone got an idea?

    Read the article

  • Export Flash as Transparent MOV

    - by Chris Nicol
    Is it possible to export a flash movie with a transparent background as a .MOV. I don't mean for embedding in a website, I mean the actual .MOV (or .avi). What I'm trying to accomplish is that I have a flash animation that I want to embed in a WPF application. I don't want to use a Browser within the WPF because of all of the issues that surround the browser control (has to be topmost control, etc). So my solution was to export said animation as a movie and play it in the MediaElement control. The only problem is that I need the background to be transparent, and I can't find a way to do this. Any suggestions or alternative solutions would be most welcome.

    Read the article

  • Using gprof with sockets

    - by Chris
    I have a program I want to profile with gprof. The problem (seemingly) is that it uses sockets. So I get things like this: ::select(): Interrupted system call I hit this problem a while back, gave up, and moved on. But I would really like to be able to profile my code, using gprof if possible. What can I do? Is there a gprof option I'm missing? A socket option? Is gprof totally useless in the presence of these types of system calls? If so, is there a viable alternative? EDIT: Platform: Linux 2.6 (x64) GCC 4.4.1 gprof 2.19

    Read the article

  • Login to a Remote Service (ruby based) from iPhone

    - by Chris Maness
    Ok here's my problem in a nutshell I've built a web service from ruby on rails. I'm using restful_authentication to create and run the login but I'm also building an iPhone application to access my web service but I can't quite figure it out. I was wondering if anyone could help me figure out a place to begin.

    Read the article

  • Generate T-SQL for Existing Indexes

    - by Chris S
    How do you programmatically generate T-SQL CREATE statements for existing indexes in a database? SQL Studio provides a "Script Index as-Create to" command that generates code in the form: IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = N'IX_myindex') CREATE NONCLUSTERED INDEX [IX_myindex] ON [dbo].[mytable] ( [my_id] ASC )WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY] GO How would you do this programmatically (ideally through Python)?

    Read the article

  • Cakephp: Designpattern for creation of models in hasMany relationship

    - by Chris
    I have two Models: Car and Passenger. Car hasMany Passenger Passenger belongsTo Car I managed to create add functionailty for each model and managed to resolve the hasMany relationship between them. Now I'm trying to create a addCar function and view that allows the user to create a new car and automatically generate Passengers. I thought of something like this The view asks the user enter the car information The view has some field that allows to temporarly add new passengers and remove remove them When the user saves the new car, the entities for the passengers are created, the entity for the car is created and the passengers are linked to the car. If the user decides to cacnel everything, the DB remains unchanged. Now my question is: What is the best way to do this? Is there a pattern / tutorial to follow for such a entity and associated subentity creation? To clarify: The passengers associated with each car do not exist prior to the existence of the car.

    Read the article

  • Writing to an xml file with xmllite?

    - by Chris
    I have an xml file which holds a set of "game" nodes (which contain details about saved gameplay, as you'd save your game on any console game). All of this is contained within a "games" root node. I'm implementing save functionality to this xml file and wish to be able to append or overwrite a "game" node and its child nodes within the "games" root node. How can this be accomplished with xmllite.dll?

    Read the article

  • Issues with simple jQuery image gallery with Colorbox plugin

    - by Chris
    I'm putting together an image gallery for an ecommerce site and wanting to use colorbox to launch larger images. My problem is that image launched in colorbox stays as the first one launched and should reflect the image shown as img#bigpic - the link to the image does appear to be updating correctly. Here's the jQuery I have: $(document).ready(function(){ $("#largeimage").colorbox(); imageSwapper(".thumbnails a"); function imageSwapper(link) { $(link).click(function(){ $("#bigpic").attr("src", this.href); $("#largeimage").attr("href", this.rel); return false; }); }; $("#largeimage").bind('mouseenter mouseleave', function(event) { $("#largeimage span").toggleClass('showspan'); }); }); ...and the HTML <a href="_images/products/large/bpn0001_1.jpg" id="largeimage"><span></span><img src="_images/products/bpn0001_1.jpg" id="bigpic" /></a> <div class="thumbnails"> <ul> <li><a href="_images/products/bpn0001_1.jpg" rel="_images/products/large/bpn0001_1.jpg"><img src="_images/products/mini/bpn0001_1.jpg" /></a></li> <li><a href="_images/products/bpn0001_2.jpg" rel="_images/products/large/bpn0001_2.jpg"><img src="_images/products/mini/bpn0001_2.jpg" /></a></li> <li><a href="_images/products/bpn0001_3.jpg" rel="_images/products/large/bpn0001_3.jpg"><img src="_images/products/mini/bpn0001_3.jpg" /></a></li> </ul> </div> Any help would be much appreciated!

    Read the article

  • Where can I find Python tutorials aimed at people who are already programmers?

    - by Chris R
    I'm a reasonably skilled programmer, and I'm interested in branching out into some new languages -- python, specifically -- but frankly I do NOT want to go through a tutorial that assumes I know nothing about programming. I want a tutorial -- again, preferably for python -- that assumes I'm just unfamiliar with the language itself and describes the ways I can use the language to solve problems. Does such a beast exist? I mean, other than the Python wiki?

    Read the article

  • PHP Session / Array Problem accesing

    - by Chris
    Hello, I have a form that certain data, which then gets calculated and gets displayed in a table. All the data gets saved in a 2 dimensional array. Every time i go back to the form the new data gets saved in the array. That data will be displayed in the next table row and so on. I have used print_r($_Session) and everything gets properly saved in the array. Although i have no idea how to acces the session variables area, floor, phone, network etc wich are now in the array. Without arrays i stored them in a variable for example $phone , and did calculations with it. But now when i use the arrays, i keep on getting undefined index phone etc... How can i acces these variables, been looking at this for hours without getting any closer to a solution. Any help much appreciated. Regards. First page: if (empty ($ _POST)) ( Mode = $ name $ _POST ['state name']; $ Area = $ _POST ['size']; $ Floor = isset ($ _POST ['floor'])? $ _POST ['Floor'] 0, / / if checkbox checked value 1 else 0 $ Phone = isset ($ _POST ['phone'])? $ _POST ['Phone']: 0; $ Network = isset ($ _POST ['network'])? $ _POST ['Network']: 0; / / Control surface if (is_numeric ($ area)) / / OK ( if (isset ($ _SESSION ['table'])) ( / / Create a new row to the existing session table $ Table = $ _SESSION ['table']; $ Number = count ($ table); $ Table [$ count] [0] = $ file name; $ Table [$ count] [1] = $ size; $ Table [$ count] [2] = $ floor; $ Table [$ count] [3] = $ phone; $ Table [$ count] [4] = $ network; $ _SESSION ['Table'] = $ table; ) else ( / / Create the session table $ Table [0] [0] = $ file name; $ Table [0] [1] = $ size; $ Table [0] [2] = $ floor; $ Table [0] [3] = $ phone; $ Table [0], [4] $ = network; $ _SESSION ['Table'] = $ table; ) header ("Location: ExpoOverzicht.php"); ) else ( echo "<h1> surface Wrong - New try </ h1>"; ) ) When i made the php code withotu the arrays i declared like this, and it worked fine. But now there in the array, and i have no idea how to "acces them" $standnaam = $_SESSION["standnaam"]; $oppervlakte = $_SESSION["oppervlakte"]; $verdieping = $_SESSION["verdieping"]; $telefoon = $_SESSION["telefoon"]; $netwerk = $_SESSION["netwerk"];

    Read the article

  • How to configure multiple mappings using FluentHibernate?

    - by chris.baglieri
    First time rocking it with NHibernate/Fluent so apologies in advance if this is a naive question. I have a set of Models I want to map. When I create my session factory I'm trying to do all mappings at once. I am not using auto-mapping (though I may if what I am trying to do ends up being more painful than it ought to be). The problem I am running into is that it seems only the top map is taking. Given the code snippet below and running a unit test that attempts to save 'bar', it fails and checking the logs I see NHibernate is trying to save a bar entity to the foo table. While I suspect it's my mappings it could be something else that I am simply overlooking. Code that creates the session factory (note I've also tried separate calls into .Mappings): Fluently.Configure().Database(MsSqlConfiguration.MsSql2008 .ConnectionString(c => c .Server(@"localhost\SQLEXPRESS") .Database("foo") .Username("foo") .Password("foo"))) .Mappings(m => { m.FluentMappings.AddFromAssemblyOf<FooMap>() .Conventions.Add(FluentNHibernate.Conventions.Helpers .Table.Is(x => "foos")); m.FluentMappings.AddFromAssemblyOf<BarMap>() .Conventions.Add(FluentNHibernate.Conventions.Helpers .Table.Is(x => "bars")); }) .BuildSessionFactory(); Unit test snippet: using (var session = Data.SessionHelper.SessionFactory.OpenSession()) { var bar = new Bar(); session.Save(bar); Assert.NotNull(bar.Id); }

    Read the article

  • How do I correctly reference georss: point in my xsd?

    - by Chris Hinch
    I am putting together an XSD schema to describe an existing GeoRSS feed, but I am stumbling trying to use the external georss.xsd to validate an element of type georss:point. I've reduced the problem to the smallest components thusly: XML: <?xml version="1.0" encoding="utf-8"?> <this> <apoint>45.256 -71.92</apoint> </this> XSD: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:georss="http://www.georss.org/georss"> <xs:import namespace="http://www.georss.org/georss" schemaLocation="http://georss.org/xml/1.1/georss.xsd"/> <xs:element name="this"> <xs:complexType> <xs:sequence> <xs:element name="apoint" type="georss:point"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> If I make apoint type "xs: string" instead of "georss: point", the XML validates happily against the XSD, but as soon as I reference an imported type (georss: point), my XML validator (Notepad++ | XML Tools) "cannot parse the schema". What am I doing wrong?

    Read the article

  • 2 dimensional arraylists in java

    - by Chris Maness
    So here's the deal I'm working on a project that requires me to have a 2 dimensional arraylist of 1 dimensional arrays. But every time I try to load in my data I get an error: Can't do this opperation because of bad input java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 On some of the inputs. I've got no idea where I'm going wrong on this one. A little help please? Source Code: import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Scanner; import javax.swing.JOptionPane; import java.io.InputStream; public class Facebull { public static void main (String[] args) { if(args.length != 0){ load(args[0]); } else{ load("testFile"); } } public static void load(String fname) { int costOfMach = 0; ArrayList <Integer> finalMach = new ArrayList<Integer>(); ArrayList <ArrayList<int[]>>machines = new ArrayList<ArrayList<int[]>>(); Scanner inputFile = null; File f = new File(fname); if (f.exists ()) { try { inputFile = new Scanner (f); } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(null,"Can't find the file\n" + e); } int i = 0; while (inputFile.hasNext ( )) { String str = inputFile.nextLine ( ); String [ ] fields = str.split ("[\t ]"); System.out.println(str); if (!(fields[0].isEmpty() || fields[0].equals (""))){ fields[0] = fields[0].substring(1); fields[1] = fields[1].substring(1); fields[2] = fields[2].substring(1); try { //data to be inputed is 0 and 3 location of data is 1 and 2 int[] item = new int[2]; item[1] = Integer.parseInt(fields[0]); item[0] = Integer.parseInt(fields[3]); if(machines.size() < Integer.parseInt(fields[1])){ ArrayList<int[]> column = new ArrayList<int[]>(); machines.add (Integer.parseInt(fields[1])-1, column); System.out.println("we're in the if"); } machines.get(Integer.parseInt(fields[1])-1).add(Integer.parseInt(fields[2])-1, item); } //catches any exception catch (Exception e) { System.out.println("Can't do this opperation because of bad input \n" + e); } } } inputFile.close ( ); } System.out.print(machines); }//end load }

    Read the article

  • Mono on OS X Compatible with MSVC 2010 peers?

    - by Chris
    I'm to begin .NET development at work but have the option of using MonoDevelop/Mono on OS X instead of MSVC 2010 on Windows and would prefer it because of my familiarity with OS X. We are likely going to use a number of popular frameworks, such as NHibernate and Castle DI - my question to those of you familiar with .NET development and Mono: will I be at much of a disadvantage? Are there strong incompatibilities or, with some "paper cuts", the two systems are roughly compatible? Again, my colleagues will be using MSVC 2010 and we intend on working on the same codebases together. Thanks for any insight you can give to this .NET newbie. EDIT: I should note I'll primarily be doing development with MVC 2, which I understand does work with Mono, and will have some leeward in choosing frameworks, i.e. I can avoid highly incompatible frameworks.

    Read the article

  • Dynamic Select boxes page load

    - by Chris
    Hello, I have a dynamic chained select box that I am attempting to show the value of on a page load. In my chained select box, it will default to the first option within the select box on page load, could anyone provide assitance? I stumbled upon this thread, but I can't seem to translate what they are doing with that answer to my language of CF. Dynamic chained drop downs on page refresh Here is the JS script I am using. function dynamicSelect(id1, id2) { // Feature test to see if there is enough W3C DOM support if (document.getElementById && document.getElementsByTagName) { // Obtain references to both select boxes var sel1 = document.getElementById(id1); var sel2 = document.getElementById(id2); // Clone the dynamic select box var clone = sel2.cloneNode(true); // Obtain references to all cloned options var clonedOptions = clone.getElementsByTagName("option"); // Onload init: call a generic function to display the related options in the dynamic select box refreshDynamicSelectOptions(sel1, sel2, clonedOptions); // Onchange of the main select box: call a generic function to display the related options in the dynamic select box sel1.onchange = function() { refreshDynamicSelectOptions(sel1, sel2, clonedOptions); } } } function refreshDynamicSelectOptions(sel1, sel2, clonedOptions) { // Delete all options of the dynamic select box while (sel2.options.length) { sel2.remove(0); } // Create regular expression objects for "select" and the value of the selected option of the main select box as class names var pattern1 = /( |^)(select)( |$)/; var pattern2 = new RegExp("( |^)(" + sel1.options[sel1.selectedIndex].value + ")( |$)"); // Iterate through all cloned options for (var i = 0; i < clonedOptions.length; i++) { // If the classname of a cloned option either equals "select" or equals the value of the selected option of the main select box if (clonedOptions[i].className.match(pattern1) || clonedOptions[i].className.match(pattern2)) { // Clone the option from the hidden option pool and append it to the dynamic select box sel2.appendChild(clonedOptions[i].cloneNode(true)); } } } Thanks so much for any assistance

    Read the article

  • Cakephp: Access data in add function

    - by Chris
    I'm using the CakePHP blog example: function add() { if (!empty($this->data)) { if ($this->Post->saveAll($this->data)) { $this->Session->setFlash('Your post has been saved.'); $this->redirect(array('action' => 'index')); } }} I want to modify it in a way that the user is redirected to the post after adding it: But this doesn't work: $this->redirect(array('action' => 'view', $this->Post->id))); What is the correct way to read the model's data after creation?

    Read the article

  • Reusing an anonymous parameter in a prepared statement

    - by Chris Lieb
    I am customizing the insert SQL generated by hibernate and have hit an issue. When Hibernate generates the query by itself, it inserts data into the first two columns of the table, but this causes a database error since all four columns of the table are non-nullable. For the insert to be performed properly, it must insert the same data into two columns of the new record. This means that I need Hibernate to bind the same data to two different parameters in the query (prepared statement) that I am writing. Is there some SQL syntax that allows me to refer to anonymous parameters bound to a prepared statement in an order different from which they are bound? Details REF_USER_PAGE_XREF ---------------------------------------- PK FK1 | NETWORK_ID | VARCHAR2(100) PK FK1 | PAGE_PATH | VARCHAR2(1000) | USER_LAST_UPDT | VARCHAR2(100) | TMSP_LAST_UPDT | DATE insert into REF_USER_ROLE_XREF( NETWORK_ID, PAGE_PATH, TMSP_LAST_UPDT, USER_LAST_UPDT) values ( ?, /* want to insert the same data here */ ?, ?, /* and here */ (select to_char(sysdate, 'DD-MON-YY') from dual) I want to insert the same data into the first and third anonymous parameters.

    Read the article

< Previous Page | 106 107 108 109 110 111 112 113 114 115 116 117  | Next Page >