Daily Archives

Articles indexed Wednesday May 12 2010

Page 19/121 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • expand an collapse button in datagrid

    - by prince23
    hi, <sdk:DataGrid MinHeight="100" x:Name="dgCounty" AutoGenerateColumns="False" VerticalAlignment="Top" IsReadOnly="True" Margin="5,5,5,0" RowDetailsVisibilityChanged="dgCounty_RowDetailsVisibilityChanged" RowDetailsVisibilityMode="VisibleWhenSelected"> <sdk:DataGrid.Columns> <sdk:DataGridTemplateColumn CanUserReorder="False"> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button x:Name="ViewButton" Click="ToggleRowDetailsVisibility" Cursor="Hand" Content="View Details" /> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> <sdk:DataGridTextColumn Header="Countryname" Width="100" Binding="{Binding Region Name}" CanUserReorder="False"/> <sdk:DataGridTextColumn Header="Populution" Width="80" Binding="{Binding Number Of People}" CanUserReorder="False"/> </sdk:DataGrid.Columns> <sdk:DataGrid.RowDetailsTemplate> <DataTemplate> <sdk:DataGrid x:Name="dgrdRowDetail" Width="400" AutoGenerateColumns="False" HorizontalAlignment="Center" IsReadOnly="True" Grid.Row="1"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Header="county" Binding="{Binding CompanyName}"/> <sdk:DataGridTextColumn Header="Number Of People" Binding="{Binding CompanyID}"/> </sdk:DataGrid.Columns> </sdk:DataGrid> </DataTemplate> </sdk:DataGrid.RowDetailsTemplate> </sdk:DataGrid> how to make an button in datagrid expand an collapse where there will be 2 image buttons once user clicks the button the rows under it will expand where there should be an one image button with (- symbol) again user clicks the same row the rows which were expanded should collapse.(+ image button) here i have done the function for doing the expand and collapse is completed. now only i need add an image which will change once the user clicks the row either ( we can do it by javascript or in code behind ?) how can i change the image button like that can any one tell me how i should i ahead or any code that can help me to solve the issue thanks in adance prince

    Read the article

  • Are functional programming languages good for practical tasks?

    - by Clueless
    It seems to me from my experimenting with Haskell, Erlang and Scheme that functional programming languages are a fantastic way to answer scientific questions. For example, taking a small set of data and performing some extensive analysis on it to return a significant answer. It's great for working through some tough Project Euler questions or trying out the Google Code Jam in an original way. At the same time it seems that by their very nature, they are more suited to finding analytical solutions than actually performing practical tasks. I noticed this most strongly in Haskell, where everything is evaluated lazily and your whole program boils down to one giant analytical solution for some given data that you either hard-code into the program or tack on messily through Haskell's limited IO capabilities. Basically, the tasks I would call 'practical' such as Aceept a request, find and process requested data, and return it formatted as needed seem to translate much more directly into procedural languages. The most luck I have had finding a functional language that works like this is Factor, which I would liken to a reverse-polish-notation version of Python. So I am just curious whether I have missed something in these languages or I am just way off the ball in how I ask this question. Does anyone have examples of functional languages that are great at performing practical tasks or practical tasks that are best performed by functional languages?

    Read the article

  • Microsoft Ajax Minifier and NAnt

    - by Vinblad
    Hi folks! Could someone explain to me how to use the Microsoft Ajax Minifier from a nant-script as a nant-task. I've seen examples of how to use it in Visual Studio but I would like the minification to be done on our CI-server.

    Read the article

  • JAXB, how to marshal without a namespace

    - by Alvin
    I have a fairly large repetitive XML to create using JAXB. Storing the whole object in the memory then do the marshaling takes too much memory. Essentially, my XML looks like this: <Store> <item /> <item /> <item /> ..... </Store> Currently my solution to the problem is to "hard code" the root tag to an output stream, and marshal each of the repetitive element one by one: aOutputStream.write("<?xml version="1.0"?>") aOutputStream.write("<Store>") foreach items as item aMarshaller.marshall(item, aOutputStream) end aOutputStream.write("</Store>") aOutputStream.close() Somehow the JAXB generate the XML like this <Store xmlns="http://stackoverflow.com"> <item xmlns="http://stackoverflow.com"/> <item xmlns="http://stackoverflow.com"/> <item xmlns="http://stackoverflow.com"/> ..... </Store> Although this is a valid XML, but it just look ugly, so I'm wonder is there any way to tell the marshaller not to put namespace for the item elements? Or is there better way to use JAXB to serialize to XML chunk by chunk?

    Read the article

  • Silverlight Cream for May 11, 2010 -- #859

    - by Dave Campbell
    In this All Submittal Issue: Colin Eberhardt, Ken Johnson, Alan Beasley, Pencho Popadiyn, Phil Middlemiss, Khawar(-2-), Levente Mihály, Alex van Beek, Bart Czernicki, Michael Washington, and Mark Monster. Shoutout: Not Silverlight necessarily, but definitely VS2010, read what Brett Balmer has to say In Defense of Portrait Mode From SilverlightCream.com: Silverlight MultiBinding solution for Silverlight 4 Colin Eberhardt updated his Silverlight Multibinding solution to Silverlight 4. Great article with explanatory graphics, and links to the code... congrats on the use in the FaceBook Client too! Spirograph Shapes: WPF Bezier shapes from math formulae Wow... I haven't seen this much math since my Master's Thesis! ... Check out all the shapes Ken Johnson has built... don't let the math scare you... just use it :) Busy Dizzy Bee-sley Spirographic Animation in Expression Blend and Silverlight This is just fun... I saw Michael Washington playing with this yesterday at the Arizona Day of .NET but didn't have a chance to ask what it was.. Alan Beasley had a good time building this, and is sharing a very detailed tutorial with us. ModalDialogs, IEditableObject and MVVM in Silverlight 4 Pencho Popadiyn said the 'M' word over at SilverlightShow... actually the 'MVVM' word :) ... he's discussing Modal dialogs with no code in the View ... check out how he did it. A Chrome and Glass Theme - Part 6 Phil Middlemiss is up to episode 6 in his Theme-building tutorial... this time out, he's giving the TabControl and TabItem new clothes ... specifically discussing what to change and what to allow to inherit ... good stuff! Silverlight 4 Fonts gotcha Check out Khawar's ATM Machine demo -- there's a link on the page for this post... he had an issue with fonts, ratted it out, and explains it for all of us... thanks Khawar Demystifying Silverlight Obfuscation Khawar also has a good post up on Obfuscating your Silverlight... definitely showing that it's not all that difficult to do. geoGallery, a WinPhone7 sample OK this is interesting... using the geoLocation feature of WP7, Levente Mihály hits Google Picasa to find pictures... good write-up and all the code. Silverlight 4: Digitally signing a XAP with Visual Studio 2010 Alex van Beek has a nice tutorial on Signing your XAP file using Visual Studio 2010... of course you may want to visit Tim Heuer's blog (search at SC) to find the two good deals on certificates that are still in play. Creating Key Performance Indicators (KPIs) in Expression Blend 4 for Business Intelligence applications In an interesting post, Bart Czernicki describes using the shape assets in Blend 4 to produce a KPI display in Silverlight or WPF. A discussion of the shape's evolution for KPI is included as well as some alternate shape uses. A DotNetNuke Silverlight 4 Drag and Drop File Manager Michael Washington has blogged about his Drag and Drop File Manager using the View Model Style pattern. This is covered in two CodeProject articles listed in the post. The design work was done by Alan Beasely and links to his work is there as well as covered in other SC posts. How to select a ListItem on Hover Mark Monster had a Use Case for Selecting a ListBox entry by hovering ... but he did it with a Behavior and for a ListBox and PathListBox and it works with DataBinding... Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • What is Best storage servers infrastructure ? DAS/NAS/SAN or installing GlusterFS/LUSTER/HDFS/RBDB

    - by TORr0t
    I am trying to design an infrastucture for the project I am working on. It would be somehow a file-sharing/downloading project (like rapidshare) and I would need high storage sizes and good scability, and I would add new storage nodes after my project grows up. I have come up with 3 solutions for my project which are using Luster, GlusterFS, HDFS, RDBD. For start, i would have 2 servers, one server is for glusterfs client + webserver + db server+ a streaming server, and the other server is gluster storage node. (After sometime, i would be adding more node servers, and client servers (dont know how many new client new servers to add, will see later) So, i am thinking to work with glusterfs. But i really wonder that if i have to use high performance servers with high sotrage sizes or avarage/slow servers with high storage sizes? Or nas/das/san solutions are better for glusterfs storage nodes? I might buy a nas and install glusterfs onto it. I would be happy to listen to your recommendations for the server properties (for each clients and nodes) . I really dont know if I really need high amount of ram and good cpus to for the nodes. I am sure i need it for client servers. The files would be streamed as well, so the Automatic file replication is important, thus, my system should work like a cloud, when needed, according to high traffic, the storage nodes should copy the most demanded file to be streamed and would help me to get rid of scability problems and my visitors would able to stream/download those files. Also, i am open to your experiences/thoughts about any good solution. Luster, hdfs, rbdb are the other options and i would be happy to listen to your thoughts here. I would be very very happy to hear back from anyone commented of any words I have used here. Thanks

    Read the article

  • Optimal two variable linear regression calculation

    - by Dave Jarvis
    Problem Am looking to apply the y = mx + b equation (where m is SLOPE, b is INTERCEPT) to a data set, which is retrieved as shown in the SQL code. The values from the (MySQL) query are: SLOPE = 0.0276653965651912 INTERCEPT = -57.2338357550468 SQL Code SELECT ((sum(t.YEAR) * sum(t.AMOUNT)) - (count(1) * sum(t.YEAR * t.AMOUNT))) / (power(sum(t.YEAR), 2) - count(1) * sum(power(t.YEAR, 2))) as SLOPE, ((sum( t.YEAR ) * sum( t.YEAR * t.AMOUNT )) - (sum( t.AMOUNT ) * sum(power(t.YEAR, 2)))) / (power(sum(t.YEAR), 2) - count(1) * sum(power(t.YEAR, 2))) as INTERCEPT, FROM (SELECT D.AMOUNT, Y.YEAR FROM CITY C, STATION S, YEAR_REF Y, MONTH_REF M, DAILY D WHERE -- For a specific city ... -- C.ID = 8590 AND -- Find all the stations within a 15 unit radius ... -- SQRT( POW( C.LATITUDE - S.LATITUDE, 2 ) + POW( C.LONGITUDE - S.LONGITUDE, 2 ) ) < 15 AND -- Gather all known years for that station ... -- S.STATION_DISTRICT_ID = Y.STATION_DISTRICT_ID AND -- The data before 1900 is shaky; insufficient after 2009. -- Y.YEAR BETWEEN 1900 AND 2009 AND -- Filtered by all known months ... -- M.YEAR_REF_ID = Y.ID AND -- Whittled down by category ... -- M.CATEGORY_ID = '001' AND -- Into the valid daily climate data. -- M.ID = D.MONTH_REF_ID AND D.DAILY_FLAG_ID <> 'M' GROUP BY Y.YEAR ORDER BY Y.YEAR ) t Data The data is visualized here: Question The following results (to calculate the start and end points of the line) appear incorrect. Why are the results off by ~10 degrees (e.g., outliers skewing the data)? (1900 * 0.0276653965651912) + (-57.2338357550468) = -4.66958228 (2009 * 0.0276653965651912) + (-57.2338357550468) = -1.65405406 I would have expected the 1900 result to be around 10 (not -4.67) and the 2009 result to be around 11.50 (not -1.65). Related Sites Least absolute deviations Robust regression Thank you!

    Read the article

  • Complex pattern replacement using PHP preg_replace function ignoring quoted strings

    - by Saiful
    Consider the following string: this is a STRING WHERE some keywords ARE available. 'i need TO format the KEYWORDS from the STRING' In the above string keywords are STRING and WHERE Now i need to get an output as follows: this is a <b>STRING</b> <b>WHERE</b> some keywords ARE available. 'i need TO format the KEYWORDS from the STRING' So that the html output will be like: this is a STRING WHERE some keywords ARE available. 'i need TO format the KEYWORDS from the STRING' Note that the keywords within a quoted ('...') string will be ignored. in the above example i ignored the STRING keyword within the quoted string. Please give a modified version of the following PHP script so that I can have my desired result as above : $patterns = array('/STRING/','/WHERE/'); $replaces = array('<b>STRING</b>', '<b>WHERE</b>'); $string = "this is a STRING WHERE some keywords ARE available. 'i need TO format the KEYWORDS from the STRING'"; preg_replace($patterns, $replaces, $string);

    Read the article

  • C++ return type overload hack

    - by aaa
    I was bored and came up with such hack (pseudocode): 1 struct proxy { 2 operator int(); // int function 3 operator double(); // double function 4 proxy(arguments); 5 arguments &arguments_; 6 }; 7 8 proxy function(arguments &args) { 9 return proxy(args); 10 } 11 int v = function(...); 12 double u = function(...); is it evil to use in real code?

    Read the article

  • Trouble with creating WPF window extended on the title area (like Office 2007/2010)

    - by Rikker Serg
    I want to make WPF window extended on the title area (like Office 2007/2010). I implemented DwmWindow (see DwmTest.zip) where I put required stuff. Commonly, it works fine except one disgusting thing: the window appears as white rectangle (see DwmIssue.png) and after a few second this rectangle disappears and the content of the window is shown (see DwmIssueCorrect.png). This bug is essential only for my window. If I remove this lines it works fine (without it aero will not showed on title): HwndSource mainWindowSrc = HwndSource.FromHwnd(handle); if (mainWindowSrc != null) mainWindowSrc.CompositionTarget.BackgroundColor = Colors.Transparent; NativeMethods.MARGINS margins = new NativeMethods.MARGINS(0, 50, 0, 0); NativeMethods.DwmExtendFrameIntoClientArea(handle, margins); How can I eliminate this white rectangle? (To run a sample DwmTest.zip WinVista/7 with DWM enabled and .NET 4.0 is required. To compile sample you will need Visual Studio 2010)

    Read the article

  • determine complex type from a primitive type using reflection

    - by Nilotpal Das
    I am writing a tool where I need to reflect upon methods and if the parameters of the methods are complex type, then I need to certain type of actions such as instantiating them etc. Now I saw the IsPrimitive property in the Type variable. However, it shows string and decimal as complex types, which technically isn't incorrect. However what I really want is to be able to distinguish developer created class types from system defined data types. Is there any way that I can do this?

    Read the article

  • NSNumber floatValue not equal to NSNumber value

    - by Mirkules
    Hi Everyone, First post here. Having a problem with NSNumber's floatValue method -- somehow, it returns an imprecise number. Here's the problem: I store a bunch of NSNumbers in an array, like this: NSArray *a = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.04f], [NSNumber numberWithFloat:0.028f], [NSNumber numberWithFloat:0.016f], [NSNumber numberWithFloat:0.004f], nil]; Then I try to retrieve the first value (for example): NSNumber n = (NSNumber) [a objectAtIndex:0]; CGFloat f = [n floatValue]; In the debugger, n shows a value of 0.04 (in the summary column), but f shows a value of 0.0399999991. What am I doing wrong here? Thanks everyone.

    Read the article

  • SharpPcap issue

    - by Eyla
    This is my first time to use SharpPcap library. I created new project with VC# 2008 and I added SharpPcap as a reference to my project. I post a sample code to get interface of my pc but I'm getting this error: Error 1 The type or namespace name 'PcapDeviceList' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Ali\Documents\Visual Studio 2008\Projects\Pcap\Pcap\Form1.cs 28 13 Pcap please advice to solve this problem. here is my code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using SharpPcap; using SharpPcap.Packets; using SharpPcap.Protocols; using SharpPcap.Util; namespace Pcap { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { /* Retrieve the device list */ PcapDeviceList devices = SharpPcap.GetAllDevices(); /*If no device exists, print error */ if (devices.Count < 1) { Console.WriteLine("No device found on this machine"); return; } int i = 0; /* Scan the list printing every entry */ foreach (PcapDevice dev in devices) { /* Description */ label1.Text = "{0}) {1}" + i + dev.PcapDescription +"\n"+ /* Name */ "\tName:\t{0}" + dev.PcapName+"\n"+ /* IP Address */ "\tIP Address: \t\t{0}"+ dev.PcapIpAddress+"\n"+ /* Is Loopback */ "\tLoopback: \t\t{0}"+ dev.PcapLoopback; i++; } } } }

    Read the article

  • Prevent ASP.NET from encoding strings on output

    - by Darkwater23
    How can I stop ASP.Net from encoding anchor tags in List Items when the page renders? I have a collection of objects. Each object has a link property. I did a foreach and tried to output the links in a BulletedList, but ASP encoded all the links. Any idea? Thanks! Here's the offending snippet of code. When the user picks a specialty, I use the SelectedIndexChange event to clear and add links to the BulletedList: if (SpecialtyList.SelectedIndex > 0) { PhysicianLinks.Items.Clear(); foreach (Physician doc in docs) { if (doc.Specialties.Contains(SpecialtyList.SelectedValue)) { PhysicianLinks.Items.Add(new ListItem("<a href=\"" + doc.Link + "\">" + doc.FullName + "</a>")); } } }

    Read the article

  • Update database every 30 minutes once

    - by Ravi
    Hi, I am working on C#.Net Windows application with SQL Server 2005. This project i am using ADO.Net Data-service for database maintenance. I am working on industrial automation domain, here data keep on reading more than 8 hours. After reading data from device based on the trigger i have periodically update data to database. for example start reading data on 9.00AM, trigger firing on 9.50AM. Once trigger fire, last 30 minutes(9.20 AM to 9.50AM) data store into data base. After trigger firing keep on reading data from device and store into data base. 10.00AM trigger going to off at time storing data to database has to be stop. Again trigger firing on 11.00AM. Once trigger fire, last 30 minutes(10.30 AM to 11.00AM) data store into data base. After trigger firing keep on reading data from device and store into data base. After 10.00AM trigger not firing means data keep on store locally. Here i don't know until trigger fire keep on reading data where & how to maintain temporarily , After trigger firing, last 30 minutes data how to bring and store into database. I don't know how to achieve it. It would be great if anyone could suggest any idea. Thanks

    Read the article

  • Visual Studio - Project with that name already opened in the solution

    - by Mike K.
    I recently migrated a VSS database to TFS 2008. Using Source Control Explorer, I got the latest version of a solution with 12 projects. When I opened the solution in VS 2005, two of the projects were not found. I am not sure why these two projects were not found, but thought it easiest to just delete and re-add them to the solution. When I do this, VS gives me a "A project with that name is already open in the solution." The project doesn't appear in solution explorer, and is not listed in the .sln file. Any ideas?

    Read the article

  • Convert videos to iPod touch friendly formats

    - by joshhunt
    I have a bunch of Xvid videos lying around and I would love to convert them to a format that will play on my iPod touch efficiently and quickly. What free programs can do this? Although I am after something to run on Leopard, Windows programs wouldn't be bad either.

    Read the article

  • how to make right click of mouse on Mac

    - by George2
    Hello everyone, I am using a MacBook Pro running Mac OS X 10.5. I am new to this development environment, and previously worked on Windows. I am wondering how to make right click on the Mac? When I click on my mouse pad, it only has left click effect. thanks in advance, George

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >