Search Results

Search found 3140 results on 126 pages for 'creation'.

Page 11/126 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • XML creation using DOM and MYSQL

    - by dbomb101
    I am trying to create a XML document from information extracted from a mysql table. I am using a tutorial to accomplish this http://www.tonymarston.net/php-mysql/dom.html#a5 what I want to do is to create each element separately, instead of creating them all at once as shown in the tutorial. In order to do that I am trying to place the specific field name into the foreach loop below, any help would be greatly appreciated. foreach ($row as where fieldname should go => $row['artistname']) { $artval = $doc->createTextNode($row['artistname']); $artval = $chil->appendChild($val); }

    Read the article

  • AppDomain Creation In .Net

    - by Mita
    Is There a way we can clone Current Application Domain & Its Assembly in to new created domain to execute same peace of code in multiple domain having same dependencies as current domain have.

    Read the article

  • VB Equivalent of C# Event Creation

    - by Steven
    I'm trying to extend the GridView class to always show the header and footer even when the datasource is empty. I found this website: link. However, it is written in C# but I use VB. What's the VB equivalent of line 76 (public event MustAddARowHandler MustAddARow;)?

    Read the article

  • Dynamic/runtime method creation (code generation) in Python

    - by Eli Bendersky
    Hello, I need to generate code for a method at runtime. It's important to be able to run arbitrary code and have a docstring. I came up with a solution combining exec and setattr, here's a dummy example: class Viking(object): def __init__(self): code = ''' def dynamo(self, arg): """ dynamo's a dynamic method! """ self.weight += 1 return arg * self.weight ''' self.weight = 50 d = {} exec code.strip() in d setattr(self.__class__, 'dynamo', d['dynamo']) if __name__ == "__main__": v = Viking() print v.dynamo(10) print v.dynamo(10) print v.dynamo.__doc__ Is there a better / safer / more idiomatic way of achieving the same result?

    Read the article

  • validating creation by post_id and ip_address - Ruby on Rails

    - by bgadoci
    I have created a blog application using Ruby on Rails which includes the ability to vote on posts. A user can click vote and a record is created in the vote table. I am now trying to limit that same person from voting for a post multiple times. class Post has_many :votes end class Vote belongs_to :post end When a vote record is created I am using the VotesController to pass the :post_id and using a hidden field in the view to pass the ip_address (both to the vote table). I am wondering if there is a way to add a validation to the Vote Model that searches to see if a post_id has an ip_address that matches the person requesting to vote. I have tried simply using the validates_uniqueness_of :ip_address but that restricts the user from voting on any post. I just want to restrict the user from voting on a particular post that they have already voted on. Is there a way to do this through validation?

    Read the article

  • Prevent deferred creation of controls.

    - by Scott Chamberlain
    Here is a test framework to show what I am doing, just create a new project add a tabbed control, on tab 1 put a button on tab 2 put a check box (default names) and paste this code for its code public partial class Form1 : Form { private List<bool> boolList = new List<bool>(); BindingSource bs = new BindingSource(); public Form1() { InitializeComponent(); boolList.Add(false); bs.DataSource = boolList; checkBox1.DataBindings.Add("Checked", bs, ""); } bool updating = false; private void button1_Click(object sender, EventArgs e) { updating = true; boolList[0] = true; bs.ResetBindings(false); Application.DoEvents(); updating = false; } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (!updating) MessageBox.Show("CheckChanged fired outside of updating"); } } The issue is if you run the program and look at tab 2 then press the button on tab 1 the program works as expected, however if you press the button on tab 1 then look at tab 2 the event for the checkbox will not fire untill you look at tab 2. The reason for this is the controll on tab 2 is not in the "created" state, so its binding to change the checkbox from unchecked to checked does not happen until after the control has been "Created". checkbox1.CreateControl() does not do anything because according to MSDN CreateControl does not create a control handle if the control's Visible property is false. You can either call the CreateHandle method or access the Handle property to create the control's handle regardless of the control's visibility, but in this case, no window handles are created for the control's children. I tried getting the value of Handle(there is no CreateHandle for Button) but still the same result. Any suggestions other than have the program quickly flash all of my tabs that have data-bound check boxes when it first loads?

    Read the article

  • C# text creation issue

    - by Mike
    This is whats going on. I have a huge text file that is suppose to be 1 line per entry. The issue is sometimes the line is broken with a new line. I edit this entire file and wherever the file doesn't begin with ("\"A) i need to append the current line to the previous line ( replacing \n with " "). Everything I come up with keeps appending the line to a new line. Any help is appricated... CODE: public void step1a() { string begins = ("\"A"); string betaFilePath = @"C:\ext.txt"; string[] lines = File.ReadAllLines(betaFilePath); foreach (string line in lines) { if (line.StartsWith(begins)) { File.AppendAllText(@"C:\xt2.txt",line); File.AppendAllText(@"C:\xt2.txt", "\n"); } else { string line2 = line.Replace(Environment.NewLine, " "); File.AppendAllText(@"C:\xt2.txt",line2); } } } Example: Orig: "\"A"Hero|apple|orange|for the fun of this "\"A"Hero|apple|mango|lots of fun always "\"A"Her|apple|fruit|no pain is the way "\"A"Hero|love|stackoverflowpeople|more fun Resulting: "\"A"Hero|apple|orange|for the fun of this "\"A"Hero|apple|mango|lots of fun always "\"A"Her|apple|fruit|no pain is the way "\"A"Hero|love|stackoverflowpeople|more fun

    Read the article

  • VS2008: File creation fails randomly in unit testing?

    - by Tim
    I'm working on implementing a reasonably simple XML serializer/deserializer (log file parser) application in C# .NET with VS 2008. I have about 50 unit tests right now for various parts of the code (mostly for the various serialization operations), and some of them seem to be failing mostly at random when they deal with file I/O. The way the tests are structured is that in the test setup method, I create a new empty file at a certain predetermined location, and close the stream I get back. Then I run some basic tests on the file (varying by what exactly is under test). In the cleanup method, I delete the file again. A large portion (usually 30 or more, though the number varies run to run) of my unit tests will fail at the initialize method, claiming they can't access the file I'm trying to create. I can't pin down the exact reason, since a test that will work one run fails the next; they all succeed when run individually. What's the problem here? Why can't I access this file across multiple unit tests? Relevant methods for a unit test that will fail some of the time: [TestInitialize()] public void LogFileTestInitialize() { this.testFolder = System.Environment.GetFolderPath( System.Environment.SpecialFolder.LocalApplicationData ); this.testPath = this.testFolder + "\\empty.lfp"; System.IO.File.Create(this.testPath); } [TestMethod()] public void LogFileConstructorTest() { string filePath = this.testPath; LogFile target = new LogFile(filePath); Assert.AreNotEqual(null, target); Assert.AreEqual(this.testPath, target.filePath); Assert.AreEqual("empty.lfp", target.fileName); Assert.AreEqual(this.testFolder + "\\empty.lfp.lfpdat", target.metaPath); } [TestCleanup()] public void LogFileTestCleanup() { System.IO.File.Delete(this.testPath); } And the LogFile() constructor: public LogFile(String filePath) { this.entries = new List<Entry>(); this.filePath = filePath; this.metaPath = filePath + ".lfpdat"; this.fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1); } The precise error message: Initialization method LogFileParserTester.LogFileTest.LogFileTestInitialize threw exception. System.IO.IOException: System.IO.IOException: The process cannot access the file 'C:\Users\<user>\AppData\Local\empty.lfp' because it is being used by another process..

    Read the article

  • auto m3u creation

    - by newbie69
    Hi, I am looking for a solution to automatically create .m3u playlists for each music folder in my sdcard so that the music player can play music by folders. I had written a simple VB.Net app in the past that does exactly the above but apparently, it has to be run from Windows. Since I have no Java nor Android developing experience I found it quite hard to try to write a similar app that can be run directly from the phone. In a few words, the app does the following: 1) Searches the SD and lists all folders that contain 2 or more .mp3 files (just for user verification) 2) Creates in every listed folder above, a .m3u file that simply lists line-by-line all the mp3 files that exist in the specific folder. Is there such an app or could someone spare some time and give me some rough instructions on how to create it in Eclipse 3.5.2 environment? (device used: Motorola Droid/Milestone, Android 2.1) I don't care about any graphics or complex UI, just a script to execute the above procedure that would give every "playlist-supporting" music player in Android, the precious ability to play music by folders. I know it is too much to ask but just in case! Thanx in advance.

    Read the article

  • Resources for widget creation

    - by Kenji Crosland
    My rails app is about to go live and I'm trying to figure out how to create a widget based on data on the site. My Javascript is not too hot--limited to the O'reilly head first book on JS. I can read simple Javascript okay but when it comes to writing it I'm a little lost. That said, I hope to roll out a widget, maybe a wordpress plugin too soon after my app is launched. Does anyone know of any rails plugins, javascript templates, tutorials or books that can get me going? I did ask a similar question before here: But my limited knowledge of JS kept me from implementing the suggested answer properly.

    Read the article

  • Charging for the creation of a website [closed]

    - by mattgcon
    I am not sure if this can be asked here, but you all are very reliable and trustworthy in my eyes and well straight to the point, so I am going to ask. I am a professional programmer and web designer for UCLA (do not set prices) and I have an old colleage that needs a website designed for his new company. He wants his website to resemble the LDH Energy website, layout colors and the flash movies (no image replication or verbiage, all that will be his) and he has one idea of a price and I have another. Can anyone go and look at that website and let me know their opinion of what to charge for his website? thank you matthew

    Read the article

  • Creation time of Innodb tables

    - by shantanuo
    CRETAE_TIME column of "TABLES" table from INFORMATION_SCHEMA shows the same CREATE_TIME for all my innodb tables. It means all these tables were created between 2010-03-26 06:52:00 and 2010-03-26 06:53:00 while actually they were created a few months ago. Does the CREATE_TABLE field change automatically for Innodb tables?

    Read the article

  • CMS template creation and jQuery integration

    - by Fermin
    Hi, First off I should say that I don't have any experience in working with a CMS. I have 2 general questions about CMS: How easy is it to create a template? I have strong CSS/XHTML skills, is creating a template as easy as writing the markup or does it have to be done in a very rigid way? How is jQuery support in CMS systems? I like what you can do with jQuery and would like to incorporate it into the next couple of sites that I will do. EDIT: So far answers are asking which CMS, I don't have any in mind. Any suggestions welcome, open source and non .NET preferable.

    Read the article

  • Running out of memory with UIImage creation on an offscreen Bitmap Context by NSOperation

    - by sigsegv
    I have an app with multiple UIView subclasses that acts as pages for a UIScrollView. UIViews are moved back and forth to provide a seamless experience to the user. Since the content of the views is rather slow to draw, it's rendered on a single shared CGBitmapContext guarded by locks by NSOperation subclasses - executed one at once in an NSOperationQueue - wrapped up in an UIImage and then used by the main thread to update the content of the views. -(void)main { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc]init]; if([self isCancelled]) { return; } if(nil == data) { return; } // Buffer is the shared instance of a CG Bitmap Context wrapper class // data is a dictionary CGImageRef img = [buffer imageCreateWithData:data]; UIImage * image = [[UIImage alloc]initWithCGImage:img]; CGImageRelease(img); if([self isCancelled]) { [image release]; return; } NSDictionary * result = [[NSDictionary alloc]initWithObjectsAndKeys:image,@"image",id,@"id",nil]; // target is the instance of the UIView subclass that will use // the image [target performSelectorOnMainThread:@selector(updateContentWithData:) withObject:result waitUntilDone:NO]; [result release]; [image release]; [pool release]; } The updateContentWithData: of the UIView subclass performed on the main thread is just as simple -(void)updateContentWithData:(NSDictionary *)someData { NSDictionary * data = [someData retain]; if([[data valueForKey:@"id"]isEqualToString:[self pendingRequestId]]) { UIImage * image = [data valueForKey:@"image"]; [self setCurrentImage:image]; [self setNeedsDisplay]; } // If the image has not been retained, it should be released together // with the dictionary retaining it [data release]; } The drawLayer:inContext: method of the subclass will just get the CGImage from the UIImage and use it to update the backing layer or part of it. No retain or release is involved in the process. The problem is that after a while I run out of memory. The number of the UIViews is static. CGImageRef and UIImage are created, retained and released correctly (or so it seems to me). Instruments does not show any leaks, just the free memory available dip constantly, rise a few times, and then dip even lower until the application is terminated. The app cycles through about 2-300 of the aforementioned pages before that, but I would expect to have the memory usage reach a more or less stable level of used memory after a bunch of pages have been already skimmed at fast speed or, since the images are up to 3MB in size, deplete way earlier. Any suggestion will be greatly appreciated.

    Read the article

  • php file creation and how to run my php program

    - by user216112
    I'd like if someone could give me some advice on creating the php file, i know to php language.but where to write it.i have followed some tutorial to run php file in netbeans but its pathethic to download xamp server,apache http server.can u give me the direct of how make configuration and all.i have window7 ultimate and will file i hav to download i don't know. i have netbeans all bundle feature and wamp server.how should i write my php program successfully.plz help me to resolve this.

    Read the article

  • How to handle a DataTemplate creation

    - by Shimmy
    Hello! Take a look at the following xaml: <ListBox ItemsSource="{Binding}"> <ListBox.Resources> <CollectionViewSource x:Key="CVS"/> </ListBox.Resources> <ListBox.DataTemplate> <DataTemplate OnBinding="myBinding"> <ListBox DataContext="{StaticResource CVS}" ItemsSource="{Binding}" /> </DataTemplate> </ListBox.DataTemplate> </ListBox> So I can handle the binding and manually retrieve the CVS and set its Source property to my custom stuff according to the DataTemplate's DataContext. Or else there is a different way in doing it. Any ideas are welcommed!

    Read the article

  • NHibernate Proxy Creation

    - by Chris Meek
    I have a class structure like the following class Container { public virtual int Id { get; set; } public IList<Base> Bases { get; set; } } class Base { public virtual int Id { get; set; } public virtual string Name { get; set; } } class EnemyBase : Base { public virtual int EstimatedSize { get; set; } } class FriendlyBase : Base { public virtual int ActualSize { get; set; } } Now when I ask the session for a particular Container it normally gives me the concrete EnemyBase and FriendlyBase objects in the Bases collection. I can then (if I so choose) cast them to their concrete types and do something specific with them. However, sometime I get a proxy of the "Base" class which is not castable to the concrete types. The same method is used both times with the only exception being that in the case that I get proxies I have added some related entities to the session (think the friendly base having a collection of people or something like that). Is there any way I can prevent it from doing the proxy creating and why would it choose to do this in some scenarios? UPDATE The mappings are generated with the automap feature of fluentnhibernate but look something like this when exported <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true"> <class xmlns="urn:nhibernate-mapping-2.2" mutable="true" name="Base" table="`Base`"> <id name="Id" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <column name="Id" /> <generator class="MyIdGenerator" /> </id> <property name="Name" type="String"> <column name="Name" /> </property> <joined-subclass name="EnemyBase"> <key> <column name="Id" /> </key> <property name="EstimatedSize" type="Int"> <column name="EstimatedSize" /> </property> </joined-subclass> <joined-subclass name="FriendlyBase"> <key> <column name="Id" /> </key> <property name="ActualSize" type="Int"> <column name="ActualSize" /> </property> </joined-subclass> </class> </hibernate-mapping> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true"> <class xmlns="urn:nhibernate-mapping-2.2" mutable="true" name="Container" table="`Container`"> <id name="Id" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <column name="Id" /> <generator class="MyIdGenerator" /> </id> <bag cascade="all-delete-orphan" inverse="true" lazy="false" name="Bases" mutable="true"> <key> <column name="ContainerId" /> </key> <one-to-many class="Base" /> </bag> </class> </hibernate-mapping>

    Read the article

  • SQL View Creation

    - by george9170
    I have two tables Table FOO FooUniqueID| Year| Name| Worth| --------------------------- 1 2008 Bob 23.00 2 2009 Bob 40200 Table Bar BarUniqueID | Name | Value ----------------------- 1aBc Year 2009 I would like to create a view. That will select everything from FOO where the Year is equal select value from Bar where name = year without using a sub query. thank you

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >