Daily Archives

Articles indexed Wednesday May 26 2010

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

  • Iterating through StaticResource loaded by ResourceDictionary

    - by akaphenom
    Given a resource dictionary loading some static resources into memory - is there any way to iterate through theResources loaded into memory? My silverlight application keeps telling me it cannot find a static resource. I wonder if I have a naming convention issue or somehting - was hoping iterating through the resources in memory would help diagnose any issue... I have the following app.xaml <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Module1.MyApp"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/FSSilverlightApp;component/TransitioningFrame.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> and content template: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ControlTemplate x:Key="TransitioningFrame" TargetType="navigation:Frame"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> <ContentPresenter Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}"/> </Border> </ControlTemplate> </ResourceDictionary>

    Read the article

  • Best pattern for storing (product) attributes in SQL Server

    - by EdH
    We are starting a new project where we need to store product and many product attributes in a database. The technology stack is MS SQL 2008 and Entity Framework 4.0 / LINQ for data access. The products (and Products Table) are pretty straightforward (a SKU, manufacturer, price, etc..). However there are also many attributes to store with each product (think industrial widgets). These may range from color to certification(s) to pipe size. Every product may have different attributes, and some may have multiples of the same attribute (Ex: Certifications). The current proposal is that we will basically have a name/value pair table with a FK back to the product ID in each row. An example of the attributes Table may look like this: ProdID AttributeName AttributeValue 123 Color Blue 123 FittingSize 1.25 123 Certification AS1111 123 Certification EE2212 123 Certification FM.3 456 Pipe 11 678 Color Red 999 Certification AE1111 ... Note: Attribute name would likely come from a lookup table or enum. So the main question here is: Is this the best pattern for doing something like this? How will the performance be? Queries will be based on a JOIN of the product and attributes table, and generally need many WHEREs to filter on specific attributes - the most common search will be to find a product based on a set of known/desired attributes. If anyone has any suggestions or a better pattern for this type of data, please let me know. Thanks! -Ed

    Read the article

  • App store for the PC?

    - by Chris
    So I've spent a lot of time making an iPhone game and have recently realized that I don't have to limit myself to just Apple - I know there are app stores for Palm and Android, but does anybody know of a good "app store" for the plain old PC? I would like to have one where individual developers can publish an app and not have to worry about all the billing and piracy issues!

    Read the article

  • Android interacting with HTML5 tutorial?

    - by Adam
    I've been looking at using a WebView to display an HTML5 webpage, where the novel features of the mobile device (GPS, compass, accelerometer, camera, etc) can be fed back into the web page. I was wondering if there were any good tutorials showing these functions interacting with the webview. So far I've found ways for the WebView to send javascript commands to the web page, but those interactions haven't been triggered from outside the web view (such as upon receiving an intent from the GPS or accelerometer). Note: The HTML5 Geolocation API is not what I'm interested in. I'm interested in the web page <- WebView interactions, as noted here: http://android-developers.blogspot.com/2008/09/using-webviews.html

    Read the article

  • Built in python hash() function

    - by sm1
    Windows XP, Python 2.5: hash('http://stackoverflow.com') Result: 1934711907 Google App Engine (http://shell.appspot.com/): hash('http://stackoverflow.com') Result: -5768830964305142685 Why is that? How can I have a hash function which will give me same results across different platforms (Windows, Linux, Mac)?

    Read the article

  • save selected row in UITableView after reloadData

    - by vinnitu
    I write custom jabber client in iphone. I use xmppframework as engine. And I have UITableViewController with NSMutableArray for repesent contact list. When i receive(or somebody change it contents) roster (aka contact list) i wanna change UITableView items (add/remove/modify). So if User work with listView at time when list updates by [items addObject:newItem]; [self.tableView reloadData]; user lost current selection item. So, my question is howto save (if possible, i mean if given selected item not removed) current select item after reloadData? Thx.

    Read the article

  • Reversible numerical calculations in Prolog

    - by user8472
    While reading SICP I came across logic programming chapter 4.4. Then I started looking into the Prolog programming language and tried to understand some simple assignments in Prolog. I found that Prolog seems to have troubles with numerical calculations. Here is the computation of a factorial in standard Prolog: f(0, 1). f(A, B) :- A > 0, C is A-1, f(C, D), B is A*D. The issues I find is that I need to introduce two auxiliary variables (C and D), a new syntax (is) and that the problem is non-reversible (i.e., f(5,X) works as expected, but f(X,120) does not). Naively, I expect that at the very least C is A-1, f(C, D) above may be replaced by f(A-1,D), but even that does not work. My question is: Why do I need to do this extra "stuff" in numerical calculations but not in other queries? I do understand (and SICP is quite clear about it) that in general information on "what to do" is insufficient to answer the question of "how to do it". So the declarative knowledge in (at least some) math problems is insufficient to actually solve these problems. But that begs the next question: How does this extra "stuff" in Prolog help me to restrict the formulation to just those problems where "what to do" is sufficient to answer "how to do it"?

    Read the article

  • Declare in .h file? iPhone SDK

    - by Henry D'Andrea
    How would I declare this code in the header file (.h) in iPhone SDK? (void) save { UIGraphicsBeginImageContext(self.view.frame.size);  [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil); }

    Read the article

  • Support Open Source Projects via T-Shirts

    - by The MYYN
    Can we get a list of free and open source projects, which can be supported through purchasing branded garment? Free Software Foundation http://shop.fsf.org/ OpenBSD https://https.openbsd.org/cgi-bin/order Mozilla http://store.mozilla.org/ ps. I know this is extremly off-topic. But I'd like to buy clothing and support open source at the same time. And I'd like to know, where this is possible.

    Read the article

  • Problems importing WAR files in Eclipse?

    - by CitadelCSAlum
    I was unfortunately forced to result to uploading a WAR file as my backup for a web application I am working on. Luckily I have the most recent WAR file available. I am using Eclipse IDE and am using the Web Tools plugin for all the J2EE work that I am doing with the Dynamic Web Application Project. When I imported my WAR file, and ran it on a local server, everything works fine. The problem I a ran into is that in the Java Resources/src folder that all my packages and .java files were now only consists of all the same packages, but they are empty. I checked to see if I could find the files and I found the .class files in an "Imported files" folder that is not accessible in the Eclipse Project Explorer. I believe that I need to do some type of build or something so that my .java files are available for me, but unfortunately this is one area where I lack. One thing I would also like to know is, one way or the other, am I able to obtain the .java source code files if I have access to the .class files? Also, I would like to configure this environment as it was before where my Java Resources:src folder contaiend the packages and .java files.

    Read the article

  • is there a way using Ruby's net/http to post form data to an http proxy?

    - by Derek P.
    I have a basic Squid server setup and I am trying to use Ruby's Net::HTTP::Proxy class to send a POST of form data to a specified HTTP endpoint. I assumed I could do the following: Net::HTTP::Proxy(my_host, my_port).start(url.host) do |h| req = Net::HTTP::Post.new(url.path) req.form_data = { "xml" => xml } h.request(req) end But, alas, proxy vs. non-proxied Net::HTTP classes don't seem to use the proxy IP Address. my remote service responds telling me that it received a request from the wrong IP address, ie: not the proxy. I am looking for a specific way to write the procedure, so that I can successfully send a form post via a proxy. Help? :)

    Read the article

  • Arithmetic operators and function calling in C

    - by Robert Dalton
    I'm not quite sure why I can't do double a = (float) my_Function(45) / 2048 / 2340 / 90; printf("%.4",a); // prints out 0.00 But instead I have to use one more variable as: double a = (float) my_Function(45); double b = (float) a / 2048 / 2340 / 90; printf("%.4",b); // prints out the correct value

    Read the article

  • (iPhone) Instruments can't "Attach to Process"

    - by AlexLive
    Actually, I'm using a second generation Ipod Touch. What I'm trying to do is to debug my app on XCode and look for any memory leaks on Instruments at the same time. Is it even possible? Because the "Attach to Process" submenu lists when my app is running (or debugging in this case) but all the items inside this menu are disabled. All I can do is start the app from Instruments but later I come across some bug and I want to see the variables and properties affected. I'm also new to Instruments. Please, could someone give me any advice? Help would be greatly appreciated!

    Read the article

  • Why addming permissions to an existing AppDomain has no effect?

    - by MainMa
    Hi, I have a following code which behaves strangely in .NET 4.0: // AppDomain is created, and permissions which were added to `sandboxPermissions` are added successfully. sandboxAppDomain = AppDomain.CreateDomain("SandboxDomain", null, appDomainSetup, sandboxPermissions, new[] { commonStrongName }); // Trying to add a new permission to an AppDomain which is already created. sandboxAppDomain.PermissionSet.AddPermission(new FileIOPermission(FileIOPermissionAccess.AllAccess, @"C:\Some\Path\Here")); // Setting breakpoint to this line: `permissions` contains every permission which was added to `sandboxPermissions`, but no trace of C:\Some\Path\Here related permission. var permissions = sandboxAppDomain.PermissionSet.ToXml(); Every permission added before creating an AppDomain is just here, as expected. But adding permissions after an AppDomain is created has no effect at all. There are no exceptions thrown (nor first-chance ones). What can it be? If the framework method (AddPermission) fails to do what it was expected to do, mustn't it throw an exception?

    Read the article

  • How can someone with no experience learn how to program?

    - by Mugatu
    A friend and I have been coming up with website ideas for a couple years, mostly just jotting them down whenever we come up with a good, useful idea when browsing the web. For the past 6 months we've hired a couple different programmers to make a couple of the sites for us, but have been disappointed with how it's gone. Been too slow and too many miscommunications for our liking. So like the saying goes if you want something done right do it yourself, we're going to do it ourselves. I know nothing about programming, I've never written a line of code in my life. I consider myself very good with math and about as logical as you can get, but I have zero real-life programming knowledge. The sites we want to make are all pretty 'Web 2.0'ish', meaning user-generated content, commenting on posts, pages that change on the fly, etc. So here are some of my questions for anyone who's been there before: Is there a language you'd recommend learning first? Something that is a good indicator how most other languages work? What web programming languages do you recommend learning first based on popularity both now and the future. I don't want to learn a language that's going to be outdated by the time I'm an expert at it. Any specific books you'd recommend? Any general advice you'd give to someone literally starting at square zero for coding who plans on being in it for the long haul?

    Read the article

  • How to force disconnect users from a box?

    - by LikeToCode
    how do you disconnect an active user logged in to a box? There should be a command line tool that comes with Windows, but I forgot it's name. It lists all the users logged in to a box and you can force disconnect of some, because, for example, you want to Remote Desktop to it and there's too many users.

    Read the article

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