Daily Archives

Articles indexed Tuesday May 11 2010

Page 21/123 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Gracefully Handling Deadlocks

    - by Derek Dieter
    In some situations, deadlocks may need to be dealt with not by changing the source of the deadlock, but by changing handling the deadlock gracefully. An example of this may be an external subscription that runs on a schedule deadlocking with another process. If the subscription deadlocks then it would be ok to [...]

    Read the article

  • How do you create multiple versions of an ActiveX control?

    - by Peter Ruderman
    Hopefully this is a straightforward question, but googling has proved fruitless (and frustrating, to say the least). Links to good documentation would be greatly appreciated. Here's the problem. We have a web application with an associated ActiveX control. (The control wraps a crufty old MFC application if it matters.) Moving forward, we expect to release multiple versions of this application, and each will have a corresponding version of the control. If someone accesses two versions of the web application, then that user should end up with two different versions of the control on his system. (The controls should play nice and not clobber each other.) In addition, I want to automate this process. Our system has a global version number that applies to all components. If we change the version number, the next build should produce a new version of the control. What's the best way to do this?

    Read the article

  • Is it possible to use Dependency Injection/IoC on an ASP.NET MVC FilterAttribute ?

    - by Pure.Krome
    Hi folks, I've got a simple custom FilterAttribute which I use decorate various ActionMethods. eg. [AcceptVerbs(HttpVerbs.Get)] [MyCustomFilter] public ActionResult Bar(...) { ... } Now, I wish to add some logging to this CustomFilter Action .. so being a good boy, I'm using DI/IoC ... and as such wish to use this pattern for my custom FilterAttribute. So if i have the following... ILoggingService and wish to add this my custom FilterAttribute .. i'm not sure how. Like, it's easy for me to do the following... public class MyCustomFilterAttribute : FilterAttribute { public MyCustomFilterAttribute(ILoggingService loggingService) { ... } } But the compiler errors saying the attribute which decorates my ActionMethod (listed above...) requires 1 arg .. so i'm just not sure what to do :(

    Read the article

  • Android - Custom Widget doesnt update

    - by david
    Hi, I'm trying to make a widget to my app, but it doesnt update. I just need to change the textview text and open an activity when a press a button, but none of them works... the code public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.newswidget); views.setTextViewText(R.id.tvNews, "prueba1"); views.setString(R.id.tvNews, "setText", "prueba3"); Intent intent = new Intent(context, DoctorChatAndroid.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.ibNext, pendingIntent); for (int i = 0; i < appWidgetIds.length; i++) { appWidgetManager.updateAppWidget(i, views); } the layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageButton android:id="@+id/ibNext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_media_ff" android:layout_alignParentRight="true"/> <ImageButton android:id="@+id/ibLast" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_media_rew" android:layout_toLeftOf="@id/ibNext"/> <TextView android:id="@+id/tvNews" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/nwNoNewAnswer" android:layout_toLeftOf="@id/ibLast"/> </RelativeLayout> the other xml thx a lot!!!

    Read the article

  • A question about paypal IPN

    - by user304828
    i download sample code from https://cms.paypal.com/cms_content/US/en_US/files/developer/nvp_DoDirectPayment_php.txt run and get TIMESTAMP=2010%2d05%2d11T04%3a42%3a06Z&CORRELATIONID=ac15852d1e958&ACK=Failure&VERSION=51%2e0&BUILD=1268624&L_ERRORCODE0=10002&L_SHORTMESSAGE0=Security%20error&L_LONGMESSAGE0=Security%20header%20is%20not%20valid&L_SEVERITYCODE0=Error' (length=233) what is problem ? api username ? api pass ? signature or anything else ? this infor i fill in source code: // Set request-specific fields. $paymentType = urlencode('Authorization'); // or 'Sale' $firstName = urlencode('Nguyen'); $lastName = urlencode('Quang Trung'); $creditCardType = urlencode('Visa'); $creditCardNumber = urlencode(' 4111111111111111'); $expDateMonth = '04'; // Month must be padded with leading zero $padDateMonth = urlencode(str_pad($expDateMonth, 2, '0', STR_PAD_LEFT)); $expDateYear = urlencode('2015'); $cvv2Number = urlencode('5360 '); $address1 = urlencode('ha noi'); $address2 = urlencode('hcm'); $city = urlencode('ha noi'); $state = urlencode('ha noi state'); $zip = urlencode('84'); $country = urlencode('viet nam'); // US or other valid country code $amount = urlencode('900'); $currencyID = urlencode('USD'); // or other currency ('GBP', 'EUR', 'JPY', 'CAD', 'AUD')

    Read the article

  • Getting proper indentation using XMLBuilder in a helper

    - by Robbie
    I'm attempting to use a view helper to create some dynamic links based on if you're logged in or not. What I want returned, for sake of easy code readability, is: <ul class="right"> <li><a href="#">Login</a></li> <li><a href="#">Register</a></li> </ul> In the view helper I have this Ruby code: def loginh xm = Builder::XmlMarkup.new(:indent=>2, :margin=>4) xm.ul("class" => "right") { xm.li('class' => 'text') { xm.text("test") } } end In the view, the line that calls login helper is already indented 4 levels. Because of this, the first line gets 'skewed', so in the view I have: <%= loginh %> Which results in: <ul class="right"> <li class="text"> <text>test</text> </li> </ul> You can see it works perfectly, except for the first line. It would appear that the first line is affected by the indent before <%= loginh % is called. I can easily remedy this by removing the indentation prior to <%= loginh % - but in essence I'd be sacrificing code readability for markup readability. Which isn't what I'm looking to do. Is there any way I could remove the beginning whitespace?

    Read the article

  • Elegantly Handle Repetitive Property Code in C#

    - by Eric J.
    The language shortcut public string Code { get; set; } saves a bit of typing when defining trivial properties in C#. However, I find myself writing highly repetitive, not-quite-as-trivial property code that still follows a clear pattern e.g. public string Code { get { return code; } set { if (code != value) { code = value; NotifyPropertyChanged("Code"); } } } I can certainly define a Visual Studio snippet to reduce typing. However, if I need to add something to my pattern, I have to go back and change quite a bit of existing code. Is there a more elegant approach? Is a snippet the best way to go?

    Read the article

  • Cucumber, capybara and selenium - Submiting a form without a button

    - by Daniel Cukier
    I have a test using Cucumber, capybara and selenium driver. This test should go to a form and submit it. The normal text would be Scenario: Fill form Given I am on the Form page When I fill in "field1" with "value1" And I fill in "field2" with "value2" And I press "OK" Then I should see "Form submited" The problem is that I don't have the OK button in the form I need a way to do the "form.submit", without clicking any button or link - the same as happens when you press ENTER when you are in a form field using the browser. I don't know how to tell capybara to submit a form. How can I do it?

    Read the article

  • Using a Resource as an Attribute to a HTML Element in ASP.net

    - by Michael Stum
    I would like to have this piece of code in my .aspx file: <input class="ms-ButtonHeightWidth" type="button" name="BtnOK" id="Button2" value="Close" onclick="javascript:HandleOKButtonClick()" accesskey="<%$Resources:wss,okbutton_accesskey%>" /> Unfortunately, ASP.net doesn't seem to like that: An error occurred during the processing of /_layouts/MyPage/Info.aspx. Literal expressions like '<%$Resources:wss,okbutton_accesskey%>' are not allowed. Use <asp:Literal runat="server" Text="<%$Resources:wss,okbutton_accesskey%>" /> instead That doesn't work in this situation as that would mean nesting the Literal between the quotes of the accesskey attribute, which causes a "The tag contains duplicate 'ID' attributes" error. Is there a way to use a string from a resource without having to change the input to an asp:Button? I guess there has to be a way using <%=, but I don't know how I would address the resource itself?

    Read the article

  • Firebug kills -webkit Settings in CSS File - Why?

    - by Johnny
    style.css - Original File .box { -webkit-border-radius:8px; -moz-border-radius:8px; padding:10px; } style.css - In Firebug CSS Console .box { -moz-border-radius:8px 8px 8px 8px; padding:10px; } How can I force Firebug to show my -webkit css styles as well? Thanks for your help!

    Read the article

  • How to create Chat application using Servlets & JSP

    - by Crazy boy
    I want to create chat application using Servlets & JSP. May I know how can I create chat application as I have never created before? How much knowledge I need to have to create chat application? Is there any need of networking API to create chat application? What's the design pattern I need to follow to create that application? Is there any need of database?

    Read the article

  • Efficient way to combine results of two database queries.

    - by ensnare
    I have two tables on different servers, and I'd like some help finding an efficient way to combine and match the datasets. Here's an example: From server 1, which holds our stories, I perform a query like: query = """SELECT author_id, title, text FROM stories ORDER BY timestamp_created DESC LIMIT 10 """ results = DB.getAll(query) for i in range(len(results)): #Build a string of author_ids, e.g. '1314,4134,2624,2342' But, I'd like to fetch some info about each author_id from server 2: query = """SELECT id, avatar_url FROM members WHERE id IN (%s) """ values = (uid_list) results = DB.getAll(query, values) Now I need some way to combine these two queries so I have a dict that has the story as well as avatar_url and member_id. If this data were on one server, it would be a simple join that would look like: SELECT * FROM members, stories WHERE members.id = stories.author_id But since we store the data on multiple servers, this is not possible. What is the most efficient way to do this? Thanks.

    Read the article

  • asp.net datasource in memory which component suites this better?

    - by Mike
    I need to create a page that has a listbox with databound items. Upon clicking an entry in the listbox, the page will postback and insert an entry into a listview. The listview should have the item's name, and a textbox allowing the user to edit the value for each. I don't want the listview to be in "edit" mode. I just want the user to be able to update the value. Is this possible?

    Read the article

  • Pinning Projects and Solutions with Visual Studio 2010

    - by ScottGu
    This is the twenty-fourth in a series of blog posts I’m doing on the VS 2010 and .NET 4 release. Today’s blog post covers a very small, but still useful, feature of VS 2010 – the ability to “pin” projects and solutions to both the Windows 7 taskbar as well VS 2010 Start Page.  This makes it easier to quickly find and open projects in the IDE. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] VS 2010 Jump List on Windows 7 Taskbar Windows 7 added support for customizing the taskbar at the bottom of your screen.  You can “pin” and re-arrange your application icons on it however you want. Most developers using Visual Studio 2010 on Windows 7 probably already know that they can “pin” the Visual Studio icon to the Windows 7 taskbar – making it always present.  What you might not yet have discovered, though, is that Visual Studio 2010 also exposes a Taskbar “jump list” that you can use to quickly find and load your most recently used projects as well. To activate this, simply right-click on the VS 2010 icon in the task bar and you’ll see a list of your most recent projects.  Clicking one will load it within Visual Studio 2010: Pinning Projects on the VS 2010 Jump List with Windows 7 One nice feature also supported by VS 2010 is the ability to optionally “pin” projects to the jump-list as well – which makes them always listed at the top.  To enable this, simply hover over the project you want to pin and then click the “pin” icon that appears on the right of it: When you click the pin the project will be added to a new “Pinned” list at the top of the jumplist: This enables you to always display your own list of projects at the top of the list.  You can optionally click and drag them to display in any order you want. VS 2010 Start Page and Project Pinning VS 2010 has a new “start page” that displays by default each time you launch a new instance of Visual Studio.  In addition to displaying learning and help resources, it also includes a “Recent Projects” section that you can use to quickly load previous projects that you have recently worked on: The “Recent Projects” section of the start page also supports the concept of “pinning” a link to projects you want to always keep in the list – regardless of how recently they’ve been accessed. To “pin” a project to the list you simply select the “pin” icon that appears when you hover over an item within the list: Once you’ve pinned a project to the start page list it will always show up in it (at least until you “unpin” it). Summary This project pinning support is a small but nice usability improvement with VS 2010 and can make it easier to quickly find and load projects/solutions.  If you work with a lot of projects at the same time it offers a nice shortcut to load them. Hope this helps, Scott

    Read the article

  • How can I 'git clone' from another machine

    - by hap497
    Hi, In 1 machine (ip 192.168.1.2), I create a git repository by $ cd /home/hap/working $ git init $ (add some files) $ git add . $ git commit -m 'Initial commit' And I have another machine in the same WiFi network, How can I get clone from the other machine? Thank you

    Read the article

  • How to avoid manual editing of manifest file

    - by Atara
    My application uses isolated activeX (outer), that depends on another activeX (inner), both are using registration-free-com. The generated manifest file contains only the information for the outer activeX. (probably because vs cannot know that the outer activeX is using inner activeX ) When I re-build my project, I always need to manually add the information for the inner activeX to the manifest file, otherwise the application only shows the outer, without the inner. Is there a way to inform visual studio (2008) that I do not want it to re-generate the manifest file for each build? Will I have such option if I upgrade to VS2010 ? Thanks, Atara

    Read the article

  • ASP.NET Development Server - Empty webResource.axd after conversion from 2.0 to 3.5

    - by David Casey
    I have moved a project from asp.net 2.0 to 3.5. The original project was using the atlas ajax extensions so I have modified the code to use the built in ajax features in 3.5. When running the project within the dev environemnt (VS2008 on Vista Business SP1) and using the asp.net dev server I receive javascript errors such as WebForm_PostBackOptions which point to a missing handler/module. If I deploy the project and run it stand alone within IIS or if I use Fiddler2 while running in VS2008 I do not see the errors and fiddler shows that the axd files are being downloaded correctly. Also deploying to a 2003 server does not show any issues. I could just carry on and forget this as it works when deployed but I would like to understand what is happening. Has anyone got an ideas as to what is going on here and how to get the same results accross all environments?

    Read the article

  • Refresh UltraGrid's GroupBy Sort on child bands when ListChanged?

    - by Idriss
    I am using Infragistics 2009 vol 1. My UltraGrid is bound to a BindingList of business objects "A" having themself a BindingList property of business objects "B". It results in having two bands: one named "BindingList`1", the other one "ListOfB" thanks to the currency manager. I would like to refresh the GroupBy sort of the grid whenever a change is performed on the child band through the child business object and INotifyPropertyChange. If I group by a property in the child band which is a boolean (let's say "Active") and I subscribe to the event ListChanged on the bindinglist datasource with this event handler: void Grid_ListChanged(object sender, ListChangedEventArgs e) { if (e.ListChangedType == ListChangedType.ItemChanged) { string columnKey = e.PropertyDescriptor.Name; if (e.PropertyDescriptor.PropertyType.Name == "BindingList`1") { ultraGrid.DisplayLayout.Bands[columnKey].SortedColumns.RefreshSort(true); } else { UltraGridBand band = ultraGrid.DisplayLayout.Bands[0]; UltraGridColumn gc = band.Columns[columnKey]; if (gc.IsGroupByColumn || gc.SortIndicator != SortIndicator.None) { band.SortedColumns.RefreshSort(true); } ColumnFilter cf = band.ColumnFilters[columnKey]; if (cf.FilterConditions.Count > 0) { ultraGrid.DisplayLayout.RefreshFilters(); } } } } the band.SortedColumns.RefreshSort(true) is called but It gives unpredictable results in the groupby area when the property Active is changed in the child band: if one object out of three actives becomes inactive it goes from: Active : True (3 items) To: Active : False (3 items) Instead of (which is the case when I drag the column back and forth to the group by area) Active : False (1 item) Active : True (2 items) Am I doing something wrong? Is there a way to restore the expanded state of the rows when performing a RefreshSort(true); ?

    Read the article

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