Search Results

Search found 1890 results on 76 pages for 'paul petrick'.

Page 46/76 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • HATEOAS - Discovery and URI Templating

    - by Paul Kirby
    I'm designing a HATEOAS API for internal data at my company, but have been having troubles with the discovery of links. Consider the following set of steps for someone to retrieve information about a specific employee in this system: User sends GET to http://coredata/ to get all available resources, returns a number of links including one tagged as rel = "http://coredata/rels/employees" User follows HREF on the rel from the first request, performing a GET at (for example) http://coredata/employees The data returned from this last call is my conundrum and a situation where I've heard mixed suggestions. Here are some of them: That GET will return all employees (with perhaps truncated data), and the client would be responsible for picking the one it wants from that list. That GET would return a number of URI templated links describing how to query / get one employee / get all employees. Something like: "_links": { "http://coredata/rels/employees#RetrieveOne": { "href": "http://coredata/employees/{id}" }, "http://coredata/rels/employees#Query": { "href": "http://coredata/employees{?login,firstName,lastName}" }, "http://coredata/rels/employees#All": { "href": "http://coredata/employees/all" } } I'm a little stuck here with what remains closest to HATEOAS. For option 1, I really do not want to make my clients retrieve all employees every time for the sake of navigation, but I can see how using URI templating in example two introduces some out-of-band knowledge. My other thought was to use the RetrieveOne, Query, and All operations as my cool URLs, but that seems to violate the concept that you should be able to navigate to the resources you want from one base URI. Has anyone else managed to come up with a good way to handle this? Navigation is dead simple once you've retrieved one resource or a set of resources, but it seems very difficult to use for discovery.

    Read the article

  • Getting the primary key back from a SQL insert with SQLLite

    - by Paul Nathan
    Hi, I have a SQL table set that looks like this create table foo ( id int primary key asc, data datatype ); create table bar ( id int primary key asc, fk_foo int, foreign key(foo_int) references foo(id)); Now, I want to insert a record set. insert into table foo (data) values (stuff); But wait - to get Bar all patched up hunkydory I need the PK from Foo. I know this is a solved problem. What's the solution?

    Read the article

  • "Finally" target for MSBuild

    - by Paul Alexander
    Is there a way to run a certain target after all other targets have been run regardless of their success or failure? try...finally equivalent in MsBuild is related, but only deals with a small group of targets. I need something for the whole package with dozens of sub builds.

    Read the article

  • Ordering by a max or a min from another table

    - by Paul Tomblin
    I have a table that consists of a unique id, and a few other attributes. It holds "schedules". Then I have another table that holds a list of all the times each schedule has or will "fire". This isn't the exact schema, but it's close: create table schedule ( id varchar(40) primary key, attr1 int, attr2 varchar(20) ); create table schedule_times ( id varchar(40) foreign key schedule(id), fire_date date ); I want to query the schedule table, getting the attributes and the next and previous fire_dates, in Java, sometimes ordering on one of the attributes, but sometimes ordering on either previous fire_date or the next fire_date. Ordering by the attributes is easy, I just stick an "order by" into the string while I'm building my prepared statement. I'm not even sure how to go about selecting the last fire_date and the next one in a single query - I know that I can find the next fire_date for a given id by doing a SELECT min(fire_date) FROM schedule_times WHERE id = ? AND fire_date > sysdate; and the similar thing for previous fire_date using max() and fire_date < sysdate. I'm just drawing a blank on how to incorporate that into a single select from the schedule so I can get both next and previous fire_date in one shot, and also how to order by either of those attributes.

    Read the article

  • How do I bind a jQuery Tools overlay event to an existing overlay?

    - by Paul
    Say when the page loads, this code runs: jQuery(document).ready(function($){ $('#overlay').overlay( api: true ); }); How would I bind an event to it? I've tried: $('#overlay').onBeforeLoad( function(){ alert('Hi'); }); $('#overlay').bind( 'onBeforeLoad', function(){ alert('Hi'); }); var api = $('#overlay').data('overlay'); api.onBeforeLoad(function(){ alert('Hi') }); When I do: alert(api.getContent().attr('id')); An alert pops up with '#overlay' inside. When the overlay is open and I run: alert(api.isOpened()); An alert pops up with 'false' inside. Thanks in advance.

    Read the article

  • Using a variable name in XMLHttpRequest

    - by Paul
    Hi All, I am using jQuery and trying to load a variable in place of a named xml file. My Code: $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#theForm').ajaxForm(function(responseXML2) { var myxml = responseXML2; alert(responseXML2); displayResult(); }); }); function loadXMLDoc(dname) { if (window.XMLHttpRequest) { alert("loading xmlhttprequest"); xhttp=new XMLHttpRequest(); } else { alert("loading activeX"); xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } alert("bottom load"); xhttp.open("GET",dname,false); xhttp.send(); return xhttp.responseXML; } function displayResult() { alert("setting vars"); alert("displayResult called"); //xml=loadXMLDoc(responseXML2); //tried this and the line below, among others xml=responseXML2; alert("xmlDocLoaded"); xsl=loadXMLDoc("xslt-test.xsl"); alert("XSLloaded"); // code for IE if (window.ActiveXObject) { alert("IE"); ex=xml.transformNode(xsl); document.getElementById("ieiresponse").innerHTML=ex; } // code for Mozilla, Firefox, Opera, etc. else if (document.implementation && document.implementation.createDocument) { alert("notIE"); xsltProcessor=new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); resultDocument = xsltProcessor.transformToFragment(xml,document); document.getElementById("ieiresponse").appendChild(resultDocument); } } In the code above I want to have: //xml=loadXMLDoc(responseXML2); //tried this and the line below, among others xml=responseXML2; instead of a named file: xsl=loadXMLDoc("example.xml"); When I run through the code, it works if I name the file, but when I use the variable, (which does show up in alerts, so is being pulled), it stops the code at the above line (placing the variable as the xml file) Any help would be much appreciated! Thank you in advance.

    Read the article

  • accessing pdf via https URL

    - by Paul
    I send out a newsletter email containing URLs to a https website that then redirects to a pdf document. On first invocation of a URL the user is prompted with the typical https browser "security alert" popup, on selecting "Yes" the display of the PDF fails. The HTTP Header on the failed response is: HTTP/1.1 200 OK Server: ECS/HTTP-Server Date: Tue, 16 Mar 2010 15:57:26 GMT Content-type: application/pdf Content-language: en-US Set-cookie: JSESSIONID=0000r111cRz1Vc-PtCJg8Cdu4eR:-1; Path=/ Expires: Thu, 01 Dec 1994 16:00:00 GMT Cache-control: no-cache="set-cookie, set-cookie2" Connection: close Subsequent invocations of the URL successfully opens the PDF (at this point we have the session id cookie set by the initial failed request). The HTTP Header on the successful response is: HTTP/1.1 200 OK Server: ECS/HTTP-Server Date: Tue, 16 Mar 2010 16:53:03 GMT Content-type: application/pdf Content-language: en-US Connection: close The email client is Lotus Notes 6.5 which launches an IE6 browser Any ideas?

    Read the article

  • How do I make a child control re-anchor to its parent Form when it has been cut off on a small resol

    - by Paul Fedory
    I have a Windows Form with a default size of 1100 x 400, and I have a DataGridView control on it anchored to Top, Left, Bottom, Right. Resizing the form on a screen with resolution higher than 1100 x 400 works fine, and the anchoring works well, resizing the DataGridView control as expected. When I launch the form on a screen with resolution 800x600, the form is cut off, and made to fit the 800 x 600. The DataGridView is cut off, and cannot be seen entirely - it bleeds off the form to the right, so it's not respecting the right anchor. Resizing the form in this situation doesn't respect the anchoring settings for some reason: the DataGridView control does not resize when the form is resized. Is there a way programmatically (on a resize event or something) to force the child DataGridView control to anchor to the sides of the form? I've already tried calling a PerformLayout and Refresh in the Form's resize event but it's rather redundant, isn't it?

    Read the article

  • How to translate legacy system colors to (A)RGB?

    - by Paul Sasik
    I have a list of color values encoded as signed integers in a legacy INI file that I need to translate into (A)RGB values with .NET. An INI example: [INI_Section] Color=-2147483633 Doing something like: Color.FromArgb(-2147483633) gives an alpha-blended version of a color that is not at all what I expect. Is there a .NET method for translating these legacy colors properly? Note that pInvoke to OlePro32.dll is not an option.

    Read the article

  • JPanel: both implementing my own paintComponent() and rendering children doesn't work

    - by Paul Marshall
    I'm extending a JPanel to display a game board, and adding a JEditorPane at the bottom to hold some status text. Unfortunately, the game board renders just fine, but the JEditorPane is just a blank gray area until I highlight the text in it, when it will render whatever text is highlighted (but not the rest). If I'm understanding Swing right, it should work, because super.paintComponent(g) should render the other children (i.e., the JEditorPane). Tell me, o great stackoverflow, what bonehead mistake am I making? public GameMap extends JPanel { public GameMap() { JEditorPane statusLines = new JEditorPane("text/plain","Stuff"); this.setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS)); this.add(new Box.Filler(/*enough room to draw my game board*/)); this.add(statusLines); } public void paintComponent(Graphics g){ super.paintComponent(g); for ( all rows ){ for (all columns){ //paint one tile } } } }

    Read the article

  • More efficient approach to XSLT for-each

    - by Paul
    I have an XSLT which takes a . delimted string and splits it into two fields for a SQL statement: <xsl:for-each select="tokenize(Path,'\.')"> <xsl:choose> <xsl:when test="position() = 1 and position() = last()">SITE = '<xsl:value-of select="."/>' AND PATH = ''</xsl:when> <xsl:when test="position() = 1 and position() != last()">SITE = '<xsl:value-of select="."/>' </xsl:when> <xsl:when test="position() = 2 and position() = last()">AND PATH = '<xsl:value-of select="."/>' </xsl:when> <xsl:when test="position() = 2">AND PATH = '<xsl:value-of select="."/></xsl:when> <xsl:when test="position() > 2 and position() != last()">.<xsl:value-of select="."/></xsl:when> <xsl:when test="position() > 2 and position() = last()">.<xsl:value-of select="."/>' </xsl:when> <xsl:otherwise>zxyarglfaux</xsl:otherwise> </xsl:choose> </xsl:for-each> The results are as follows: INPUT: North OUTPUT: SITE = 'North' AND PATH = '' INPUT: North.A OUTPUT: SITE = 'North' AND PATH = 'A' INPUT: North.A.B OUTPUT: SITE = 'North' AND PATH = 'A.B' INPUT: North.A.B.C OUTPUT: SITE = 'North' AND PATH = 'A.B.C' This works, but is very lengthy. Can anyone see a more efficient approach? Thanks!

    Read the article

  • What are the common programming mistakes in Python?

    - by Paul McGuire
    I was about to tag the recent question in which the OP accidentally shadowed the builtin operator module with his own local operator.py with the "common-mistakes" tag, and I saw that there are a number of interesting questions posted asking for common mistakes to avoid in Java, Ruby, Scala, Clojure, .Net, jQuery, Haskell, SQL, ColdFusion, and so on, but I didn't see any for Python. For the benefit of Python beginners, can we enumerate the common mistakes that we have all committed at one time or another, in the hopes of maybe steering a newbie or two clear of them? (In homage to "The Princess Bride", I call these the Classic Blunders.) If possible, a little supporting explanation on what the problem is, and the generally accepted resolution/workaround, so that the beginning Pythoner doesn't read your answer and say "ok, that's a mistake, how do I fix it?"

    Read the article

  • Silent Printing of PDF From Within Java

    - by Paul Reiners
    We are looking into silent printing of PDF documents from within Java. The printing will be invoked from the desktop and not through a browser so we cannot use JavaScript. PDF Renderer is an operational solution but their rendering quality is not acceptable. iText does not seem to be pluggable with the Java print service. There are some commercial Java libraries, jPDFPrint by Qoppa, JPedal, and ICEpdf which we have not tried out yet. Does anybody have any experience with PDF silent printing from Java?

    Read the article

  • Encoding a string as an integer .NET

    - by Paul Knopf
    I have a string that I would like represented uniquely as an integer. For example: A3FJEI = 34950140 How would I go about writing a EncodeAsInteger(string) method. I understand that the amount of characters in the string will make the integer increase greatly, forcing the value to become a long, not an int. Since I need the value to be an integer, I don't need the numerical representation to be entirely unique to the string. Maybe I can foreach through all the characters of the string and sum the numerical keycode of the character.

    Read the article

  • jQuery Selectors: how to access an a tag, whose span has a specific class?

    - by Paul
    I'm messing around with FullCalendar jQuery calendar, and qTips, so that I can display more information about the event upon mouseover. I've added a summary element to the FullCalendar js, and also my server code. I then added a new qTip in the eventMouseover method, based on the span class, which works prefectly. However, if the event stretches over a couple of days, the qTip only works (because it is a span tag), on the text itself, not the entire blue strip. What I want to do is to assign the qTip to the a tag, and make the a tags display block. This works currently: eventMouseover: function(event){ $('span[class=fc-event-title]').each(function() { if( $(this).text() == event.title ) { $(this).qtip({ content: event.summary, style: { border: { width: 1, radius: 5, color: '#6699CC' }, width: 200 } }); } }); but I can't figure out how to select the a tag where it contains a span with class of fc-event-title. Many thanks for any assistance.

    Read the article

  • Filter string in C

    - by Paul Tarjan
    How can I filter a string in c? I want to remove anything that isn't [a-z0-9_]. int main(int argc, char ** argv) { char* name = argv[1]; // remove anything that isn't [a-z0-9_] printf("%s", name); }

    Read the article

  • ToolStripMenuItems and Drag and Drop

    - by Paul
    I need to implement "Drag and Drop" operations for the ToolStripMenuItems. Everything works fine only with ToolStripMenuItems on the first level. I mean I can't move menu item from a submenu to other one. But I can move submenu to top-level menu. I noticed that DragEnter event isn't arise for submenus. Initialization is the same for all menu-items. What is wrong? :(

    Read the article

  • How to do "See Also" to a book using doxygen

    - by Paul J. Lucas
    The Javadoc @see allows a simple string as an argument to refer to something like a book, e.g.: @see "The Java Programming Language." As far as I can tell, the Doxygen \see offers no equivalent. Is there any way to have a book reference generated in the documentation, e.g.: See Also The C++ Programming Language, Bjarne Stroustrup, Addison-Wesley, 2000, section 19.4.1: The Standard Allocator ? Clarification This question is about how to do a "See Also" as part of a comment, e.g.: /** * Allocates memory in an amazing way. * \param size The number of bytes to allocate. * \return Returns a pointer to the start of the allocated memory. * \see MyOtherClass::alloc() * \see "The C++ Programming Language," Bjarne Stroustrup, Addison-Wesley, 2000, * section 19.4.1: The Standard Allocator. */ void* my_alloc( size_t size ); Of course the above does not work in Doxygen. Note that if there are multiple \see tags, they should be merged into a single "See Also" section (like the way \see normally works.

    Read the article

  • Dynamic classloading fails on runtime

    - by Henrik Paul
    I have the following snippet of java code: final Class<?> junitCoreClass = AccessController.doPrivileged( new PrivilegedAction<URLClassLoader>() { @Override public URLClassLoader run() { return new URLClassLoader(new URL[] { junitJarUrl }); } }).loadClass("org.junit.runner.JUnitCore"); System.out.println(junitCoreClass.getName()); final JUnitCore junitCore = (JUnitCore) junitCoreClass.newInstance(); This compiles fine. But when I try to run it, something weird happens; a java.lang.NoClassDefFoundError is thrown on that last line, referring to the class just loaded. The weird part is, the println prints the exact class name. I checked that if I keep the reference as an Object and manipulate it only through reflection, everything's fine, so the offending piece of code must be the explicit cast. Can someone explain to me why this happens, and also tell me how I can achieve what I'm trying to do?

    Read the article

  • Using Google Weather API with Lat and Lon - how to format?

    - by Paul
    I am wanting to use the Google Weather API - by passing lat and long values. However it seems Google is needing these formatted differently to the values I have stored. i.e. For the town of McTavish I have values of 45.5 and -73.583 This works here: http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=45.5,-73.583 But when I use Google it does not: See: www.google.com/ig/api?weather=,,,45.5,-73.583 Any help appreciated. I would prefer to use the Google Data.

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >