Search Results

Search found 17342 results on 694 pages for 'custom draw'.

Page 134/694 | < Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >

  • SQLAlchemy custom query column

    - by thrillerator
    I have a declarative table defined like this: class Transaction(Base): __tablename__ = "transactions" id = Column(Integer, primary_key=True) account_id = Column(Integer) transfer_account_id = Column(Integer) amount = Column(Numeric(12, 2)) ... The query should be: SELECT id, (CASE WHEN transfer_account_id=1 THEN -amount ELSE amount) AS amount FROM transactions WHERE account_id = 1 OR transfer_account_id = 1 My code is: query = Transaction.query.filter_by(account_id=1, transfer_account_id=1) query = query.add_column(func.case(...).label("amount") But it doesn't replace the amount column. Been trying to do this with for hours and I don't want to use raw SQL.

    Read the article

  • Having difficulty add a custom icon to a JFrame

    - by Oliver
    Hi, I have been trying to change the icon in the frame. I have virtually tried everything: The icon is 16x16 which is the right size ....doesn't work I've trying PNG,GIF and JPG formats none of them work. Tried different way of setting the icon....doesn't work. I've tried relative (local paths) e.g. "icon.gif" and absolute paths e.g. "c:\work\java\icon.gif" ...doesn't work Here is my code and see if you can figure it out Thanks Oli import javax.swing.*; public class androidDriver { public static void main(String[] args) throws IOException { JFrame f = new JFrame("Android Data Viewer"); f.setResizable(false); f.setSize(300,300); f.setLocationRelativeTo(null); f.setVisible(true); f.setIconImage(new ImageIcon("androidIcon2.gif").getImage()); } }

    Read the article

  • Custom RIA Authentication

    - by cmaduro
    Following the steps in this post: http://forums.silverlight.net/forums/t/177042.aspx Where/How do I add the [Key] attribute on the Name property of the IAuthentication where User is one of my ADO.Net Entity objects? My options so far seem to be: In the designer codebehind of me ADO.Net Entity Model. Create a partial User class and add it there In the AuthenticationService.metadata.cs partial User class. It just does not seem to work no matter where I place the [Key] attribute.

    Read the article

  • Displaying an NSString on a Custom View

    - by ilovetacos
    I have an interface that has an NSTextField, NSButton, and an NSView. When I type something in the textfield and press the button, I want the text to be drawn in the NSView. So far I have everything connected and working, except for the view. How can I connect the text and the view so that every time I press the button, the text is drawn to the view?

    Read the article

  • How can I resolve this custom error redirect in ASP.NET

    - by D. Veloper
    I want to redirect all url errors The url I want to cath is ~/bla/foo It should redirect to ~/error404.aspx bla exists as a folder. foo does not exist. I already set the webconfig to point to my error but I just doesn't work. I get this error: Server Error in application /. -------------------------------------------------- ------------------------------ The source can not be found. Description: HTTP 404. Perhaps you are looking for the source (or a dependency thereof) removed or is temporarily unavailable or has changed its name. Check the spelling of the URL. Requested URL: / bla/foo.asox I google translate this error cuz VS here is language specific. What can I do to resolve this??? I want to point to ~/error404.aspx

    Read the article

  • how to access control in templatefield gridview with custom id

    - by Mohsen.Tavoosi
    i have a customized gridview.my grid is able to sort for each column just by 1 click in the header without any setting and overloading methods such as sorting,etc by user(programmer).(i do this successfully and work fine) users(programmers) maybe add each column in grid.such as template field,hyperlinkfield,boundfield... . for sorting, i must access datafield of columns. i can access boundfield column by this code.i can access datafield and header text and ... sample: for (int j = 0; j < this.Columns.Count; j++) { BoundField bf; bf = this.Columns[j] as BoundField; if (bf != null) { string ht = bf.HeaderText; string df = bf.DataField; } } but i can access control in the templateField.such as ColumnBound. sample: <asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label> i want access "Name" (Bind ("Name") or Eval ("Name")) . how can i? there is a point: i dont now what is the ID (in this case "Label1") of control in templatefield. special thanks

    Read the article

  • iPhone: UITableView with custom cells for settings

    - by Nic Hubbard
    I want to use a UITableView for my settings screen. So that my settings view will look like apple does it, with a group table view, and then the UI elements to let you change settings. So, it does not seem like the cells are loaded from an array, but seems like each one is customized. Ideas on how to do this?

    Read the article

  • ASP.NET Custom Control

    - by Alyn
    I am building an ASP.NET Web User Control which has a panel within it. How do I make the Panel within the user control resizable (i.e. with handles) at design time in Visual Studio. I need to create a design class or something?? Thanks.

    Read the article

  • Custom keys with NERDComment plugin and remapped Leader?

    - by Paul Wicks
    I'm trying to set up the NERDComment plugin in vim, but I'm having some trouble with the keys. I'd like to set the basic toggle functionality (comment a line if it's uncommented, uncomment if it's commented) to be c. The problem is that I've remapped the Leader to be ,, which is the same key that NERD wants for all of it's hotkeys. Anyone have any idea as to how to set this up?

    Read the article

  • Monads and custom traversal functions in Haskell

    - by Bill
    Given the following simple BST definition: data Tree x = Empty | Leaf x | Node x (Tree x) (Tree x) deriving (Show, Eq) inOrder :: Tree x -> [x] inOrder Empty = [] inOrder (Leaf x) = [x] inOrder (Node root left right) = inOrder left ++ [root] ++ inOrder right I'd like to write an in-order function that can have side effects. I achieved that with: inOrderM :: (Show x, Monad m) => (x -> m a) -> Tree x -> m () inOrderM f (Empty) = return () inOrderM f (Leaf y) = f y >> return () inOrderM f (Node root left right) = inOrderM f left >> f root >> inOrderM f right -- print tree in order to stdout inOrderM print tree This works fine, but it seems repetitive - the same logic is already present in inOrder and my experience with Haskell leads me to believe that I'm probably doing something wrong if I'm writing a similar thing twice. Is there any way that I can write a single function inOrder that can take either pure or monadic functions?

    Read the article

  • Magento - Clean custom Account/Registration Fields

    - by Bizboss
    Hello, I followed this tutorial to add fields in the registration form of a customer under Magento, I succeed to run the example, but I know that It is not clean, for upates later... What' the best way to rewrite all the files used in the tutorial, in a clean way : app/design/frontend/default/yourtheme/template/customer/form/register.phtml app/design/frontend/default/yourtheme/template/customer/form/edit.phtml app/code/core/Mage/Customer/Model/Entity/Setup.php app/code/core/Mage/Customer/etc/config.xml app/code/core/Mage/Customer/controllers/AccountController.php Thanks a lot

    Read the article

  • Access custom label property at didSelectRowAtIndexPath.

    - by Mr. McPepperNuts
    I have a UILabel for each cell at cellForRowAtIndexPath. UILabel *cellLabel = [[UILabel alloc] initWithFrame:frame]; cellLabel.text = myString; I want to access that string "myString" at didSelectRowAtIndexPath using indexpath. NSString *anotherString = cell.textLabel.text; returns null. Now if at cellForRowAtIndexPath, I did something like cell.textLabel.text = theString; then the didSelectRowAtIndexPath returns the appropriate cell. My question is, how can I access the text in the UILabel I apply to the cell, at didSelectRowAtIndexPath? Also, logging the cell in didSelectRowAtIndexPath returns cell: <UITableViewCell: 0x5dcb9d0; frame = (0 44; 320 44); autoresize = W; layer = <CALayer: 0x5dbe670>> Edit: NSString *myString = [[results objectAtIndex:indexPath.row] valueForKey:@"name"]; //cell.textLabel.text = myString; CGFloat width = [UIScreen mainScreen].bounds.size.width - 50; CGFloat height = 20; CGRect frame = CGRectMake(10.0f, 10.0f, width, height); UILabel *cellLabel = [[UILabel alloc] initWithFrame:frame]; cellLabel.text = myString; cellLabel.textColor = [UIColor blackColor]; cellLabel.backgroundColor = [UIColor whiteColor]; cellLabel.textAlignment = UITextAlignmentLeft; cellLabel.font = [UIFont systemFontOfSize:14.0f]; [cell.contentView addSubview:cellLabel]; [cellLabel release]; return cell;

    Read the article

  • When to use custom html tags?

    - by Paul Whelan
    What is the use case for using your own html tags? (In standard off the shelf browsers) A colleague and myself were discussing it lately. I could not think of a use case. We discussed it could be used for styling with css but then decided to use the span tag with a class instead. Thanks Paul

    Read the article

  • How can I create a new custom page with my own content in Elgg

    - by Vafello
    I would like to create a new page in Elgg where I can put my own content. I would like to have there all the default menus, etc. but with empty space where I can put my code. I would like to have a link to this page on my profile page. Should it be done as a new plugin? If yes, how to create empty page with my current template settings?

    Read the article

  • How to write a custom solution using a python package, modules etc

    - by morpheous
    I am writing a packacge foobar which consists of the modules alice, bob, charles and david. From my understanding of Python packages and modules, this means I will create a folder foobar, with the following subdirectories and files (please correct if I am wrong) foobar/ __init__.py alice/alice.py bob/bob.py charles/charles.py david/david.py The package should be executable, so that in addition to making the modules alice, bob etc available as 'libraries', I should also be able to use foobar in a script like this: python foobar --args=someargs Question1: Can a package be made executable and used in a script like I described above? Question 2 The various modules will use code that I want to refactor into a common library. Does that mean creating a new sub directory 'foobar/common' and placing common.py in that folder? Question 3 How will the modules foo import the common module ? Is it 'from foobar import common' or can I not use this since these modules are part of the package? Question 4 I want to add logic for when the foobar package is being used in a script (assuming this can be done - I have only seen it done for modules) The code used is something like: if __name__ == "__main__": dosomething() where (in which file) would I put this logic ?

    Read the article

  • Creating a custom Configuration

    - by Rob
    I created a customer configuration class Reports. I then created another class called "ReportsCollection". When I try and do the "ConfigurationManager.GetSection()", it doesn't populate my collection variable. Can anyone see any mistakes in my code? Here is the collection class: public class ReportsCollection : ConfigurationElementCollection { public ReportsCollection() { } protected override ConfigurationElement CreateNewElement() { throw new NotImplementedException(); } protected override ConfigurationElement CreateNewElement(string elementName) { return base.CreateNewElement(elementName); } protected override object GetElementKey(ConfigurationElement element) { throw new NotImplementedException(); } public Report this[int index] { get { return (Report)BaseGet(index); } } } Here is the reports class: public class Report : ConfigurationSection { [ConfigurationProperty("reportName", IsRequired = true)] public string ReportName { get { return (string)this["reportName"]; } //set { this["reportName"] = value; } } [ConfigurationProperty("storedProcedures", IsRequired = true)] public StoredProceduresCollection StoredProcedures { get { return (StoredProceduresCollection)this["storedProcedures"]; } } [ConfigurationProperty("parameters", IsRequired = false)] public ParametersCollection Parameters { get { return (ParametersCollection)this["parameters"]; } } [ConfigurationProperty("saveLocation", IsRequired = true)] public string SaveLocation { get { return (string)this["saveLocation"]; } } [ConfigurationProperty("recipients", IsRequired = true)] public RecipientsCollection Recipients { get { return (RecipientsCollection)this["recipients"]; } } } public class StoredProcedure : ConfigurationElement { [ConfigurationProperty("storedProcedureName", IsRequired = true)] public string StoredProcedureName { get { return (string)this["storedProcedureName"]; } } } public class StoredProceduresCollection : ConfigurationElementCollection { protected override ConfigurationElement CreateNewElement() { throw new NotImplementedException(); } protected override ConfigurationElement CreateNewElement(string elementName) { return base.CreateNewElement(elementName); } protected override object GetElementKey(ConfigurationElement element) { throw new NotImplementedException(); } public StoredProcedure this[int index] { get { return (StoredProcedure)base.BaseGet(index); } } } } And here is the very straight-forward code to create the variable: ReportsCollection reportsCollection = (ReportsCollection) System.Configuration.ConfigurationManager.GetSection("ReportGroup");

    Read the article

  • Drupal form with custom ID

    - by Andrew
    Correct me if I'm wrong, after reading drupal fapi related articles, I got the impression that fapi generates 'id' attributes by itself. It allows developers to assign 'name' attribute only. If that's the case, is there a way I can set desire 'id' value for elements? Because, I want my elements to have meaningful 'id' so that html/jquery code would be easier to read as well as save my time from going through already written jquery code to change those all 'id's that I've used inside. P.S:drupal version - 6.x

    Read the article

  • Dual slider control with custom skin

    - by Ryan French
    Hi All, I'm currently trying to create a page for users to select two points from a range, using a slide control. The first point in the range is when an alert will be sent to the user, the second point is a max limit. What I would like to do is have the bar colored green from the 0 point to the first slider point, then orange between the two sliders, and lastly red from the second slider up to the other end of the bar. Does anyone know of an easy was I can do this or of a slider control that can be skinned to do this?

    Read the article

  • Custom Calculations in a Matrix - Reporting Services 2005

    - by bfrancis
    I am writing a report to show gas usage (in gallons) used by each department. The request is to view each month and the gallons used by each department. A column is required to display what each departments target goal is, based on the gallons of gas they have used in a past time frame. Each departments target goal is x percent less than the total gallons used for said time frame. I currently have a matrix in Reporting Services with departments making up rows, months making up columns, and gallons filling the details. The matrix is being filled by dataset1. I have the data grouping as is requested for each month by each department. My problem is calculating the target goal. My thought was to create a second dataset (dataset2) that returns the gallons used based on the time frame requested. I grouped this data by department. I was hoping I could use the department field in each dataset to make sure the appropriate numbers were used. I added a new column which shows up next to the gallons field. As I attempted to build the Expression I found out that I could only grab the gallons used from dataset2 if I was summing the gallons field. This gives me the total gallons used by every department combined. I have tried to find resources with similar examples of what I am trying to accomplish but I cannot seem to come across one. I am trying to keep this as detailed as possible without making it too wordy. I would be more than happy to clarify or explain into further detail what I have written above if it is needed. If anyone has links, comments, or suggestions they would be greatly appreciated. A very simple visual or what I am hoping to accomplish is below. The months and departments would expand based on the data returned. months ------------------------------ departments| gallons/month | target goal

    Read the article

  • Custom Jquery slideshow doesn't want to reset?

    - by Jared
    Hello, Under $(document).ready(function(), I have the following code: num = $("#mainContentCategoryLinksWrapper > div").size(); This makes num equal the length of the children of #mainContentCategoryLinksWrapper. Currently, this equals 4. Above the $(document).ready(function( I have this: var timesRun = 0; function slideshow(){ if(timesRun < num){ $(".arrowIn").stop().animate({color: "#a12324", textIndent: "30px", backgroundPosition: '0px 0px'}, 100, function(){ //the first child in the series has a class of "arrowIn" $(".arrowIn").next().addClass("replaceMe"); //Adds the ".replaceMe" placeholder the the next element. $(".arrowIn").removeClass("arrowIn"); //Deletes the class on the current element $(".replaceMe").addClass("arrowIn").removeClass("replaceMe"); //reassigns ".arrowIn" over ".replaceMe" timesRun = timesRun + 1; //increases number of times run }).prev().animate({color: "#000000", textIndent: "25px", backgroundPosition: '0px -25px'}, {duration: 50}); //puts the previous element back to it's original position }else{ timesRun = 0; $(".arrowIn").removeClass("arrowIn"); $("#mainContentCategoryLinksWrapper:first-child").addClass("arrowIn"); //this is supposed to reset timesRun, and set the first child in the series back to the original ".arrowIn" } } setInterval( 'slideshow()', 1000 ); So here is the what the code does: 1) Animates the first in the series of 4 (#1) timesRun = 1 2) Animates the second in the series of 4 (#2) timesRun = 2 3) Animates the third in the series of 4 (#3) timesRun = 3 4) Animates the fourth in the series of 4 (#4) timesRun = 4 5) timesRun is now longer less than num. Reset class names back to original to .arrowIn, set timesRun to 0. However, when the slideshow() is reexectuted, it doesn't start over. Any ideas? See www.raceramps.com/v3 for an example.

    Read the article

  • php custom forum error

    - by phillip morris
    i have a form, and i want to have it be limited at 10 characters minimum. that is no problem, but what i want to do is echo the error at the top of the page, which is being included, so i cant just do: echo '<div class="error">Error</div>'; i want to have a designated div that is empty (will be on the included header page), but when there is an error it gets filled with the error text to output. anyone know how to do this not using sessions or cookies?

    Read the article

  • Implementing "Generator" support in a custom language

    - by Roger Alsing
    I've got a bit of fettish for language design and I'm currently playing around with my own hobby language. (http://rogeralsing.com/2010/04/14/playing-with-plastic/) One thing that really makes my mind bleed is "generators" and the "yield" keyword. I know C# uses AST transformation to transform enumerator methods into statemachines. But how does it work in other languages? Is there any way to get generator support in a language w/o AST transformation? e.g. Does languages like Python or Ruby resort to AST transformations to solve this to? (The question is how generators are implemented under the hood in different languages, not how to write a generator in one of them)

    Read the article

  • Validate form fields from InfoPath custom code

    - by Alex Angas
    I'm developing an InfoPath form for Forms Services. It has these views: View 1 asks the user to input some basic initial data View 2 calls a web service based on data in View 1 and populates drop-downs accordingly At the bottom of View 1 I've added a Next > button to move to View 2. As part of clicking that button I would like the inputs in View 1 to be validated first. However, there don't appear to be any rules that validate a view or anything in the object model to execute validation rules. Is there code that can trigger a field's validation event?

    Read the article

  • DriverManager always returns my custom driver regardless of the connection URL

    - by JGB146
    I am writing a driver to act as a wrapper around two separate MySQL connections (to distributed databases). Basically, the goal is to enable interaction with my driver for all applications instead of requiring the application to sort out which database holds the desired data. Most of the code for this is in place, but I'm having a problem in that when I attempt to create connections via the MySQL Driver, the DriverManager is returning an instance of my driver instead of the MySQL Driver. I'd appreciate any tips on what could be causing this and what could be done to fix it! Below is a few relevant snippets of code. I can provide more, but there's a lot, so I'd need to know what else you want to see. First, from MyDriver.java: public MyDriver() throws SQLException { DriverManager.registerDriver(this); } public Connection connect(String url, Properties info) throws SQLException { try { return new MyConnection(info); } catch (Exception e) { return null; } } public boolean acceptsURL(String url) throws SQLException { if (url.contains("jdbc:jgb://")) { return true; } return false; } It is my understanding that this acceptsURL function will dictate whether or not the DriverManager deems my driver a suitable fit for a given URL. Hence it should only be passing connections from my driver if the URL contains "jdbc:jgb://" right? Here's code from MyConnection.java: Connection c1 = null; Connection c2 = null; /** *Constructors */ public DDBSConnection (Properties info) throws SQLException, Exception { info.list(System.out); //included for testing Class.forName("com.mysql.jdbc.Driver").newInstance(); String url1 = "jdbc:mysql://server1.com/jgb"; String url2 = "jdbc:mysql://server2.com/jgb"; this.c1 = DriverManager.getConnection( url1, info.getProperty("username"), info.getProperty("password")); this.c2 = DriverManager.getConnection( url2, info.getProperty("username"), info.getProperty("password")); } And this tells me two things. First, the info.list() call confirms that the correct user and password are being sent. Second, because we enter an infinite loop, we see that the DriverManager is providing new instances of my connection as matches for the mysql URLs instead of the desired mysql driver/connection. FWIW, I have separately tested implementations that go straight to the mysql driver using this exact syntax (al beit only one at a time), and was able to successfully interact with each database individually from a test application outside of my driver.

    Read the article

< Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >