Daily Archives

Articles indexed Monday April 26 2010

Page 8/110 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to read the metadata of a MKV movie files in C#?

    - by Ole Jak
    How to read the metadata of a MKV movie files in C# (or C or C++ or AS3)? for example such creator metadatacreator hasKeyframes hasVideo hasAudio hasMetaData canSeekToEnd duration datasize videosize videocodecid audiosize audiocodecid audiosamplerate audiosamplesize stereo filesize lasttimestamp lastkeyframetimestamp lastkeyframelocation keyframes (filepositions, times) width height framerate videodatarate audiodatarate

    Read the article

  • Problem with variable inside gsp

    - by xain
    Hi, I have a loop inside a gsp page, and I want to do a calculation on the fly, so I set a variable: <g:set var="total" value="0" /> And in the loop: <g:each in="${mob}" var="m"> ... <g:set var="total" value="${total+(m.q*m.sts.uf)}"/> ... </g:each> The "total" value does not correspond to the expected calculation. m.q is an integer, and m.sts.uf is a float. Any hints ? Thanks.

    Read the article

  • Key logging in .NET

    - by Moshe
    Is it possible to write a key logger in Visual Basic.NET? Is this the right language to be using? So far, I've gotten a console app to read input and append to a file. 1)How can I make a .NET program "catch" all keyboard input? 2)How do I make a process not show up in Task Manager? This is not for a virus, but rather a parental control program for a specific clientele. No malicious intent here.

    Read the article

  • How do you set the sitemap priority for flatpages in django?

    - by mlissner
    I have a site with about 60,000 pages that are getting placed in the sitemap, and which have a priority of 0.3. These are all really long pages that are rich in keywords. I also have a few pages (like the about page), that need high priority, but which I've implemented with the django flatpages framework. Is it possible for pages created this way to have a higher priority in the sitemap?

    Read the article

  • c# hierarchy collection library? - anyone know of one (e.g. GetDirectChildren, GetAllChildren, GetPa

    - by Greg
    Hi, Does anyone know of a solid C# library / approach to manage a hierarchy/web type collection? This would be a library that would basic consist of the concept of nodes & relationships, for example to model web pages/files linked under a URL, or modeling IT infrastructure. It would have key methods such as: Node.GetDirectParents() Node.GetRootParents() Node.GetDirectChildren() Node.GetAllChildren() So it's smarts would include the ability to "walk the tree" of nodes based on the relationships when someone does ask for "give me all the children under this node" for example. It ideally include a persistence layer, to save/retrieve such data to/from a databases (e.g. with a Nodes and Relationships table). Thanks

    Read the article

  • UIToolbar on top of navigation bar - black opaque doesn't blend

    - by z s
    I am trying to put a UIToolbar on the right side of a UINavigationBar, to add multiple buttons on that side. When I leave the tint of both to Default, they blend fine. But when I set both of them to BlackOpaque, they don't blend very well. I can see the edge of where the toolbar starts very clearly. I've tried this through IB and code. Same result in both cases. Anyone run into this before, or can offer some suggestions?

    Read the article

  • Django 5 star Reviews

    - by firststepofthejourney
    Hello All, I am new to programming and I just jumped in to Django and I need a bit of help. I downloaded the generic reviews model off of Google code and I have no clue how to implement it. Can anyone pass along some guidance on how to make this work with a 5 star ratings system? I would appreciate it. Thanks.

    Read the article

  • How to hide labels in html

    - by user225269
    I have this code which depends on this javascript from dynamic drive: http://dynamicdrive.com/dynamicindex16/formdependency.htm Its a form dependency manager. Which will show or hide elements depending on what you choose from the forms that are revealed: I don't know why but If I alter the code from this: <td> <label>ID Number<input type="checkbox" name="id" class="DEPENDS ON info BEING student"></label> </td> </tr> To this: <td> <input type="hidden" class="DEPENDS ON info BEING student"> <label style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 3px silver groove;"></label> <tr> <td> <input type="checkbox" name="id" class="DEPENDS ON info BEING student"><label>ID Number</label> </td> </tr> Note: The only change that I did here is to transfer the label from the left side of the checkbox to the right side so that they will look better. But when I do this. The labels will be visible even if I did not yet click on the button that will make it visible(but without the checkboxes). And when I click on that button, that's the only time when the checkbox will appear on the left side of the labels. The checkbox is ok, but the label is not. And the javascript is working properly. What do I do so that the checkbox and label will go together?

    Read the article

  • Presentations about SARGability tomorrow

    - by Rob Farley
    Tomorrow, via LiveMeeting, I’m giving two presentations about SARGability. That’s April 27th , for anyone reading this later. The first will be at the Adelaide SQL Server User Group . If you’re in Adelaide, you should definitely come along. Both meetings are being broadcast to the PASS AppDev Virtual Chapter . The second will be in the Adelaide evening at 9:30pm, and will just be and my computer. The audience will be on the other end of a phone-line, which is very different for me. I’m very much...(read more)

    Read the article

  • Disturbing or politically incorrect classes

    - by Jonas B
    Please don't take this seriously! - Community wikied Satire is always fun. Try to come up with the most shocking, disturbing or politically incorrect class you can think of. (But please no racism or anything seriously offensive or anything that can't be interpeted as satire). I'll go first with my example: public class Person { public bool Female; public Person(bool female) { Female = female; } public static bool operator <(Person j1, Person j2) { if (j1.Female && !j2.Female) return true; else return false; } public static bool operator >(Person j1, Person j2) { if (!j1.Female && j2.Female) return true; else return false; } public static bool operator <=(Person j1, Person j2) { if ((j1.Female == j2.Female) || (j1.Female && !j2.Female)) return true; else return false; } public static bool operator >=(Person j1, Person j2) { if ((j1.Female == j2.Female) || (!j1.Female && j2.Female)) return true; else return false; } }

    Read the article

  • Finding Last Fired time using a Cron Expression in Java

    - by a-sak
    Is there a way in Java to find the "Last Fired Time" from a Cron Expression. E.g. If now = 25-Apr-2010 10pm, cron expression "0 15 10 ? * *" (quartz) should return me 25-Apr-2010 10:15am I do not care if we use standard cron expressions (like Unix and Quartz) or less popular ones if they can fetch me the correct "Last Fired Time"

    Read the article

  • How to implement "select sum()" in Grails

    - by xain
    I have a relationship like this: class E { string name hasMany = [me:ME] } class M { float price } class ME { E e M m int quantity } And I'd hate to iterate to achieve this: "obtain the sum of the quantity in ME times the price of the corresponding M for a given E". Any hints on how to implement it using GORM/HQL ? Thanks in advance

    Read the article

  • how to update a record without worrying about primary key

    - by railsnew
    In ActiveRecord how can we update a record without worrying/knowing primary key. If I do Address.update(15, :user_name => 'Samuel') it corresponds to UPDATE addresses set user_name = 'Samuel' where id = 15 but what if i want to do: UPDATE addresses set user_name = 'Samuel' where cid = 15 what will be the ActiveRecord equivalent of that?? I tried: Address.update({:cid => 15}, :user_name => 'Samuel') but that does not work.

    Read the article

  • Java EE 6 - ordering Servlet Request Listeners

    - by Walter White
    Hi all, I finally updated to Java EE 6 (web profile) and would like to control the ordering of my servlet request listeners. I did that before through the XML ordering by listing the listeners in a particular order. Now, I have placed the @WebListener annotation on the classes which are listeners and am trying to figure out how to order the listeners such that they work properly. One must run before another one, otherwise, it won't have the information it needs and won't work. Also, it doesn't seem my listeners are actually being invoked even though they're marked with @WebListener. I am running embedded glassfish 3.0. Another question that is somewhat related - ServletRequestListeners in Java EE 6 by default are still synchronous meaning they're hit first, then servlet filters, right? ServletRequestListeners are not asynchronous where they merely get notified of an event without interrupting the execution? Walter

    Read the article

  • Garbage Collection leak? Scripting Bridge leak?

    - by Y.Vera
    Hello everyone! I'm always really picky about memory leaks and I cannot understand why my garbage collected application leaks. My code is entirely memory-managed and it runs great without garbage collection, not a single leak. However, as soon as I turn on garbage collection it leaks! Just to prove a point, why does this leak in a garbage collected app? (place this dummy code at applicationDidFinishLaunching:) NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel beginSheetModalForWindow:window completionHandler:^(NSInteger result) {NSBeep();}]; Also, is there a way to prevent leaks in apps (garbage collected or otherwise) that use Scripting Bridge? it seems as if they all leak, even the sample ones in xcode. Thanks everybody!

    Read the article

  • relational database: how to design this table

    - by donpal
    I'm a database newbie designing a database. I'll use SO to ask my question because it's easier to ask it on something that you can see already, but it's not the same, it will just help me understand the right approach. As you can see, there are many questions here and each can have many answers. How should I store the answers in a table? Should I store all the answers in the SAME table with a unique id (make it the key) and just a new field for the question id? What if there are 100,000 answers like there is here? Do I still store them in 1 table? What keys should I use to minimize search time when I want to search for the answers of a specific question? The database is both read and write if that makes any difference in this case.

    Read the article

  • Sending commands to a console program from Visual Basic 6

    - by DomingoSL
    I have a console program on windows (a compiled version of curl command line) in where you can write commands and have a return. How can i send commands to this console application and return the result to VB6??? i know you can do this with DOS commands with Windows Script Host but as you see the commands i want to run dont are in command.exe Thanks!

    Read the article

  • Magento - zend - backend error

    - by user325659
    I get the following error when i am logged into the backend in magento Fatal error: Interface 'Zend_Http_Client_Adapter_Interface' not found in /homepages/45/d210005774/htdocs/websitename/lib/Varien/Http/Adapter/Curl.php on line 176 Also i got this error previously in my index management section in magento Fatal error: Call to undefined method Zend_Locale_Data::disableCache() in /homepages/45/d210005774/htdocs/websitename/lib/Zend/Locale/Format.php on line 153 Could anyone help me out with this? I think the problem is to do with zend framework but i am not sure whats causing this

    Read the article

  • Problem with altering model attributes in controller

    - by SpawnCxy
    Hi all, Today I've got a problem when I tried using following code to alter the model attribute in the controller function userlist($trigger = 1) { if($trigger == 1) { $this->User->useTable = 'betausers'; //'betausers' is completely the same structure as table 'users' } $users = $this->User->find('all'); debug($users); } And the model file is class User extends AppModel { var $name = "User"; //var $useTable = 'betausers'; function beforeFind() //only for debug { debug($this->useTable); } } The debug message in the model showed the userTable attribute had been changed to betausers.And It was supposed to show all records in table betausers.However,I still got the data in the users,which quite confused me.And I hope someone can show me some directions to solve this problem. Regards

    Read the article

  • Using Unity – Part 4

    - by nmarun
    In this part, I’ll be discussing about constructor and property or setter injection. I’ve created a new class – Product3: 1: public class Product3 : IProduct 2: { 3: public string Name { get; set; } 4: [Dependency] 5: public IDistributor Distributor { get; set; } 6: public ILogger Logger { get; set; } 7:  8: public Product3(ILogger logger) 9: { 10: Logger = logger; 11: Name = "Product 1"; 12: } 13:  14: public string WriteProductDetails() 15: { 16: StringBuilder productDetails = new StringBuilder(); 17: productDetails.AppendFormat("{0}<br/>", Name); 18: productDetails.AppendFormat("{0}<br/>", Logger.WriteLog()); 19: productDetails.AppendFormat("{0}<br/>", Distributor.WriteDistributorDetails()); 20: return productDetails.ToString(); 21: } 22: } This version has a property of type IDistributor and takes a constructor parameter of type ILogger. The IDistributor property has a Dependency attribute (Microsoft.Practices.Unity namespace) applied to it. IDistributor and its implementation are shown below: 1: public interface IDistributor 2: { 3: string WriteDistributorDetails(); 4: } 5:  6: public class Distributor : IDistributor 7: { 8: public List<string> DistributorNames = new List<string>(); 9:  10: public Distributor() 11: { 12: DistributorNames.Add("Distributor1"); 13: DistributorNames.Add("Distributor2"); 14: DistributorNames.Add("Distributor3"); 15: DistributorNames.Add("Distributor4"); 16: } 17: public string WriteDistributorDetails() 18: { 19: StringBuilder distributors = new StringBuilder(); 20: for (int i = 0; i < DistributorNames.Count; i++) 21: { 22: distributors.AppendFormat("{0}<br/>", DistributorNames[i]); 23: } 24: return distributors.ToString(); 25: } 26: } ILogger and the FileLogger have the following definition: 1: public interface ILogger 2: { 3: string WriteLog(); 4: } 5:  6: public class FileLogger : ILogger 7: { 8: public string WriteLog() 9: { 10: return string.Format("Type: {0}", GetType()); 11: } 12: } The Unity container creates an instance of the dependent class (the Distributor class) within the scope of the target object (an instance of Product3 class that will be called by doing a Resolve<IProduct>() in the calling code) and assign this dependent object to the attributed property of the target object. To add to it, property injection is a form of optional injection of dependent objects.The dependent object instance is generated before the container returns the target object. Unlike constructor injection, you must apply the appropriate attribute in the target class to initiate property injection. Let’s see how to change the config file to make this work. The first step is to add all the type aliases: 1: <typeAlias alias="Product3" type="ProductModel.Product3, ProductModel"/> 2: <typeAlias alias="ILogger" type="ProductModel.ILogger, ProductModel"/> 3: <typeAlias alias="FileLogger" type="ProductModel.FileLogger, ProductModel"/> 4: <typeAlias alias="IDistributor" type="ProductModel.IDistributor, ProductModel"/> 5: <typeAlias alias="Distributor" type="ProductModel.Distributor, ProductModel"/> Now define mappings for these aliases: 1: <type type="ILogger" mapTo="FileLogger" /> 2: <type type="IDistributor" mapTo="Distributor" /> Next step is to define the constructor and property injection in the config file: 1: <type type="IProduct" mapTo="Product3" name="ComplexProduct"> 2: <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration"> 3: <constructor> 4: <param name="logger" parameterType="ILogger" /> 5: </constructor> 6: <property name="Distributor" propertyType="IDistributor"> 7: <dependency /> 8: </property> 9: </typeConfig> 10: </type> There you see a constructor element that tells there’s a property named ‘logger’ that is of type ILogger. By default, the type of ILogger gets resolved to type FileLogger. There’s also a property named ‘Distributor’ which is of type IDistributor and which will get resolved to type Distributor. On the calling side, I’ve added a new button, whose click event does the following: 1: protected void InjectionButton_Click(object sender, EventArgs e) 2: { 3: unityContainer.RegisterType<IProduct, Product3>(); 4: IProduct product3 = unityContainer.Resolve<IProduct>(); 5: productDetailsLabel.Text = product3.WriteProductDetails(); 6: } This renders the following output: This completes the part for constructor and property injection. In the next blog, I’ll talk about Arrays and Generics. Please see the code used here.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >