Search Results

Search found 4643 results on 186 pages for 'john dyer'.

Page 124/186 | < Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >

  • Define global textbox (or other control) width in WPF

    - by John B
    I'd like to be able to maintain the width of controls globally throughout my WPF application. Previously in winforms world I'd override onload in a base form and iterate through all controls and containers and determine the type of controls and set the dimensions accordingly. I guess I could do the same in WPF but is there any better way to do this?

    Read the article

  • Java Null Pointer Exception :-(

    - by John-Michael Reed
    I've got a Null Pointer Exception in my main that just won't go away and I'm totally out of ideas. The error is on the line "Board[x][y].color = 2;" in which Board is a public, static array of piece objects that contain instance variables like the one "color" that is being set to 2 in the above statement. Pieces is not static - that is there are many different copies of pieces, each with its own data, but only one board. The array has been initialized and defined as both public Piece[][] Board = new Piece[8][8] and public static Piece[][] Board = new Piece[8][8], but no matter how I mess around with it (getting rid of static, putting the variable in another object, etc.), I can't seem to get the error to go away. Help?

    Read the article

  • How can I efficiently retrieve a large number of database settings as PHP variables?

    - by Steven
    Currently all of my script's settings are located in a PHP file which I 'include'. I'm in the process of moving these settings (about 100) to a database table called 'settings'. However I'm struggling to find an efficient way of retrieving all of them into the file. The settings table has 3 columns: ID (autoincrements) name value Two example rows might be: 1 admin_user john 2 admin_email_address [email protected] The only way I can think of retrieving each setting is like this: $result = mysql_query("SELECT value FROM settings WHERE name = 'admin_user'"); $row = mysql_fetch_array($result); $admin_user = $row['value']; $result = mysql_query("SELECT value FROM settings WHERE name = 'admin_email_address'"); $row = mysql_fetch_array($result); $admin_email_address = $row['value']; etc etc Doing it this way will take up a lot of code and will likely be slow. Is there a better way? Thanks.

    Read the article

  • Store data in an inconvenient table or create a derived table?

    - by user1705685
    I have a certain predefined database structure that I am stuck with. The question is whether this structure is OK for ORM or I whether should add a processing layer that would create a more convenient structure every time something is inserted into the original DB. To simplify, here's what it kind of looks like. I have a person table: PersonId Name And I have a properties table: PersonId PropertyType PropertyValue So, for person John Doe... (1, 'John Doe') ...I could have three properties: (1, 'phone', '555-55-55'), (1, 'email', '[email protected]), (1, 'type', 'employee') By using ORM I would like to get a "person" object that would have properties "name", "phone", "email", "type". Can Propel do that? How efficient is it? Is it a better idea to create a table with columns "phone", "email", "type" and fill it automatically as new rows are inserted into the properties table?

    Read the article

  • PHP and storing stats

    - by John
    Using PHP5 and the latest version of MySQL I want to be able to track impressions and clicks for business listings. My question is if I did this myself what would be the best method in storing it so I can run reports? Before I just had a table that had the listing id, user ip address and if it was a click or impression as well as the date it was tracked. However the database itself is approaching 2GB of data and its very slow, part of the problem is its a pretty simple script that includes impressions and clicks from anyone including search engines and basically anyone or anything that accesses the listing page. Is there an api or file out there that has an update to date list that can detect if the person viewing is a actually person and not a spider so I dont fill up the database with unneeded stats? Just looking for suggestions, do I just have a raw database that gets just the hits then a cron job at night tally up for the day for each listing for each ip and store the cumulative stats in a different table? Also what type of database should it be? Innodb? MyISAM?

    Read the article

  • ( Sql Server 2005 C#.Net ) - I want just the insert query for a temp table.

    - by John Stephen
    Hi..I am using C#.Net and Sql Server ( Windows Application ). I had created a temporary table. When a button is clicked, temporary table (#tmp_emp_details) is created. I am having another button called "insert Values" and also 5 textboxes. The values that are entered in the textbox are used and whenever com.ExecuteNonQuery(); line comes, it throws an error message called "Invalid object name '#tbl_emp_answer'.". Below is the set of code..Please give me a solution. Code for insert (in insert value button): private void btninsertvalues_Click(object sender, EventArgs e) { username = txtusername.Text; examloginid = txtexamloginid.Text; question = txtquestion.Text; answer = txtanswer.Text; useranswer = txtanswer.Text; SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=tempdb;Integrated Security=True;"); SqlCommand com = new SqlCommand("Insert into #tbl_emp_answer values('"+username+"','"+examloginid+"','"+question+"','"+answer+"','"+useranswer+"')", con); con.Open(); com.ExecuteNonQuery(); con.Close(); }

    Read the article

  • Major inconsistencies in Zend Framework

    - by John Nall
    Okay first of all let me just say Zend Framework is the greatest tool I have ever used in 30+ years of programming (well, for web development, Qt wins the desktop market). However, through my use I have noticed some glaring and annoying inconsistencies. For instance, Zend_Form_Element's have a setAttrib() method. Now why the hell is this the only method in that API which is abbrev.? Why then am I using setRequired() instead of setReq()? I have more examples, I am extremely nerd raged about this. It is completely ruining what could have been God's gift to web development. FOR FUTURE REFERENCE NEVER ABBREV. THINGS WHEN MAKING AN API. also always filter data before storing it i m o Who do we talk to about this, where something will actually get done about it?

    Read the article

  • ASP .NET Dynamically adding EventHandlers to button on Page_Load. EventHandler's do not fire the fir

    - by John
    Background: I am customizing an existing ASP .NET / C# application. It has it's own little "framework" and conventions for developers to follow when extending/customizing its functionality. I am currently extending some of it's administrative functionality, to which the framework provides a contract to enforce implementation of the GetAdministrationInterface() method, which returns System.Web.UI.Control. This method is called during the Page_Load() method of the page hosting the GUI interface. Problem: I have three buttons in my GUI, each of which have been assigned an Event Handler. My administration GUI loads up perfectly fine, but clicking any of the buttons doesn't do what I expect them to do. However, when I click them a second time, the buttons work. I placed breakpoints at the the beginning of each event handler method and stepped through my code. On the first click, none of the event handlers are triggered. On the second click, they are triggered. Any ideas? Example of Button Definition Button btn = new Button(); btn.Text = "Click Me Locked Screen"; bth.Click += new EventHandler(Btn_Click); Example of Event Handler Method Definition void Btn_Click(object sender, EventArgs e) { // Do Something }

    Read the article

  • NoMethodError when trying to invoke helper method from Rails controller

    - by John Topley
    I'm getting a NoMethodError when trying to access a method defined in one of my helper modules from one of my controller classes. My Rails application uses the helper class method with the :all symbol as shown below: class ApplicationController < ActionController::Base helper :all . . end My understanding is that this should make all of my controller classes automatically include all of the helper modules within the app/helpers directory, therefore mixing in all of the methods into the controllers. Is this correct? If I explicitly include the helper module within the controller then everything works correctly.

    Read the article

  • Inheritance: possible to change base reference to something else?

    - by fred
    For example I have two classes, Base and Derived as shown below: class Base { public string Name { get; set; } public Base() { } } class Derived : Base { public Derived(Base b) { base = b; // doesn't compile, but is there any way to do something similar? } } So that they behave like this: Base b = new Base(); b.Name = "Bob"; Derived d = new Derived(b); d.Name = "John"; // b.Name is now "John" also Is this possible? I guess one way would be to keep the Base b reference in Derived and override Derived.Name to point to b.Name? Is there an easier way though, for example if I have like 50 properties to override? class Derived : Base { Base b; public override string Name { get { return b.Name; } set { b.Name = value; } } public Derived(Base b) { this.b = b; } }

    Read the article

  • more efficient version of this?

    - by john connor
    i have this thingy here : function numOfPackets(bufferSize, packetSize) { if (bufferSize <= 0 || packetSize > bufferSize) return 0; if (packetSize < 0) throw Error(); var out = 0; for(;;){ out++; bufferSize = bufferSize - packetSize; if( packetSize > bufferSize ) break; } return out; } which i run at often , can u give me more efficent variant of it?

    Read the article

  • How do I access abstract private data from derived class without friend or 'getter' functions in C++?

    - by John
    So, I am caught up in a dilemma right now. How am I suppose to access a pure abstract base class private member variable from a derived class? I have heard from a friend that it is possible to access it through the base constructor, but he didn't explain. How is it possible? There are some inherited classes from base class. Is there any way to gain access to the private variables ? class Base_button { private: bool is_vis; Rect rButton; public: // Constructors Base_button(); Base_button( const Point &corner, double height, double width ); // Destructor virtual ~ Base_button(); // Accessors virtual void draw() const = 0; bool clicked( const Point &click ) const; bool is_visible() const; // Mutators virtual void show(); virtual void hide(); void move( const Point &loc ); }; class Button : public Base_button { private: Message mButton; public: // Constructors Button(); Button( const Point &corner, const string &label ); // Acessors virtual void draw() const; // Mutators virtual void show(); virtual void hide(); }; I want to be able access Rect and bool in the base class from the subclass

    Read the article

  • How do I stop and empty tag in XML serializer?

    - by John
    I have an object like this, public class UserObj { public string First {get; set;} public string Last {get; set;} public addr Address {get; set;} } public class addr { public street {get; set;} public town {get; set;} } Now when I use XmlSerializer on it and street and town are empty I get this in the XML output, <Address /> Is there a way not to output this empty tag? Thanks

    Read the article

  • Good book for Flex 4?

    - by John Isaacks
    I read the O'Really Book: Programming Flex 3 and I thought it was awesome. I am now migrating to Flex 4 and wanted to read a great book for Flex 4. There are many Flex 4 books out there and I really just want to read 1 to get me up and running fast. So if anyone can share/recommend some books that would be great!

    Read the article

  • Code example with annotation in JavaDoc

    - by John
    Hello, my JavaDoc doesn't work when I have a code example with an annotation. Any suggestions? /** * <pre> * public class Demo { * @DemoAnnotation * public void demoMethod() { * } * } * </pre> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface DemoAnnotation {

    Read the article

  • How can you prevent a window being captured by Print-Screen?

    - by John
    I noticed a few times than when I print-screen while Media Player is running, the content is replaced with a grey rectangle. I've no idea if it's deliberate due to DRM, or some technical issue, but it struck me that being able to deliberately block screen-capture might be a useful feature in some scenarios. Is there some specific message each HWND gets for print-screen - does Windows do a special repaint or simply dump buffers to the clipboard? I guess I'd prefer to focus this on Win32 specifically, but as long as it's Windows-related then fine.

    Read the article

  • LINQ query with specified number of rows in a subquery problem

    - by John
    I'm trying to write the following query in LINQ, but can't seem to get it correct. select p.* from Person p inner join PersoniPhones i ON p.PersonID = i.PersonID where p.PersonID in ( SELECT PersonID FROM ( SELECT Top 10 PersonID, iPhoneID FROM iPhone ORDER BY LastPlayedDate DESC ) as t ) I've tried the following, but it doesn't return correctly var tenIPhones = from i in context.PersonIPhones .OrderByDescending(i => i.LastPlayedDate) .Take(minNumQuestions) select new { i.PersonID, i.IPHoneID}; var people = from p in context.Person join t in tenIPhones on p.PersonID equals t.PersonID select p; Any ideas?

    Read the article

  • Using PHP interfaces in Codeigniter

    - by John Stewart
    I am trying to find out how can I used PHP interfaces in my MVC design. I want to make sure that the design enforces an interface so that any new module would follow that. For example: <?php interface BaseAPI { public function postMessage($msg); } class ServiceAPI implements BaseAPI { public function postMessage($msg) { return $msg; } } class Service_Two_API implements BaseAPI { public function postMessage($msg) { return "can't do this: ".$msg; } } ?> I want to do this in CI. Is it possible? how should I design it?

    Read the article

  • What rules govern cross-version compatibility for .NET applications and the C# language?

    - by John Feminella
    For some reason I've always had trouble remembering the backwards/forwards compatibility guarantees made by the framework, so I'd like to put that to bed forever. Suppose I have two assemblies, A and B. A is older and references .NET 2.0 assemblies; B references .NET 3.5 assemblies. I have the source for A and B, Ax and Bx, respectively; they are written in C# at the 2.0 and 3.0 language levels. (That is, Ax uses no features that were introduced later than C# 2.0; likewise Bx uses no features that were introduced later than 3.0.) I have two environments, C and D. C has the .NET 2.0 framework installed; D has the .NET 3.5 framework installed. Now, which of the following can/can't I do? Running: run A on C? run A on D? run B on C? run C on D? Compiling: compile Ax on C? compile Ax on D? compile Bx on C? compile Bx on D? Rewriting: rewrite Ax to use features from the C# 3 language level, and compile it on D, while having it still work on C? rewrite Bx to use features from the C# 4 language level on another environment E that has .NET 4, while having it still work on D?' Referencing from another assembly: reference B from A and have a client app on C use it? reference B from A and have a client app on D use it? reference A from B and have a client app on C use it? reference A from B and have a client app on D use it? More importantly, what rules govern the truth or falsity of these hypothetical scenarios?

    Read the article

  • how can an application use port 80/HTTP without conflicting with browsers?

    - by John
    If I understand right, applications sometimes use HTTP to send messages, since using other ports is liable to cause firewall problems. But how does that work without conflicting with other applications such as web-browsers? In fact how do multiple browsers running at once not conflict? Do they all monitor the port and get notified... can you share a port in this way? I have a feeling this is a dumb question, but not something I ever thought of before, and in other cases I've seen problems when 2 apps are configured to use the same port.

    Read the article

< Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >