Daily Archives

Articles indexed Saturday September 1 2012

Page 3/15 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Do subdomains need to be defined through domain registrar?

    - by Johnny
    I have bought a new domain name from GoDaddy. Let's say it is abcd.com. On GoDaddy's DNS Managing page, I changed A(Host) part to @ = 74.125.232.215 which is www.google.co.uk's IP address. Now if I type www.abcd.com, it directly goes to www.google.co.uk. But if I type http://test.abcd.com, it cannot be loaded. Do I need to define every subdomain through GoDaddy? Is this how it works? P.S. Amazon EC2 directly generates a subdomain for users to reach their virtual PCs. It cannot be domain registrar dependant. P.S.2. Same question for using "www2" at the start of url.

    Read the article

  • Let apache run perlscripts that don't have an extension

    - by tiMbeRdroP
    I'd like to use perlscripts without their extension. f.e. "index" instead of "index.pl". Changing the DefaultType-directive from text/plain to application/x-perl didn't do the trick. Instead of running the script the server offered to download its source. I'm not exactly sure if changing this directive is the right approach. Telling apache to read the shebang-line when there is no extension sounds much better to me. I hope someone with more experience on this topic can help me out.

    Read the article

  • Image hotlinking providers?

    - by Josh
    I use a lot of images in my wordpress and due to hosting restrictions I need to host the images somewhere else and hotlink them in my blog posts. So I am looking for some reliable image host which provides free hotlinking service. The Google Picasa would be best, but I think they do not allow hotlinking. PS. I'm not looking for hosts like tinypic or imgshack, I'm looking for some websites which provides powerful features to oranize images (eg. albums etc).

    Read the article

  • how to get new site indexed by alexa

    - by JohnMerlino
    When I search my site on alexa, it says "Alexa Traffic Rank: No Data". So I google the issue. I come across this page: http://www.loudable.com/my-website-data-not-showing-in-alexa-get-your-website-crawled-by-alexasolution.html It says to get site indexed, click Crawl my site on the webmasters page. However there is no longer a link that says "Crawl my site". So as of now, does anyone know how to get site indexed by alexa so that my traffic rank will display on alexa index?

    Read the article

  • What options are out there for an embeddable WYSIWIG text editor?

    - by Evan Plaice
    I'm thinking something along the lines of TinyMCE Please include a list of features. Examples include: supports text formatting supports links supports images syntax types (markdown/wiki/etc) licensing and/or pricing customizibility plugin support browser compatibility Note: Please limit the answers to one editor per answer to preserve cleanliness Update: Forgot to add browser compatibility to the list

    Read the article

  • Please help with bounding box/sprite collision in darkBASIC pro

    - by user1601163
    So I just recently learned BASIC and figured I would try making a clone of pong on my own in darkBASIC pro, and I made everything else work just fine except for the part that makes the ball bounce off the paddle. And yes I'm aware that the game is not yet finished. The error is on lines 39-51 EVERYTHING IS 2D. /////////////////////////////////////////////////////////// // // Project: Pong // Created: Friday, August 31, 2012 // Code: Brandon Spaulding // Art: Brandon Spaulding // Made in CIS lab at CPAVTS // Pong art and code © Brandon Spaulding 2012-2013 // ////////////////////////////////////////////////////////// y=150 x=0 ay=150 ax=612 ballx=300 bally=200 ballx_DIR=1 bally_DIR=1 hide mouse set global collision on //objectnumber=10 //make object box objectnumber,5,150,0 do load image "media\paddle1.png",1 load image "media\paddle2.png",2 load image "media\ball.png",3 sprite 1,x,y,1 sprite 2,ax,ay,2 sprite 3,ballx,bally,3 if upkey()=1 then y = y - 4 if downkey()=1 then y = y + 4 //num_1 = sprite collision(1,0) //num_2 = sprite collision(2,0) num_3 = sprite collision(3,0) for t=1 to 2 //ball&paddle collision if num_3 > 0 if bally_DIR=1 bally_DIR=0 else bally_DIR=1 endif if ballx_DIR=0 ballx_DIR=1 else ballx_DIR=0 endif endif //if bally > 1 and bally < 500 then bally=bally + 2.5 if bally_DIR=1 bally=bally-2.5 if bally<-2.5 bally_DIR=0 endif else bally=bally+2.5 if bally>452.5 bally_DIR=1 endif endif if ballx_DIR=1 ballx=ballx-2.5 if ballx<-2.5 ballx_DIR=0 endif else ballx=ballx+2.5 if ballx>612 ballx_DIR=1 endif endif //bally = bally + t //if bally < 600 or bally > 1 then bally = bally - 2.5 //if ballx < 400 or ballx > 1 then ballx = ballx + 2.5 //move sprite 3,1 next t if escapekey()=1 then exit loop end Thank you in advance for the help.

    Read the article

  • Checking collision of bullets and Asteroids

    - by Moaz ELdeen
    I'm trying to detect collision between two list of bullets and asteroids. The code works fine, but when the bullet intersects with an asteroid, and that bullet passes through another asteroid, the code gives an assertion, and it says about it can't increment the iterator. I'm sure there is a small bug in that code, but I can't find it. for (list<Bullet>::iterator itr_bullet = ship.m_Bullets.begin(); itr_bullet!=ship.m_Bullets.end();) { for (list<Asteroid>::iterator itr_astroid = asteroids.begin(); itr_astroid!=asteroids.end(); itr_astroid++) { if(checkCollision(itr_bullet->getCenter(),itr_astroid->getCenter(), itr_bullet->getRadius(), itr_astroid->getRadius())) { itr_astroid = asteroids.erase(itr_astroid); } } itr_bullet++; }

    Read the article

  • Bubble sorting my array does not sort it

    - by Trixmix
    I sort an array of chunks by doing this: for (int i =0; i<this.getQueue().size();i++) { for (int j =0; j<this.getQueue().size()-i-1;j++) { Chunk temp1 = this.getQueue().get(i); Chunk temp2 = this.getQueue().get(i+1); if (temp1 != null &&temp2 != null && temp2.getLocation().getY() < temp1.getLocation().getY()) { this.getQueue().set(i, temp2); this.getQueue().set(i+1, temp1); } } } What I want is the the chunks with the lowest Y coordinate will be at the start of the array and the ones with the bigger Y coordinate will be at the end of the array. And this is my result: 1024.0 944.0 1104.0 944.0 1104.0 ----BEFORE----- 944.0 1024.0 944.0 1104.0 1104.0 ---AFTER--- Why is this not working It seams fine. I dont want to use a comparator so dont suggest it. More info, the Y cords are floats. I got the result by for each looping on this queue and printed the Y locations.

    Read the article

  • Getting Center and Radius of Irregural Object

    - by Moaz ELdeen
    I have drawn an asteroid object manually , and would like to get its center/radius by a specific equation. I think I can get them by calculated and hard-coded values. The code to draw the asteroid: void Asteroid::Draw() { float ratio = app::getWindowWidth()/app::getWindowHeight(); gl::pushMatrices(); gl::translate(m_Pos*ratio); gl::scale(3.5*ratio,3.5*ratio,3.5*ratio); gl::color(ci::Color(1,1,1)); gl::drawLine(Vec2f(-15,0),Vec2f(-10,-5)); gl::drawLine(Vec2f(-10,-5),Vec2f(-5,-5)); gl::drawLine(Vec2f(-5,-5),Vec2f(-5,-8)); gl::drawLine(Vec2f(-5,-8),Vec2f(5,-8)); gl::drawLine(Vec2f(5,-8),Vec2f(5,-5)); gl::drawLine(Vec2f(5,-5),Vec2f(10,-5)); gl::drawLine(Vec2f(10,-5),Vec2f(15,0)); gl::drawLine(Vec2f(15,0),Vec2f(10,5)); gl::drawLine(Vec2f(10,5),Vec2f(-10,5)); gl::drawLine(Vec2f(-10,5),Vec2f(-10,5)); gl::drawLine(Vec2f(-15,0),Vec2f(-10,5)); gl::popMatrices(); } According to the answer I have written that code to calculate the radius, is it correct or not ? cinder::Vec2f Asteroid::getCenter() { return ci::Vec2f(m_Pos.x, m_Pos.y); } double Asteroid::getRadius() { ci::Vec2f _vec = (getCenter()- Vec2f(15,5)); return _vec.length()*0.3f; }

    Read the article

  • javascript fixed timestep gameloop with requestanimation frame

    - by coffeecup
    hello i just started to read through several articles, including http://gafferongames.com/game-physics/fix-your-timestep/ ...://gamedev.stackexchange.com/questions/1589/fixed-time-step-vs-variable-time-step/ ...//dewitters.koonsolo.com/gameloop.html ...://nokarma.org/2011/02/02/javascript-game-development-the-game-loop/index.html my understanding of this is that i need the currentTime and the timeStep size and integrate all states to the next state the time which is left is then passed into the render function to do interpolation i tried to implement glenn fiedlers "the final touch", whats troubling me is that each FrameTime is about 15 (ms) and the update loop runs at about 1500 fps which seems a little bit off? heres my code this.t = 0 this.dt = 0.01 this.currTime = new Date().getTime() this.accumulator = 0.0 this.animate() animate: function(){ var newTime = new Date().getTime() , frameTime = newTime - this.currTime , alpha if ( frameTime > 0.25 ) frameTime = 0.25 this.currTime = newTime this.accumulator += frameTime while (this.accumulator >= this.dt ) { this.prev_state = this.curr_state this.update(this.t,this.dt) this.t += this.dt this.accumulator -= this.dt } alpha = this.accumulator / this.dt this.render( this.t, this.dt, alpha) requestAnimationFrame( this.animate ) } also i would like to know, are there differences between glenn fiedlers implementation and the last solution presented here ? gameloop1 gameloop2 [ sorry couldnt post more than 2 links.. ] edit : i looked into it again and adjusted the values this.currTime = new Date().getTime() this.accumulator = 0 this.p_t = 0 this.p_step = 1000/100 this.animate() animate: function(){ var newTime = new Date().getTime() , frameTime = newTime - this.currTime , alpha if(frameTime > 25) frameTime = 25 this.currTime = newTime this.accumulator += frameTime while(this.accumulator >= this.p_step){ // prevstate = currState this.update() this.p_t+=this.p_step this.accumulator -= this.p_step } alpha = this.accumulator / this.p_step this.render(alpha) requestAnimationFrame( this.animate ) now i can set the physics update rate, render runs at 60 fps and physics update at 100 fps, maybe someone could confirm this because its the first time i'm playing around with game development :-)

    Read the article

  • Objective C convention: When to use For and when to use With

    - by Howard
    According to the Apple guideline , seems it is confusing, e.g. for method viewWithTag In Java, I would have a method called getViewByTag // Java version, equivalent to viewWithTag in Obj-C But I also found there are some method like objectForKey, so why not just use objectWithKey instead? getObjectByKey or just get // Java version, equivalent to objectForKey, // but why not objectWithKey? Or not viewForKey above?

    Read the article

  • Newbie: understanding main and IO()

    - by user1640285
    While learning Haskell I am wondering when an IO action will be performed. In several places I found descriptions like this: "What’s special about I/O actions is that if they fall into the main function, they are performed." But in the following example, 'greet' never returns and therefore nothing should be printed. import Control.Monad main = greet greet = forever $ putStrLn "Hello World!" Or maybe I should ask: what does it mean to "fall into the main function"?

    Read the article

  • save sqlite3 file of my App

    - by user1553381
    I'm new with dealing with the .sqlite3 in iphone, I created a sqlite3 file in /Users/myLab/Library/Application Support/iPhone Simulator/5.1/Applications/308C4355-D8EE-4524-A7F9-638DEB68B298/Documents/file.sqlite3 and I inserted the tables into it using Terminal.app and everything works ok with my app. but when I moved this application to another device, opened by xcode and trying to run it, I discovered that my tables are not found in this .sqlite3 file in another device. how can I save my tables in .sqlite3 file??

    Read the article

  • Action method expected parameter named Id and nothing otherwise

    - by codingbiz
    The Error The parameters dictionary contains a null entry for parameter 'UserId' of non-nullable type 'System.Int64' for method 'System.Web.Mvc.ActionResult Predict(Int64)' in 'sportingbiz.Controllers.PredictionController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters This does not work. Throws the error mentioned above http://mysite/User/Profile/15 This works http://mysite/User/Profile/?UserID=15 The Controller Action public ActionResult Profile(long UserID) { } When I changed the parameter name to Id it works. I think it's because Id was specified in the route collection (Global.asax). Is it possible to tell MVC that UserId should map to Id without changing it in the Global.asax

    Read the article

  • Output is different for R-value and L-value. Why?

    - by Leonid Volnitsky
    Can someone explain to me why output for R-value is different from L-value? #include <iostream> #include <vector> using namespace std; template<typename Ct> struct ct_wrapper { Ct&& ct; // R or L ref explicit ct_wrapper(Ct&& ct) : ct(std::forward<Ct>(ct)) { std::cout << this->ct[1];}; }; int main() { // L-val vector<int> v{1,2,3}; ct_wrapper<vector<int>&> lv(v); cout << endl << lv.ct[0] << lv.ct[1] << lv.ct[2] << endl; // R-val ct_wrapper<vector<int>&&> rv(vector<int>{1,2,3}); cout << endl << rv.ct[0] << rv.ct[1] << rv.ct[2] << endl; } Output (same for gcc48 and clang32): 2 123 2 003

    Read the article

  • How to only reference one element when using .live("click" with elements within each other?

    - by think123
    Suppose I have the following code: <div id="outerrt"> <div id="rt" style="width: 200px; height: 200px; border: 1px solid black;"> <span id="rt2">content</span> </div> </div> And I use the following: $("#outerrt *").live("click", function () { alert($(this).attr('id')); }); What it would give me when I click on the content text is three alert windows, in the following order: rt2 rt outerrt What I actually want it to give me is only one id: rt2. How do I accomplish that?

    Read the article

  • Adding scope variable to an constructor

    - by Lupus
    I'm trying to create a class like architecture on javascript but stuck on a point. Here is the code: var make = function(args) { var priv = args.priv, cons = args.cons, pub = args.pub; return function(consParams) { var priv = priv, cons = args.cons; cons.prototype.constructor = cons; cons.prototype = $.extend({}, pub); if (!$.isFunction(cons)) { throw new Hata(100001); } return new cons(consParams); } }; I'm trying to add the priv variable on the returned function objects's scope and object scope of the cons.prototype but I could not make it; Here is the usage of the make object: var myClass = make({ cons: function() { alert(this.acik); }, pub: { acik: 'acik' }, priv: { gizli: 'gizli' } }) myObj = myClass(); PS: Please forgive my english...

    Read the article

  • SDK Facebook app - allow to use the app only on FB, not on my website

    - by user984621
    I am newbie in creating apps for Facebook and I would like to ask you about a few things. I created my first app, in the settings I set up the domain URL, canvas URL, etc... when I load the app via apps.facebook.com/my_app_name the app is working, but also when I visit the page via the canvas URL I configured. Is there any way to only allow access to the app only when loaded inside the Facebook chrome? Also, in the app that I made are some links, buttons, etc. and when you hover over them with the mouse you can see my own domain in the status bar below. Is there a way to change that?

    Read the article

  • PHP Copy-Paste Detector

    - by user1615069
    My problem is that when I run phpcpd command I always get 0% doubled code result, no matter if it's my project, if it's any php module's files, or if it's a file I created to check if phpcpd works...For example when I check the file below it also displays 0%: phpcpd folder/file.php: <?php class Class_Two { public function aaa() { if(2 == 2) { echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; echo 'ok'; } } } class Class_Two { public function aaa() { if(2 == 2) { echo 'ok'; } } public function aaa() { if(2 == 2) { echo 'ok'; } } } Any suggestions on why isn't it working properly? Or maybe it is supposed to do some other tasks?

    Read the article

  • Shell script for generating HTML out put

    - by user1638016
    The following script is generating the desired out put but not redirecting the result to /home/myuser/slavedelay.html #!/bin/bash host=<ip> echo $host user=usr1 password=mypass threshold=300 statusok=OK statuscritical=CRITICAL for i in ert7 ert9 do echo "<html>" > /home/myuser/slavedelay.html if [ "$i" == "ert7" ]; then slvdelay=`mysql -u$user -p$password -h<ip> -S /backup/mysql/mysql.sock -e 'show slave status\G' | grep Seconds_Behind_Master | sed -e 's/ *Seconds_Behind_Master: //'` if [ $slvdelay -ge $threshold ]; then echo "<tr><td>$i</td><td>CRITICAL</td>" >> /home/myuser/slavedelay.html echo "<tr><td>$i</td><td>CRITICAL</td>" else echo "<tr><td>$i</td><td>OK</td>" >> /home/myuser/slavedelay.html echo "<tr><td>$i</td><td>OK</td>" fi fi done echo "</html>" >> /home/myuser/slavedelay.html If I cat the output file /home/myuser/slavedelay.html it gives. <html> </html> Execution result : sh slave_delay.sh <tr><td>sdb7</td><td>OK</td>

    Read the article

  • how to gzip-compress large Ajax responses (HTML only) in Coldfusion?

    - by frequent
    I'm running Coldfusion8 and jquery/jquery-mobile on the front-end. I'm playing around with an Ajax powered search engine trying to find the best tradeoff between data-volume and client-side processing time. Currently my AJAX search returns 40k of (JQM-enhanced markup), which avoids any client-side enhancement. This way I'm getting by without the page stalling for about 2-3 seconds, while JQM enhances all elements in the search results. What I'm curious is whether I can gzip Ajax responses sent from Coldfusion. If I check the header of my search right now, I'm having this: RESPONSE-header Connection Keep-Alive Content-Type text/html; charset=UTF-8 Date Sat, 01 Sep 2012 08:47:07 GMT Keep-Alive timeout=5, max=95 Server Apache/2.2.21 (Win32) mod_ssl/2.2.21 ... Transfer-Encoding chunked REQUEST-header Accept */* Accept-Encoding gzip, deflate Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 Connection keep-alive Cookie CFID= ; CFTOKEN= ; resolution=1143 Host www.host.com Referer http://www.host.com/dev/users/index.cfm So, my request would accept gzip, deflate, but I'm getting back chunked. I'm generating the AJAX response in a cfsavecontent (called compressedHTML) and run this to eliminate whitespace <cfrscipt> compressedHTML = reReplace(renderedResults, "\>\s+\<", "> <", "ALL"); compressedHTML = reReplace(compressedHTML, "\s{2,}", chr(13), "ALL"); compressedHTML = reReplace(compressedHTML, "\s{2,}", chr(09), "ALL"); </cfscript> before sending the compressedHTML in a response object like this: {"SUCCESS":true,"DATA": compressedHTML } Question If I know I'm sending back HTML in my data object via Ajax, is there a way to gzip the response server-side before returning it vs sending chunked? If this is at all possible? If so, can I do this inside my response object or would I have to send back "pure" HTML? Thanks! EDIT: Found this on setting a 'web.config' for dynamic compression - doesn't seem to work EDIT2: Found thi snippet and am playing with it, although I'm not sure this will work. <cfscript> compressedHTML = reReplace(renderedResults, "\>\s+\<", "> <", "ALL"); compressedHTML = reReplace(compressedHTML, "\s{2,}", chr(13), "ALL"); compressedHTML = reReplace(compressedHTML, "\s{2,}", chr(09), "ALL"); if ( cgi.HTTP_ACCEPT_ENCODING contains "gzip" AND not showRaw ){ cfheader name="Content-Encoding" value="gzip"; bos = createObject("java","java.io.ByteArrayOutputStream").init(); gzipStream = createObject("java","java.util.zip.GZIPOutputStream"); gzipStream.init(bos); gzipStream.write(compressedHTML.getBytes("utf-8")); gzipStream.close(); bos.flush(); bos.close(); encoder = createObject("java","sun.misc. outStr= encoder.encode(bos.toByteArray()); compressedHTML = toString(bos.toByteArray()); } </cfscript> Probably need to try this on the response object and not the compressedTHML variable

    Read the article

  • EL syntax error: Expression cannot start with binary operator

    - by auser
    Anyone have any creative ideas for how I can solve this warning? EL syntax error: Expression cannot start with binary operator caused by the following code: String.format("#{myController.deleteItemById(%d)}", getId()) My code looked like this before: "#{myController.deleteItemById(" + getId() + ")}" but this caused eclipse to generate the following warning: EL syntax error: String is not closed UPDATE: @ManagedBean(name = "myController") @ViewScoped public class MyController implements Serializable { private long id; private HtmlPanelGroup panel; public long getId() {return this.id; } private void getPanel() { /// bunch of code for programatically creating a form HtmlCommandButton deleteButton = new HtmlCommandButton(); deleteButton.setId(id); deleteButton.setValue(value); deleteButton.setActionExpression(/* EL expression used here */); } } <?xml version='1.0' encoding='UTF-8' ?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <!-- some other elements removed for the sake of clarity --> <h:body> <h:panelGroup binding="#{myController.panel}" /> </h:body> </html>

    Read the article

  • Hibernate Lazy init exception in spring scheduled job

    - by Noam Nevo
    I have a spring scheduled job (@Scheduled) that sends emails from my system according to a list of recipients in the DB. This method is annotated with the @Scheduled annotation and it invokes a method from another interface, the method in the interface is annotated with the @Transactional annotation. Now, when i invoke the scheduled method manually, it works perfectly. But when the method is invoked by spring scheduler i get the LazyInitFailed exception in the method implementing the said interface. What am I doing wrong? code: The scheduled method: @Component public class ScheduledReportsSender { public static final int MAX_RETIRES = 3; public static final long HALF_HOUR = 1000 * 60 * 30; @Autowired IScheduledReportDAO scheduledReportDAO; @Autowired IDataService dataService; @Autowired IErrorService errorService; @Scheduled(cron = "0 0 3 ? * *") // every day at 2:10AM public void runDailyReports() { // get all daily reports List<ScheduledReport> scheduledReports = scheduledReportDAO.getDaily(); sendScheduledReports(scheduledReports); } private void sendScheduledReports(List<ScheduledReport> scheduledReports) { if(scheduledReports.size()<1) { return; } //check if data flow ended its process by checking the report_last_updated table in dwh int reportTimeId = scheduledReportDAO.getReportTimeId(); String todayTimeId = DateUtils.getTimeid(DateUtils.getTodayDate()); int yesterdayTimeId = Integer.parseInt(DateUtils.addDaysSafe(todayTimeId, -1)); int counter = 0; //wait for time id to update from the daily flow while (reportTimeId != yesterdayTimeId && counter < MAX_RETIRES) { errorService.logException("Daily report sender, data not ready. Will try again in one hour.", null, null, null); try { Thread.sleep(HALF_HOUR); } catch (InterruptedException ignore) {} reportTimeId = scheduledReportDAO.getReportTimeId(); counter++; } if (counter == MAX_RETIRES) { MarketplaceServiceException mse = new MarketplaceServiceException(); mse.setMessage("Data flow not done for today, reports are not sent."); throw mse; } // get updated timeid updateTimeId(); for (ScheduledReport scheduledReport : scheduledReports) { dataService.generateScheduledReport(scheduledReport); } } } The Invoked interface: public interface IDataService { @Transactional public void generateScheduledReport(ScheduledReport scheduledReport); } The implementation (up to the line of the exception): @Service public class DataService implements IDataService { public void generateScheduledReport(ScheduledReport scheduledReport) { // if no recipients or no export type - return if(scheduledReport.getRecipients()==null || scheduledReport.getRecipients().size()==0 || scheduledReport.getExportType() == null) { return; } } } Stack trace: ERROR: 2012-09-01 03:30:00,365 [Scheduler-15] LazyInitializationException.<init>(42) | failed to lazily initialize a collection of role: com.x.model.scheduledReports.ScheduledReport.recipients, no session or session was closed org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.x.model.scheduledReports.ScheduledReport.recipients, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122) at org.hibernate.collection.PersistentBag.size(PersistentBag.java:248) at com.x.service.DataService.generateScheduledReport(DataService.java:219) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy208.generateScheduledReport(Unknown Source) at com.x.scheduledJobs.ScheduledReportsSender.sendScheduledReports(ScheduledReportsSender.java:85) at com.x.scheduledJobs.ScheduledReportsSender.runDailyReports(ScheduledReportsSender.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273) at org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:65) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) ERROR: 2012-09-01 03:30:00,366 [Scheduler-15] MethodInvokingRunnable.run(68) | Invocation of method 'runDailyReports' on target class [class com.x.scheduledJobs.ScheduledReportsSender] failed org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.x.model.scheduledReports.ScheduledReport.recipients, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122) at org.hibernate.collection.PersistentBag.size(PersistentBag.java:248) at com.x.service.DataService.generateScheduledReport(DataService.java:219) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy208.generateScheduledReport(Unknown Source) at com.x.scheduledJobs.ScheduledReportsSender.sendScheduledReports(ScheduledReportsSender.java:85) at com.x.scheduledJobs.ScheduledReportsSender.runDailyReports(ScheduledReportsSender.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273) at org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:65) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636)

    Read the article

  • how to refresh/reload dhtmlx grid

    - by steve
    I am using dhtmlx grid.I have two grids named grid1,grid2. I have loaded the two grids using json object. If i select one record in the grid1 and click on the button that record has to load in the second record.I am able to load that selected record in the second grid using document.location.reload(true);with this, the total page is refreshing.but i want to refresh grid2 only. I want to refresh grid2 only after click on the button.how can i refresh/reload grid2.

    Read the article

  • Memory issues - Living vs. overall -> app is killed

    - by D33
    I'm trying to check my applications memory issues in Instruments. When I load the application I play some sounds and show some animations in UIImageViews. To save some memory I load the sounds only when I need it and when I stop playing it I free it from the memory. problem 1: My application is using about 5.5MB of Living memory. BUT The Overall section is growing after start to 20MB and then it's slowly growing (about 100kB/sec). But responsible Library is OpenAL (OAL::Buffer), dyld (_dyld_start)-I am not sure what this really is, and some other stuff like ft_mem_qrealloc, CGFontStrikeSetValue, … problem 2: When the overall section breaks about 30MB, application crashes (is killed). According to the facts I already read about overall memory, it means then my all allocations and deallocation is about 30MB. But I don't really see the problem. When I need some sound for example I load it to the memory and when I don't need it anymore I release it. But that means when I load 1MB sound, this operation increase overall memory usage with 2MB. Am I right? And when I load 10 sounds my app crashes just because the fact my overall is too high even living is still low??? I am very confused about it. Could someone please help me clear it up? (I am on iOS 5 and using ARC) SOME CODE: creating the sound OpenAL: MYOpenALSound *sound = [[MyOpenALSound alloc] initWithSoundFile:filename willRepeat:NO]; if(!sound) return; [soundDictionary addObject:sound]; playing: [sound play]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, ((sound.duration * sound.pitch) + 0.1) * NSEC_PER_SEC), dispatch_get_current_queue(), ^{ [soundDictionary removeObjectForKey:[NSNumber numberWithInt:soundID]]; }); } creating the sound with AVAudioPlayer: [musics replaceObjectAtIndex:ID_MUSIC_MAP withObject:[[Music alloc] initWithFilename:@"mapMusic.mp3" andWillRepeat:YES]]; pom = [musics objectAtIndex:musicID]; [pom playMusic]; and stop and free it: [musics replaceObjectAtIndex:ID_MUSIC_MAP withObject:[NSNull null]]; AND IMAGE ANIMATIONS: I load images from big PNG file (this is realated also to my other topic : Memory warning - UIImageView and its animations) I have few UIImageViews and by time I'm setting animation arrays to play Animations... UIImage *source = [[UIImage alloc] initWithCGImage:[[UIImage imageNamed:@"imageSource.png"] CGImage]]; cutRect = CGRectMake(0*dimForImg.width,1*dimForImg.height,dimForImg.width,dimForImg.height); image1 = [[UIImage alloc] initWithCGImage:CGImageCreateWithImageInRect([source CGImage], cutRect)]; cutRect = CGRectMake(1*dimForImg.width,1*dimForImg.height,dimForImg.width,dimForImg.height); ... image12 = [[UIImage alloc] initWithCGImage:CGImageCreateWithImageInRect([source CGImage], cutRect)]; NSArray *images = [[NSArray alloc] initWithObjects:image1, image2, image3, image4, image5, image6, image7, image8, image9, image10, image11, image12, image12, image12, nil]; and this array I just use simply like : myUIImageView.animationImages = images, ... duration -> startAnimating

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >