Search Results

Search found 1590 results on 64 pages for 'bob montgomery'.

Page 8/64 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to create a JAX-RS service where the sub-resource @Path doesn't have a leading slash

    - by Matt
    I've created a JAX-RS service (MyService) that has a number of sub resources, each of which is a subclass of MySubResource. The sub resource class being chosen is picked based on the parameters given in the MyService path, for example: @Path("/") @Provides({"text/html", "text/xml"}) public class MyResource { @Path("people/{id}") public MySubResource getPeople(@PathParam("id") String id) { return new MyPeopleSubResource(id); } @Path("places/{id}") public MySubResource getPlaces(@PathParam("id") String id) { return new MyPlacesSubResource(id); } } where MyPlacesSubResource and MyPeopleSubResource are both sub-classes of MySubResource. MySubResource is defined as: public abstract class MySubResource { protected abstract Results getResults(); @GET public Results get() { return getResults(); } @GET @Path("xml") public Response getXml() { return Response.ok(getResults(), MediaType.TEXT_XML_TYPE).build(); } @GET @Path("html") public Response getHtml() { return Response.ok(getResults(), MediaType.TEXT_HTML_TYPE).build(); } } Results is processed by corresponding MessageBodyWriters depending on the mimetype of the response. While this works it results in paths like /people/Bob/html or /people/Bob/xml where what I really want is /people/Bob.html or /people/Bob.xml Does anybody know how to accomplish what I want to do?

    Read the article

  • PHP / Zend Framework: Force prepend table name to column name in result array?

    - by Brian Lacy
    I am using Zend_Db_Select currently to retrieve hierarchical data from several joined tables. I need to be able to convert this easily into an array. Short of using a switch statement and listing out all the columns individually in order to sort the data, my thought was that if I could get the table names auto-prepended to the keys in the result array, that would solve my problem. So considering the following (assembled) SQL: SELECT user.*, contact.* FROM user INNER JOIN contact ON contact.user_id = user.user_id I would normally get a result array like this: [username] => 'bob', [contact_id] => 5, [user_id] => 2, [firstname] => 'bob', [lastname] => 'larsen' But instead I want this: [user.user_id] => 2, [user.username] => 'bob', [contact.contact_id] => 5, [contact.firstname] => 'bob', [contact.lastname] => 'larsen' Does anyone have an idea how to achieve this? Thanks!

    Read the article

  • Populate tableView with more than one array

    - by Ewoods
    The short version: Is there a way to populate one specific row in a tableView with one value from one array, then populate another row in that same tableView with one value from a different array? For example, cell 1 would have the first value from Array A, cell 2 would have the first value from Array B, cell 3 would have the first value from Array C, etc. The long version: I hope this isn't too confusing. I've got an array of names, and then three more arrays with actions associated with those people. For example, the names array has Jim, Bob, and Sue, and then there's an array for eating, reading, and sleeping that records every time each person does one of these things (all of these arrays are populated from a MySQL database). The names array is used to populate a root tableView. Tapping on one of the names brings up a detail view controller that has another tableView that only has three rows. This part is all working fine. What I want to happen is when I tap on a name, it moves to the detail view and the three cells would then show the last event for that person for each of the three activities. Tapping on one of those three events then moves to a new view controller with a tableView that shows every event for that category. For example, if I tapped on Bob, the second page would show the last time Bob ate, read, and slept. Tapping on the first row would bring up a table that showed every time Bob has eaten. So far I've only been able to populate the second tableView with all of the rows from one of the arrays. I need it the other way around (one row from all of the arrays).

    Read the article

  • Mac Security - Which one?

    - by Bob Rivers
    Hi, Recently I had my credit card cloned. A few hours after shopping at an online store (in which I trust and buy since 2006) I received a call from my bank asking if I recognize a $5,000 debt to a store(?!) called Church of Christ... I'm a Mac user (OS X 10.6.3). I always kept my system updated and I have firewall enabled (in my Mac and in my broadband router), but I decided to adopt some kind of protection. I don't want to rise passionate discussions. Real or not, snake oil or not, I need to have back my peace of mind... I read this and this posts. I selected two software that I think that could help me (both have more features other than just an antivirus). Does someone have feedback about Intego's VirusBarrier X6 or Trendmicro's Smart Surfing? Intego solutions seems to be better, but TrendMicro brand/name is stronger in corporate environment, so their solution should be good. Both solutions have 30 day free trial, but I would like to hear something from you. Any other solution that I should look? TIA, Bob

    Read the article

  • SQL 2K5 - Multiple databases vs. Multiple files

    - by Bob Palmer
    Hey all, quick question. Our current legacy system was built using multiple distinct databases (about ten of them). These are all part of the same discreet system, and a large number of SPs and functionalty span multiple databases. There are also key relationships that span (for example, a header table may be in database A with history, etc. in database B). When deploying multiple copies of our app to the same server therefore, we have to use multiple instances (because the database names are coded into so many sprocs). We're evaluating the idea of taking these ten databases (about 30gb total with individual sizes ranging from 100mb to 10gb) and merging them into a single database. Currently, we have our databases spread accross multiple spindles for better IO. The question I have is whether or not there is any performance loss or benefit of having 10 different databases vs. 10 different database files? i.e. rather than having three databases (A, B, and C) Disk D: A.mdf (1gb) Disk E: B.mdf (4gb) Disk F: C.mdf (10gb) Disk G: A_Log.ldf, B_Log.ldf, C_Log.ldf have one database (X) Disk D: X1.mdf (5gb) Disk E: X2.mdf (5gb) Disk F: X3.mdf (5gb) Disk G: X1_log.ldf,X2_log.ldf,X3_log.ldf Thanks! -Bob

    Read the article

  • Silverlight DataGrid Header Horizontal Alignment

    - by Brandon Montgomery
    I want to change the alignment of a header on a datagrid in Silverlight, and I can't seem to figure out how to do it. Here's what I have so far: <data:DataGridTextColumn Header="#" IsReadOnly="True" ElementStyle="{StaticResource CenterAlignStyle}" Binding="{Binding OutlineNumber, Mode=OneWay}" > <data:DataGridTextColumn.HeaderStyle> <Style TargetType="prim:DataGridColumnHeader"> <Setter Property="HorizontalAlignment" Value="Center"/> </Style> </data:DataGridTextColumn.HeaderStyle> </data:DataGridTextColumn> No matter what I try, I can't seem to change the default alignment, which appears to be "left."

    Read the article

  • Silverlight DataGrid set cell IsReadOnly programatically

    - by Brandon Montgomery
    I am binding a data grid to a collection of Task objects. A particular column needs some special rules pertaining to editing: <!--Percent Complete--> <data:DataGridTextColumn Header="%" ElementStyle="{StaticResource RightAlignStyle}" Binding="{Binding PercentComplete, Mode=TwoWay, Converter={StaticResource PercentConverter}}" /> What I want to do is set the IsReadOnly property only for each task's percent complete cell based on a property on the actual Task object. I've tried this: <!--Percent Complete--> <data:DataGridTextColumn Header="%" ElementStyle="{StaticResource RightAlignStyle}" Binding="{Binding PercentComplete, Mode=TwoWay, Converter={StaticResource PercentConverter}}" IsReadOnly={Binding IsNotLocalID} /> but apparently you can't bind to the IsReadOnly property on a data grid column. What is the best way do to do what I am trying to do?

    Read the article

  • jQuery AJAX slow in Firefox, fast in IE

    - by Brandon Montgomery
    I'm using jQuery to post to an ASP .NET Web Service to implement a custom auto-complete function. The code works great, except it's slow in FireFox (can't get it to go faster than 1 second). IE is blazing fast - works great. I watch the post in Firefox using Firebug. Here's the service code: <ScriptService(), _ WebService(Namespace:="http://tempuri.org/"), _ WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1), _ ToolboxItem(False)> _ Public Class TestWebSvc Inherits System.Web.Services.WebService <WebMethod(), _ ScriptMethod(ResponseFormat:=Script.Services.ResponseFormat.Json, UseHttpGet:=True)> _ Public Function GetAccounts(ByVal q As String) As Object 'Code taken out for simplicity Return result End Function End Class And the jQuery ajax call: $.ajax({ beforeSend: function (req) { req.setRequestHeader("Content-Type", "application/json"); }, contentType: "application/json; charset=utf-8", type: "GET", url: "http://localhost/Suggest/TestWebSvc.asmx/GetAccounts", data: "q='" + element.val() + "'", dataType: "json", success: testWebSvcSuccess }); As you can see, I've tried to use the HTTP GET verb instead in hopes that that would make the call faster. As it does not, I'll probably switch it back to using POST if I can. Right now I'm just focused on why it's super fast in IE and super slow in Firefox. Versions: jQuery 1.3.2; Firefox 3.0.11; IE 8.0.6001.18783 (64-bit) Thank you for any insight you can provide.

    Read the article

  • Making a Text-To-Speech Wrapper in Android

    - by John Montgomery
    I am attempting to create a wrapper class for Google Android's Text-To-Speech functionality. However, I'm having trouble finding a way to have the system pause until after the onInit function has finished. Attached at the bottom is something of a solution I created based on what I found here: http://stackoverflow.com/questions/1160876/android-speech-how-can-you-read-text-in-android However, this solution does not seem to work. Any thoughts on why this might not be working, or what would be a good idea in order to make sure that any Speak() calls happen after my onInit() call? public class SpeechSynth implements OnInitListener { private TextToSpeech tts; static final int TTS_CHECK_CODE = 0; private int ready = 0; private ReentrantLock waitForInitLock = new ReentrantLock(); SpeechSynth( Activity screen ) { ready = 0; tts = new TextToSpeech( screen, this ); waitForInitLock.lock(); } public void onInit(int status) { if (status == TextToSpeech.SUCCESS) { ready = 1; } waitForInitLock.unlock(); } public int Speak( String text ) { if( ready == 1 ) { tts.speak(text, TextToSpeech.QUEUE_ADD, null); return 1; } else { return 0; } } } I have been able to make it so that I can pass a string of text through the constructor, then have it played in the onInit() function. However, I would really like to avoid having to destroy and re-create the whole text-to-speech engine every time I need to have my program say something different.

    Read the article

  • vbCrLf in Multiline TextBox shows up only when .Trim() is called

    - by Brandon Montgomery
    I have an ASP TextBox with TextMode set to MultiLine. I'm having problems with preserving the vbCrLf characters when a user tries to put line breaks into the text. When a button on the page is pressed, I'm taking the text from the control, trimming it using String.Trim, and assigning that value to a String property on an object (which, in turn assigns it to a private internal String variable on the object). The object then takes the value from the private internal variable and throws it into the database using a stored procedure call (the SP parameter it is put into is an nvarchar(4000)). ASPX Page: <asp:UpdatePanel ID="UpdatePanel2" runat="server" RenderMode="Inline" UpdateMode="Conditional" ChildrenAsTriggers="true"> <ContentTemplate> <!-- some other controls and things --> <asp:TextBox TextMode="MultiLine" runat="server" ID="txtComments" Width="100%" Height="60px" CssClass="TDTextArea" Style="border: 0px;" MaxLength="2000" /> <!-- some other controls and things --> </ContentTemplate> </asp:UpdatePanel> code behind: ProjectRequest.StatusComments = txtComments.Text.Trim object property: Protected mStatusComments As String = String.Empty Property StatusComments() As String Get Return mStatusComments.Trim End Get Set(ByVal Value As String) mStatusComments = Value End Set End Property stored proc call: Common.RunSP(mDBConnStr, "ProjectStatusUpdate", _ Common.MP("@UID", SqlDbType.NVarChar, 40, mUID), _ Common.MP("@ProjID", SqlDbType.VarChar, 40, mID), _ Common.MP("@StatusID", SqlDbType.Int, 8, mStatusID), _ Common.MP("@Comments", SqlDbType.NVarChar, 4000, mStatusComments), _ Common.MP("@PCTComp", SqlDbType.Int, 4, 0), _ Common.MP("@Type", Common.TDSqlDbType.TinyInt, 1, EntryType)) Here's the strangest part. When I debug the code, if I type "test test" (without the quotes) into the comments text box, then click the save button and use the immediate window to view the variable values as I step through, here is what I get: ?txtComments.Text "test test" ?txtComments.Text.Trim "test test" ?txtComments.Text(4) " "c ?txtComments.Text.Trim()(4) " "c Anyone have a clue as to what's going on here?

    Read the article

  • Subversion svn:externals - What's wrong here?

    - by Brandon Montgomery
    I first want to say I've read the Subversion manual. I've read this question. I've also read this question. Here's my dilemma. Let's say I have 3 repositories laid out like this: DataAccessObject/ branches/ tags/ trunk/ DataAccessObject/ DataAccessObjectTests/ PlanObject/ branches/ tags/ trunk/ PlanObject/ PlanObjectTests/ WinFormsPlanViewer/ branches/ tags/ trunk/ WinFormsPlanViewer/ The PlanObject and DataAccessObject repositories contain shared projects. They are used by the WinFormsPlanViewer, but also by several other projects in several other repositories. Bear with me here. I put an svn:externals definition on the WinFormsPlanViewer/trunk folder like this: https://server/svn/PlanObject/trunk Objects https://server/svn/DataAccessObject/trunk Objects And here's what I see after I do an svn update. WinFormsPlanViewer/ branches/ tags/ trunk/ WinFormsPlanViewer/ Objects/ DataAccessObject/ DataAccessObjectTests/ The PlanObject stuff doesn't even come down in the update! I don't know if this has anything to do with it, but there's an externals definition on the PlanObject/trunk folder also: https://server/svn/DataAccessObject/trunk Objects What's going on here? What am I doing wrong? Are there bad consequences of referencing the PlanObject and the DataAccessObject from the WinFormsPlanViewer using svn:externals when the PlanObject references the DataAccessObject using svn:externals also?

    Read the article

  • Cascade Saves with Fluent NHibernate AutoMapping

    - by Ryan Montgomery
    How do I "turn on" cascading saves using AutoMap Persistence Model with Fluent NHibernate? As in: I Save the Person and the Arm should also be saved. Currently I get "object references an unsaved transient instance - save the transient instance before flushing" public class Person : DomainEntity { public virtual Arm LeftArm { get; set; } } public class Arm : DomainEntity { public virtual int Size { get; set; } } I found an article on this topic, but it seems to be outdated.

    Read the article

  • Automatic Deployment to Multiple Production Environments

    - by Brandon Montgomery
    I want to update an ASP .NET web application (including web.config file changes and database scripts) to multiple production environments - ideally with the click of a button. I do not have direct network connectivity to any of them. I think this means the application servers will have to "pull" the information required for updating the application, and run a script to update the application that resides on the server. Basically, I need a way to "publish" an update, and the servers see that update and automatically download and run it. I've thought about possibly setting up an SFTP server for publishing updates, and developing a custom tool which is installed on production environments which looks at the SFTP server every day and downloads application files if they are available. That would at least get the required files onto the servers, and I could use xcopy/robocopy and Migrator.NET to deploy the updates. Still not sure about config file changes, but that at least gets me somewhere. Is there any good solution for this scenario? Are there any tools that do this for you?

    Read the article

  • How do I get the collection of Model State Errors in ASP.NET MVC?

    - by Ryan Montgomery
    How do I get the collection of errors in a view? I don't want to use the Html Helper Validation Summary or Validation Message. Instead I want to check for errors and if any display them in specific format. Also on the input controls I want to check for a specific property error and add a class to the input. P.S. I'm using the Spark View Engine but the idea should be the same. So I figured I could do something like... <if condition="${ModelState.Errors.Count > 0}"> DispalyErrorSummary() </if> ....and also... <input type="text" value="${Model.Name}" class="?{ModelState.Errors["Name"] != string.empty} error" /> .... Or something like that. UPDATE My final solution looked like this: <input type="text" value="${ViewData.Model.Name}" class="text error?{!ViewData.ModelState.IsValid && ViewData.ModelState["Name"].Errors.Count() > 0}" id="Name" name="Name" /> This only adds the error css class if this property has an error.

    Read the article

  • Mercurial central server file discrepancy (using 'diff to local')

    - by David Montgomery
    Newbie alert! OK, I have a working central Mercurial repository that I've been working with for several weeks. Everything has been great until I hit a really bizarre problem: my central server doesn't seem to be synced to itself? I only have one file that seems to be out-of-sync right now, but I really need to know how this happened to prevent it from happening in the future. Scenario: 1) created Mercurial repository on server using an existing project directory. The directory contained the file 'mypage.aspx'. 2) On my workstation, I cloned the central repository 3) I made an edit to mypage.aspx 4) hg commit, then hg push from my workstation to the central server 5) now if I look at mypage.aspx on the server's repository using TortoiseHg's repository explorer, I see the change history for mypage.aspx -- an initial check-in and one edit. However, when I select 'Diff to local', it shows the current version on the server's disk is the original version, not the edited version! I have not experimented with branching at all yet, so I'm sure I'm not getting a branch problem. 'hg status' on the server or client returns no pending changes. If I create a clone of the server's repository to a new location, I see the same change history as I would expect, but the file on disk doesn't contain my edit. So, to recap: Central repository = original file, but shows change in revision history (bad) Local repository 'A' = updated file, shows change in revision history (good) Local repository 'B' = original file, but shows change in revision history (bad) Help please! Thanks, David

    Read the article

  • Implement a custom editor in Visual Studio 2008 or 2010

    - by David Montgomery
    Hi, I'm trying to find documentation on how one would go about creating a custom editor plug-in for VS2008 or VS2010. The file syntax I want to edit is from a tool called TemplateMaschine by Stefan Sarstedt. An example of the template syntax: <%@ Assembly Name="System.Xml" %> <%@ Import NameSpace="System.Xml" %> <%@ Import NameSpace="System.Collections" %> <%@ Argument Name="className" Type="string" %> <%@ Argument Name="attributes" Type="ArrayList" %> public class <%=className%> { <% foreach(string attr in attributes) { %> public string <%=attr%>; <% } %> } The most important editor features for me would be real-time syntax checking and code completion. If we could get those features, it would save us THOUSANDS of man-hours. Failing to incorporate a custom editor into Studio, maybe there is some open source text editor project out there that might be easy to extend for my purposes? I've looked a little at Eclipse, but I would think code completion won't be an option (also, my Java stinks). Another possibility might be extending the SharpDevelop text editor component. Ideas and suggestions welcome!

    Read the article

  • Alter a single attribute with XSLT

    - by Pete Montgomery
    Hello! <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation debug="true" defaultLanguage="C#"> <!-- this is a comment --> </compilation> </system.web> </configuration> What's the simplest XSLT you can think of to transform the value of the first, in this case only, /configuration/system.web/compilation/@debug attribute from true to false?

    Read the article

  • Why does RIGHT(@foostr, 0) return NULL when @foostr is varchar(max)?

    - by bob-montgomery
    In SQL Server 2005 If I want to find the right-most one character of a varchar(max) variable, no problem: declare @foostr varchar(max) set @foostr = 'abcd' select right (@foostr, 1) ---- d If I want to find the right-most zero characters of a string literal, no problem: select right ('abcd', 0) ------------------ It returns an empty string. If I want to find the right-most zero characters of a varchar(10), no problem: declare @foostr varchar(10) set @foostr = 'abcd' select right (@foostr, 0) ---- It returns an empty string. If I want to find the right-most zero characters of a varchar(max), well: declare @foostr varchar(max) set @foostr = 'abcd' select right (@foostr, 0) ---- NULL It returns NULL. Why?

    Read the article

  • What does it mean to pass a &variable to a function? E.g., string& insert ( size_t pos1, const strin

    - by Bob Montgomery
    I understand passing a pointer, and returning a pointer: char * strcat ( char * destination, const char * source ); You're passing a variable that contains the address to a char; returning the same. But what does it mean to pass something using the reference operator? Or to return it? string& insert ( size_t pos1, const string& str ); I mean, I understand what actually happens, I just don't understand the notation. Why isn't the notation this instead: string * insert ( size_t pos1, const string * str ); //made up I presume it has something to do with passing/returning the instance of a class, but what? Is this syntax valid; if not why not and if so what does it mean? char & strcat ( char & destination, const char & source ); //made up (all of the function declarations, except the last made-up two, are from http://www.cplusplus.com )

    Read the article

  • Saving a 'Date' using DataMapper on AppEngine+JRuby

    - by Ryan Montgomery
    I have a a model as follows: class Total include DataMapper::Resource property :id, Serial property :amount, Float, :default => 0.00 property :day, Date belongs_to :calendar end I am trying to select a specific Total from the data-store. class Calendar include DataMapper::Resource property :id, Serial property :name, String has n, :totals def get_total_for(date) return Total.first(:day => date, :calendar => self) end end When I call get_total_for(DateTime.now) I receive the following error on the call to the data-store. java.lang.IllegalArgumentException: day: org.jruby.RubyObject is not a supported property type. Is Date not allowed for usage in AppEngine? Is this a DataMapper issue? I have tried changing the name of the :day property to something else (hoping it was just a name conflict) but it doesn't seem to matter. Thanks for any help you can provide.

    Read the article

  • How can I impersonate the current user with IronPython?

    - by Ryan Montgomery
    I am trying to manage an IIS7 installation remotely using the Microsoft.Web.Administration library. I'm doing this in IronPython: import Microsoft.Web.Administration from Microsoft.Web.Administration import ServerManager manager = ServerManager.OpenRemote("RemoteServerName") for site in manager.Sites: print "Site: %(site)s" % { 'site' : site.Name } On the last line as it attempts to communicate with the remote server I get the following error: Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine devdealernetsvr failed due to the following error: 80070005. My research into the error lead me to believe that I do not have the proper credentials against the remote machine and so I would like to impersonate a user that does. I was hard pressed to find a way to do this with IronPython. Any help is much appreciated.

    Read the article

  • Extend Google AppEngine User in JRuby?

    - by Ryan Montgomery
    I'm working with JRuby and DataMapper running on Google AppEngine. I want to add a property to the AppEngine::User like :active_calendar which is a reference to a Calendar kind. I was able to do something in Python this way using a back reference. Are these possible in JRuby? Is this possible? Do I need to subclass the User? Can I even do that? If so - how? Thanks!

    Read the article

  • How to deal with missing items the SEO way?

    - by Brandon Montgomery
    I am working on a public-facing web site which serves up articles for people to read. After some time, articles become stale and we remove them from the site. My question is this: what is the best way to handle the situation when a search engine visits a URL corresponding to a removed article? Should the app respond with a permanent redirect (301 Moved Permanently) to a "article not found" page, or is there a better way to handle this?

    Read the article

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