Daily Archives

Articles indexed Tuesday March 16 2010

Page 10/130 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How do I make silverlight button transparent while showing the image?

    - by jadoti
    I have a button that is programatically created, it's content is a stack panel with an image and a textblock. This all works great. I want to make the button behind the image and text transparent, so that the image and text looks like it's sitting on the background, but still have all the properties of the button (i.e. someone clicks in the button region it still registers the button click event). I have been playing with opacities, but every opacity I play with dealing with the button seems to set the whole button (image and text included) to that opacity value as well. How can I make the button opaque while making the text and image content still visible? Oh, this is silverlight 3. Thanks in advance.

    Read the article

  • jQuery CDN host with vsdoc?

    - by Guy
    Following on from this question (that I asked) and this question (that Simon asked), is there a CDN that provides the jQuery script AND the -vsdoc version side-by-side? e.g. Google provide: http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js but don't provide http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min-vsdoc.js Does Microsoft have a CDN for jQuery?

    Read the article

  • Wordpress login system

    - by user293486
    Hi I am new to wordpress. I'm creating template in wordpress with php.I would like to know how to integrate my own login page (which contain two boxes i.e, user name & password) with wordpress login system. Please anyone give a solution. Thanks in advance. by vinoth .J

    Read the article

  • UITextView autoscroll to last line

    - by MihaiD
    Hi *, When writing in a UITextView more text than can fit entirely inside it, the text will scroll up and the cursor will often place itself one or two lines above the view's bottom line. This is a bit frustrating as I want my application to make good use of the entire height of the text view. Basically what I want is to configure the UITextView to write up to it's lowest part and not use it just for scrolling. I've seen some similar questions here, here and here. However I've not seen a proper solution yet. Thanks

    Read the article

  • Python named print?

    - by Mark
    I know it's a really simple question, but I have no idea how to google it. how can I do print '<a href="%s">%s</a>' % (my_url) So that my_url is used twice? I assume I have to "name" the %s and then use a dict in the params, but I'm not sure of the proper syntax? just FYI, I'm aware I can just use my_url twice in the params, but that's not the point :)

    Read the article

  • Helping using FirePHP to debug a .php application

    - by Angela
    Hi, just set up FirePHP and using a framework called Qcodo / Qcubed. Has anyone heard of these on SO? Been having challenges debugging -- trying to do a fairly simple new() and save() and then output via Ajax but not getting any kind of responsiveness from errors. Any help for us, two of us have checked it out but can't seem to get a response. Thanks! BTW, here's the class which seems to be creating the problems: http://github.com/allyforce/AF-upload/blob/master/Library/Target1.class.php

    Read the article

  • How to invoke WPF Dispatcher in Nunit?

    - by Reporting Avatar
    I want to test an application which renders a text block with a data field value. I would like to get the actual width and actual height, once the rendering completes. Everything works fine. The problem came first, when I tried to test the application. I'm unable to invoke the dispatcher from the test project. Following is the code. this.Loaded += (s, e) => { TextBlock textBlock1 = new TextBlock(); //// Text block value is assigned from data base field. textBlock1.Text = strValueFromDataBaseField; //// Setting the wrap behavior. textBlock1.TextWrapping = TextWrapping.WrapWithOverflow; //// Adding the text block to the layout canvas. this.layoutCanvas.Children.Add(textBlock1); this.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)(() => { //// After rendering the text block with the data base field value. Measuring the actual width and height. this.TextBlockActualWidth = textBlock1.ActualWidth; this.TextBlockActualHeight = textBlock1.ActualHeight; //// Other calculations based on the actual widht and actual height. } )); }; I've just started using the NUnit. So, please help me. Thanks

    Read the article

  • Matlab and MrVista

    - by AnnaRaven
    I'm new to MATLAB and mrVista. I'm running Matlab Version 7.8.0.347 (R2009a) 32-bit(win32) from February 12, 2009 OS is Windows 7 Professional I downloaded the most recent MrVista_hourly.zip and extracted it into my C:\Program_Files_(x86)\MATLAB directory. I think I need to run mrvInstall, but when I do, I get the following: EDU>> mrvInstall Checking VISATSOFT installation. Windows, 32-bit, installation Checking and possibly installing .NET framework. This can take several minutes Checking for visualization library (.dll) files. You are missing msvcp70.dll. So, I'm completely lost at this point. Do I just need to download msvcp70.dll from the net? If so, is there a safe place to download it from? If there's some other way I'm supposed to get mrVista to work from MATLAB, instead of mrvInstall, please let me know that. Thanks in advance for your help. EDIT: I've downloaded and installed the dll and still isn't working. I'll go ask on Super User. Thanks for trying to help anyway.

    Read the article

  • LINQ: why does this query not work on an ArrayList?

    - by Benny
    public static ArrayList GetStudentAsArrayList() { ArrayList students = new ArrayList { new Student() { RollNumber = 1,Name ="Alex " , Section = 1 ,HostelNumber=1 }, new Student() { RollNumber = 2,Name ="Jonty " , Section = 2 ,HostelNumber=2 } }; return students; } The following code doesn't compile. The error is ArrayList is not IEnumerable ArrayList lstStudents = GetStudentAsArrayList(); var res = from r in lstStudents select r; This compiles: ArrayList lstStudents = GetStudentAsArrayList(); var res = from Student r in lstStudents select r; Can anybody explain what the difference is between these two snippets? Why the second works?

    Read the article

  • Forms Auth: have different credentials for a subdirectory?

    - by Fyodor Soikin
    My website has forms authentication, and all is well. Now I want to create a subdirectory and have it also password-protected, but! I need the subdirectory to use a completely different set of logins/passwords than the whole website uses. Say, for example, I have users for the website stored in the "Users" table in a database. But for the subdirectory, I want the users to be taken from the "SubdirUsers" table. Which probably has a completely different structure. Consequently, I need the logins to be completely parallel, as in: Logging into the whole website does not make you logged into the subdirectory as well Clicking "logout" on the whole website does not nullify your login in the subdirectory And vice versa I do not want to create a separate virtual application for the subdirectory, because I want to share all libraries, user controls, as well as application state and cache. In other words, it has to be the same application. I also do not want to just add a flag to the "Users" table indicating whether this is a whole website user or the subdirectory user. User lists have to come from different sources. For now, the only option that I see is to roll my own Forms Auth for the subdirectory. Anybody can propose a better alternative?

    Read the article

  • Associate List<T>.Remove to an event in C#?

    - by Uri
    Hi guys, I have a Products:List<Product> class. I'd like to make it so that every time that I remove an item from that list, my program decreases a counter. Is there a way to do it without overriding the Remove method or decreasing it manually? And if there is none, anybody knows where I can find the code for the Remove method? Thanks! I thought about associating the Remove method to an event, but I don't know how to do it without overriding it or creating another method with the Remove method inside it. Excuse me for my ignorance, but I'm just getting into OOP programming.

    Read the article

  • Given year, month and day, all in int, how would I generate an NSDate

    - by BU
    I think the solution is really simple, I just haven't come across it online. Suppose I am given int year, int month, int day, int hour, int min, int sec.. how do I generate NSDate out of it? I know we can use [NSDate initWithString:] but I think it gets complicated if month/day/hour/min/sec are one digit numbers. Thanks in advance for your help.

    Read the article

  • Center content of UISCrollView when smaller

    - by hgpc
    I have an UIImageView inside a UIScrollView which I use for zooming and scrolling. If the image/content of the scroll view if bigger than the scroll view everything works fine. However, when the image becomes smaller than the scroll view, it sticks to the top left corner of the scroll view. I would like to keep it centered, like the Photos app. Any ideas or examples about keeping the content of the UIScrollView centered when smaller? I am working with iPhone 3.0. The following code almost works. The image returns to the top left corner if I pinch it after reaching the minimum zoom level. - (void)loadView { [super loadView]; // set up main scroll view imageScrollView = [[UIScrollView alloc] initWithFrame:[[self view] bounds]]; [imageScrollView setBackgroundColor:[UIColor blackColor]]; [imageScrollView setDelegate:self]; [imageScrollView setBouncesZoom:YES]; [[self view] addSubview:imageScrollView]; UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"WeCanDoIt.png"]]; [imageView setTag:ZOOM_VIEW_TAG]; [imageScrollView setContentSize:[imageView frame].size]; [imageScrollView addSubview:imageView]; CGSize imageSize = imageView.image.size; [imageView release]; CGSize maxSize = imageScrollView.frame.size; CGFloat widthRatio = maxSize.width / imageSize.width; CGFloat heightRatio = maxSize.height / imageSize.height; CGFloat initialZoom = (widthRatio heightRatio) ? heightRatio : widthRatio; [imageScrollView setMinimumZoomScale:initialZoom]; [imageScrollView setZoomScale:1]; float topInset = (maxSize.height - imageSize.height) / 2.0; float sideInset = (maxSize.width - imageSize.width) / 2.0; if (topInset < 0.0) topInset = 0.0; if (sideInset < 0.0) sideInset = 0.0; [imageScrollView setContentInset:UIEdgeInsetsMake(topInset, sideInset, -topInset, -sideInset)]; } - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { return [imageScrollView viewWithTag:ZOOM_VIEW_TAG]; } /************************************** NOTE **************************************/ /* The following delegate method works around a known bug in zoomToRect:animated: */ /* In the next release after 3.0 this workaround will no longer be necessary */ /**********************************************************************************/ - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale { [scrollView setZoomScale:scale+0.01 animated:NO]; [scrollView setZoomScale:scale animated:NO]; // END Bug workaround CGSize maxSize = imageScrollView.frame.size; CGSize viewSize = view.frame.size; float topInset = (maxSize.height - viewSize.height) / 2.0; float sideInset = (maxSize.width - viewSize.width) / 2.0; if (topInset < 0.0) topInset = 0.0; if (sideInset < 0.0) sideInset = 0.0; [imageScrollView setContentInset:UIEdgeInsetsMake(topInset, sideInset, -topInset, -sideInset)]; }

    Read the article

  • Right-click context menu for Java JTree?

    - by arcanex
    I'm trying to implement pop-up menus in Java JTree. I've sub-classed DefaultTreeCellRenderer (to change node appearance) and DefaultTreeCellEditor (to create Components to attach event listeners to, since apparently the Components that DefaultTreeCellRenderer.getTreeCellRendererComponent() returns can't do it?). I don't really want to "edit" the nodes, just be able to pop-up a menu when a node gets right-clicked, but this is the only way I can think of doing it right now... Below is the code that I have so far-- I'm just trying to figure out how to capture MouseEvents. It sort of works, but badly. What's a better way to accomplish what I'm trying to do here? private class My_TreeCellRenderer extends DefaultTreeCellRenderer { My_TreeCellRenderer() { super (); } public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); // set label text and tool tips setText(((My_Object)value).getTreeLabel()); setToolTipText(((My_Object)value).getTreeToolTip()); return this; } } private class My_TreeCellEditor extends DefaultTreeCellEditor { private MouseAdapter ma; My_TreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer) { super (tree, renderer); ma = new MouseAdapter() { public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { System.out.println("My Popup"); } } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { System.out.println("My Popup"); } } }; } public Component getTreeCellEditorComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row) { String src_filename = null; // return non-editing component Component c = renderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, true); // add mouse listener if it's not listening already MouseListener mouseListeners[] = c.getMouseListeners(); int i; for (i=0; i < mouseListeners.length && mouseListeners[i] != ma; i++); if (i >= mouseListeners.length) c.addMouseListener(ma); return c; } protected boolean canEditImmediately(EventObject event) { if (event instanceof MouseEvent && ((MouseEvent)event).getClickCount() == 1) return true; else return false; } }

    Read the article

  • Cancel UDP recvfrom in C on Unix

    - by hora
    I'm just starting to learn how network programming in C works, and I've written a small program that sends messages to and from a UNIX terminal. I'm using pthreads in my program, one of which essentially just waits on recvfrom() to receive a message. However, I want to be able to close all threads properly if the users chooses to quit the program. The way I have it set up right now, a different thread just cancels the thread waiting on recvfrom, but I'm worried this might not be a good idea since I'm leaving sockets unclosed and I'm not freeing all the memory I allocated. Is there a way to cancel a recvfrom() call, or some way to run a certain routine upon cancelling a pthread? Thanks.

    Read the article

  • Using JSON with jRails

    - by Zachary
    I am currently trying to use AJAX in my application via jRails. I am trying to return a JSON object from my controller, and then parse it in my Javascript. I am using json2.js to do the parsing. Here is the code I currently have: function getSomething() { $.ajax({ type: "GET", url: "map/testjson", success: function(data) { var myData = JSON.parse(data[0]); window.alert(myData.login); } }); } and in the controller: class Map::MapController < ApplicationController def index end def testjson @message = User.find(:all) ActiveRecord::Base.include_root_in_json = false respond_to do |w| w.json { render :json => @message.to_json } end end end The window.alert simply says 'undefined' (without tics). However, if I change the javascript to window.alert(data) (the raw object returned by the controller) I get: [{"salt":"aSalt","name":"", "created_at":"2010-03-15T02:34:25Z","remember_token_expires_at": null,"crypted_password":"aPassword", "updated_at":"2010-03-15T02:34:25Z","id":1,"remember_token":null, "login":"zgwrig2","email":"[email protected]"}] This looks like an array of size 1, if I'm looking at it correctly, but I have tried just about every combination of JSON.parse on the data object that I can think of, and nothing seems to work. Any ideas on what I'm doing wrong here?

    Read the article

  • Microsoft Silverlight Analytics Framework - Day 2 Part 2 of MIX 2010

    - by GeekAgilistMercenary
    I went to the session on Microsoft Silverlight Analytics Framework (MSAF) today while here at MIX 2010.  It was a great walk through the features, ideas, and what the end goal is.  Michael Scherotter did a great job of lining up the ideas, intentions, and the functional ideas behind the framework. The framework is built around the Silverlight Behaviors.  If you aren't sure what behaviors are, check out these entries from Nikhilk.net Silverlight Behaviors, Silverlight 3 Drag Behavior, An Introduction to Behaviors, Triggers, and Actions, and of course the MSDN Documentation on the matter. Some of the key features of the framework is to support out-of-browser scenarios, which works perfectly with out Webtrends DX Web Services.  Offline scenarios, which again, we have worked toward supporting at Webtrends DC Web Services via caching and other criteria as needed.  Another feature that I was really stoked about is the Microsoft Expression Blend integration that removes the need for coding, thus simplifying the addition of analytics components based on events or other actions within a Silverlight Application.  This framework also easily supports A/B Testing (again, something we do quit a bit of at Webtrends with Webtrends Optimize. The last thing I really wanted to point out was the control support that this framework has support in already from Telerik RadControls, Smooth Streaming Media Element, and Microsoft Silverlight Media Framework Player 1.0.  These are implemented with behaviors and handlers exposed via MEF (Managed Extensibility Framework). All in all, great second day, great analytics framework for Silverlight, and great presentation.  Until tomorrow, adieu. For this original entry and all sorts of other technical gibberish I write, check out my other blog Agilist Mercenary.

    Read the article

  • C# 4 Named Parameters for Overload Resolution

    - by Steve Michelotti
    C# 4 is getting a new feature called named parameters. Although this is a stand-alone feature, it is often used in conjunction with optional parameters. Last week when I was giving a presentation on C# 4, I got a question on a scenario regarding overload resolution that I had not considered before which yielded interesting results. Before I describe the scenario, a little background first. Named parameters is a well documented feature that works like this: suppose you have a method defined like this: 1: void DoWork(int num, string message = "Hello") 2: { 3: Console.WriteLine("Inside DoWork() - num: {0}, message: {1}", num, message); 4: } This enables you to call the method with any of these: 1: DoWork(21); 2: DoWork(num: 21); 3: DoWork(21, "abc"); 4: DoWork(num: 21, message: "abc"); and the corresponding results will be: Inside DoWork() - num: 21, message: Hello Inside DoWork() - num: 21, message: Hello Inside DoWork() - num: 21, message: abc Inside DoWork() - num: 21, message: abc This is all pretty straight forward and well-documented. What is slightly more interesting is how resolution is handled with method overloads. Suppose we had a second overload for DoWork() that looked like this: 1: void DoWork(object num) 2: { 3: Console.WriteLine("Inside second overload: " + num); 4: } The first rule applied for method overload resolution in this case is that it looks for the most strongly-type match first.  Hence, since the second overload has System.Object as the parameter rather than Int32, this second overload will never be called for any of the 4 method calls above.  But suppose the method overload looked like this: 1: void DoWork(int num) 2: { 3: Console.WriteLine("Inside second overload: " + num); 4: } In this case, both overloads have the first parameter as Int32 so they both fulfill the first rule equally.  In this case the overload with the optional parameters will be ignored if the parameters are not specified. Therefore, the same 4 method calls from above would result in: Inside second overload: 21 Inside second overload: 21 Inside DoWork() - num: 21, message: abc Inside DoWork() - num: 21, message: abc Even all this is pretty well documented. However, we can now consider the very interesting scenario I was presented with. The question was what happens if you change the parameter name in one of the overloads.  For example, what happens if you change the parameter *name* for the second overload like this: 1: void DoWork(int num2) 2: { 3: Console.WriteLine("Inside second overload: " + num2); 4: } In this case, the first 2 method calls will yield *different* results: 1: DoWork(21); 2: DoWork(num: 21); results in: Inside second overload: 21 Inside DoWork() - num: 21, message: Hello We know the first method call will go to the second overload because of normal method overload resolution rules which ignore the optional parameters.  But for the second call, even though all the same rules apply, the compiler will allow you to specify a named parameter which, in effect, overrides the typical rules and directs the call to the first overload. Keep in mind this would only work if the method overloads had different parameter names for the same types (which in itself is weird). But it is a situation I had not considered before and it is one in which you should be aware of the rules that the C# 4 compiler applies.

    Read the article

  • Silverlight 4 and Windows Phone Development

    - by Bobby Diaz
    There were a lot of announcements made during the keynote at MIX10 today, most notable were the releases of Silverlight 4 RC, Silverlight 4 Tools for Visual Studio 2010, Expression Blend 4 Beta and the Windows Phone 7 Developer Tools.  I was glad to see that developers will be able to use Silverlight to create awesome applications for Windows Phone 7 so we can reuse our WPF and Silverlight skills to target mobile devices! With so much information coming out of this conference, I wanted to be sure to save a list of links that I can quickly reference as I learn about these exciting new technologies: Silverlight 4 A guide to what has changed in the Silverlight 4 RC Silverlight 4 Beta – A guide to the new features WCF RIA Services Silverlight 4 Information Silverlight Toolkit  March 2010 Release  was still showing Nov09 at time of posting… Windows Phone 7 Getting Started with Silverlight and Windows Phone 7 Development Building your first Silverlight for Windows Phone Application Silverlight for Windows Phone Windows Phone for Developers Developing for Windows Phone 7 Series Whew, and that’s just from day 1!  Can’t wait to see what else comes out tomorrow.  Hopefully these links will give you a good starting point for Silverlight 4 and Windows Phone 7 information. Enjoy!

    Read the article

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