Search Results

Search found 858 results on 35 pages for 'vincent of earth'.

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

  • Rails: Generated tokens missing occasionally

    - by Vincent Chan
    We generate an unique token for each user and store it on database. Everything is working fine in the local environment. However, after we upload the codes to the production server on Engine Yard, things become weird. We tried to register an account right after the deploy. It is working fine and we can see the token in the db. But after that, when we register new accounts, we cannot see any tokens. We only have NULL in the db. Not sure what caused this problem because we can't re-produce this in the local machine. Thanks for your help.

    Read the article

  • Hibernate many-to-many mapping not saved in pivot table

    - by vincent
    I having problems saving many to many relationships to a pivot table. The way the pojos are created is unfortunately a pretty long process which spans over a couple of different threads which work on the (to this point un-saved) object until it is finally persisted. I associate the related objects to one another right after they are created and when debugging I can see the List of related object populated with their respective objects. So basically all is fine to this point. When I persist the object everything get saved except the relations in the pivot table. mapping files: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.thebeansgroup.jwinston.plugin.orm.hibernate.object"> <class name="ShowObject" table="show_object"> <id name="id"> <generator class="native" /> </id> <property name="name" /> <set cascade="all" inverse="true" name="venues" table="venue_show"> <key column="show_id"/> <many-to-many class="VenueObject"/> </set> </class> </hibernate-mapping> and the other <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.thebeansgroup.jwinston.plugin.orm.hibernate.object"> <class name="VenueObject" table="venue_object"> <id name="id"> <generator class="native"/> </id> <property name="name"/> <property name="latitude" type="integer"/> <property name="longitude" type="integer"/> <set cascade="all" inverse="true" name="shows" table="venue_show"> <key column="venue_id"/> <many-to-many class="ShowObject"/> </set> </class> </hibernate-mapping> pojos: public class ShowObject extends OrmObject { private Long id; private String name; private Set venues; public ShowObject() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Set getVenues() { return venues; } public void setVenues(Set venues) { this.venues = venues; } } and the other: public class VenueObject extends OrmObject { private Long id; private String name; private int latitude; private int longitude; private Set shows = new HashSet(); public VenueObject() { } @Id @GeneratedValue(strategy = GenerationType.AUTO) public Long getId() { return id; } public void setId(Long id) { this.id = id; } public int getLatitude() { return latitude; } public void setLatitude(int latitude) { this.latitude = latitude; } public int getLongitude() { return longitude; } public void setLongitude(int longitude) { this.longitude = longitude; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Set getShows() { return shows; } public void setShows(Set shows) { this.shows = shows; } } Might the problem be related to the lack of annotations?

    Read the article

  • Populating a foreign key table with variable user input

    - by Vincent
    I'm working on a website that will be based on user contributed data, submitted using a regular HTML form. To simplify my question, let's say that there will be two fields in the form: "User Name" and "Country" (this is just an example, not the actual site). There will be two tables in the database : "countries" and "users," with "users.country_id" being a foreign key to the "countries" table (one-to-many). The initial database will be empty. Users from all over the world will submit their names and the countries they live in and eventually the "countries" table will get filled out with all of the country names in the world. Since one country can have several alternative names, input like Chile, Chili, Chilli will generate 3 different records in the countries table, but in fact there is only one country. When I search for records from Chile, Chili and Chilli will not be included. So my question is - what would be the best way to deal with a situation like this, with conditions such that the initial database is empty, no other resources are available and everything is based on user input? How can I organize it in such way that Chile, Chili and Chilli would be treated as one country, with minimum manual interference. What are the best practices when it comes to normalizing user submitted data and is there a scientific term for this? I'm sure this is a common problem. Again, I used country names just to simplify my question, it can be anything that has possible different spellings.

    Read the article

  • Cakephp change model's title without rename model/dbtable

    - by Vincent
    I have a table that store all information about class, but because Class is reserved for class name I had to rename the table from classes to types. But in the view section I need it to be displayed as "Class", including the Paginator links. Anyway to achieve this by adding something in the Type model, without completely customize Paginator and and all view compoenents?

    Read the article

  • What is the best web-based File Explorer?

    - by Vincent
    I would like to know what you think is the best web-based File Explorer to manage files in a remote server through HTTP / Web. It would be preferable to have PHP or Flash technology, but any good suggestion would do. More generally, how would you allow someone to manage files on a remote server with HTTP being the only open outgoing port?

    Read the article

  • Jquery - check if atleast one checkbox is checked

    - by Vincent
    All, I have the following HTML form and it can have many checkboxes. When the submit button is clicked, I want the user to get a javascript alert to check atleast one checkbox if none are checked. Is there an easy way to do this using Jquery? <form name = "frmTest" id="frmTest"> <input type="checkbox" value="true" checked="true" name="chk[120]"> <input type="checkbox" value="true" checked="true" name="chk[128]"> <input type="checkbox" name="chk[130]"> <input type="checkbox" name="chk[143]"> <input type="submit" name="btnsubmit" value="Submit"> </form> Thanks

    Read the article

  • Monitor and Terminate Python script based on system resource use

    - by Vincent
    What is the "right" or "best" way to monitor the system resources a python script is using and terminate it if the resource use exceeds some predetermined values. In my case memory usage is of concern. I am not asking how to measure the system resource use although I am open to suggestions. As a simple example, let's assume I have a function that finds prime numbers less than some large number and adds them to a list based on some condition. I don't know ahead of time how many prime numbers will satisfy the condition so I what to be sure to terminate the function if I use up to much system memory (8gb lets say). I know that there are ways to monitor the size of python objects. What I don't know is the proper way to monitor the size of the list and exit is to just include a size test in the prime function loop and exit if it exceeds 8gb or if there is an "external" way to monitor and exit.

    Read the article

  • Annotate gem and rails 3.1

    - by vincent jacquel
    Does anyone have any idea why annotate does not work anymore in rails 3.1 ? When trying to run it with : $ rvmsudo bundle exec annotate --position before and given I've got the following in my gemfile: gem "annotate", '2.4.0' I get the following error: /usr/local/rvm/gems/ruby-1.9.2-p180@rails31/gems/activerecord-3.1.0/lib/active_record /railties/databases.rake:3:in `<top (required)>': undefined method `namespace' for main:Object (NoMethodError) I'm using RVM with a gemset dedicated to rails 3.1 with Ruby 1.9.2

    Read the article

  • Sort array with multiple keys

    - by Vincent
    All, I have the following array in array format. The JSON format is shown just for user-friendliness. How can I sort the array ascending with the key "name" in php? "food": [ { "id": 1, "name": "dessert" }, { "id": 2, "name": "maincourse" }, { "id": 3, "name": "entrees" }, { "id": 4, "name": "appetizers" } ]

    Read the article

  • Odd C interview question

    - by Brennan Vincent
    Hi guys. I found this problem on a site full of interview questions, and was stumped by it. Is there some preprocessor directive that allows one to read from standard input during compilation? Write a small C program, which while compiling takes another program from input terminal, and on running gives the result for the second program. (NOTE: The key is, think UNIX). Suppose, the program is 1.c Then, while compiling $ cc -o 1 1.c int main() { printf("Hello World\n"); } ^D $ ./1 Hello World

    Read the article

  • construct graph from python set type.

    - by Vincent
    The sort question, is the an off the self function to make a graph from a set of python sets? The longer: I have several python set types. They each overlap or some are sub sets of others. I would like to make a graph (as in nodes and edges) with the edges weighted by common intersection of the sets. There are several graphing packages for python. (NetworkX, igraph,...) I am not familiar with the use of any of them. Will any of them make a graph directly from a list of sets ie, MakeGraphfromSets(alistofsets) If not do you know of an example of how to take the list of sets to define the edges. It actually looks like it might be straight forward but an example is always good to have.

    Read the article

  • derived class as default argument g++

    - by Vincent
    Please take a look at this code: template<class T> class A { class base { }; class derived : public A<T>::base { }; public: int f(typename A<T>::base& arg = typename A<T>::derived()) { return 0; } }; int main() { A<int> a; a.f(); return 0; } Compiling generates the following error message in g++: test.cpp: In function 'int main()': test.cpp:25: error: default argument for parameter of type 'A<int>::base&' has type 'A<int>::derived' The basic idea (using derived class as default value for base-reference-type argument) works in visual studio, but not in g++. I have to publish my code to the university server where they compile it with gcc. What can I do? Is there something I am missing?

    Read the article

  • use/run python's 2to3 as or like a unittest

    - by Vincent
    I have used the 2to3 utility to convert code from the command line. What I would like to do is run it basically as a unittest. Even if it tests the file rather than parts(funtions, methods...) as would be normal for a unittest. It does not need to be a unittest and I don't what to automatically convert the files I just want to monitor the py3 compliance of files in a unittest like manor. I can't seem to find any documentation or examples for this. An example and/or documentation would be great. Thanks

    Read the article

  • Is it possible for the View to subscribe ViewModel CLR event?

    - by Vincent Leung
    Sometimes a view model needs to raise notifications, that a view should handle and do something in response, esp. when these can't be modeled as properties and property change notifications. Anything in MVVM Light that can allow the view to listen to events and translate view model notifications into user interface actions via declarative Xaml markup?

    Read the article

  • CURL alternative - Design ideas

    - by Vincent
    All, I am looking for some web application design ideas here. I have a server X that hosts an SDK, which has the capacity to talk a piece of hardware. When I make an HTTPS request from an external PHP web application (hosted on Server Y) to Server X through curl, Server X gives JSON data as a response. I use this data to render my UI for the web app on Server Y. The above method seems to be slow and has a tendency to fail in production if there are too many concurrent requests. Can anybody let me know if there is an alternative to CURL or any other design people are using to pull data like this from servers? Thanks

    Read the article

  • Question regarding Ajax Hacking

    - by Vincent
    All, I have a PHP website written in Zend Framework and MVC. Most of the controller actions check if the request is an Ajax request or not, else they redirect the user to home page. I am thinking about various ways to break that site. I am considering the following scenario: A user creates his own PHP project on his Local machine. User writes a JQuery ajax post request to one of the controllers on my site and tries to post malicious info. Ex: $.ajax({ type: 'POST', url: "https://marketsite/getinfo/getstuff", cache: false, dataType: "html", success: function(html_response){ alert(html_response); }, error: function(xhr,ajaxOptions,errorThrown){ alert(errorThrown); } }); My Question is does "url" attribute in the ajax request above take absolute path? I know it takes relative path. Also, is it possible to break any site by sending such requests? Thanks

    Read the article

  • Body class for controller in Rails app.

    - by Vincent
    Currently I have this in my layout: <body class="<%= controller.controller_name %>"> I want to add an additional class that will be the same for all actions in any controller where it's set, something like: class SomeController < ApplicationController body_class 'page' ... end class AnotherController < ApplicationController body_class 'page' ... end Which will result in: <body class="some page"> <body class="another page"> What would be the easiest way to achieve this? Can I use controller class variables for this?

    Read the article

  • Redirect URL from AJAX Calls

    - by Vincent
    All, I have an application written in Zend MVC Framework. So, naturally all regular requests and ajax requests go through /public/index.php. I want my application to support maintenance mode. So, in my index.php file, I have the following code: if( Zend_Registry::get('config')->maintenance == 'true' ) { header('Location:/maintenance.php'); } The issue is, when ajax requests are called they render servermaintenance.php inside the page instead of redirecting to this page. How can I make sure it gets redirected instead of getting rendered? Thanks

    Read the article

  • Migrating from Struts2 to Spring MVC

    - by Vincent Ramdhanie
    Scenario: A fairly mature project uses Struts2 and Spring and Hibernate. I say mature because it has been going on a for a while and there are many struts actions written already. Suppose we wanted to remove Struts2 from the project and instead depend entirely on Spring MVC without rewriting the entire project. Is this something that should even be considered? Are there any migration guides out there? Has anyone done this before and would like to warn me against it?

    Read the article

  • Calculating distance from latitude, longitude and height using a geocentric co-ordinate system

    - by Sarge
    I've implemented this method in Javascript and I'm roughly 2.5% out and I'd like to understand why. My input data is an array of points represented as latitude, longitude and the height above the WGS84 ellipsoid. These points are taken from data collected from a wrist-mounted GPS device during a marathon race. My algorithm was to convert each point to cartesian geocentric co-ordinates and then compute the Euclidean distance (c.f Pythagoras). Cartesian geocentric is also known as Earth Centred Earth Fixed. i.e. it's an X, Y, Z co-ordinate system which rotates with the earth. My test data was the data from a marathon and so the distance should be very close to 42.26km. However, the distance comes to about 43.4km. I've tried various approaches and nothing changes the result by more than a metre. e.g. I replaced the height data with data from the NASA SRTM mission, I've set the height to zero, etc. Using Google, I found two points in the literature where lat, lon, height had been transformed and my transformation algorithm is matching. What could explain this? Am I expecting too much from Javascript's double representation? (The X, Y, Z numbers are very big but the differences between two points is very small). My alternative is to move to computing the geodesic across the WGS84 ellipsoid using Vincenty's algorithm (or similar) and then calculating the Euclidean distance with the two heights but this seems inaccurate. Thanks in advance for your help!

    Read the article

  • Is a full html page needed when loading a page with jQuery mobile?

    - by Vincent Hiribarren
    I am currently looking at jQuery mobile and its system of loading web pages with XmlHttpRequest. Thanks to that it is possible to automatically perform transition animations between two pages, for instance. However, something is not clear to me. If I understand correctly, each new page of a jQuery mobile powered website is injected in the DOM of the initial web page. The documentation of jQuery mobile even tells that because of this mechanism, the <title> tag of new webpages are not taken into account. So, in a way, if my initial webpage A.html loads a page B.html, I would tend to think that the webpage B.html does not need to have a full HTML grammar with the <html>, <head> or <body> tags. My page B.html could directly begin with a <div> element. Am I right?Is a full html page needed when loading a HTML page with jQuery mobile?What are the pros and cons about having a webpage with a wrong/truncated HTML syntax (appart that this page should not be accessed directly but through the main page)?

    Read the article

  • Zend - Deny access to CSS, JS, Image files

    - by Vincent
    All, I have the following Zend application structure: helloworld - application - configs - controllers - models - layouts - include - library - public - design -- css -- site.css -- js -- global.js -- images -- siteheader.gif -- sitefooter.gif - .htaccess - index.php My .htaccess file in public folder looks like this: Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] My document root points to the "public" folder. Currently, if the user visits a directory level URL, (Ex: http://localhost/design or localhost/css) , my .htaccess file above make sure to show him the "Access Forbidden" page. But if he visits the file level URL, (Ex: http://localhost/design/css/site.css), it shows him the CSS file or the js file or PHP file.. How can I make sure to lock file level access for the above file types, if accessed directly from the URL? Since my application is JS intensive, I want to protect it from users looking at it. Thanks

    Read the article

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