Search Results

Search found 2532 results on 102 pages for 'ben stock'.

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

  • Best way to implement a List(Of) with a maximum number of items

    - by Ben
    I'm trying to figure out a good way of implementing a List(Of) that holds a maximum number of records. e.g. I have a List(Of Int32) - it's being populated every 2 seconds with a new Int32 item. I want to store only the most current 2000 items. How can I make the list hold a maximum of 2000 items, then when the 2001'th item is attempted to be added, the List drops the 2000'th item (resulting in the current total being 1999). Thing is, I need to make sure I'm dropping only the oldest item and adding a new item into the List. Ben

    Read the article

  • Can I use LGA775 heatsink on LGA1156 CPU?

    - by Ghostrider
    Will cooler that is designed to LGA775 CPUs install on LGA1156 CPU or are they mechanically incompatible? I'm building my first 1U server and surprise-surprise - Intel stock cooler doesn't fit (unless I'm willing to keep the case open). Places that I prefer to buy stuff from are currently out of stock on 1U 1156 heatsinks so I'm wondering if LGA775 would do the trick.

    Read the article

  • Cisco ASA 5510 shortage?

    - by PHLiGHT
    Has anyone else had problems ordering them recently? Our main vendors have had them out of stock for awhile now and we need to buy a couple. Any known places where they are in stock or why the shortage?

    Read the article

  • Get list of Unique many-to-many records from a queryset

    - by rsp
    My models: class Order(models.Model): ordered_by = models.ForeignKey(User) reasons = models.ManyToManyField(Reason) class Reason(models.Model): description = models.CharField() Basically a user creates an order and gives reasons for that order. ie, john has two orders (one for pencils because he is out AND because he doesn't like his current stock. a second order for pens because he is out). I want to print a list out of all reasons a user has placed his orders. So under john, it should print "he is out", "he doesn't like his current stock"; those two lines only. If I simply select all of john's orders, iterate through them and print out their "reasons" it'll print "he is out", "he doesn't like his current stock" and then "he is out" again. I don't want these duplicate values. How do I select a list of his reasons for ALL his orders so that the list has all unique rows?

    Read the article

  • How to create a backpropagation neural network in neurondonet?

    - by Suraj Prakash
    I am doing stock market prediction using ANNs in c#.net. I am using NeuronDotNet for the neural part. I have to give eight inputs to the network, with a hidden layer consisting 8 nodes and a single node output layer. Can anybody please give me some coding ideas for this???? This project was not a AI course assignment, but my major project. I have studied about the stocks and found various factors that affected the future value of stock of a company. Now I have to use these factors as input to the neural network. I am not getting into how to implement these factors in the neural network. I have just decided to use those eight factors as eight nodes in the input layer but things are going complex. My concern is to use these factors as input and train the neural network for output as next day's stock value. What major things should I have to care about??

    Read the article

  • Need to work out database structure

    - by jim smith
    Hi, Just need a little kickstart with this. I have Mysql/PHP, and I have 5,000 products. I have 30 companies I need to store some data for those 30 companies for each product as follows: a) prices b) stock qty I also need to store data historically on a daily basis. So the table... It makes sense that the records will be the products because there's 5000, and if I put the companies as the columns, I can store the prices, but what about the stock quantities? I could create two columns for each compoany, one for prices, one for qty. Then make the tablename the date for that day...so theer would be a new table for every day with 5000 products in it? is this the correct way? Some idea on how I'll be retreiving data the top 5 lowest prices (and the company) by product for a certain date the price and stock changes in the past 7 days by product

    Read the article

  • django modeling

    - by SledgehammerPL
    Concept: Drinks are made of components. E.g. 10ml of Vodka. In some receipt the component is very particular (10ml of Finlandia Vodka), some not (10 ml of ANY Vodka). I wonder how to model a component to solve this problem - on stock I have particular product, which can satisfy more requirements. The model for now is: class Receipt(models.Model): name = models.CharField(max_length=128) (...) components = models.ManyToManyField(Product, through='ReceiptComponent') def __unicode__(self): return self.name class ReceiptComponent(models.Model): product = models.ForeignKey(Product) receipt = models.ForeignKey(Receipt) quantity = models.FloatField(max_length=9) unit = models.ForeignKey(Unit) class Admin: pass def __unicode__(self): return unicode(self.quantity!=0 and self.quantity or '') + ' ' + unicode(self.unit) + ' ' + self.product.genitive class Product(models.Model): name = models.CharField(max_length = 128) (...) class Admin: pass def __unicode__(self): return self.name class Stock(Store): products = models.ManyToManyField(Product) class Admin: pass def __unicode__(self): return self.name I think about making some table which joins real product (on stock) with abstract product (receiptcomponent). But maybe there's easy solution?

    Read the article

  • How to send an array(multidimensional/associative) and some varaibles together through json?

    - by I Like PHP
    i have an multidimensional array $ouptput=Array ( [0] => Array ( [0] => mov_1 [1] => MY FAIR LADY ) [1] => Array ( [1] => mov_10 [2] => love actually ) ) and two variables $avlblQnty=50 $success= true when i send these data via json echo json_encode( array('movieData'=>$output,'stock'=>$avlblQnty,'sucess'=>$success)); it returns {"movieData":[["mov_1","MY FAIR LAD],{"1":"mov_10","2":"love actually"}],"stock":0,"success":true} but i need json encoded data properly so that i can create an select box on movieData using(movieData.length), so for that i want json edcoded data in below format so that i can retrive successfully {"movieData":[{"mov_1":"MY FAIR LAD,mov_10":"love actually"}],"stock":0,"success":true} i want to know how to send an array(multidimensional/associative) and some varaibles together through json?

    Read the article

  • How can I apply indexer to Dictionary VALUES (C#3.0)

    - by Newbie
    I have done a program string[] arrExposureValues = stock.ExposureCollection[dt] .Values.ToArray(); for(int i=0;i<arrExposureValues .length;i++) Console.WriteLine(arrExposureValues[i]); Nothing wrong and works fine. But is it possible to do something like the below for(int i=0;i<stock.ExposureCollection[dt].Count;i++) Console.WriteLine(stock.ExposureCollection[dt].Values[i]); This is just for my sake of knowledge (Basically trying to accomplish the same in one line). Note: ExposureCollection is a dictionary object Dictionary<DateTime, Dictionary<string, string>> First of all I have the doubt if it is at all possible! I am using C#3.0. Thanks.

    Read the article

  • How can I apply indexer to Dictionary.Values (C# 3.0)

    - by Newbie
    I have done a program string[] arrExposureValues = stock.ExposureCollection[dt].Values.ToArray(); for(int i = 0; i < arrExposureValues.Length; i++) Console.WriteLine(arrExposureValues[i]); Nothing wrong and works fine. But is it possible to do something like the below for(int i = 0; i < stock.ExposureCollection[dt].Count; i++) Console.WriteLine(stock.ExposureCollection[dt].Values[i]); This is just for my sake of knowledge (Basically trying to accomplish the same in one line). Note: ExposureCollection is Dictionary<DateTime, Dictionary<string, string>> First of all I have the doubt if it is at all possible! I am using C# 3.0. Thanks.

    Read the article

  • How to target specific letter/word with jquery?

    - by Gal
    As a mere example, I want to apply the class "fancy" to all occurrences of the sign "&" in the document. The CSS: .fancy { font-style: italic; } So a text that looks like this: Ben & Jerry's would be manipulated by jquery to this: Ben <span class="fancy">&</span> Jerry's Is there a function to target specific words/phrases/letters like this?

    Read the article

  • How to merge two single column csv files with linux commands

    - by user1328191
    I was wondering how to merge two single column csv files into one file where the resulting file will contain two columns. file1.csv    first_name    chris    ben    jerry file2.csv    last_name    smith    white    perry result.csv    first_name,last_name    chris,smith    ben,white    jerry,perry Thanks

    Read the article

  • Combining Searchlogic named scopes with OR

    - by jaycode
    Is something like this possible? Product.price_greater_than(10000).or_tags_name_equals('luxury') The wiki doesn't help much on this... I saw in the wiki: User.id_or_age_lt_or_username_or_first_name_begins_with(10) => "id < 10 OR age < 10 OR username LIKE 'ben%' OR first_name like'ben%'" I really don't get that, how in the world did "ben" comes up??? could anyone help please?

    Read the article

  • Allowing the specific format of email address in MVC input

    - by user219315
    Hi I have a page in MVC where i want to take the email adddress as the input which can be of format like:"Jone Davi" <[email protected]>, "Ben Miller" <[email protected]>, "Jane Ton" <[email protected]>, Then from this I want to parse the valid emailaddress.But on click of the submit button getting error message" A potentially dangerous Request.Form value was detected from the client " Thus is there any way to take the input of email address in above format and bypass the security error for that specific page. Thanks in advance.

    Read the article

  • ASP.NET PowerShell Impersonation

    - by Ben
    I have developed an ASP.NET MVC Web Application to execute PowerShell scripts. I am using the VS web server and can execute scripts fine. However, a requirement is that users are able to execute scripts against AD to perform actions that their own user accounts are not allowed to do. Therefore I am using impersonation to switch the identity before creating the PowerShell runspace: Runspace runspace = RunspaceFactory.CreateRunspace(config); var currentuser = WindowsIdentity.GetCurrent().Name; if (runspace.RunspaceStateInfo.State == RunspaceState.BeforeOpen) { runspace.Open(); } I have tested using a domain admin account and I get the following exception when calling runspace.Open(): Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Requested registry access is not allowed. The web application is running in full trust and I have explicitly added the account I am using for impersonation to the local administrators group of the machine (even though the domain admins group was already there). I'm using advapi32.dll LogonUser call to perform the impersonation in a similar way to this post (http://blogs.msdn.com/webdav_101/archive/2008/09/25/howto-calling-exchange-powershell-from-an-impersonated-thead.aspx) Any help appreciated as this is a bit of a show stopper at the moment. Thanks Ben

    Read the article

  • UIView rotation, modal view lanscape and portrait, parent fails to render

    - by Ben
    Hi everyone, I've hit a bit of a roadblock with something that I hope that someone in here can help me out with. I'll describe the 'state of play' first, and then what the issue is, so here goes; I have a series of view controllers that are chained together with a Navigation Controller (this works just fine), All of these view controllers support portrait mode only (by design), In one of the view controllers (the 'end' one actually) the user can click a table cell to pop up a modal view controller (using presentModalViewController(...) of course) This modal view controller supports portrait and landscape modes (and this works), When the user clicks the 'Done' button on this modal view controller we pop and pass control back to the parent view controller, however; If the user is in portrait mode when they click 'Done' then the parent displays itself just fine, If the user is in landscape mode when they click 'Done' then the parent displays a totally white, blank screen (that covers the whole screen). It is as if the controller does not know how to render in landscape and just doesn't bother. I'd like to be able to have this parent view render in portrait no matter what the orientation of the phone is when the user clicks the 'Done' button. Various forum posts suggest using the UIDevice method 'setOrientation' (but this is undocumented and will get our app rejected apparently). Another suggestion was to set the 'statusBarOrientation' to portrait in the 'viewWillAppear' method but that had no effect. So I am a bit stuck! Has any encountered anything like this before? If need be I can provide code, if that will help anyone diagnose the problem for me. Thanks in advance! Cheers, Ben

    Read the article

  • VB.Net plugin using Matlab COM Automation Server...Error: 'Could not load Interop.MLApp'

    - by Ben
    My Problem: I am using Matlab COM Automation Server to call and execute matlab .m files from a VB.Net plugin for a CAD program called Rhino 3D. The code works flawlessly when set up as a simple Windows Application in Visual Studio, but when I insert it (and make the requisite reference) into my .Net plugin and test it in the CAD program I get the following error: "Could not load file or assembly 'Interop.MLApp, Version 1.0.0.0, culture=neutral, PublicKeyToken=null' or one of its dependencies. the system cannot find the file specified." What I've Tried: I am baffled as to why this occurs, but I was able to contact the CAD program's technical support staff and they suggested that it has something to do with their DotNet SDK having trouble with references that are located far outside the CAD program directory. They didn't have any solutions so I tried playing around with copylocal and this made no difference. I tried using other COM libraries and the Open Office automation server works fine, although uses url's instead of requiring a reference. I also tested Excel, which does require a reference, and it returned the error: "retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154." This may or may not be related to the issue with the Matlab COM reference, but I thought was worthwhile to share. Perhaps is there another way to reference Interop.MLApp? I would appreciate any suggestions or thoughts on how I might make the Matlab Interop.MLApp reference work. Best regards, Ben

    Read the article

  • Singletons, thread safety and structuremap

    - by Ben
    Hi, Currently I have the following class: public class PluginManager { private static bool s_initialized; private static object s_lock = new object(); public static void Initialize() { if (!s_initialized) { lock (s_lock) { if (!s_initialized) { // initialize s_initialized = true; } } } } } The important thing here is that Initialize() should only be executed once whilst the application is running. I thought that I would refactor this into a singleton class since this would be more thread safe?: public sealed class PluginService { static PluginService() { } private static PluginService _instance = new PluginService(); public static PluginService Instance { get { return _instance; } } private bool s_initialized; public void Initialize() { if (!s_initialized) { // initialize s_initialized = true; } } } Question one, is it still necessary to have the lock here (I have removed it) since we will only ever be working on the same instance? Finally, I want to use DI and structure map to initialize my servcices so I have refactored as below: public interface IPluginService { void Initialize(); } public class NewPluginService : IPluginService { private bool s_initialized; public void Initialize() { if (!s_initialized) { // initialize s_initialized = true; } } } And in my registry: ForRequestedType<IPluginService>() .TheDefaultIsConcreteType<NewPluginService>().AsSingletons(); This works as expected (singleton returning true in the following code): var instance1 = ObjectFactory.GetInstance<IPluginService>(); var instance2 = ObjectFactory.GetInstance<IPluginService>(); bool singleton = (instance1 == instance2); So my next question, is the structure map solution as thread safe as the singleton class (second example). The only downside is that this would still allow NewPluginService to be instantiated directly (if not using structure map). Many thanks, Ben

    Read the article

  • C# Application Calling Powershell Script Issues

    - by Ben
    Hi, I have a C# Winforms application which is calling a simple powershell script using the following method: Process process = new Process(); process.StartInfo.FileName = @"powershell.exe"; process.StartInfo.Arguments = String.Format("-noexit \"C:\Develop\{1}\"", scriptName); process.Start(); The powershell script simply reads a registry key and outputs the subkeys. $items = get-childitem -literalPath hklm:\software foreach($item in $items) { Write-Host $item } The problem I have is that when I run the script from the C# application I get one set of results, but when I run the script standalone (from the powershell command line) I get a different set of results entirely. The results from running from the c# app are: HKEY_LOCAL_MACHINE\software\Adobe HKEY_LOCAL_MACHINE\software\Business Objects HKEY_LOCAL_MACHINE\software\Helios HKEY_LOCAL_MACHINE\software\InstallShield HKEY_LOCAL_MACHINE\software\Macrovision HKEY_LOCAL_MACHINE\software\Microsoft HKEY_LOCAL_MACHINE\software\MozillaPlugins HKEY_LOCAL_MACHINE\software\ODBC HKEY_LOCAL_MACHINE\software\Classes HKEY_LOCAL_MACHINE\software\Clients HKEY_LOCAL_MACHINE\software\Policies HKEY_LOCAL_MACHINE\software\RegisteredApplications PS C:\Develop\RnD\SiriusPatcher\Sirius.Patcher.UI\bin\Debug When run from the powershell command line I get: PS M: C:\Develop\RegistryAccess.ps1 HKEY_LOCAL_MACHINE\software\ATI Technologies HKEY_LOCAL_MACHINE\software\Classes HKEY_LOCAL_MACHINE\software\Clients HKEY_LOCAL_MACHINE\software\Equiniti HKEY_LOCAL_MACHINE\software\Microsoft HKEY_LOCAL_MACHINE\software\ODBC HKEY_LOCAL_MACHINE\software\Policies HKEY_LOCAL_MACHINE\software\RegisteredApplications HKEY_LOCAL_MACHINE\software\Wow6432Node PS M: The second set of results match what I have in the registry, but the first set of results (which came from the c# app) don't. Any help or pointers would be greatly apreciated :) Ben

    Read the article

  • Building Cross Platform app - recommendation

    - by Ben
    Hi, I need to build a fairly simple app but it needs to work on both PC and Mac. It also needs to be redistributable on a disc or usb drive as a standalone desktop app. Initially I thought AIR would be perfect for this (it ticks all the API requirements), but the difficulty is making it distributable, as the app would require the AIR runtime to be installed to run. I came across Shu Player as an option as it seems to be able to package the AIR runtime with the app and do a (silent?) install. However this seems to break the T&C from Adobe (as outlined here) so I'm not sure about the legality. Another option could be Zinc but I haven't tested it so I'm not sure how well it'll fit the bill. What would you recommend or suggest I check out? Any suggestion much appreciated EDIT: There's a few more discussions on mono usage (though no real conclusion): Here and Here EDIT2: Titanium could also fit the bill maybe, will check it out. Any more comments from anyone? Ben

    Read the article

  • How can I implement NHibernate session per request without a dependency on NHibernate?

    - by Ben
    I've raised this question before but am still struggling to find an example that I can get my head around (please don't just tell me to look at the S#arp Architecture project without at least some directions). So far I have achieved near persistance ignorance in my web project. My repository classes (in my data project) take an ISession in the constructor: public class ProductRepository : IProductRepository { private ISession _session; public ProductRepository(ISession session) { _session = session; } In my global.asax I expose the current session and am creating and disposing session on beginrequest and endrequest (this is where I have the dependency on NHibernate): public static ISessionFactory SessionFactory = CreateSessionFactory(); private static ISessionFactory CreateSessionFactory() { return new Configuration() .Configure() .BuildSessionFactory(); } protected MvcApplication() { BeginRequest += delegate { CurrentSessionContext.Bind(SessionFactory.OpenSession()); }; EndRequest += delegate { CurrentSessionContext.Unbind(SessionFactory).Dispose(); }; } And finally my StructureMap registry: public AppRegistry() { For<ISession>().TheDefault .Is.ConstructedBy(x => MvcApplication.SessionFactory.GetCurrentSession()); For<IProductRepository>().Use<ProductRepository>(); } It would seem I need my own generic implementations of ISession and ISessionFactory that I can use in my web project and inject into my repositories? I'm a little stuck so any help would be appreciated. Thanks, Ben

    Read the article

  • unordered lists as columns

    - by Ben
    I am trying to use unordered lists as columns something setup like the following: <ul> <li>word 1</li> <li>word 1</li> <li>word 1</li> <li>word 1</li> <li>word 1</li> </ul> <ul> <li>word 2</li> <li>word 2</li> <li>word 2</li> <li>word 2</li> <li>word 2</li> </ul> What would I need to do as far as css these to lineup side by side as vertical lists with no bullets. I'm sure I'm missing something simple but I can't seem to figure it out. I specifically need this to work in IE7. Thanks in advance, Ben

    Read the article

  • ASP.NET MembershipProvider and StructureMap

    - by Ben
    I was using the default AspNetSqlMembershipProvider in my application. Authentication is performed via an AuthenticationService (since I'm also supporting other forms of membership like OpenID). My AuthenticationService takes a MembershipProvider as a constructor parameter and I am injecting the dependency using StructureMap like so: For<MembershipProvider>().Use(Membership.Provider); This will use the MembershipProvider configured in web.config. All this works great. However, now I have rolled my own MembershipProvider that makes use of a repository class. Since the MembershipProvider isn't exactly IoC friendly, I added the following code to the MembershipProvider.Initialize method: _membershipRepository = ObjectFactory.GetInstance<IMembershipRepository>(); However, this raises an exception, like StructureMap hasn't been initialized (cannot get instance of IMembershipRepository). However, if I remove the code and put breakpoints at my MembershipProvider's initialize method and my StructureMap bootstrapper, it does appear that StructureMap is configured before the MembershipProvider is initialized. My only workaround so far is to add the above code to each method in the MembershipProvider that needs the repository. This works fine, but I am curious as to why I can't get my instance in the Initialize method. Is the MembershipProvider performing some internal initialization that runs before any of my own application code does? Thanks Ben

    Read the article

  • Querying a self referencing join with NHibernate Linq

    - by Ben
    In my application I have a Category domain object. Category has a property Parent (of type category). So in my NHibernate mapping I have: <many-to-one name="Parent" column="ParentID"/> Before I switched to NHibernate I had the ParentId property on my domain model (mapped to the corresponding database column). This made it easy to query for say all top level categories (ParentID = 0): where(c => c.ParentId == 0) However, I have since removed the ParentId property from my domain model (because of NHibernate) so I now have to do the same query (using NHibernate.Linq) like so: public IList<Category> GetCategories(int parentId) { if (parentId == 0) return _catalogRepository.Categories.Where(x => x.Parent == null).ToList(); else return _catalogRepository.Categories.Where(x => x.Parent.Id == parentId).ToList(); } The real impact that I can see, is the sql generated. Instead of a simple 'select x,y,z from categories where parentid = 0' NHibernate generates a left outer join: SELECT this_.CategoryId as CategoryId4_1_, this_.ParentID as ParentID4_1_, this_.Name as Name4_1_, this_.Slug as Slug4_1_, parent1_.CategoryId as CategoryId4_0_, parent1_.ParentID as ParentID4_0_, parent1_.Name as Name4_0_, parent1_.Slug as Slug4_0_ FROM Categories this_ left outer join Categories parent1_ on this_.ParentID = parent1_.CategoryId WHERE this_.ParentID is null Which doesn't seems much less efficient that what I had before. Is there a better way of querying these self referencing joins as it's very tempting to drop the ParentID back onto my domain model for this reason. Thanks, Ben

    Read the article

  • Problem with WPF Data Binding Defined in Code Not Updating UI Elements

    - by Ben
    I need to define new UI Elements as well as data binding in code because they will be implemented after run-time. Here is a simplified version of what I am trying to do. Data Model: public class AddressBook : INotifyPropertyChanged { private int _houseNumber; public int HouseNumber { get { return _houseNumber; } set { _houseNumber = value; NotifyPropertyChanged("HouseNumber"); } } public event PropertyChangedEventHandler PropertyChanged; protected void NotifyPropertyChanged(string sProp) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(sProp)); } } } Binding in Code: AddressBook book = new AddressBook(); book.HouseNumber = 123; TextBlock tb = new TextBlock(); Binding bind = new Binding("HouseNumber"); bind.Source = book; bind.Mode = BindingMode.OneWay; tb.SetBinding(TextBlock.TextProperty, bind); // Text block displays "123" myGrid.Children.Add(tb); book.HouseNumber = 456; // Text block displays "123" but PropertyChanged event fires When the data is first bound, the text block is updated with the correct house number. Then, if I change the house number in code later, the book's PropertyChanged event fires, but the text block is not updated. Can anyone tell me why? Thanks, Ben

    Read the article

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