Daily Archives

Articles indexed Friday May 21 2010

Page 5/114 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to implement an ListView containing images with style

    - by Alexandergre
    So I have been working with an app where I need to show the thumbnails as clean and use the space in a good way. Style A is my work until now. What I want to accomplish is something like style B. no titles and use the space in a good way. I need help with this. there was no tutorial on the net. Is ListView able to do such a thing? or shall I make picturesboxes and put them in a scrollview? the code: private void button1_Click(object sender, EventArgs e) { ImageList myImageList = new ImageList(); myImageList.ImageSize = new Size(48, 48); DirectoryInfo dir = new DirectoryInfo(@"C:\img"); foreach (FileInfo file in dir.GetFiles()) { try { myImageList.Images.Add(Image.FromFile(file.FullName)); } catch { Console.WriteLine("This is not an image file"); } } myListView.LargeImageList = myImageList; myListView.Items.Add("a", 0); myListView.Items.Add("b", 1); myListView.Items.Add("c", 2);

    Read the article

  • ubuntu-10.04-desktop-i386 does not work with HTTP preseed?

    - by netvope
    Installation media: ubuntu-10.04-desktop-i386.iso I tried a lot of different boot parameters, but either the installer ignored the preseed configuration, or it boot itself directly as LiveCD. An example of the boot parameters I've tried: auto url=http://mydomain.com/path/preseed.cfg boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- If I remove only-ubiquity, it boots as a LiveCD. If I remove boot=casper, it won't boot. If I add vga=normal locale=en_US console-setup/layoutcode=us console-setup/ask_detect=false interface=auto, it still can't do automatic install. If I remove auto, it's the same. What is the correct boot parameters for launching such an installation? From the apache log of the server hosting preseed.cfg, I see that the installer has no problems fetching the preseed file. My preseed file is almost identical to the one at https://help.ubuntu.com/10.04/installation-guide/example-preseed.txt. Moreover, I have run debconf-set-selections -c preseed.cfg to ensure that the preseed file is correct.

    Read the article

  • DNS request times out then succeeds on my local network. Why?

    - by Dan
    I have a W2K3 Server that is the Domain Controller and also the DNS server. I wanted to make another DNS zone on my network called "something.local" and then make 'A' records to point requests like 'admin.something.local' and 'www.something.local' to machines on my network. I keep getting DNS timeouts but then after 2 tries it succeeds. Why would this happen? How can I troubleshoot? From my desktop I run: nslookup admin.something.local and get: Server: server.domain.com.au.local Address: 192.168.0.10 DNS request timed out. timeout was 2 seconds. DNS request timed out. timeout was 2 seconds. Name: admin.something.local Address: 192.168.0.191 If I go back the other way: nslookup 192.168.0.191 I get: Server: server.domain.com.au.local Address: 192.168.0.10 Name: admin.something.local Address: 192.168.0.191 My DNS server address is 192.168.0.10. The new DNS zone is not hooked up to active directory. I do not have much experience with DNS. Yesterday it was working fine. I have tried doing an 'ipconfig /flushdns' on both my desktop and the DNS server

    Read the article

  • How to generate an ASCII representation of a Unix file hierarchy?

    - by Jenn D.
    Hi, all. I'm looking for a quick and dirty way to generate some diagrams of some directories that have almost, but not exactly, the same hierarchy, so I can show them around at a meeting and we can decide which flavor we like best. I'm not interested in the "leaf" nodes, just the directories. The catch: I don't want to mess with X. This is a server system I deal with entirely through SSH. So I'm looking for something that will do ASCII layout, maybe with simple pipes-and-hyphens for lines or something. Does anyone know of such a utility? I'm sure I could write something myself, but it's such a fiddly little sort of project, with handling spacing and layout and such; I'd really like to discover that someone's done it for me. Alas, Google doesn't seem to know of such a thing...or if it does, it's hidden beneath heaps of excellent visual explications of the standard general Unix file hierarchy. Thanks!

    Read the article

  • why do we have to send the const " type " reference instead of just the types name to the constructo

    - by hamza
    i m trying to make a simple program ( & yes , it is a homework ) that can generate Dates , & like most of normal people : i made my Class attributes private , i tried to send the same type that i m working on to the constructor but the complier have not accept it , i did some research & i found out that in cases like that people generously send a const "type" reference to the constructor witch meant to me that have not understand OOP well so why do we have to send the const " type " reference instead of just the types name to the constructor ? & please give me some links or websites for beginners PS : sorry for my English

    Read the article

  • Programming language for web

    - by cable729
    I haven't programmed in a while, and have kind of lost interest, but I want to get back, and I've enjoyed C# the most, a lot more than objective-c and visual basic. So I want to make some games that me and my friends will be able to play next school year. So basically something you can play on the web. What programming languages deploy to the web? If c# is possible, and a mac with safari/firefox would be able to use it (I can't install plugins, and I don't want to get in trouble for making myself admin again) Flash, Java, etc. If java does, I'd like that most since it's most like c#. Then what libraries/engines would I use? I want to do 2d. And then what IDE would I use? Thanks in advance!

    Read the article

  • Windows Service And Thread Programming .NET

    - by Raghu
    I have developed windows service to process files whose records will be stored in database. When windows service finds a file it creates a thread and assigns each file to one thread. I have not used Thread Pool. I wanted to know when windows service is stopped, then how to identify how many threads are running and whether they are complete. If all the threads are executed then windows service can be stopped successfully. Otherwis windows service should wait until all threads are executed or aborted. How to implement this.

    Read the article

  • C# - Help with LINQ

    - by cmaduro
    I need to check if a certain property exists within a class. Please refer to the LINQ query in question. For the life of me I cannot make the compiler happy. class Program { static void Main(string[] args) { ModuleManager m = new ModuleManager(); IModule module = m.FindModuleForView(typeof(HomeView)); Console.WriteLine(module.GetType().ToString()); Console.ReadLine(); } } public class ModuleManager { [ImportMany] public IEnumerable<Lazy<IModule>> Modules { get; set; } [ImportMany] public IEnumerable<Lazy<View>> Views { get; set; } public ModuleManager() { //An aggregate catalog that combines multiple catalogs var catalog = new AggregateCatalog(); //Adds all the parts found in the same assembly as the Program class catalog.Catalogs.Add(new AssemblyCatalog(typeof(Program).Assembly)); //Create the CompositionContainer with the parts in the catalog _container = new CompositionContainer(catalog); //Fill the imports of this object try { this._container.ComposeParts(this); } catch (CompositionException compositionException) { Console.WriteLine(compositionException.ToString()); } } public IModule FindModuleForView(Type view) { //THIS IS THE PROBLEM var module = from m in Modules where ( from p in m.Value.GetType().GetProperties() where p.GetType().Equals(view) select p ) select m; } public CompositionContainer _container { get; set; } } public interface IModule { } [Export] public class HomeModule : IModule { public HomeModule() { } [Export] public HomeView MyHomeView { get { return new HomeView(); } set { } } } public class HomeView : View { } public class View { }

    Read the article

  • How to: WCF XML-RPC client?

    - by mr.b
    I have built my own little custom XML-RPC server, and since I'd like to keep things simple, on both server and client side, what I would like to accomplish is to create a simplest possible client (in C# preferably) using WCF. Let's say that Contract for service exposed via XML-RPC is as follows: [ServiceContract] public interface IContract { [OperationContract(Action="Ping")] string Ping(); // server returns back string "Pong" [OperationContract(Action="Echo")] string Echo(string message); // server echoes back whatever message is } So, there are two example methods, one without any arguments, and another with simple string argument, both returning strings (just for sake of example). Service is exposed via http. Aaand, what's next? :) P.S. I have tried googling around for samples and similar, but all that I could come up with are some blog-related samples that use existing (and very big/numerous) classes, which implement appropriate IContract (or IBlogger) interfaces, so that most of what I am interested is hidden below several layers of abstraction...

    Read the article

  • Windows Azure - Automatic Load Balancing - partitioning

    - by veda
    I was going through some videos. I found that Windows Azure will group the blobs into partitions based on the partition key and will Automatically Load Balance these partitions on their servers. The partition key for a blob is blob name. Using the blob name, azure will automatically do partitions. Now, My question is that Can I able to make the azure to do partitions based on the Container Name. I wanted my partition key to be container name. For example, I have a storage account. In that I have 2 containers named container1 and container2. In container1, I have 1000 files named 1.txt, 2.txt, 3.txt, ......., 501.txt, 502.txt, ..... 999.txt, 1000.txt and in container2, I have another 1000 files named 1001.txt, 1002.txt, 1003.txt, ......., 1501.txt, 1502.txt, ..... 1999.txt, 2000.txt Now, Will Windows Azure will generate 2000 partitions based on the blob name and serve me through several servers??? Won't it be better if Azure partitions based on the Container name? container1 on one server and conatiner2 on another.

    Read the article

  • Add characters to month loop?

    - by JM4
    I currently have a php loop running exactly how I need it with proper validations (in both php and javascript) with one exception, if the month is less than 2 digits, (i.e. 1,2,3,4), I need for a '0' to appear before: 01 - January 02 - February ... 10 - October My code for the loop is currently: <select name="Month"> <option value="">Month</option> <?php for ($i=1; $i<=12; $i++) { echo "<option value='$i'"; if ($fields["Month"] == $i) echo " selected"; echo ">$i</option>"; } ?> </select> any ideas? Also note, this month date is being stored in session, not interested in printing to screen

    Read the article

  • Getting pixel averages of a vector sitting atop a bitmap...

    - by user346511
    I'm currently involved in a hardware project where I am mapping triangular shaped LED to traditional bitmap images. I'd like to overlay a triangle vector onto an image and get the average pixel data within the bounds of that vector. However, I'm unfamiliar with the math needed to calculate this. Does anyone have an algorithm or a link that could send me in the right direction? (I tagged this as Python, which is preferred, but I'd be happy with the general algorithm!) I've created a basic image of what I'm trying to capture here: http://imgur.com/Isjip.gif

    Read the article

  • Need help with using regular expression in Java

    - by richard
    Hi, I am trying to match pattern like '@(a-zA-Z0-9)+ " but not like 'abc@test'. So this is what I tried: Pattern MY_PATTERN = Pattern.compile("\\s@(\\w)+\\s?"); String data = "[email protected] #gogasig @jytaz @tibuage"; Matcher m = MY_PATTERN.matcher(data); StringBuffer sb = new StringBuffer(); boolean result = m.find(); while(result) { System.out.println (" group " + m.group()); result = m.find(); } But I can only see '@jytaz', but not @tibuage. How can I fix my problem? Thank you.

    Read the article

  • Sort a list of dicts by dict values

    - by ensnare
    I have a list of dictionaries: [{'title':'New York Times', 'title_url':'New_York_Times','id':4}, {'title':'USA Today','title_url':'USA_Today','id':6}, {'title':'Apple News','title_url':'Apple_News','id':2}] I'd like to sort it by the title, so elements with A go before Z: [{'title':'Apple News','title_url':'Apple_News','id':2}, {'title':'New York Times', 'title_url':'New_York_Times','id':4}, {'title':'USA Today','title_url':'USA_Today','id':6}] What's the best way to do this? Also, is there a way to ensure the order of each dictionary key stays constant, e.g., always title, title_url, then id? Thank you.

    Read the article

  • Why do SQL connection leave parameters in?

    - by acidzombie24
    While coding with sqlite everytime i always had the exact number of parameters and when i executed the query i always had 0 parameters after it. I kept using the cmd object and it worked fine. Now while porting to use sql server (2008) my SqlConnection has parameters left over from a successful command. Why? I seem to be able to create tables without the problem (then again i may have use a clone of an empty cmd since i use recursion). Does SqlCommand always leave the parameters in after a query? This always breaks the following query unless i do parameter.clear(). Should i create a new SqlCommand object? or use parameter.clear() each time? I'm somewhat confused.

    Read the article

  • Using ExtJS with ASP.NET, Webforms or MVC?

    - by TigrouMeow
    Hello, For a scenario using 0 ASP.NET controls at all but rather an 100% extJS interface, what would be the advantages of using ASP.NET MVC or ASP.NET WebForms? And the disadvantages? Is there a OBVIOUS way to do it properly? I would love to have feedback's on your experiences. Thank you!

    Read the article

  • Why is ASP.NET MVC Authorize attribute throwing a null reference exception?

    - by robertz
    I had a working asp.net mvc application running on my local IIS 7 web server, but now I'm getting errors whenever I request a page that requires authorization. I'm using standard forms authentication with asp.net membership. Here's the error: Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] System.Web.Mvc.AuthorizeAttribute.AuthorizeCore(HttpContextBase httpContext) +31 System.Web.Mvc.AuthorizeAttribute.OnAuthorization(AuthorizationContext filterContext) +38 System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +103 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +345...

    Read the article

  • optimistic and pessimistic locks

    - by billmce
    Working on my first php/Codeigniter project and I’ve scoured the ‘net for information on locking access to editing data and haven’t found very much information. I expect it to be a fairly regular occurrence for 2 users to attempt to edit the same form simultaneously. My experience (in the stateful world of BBx, filePro, and other RAD apps) is that the data being edited is locked using a pessimistic lock—one user has access to the edit form at the time. The second user basically has to wait for the first to finish. I understand this can be done using Ajax sending XMLHttpRequests to maintain a ‘lock’ database. The php world, lacking state, seems to prefer optimistic locking. If I understand it correctly it works like this: both users get to access the data and they each record a ‘before changes’ version of the data. Before saving their changes, the data is once again retrieved and compared the ‘before changes’ version. If the two versions are identical then the users changes are written. If they are different; the user is shown what has changed since he/she started editing and some mechanism is added to resolve the differences—or the user is shown a ‘Sorry, try again’ message. I’m interested in any experience people here have had with implementing both pessimistic and optimistic locking. If there are any libraries, tools, or ‘how-to’s available I’m appreciate a link. Thanks

    Read the article

  • Is adding indexes to a SQL Server ever a bad idea?

    - by Aerik
    We have a mid-size SQL Server based application that has no indexes defined. Not even on the the identity columns. I suggested to our moderately expensive application consultant that perhaps we might get better performance (particularly as our database grows) by creating some indexes on appropriate fields, and he said: "Indexes will significantly impact other areas of the application and customers should not create them under any circumstances." Anybody ever heard of anything like this? Are there ever circumstances where one should not create any indexes? I can see nothing special about this app - it's got int identity columns, then lots of string columns, bunch of relational tables but nothing special or weird that I can see. Thanks!

    Read the article

  • Android::Confused about image sizes in a website

    - by Legend
    I was testing my website inside the Android emulator with the Droid Skin (240 dpi). I have the following css: #container { position: relative; width: 854px; height: 480px; background: #000; margin: auto; } #container li { position: relative; list-style: none; width: 201px; height: 110px; padding-left: 10px; padding-top:10px; padding-bottom:10px; overflow: hidden; float: left; z-index: 2; } The display is not what I expected obviously because I am defining everything in px (when I should have been using dip but css does not allow dip). How can I convert my px to something that is suitable for Android? Any suggestions?

    Read the article

  • Jquery validator plugin- Validates at least one in the group

    - by christian
    [http://jsfiddle.net/mhmBs/][1] I tried using the method that he uses in a jquery validator plugin.. My error container is separated from the form, it is outside the form. When I use that method to validated that the user input at least one from 3 input text boxes. It validates the field, but the other items to be validated is ignored specially the items before 3 input text boxes.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >