Search Results

Search found 3423 results on 137 pages for 'tom daniel'.

Page 76/137 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • JavaDB/Derby Error 08006

    - by Tom Brito
    In the article Using Java DB in Desktop Applications the Address Book demo have a method disconnect which have a try-catch block that catch and ignores the exception. If you add a printStackTrace you can see that the exception always occur. What's wrong here? The JavaDB should not throw this exception, or they should fix something in the example program?

    Read the article

  • Programmer tendency to preach [closed]

    - by Daniel
    I've run across several SO posts that come across as preachy or condescending. Do pedagogical programmers feel plagued by thoughtless questions? Or, do programmers count self-sufficiency such a virtue that any perceived lack of ambition merits scolding? These are some theories, admittedly negative ones. Can anyone offer some insight?

    Read the article

  • Have an unprivileged non-account user ssh into another box?

    - by Daniel Quinn
    I know how to get a user to ssh into another box with a key: ssh -l targetuser -i path/to/key targethost But what about non-account users like apache? As this user doesn't have a home directory to which it can write a .ssh directory, the whole thing keeps failing with: $ sudo -u apache ssh -o StrictHostKeyChecking=no -l targetuser -i path/to/key targethost Could not create directory '/var/www/.ssh'. Warning: Permanently added '<hostname>' (RSA) to the list of known hosts. Permission denied (publickey). I've tried variations using -o UserKnownHostsFile=/dev/null and setting $HOME to /dev/null and none of these have done the trick. I understand that sudo could probably fix this for me, but I'm trying to avoid having to require a manual server config since this code will be deployed on a number of different environments. Any ideas? Here's a few examples of what I've tried that don't work: $ sudo -u apache export HOME=path/to/apache/writable/dir/ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=path/to/apache/writable/dir/.ssh/known_hosts -l deploy -i path/to/key targethost $ sudo -u apache ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=path/to/apache/writable/dir/.ssh/known_hosts -l deploy -i path/to/key targethost $ sudo -u apache ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -l deploy -i path/to/key targethost Eventually, I'll be using this solution to run rsync as the apache user.

    Read the article

  • javascript replace div tags for p tags where it has no class

    - by Tom
    I would like to replace div tags for p tags but only when the div tag does not have a class. So this: <div class="myDiv"> <div>sdfglkhj sdfgkhl sdfkhgl sdf</div> <div>dsf osdfghjksdfg hsdfg</div> </div> Would become: <div class="myDiv"> <p>sdfglkhj sdfgkhl sdfkhgl sdf</p> <p>dsf osdfghjksdfg hsdfg</p> </div> I've tried .replace("<div>", "<p>").replace("</div>","</p>") but this replaces the closing tag of the one with a class.

    Read the article

  • JCE Pro - Any good?

    - by Tom
    Hi Guys, I was wondering if anyone has had any valid experience with JCE Pro ? http://www.syntropy.se - javascript obfuscation Or any other good obfuscation methods for that reason ?

    Read the article

  • PayPal integration woes: PDT hangs on return to site

    - by Tom
    Hi, I'm implementing PayPal IPN & PDT. After some headache & time at the sandbox, IPN is working well and PDT returns the correct $_GET data. The implementation is as follows: Pass user ID in form to PayPal User buys product and triggers IPN which updates database for given user ID PDT returns transaction ID when user returns to site The return page says "please wait" and repeat-Ajax-checks for the transaction status User is redirected to success/failure page Everything works well, EXCEPT that when using the PayPal ready PHP code for PDT to do a return POST, the page hangs. PayPal waits for a response and the user never gets back to my site. I'm not getting a fail status, just nothing. The funny thing is that once the unknown error occurs, my test domain becomes unresponsive for a short period. The code (PHP): https://www.paypal.com/us/cgi-bin/webscr?cmd=p/xcl/rec/pdt-code-outside If I comment out the POST back, it all works fine. I'm able to pin down the problem to once the code enters the while{} loop. Unfortunately, I'm not experienced enough to write a replacement from scratch for the PayPal code, so would really appreciate any ideas on what might be wrong. The POST back goes to ssl://www.sandbox.paypal.com, and I'm using button code and an authorisation token that have all been created via a sandbox test account. Thanks in advance.

    Read the article

  • whats the diference between train, validation and test set, in neural networks?

    - by Daniel
    Im using this library http://pastebin.com/raw.php?i=aMtVv4RZ to implement a learning agent. I have generated the train cases, but i dont know for sure what are the validation and test sets, the teacher says: 70% should be train cases, 10% will be test cases and the rest 20% should be validation cases. Thanks. edit i have this code, for training.. but i have no ideia when to stop training.. def train(self, train, validation, N=0.3, M=0.1): # N: learning rate # M: momentum factor accuracy = list() while(True): error = 0.0 for p in train: input, target = p self.update(input) error = error + self.backPropagate(target, N, M) print "validation" total = 0 for p in validation: input, target = p output = self.update(input) total += sum([abs(target - output) for target, output in zip(target, output)]) #calculates sum of absolute diference between target and output accuracy.append(total) print min(accuracy) print sum(accuracy[-5:])/5 #if i % 100 == 0: print 'error %-14f' % error if ? < ?: break

    Read the article

  • What is the point of CSS collapsing margins?

    - by Tom
    The CSS2 box model tells us that adjoining margins collapse. I find it quite annoying, being the source of many design bugs. I hope that by understanding the purpose of collapsing margins, I will understand when to use them and how to avoid them when they are not needed. What is the purpose of this feature?

    Read the article

  • Symfony: Weird routing issue

    - by Tom
    Hi, I've got following URL in symfony (specifics not important): /frontend_dev.php/something/25/apple ... and a routing rule: /something/:id/:word The URL works fine when clicked through to on the site, but not when I type in the URL. Instead, symfony says: Unable to find a matching route to generate url for params "NULL". The weird thing is that I can navigate to this page and it works, but when hitting Enter in the browser address bar, it no longer finds it. Any thoughts on what might be the cause of something like this generally? I should also add that the URL was working fine when typed in the address bar earlier, but doesn't anymore, and I'm not sure what's there that might be interfering with it. Thanks in advance.

    Read the article

  • what libraries or platforms should I use to build web apps that provide real-time, asynchronous data

    - by Daniel Sterling
    This is a less a question with a simple, practical answer and more a question to foster discussion on the real-time data exchange topic. I'll begin with an example: Google Wave is, at its core, a real-time asynchronous data synchronization engine. Wave supports (or plans to support) concurrent (real-time) document collaboration, disconnected (offline) document editing, conflict resolution, document history and playback with attribution, and server federation. A core part of Wave is the Operational Transformation engine: http://www.waveprotocol.org/whitepapers/operational-transform The OT engine manages document state. Changes between clients are merged and each client has a sane and consistent view of the document at all times; the final document is eventually consistent between all connected clients. My question is: is this system abstract or general enough to be used as a library or generic framework upon which to build web apps that synchronize real-time, asynchronous state in each client? Is the Wave protocol directly used by any current web applications (besides Google's client)? Would it make sense to directly use it for generic state synchronization in a web app? What other existing libraries or frameworks would you consider using when building such a web app? How much code in such an app might be domain-specific logic vs generic state synchronization logic? Or, put another way, how leaky might the state synchronization abstractions be? Comments and discussion welcomed!

    Read the article

  • Undesired "flashing" in Jquery dropdown menu?

    - by Tom
    Hi, I've got the following piece of Jquery: $("#collapse-menu > li > a").click(function() { $(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("medium"); }); What it basically does is expands or collapses a menu of nested "lists" which contain dropdowns (simplified example): <ul id="collapse-menu"> <li><a class="expanded">Basic Details</a> <ul> <li> <select> .... </select> </li> <li> <select> .... </select> </li> The code works absolutely fine EXCEPT when a large value is selected in any of the dropdowns. At that point, when clicked, the menu will still expand/collapse correctly but "flash" quickly while doing so, as if the entire element was being reset somehow. The data itself is fine but it's the flashing that's unwanted. The strange thing is that if a small value is selected in a dropdown, there's no flashing. When a large value is selected (say, above 30 in an age dropdown of 18-99), the flashing starts happening. Can anyone tell me why this is happening? Or whether there's something not right about the Jquery that's causing this. Thanks. UPDATE: Adding a bounty to this. Have tried a few similar plugins/solutions out there on the net but they all seem to suffer from this "flashing" problem when large dropdown values are selected by default. If it helps, here's a typical similar solution: http://www.i-marco.nl/weblog/jquery-accordion-menu/index_collapsed.html# ... but it suffers from the same problem when dropdowns are added inside the accordion. I hope someone has a clean solution, instead of needing to hack this somehow.

    Read the article

  • Google Maps API V3: How to jump to a specific marker from outside the map?

    - by Tom
    I have a map with two markers on it. The initial view of the map only shows one marker, and I want to provide a link next to the map that will move the map to the 2nd marker when clicked. Here's a demo of what I want, using v2 of the API: http://arts.brighton.ac.uk/contact-university-of-brighton-faculty-of-arts (note the links below the map) Here's what I have so far: <script type="text/javascript"> function initialize() { var latlng = new google.maps.LatLng(50.823817, -0.135634); var myOptions = { zoom: 13, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU } , scaleControl: false }; var map = new google.maps.Map(document.getElementById("map"), myOptions); // 1st marker var marker1 = new google.maps.Marker({ position: new google.maps.LatLng(50.823817, -0.135634), map: map, title: 'my title' }); var infowindow = new google.maps.InfoWindow({ content: 'my window content' }); google.maps.event.addListener(marker1, 'click', function() { infowindow.open(map, marker1); }); // 2nd marker var marker2 = new google.maps.Marker({ position: new google.maps.LatLng(51.5262405, -0.074549), map: map, title: 'my 2nd title'}); var infowindow2 = new google.maps.InfoWindow({ content: 'content for my 2nd window' }); google.maps.event.addListener(marker2, 'click', function() { infowindow2.open(map, marker2); }); } </script> So what I'd like to add is a link to marker2, to move the map some 50-odd miles up, e.g. <a href="#marker2">Second location</a>. How would I do this?

    Read the article

  • Java Node.cloneNode()

    - by Tom Brito
    Talking about the org.w3c.dom package; When I call Node.cloneNode() method from a Element(extends Node) object, which Document is used to create the new cloned Element? Example: import org.w3c.dom; class MyClass { public static void main(String[] args) throws Exception { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.newDocument(); Element element = doc.createElement("myElement"); Element cloneElement = (Element) element.cloneNode(true); } } Which Document was used to create cloneElement?

    Read the article

  • Misalignement in the output Bitmap created from a byte array

    - by Daniel
    I am trying to understand why I have troubles creating a Bitmap from a byte array. I post this after a careful scrutiny of the existing posts about Bitmap creation from byte arrays, like the followings: Creating a bitmap from a byte[], Working with Image and Bitmap in c#?, C#: Bitmap Creation using bytes array My code is aimed to execute a filter on a digital image 8bppIndexed writing the pixel value on a byte [] buffer to be converted again (after some processing to manage gray levels) in a 8BppIndexed Bitmap My input image is a trivial image created by means of specific perl code: https://www.box.com/shared/zqt46c4pcvmxhc92i7ct Of course, after executing the filter the output image has lost the first and last rows and the first and last columns, due to the way the filter manage borders, so from the original 256 x 256 image i get a 254 x 254 image. Just to stay focused on the issue I have commented the code responsible for executing the filter so that the operation really performed is an obvious: ComputedPixel = InputImage.GetPixel(myColumn, myRow).R; I know, i should use lock and unlock but I prefer one headache one by one. Anyway this code should be a sort of identity transform, and at last i use: private unsafe void FillOutputImage() { OutputImage = new Bitmap (OutputImageCols, OutputImageRows , PixelFormat .Format8bppIndexed); ColorPalette ncp = OutputImage.Palette; for (int i = 0; i < 256; i++) ncp.Entries[i] = Color .FromArgb(255, i, i, i); OutputImage.Palette = ncp; Rectangle area = new Rectangle(0, 0, OutputImageCols, OutputImageRows); var data = OutputImage.LockBits(area, ImageLockMode.WriteOnly, OutputImage.PixelFormat); Marshal .Copy (byteBuffer, 0, data.Scan0, byteBuffer.Length); OutputImage.UnlockBits(data); } The output image I get is the following: https://www.box.com/shared/p6tubyi6dsf7cyregg9e It is quite clear that I am losing a pixel per row, but i cannot understand why: I have carefully controlled all the parameters: OutputImageCols, OutputImageRows and the byte [] byteBuffer length and content even writing known values as way to test. The code is nearly identical to other code posted in stackOverflow and elsewhere. Someone maybe could help to identify where the problem is? Thanks a lot

    Read the article

  • nfs (netapp) question: how to map the device shown in sar -d to the data volume?

    - by Daniel
    Using sar I can see device nfss24 is very busy, but how to know which data volume (file system) the device is for? sar -d 1 10|egrep "busy|nfs" SunOS phxdbnfs11 5.10 Generic_141414-07 sun4v 04/14/2010 19:03:27 device %busy avque r+w/s blks/s avwait avserv 19:03:28 nfs23 0 0.0 0 0 0.0 0.0 nfs24 100 1484053.4 504 32123 2944300.0 47.5 nfs25 0 0.0 0 0 0.0 0.0 nfs26 0 0.0 0 0 0.0 0.0 nfs27 107 1.1 0 0 0.0 0.0 nfs28 107 17.0 0 0 0.0 0.0 nfs29 100 13109.5 460 29435 28451.7 52.0 nfs30 0 0.0 0 0 0.0 0.0 nfs31 107 9.6 0 0 0.0 0.0 nfs32 0 0.0 0 0 0.0 0.0 nfs33 107 1.1 0 0 0.0 0.0 19:03:29 nfs23 0 0.0 0 0 0.0 0.0 nfs24 100 1483762.8 530 33709 2797054.5 45.1 nfs25 0 0.0 0 0 0.0 0.0 nfs26 0 0.0 0 0 0.0 0.0 nfs27 107 1.1 0 0 0.0 0.0 nfs28 107 17.0 0 0 0.0 0.0 nfs29 100 12800.8 511 32732 25016.0 46.8 nfs30 0 0.0 0 0 0.0 0.0 nfs31 107 9.6 0 0 0.0 0.0 nfs32 0 0.0 0 0 0.0 0.0 nfs33 107 1.1 0 0 0.0 0.0 19:03:30 nfs23 0 0.0 0 0 0.0 0.0 nfs24 100 1483080.4 761 48162 1950073.8 31.4 nfs25 0 0.0 0 0 0.0 0.0 nfs26 0 0.0 0 0 0.0 0.0 nfs27 107 1.1 0 0 0.0 0.0 nfs28 107 17.0 0 0 0.0 0.0 nfs29 100 12406.7 737 46855 16800.7 32.4 nfs30 0 0.0 0 0 0.0 0.0 nfs31 107 9.6 0 0 0.0 0.0 nfs32 0 0.0 0 0 0.0 0.0 nfs33 107 1.1 0 0 0.0 0.0

    Read the article

  • Server is on or off

    - by Daniel
    Curious. I'm starting to broadcast high school football games online, and it uses a program to broadcast the feeds off my computer. However, when I shut the program down or the computer down, the server goes offline and guests won't be able to access the feeds. Is there any kind of code out there that I can post onto my website that will indicate to my guests whether the server is on or off? I would figure it would be a simple code, a php script or something that periodically checks to see if a site is on line and then displays ON or OFF.

    Read the article

  • Detecting whether user stayed after prompting onBeforeUnload

    - by Daniel Magliola
    In a web app I'm working on, I'm capturing onBeforeUnload to ask the user whether he really wants to exit. Now, if he decides to stay, there are a number of things I'd like to do. What I'm trying to figure out is that he actually chose to stay. I can of course declare a SetTimeout for "x" seconds, and if that fires, then it would mean the user is still there (because we didn't get unloaded). The problem is that the user can take any time to decide whether to stay or not... I was first hoping that while the dialog was showing, SetTimeout calls would not fire, so I could set a timeout for a short time and it'd only fire if the user chose to stay. However, timeouts do fire while the dialog is shown, so that doesn't work. Another idea I tried is capturing mouseMoves on the window/document. While the dialog is shown, mouseMoves indeed don't fire, except for one weird exception that really applies to my case, so that won't work either. Can anyone think of other way to do this? Thanks! (In case you're curious, the reason capturing mouseMove doesn't work is that I have an IFrame in my page, containing a site from another domain. If at the time of unloading the page, the focus is within the IFrame, while the dialog shows, then I get the MouseMove event firing ONCE when the mouse moves from inside the IFrame to the outside (at least in Firefox). That's probably a bug, but still, it's very likely that'll happen in our case, so I can't use this method).

    Read the article

  • Sql query listing Fathers and childs with joins, how to distinct them?

    - by DaNieL
    Having those tables: table_n1: | t1_id | t1_name | | 1 | foo | table_n2: | t2_id | t1_id | t2_name | | 1 | 1 | bar | I need a query that gives me two result: | names | | foo | | foo / bar | But i cant figure out the right way. I wrote this one: SELECT CONCAT_WS(' / ', table_n1.t1_name, table_n2.t2_name) AS names FROM table_n1 LEFT JOIN table_n2 ON table_n2.t1_id = table_n1.t1_id that works for an half: this only return the 2° row (in the example above): | names | | foo - bar | This query return the 'father' (table_n1) name only when it doesnt have 'childs' (table_n2). How can i fix it?

    Read the article

  • snippet generation in php

    - by daniel
    Hi, I have a long chunk of text that came back from a search query. I'd like to display a snippet of the text, not the entire thing, and highlight the search query within the snippet. I realize that decided what part of the text to slice can be complicated, and I was hoping for any ideas on how do to this? Thanks!

    Read the article

  • Why does the rename() syscall prohibit moving a directory that I can't write to a different director

    - by Daniel Papasian
    I am trying to understand why this design decision was made with the rename() syscall in 4.2BSD. There's nothing I'm trying to solve here, just understand the rationale for the behavior itself. 4.2BSD saw the introduction of the rename() syscall for the purpose of allowing atomic renames/moves of files. From 4.3BSD-Reno/src/sys/ufs/ufs_vnops.c: /* * If ".." must be changed (ie the directory gets a new * parent) then the source directory must not be in the * directory heirarchy above the target, as this would * orphan everything below the source directory. Also * the user must have write permission in the source so * as to be able to change "..". We must repeat the call * to namei, as the parent directory is unlocked by the * call to checkpath(). */ if (oldparent != dp->i_number) newparent = dp->i_number; if (doingdirectory && newparent) { VOP_LOCK(fndp->ni_vp); error = ufs_access(fndp->ni_vp, VWRITE, tndp->ni_cred); VOP_UNLOCK(fndp->ni_vp); So clearly this check was added intentionally. My question is - why? Is this behavior supposed to be intuitive? The effect of this is that one cannot move a directory (located in a directory that one can write) that one cannot write to another directory that one can write to atomically. You can, however, create a new directory, move the links over (assuming one has read access to the directory), and then remove one's write bit on the directory. You just can't do so atomically. % cd /tmp % mkdir stackoverflow-question % cd stackoverflow-question % mkdir directory-1 % mkdir directory-2 % mkdir directory-1/directory-i-cant-write % echo "foo" > directory-1/directory-i-cant-write/contents % chmod 000 directory-1/directory-i-cant-write/contents % chmod 000 directory-1/directory-i-cant-write % mv directory-1/directory-i-cant-write directory-2 mv: rename directory-1/directory-i-cant-write to directory-2/directory-i-cant-write: Permission denied We now have a directory I can't write with contents I can't read that I can't move atomically. I can, however, achieve the same effect non-atomically by changing permissions, making the new directory, using ln to create the new links, and changing permissions. (Left as an exercise to the reader) . and .. are special cased already, so I don't particularly buy that it is intuitive that if I can't write a directory I can't "change .." which is what the source suggests. Is there any reason for this besides it being the perceived correct behavior by the author of the code? Is there anything bad that can happen if we let people atomically move directories (that they can't write) between directories that they can write?

    Read the article

  • Need to get back form controls' information externally

    - by Tom
    Are there any tutorials or guides out there that anyone knows of that will show me how to read forms from an external program and get back information about the controls on the form? Currently, I can get the handle to the form, and I can get the class name, but I need to get more information such as a persistent name and contained data. Thanks. Edit: I now have a way to read the contained data (with the WM_GETTEXT message), however, I still need a persistent name/ID that I can be sure will not change from instance to instance. One way I can think of for doing this is to take the handle, find the position of the control on the window, and then get the handle from the position from then on. Another way is to determine a static ID for the control and then use that to get the handle from then on. The new scope of my problem is how to implement either of these. Any Ideas?

    Read the article

  • asp.net cannot update database

    - by tom
    string ConnectionString = WebConfigurationManager.ConnectionStrings["dbnameConnectionString"].ConnectionString; SqlConnection myConnection = new SqlConnection(ConnectionString); myConnection.Open(); try { string qry = "UPDATE customers SET firstname=@firstname WHERE cid=1"; SqlCommand insertQuery = new SqlCommand(qry, myConnection); insertQuery.Parameters.Add(new SqlParameter("@firstname", txtFirstname.Text)); insertQuery.ExecuteNonQuery(); myConnection.Close(); } catch (Exception ee) { } Any suggestions?

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >