Search Results

Search found 4763 results on 191 pages for 'adams john'.

Page 128/191 | < Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >

  • Released object crashes app

    - by John Smith
    I am using objective-C++ (+Boost) for iPhone development. I am in a rather tight loop and need to allocate and release a certain object. The code is something like this. for (int i=0;i<100;i++) { opt = [[FObj alloc] init]; //do stuff with opt [opt release]; } The FObj object is something like @interface FObj MyCPPObj * cppobj; @end In the implementation of FObj there is a dealloc method: -(void) dealloc { delete cppobj; //previously allocated with 'new' [super dealloc]; } I am afraid that if i don't release then the 'MyCPPObj's will just pile up. But releasing makes the app crash after the first loop. What am I doing wrong? Or perhaps should I make cppobj and boost::shared_ptr? (do boost shared pointers automatically release their objects when an objective-C++ object is deleted?)

    Read the article

  • Is a web-server (e.g servlets) a good solution for an IM server?

    - by John
    I'm looking at a new app, broadly speaking an IM application with a strong client-server model - all communications go through a server so they can be logged centrally. The server will be Java in some form, clients could at this point be anything from a .NET Desktop app to Flex/Silverlight, to a simple web-interface using JS/AJAX. I had anticipated doing the server using standard J2EE so I get a thread-safe, multi-user server for 'free'... to make things simple let's say using Servlets (but in practice SpringMVC would be likely). This all seemed very neat but I'm concerned if the stateless nature of Servlets is the best approach. If my memory of servlets (been a year or two) is right, each time a client sent a HTTP request, typically a new message entered by the user, the servlet could not assume it had the user/chat in memory and might have to get it from the DB... regardless it has to look it up. Then it either has to use some PUSH system to inform other members of the chat, or cache that there are new messages, for other clients who poll the server using AJAX or similar - and when they poll it again has to lookup the chat, including new messages, and send the new data. I'm wondering if a better system would be the server is running core Java, and implements a socket-based communication with clients. This allows much more immediate data transfer and is more flexible if say the IM client included some game you could play. But then you're writing a custom server and sockets don't sound very friendly to a browser-based client on current browsers. Am I missing some big piece of the puzzle here, it kind of feels like I am? Perhaps a better way to ask the question would simply be "if the client was browser-based using HTML/JS and had to run on IE7+,FF2+ (i.e no HTML5), how would you implement the server?" edit: if you are going to suggest using XMPP, I have been trying to get my head around this in another question, so please consider if that's a more appropriate place to discuss this specifically.

    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

  • ( 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

  • C# cross thread dialogue co-operation

    - by John Attridge
    K I am looking at a primarily single thread windows forms application in 3.0. Recently my boss had a progress dialogue added on a separate thread so the user would see some activity when the main thread went away and did some heavy duty work and locked out the GUI. The above works fine unless the user switches applications or minimizes as the progress form sits top most and will not disappear with the main application. This is not so bad if there are lots of little operations as the event structure of the main form catches up with its events when it gets time so minimized and active flags can be checked and thus the dialog thread can hide or show itself accordingly. But if a long running sql operation kicks off then no events fire. I have tried intercepting the WndProc command but this also appears queued when a long running sql operation is executing. I have also tried picking up the processes, finding the current app and checking various memory values isiconic and the like inside the progress thread but until the sql operation finishes none of these get updated. Removing the topmost causes the dialog to disappear when another app activates but if the main app is then brought back it does not appear again. So I need a way to find out if the other thread is minimized or no longer active that does not involve querying the actual thread as that locks until the sql operation finishes. Now I know that this is not the best way to write this and it would be better to have all the heavy processing on separate threads leaving the GUI free but as this is a huge ancient legacy app the time to re-write in that fashion will not be provided so I have to work with what I have got. Any help is appreciated

    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

  • 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

  • How to loop through the ChartColorPalette properties and add to list?

    - by John M
    I am using the Microsoft Chart Controls for .NET 3.5 (C#) and have a chart in a winform. My hope is to allow the user to change the color palette based on their preference. How do I iterate through the color properties of the ChartColorPalette and add them to a combobox list? I know it should be something like: for each(something in ChartColorPalette) { combobox.items.add(something.ToString); }

    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

  • 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

  • iframe height adjustment

    - by john
    Is there a way to set the height of the iframe to be the same as the height of its source? I am trying to a) Avoid scrollbars and b) Avoid using fixed height in px Thank you. :)

    Read the article

  • 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

  • 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

  • NServiceBus specify order of Handlers execution

    - by John Simons
    Just wondering if this is the way to specify the order to run a handler (AuthorizationHandler) before all others? public void SpecifyOrder(Order order) { order.Specify(First<AuthorizationHandler>.Then<IHandleMessages<IMessage>>()); } It just feels odd to add Then<IHandleMessages<IMessage>>(). Is there a nicer way of saying to the Bus execute x handler before all others?

    Read the article

  • Insert a default row into a combobox that is bound to a datatable?

    - by John M
    On a winform there is a combobox that derives its information from a datatable. The datatable draws from a database list. this.cboList.DataSource = pullData(); this.cboList.DisplayMember = "fieldA"; Once the DataSource is set I am not able to insert a default row (ie *) as the first item in the combobox. I tried this: this.cboList.Items.Insert(0,"*"); Is there a way to insert in the combobox after the datasource is set or should this be done in the datatable?

    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

  • svn from console - how to save password?

    - by john mcdonald
    Hi all, I was wondering if there is a way to save my svn password when doing svn operations from the console. The console is the only option that I have. When I try to do any svn action "eg svn commmit," it prompts for the account password every time. Is there a way to save this password somehow so that I don't have to retype it every time? Thanks.

    Read the article

  • Reading a simple Avro file from HDFS

    - by John Galt... who
    I am trying to do a simple read of an Avro file stored in HDFS. I found out how to read it when it is on the local file system.... FileReader reader = DataFileReader.openReader(new File(filename), new GenericDatumReader()); for (GenericRecord datum : fileReader) { String value = datum.get(1).toString(); System.out.println("value = " value); } reader.close(); My file is in HDFS, however. I cannot give the openReader a Path or an FSDataInputStream. How can I simply read an Avro file in HDFS? EDIT: I got this to work by creating a custom class (SeekableHadoopInput) that implements SeekableInput. I "stole" this from "Ganglion" on github. Still, seems like there would be a Hadoop/Avro integration path for this. 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

  • 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

  • Overhead of calling tiny functions from a tight inner loop? [C++]

    - by John
    Say you see a loop like this one: for(int i=0; i<thing.getParent().getObjectModel().getElements(SOME_TYPE).count(); ++i) { thing.getData().insert( thing.GetData().Count(), thing.getParent().getObjectModel().getElements(SOME_TYPE)[i].getName() ); } if this was Java I'd probably not think twice. But in performance-critical sections of C++, it makes me want to tinker with it... however I don't know if the compiler is smart enough to make it futile. This is a made up example but all it's doing is inserting strings into a container. Please don't assume any of these are STL types, think in general terms about the following: Is having a messy condition in the for loop going to get evaluated each time, or only once? If those get methods are simply returning references to member variables on the objects, will they be inlined away? Would you expect custom [] operators to get optimized at all? In other words is it worth the time (in performance only, not readability) to convert it to something like: ElementContainer &source = thing.getParent().getObjectModel().getElements(SOME_TYPE); int num = source.count(); Store &destination = thing.getData(); for(int i=0;i<num;++i) { destination.insert(thing.GetData().Count(), source[i].getName(); } Remember, this is a tight loop, called millions of times a second. What I wonder is if all this will shave a couple of cycles per loop or something more substantial? Yes I know the quote about "premature optimisation". And I know that profiling is important. But this is a more general question about modern compilers, Visual Studio in particular.

    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

  • Is there any way to validate the Open Graph protocol meta tags for Facebook integration?

    - by John
    Is there any way to validate the Facebook Open Graph protocol meta tags in the head section of my website? Code below. <meta property="og:title" content="my content" /> <meta property="og:type" content="company" /> <meta property="og:url" content="http://mycompany.com/" /> <meta property="og:image" content="http://mycompany.com/image.png" /> <meta property="og:site_name" content="my site name" /> <meta property="fb:admins" content="my_id" /> <meta property="og:description" content="my description" /> -edit- I mean validating the html. Sorry for the confusion! Right now my site isn't valid because of these tags.

    Read the article

< Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >