Daily Archives

Articles indexed Tuesday March 30 2010

Page 31/126 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • WPF ItemsViewSource Sorting

    - by niao
    Greetings, I have a problem with sorting ItemsViewSource in WPF. The problem is as follows: My application has a listbox with items, there is a possibility to add new items to this listbox. I have ItemsViewSource which is binded to ListBox ItemsSource - by default some sortDescription is applied (by name) so when new item is added to the listbox it is automatically added to appopriate position in ListBox. I also have a ToggleButton named "No sorting" and what I would like to achieve - when this butt is pressed and new item is added to listbox, the item will be included in the first position in ListBox and additionally previous sorting will be preserved. I can achieve the functionality of adding new item to first position on the list by calling _ItemsViewSource.SortDescriptions.Clear(); but then my previous sorting is not preserved. How can I achieve this and preserve previous sorting? Thanks in advance.

    Read the article

  • Is there any killer application for Ontology/semantics/OWL/RDF yet?

    - by narnirajesh
    Hi Guys, I got interested in semantic technologies after reading a lot of books, blogs and articles on the net saying that it would make data machine-understandable, allow intelligent agents make great reasoning, automated & dynamic service composition etc.. I am still reading the same stuff from 2 years. The number of articles/blogs/semantic-conferences have increased considerably. But I am still unable to see any killer-application. Why is it so? Or is there some application/product (commercial/open-source) already existing, which actually is doing all that being boasted of? To put it more precisely, is there any product that leverages semantic technologies (esp RDF/OWL/SPARQL) and is delivering functionality/performance/maintainability, which would not have been possible with the existing (no-semantic) technologies? Some product that is completely dependent on semantic technologies and really adds value to the customers and generating revenues?

    Read the article

  • How can i optimize this c# code?

    - by Pandiya Chendur
    I have converted my Datatable to json string use the following method... public string GetJSONString(DataTable Dt) { string[] StrDc = new string[Dt.Columns.Count]; string HeadStr = string.Empty; for (int i = 0; i < Dt.Columns.Count; i++) { StrDc[i] = Dt.Columns[i].Caption; HeadStr += "\"" + StrDc[i] + "\" : \"" + StrDc[i] + i.ToString() + "¾" + "\","; } HeadStr = HeadStr.Substring(0, HeadStr.Length - 1); StringBuilder Sb = new StringBuilder(); Sb.Append("{\"" + Dt.TableName + "\" : ["); for (int i = 0; i < Dt.Rows.Count; i++) { string TempStr = HeadStr; Sb.Append("{"); for (int j = 0; j < Dt.Columns.Count; j++) { if (Dt.Rows[i][j].ToString().Contains("'") == true) { Dt.Rows[i][j] = Dt.Rows[i][j].ToString().Replace("'", ""); } TempStr = TempStr.Replace(Dt.Columns[j] + j.ToString() + "¾", Dt.Rows[i][j].ToString()); } Sb.Append(TempStr + "},"); } Sb = new StringBuilder(Sb.ToString().Substring(0, Sb.ToString().Length - 1)); Sb.Append("]}"); return Sb.ToString(); } Is this fair enough or still there is margin for optimization to make it execute faster.... Any suggestion...

    Read the article

  • Code to connect to remote server using perl

    - by user304852
    I'm written small code to connect to remote server using perl but observing error messages #!/usr/bin/perl -w use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>60, Errmode=>'die'); $telnet->open('192.168.50.40'); $telnet->waitfor('/login:/'); $telnet->print('queen'); $telnet->waitfor('/password:/'); $telnet->print('kinG!'); $telnet->waitfor('/:/'); $telnet->print('vol >> C:\result.txt'); $telnet->waitfor('/:/'); $telnet->cmd("mkdir vol"); $telnet->print('mkdir vol234'); $telnet->cmd("mkdir vol1"); $telnet->waitfor('/\$ $/i'); $telnet->print('whoamI'); print $output; But while running i'm getting following errors C:\>perl -c E:\test\net.pl E:\test\net.pl syntax OK C:\>perl E:\test\net.pl command timed-out at E:\test\net.pl line 13 C:\> Help me in this regard.. i'm not much aware of perl

    Read the article

  • HTTP request, strange socket behavoir

    - by hoodoos
    I expirience strange behavior when doing HTTP requests through sockets, here the request: POST https://test.com:443/service/XMLSelect HTTP/1.1 Content-Length: 10926 Host: test.com User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 1.0.3705) Authorization: Basic XXX SOAPAction: http://test.com/SubmitXml Later on there goes body of my request with given content length. After that I recive something like: HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Tue, 30 Mar 2010 06:13:52 GMT So everything seem to be fine here. I read all contents from network stream and successfuly recieve response. But my socket which I'm doing polling on switches it's modes like that: write ( i write headers and request here ) read ( after headers sent i begin to recieve response ) write ( STRANGE BEHAVIOUR HERE. WHY? here i send nothing really ) read ( here it switches to read back again ) last two steps can repeat several times. So I want to ask what leads for socket's mode change? And in this case it's not a big problem, but when I use gzip compression in my request ( no idea how it's related ) and ask server to send gzipped response to me like this: POST https://test.com:443/service/XMLSelect HTTP/1.1 Content-Length: 1076 Accept-Encoding: gzip Content-Encoding: gzip Host: test.com User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 1.0.3705) Authorization: Basic XXX SOAPAction: http://test.com/SubmitXml I recieve response like that: HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Encoding: gzip Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Tue, 30 Mar 2010 07:26:33 GMT 2000 ? I recieve a chunk size and GZIP header, it's all okay. And here's what is happening with my poor little socket meanwhile: write ( i write headers and request here ) read ( after headers sent i begin to recieve response ) write ( STRANGE BEHAVIOUR HERE. And it finally sits here forever waiting for me to send something! But if i refer to HTTP I don't have to send anything more! ) What can it be related to? What it wants me to send? Is it remote web server's problem or do I miss something? PS All actual service references and login/passwords replaced with fake ones :)

    Read the article

  • Date query with Hibernate on Timestamp Column in PostgreSQL

    - by Shashikant Kore
    A table has timestamp column. A sample value in that could be 2010-03-30 13:42:42. With Hibernate, I am doing a range query Restrictions.between("column-name", fromDate, toDate). The Hibernate mapping for this column is as follows. <property name="orderTimestamp" column="order_timestamp" type="java.util.Date" /> Let's say, I want to find out all the records that have the date 30th March 2010 and 31st March 2010. A range query on this field is done as follows. Date fromDate = new SimpleDateFormat("yyyy-MM-dd").parse("2010-03-30"); Date toDate = new SimpleDateFormat("yyyy-MM-dd").parse("2008-03-31"); Expression.between("orderTimestamp", fromDate, toDate); This doesn't work. The query is converted to respective timestamps as "2010-03-30 00:00:00" and "2010-03-31 00:00:00". So, all the records for the 31st March 2010 are ignored. A simple solution to this problem could be to have the end date as "2010-03-31 23:59:59." But, I would like to know if there is way to match only the date part of the timestamp column. Also, is Expression.between() inclusive of both limits? Documentation doesn't throw any light on this.

    Read the article

  • IE on Windows 7 not saving files to disk [closed]

    - by Gemini
    I am running Win 7 Build 7100. Since I restored this system I am facing peculiar issues - all effectively rendering this system unusable. The biggest peeve is: Any file downloaded from IE is never saved to disk. IE shows the entire download progress bar and at the end of download, no file is saved anywhere on the disk!

    Read the article

  • Finding wireless interference

    - by Arcath
    I want to find out if wireless interference is causing any problems with my wireless networks. I remember seeing a piece of software that let you see what networks where in range and where they fell in the spectrum, aswell as any other sources. Anyone know a way/a piece of software that can do this?

    Read the article

  • Apple met en ligne la mise à jour 10.6.3 pour Mac OS X,qui contient de nombreux correctifs

    Apple propose ce soir la mise à jour pour Mac OS X 10.6. Après avoir envoyé de nombreuses bêta aux développeurs, la voici enfin avec de nombreux correctifs : Améliorent la fiabilité et la compatibilité de QuickTime X. Corrigent des problèmes de compatibilité avec les applications basées sur OpenGL. Corrigent un problème d'affichage incorrect des couleurs d'arrière-plan de message dans Mail. Corrigent un problème qui empêchait les fichiers dont le nom contenait les caractères "#" ou "&" de s'ouvrir dans les applications Rosetta. Corrigent un problème qui empêchait la copie de fichiers sur des serveurs de fichiers Windows. Améliorent les performances de Logic Pro 9 et de Main Stage 2 en mode 64 bits.

    Read the article

  • one high-end server with one Application Server or multiple Application Servers?

    - by elgcom
    If I have a high-end server, for example with 1T memory and 8x4core CPU... will it bring more performance if I run multiple App Server (on different JVM) rather than just one App Server? On App Server I will run some services (EAR whith message driven beans) which exchange message with each other. btw, has java 64bit now no memory limitation any more? http://java.sun.com/products/hotspot/whitepaper.html#64

    Read the article

  • Is PHP serialize function compatible UTF-8 ?

    - by Matthieu
    I have a site I want to migrate from ISO to UTF-8. I have a record in database indexed by the following primary key : s:22:"Informations générales"; The problem is, now (with UTF-8), when I serialize the string, I get : s:24:"Informations générales"; (notice the size of the string is now the number of bytes, not string length) So this is not compatible with non-utf8 previous records ! Did I do something wrong ? How could I fix this ? Thanks

    Read the article

  • Rails link to current page and passing parameters to it

    - by Faisal
    I am adding I18N to my rails application by passing the locale using url params. My urls are looking like http://example.com/en/users and http://example.com/ar/users (for the english and arabic locales respectively). In my routes file, I have defined my routes with a :path_prefix option: map.resources :users, :path_prefix => '/:locale' And locale is being set using a before_filter defined in ApplicationController def set_locale I18n.locale = params[:locale] end I also defined ApplicationController#default_url_options, to add locale to all urls generated by the application: def default_url_options(options={}) {:locale => I18n.locale} end What I want is to add a link in the layout header (displayed in all pages) that would link to the same page but with the other locale. For instance, if I am browsing the arabic locale, I want a "English" link in the header, that will redirect me back to my current page, and set the locale to english. Is there a way to do this in rails?

    Read the article

  • How can I validate the result in an ASP.NET MVC editor template?

    - by Morten Christiansen
    I have created an editor template for representing selecting from a dynamic dropdown list and it works as it should except for validation, which I have been unable to figure out. If the model has the [Required] attribute set, I want that to invalidate if the default option is selected. The view model object that must be represented as the dropdown list is Selector: public class Selector { public int SelectedId { get; set; } public IEnumerable<Pair<int, string>> Choices { get; private set; } public string DefaultValue { get; set; } public Selector() { //For binding the object on Post } public Selector(IEnumerable<Pair<int, string>> choices, string defaultValue) { DefaultValue = defaultValue; Choices = choices; } } The editor template looks like this: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <select class="template-selector" id="<%= ViewData.ModelMetadata.PropertyName %>.SelectedId" name="<%= ViewData.ModelMetadata.PropertyName %>.SelectedId"> <% var model = ViewData.ModelMetadata.Model as QASW.Web.Mvc.Selector; if (model != null) { %> <option><%= model.DefaultValue %></option><% foreach (var choice in model.Choices) { %> <option value="<%= choice.Value1 %>"><%= choice.Value2 %></option><% } } %> </select> I sort of got it to work by calling it from the view like this (where Category is a Selector): <%= Html.ValidationMessageFor(n => n.Category.SelectedId)%> But it shows the validation error for not supplying a proper number and it does not care if I set the Required attribute.

    Read the article

  • encryption of a single character

    - by SystemicPlural
    What is the minimum number of bits needed to represent a single character of encrypted text. eg, if I wanted to encrypt the letter 'a', how many bits would I require. (assume there are many singly encrypted characters using the same key.) Am I right in thinking that it would be the size of the key. eg 256 bits?

    Read the article

  • How to load local images in webview in Iphone sdk?

    - by monish
    Hi guys, Here I am getting a problem when I am loading local Image in the webview using html code my image was not diplaying in my webview here is my code for Loading the local image in webview: htmlString = [htmlString stringByAppendingString:@"<table width=85% cellpadding=3 cellspacing=0 border=0> "]; htmlString = [htmlString stringByAppendingString:@"<tr>"]; htmlString = [htmlString stringByAppendingString:@"<td >"]; htmlString = [htmlString stringByAppendingString:@"<div align='Right'><a href='/reviews/"]; htmlString = [htmlString stringByAppendingString:@"'>"]; htmlString = [htmlString stringByAppendingString:@"<img src ='reviews1.jpg' BORDER=0 HEIGHT=148 WIDTH=110/>"]; htmlString = [htmlString stringByAppendingString:@"</a>"]; - (BOOL)webView:(UIWebView*)webView2 shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { //CAPTURE USER LINK-CLICK. if (navigationType == UIWebViewNavigationTypeLinkClicked) { NSURL *aURL = [request URL]; NSString* aurlString = [aURL absoluteString]; if ( [aurlString rangeOfString:@"/reviews/"].location != NSNotFound) { [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; ReviewWebViewController* viewController = [[ReviewWebViewController alloc] init]; viewController.loadUrl=[techProducts techProductReviewUrl]; [self.navigationController pushViewController:viewController animated:YES]; [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; [viewController release]; return NO; } } } Here no image was displaying only ?mark is displaying . guys pls help me to get out of dis prb. Thank you, Monish.

    Read the article

  • Greyscale Image from YUV420p data

    - by fergs
    From what I have read on the internet the Y value is the luminance value and can be used to create a grey scale image. The following link: http://www.bobpowell.net/grayscale.htm, has some C# code on working out the luminance of a bitmap image : { Bitmap bm = new Bitmap(source.Width,source.Height); for(int y=0;y<bm.Height;y++) public Bitmap ConvertToGrayscale(Bitmap source) { for(int x=0;x<bm.Width;x++) { Color c=source.GetPixel(x,y); int luma = (int)(c.R*0.3 + c.G*0.59+ c.B*0.11); bm.SetPixel(x,y,Color.FromArgb(luma,luma,luma)); } } return bm; } I have a method that returns the YUV values and have the Y data in a byte array. I have the current piece of code and it is failing on Marshal.Copy – attempted to read or write protected memory. public Bitmap ConvertToGrayscale2(byte[] yuvData, int width, int height) { Bitmap bmp; IntPtr blue = IntPtr.Zero; int inputOffSet = 0; long[] pixels = new long[width * height]; try { for (int y = 0; y < height; y++) { int outputOffSet = y * width; for (int x = 0; x < width; x++) { int grey = yuvData[inputOffSet + x] & 0xff; unchecked { pixels[outputOffSet + x] = UINT_Constant | (grey * INT_Constant); } } inputOffSet += width; } blue = Marshal.AllocCoTaskMem(pixels.Length); Marshal.Copy(pixels, 0, blue, pixels.Length); // fails here : Attempted to read or write protected memory bmp = new Bitmap(width, height, width, PixelFormat.Format24bppRgb, blue); } catch (Exception) { throw; } finally { if (blue != IntPtr.Zero) { Marshal.FreeHGlobal(blue); blue = IntPtr.Zero; } } return bmp; } Any help would be appreciated?

    Read the article

  • How to configure Remote desktop on window server 2008 R2?

    - by Abdullah BaMusa
    I’m trying to connect over internet to my home workstation which has Windows Server 2008 R2 (Web Edition) installed from my PC at work (Windows 7 installed on it) via Remote Desktop. I configure the workstation to accept remote desktop and I can connect to it from my laptop if I’m within same Home LAN but I can’t establish the connection from my PC at work . My question is: Is possible to connect to my workstation over internet using remote desktop? Is there any step by step resource the setup this feature?

    Read the article

  • Java application profiling / tracking

    - by sarav
    I have a closed source Java application for which vendor has provided APIs for customization. As I have no other documents, i rely completely on the API's javadoc. I want to trace what methods are actually called in different classes for a particular use case. Is there any way to do that with eclipse?

    Read the article

  • Extending both T and SomeInterface<T> in Java

    - by Graeme Moss
    I want to create a class that takes two parameters. One should be typed simply as T. The other should be typed as something that extends both T and SomeInterface. When I attempt this with public class SomeClass<T, S extends SomeInterface<T> & T> then Java complains with "The type T is not an interface; it cannot be specified as a bounded parameter" and if instead I attempt to create an interface for S with public interface TandSomeInterface<T> extends SomeInterface<T>, T then Java complains with "Cannot refer to the type parameter T as a supertype" Is there any way to do this in Java? I think you can do it in C++...?

    Read the article

  • Rails 1.0 - Using composed_of gives me a wrong number of arguments (1 for 5) error

    - by Tristan Havelick
    I am developing a Rails 1.0 application (I can't upgrade, it's a strange situation) for which I am trying to use the :composed_of functionality. I have a class called StreetAddress: class StreetAddress attr_reader :address, :address2, :city, :state_id, :zip_code def initialize(address, address2, city, state_id, zip_code) @address = address @address2 = address2 @city = city @state_id = state_id @zip_code = zip_code end end and a model class called Hotel class Hotel < ActiveRecord::Base composed_of :street_address # ... end which has columns: "id", "brand_id", "code", "location_name", "address", "address2", "city", "state_id", "zip_code", "phone_number", "phone_ext", "fax_number", "time_zone", "url", "room_service_email", "manager_name", "manager_email" However when I try to access the aggregation I get an error: >> h = Hotel.find(1) => #<Hotel:0x38ad718 @attributes={"fax_number"=>"1-623-420-0124", "city"=>"Twin Falls", "address2"=>"285", "brand_id"=>"1", "code"=>"XZWUXUSZ", "manager_email"= >"[email protected]", "url"=>"http://www.xycdkzolukfvu.hom", "ph one_number"=>"1-805-706-9995", "zip_code"=>"72436", "phone_ext"=>"48060", "id"=> "1", "manager_name"=>"Igor Mcdowell", "room_service_email"=>"Duis.risus@Donecvit ae.ca", "time_zone"=>"America/Boise", "state_id"=>"15", "address"=>"P.O. Box 457 , 7405 Dignissim Avenue", "location_name"=>"penatibus et magnis"}> >> h.street_address ArgumentError: wrong number of arguments (1 for 5) from (eval):3:in `initialize' from (eval):3:in `new' from (eval):3:in `street_address' from (irb):6 Why?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >