Daily Archives

Articles indexed Thursday November 15 2012

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

  • How to revert to 10.04

    - by Keith Mastin
    Since "upgrading" to 12.10, the multitude of problems and slowness has wondering me , if I'm running windows, so I want to take it back to 10.04. Just some of the problems that we never had in 10.4: Can't play YouTube and chat at same time; Can't open more than 5 photos in GIMP without constant grayouts; Can't easily close apps or programs on desktop; Can't Use Avidimux and Audacity at same time, CPU load stays at 100%; New Gnome is not nearly as intuitive as classic, focus is all over the place, have to constantly switch to have the focus on right window of same program (either browser), etc. Do I need to wipe my system partition and start over, or is there an easier way to downgrade?

    Read the article

  • How to restart colord

    - by Blair Zajac
    A tiff security update came out today for 12.04 and colord is still running with the older shared library # lsof -n | grep DEL | grep /lib colord 3454 colord DEL REG 252,1 3673529 /usr/lib/x86_64-linux-gnu/libtiff.so.4.3.4 Besides restarting the whole system, given there's no /etc/init.d/colord, how do I restart it so it picks up the new libtiff.so.

    Read the article

  • How to enable home directory encryption for a particular user?

    - by Ivan
    I prefer to have a dedicated "administrator" user for technical purposes and that was one I've set up during installation. I've also refused to encrypt the home folder of the user. Now, as I've added a user account for my actual work usage I want my (but not the "administrator") home folder to be encrypted. How to turn this on? If it is not possible then how to enable encryption for all users home directories on a system already installed? I've found questions and answers about how to disable it but am not sure how to enable it.

    Read the article

  • XAMPP: Deamon is already running, but it's NOT apache

    - by TedvG
    This one is giving me a headache... I have installed XAMPP for Linux 1.7.7 on Ubuntu 12.10. I haven't installed the latest version because of the new security "feature" which makes XAMPP so secure I can't get it running... But that's another story. After it installed and ran ok for a couple of months, I now get the famous "XAMPP: Another web server daemon is already running." error while starting XAMPP. Now I've googled extensively and can rule out the following: There is no other Apache installation, just XAMPP There are no apache or apache 2 services running There are no services running that use port 80 (checked with netstat -an grep -w 80) I have also done a fresh install of xampp 1.7.7, but that gives me the same result. I think I have tried every solution on the first two result-pages of google and am nowhere nearer to a solution. Can anyone give me pointers on how to find the mysterious "Webdeamon" that is already running?

    Read the article

  • Fresh install of 64 bit 12.04 over 32 bit 11.10 alongside Windows 7

    - by Pareen
    I currently have Ubuntu 11.10 32 bit and Windows 7 dual boot in separate partitions. I am trying to do a fresh install of Ubuntu 12.04 64 bit (mistakenly installed the 32 bit 11.10 a little while ago.. I need a 64 bit version to support AOSP build) OVER my the exisiting 11.10 partition. I have referenced How to Install fresh 12.04 install to a PC with dual booting Windows 7 & Ubuntu11.10?, as well as other posts on using the Live CD to do a fresh install. However, the problem I am experiencing is when I bring up the install screen, it says the following: This computer has multiple operating systems on it. What would you like to do. (3 options) Install Ubuntu 12.04 alongside them Replace all with Ubuntu 12.04 (Warning, this will delete files across ALL operating systems) Something else (you can create or resize partitions yourself) This is different from what is in other posts, as mine states that there are "multiple O.Ses" and doesnt individually allow me to replace the Ubuntu 11.10. I don't want to replace ALL O.S.es: I need to preserve Windows 7 and am only trying to replace the old Ubuntu 11.10 partition with the new 12.04 64 bit. I did have Ubuntu installed via Wubi (I believe it was 10.04) prior to putting 11.10 in a separate partition, but I have removed it via Add/Remove programs in Windows. I was wondering how to go about doing this... Should I use the "Something else" option to bring up the partition manager, and just assign my existing 11.10 partition with root mount point + swap space. Will this do the same thing by overwriting with fresh 12.04 install?? I appreciate all your help.

    Read the article

  • Is 12.10 ready from prime time?

    - by Mikey
    I recently installed 12.10 - dual boot using Wubi. I had numerous stability problems: many sporadic, unaccounted for system errors, software that was installed and then seemed to disappear from App Launcher, etc. Machine is new HP quad with 4 gig memory - wonderful piece of hardware - definitely no hardware problems there. I went back to 12.04 (installed from ISO image, not Wubi) and it's rock solid - never any issues at all. Is 12.10 not ready for prime time? Are there fixes-updates in the pipe? Should I get a DVD disc and install 12.10 from ISO instead of Wubi? New to Linux/Ubuntu after 20 years on MS/Windows and loving it - I develop in C++ and Python - maybe will try Lazarus since I know Delphi. Would like to use the latest and greatest Ubuntu but I will not sacrifice stabilty. Are there known problems with 12.10? Would using the standard install instead of Wubi help? Seems a lot of users are voting down this question - not sure why since other users have confirmed problems.

    Read the article

  • Why does the BADSIG/"Untrusted sources" error recur forever?

    - by Jeff McMahan
    On at least a dozen occasions, I've spent 2-3 hours figuring out how to get Ubuntu 11.10-12.10 to either update or acquire software from software center, or both. I want to fix whatever is causing the BADSIG problem once and for all; I've wasted so much time trying to get this to work well enough that I can rely on it, but the same problem comes back after a couple weeks of normal updates and software center usage. Don't refer me to a standard posted solution on the web---whatever it is, I've used it more times than you have. The question isn't whether I can get it to work right this afternoon. I can. The question is what is causing the problem to recur regularly across 3 releases. Notice: I use this computer 4-5 hours per week and I do little on it. PDFs, Latex, FireFox, Mendeley, and that's it. I don't constantly install new software, and I don't fiddle with things unnecessarily.

    Read the article

  • How do I clear xmodmap settings?

    - by Wayne Werner
    Exactly what the title asks. How do I clear xmodmap settings? I have an IBM model M, and somehow xkeycaps got it into its head that my "End" key was not any key at all. xev reports keypresses when I use it, so I know the event is being generated by the keyboard. Also, xkeycaps thinks that my arrow keys are all wonky, and apparently the scrollbar is broken so it only scrolls down - so I can't scroll up to find an IBM keyboard that just maybe is close to my map so I can fix my keys. So I'm trying to reset my keyboard to the default settings, but the xmodmap manpage is woefully devoid of "reset all" or "clear all" or anything of that nature (that I was able to find). Help would be greatly appreciated!

    Read the article

  • Google Webmaster Tools Index dropped to Zero [closed]

    - by Brian Anderson
    Earlier this year I rebuilt my website using ZenCart. Immediately I saw a drop in index status from 59 to 0. I then signed up for Google Webmaster Tools and noticed the Index status took a dramatic drop and has never recovered. I have worked to add content and I know I am not done, but have not seen any recovery of this index since. What confuses me is when I look at the sitemap status under Optimization it shows me there are 1239 submitted and 1127 pages indexed. Most of my pages have fallen off page one for relevant search terms and some are as far back as page 7 or 8 where they used to be on the first page. I have made some changes in the past week to robots.txt and sitemap.xml, but have not seen any improvements. Can anyone tell me what might be going on here? My website is andersonpens.net. Thanks! Brian

    Read the article

  • SEO. dofollow trackback or nofollow trackback?

    - by Ernesto Marrero
    Thinking about SEO. It is better that they are dofollow trackback or nofollow trackback? When I write a post on my blog and automatically sends trackback to my site from http://bitacoras.com. The above link is dofollow. Is it advisable to give relevance to this link I also handing dofollow link? For example any domain. on the homepage has pagerank 3. This site has a pagerank 0 internal page that I send trackbacks. It is convenient to send dofollow link to that page to increase your pagerank. Increase my pagerank if I perform this operation ?works well ? Please appreciated.any reference in writing .

    Read the article

  • GLSL custom interpolation filter

    - by Cyan
    I'm currently building a fragment shader which is using several textures to render the final pixel color. The textures are not really textures, they are in fact "input data" to be used in the formula to generate the final color. The problem I've got is that the texture are getting bi-linear-filtered, and therefore the input data as well. This results in many unwanted side-effects, especially when final rendered texture is "zoomed" compared to original resolution. Removing the side effect is a complex task, and only result in "average" rendering. I was thinking : well, all my problems seems to come from the "default" bi-linear filtering on these input data. I can't move to GL_NEAREST either, since it would create "blocky" rendering. So i guess the better way to proceed is to be fully in charge of the interpolation. For this to work, i would need the input data at their "natural" resolution (so that means 4 samples), and a relative position between the sampled points. Is that possible, and if yes, how ? [EDIT] Since i started this question, i found this internet entry, which seems to (mostly) answer my needs. http://www.gamerendering.com/2008/10/05/bilinear-interpolation/ One aspect of the solution worry me though : the dimensions of the texture must be provided in an argument. It seems there is no way to "find this information transparently". Adding an argument into the rendering pipeline is unwelcomed though, since it's not under my responsibility, and translates into adding complexity for others.

    Read the article

  • How do display a "mucus spreading" effect in a 2D environment?

    - by nathan
    Here is an example of such a mucus spreading. The substance is spread around the source (in this example, the source would be the main alien building). The game is starcraft, the purple substance is called creep. How this kind of substance spreading would be achieved in a top down 2D environment? Recalculating the substance progression and regenerate the effect on the fly each frame or rather use a large collection of tiles or something else?

    Read the article

  • Twitter API PHP script error

    - by bardockyo
    I am having issues with my php script that I am using for gathering a users followers by accessing the twitter API. The script works fine for a user that has < 5000 followers but I tried adjusting the script using cursors to collect the complete set of users. Here is my script: <?php $cursor = -1; $file = fopen ('ids.csv', 'w+'); fwrite($file, "User id\n\r"); for ($i = 0; $i <= 1; $i++) { $xml = getFollowers($cursor); foreach ($xml->ids->id as $id) { fwrite($file, $id . ", "); fwrite($file, "\n"); } $cursor = $xml->next_cursor; } function getFollowers ($cursor) { $xmldata = 'https://api.twitter.com/1/followers/ids.xml?cursor='.$cursor.'&screen_name=microsoft'; $open = fopen($xmldata, 'r'); $content = stream_get_contents($open); fclose($open); $xml = simplexml_load_file($xmldata); return $xml; } ?> I am getting an error Warning: fopen("https://api.twitter.com/1/followers/ids.xml?cursor=-1&screen_name=microsoft") failed to open stream HTTP request failed bad request warning: stream_get_contents() expects parameter 1 to be resource, boolean given. Any ideas?

    Read the article

  • How to parse japanese char (utf8?) from imap_fetchbody?

    - by timh
    I am pulling down an email which has english, chinese and japanese in the email. I was using PHP/EZComponents to do this, but a certain japanese char was just not coming through so I am switching to php imap_* funcs to see if they will work. This is what I have below, and the output I am getting. I need to decode this somehow... I know this has been well (read:overly/chaotically) documented all over the web, but I dont have time to earn a PHD in this right now. Any help is greatly appreciated. $hn='{imap.gmail.com:993/imap/ssl}INBOX'; $inbox = imap_open($hn,$username,$password,CL_EXPUNGE); foreach($emails as $email_number) { $ov = imap_fetch_overview($inbox,$email_number,0); $msg = imap_fetchbody($inbox,$email_number,2); var_dump($msg); // doesnt work... .. but right idea? // var_dump( utf8_decode($msg) ); } PARTIAL OUTPUT: <font face=3D"Arial"><span lang=3D"EN-US" style=3D"font-size:10.5pt"><br></= span></font><font color=3D"navy" face=3D"MS Gothic"><span lang=3D"JA" style= =3D"font-size:10.5pt">=CC=EC=9A=DD=A4=AC=A4=A4=A4=A4=A4=AB=A4=E9=A1=A2</spa= n></font></p><p style=3D"margin-right:0pt;margin-bottom:12pt;margin-left:0p= t"> <font color=3D"navy" face=3D"MS Gothic"><span lang=3D"JA" style=3D"font-siz= e:10.5pt"><br></span></font></p><p style=3D"margin-right:0pt;margin-bottom:= 12pt;margin-left:0pt"><font color=3D"navy" face=3D"MS Gothic"><span lang=3D= "JA" style=3D"font-size:10.5pt">xxend</span></font></p>

    Read the article

  • Detecting scroll in Jquery Mobile

    - by noway
    I can't detect whether the page is scrolled or not with jquery mobile. Scrolltop always return 0 in any case. <script> var interval = setInterval(function() { alert($("#articlecontent").scrollTop()); //alert($(window).scrollTop()); //alert($("#maindiv").scrollTop()); } }, 3000); </script> <div data-role="page" id="maindiv"> <div class="ui-bar ui-bar-b"> </div> <div id='articlecontent' data-role="content" data-iscroll> sldfjlkjsl lksjd kls df hjks djkh sdjfkh sjkf jksd jkhsdf jkhsd hjwiuhhfg skd jkshd fkj fkjsg kjhsdkjf sldfjlkjsl lksjd kls df hjks djkh sdjfkh sjkf jksd jkhsdf jkhsd hjwiuhhfg skd jkshd fkj fkjsg kjhsdkjf sldfjlkjsl lksjd kls df hjks djkh sdjfkh sjkf jksd jkhsdf jkhsd hjwiuhhfg skd jkshd fkj fkjsg kjhsdkjf </div> <div data-role="footer" data-id="foo1"> </div> </div>

    Read the article

  • Are volatile data members trivially copyable?

    - by Lightness Races in Orbit
    Whilst writing this answer I realised that I'm not as confident about my conclusions as I usually would ensure before hitting Post Your Answer. I can find a couple of reasonably convincing citations for the argument that the trivial-copyability of volatile data members is either implementation defined or flat-out false: https://groups.google.com/forum/?fromgroups=#!topic/comp.std.c++/5cWxmw71ktI http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48118 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3159.html#496 But I haven't been able to back this up in the standard1 itself. Particularly "worrying" is that there's no sign of the proposed wording change from that n3159 issues list in the actual standard's final wording. So, what gives? Are volatile data members trivially copyable, or not? 1   C++11

    Read the article

  • JQuery Toggle which disables other links

    - by Matt Jameson
    Is there a way of disabling another link, the re-enabling them with the toggle function. here is my script so far. I would like to disable 'military' when I've clicked on 'Entertainment', but then re enable the link when the toggle returns. $("[href='#Entertainment']").click(function () { $("#Entertainment").toggle("slow"); }); $("[href='#Military']").click(function () { $("#Military").toggle("slow"); }); Is there anyway of doing this?

    Read the article

  • why does this boost::spirit::qi rule not work?

    - by Tobias Langner
    I have a grammar that defines the following rules: constantValue = qi::token(ID_FLOAT) | qi::token(ID_INTEGER); postfixExpression = primaryExpression | (postfixExpression >> qi::token(ID_OPENBRACKET) >> qi::token(ID_INTEGER) >> qi::token(ID_CLOSEBRACKET)) | (postfixExpression >> qi::token(ID_DOT) >> qi::token(ID_IDENTIFIER)); primaryExpression = qi::token(ID_IDENTIFIER) | constantValue | (qi::token(ID_OPENPAREN) >> primaryExpression >> qi::token(ID_CLOSEPAREN)); ges = postfixExpression >> qi::eoi; and I want it to match the following strings: test[1] testident.ident and it should not match test[1.2] testident.5 but it fails to match the first 2 strings. The lexer constructor is as follows: custom_lexer() : identifier("[a-zA-Z_][a-zA-Z0-9_]*") , white_space("[ \\t\\n]+") , integer_value("[1-9][0-9]*") , hex_value("0[xX][0-9a-fA-F]+") , float_value("[0-9]*\\.[0-9]+([eE][+-]?[0-9]+)?") , float_value2("[0-9]+\\.([eE][+-]?[0-9]+)?") , punctuator("&>|\\*\\*|\\*|\\+|-|~|!|\\/|%|<<|>>|<|>|<=|>=|==|!=|\\^|&|\\||\\^\\^|&&|\\|\\||\\?|:|,")// [ ] ( ) . &> ** * + - ~ ! / % << >> < > <= >= == != ^ & | ^^ && || ? : , { using boost::spirit::lex::_start; using boost::spirit::lex::_end; this->self.add (identifier, ID_IDENTIFIER) /*(white_space, ID_WHITESPACE)*/ (integer_value, ID_INTEGER) (hex_value, ID_INTEGER) (float_value, ID_FLOAT) (float_value2, ID_FLOAT) ("\\(", ID_OPENPAREN) ("\\)", ID_CLOSEPAREN) ("\\[", ID_OPENBRACKET) ("\\]", ID_CLOSEBRACKET) ("\\.", ID_DOT) (punctuator, ID_PUNCTUATOR) ; this->self("WS") = white_space; } Why don't I get a match for the mentioned strings? Thank you Tobias

    Read the article

  • PHP Preg_replace after a specific amount of characters with a conditional

    - by Marc Ripley
    I've been working on this for a bit, but my regex is weak. I need to check to see if a number is a whole number (single digit) and append a ".001" to it if so. The problem is, it's in the middle of a line with values separated by commas. MATERIALS,1,1,9999;1 4PL1 PB_Mel,,1,6,0.173,0.173,0.375,0,0.375,0,0,0,0,2,0,1,1 Needs to be MATERIALS,1,1,9999;1 4PL1 PB_Mel,,1.001,6,0.173,0.173,0.375,0,0.375,0,0,0,0,2,0,1,1 The line must start with "MATERIALS". There are more than one MATERIALS lines. The value will always be after 5 commas. I was trying something like this to even replace the number, but I don't think the approach is quite right: $stripped = preg_replace('/(MATERIALS)(,.*?){4}(,\d+?),/', '\2,', $stripped); I tried going through a preg_match_all for if process, to at least get the conditional working, but I still have to replace the lines. for($i=0;$i<sizeof($materialsLines[0]);$i++) { $section = explode(",",$materialsLines[0][$i]); if (strlen($section[5]) == 1) { $section[5] .= ".001"; } $materialsLines[0][$i] = implode(",",$section); }

    Read the article

  • javascript filter nested object based on key value

    - by murray3
    I wish to filter a nested javascript object by the value of the "step" key: var data = { "name": "Root", "step": 1, "id": "0.0", "children": [ { "name": "first level child 1", "id": "0.1", "step":2, "children": [ { "name": "second level child 1", "id": "0.1.1", "step": 3, "children": [ { "name": "third level child 1", "id": "0.1.1.1", "step": 4, "children": []}, { "name": "third level child 2", "id": "0.1.1.2", "step": 5, "children": []} ]}, ]} ] }; var subdata = data.children.filter(function (d) { return (d.step <= 2)}); This just returns the unmodified nested object, even if I put value of filter to 1. does .filter work on nested objects or do I need to roll my own function here, advise and correct code appreciated. cjm

    Read the article

  • Removing "Using temporary; Using filesort" from this MySQL select+join+group by query

    - by claytontstanley
    I have the following query: select t.Chunk as LeftChunk, t.ChunkHash as LeftChunkHash, q.Chunk as RightChunk, q.ChunkHash as RightChunkHash, count(t.ChunkHash) as ChunkCount from chunksubset as t join chunksubset as q on t.ID = q.ID group by LeftChunkHash, RightChunkHash And the following explain table: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE subsets ref PRIMARY,IDIndex,SubsetIndex SubsetIndex 767 const 522014 "Using where; Using temporary; Using filesort" 1 SIMPLE subsets eq_ref PRIMARY,IDIndex,SubsetIndex PRIMARY 771 sotero.subsets.Id,const 1 "Using where; Using index" 1 SIMPLE c ref IDIndex IDIndex 4 sotero.subsets.Id 12 "Using where" 1 SIMPLE c ref IDIndex IDIndex 4 sotero.subsets.Id 12 note the "using temporary; using filesort". When this query is run, I quickly run out of RAM (presumably b/c of the temp table), and then the HDD kicks in, and the query slows to a halt. I thought it might be an index issue, so I started adding a few that sort of made sense: Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment chunks 0 PRIMARY 1 ChunkId A 17796190 NULL NULL BTREE chunks 1 ChunkHashIndex 1 ChunkHash A 243783 NULL NULL BTREE chunks 1 IDIndex 1 Id A 1483015 NULL NULL BTREE chunks 1 ChunkIndex 1 Chunk A 243783 NULL NULL BTREE chunks 1 ChunkTypeIndex 1 ChunkType A 2 NULL NULL BTREE chunks 1 chunkHashByChunkIDIndex 1 ChunkHash A 243783 NULL NULL BTREE chunks 1 chunkHashByChunkIDIndex 2 ChunkId A 17796190 NULL NULL BTREE chunks 1 chunkHashByChunkTypeIndex 1 ChunkHash A 243783 NULL NULL BTREE chunks 1 chunkHashByChunkTypeIndex 2 ChunkType A 261708 NULL NULL BTREE chunks 1 chunkHashByIDIndex 1 ChunkHash A 243783 NULL NULL BTREE chunks 1 chunkHashByIDIndex 2 Id A 17796190 NULL NULL BTREE But still using the temporary table. The db engine is MyISAM. How can I get rid of the using temporary; using filesort in this query? Just changing to InnoDB w/o explaining the underlying cause is not a particularly satisfying answer. Besides, if the solution is to just add the proper index, then that's much easier than migrating to another db engine.

    Read the article

  • Is there anyway to carry a value in php forward to a second page?

    - by Henry Aspden
    I have created a php site, and previously it was listing only products with defined values. I have now changed it to include an array of products for example all products WHERE id = "spotlights" and this works great so it means I can add new products just to the database, but I still have to add the second page manually. e.g going from the product div on the main page, through to www.example.com/spotlight_1.php Is there anyway in PHP to carry the data from my index.php e.g. the ID through to the next page? so that I can have a template product.php page, and I can use a database pull to echo the product information required. So on index.php i click on the product with ID="1" and on the product.php page, it loads the relevant data for product 1. I can write the php SQL/mySQL calls myself, its just the way to carry accross a value from the previous page which I dont understand Regards Henry p.s. all the IDs and things are stored in the database already as 1 to 3digit values e.g. 3 or or 93 or 254 Any advice as always is greatly appreciated Regards Henry

    Read the article

  • Why can I not deploy my ear on Glassfish

    - by hexin
    I have standard maven project in netbeans (netbeans' enterprise application), that have 1 war, 1 ejb and 1 ear modules. I want to inject with @Inject my @Stateless from ejb to war (REST class) using its interface. I have added some beans.xml files in correct folders in project, but im still getting this: Error occurred during deployment: Exception while loading the app : WELD-001409 Ambiguous dependencies for type [LogicBean] with qualifiers [@Default] at injection point [[field] @Inject private pl.edu.amu.wmi.kino.rk.rest.ReportRest.bean]. Possible dependencies [[Session bean [class pl.edu.amu.wmi.kino.rk.data.impl.LogicBeanImpl with qualifiers [@Any @Default]; local interfaces are [LogicBean], Session bean [class pl.edu.amu.wmi.kino.rk.data.impl.LogicBeanImpl with qualifiers [@Any @Default]; local interfaces are [LogicBean]]]. Please see server.log for more details. What am i doing wrong? I have searched the whole internet, but could not find the solution. I know it is possible because i worked on a project with such a staff. THX for any help:)

    Read the article

  • Using JS script for "raining images". Can't seem to hide pre-loaded image

    - by user1813605
    I am trying to hide an image in a script pre-loading on the page. Below script makes images "rain" down the screen onClick. It functions well, but it displays the pre-loaded image itself on the page before the button is clicked. I'm trying to hide the image until the button is pressed. If anyone has any insight on how to hide the image until the function dispenseMittens() runs, I'd be eternally grateful :) Thanks! <script language="javascript"> var pictureSrc = 'mitten.gif'; //the location of the mittens var pictureWidth = 40; //the width of the mittens var pictureHeight = 46; //the height of the mittens var numFlakes = 10; //the number of mittens var downSpeed = 0.01; var lrFlakes = 10; var EmergencyMittens = false; //safety checks. Browsers will hang if this is wrong. If other values are wrong there will just be errors if( typeof( numFlakes ) != 'number' || Math.round( numFlakes ) != numFlakes || numFlakes < 1 ) { numFlakes = 10; } //draw the snowflakes for( var x = 0; x < numFlakes; x++ ) { if( document.layers ) { //releave NS4 bug document.write('<layer id="snFlkDiv'+x+'"><img src="'+pictureSrc+'" height="'+pictureHeight+'" width="'+pictureWidth+'" alt="*" border="0"></layer>'); } else { document.write('<div style="position:absolute;" id="snFlkDiv'+x+'"><img src="'+pictureSrc+'" height="'+pictureHeight+'" width="'+pictureWidth+'" alt="*" border="0"></div>'); } } //calculate initial positions (in portions of browser window size) var xcoords = new Array(), ycoords = new Array(), snFlkTemp; for( var x = 0; x < numFlakes; x++ ) { xcoords[x] = ( x + 1 ) / ( numFlakes + 1 ); do { snFlkTemp = Math.round( ( numFlakes - 1 ) * Math.random() ); } while( typeof( ycoords[snFlkTemp] ) == 'number' ); ycoords[snFlkTemp] = x / numFlakes; } //now animate function mittensFall() { if( !getRefToDivNest('snFlkDiv0') ) { return; } var scrWidth = 0, scrHeight = 0, scrollHeight = 0, scrollWidth = 0; //find screen settings for all variations. doing this every time allows for resizing and scrolling if( typeof( window.innerWidth ) == 'number' ) { scrWidth = window.innerWidth; scrHeight = window.innerHeight; } else { if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { scrWidth = document.documentElement.clientWidth; scrHeight = document.documentElement.clientHeight; } else { if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { scrWidth = document.body.clientWidth; scrHeight = document.body.clientHeight; } } } if( typeof( window.pageYOffset ) == 'number' ) { scrollHeight = pageYOffset; scrollWidth = pageXOffset; } else { if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { scrollHeight = document.body.scrollTop; scrollWidth = document.body.scrollLeft; } else { if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { scrollHeight = document.documentElement.scrollTop; scrollWidth = document.documentElement.scrollLeft; } } } //move the snowflakes to their new position for( var x = 0; x < numFlakes; x++ ) { if( ycoords[x] * scrHeight > scrHeight - pictureHeight ) { ycoords[x] = 0; } var divRef = getRefToDivNest('snFlkDiv'+x); if( !divRef ) { return; } if( divRef.style ) { divRef = divRef.style; } var oPix = document.childNodes ? 'px' : 0; divRef.top = ( Math.round( ycoords[x] * scrHeight ) + scrollHeight ) + oPix; divRef.left = ( Math.round( ( ( xcoords[x] * scrWidth ) - ( pictureWidth / 2 ) ) + ( ( scrWidth / ( ( numFlakes + 1 ) * 4 ) ) * ( Math.sin( lrFlakes * ycoords[x] ) - Math.sin( 3 * lrFlakes * ycoords[x] ) ) ) ) + scrollWidth ) + oPix; ycoords[x] += downSpeed; } } //DHTML handlers function getRefToDivNest(divName) { if( document.layers ) { return document.layers[divName]; } //NS4 if( document[divName] ) { return document[divName]; } //NS4 also if( document.getElementById ) { return document.getElementById(divName); } //DOM (IE5+, NS6+, Mozilla0.9+, Opera) if( document.all ) { return document.all[divName]; } //Proprietary DOM - IE4 return false; } function dispenseMittens() { if (EmergencyMittens) { window.clearInterval(EmergencyMittens); } else { EmergencyMittens = window.setInterval('mittensFall();',100); } } </script>

    Read the article

  • Getting an Error Trying to Create an Object in Python

    - by Nick Rogers
    I am trying to create an object from a class in python but I am getting an Error, "e_tank = EnemyTank() TypeError: 'Group' object is not callable" I am not sure what this means, I have tried Google but I couldn't get a clear answer on what is causing this error. Does anyone understand why I am unable to create an object from my EnemyTank Class? Here is my code: #Image Variables bg = 'bg.jpg' bunk = 'bunker.png' enemytank = 'enemy-tank.png' #Import Pygame Modules import pygame, sys from pygame.locals import * #Initializing the Screen pygame.init() screen = pygame.display.set_mode((640,360), 0, 32) background = pygame.image.load(bg).convert() bunker_x, bunker_y = (160,0) class EnemyTank(pygame.sprite.Sprite): e_tank = pygame.image.load(enemytank).convert_alpha() def __init__(self, startpos): pygame.sprite.Sprite.__init__(self, self.groups) self.pos = startpos self.image = EnemyTank.image self.rect = self.image.get_rect() def update(self): self.rect.center = self.pos class Bunker(pygame.sprite.Sprite): bunker = pygame.image.load(bunk).convert_alpha() def __init__(self, startpos): pygame.spriter.Sprite.__init__(self, self.groups) self.pos = startpos self.image = Bunker.image self.rect = self.image.get_rect() def getCollisionObjects(self, EnemyTank): if (EnemyTank not in self._allgroup, False): return False self._allgroup.remove(EnemyTank) result = pygame.sprite.spritecollide(EnemyTank, self._allgroup, False) self._allgroup.add(EnemyTank) def update(self): self.rect.center = self.pos #Setting Up The Animation x = 0 clock = pygame.time.Clock() speed = 250 allgroup = pygame.sprite.Group() EnemyTank = allgroup Bunker = allgroup e_tank = EnemyTank() bunker = Bunker()5 #Main Loop while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() screen.blit(background, (0,0)) screen.blit(bunker, (bunker_x, bunker_y)) screen.blit(e_tank, (x, 0)) pygame.display.flip() #Animation milli = clock.tick() seconds = milli/1000. dm = seconds*speed x += dm if x>640: x=0 #Update the Screen pygame.display.update()

    Read the article

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