Daily Archives

Articles indexed Wednesday May 19 2010

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

  • Two Way Data Binding With a Object in WPF,Image Control

    - by Candy
    Sorry, my English is not very good, I have a object "Stuffs" "Stuffs" have a Property “Icon” now: xaml <Button Click="Button_Click"><Image Width="80" Height="80" Source="{Binding Path=Icon,Converter={StaticResource ImageConverter}}"/></Button> cs private void Button_Click(object sender, RoutedEventArgs e) { IconFloder.Title = "Icon"; String IconFloderPath = AppDomain.CurrentDomain.BaseDirectory + ItemIconFloder; if (!System.IO.Directory.Exists(IconFloderPath)) System.IO.Directory.CreateDirectory(IconFloderPath); IconFloder.InitialDirectory = IconFloderPath; IconFloder.Filter = "Image File|*.jpeg"; IconFloder.ValidateNames = true; IconFloder.CheckPathExists = true; IconFloder.CheckFileExists = true; if (IconFloder.ShowDialog() == true) { HideImage.Text = ItemIconFloder + "\\" + IconFloder.SafeFileName; ((sender as Button).Content as Image).Source = new ImageConverter().Convert(ItemIconFloder + "\\" + IconFloder.SafeFileName, Type.GetType("System.Windows.Media.ImageSource"), null, new System.Globalization.CultureInfo("en-US")) as ImageSource; } } class ImageConverter:IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is string&&!String.IsNullOrEmpty(value.ToString())) { try { return new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + value)); } catch { } } return null; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } I would like to click buttons, change the picture, Also change Data Binding Stuffs.Icon But failed,I have no idea?I need help? I do not know whether I speak clearly

    Read the article

  • UITableView Reload Data

    - by william-hu
    Hi, i used UITableView to show the info which was get for server. - (void)viewWillAppear:(BOOL)animated { //Create connection } Then i put the received data into array : NSSArray *dataFromServer: Then i want to show the data on each cell (some NSString object). As the connection was release, i call [self.tableView reloadData] , but cant work. So i'd like to know, how to make this? It means cellForRowAtIndexPath: has nothing at beginning, but after few seconds, shows something. Thank you so much!

    Read the article

  • How to replace master branch in git, entirely, from another branch?

    - by Jason
    Hi, I have two branch in my git repo: master seotweaks (created originally from master) I created "seotweaks" with the intention of quickly merging it back into master, however that was 3 months ago and the code in this branch is 13 versions ahead of "master", it has effectively become our working master branch as all the code in "master" is more or less obsolete now. Very bad practice I know, lesson learnt. Do you know how I can replace all of the contents of the "master" branch with those in "seotweaks"? I could just delete everything in "master" and merge, but this does not feel like best practice.

    Read the article

  • Splitting a person's name into forename and surname

    - by Nick
    ok so basically I am asking the question of their name I want this to be one input rather than Forename and Surname. Now is there any way of splitting this name? and taking just the last word from the "Sentence" e.g. name = "Thomas Winter" print name.split() and what would be output is just "Winter"

    Read the article

  • Authenticate username and password

    - by Alice Lee
    I have a MMC client that runs on a .Net system, that invokes web methods on a server running on a linux box. The first task the client needs to do is to perform user login. It prompts the user for username and password. What is the best way for the client to authenticate the user's credentials. The password cannot be sent as plain text. The web server implements a web method called ValidateUser().

    Read the article

  • Database design for sharing photos site?

    - by javaLearner.java
    I am using php and mysql. If I want to do a sharing photos website, whats the best database design for upload and display photos. This is what I have in mind: domain: |_> photos |_> user Logged in user will upload photo in [http://www.domain.com/user/upload.php] The photos are stored in filesystems, and the path-to-photos stored in database. So, in my photos folder would be like: photos/userA/subfolders+photos, photos/userB/subfolders+photos, photos/userC/subfolders+photos etc Public/others people may view his photo in: [http://www.domain.com/photos/user/?photoid=123] where 123 is the photoid, from there, I will query from database to fetch the path and display the image. My questions: Whats the best database design for photo-sharing website (like flickr)? Will there be any problems if I keep creating new folder in "photos" folder. What if hundreds of thousands users registered? Whats the best practices What size of photos should I keep? Currently I only stored thumbnail (100x100) and (max) 1600x1200 px photos. What others things I should take note when developing photos-sharing website?

    Read the article

  • What's a good bit of JS or JQuery for horizontally scrolling news ticker

    - by Graphain
    Hi, I am looking for a little bit of JQuery or JS that allows me to produce a horizontally scrolling "news ticker" list. The produced HTML needs to be standards compliant as well. I have tried liScroll but this has a habit of breaking (some content ends up on a second line at the start of the scroll), especially with longer lists. I have also tried this News Ticker but when a DOCTYPE is included the scrolling will jolt rather than cycle smoothly at the end of each cycle. Any suggestions are appreciated. Edit So thanks to Matt Hinze's suggestion I realised I could do what I wanted to do with JQuery animate (I require continuous scrolling not discrete scrolling like the example). However, I quickly ran into similar problems to those I was having with liScroll and after all that realised a CSS issue (as always) was responsible. Solution: liScroll - change the default 'var stripWidth = 0' to something like 100, to give a little space and avoid new line wrapping.

    Read the article

  • Validate java SAML signature from C#

    - by Adrya
    How can i validate in .Net C# a SAML signature created in Java? Here is the SAML Signature that i get from Java: <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> </ds:CanonicalizationMethod> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"> </ds:SignatureMethod> <ds:Reference URI="#_e8bcba9d1c76d128938bddd5ae8c68e1"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"> </ds:Transform> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="code ds kind rw saml samlp typens #default xsd xsi"> </ec:InclusiveNamespaces> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"> </ds:DigestMethod> <ds:DigestValue>zEL7mB0Wkl+LtjMViO1imbucXiE=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> jpIX3WbX9SCFnqrpDyLj4TeJN5DGIvlEH+o/mb9M01VGdgFRLtfHqIm16BloApUPg2dDafmc9DwL Pyvs3TJ/hi0Q8f0ucaKdIuw+gBGxWFMcj/U68ZuLiv7U+Qe7i4ZA33rWPorkE82yfMacGf6ropPt v73mC0bpBP1ubo5qbM4= </ds:SignatureValue> <ds:KeyInfo> <ds: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> </ds:KeyInfo> </ds:Signature> I know to parse SAML, i need to validate the signature. I tried this: public bool VerifySignature() { X509Certificate2 certificate = null; XmlDocument doc = new XmlDocument(); XmlElement xmlAssertionElement = this.GetXml(doc); doc.AppendChild(xmlAssertionElement); // Create a new SignedXml object and pass it // the XML document class. SamlSignedXml signedXml = new SamlSignedXml(xmlAssertionElement); // Get signature XmlElement xmlSignature = this.Signature; if (xmlSignature == null) { return false; } // Load the signature node. signedXml.LoadXml(xmlSignature); // Get the certificate used to sign the assertion if information about this // certificate is available in the signature of the assertion. foreach (KeyInfoClause clause in signedXml.KeyInfo) { if (clause is KeyInfoX509Data) { if (((KeyInfoX509Data)clause).Certificates.Count > 0) { certificate = (X509Certificate2)((KeyInfoX509Data)clause).Certificates[0]; } } } if (certificate == null) { return false; } return signedXml.CheckSignature(certificate, true); } It validates the signature of a SAML signed in .Net but not of this Java one.

    Read the article

  • How to remove index from url in asp.net mvc?

    - by Pandiya Chendur
    I am doing a return RedirectToAction("Index", "Clients"); from my home controller.... It is fine but my url looks like http://localhost:1115/Clients/Index... How to remove index from url in asp.net mvc? Any suggestion.... My routes, public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Registrations", "{controller}/{action}/{id}", new { controller = "Registration", action = "Create", id = "" } ); }

    Read the article

  • Mouse over popup like addthis and sharethis??

    - by mathew
    does any one know how to create a mouse over popup like addthis.com and sharethis.com?? it should popup exactly on a button. and moreover it does not have anything inserted into Head tag.can be attached javascript with that link between body tag but not in head. any Ideas, Sample code??

    Read the article

  • Building/Testing a Universal iPhone/iPad application

    - by psychotik
    I have a project configured (I think) to produce Universal binaries. The base SDK is set to 3.2 and the Deployment Target is set to 3.1. Target Device Family is iPhone/iPad and the architecture is armv6 armv7. I had a few questions about how this Universal binary thing really works: 1) When I want to submit an app binary for review, what configuration should I set as the build target? If I set it as "Device - 3.1" I get a warning which says "warning: building with Targeted Device Family" that includes iPad('1,2') requires building with the 3.2 or later SDK". However, if I build with SDK 3.2, will it still run on iPhones with OS 3.1? What's the right configuration for device and architecture (arm6/arm7)? 2) How do I test the scenario above (built with SDK 3.2, but installed on a device running OS 3.1)? If I build with SDK 3.2, when I try to install it on a phone with OS 3.1, I get an error saying that the phone's OS isn't updated. Thanks!

    Read the article

  • NoSQL or Ehcache caching ?

    - by paddydub
    I'm building a Route Planner Webapp using Spring/Hibernate/Tomcat and a mysql database, I have a database containing read only data, such as Bus Stop Coordinates, Bus times which is never updated. I'm trying to make the app run faster, each time the application is run it will preform approx 1000 reads to the database to calculate a route. I have setup a Ehcache which greatly improves the read from database times. I'm now setting terracotta + Ehcache distributed caching to share the cache with multiple Tomcat JVMs. This seems a bit complicated. I've tried memcached but it was not performing as fast as ehcache. I'm wondering if a MongoDb or Redis would be better suited. I have no experience with nosql but I would appreciate if anyone has any ideas. What i need is quick access to the read only database.

    Read the article

  • How to get XP style control-tab on windows 7?

    - by JK-
    Is there anyway in windows 7 to change the behavior of control-tab so that it acts like it did in XP? What I want is for it to show the icon of the program, not a thumbnail of the window. Most of the thumbnails look alike and its really hard to instantly tell which is which like I could on XP.

    Read the article

  • How to parse a url string using mvc2 routes

    - by Lavinski
    If I have a url http://www.site.com/controllerA/actionB/idC how can i extract the RouteValueDictionary where the item with the key controller would have the value of controllerA. Note this isn't for testing so I don't want to use mocking and the solution here does not seem to be working.

    Read the article

  • How Do I Prevent Rails From Treating Updated Nested Attributes Differently From New Nested Attribute

    - by James
    I am using rails3 beta3 and couchdb via couchrest. I am not using active record. I want to add multiple "Sections" to a "Guide" and add and remove sections dynamically via a little javascript. I have looked at all the screencasts by Ryan Bates and they have helped immensely. The only difference is that I want to save all the sections as an array of sections instead of individual sections. Basically like this: "sections" => [{"title" => "Foo1", "content" => "Bar1"}, {"title" => "Foo2", "content" => "Bar2"}] So, basically I need the params hash to look like that when the form is submitted. When I create my form I am doing the following: <%= form_for @guide, :url => { :action => "create" } do |f| %> <%= render :partial => 'section', :collection => @guide.sections %> <%= f.submit "Save" %> <% end %> And my section partial looks like this: <%= fields_for "sections[]", section do |guide_section_form| %> <%= guide_section_form.text_field :section_title %> <%= guide_section_form.text_area :content, :rows => 3 %> <% end %> Ok, so when I create the guide with sections, it is working perfectly as I would like. The params hash is giving me a sections array just like I would want. The problem comes when I want edit guide/sections and save them again because rails is inserting the id of the guide in the id and name of each form field, which is screwing up the params hash on form submission. Just to be clear, here is the raw form output for a new resource: <input type="text" size="30" name="sections[][section_title]" id="sections__section_title"> <textarea rows="3" name="sections[][content]" id="sections__content" cols="40"></textarea> And here is what it looks like when editing an existing resource: <input type="text" value="Foo1" size="30" name="sections[cd2f2759895b5ae6cb7946def0b321f1][section_title]" id="sections_cd2f2759895b5ae6cb7946def0b321f1_section_title"> <textarea rows="3" name="sections[cd2f2759895b5ae6cb7946def0b321f1][content]" id="sections_cd2f2759895b5ae6cb7946def0b321f1_content" cols="40">Bar1</textarea> How do I force rails to always use the new resource behavior and not automatically add the id to the name and value. Do I have to create a custom form builder? Is there some other trick I can do to prevent rails from putting the id of the guide in there? I have tried a bunch of stuff and nothing is working. Thanks in advance!

    Read the article

  • Am I using Settings in C# correctly?

    - by Sergio Tapia
    Here's what I'm doing. I have three properties: MomsBackground, DadsBackground and ChosenBackground. When Momsbackground is selected in the program, I set the ChosenBackground string according to what item the user has clicked (either "Mom" or "Dad"). Then on Form_Load() I use a switch case for the ChosenBackground string and according to that select This.BackgroundColor to MomsBackground or DadsBackground. Code below: Am I using this as it was intended?

    Read the article

  • How can I transfer a file via XMPP using Python?

    - by Enchantner
    I'm using xmpppy library for my jabber remote administration bot, but I can't find how to send/receive a file and save it inside the directory specified. The documentation is poor and there isn't any examples, but I really want to make it. Can anyone show some examples or some links about it? Or maybe I should use an alternative xmpp bindings?

    Read the article

  • Sample code for image upload

    - by Michael
    Hi, In would like to write a simple Android application that takes a picture from the camera and uploads it to a webserver. Additionaly, I would like it to print in the screen the response from the server wich is a simple text string. Do you know if there is any sample code that does something like that? Thank you, Michael

    Read the article

  • Programmatically open an email from a POP3 and extract an attachment

    - by Josh
    We have a vendor that sends CSV files as email attachments. These CSV files contain statuses that are imported into our application. I'm trying to automate the process end-to-end, but it currently depends on someone opening an email, saving the attachment to a server share, so the application can use the file. Since I cannot convince the vendor to change their process, such as offering an FTP location or a Web Service, I'm stuck with trying to automate the existing process. Does anyone know of a way to programmatically open an email from a POP3 account and extract an attachment? The preferred solution would reside on a Windows 2003 server, be written VB.NET and secure. The application can reside on the same server as the POP3 server, for example, we could setup the free POP3 server that comes with Windows Server and pull against the mail file stored on the file system. BTW, we are willing to pay for an off-the-shelf solution, if one exists. Note: I did look at this question but the answer points to a CodeProject solution that doesn't deal with attachments.

    Read the article

  • Displaying text in C# from XML via LINQ

    - by xscape
    Is there a way to display "Test" value as bold just like the implementation of newline? <testElement>Test &#xD; Test</testElement> The output of the above line when you display it is: TEST TEST I want to know what/how to make the second line as bold just line by using expressions. Thank you

    Read the article

  • how to make data that download from google-app-engine readable..

    - by zjm1126
    i use this to download all data from my google app: i follow this article: http://code.google.com/intl/en/appengine/docs/python/tools/uploadingdata.html#Creating_Exporter_Classes and download data use this: bulkloader.py --dump --url=http://zjm1126.appspot.com/remote_api --filename=b.csv but the data is : so how to make the data readable ? thanks

    Read the article

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