Daily Archives

Articles indexed Sunday March 28 2010

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

  • WPF ComboBox in Grid Issue

    - by Nathan
    I am trying to put a series of comboboxes in a grid and then I bind them to a list. For some reason unknown to me when I click the open button on the combobox nothing happens. If I move a comobobox outside the grid it opens just fine. Can someone please tell me what I am doing wrong here. It has to be something stupid because I've used comoboxes before just fine. Here is my xaml: <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <GroupBox Header="Download Critera" Margin="70,30" Name="groupBox1" Grid.RowSpan="2"> <Grid Height="Auto" Name="grid1" Width="Auto" Margin="0" IsHitTestVisible="False"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBlock Grid.Row="1" Margin="10,5,5,5" Name="textBlock1" Text="A:" Foreground="Black" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" /> <TextBlock Grid.Row="2" Margin="10,5,5,5" Name="textBlock2" Text="B:" Foreground="Black" VerticalAlignment="Center" FontWeight="Bold" /> <TextBlock Grid.Row="3" Margin="10,5,5,5" Name="textBlock3" Text="C:" Foreground="Black" VerticalAlignment="Center" FontWeight="Bold" /> <TextBlock Grid.Row="4" Margin="10,5,5,5" Name="textBlock4" Foreground="Black" Text="D:" VerticalAlignment="Center" FontWeight="Bold" /> <TextBlock Grid.Row="5" Margin="10,5,5,5" Name="textBlock5" Text="E:" Foreground="Black" TextAlignment="Left" VerticalAlignment="Center" FontWeight="Bold" /> <ComboBox x:Name="cb1" Grid.Column="1" Grid.Row="1" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> <ComboBox x:Name="cb2" Grid.Column="1" Grid.Row="2" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> <ComboBox x:Name="cb3" Grid.Column="1" Grid.Row="3" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> <ComboBox x:Name="cb4" Grid.Column="1" Grid.Row="4" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> <ComboBox x:Name="cb5" Grid.Column="1" Grid.Row="5" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> </Grid> </GroupBox> </Grid>

    Read the article

  • Javascript incapable of getting element's max-height via element.style.maxHeight

    - by Zane
    I am making a simple accordion menu in javascript. I'd like to be able to set the compact and expanded heights for the elements via the css max-height and min-height values. For some reason, when I try to retrieve the min-height and max-height of the elements in javascript for animation purposes, I get an empty string rather than, for instance, "500px" like it should. The max-height value is set in css, e.g. #id { min-height: 40px; max-height: 500px; } is all set up, but when I put a debugging mechanism in my javascript such as alert( item.style.minHeight ); it pops up an empty alert box. This happens in Firefox 3.6.2 and IE 8. Does anybody know why javascript refuses to be able to get an element's minHeight and maxHeight?

    Read the article

  • Eclipse vs Netbeans Web Service Tooling

    - by Zenzen
    Some time ago (~4-5months ago) I attented a lecture about JEE and at some point the lecturer started talking about webservices and how hard it is to create a good one because all the IDEs make them in a bit different way (or something like that) and that in general it's better to use Netbeans to create them as Eclipse has some issues, the thing is he didn't really say why Eclipse is bad. Now I'm wondering is what he said true and why, is it really better to use Netbeans for webservices and why?

    Read the article

  • Goodbye XML&hellip; Hello YAML (part 2)

    - by Brian Genisio's House Of Bilz
    Part 1 After I explained my motivation for using YAML instead of XML for my data, I got a lot of people asking me what type of tooling is available in the .Net space for consuming YAML.  In this post, I will discuss a nice tooling option as well as describe some small modifications to leverage the extremely powerful dynamic capabilities of C# 4.0.  I will be referring to the following YAML file throughout this post Recipe: Title: Macaroni and Cheese Description: My favorite comfort food. Author: Brian Genisio TimeToPrepare: 30 Minutes Ingredients: - Name: Cheese Quantity: 3 Units: cups - Name: Macaroni Quantity: 16 Units: oz Steps: - Number: 1 Description: Cook the macaroni - Number: 2 Description: Melt the cheese - Number: 3 Description: Mix the cooked macaroni with the melted cheese Tooling It turns out that there are several implementations of YAML tools out there.  The neatest one, in my opinion, is YAML for .NET, Visual Studio and Powershell.  It includes a great editor plug-in for Visual Studio as well as YamlCore, which is a parsing engine for .Net.  It is in active development still, but it is certainly enough to get you going with YAML in .Net.  Start by referenceing YamlCore.dll, load your document, and you are on your way.  Here is an example of using the parser to get the title of the Recipe: var yaml = YamlLanguage.FileTo("Data.yaml") as Hashtable; var recipe = yaml["Recipe"] as Hashtable; var title = recipe["Title"] as string; In a similar way, you can access data in the Ingredients set: var yaml = YamlLanguage.FileTo("Data.yaml") as Hashtable; var recipe = yaml["Recipe"] as Hashtable; var ingredients = recipe["Ingredients"] as ArrayList; foreach (Hashtable ingredient in ingredients) { var name = ingredient["Name"] as string; } You may have noticed that YamlCore uses non-generic Hashtables and ArrayLists.  This is because YamlCore was designed to work in all .Net versions, including 1.0.  Everything in the parsed tree is one of two things: Hashtable, ArrayList or Value type (usually String).  This translates well to the YAML structure where everything is either a Map, a Set or a Value.  Taking it further Personally, I really dislike writing code like this.  Years ago, I promised myself to never write the words Hashtable or ArrayList in my .Net code again.  They are ugly, mostly depreciated collections that existed before we got generics in C# 2.0.  Now, especially that we have dynamic capabilities in C# 4.0, we can do a lot better than this.  With a relatively small amount of code, you can wrap the Hashtables and Array lists with a dynamic wrapper (wrapper code at the bottom of this post).  The same code can be re-written to look like this: dynamic doc = YamlDoc.Load("Data.yaml"); var title = doc.Recipe.Title; And dynamic doc = YamlDoc.Load("Data.yaml"); foreach (dynamic ingredient in doc.Recipe.Ingredients) { var name = ingredient.Name; } I significantly prefer this code over the previous.  That’s not all… the magic really happens when we take this concept into WPF.  With a single line of code, you can bind to the data dynamically in the view: DataContext = YamlDoc.Load("Data.yaml"); Then, your XAML is extremely straight-forward (Nothing else.  No static types, no adapter code.  Nothing): <StackPanel> <TextBlock Text="{Binding Recipe.Title}" /> <TextBlock Text="{Binding Recipe.Description}" /> <TextBlock Text="{Binding Recipe.Author}" /> <TextBlock Text="{Binding Recipe.TimeToPrepare}" /> <TextBlock Text="Ingredients:" FontWeight="Bold" /> <ItemsControl ItemsSource="{Binding Recipe.Ingredients}" Margin="10,0,0,0"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Quantity}" /> <TextBlock Text=" " /> <TextBlock Text="{Binding Units}" /> <TextBlock Text=" of " /> <TextBlock Text="{Binding Name}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <TextBlock Text="Steps:" FontWeight="Bold" /> <ItemsControl ItemsSource="{Binding Recipe.Steps}" Margin="10,0,0,0"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Number}" /> <TextBlock Text=": " /> <TextBlock Text="{Binding Description}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> This nifty XAML binding trick only works in WPF, unfortunately.  Silverlight handles binding differently, so they don’t support binding to dynamic objects as of late (March 2010).  This, in my opinion, is a major lacking feature in Silverlight and I really hope we will see this feature available to us in Silverlight 4 Release.  (I am not very optimistic for Silverlight 4, but I can hope for the feature in Silverlight 5, can’t I?) Conclusion I still have a few things I want to say about using YAML in the .Net space including de-serialization and using IronRuby for your YAML parser, but this post is hopefully enough to see how easy it is to incorporate YAML documents in your code. Codeplex Site for YAML tools Dynamic wrapper for YamlCore

    Read the article

  • Silverlight MVVM File Manager

    An implementation of the MVVM pattern to create a simple Silverlight 4 File Manager...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • How can we use Microsoft Groove with peers existing in both secure and unsecured network segments?

    - by MikeHerrera
    We have been instructed to implement a Microsoft Groove workspace. This would normally not be a concern, but the workspace will be utilized by machines which exist in our internal/restricted network as well as from peers from an outside/unknown network. Does there exist a best-practice for such an implementation?... or would this potentially expose the restricted network too broadly?

    Read the article

  • Is it possible to disable the retry mechanism in Exim

    - by Tony Meyer
    I have a very simple Exim configuration that's just forwarding all mail to a set of destination addresses. When immediate delivery to an address fails, the message is added to the queue (and then processed by the retry rules). I want to change this so that if immediately delivery fails, the message is :blackhole:d. (It's ok if a bounce is generated instead, as I'll just redirect the bounce to the :blackhole:). This needs to occur for temporary failures (i.e. 4xx) as well as permanent (i.e. 5xx) ones. I understand that this means that if delivery can't be done immediately the message will be permanently and irretrievably lost. In this particular context, that isn't a problem. Reading over this, it sounds suspiciously like "how can I improve my spamming Exim server". That really isn't what this is for, and if you can figure out a way I can prove that, I'm happy to do so!

    Read the article

  • Debootstrapping karmic powerpc arch results in error?

    - by FLX
    I'm trying to retrieve the powerpc arch of Karmic Koala with the following command: sudo debootstrap --arch powerpc karmic /home/xbmc/karmic http://archive.ubuntulinux.org/ubuntu However, I get the following error: E: No such script: /usr/share/debootstrap/scripts/karmic I used the debootstrap from the official repo: debootstrap --version debootstrap 1.0.12 Can anyone help me?

    Read the article

  • Compaq 610 fan is constantly on and noisy, base is fairly hot too

    - by Dave
    The fans on both of my HP Compaq 610s are constantly on and the base is fairly hot and I don't know if this is standard issue. HP assures me that this is unusual and that I should return them as DOA. Because both laptops have this problem, I'm thinking that this might be a design flaw rather than a one-off problem. I've updated the BIOS and using their recommended power settings. Am I missing something? Is there anything I can do to fix it?

    Read the article

  • PyQt error: No such signal QObject::dataChanged

    - by DSblizzard
    PyQt application works fine, but when I close it Python shows this message: "Object::connect: No such signal QObject::dataChanged(QModelIndex,QModelIndex)" What is the cause of this? There isn't dataChanged signal in the program. EDIT: Almost minimal program which causes error: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtSql import * import ui_DBMainWindow global Mw, Table, Tv Id, Name, Size = range(3) class TTable(): pass Table = TTable() class TMainWindow(QMainWindow, ui_DBMainWindow.Ui_MainWindow): def __init__(self, parent = None): global Table QMainWindow.__init__(self, parent) self.setupUi(self) self.showMaximized() self.mapper = QDataWidgetMapper(self) self.mapper.setModel(Table.Model) def main(): global Mw, Table, Tv QApp = QApplication(sys.argv) DB = QSqlDatabase.addDatabase("QSQLITE") DB.setDatabaseName("1.db") Table.Model = QSqlTableModel() Table.Model.setTable("MainTable") Table.Model.select() Mw = TMainWindow() QApp.exec_() if __name__ == "__main__": main()

    Read the article

  • Edit/show Primary Key in Django Admin

    - by emcee
    It appears Django hides fields that are flagged Primary Key from being displayed/edited in the Django admin interface. Let's say I'd like to input data in which I may or may not want to specify a primary key. How would I go about displaying primary keys in Django-admin, and how could I make specifying it optional? Many thanks in advance, beloved hive-mind.

    Read the article

  • How to securely pass credit card information between pages in PHP

    - by Alex
    How do you securely pass credit card information between pages in PHP? I am building an ecommerce application and I would like to have the users to go through the checkout like this: Enter Information - Review - Finalize Order Problem is that I am not sure on how to safely pass credit information from when the user inputs them to when I process it (at the Finalize Order step). I heard using sessions is insecure, even with encryption. Any help would be appreciated!

    Read the article

  • sending data to a php script

    - by kalpaitch
    Whats the best way to send data to the server and have it run through a php script. Bearing in mind I do not want to have the user redirected to a different page and no response needs to be sent back from the server.

    Read the article

  • NHibernate: No persister error

    - by Mike
    Hello, In my quest to further my knowledge, I'm trying to get get NHibernate running. I have the following structure to my solution Core Class Library Project Infrastructure Class Library Project MVC Application Project Test Project In my Core project I have created the following entity: using System; namespace Core.Domain.Model { public class Category { public virtual Guid Id { get; set; } public virtual string Name { get; set; } } } In my Infrastructure Project I have the following mapping: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Core.Domain.Model" assembly="Core"> <class name="Category" table="Categories" dynamic-update="true"> <cache usage="read-write"/> <id name="Id" column="Id" type="Guid"> <generator class="guid"/> </id> <property name="Name" length="100"/> </class> </hibernate-mapping> With the following config file: <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string">server=xxxx;database=xxxx;Integrated Security=true;</property> <property name="show_sql">true</property> <property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property> <property name="cache.use_query_cache">false</property> <property name="adonet.batch_size">100</property> <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property> <mapping assembly="Infrastructure" /> </session-factory> </hibernate-configuration> In my test project, I have the following Test [TestMethod] [DeploymentItem("hibernate.cfg.xml")] public void CanCreateCategory() { IRepository<Category> repo = new CategoryRepository(); Category category = new Category(); category.Name = "ASP.NET"; repo.Save(category); } I get the following error when I try to run the test: Test method Volunteer.Tests.CategoryTests.CanCreateCategory threw exception: NHibernate.MappingException: No persister for: Core.Domain.Model.Category. Any help would be greatly appreciated. I do have the cfg build action set to embedded resource. Thanks!

    Read the article

  • Css trick to conjoin divs.

    - by Jronny
    Is there a way we could conjoin three divs together? Hello <div class="mainContainer"> <div class="LeftDiv"></div> <div class="CenterDiv"> <input id="txtTest" type="text"/> </div> <div class="RightDiv"></div> </div> World! what we need here is to present the code this way: Hello<*LeftDiv*><*CenterDiv with the textbox*><*RightDiv*>World I tried to use float:left on LeftDiv, CenterDiv and RightDiv but the css also affects the mainContainer. I also need to set the LeftDiv's and RightDiv's height and width on the css but I just can't do it without the float. Thanks in advance. Edit: Added question - when LeftDiv, CenterDiv and RightDiv are floated-left, why is mainContainer affected? i just want to have the three inner divs conjoined without affecting the parent div's behavior...

    Read the article

  • How well do zippers perform in practice, and when should they be used?

    - by Rob
    I think that the zipper is a beautiful idea; it elegantly provides a way to walk a list or tree and make what appear to be local updates in a functional way. Asymptotically, the costs appear to be reasonable. But traversing the data structure requires memory allocation at each iteration, where a normal list or tree traversal is just pointer chasing. This seems expensive (please correct me if I am wrong). Are the costs prohibitive? And what under what circumstances would it be reasonable to use a zipper?

    Read the article

  • C Library for Parsing Date Time

    - by adk
    Is one aware of a date parsing function for c. I am looking for something like: time = parse_time("9/10/2009"); printf("%d\n", time->date); time2 = parse_time("Monday September 10th 2009") time2 = parse_time("Monday September 10th 2009 12:30 AM") Thank you

    Read the article

  • DB2 - How to run an ad hoc select query with a parameter in IBM System i Access for Windows GUI Tool

    - by KenB
    I would like to run some ad hoc select statements in the IBM System I Navigator tool for DB2 using a variable that I declare. For example, in the SQL Server world I would easily do this in the SQL Server Management Studio query window like so: DECLARE @VariableName varchar(50); SET @VariableName = 'blah blah'; select * from TableName where Column = @VariableName; How can I do something similar in the IBM System I Navigator tool?

    Read the article

  • How to learn high-level Java web development concepts

    - by titaniumdecoy
    I have some experience writing web applications in Java for class projects. My first project used Servlets and my second, the Stripes framework. However, I feel that I am missing the greater picture of Java web development. I don't really understand the web.xml and context.xml files. I'm not sure what constitutes a Java EE application as opposed to a generic Java web application. I can't figure out how a bean is different from an ordinary Java class (POJO?) and how that differs from an Enterprise Java Bean (EJB). These are just the first few questions I could think of, but there are many more. What is a good way to learn how Java web applications function from the top down rather than simply how to develop an application with a specific framework? (Is there a book for this sort of thing?) Ultimately, I would like to understand Java web applications well enough to write my own framework.

    Read the article

  • Clear data at serial port in Linux in C?

    - by ipkiss
    Hello guys, I am testing the sending and receiving programs with the code as The main() function is below: include include include include include include include "read_write.h" int fd; int initport(int fd) { struct termios options; // Get the current options for the port... tcgetattr(fd, &options); // Set the baud rates to 19200... cfsetispeed(&options, B9600); cfsetospeed(&options, B9600); // Enable the receiver and set local mode... options.c_cflag |= (CLOCAL | CREAD); options.c_cflag &= ~PARENB; options.c_cflag &= ~CSTOPB; options.c_cflag &= ~CSIZE; options.c_cflag |= CS8; // Set the new options for the port... tcsetattr(fd, TCSANOW, &options); return 1; } int main(int argc, char **argv) { fd = open("/dev/pts/2", O_RDWR | O_NOCTTY | O_NDELAY); if (fd == -1) { perror("open_port: Unable to open /dev/pts/1 - "); return 1; } else { fcntl(fd, F_SETFL, 0); } printf("baud=%d\n", getbaud(fd)); initport(fd); printf("baud=%d\n", getbaud(fd)); char sCmd[254]; sCmd[0] = 0x41; sCmd[1] = 0x42; sCmd[2] = 0x43; sCmd[3] = 0x00; if (!writeport(fd, sCmd)) { printf("write failed\n"); close(fd); return 1; } printf("written:%s\n", sCmd); usleep(500000); char sResult[254]; fcntl(fd, F_SETFL, FNDELAY); if (!readport(fd,sResult)) { printf("read failed\n"); close(fd); return 1; } printf("readport=%s\n", sResult); close(fd); return 0; } read_write.h: #include <stdio.h> /* Standard input/output definitions */ include /* String function definitions */ include /* UNIX standard function definitions */ include /* File control definitions */ include /* Error number definitions */ include /* POSIX terminal control definitions */ int writeport(int fd, char *chars) { int len = strlen(chars); chars[len] = 0x0d; // stick a after the command chars[len+1] = 0x00; // terminate the string properly int n = write(fd, chars, strlen(chars)); if (n < 0) { fputs("write failed!\n", stderr); return 0; } return 1; } int readport(int fd, char *result) { int iIn = read(fd, result, 254); result[iIn-1] = 0x00; if (iIn < 0) { if (errno == EAGAIN) { printf("SERIAL EAGAIN ERROR\n"); return 0; } else { printf("SERIAL read error %d %s\n", errno, strerror(errno)); return 0; } } return 1; } and got the issue: In order to test with serial port, I used the socat (https://help.ubuntu.com/community/VirtualSerialPort ) to create a pair serial ports on Linux and test my program with these port. The first time the program sends the data and the program receives data is ok. However, if I read again or even re-write the new data into the serial port, the return data is always null until I stop the virtual serial port and start it again, then the write and read data is ok, but still, only one time. (In the real case, the sending part will be done by another device, I am just taking care of the reading data from the serial port. I wrote both parts just to test my reading code.) Does anyone have any ideas? Thanks a lot.

    Read the article

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