Search Results

Search found 33 results on 2 pages for 'lithium'.

Page 1/2 | 1 2  | Next Page >

  • Backbone Model fetched from Lithium controller is not loaded properly in bb Model

    - by Nilesh Kale
    I'm using backbone.js and Lithium. I'm fetching a model from the server by passing in a _id that is received as a hidden parameter on the page. The database MongoDB has stored the data correctly and can be viewed from console as: { "_id" : ObjectId("50bb82694fbe3de417000001"), "holiday_name" : "SHREE15", "description": "", "star_rating" : "3", "holiday_type" : "family", "rooms" : "1", "adults" : "2", "child" :"0", "emails" : "" } The Lithium Model class is so: class Holidays extends \lithium\data\Model { public $validates = array( 'holiday_name' => array( array( 'notEmpty', 'required' => true, 'message' => 'Please key-in a holiday name! (eg. Family trip for summer holidays)' ))); } The backbone Holiday model is so: window.app.IHoliday = Backbone.Model.extend({ urlRoot: HOLIDAY_URL, idAttribute: "_id", id: "_id", // Default attributes for the holiday. defaults: { }, // Ensure that each todo created has `title`. initialize: function(props) { }, The code for backbone/fetch is: var Holiday = new window.app.IHoliday({ _id: holiday_id }); Holiday.fetch( { success: function(){ alert('Holiday fetched:' + JSON.stringify(Holiday)); console.log('HOLIDAY Fetched: \n' + JSON.stringify(Holiday)); console.log('Holiday name:' + Holiday.get('holiday_name')); } } ); Lithium Controller Code is: public function load($holiday_id) { $Holiday = Holidays::find($holiday_id); return compact('Holiday'); } PROBLEM: The output of the backbone model fetched from server is as below and the Holiday model is not correctly 'formed' when data returns into backbone Model: HOLIDAY Fetched: {"_id":"50bb82694fbe3de417000001","Holiday":{"_id":"50bb82694fbe3de417000001","holiday_name":"SHREE15","description":"","star_rating":"3","holiday_type":"family","rooms":"1","adults":"2","child":"0","emails":""}} iplann...view.js (line 68) Holiday name:undefined Clearly there is some issue when the data is passed/translated from Lithium and loaded up as a model into backbone Holiday model. Is there something very obviously wrong in my code?

    Read the article

  • Lithium: Run filter after find() to format output

    - by Housni
    I wanted to specify the output of a field from within my model so I added a date key to my $_schema: models/Tags.php <?php protected $_schema = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string'), 'created' => array('type' => 'integer', 'date' => 'F jS, Y - g:i a'), 'modified' => array('type' => 'integer') ); ?> I store my time as an unsigned integer in the db (output of time()). I want my base model to format any field that has the date key for output. I thought the best place to do that would be right after a find: extensions/data/Model.php <?php static::applyFilter('find', function($self, $params, $chain) { $schema = $self::schema(); $entity = $chain->next($self, $params, $chain); foreach ($schema as $field => $options) { if (array_key_exists('date', $options)) { //format as a date $params['data'][$field] = $entity->formatDate($field, $options['date']); } } return $entity; }); public function formatdate($entity, $field, $format, $timezone = 'Asia/Colombo') { $dt = new \DateTime(); $tz = new \DateTimeZone($timezone); $dt->setTimestamp($entity->$field); $dt->setTimezone($tz); return $dt->format($format); } ?> This doesn't seem to be working. When I execute a find all, this filter seems to get hit twice. The first time, $entity contains a count() of the results and only on the second hit does it contain the Records object. What am I doing wrong? How do I alter this so that simply doing <?= $tag->created; ?> in my view will format the date the way I want? This, essentially, needs to be an 'after filter', of sorts. EDIT If I can find a way to access the current model entity object (not the full namespaced path, $self contains that), I can probably solve my problem.

    Read the article

  • How long do Lithium Ion batteries normally last?

    - by Zifre
    On the laptop I have, I've had to buy a new Li-Ion batter roughly every year. I do use this computer quite a lot, but I'm wondering if this is normal. Right now, my battery is completely dead (it lasts for about 0.1 seconds), so I plan on buying a new one soon. Is there anything you can do to prevent Li-Ion batteries from going dead so quickly?

    Read the article

  • What are good hosting companies for PHP 5.3 Mysql / CouchDb / MongoDB Dev ( Lithium / CakePHP Framew

    - by Abba Bryant
    I am looking for a quality reliable host for some lithium development. I don't mind a shared platform as long as I have some ssh access. I require php 5.3.x, Mysql 5.x, and the usual imageMagick etc. Non-relational DB support up front would be nice but if they let me set one up myself I would be okay with doing it. I don't need a lot in the way of control panel tools. Good ones are appreciated but bad ones I would prefer not to even deal with. I don't anticipate needing much in the way of email but mail support would be nice to have. Cost isn't a big issue. I don't want to pay an arm and a leg but don't mind paying for what I need. Good support and decent uptime would be nice but I don't need an SLO or anything.

    Read the article

  • Git submodules not updating?

    - by DavidYell
    I have a project in which I've included some libraries as submodules. They work fine on the machine that you add them on, but when I get home and checkout the repo, I get the folders for the submodules but they are empty. .gitmodules Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium $ cat .gitmodules [submodule "libraries/lithium"] path = libraries/lithium url = git://github.com/UnionOfRAD/lithium.git [submodule "app/webroot/css/elements"] path = app/webroot/css/elements url = https://github.com/dmitryf/elements.git [submodule "app/libraries/li3_markdown"] path = app/libraries/li3_markdown url = https://github.com/sandelius/li3_markdown.git [submodule "app/webroot/markitup"] path = app/webroot/markitup url = https://github.com/markitup/1.x.git Config and status commands Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium $ git submodule -af14f48b419310935446176290e1f9dc641400e0 app/libraries/li3_markdown -ebdcd8ca09c874f5e2ef81ec198cc441f37a4f74 app/webroot/css/elements -328291e49a3c7e1fb76b3342f112734864836205 app/webroot/markitup -4980010526d05c556c496ff63951da31828c5943 libraries/lithium Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium $ git submodule update Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium $ git submodule status -af14f48b419310935446176290e1f9dc641400e0 app/libraries/li3_markdown -ebdcd8ca09c874f5e2ef81ec198cc441f37a4f74 app/webroot/css/elements -328291e49a3c7e1fb76b3342f112734864836205 app/webroot/markitup -4980010526d05c556c496ff63951da31828c5943 libraries/lithium I added these as you would normally with, git submodule add <repo> <path> git submodule init The submodules are hosted on Github and my repo is hosted on Bitbucket, although I'm not sure if this is relevant.

    Read the article

  • Laptop battery liftime from Dell specs?

    - by user26535
    Question: When I buy a Dell Laptop, I get the following choice for battery: (Lithium-Ion main battery with X cells and Y Wh [included in price/at additional $] Lithium-Ionen-Hauptakku mit 4 Zellen und 24 Wh [Im Preis enthalten] Lithium-Ionen-Hauptakku mit 9 Zellen und 85 Wh [zuzgl. CHF 120.01] Lithium-Ionen-Hauptakku mit 6 Zellen und 46 Wh [zuzgl. CHF 30.00 I figured that I can calculate that a 86 Wh offers +254% of the 24 Wh lifetime, but... Is there any way to calculate to what battery time this amounts in hours ? I mean how many hours will the 24 Wh last (at normal operation - eg. writing a document - not watching video), else the +254% is a pretty useless number... Also anybody knows whether 4 cells means 4 times 24 Wh, or 24 Wh in total?

    Read the article

  • Battery life starts at 2:30 hrs (99%), but less than 1 minute later is only 1:30 hrs (99%)

    - by zondu
    After searching this and other forums, I haven't seen this same issue listed anywhere for Ubuntu 12. Prior to installing Ubuntu 12.10, my Netbook (Acer AspireOne D250, SATA HDD) was consistently getting 2:30-3 hrs battery life under Windows XP Home, SP3. However, immediately after installing Ubuntu 12.10, the battery life starts out at 2:30 hrs (99%), but less than 1 minute later suddenly drops to 1:30 hrs (99%), which seems very odd. It could be a complete coincidence that the battery is suddenly flaky at the exact same moment that Ubuntu 12.10 was installed, but that doesn't seem likely. I'm a newbie to Ubuntu, so I don't have much experience tweaking/trouble-shooting yet. Here's what I've tried so far: enabled laptop mode (sudo su, then echo 5 /proc/sys/vm/laptop_mode) and checked that it is running when the A/C adapter is unplugged, but it doesn't seem to have made any noticeable difference in battery life, installed Jupiter, but it didn't work and messed up the system, so I had to uninstall it, disabled bluetooth (wifi is still on b/c it is necessary), set the screen to lowest brightness, etc., run through at least 1 full power cycle (running until the netbook shut itself off due to critical battery) and have been using it normally (sometimes plugged in, often unplugged until the battery gets very low) for a week since installing Ubuntu 12.10. installed powertop, but have no idea how to interpret its results. Here are the results of acpi -b: w/ A/C adapter: Battery 0: Full, 100% immediately after unplugging: Battery 0: Discharging, 99%, 02:30:20 remaining 1 minute after unplugging: Battery 0: Discharging, 99%, 01:37:49 remaining 2-3 minutes after unplugging: Battery 0: Discharging, 95%, 01:33:01 remaining 10 minutes after unplugging: Battery 0: Discharging, 85%, 01:13:38 remaining Results of cat /sys/class/power_supply/BAT0/uevent: w/ A/C adapter: POWER_SUPPLY_NAME=BAT0 POWER_SUPPLY_STATUS=Full POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_CYCLE_COUNT=0 POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 POWER_SUPPLY_VOLTAGE_NOW=12136000 POWER_SUPPLY_CURRENT_NOW=773000 POWER_SUPPLY_CHARGE_FULL_DESIGN=4500000 POWER_SUPPLY_CHARGE_FULL=1956000 POWER_SUPPLY_CHARGE_NOW=1956000 POWER_SUPPLY_MODEL_NAME=UM08B32 POWER_SUPPLY_MANUFACTURER=SANYO POWER_SUPPLY_SERIAL_NUMBER= immediately after unplugging: POWER_SUPPLY_NAME=BAT0 POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_CYCLE_COUNT=0 POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 POWER_SUPPLY_VOLTAGE_NOW=11886000 POWER_SUPPLY_CURRENT_NOW=773000 POWER_SUPPLY_CHARGE_FULL_DESIGN=4500000 POWER_SUPPLY_CHARGE_FULL=1956000 POWER_SUPPLY_CHARGE_NOW=1937000 POWER_SUPPLY_MODEL_NAME=UM08B32 POWER_SUPPLY_MANUFACTURER=SANYO POWER_SUPPLY_SERIAL_NUMBER= 1 minute later: POWER_SUPPLY_NAME=BAT0 POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_CYCLE_COUNT=0 POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 POWER_SUPPLY_VOLTAGE_NOW=11728000 POWER_SUPPLY_CURRENT_NOW=1174000 POWER_SUPPLY_CHARGE_FULL_DESIGN=4500000 POWER_SUPPLY_CHARGE_FULL=1956000 POWER_SUPPLY_CHARGE_NOW=1937000 POWER_SUPPLY_MODEL_NAME=UM08B32 POWER_SUPPLY_MANUFACTURER=SANYO POWER_SUPPLY_SERIAL_NUMBER= 2-3 minutes later: POWER_SUPPLY_NAME=BAT0 POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_CYCLE_COUNT=0 POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 POWER_SUPPLY_VOLTAGE_NOW=11583000 POWER_SUPPLY_CURRENT_NOW=1209000 POWER_SUPPLY_CHARGE_FULL_DESIGN=4500000 POWER_SUPPLY_CHARGE_FULL=1956000 POWER_SUPPLY_CHARGE_NOW=1878000 POWER_SUPPLY_MODEL_NAME=UM08B32 POWER_SUPPLY_MANUFACTURER=SANYO POWER_SUPPLY_SERIAL_NUMBER= 10 minutes later: POWER_SUPPLY_NAME=BAT0 POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_CYCLE_COUNT=0 POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 POWER_SUPPLY_VOLTAGE_NOW=11230000 POWER_SUPPLY_CURRENT_NOW=1239000 POWER_SUPPLY_CHARGE_FULL_DESIGN=4500000 POWER_SUPPLY_CHARGE_FULL=1956000 POWER_SUPPLY_CHARGE_NOW=1644000 POWER_SUPPLY_MODEL_NAME=UM08B32 POWER_SUPPLY_MANUFACTURER=SANYO POWER_SUPPLY_SERIAL_NUMBER= Results of upower -i /org/freedesktop/UPower/devices/battery_BAT0: w/ A/C adapter: native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C0A:00/power_supply/BAT0 vendor: SANYO model: UM08B32 power supply: yes updated: Tue Nov 27 15:24:58 2012 (823 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged energy: 21.1248 Wh energy-empty: 0 Wh energy-full: 21.1248 Wh energy-full-design: 48.6 Wh energy-rate: 8.3484 W voltage: 12.173 V percentage: 100% capacity: 43.4667% technology: lithium-ion immediately after unplugging: native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C0A:00/power_supply/BAT0 vendor: SANYO model: UM08B32 power supply: yes updated: Tue Nov 27 15:41:25 2012 (1 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: discharging energy: 20.9196 Wh energy-empty: 0 Wh energy-full: 21.1248 Wh energy-full-design: 48.6 Wh energy-rate: 8.3484 W voltage: 11.86 V time to empty: 2.5 hours percentage: 99.0286% capacity: 43.4667% technology: lithium-ion History (charge): 1354023683 99.029 discharging 1 minute later: native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C0A:00/power_supply/BAT0 vendor: SANYO model: UM08B32 power supply: yes updated: Tue Nov 27 15:42:31 2012 (17 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: discharging energy: 20.9196 Wh energy-empty: 0 Wh energy-full: 21.1248 Wh energy-full-design: 48.6 Wh energy-rate: 13.5432 W voltage: 11.753 V time to empty: 1.5 hours percentage: 99.0286% capacity: 43.4667% technology: lithium-ion History (charge): 1354023683 99.029 discharging History (rate): 1354023751 13.543 discharging 2-3 minutes later: native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C0A:00/power_supply/BAT0 vendor: SANYO model: UM08B32 power supply: yes updated: Tue Nov 27 15:45:06 2012 (20 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: discharging energy: 20.2824 Wh energy-empty: 0 Wh energy-full: 21.1248 Wh energy-full-design: 48.6 Wh energy-rate: 13.7484 W voltage: 11.545 V time to empty: 1.5 hours percentage: 96.0123% capacity: 43.4667% technology: lithium-ion History (charge): 1354023906 96.012 discharging 1354023844 97.035 discharging History (rate): 1354023906 13.748 discharging 1354023875 12.992 discharging 1354023844 13.284 discharging 10 minutes later: native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C0A:00/power_supply/BAT0 vendor: SANYO model: UM08B32 power supply: yes updated: Tue Nov 27 15:54:24 2012 (28 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: discharging energy: 18.1764 Wh energy-empty: 0 Wh energy-full: 21.1248 Wh energy-full-design: 48.6 Wh energy-rate: 13.2948 W voltage: 11.268 V time to empty: 1.4 hours percentage: 86.0429% capacity: 43.4667% technology: lithium-ion History (charge): 1354024433 86.043 discharging History (rate): 1354024464 13.295 discharging 1354024433 13.662 discharging 1354024402 13.781 discharging I noticed that between #2 and #3 (0 and 1 minutes after unplugging), while the battery still reports 99% charge and drops from 2:30 hr to 1:30 hr, the energy usage goes from 8.34 W to 13.54 W and the current_now increases, but shouldn't it be using less energy in battery mode since the screen is much dimmer and it's in power saving mode? (or is that normal behavior?) It also seems to drain more quickly than what it predicts, especially with the 1-1.25 hour drop in the first minute of being unplugged, which seems odd. What really concerns me is that Ubuntu 12.10 may not be properly managing the battery (with the sudden change in charge/life from 2:30 to 1:30 or 1:15 within a minute of unplugging), and that a new battery may quickly die under Ubuntu 12.10. I'd greatly appreciate any advice/suggestions on what to do, and especially whether there's a way to get back the 1-1.5 hrs of battery life that were suddenly lost when changing from WinXp to Ubuntu 12.10. Thanks :)

    Read the article

  • Phantom activity on MySQL

    - by LoveMeSomeCode
    This is probably just my total lack of MySQL expertise, but is it typical to see lots of phantom activity on a MySQL instance via phpMyAdmin? I have a shared hosting plan through Lithium, and when I log in through the phpMyAdmin console and click on the 'Status' tab, it's showing crazy high numbers for queries. Within an hour of activating my account I had 1 million queries. At first I thought this was them setting things up, but the number is climbing constantly, averaging 170/second. I've got a support ticket in with Lithium, but I thought I'd ask here if this were a MySQL/shared host thing, because I had the same thing happen with a shared hosting plan through Joyent.

    Read the article

  • Postgres update rule returning number of rows affected

    - by Lithium
    I have a view table which is a union of two seperate tables (say Table _A and Table _B). I need to be able to update a row in the view table, and it seems the way to do this was through a 'view rule'. All entries in the view table have seperate id's, so an id that exists in table _A won't exist in table _B. I created the following rule: CREATE OR REPLACE RULE view_update AS ON UPDATE TO viewtable DO INSTEAD ( UPDATE _A SET foo = false WHERE old.id = _A.id; UPDATE _B SET foo = false WHERE old.id = _B.id; ); If I do an update on table _B it returns the correct number of rows affected (1). However if I update table _A it returns (0) rows affected even though the data was changed. If I swap out the order of the updates then the same thing happens, but in reverse. How can I solve this problem so that it returns the correct number of rows affected. Thanks.

    Read the article

  • Remove Custom UINavigationBar

    - by Lithium
    Hi, I've customized my UINavigationBar with an image like that : @implementation UINavigationBar (CustomImage) - (void)drawRect:(CGRect)rect { UIImage *image = [UIImage imageNamed: @"NavigationBar.png"]; [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; } @end When I launch a video my custom NavigationBar (with the picture) is on the top or I would like to have the default navigationBar style when I'm playing a video. I tried to hide the navigationBar with [self.navigationController setNavigationBarHidden:YES animated:animated]; but it just remove the navigationBar in my controller but I still have the NavigationBar.png when I'm playing a video. I tried to set the barstyle but it doesn't work either ... self.navigationController.navigationBar.barStyle = UIBarStyleDefault; Could you help me ?

    Read the article

  • Phantom activity on MySQL

    - by LoveMeSomeCode
    This is probably just my total lack of MySQL expertise, but is it typical to see lots of phantom activity on a MySQL instance via phpMyAdmin? I have a shared hosting plan through Lithium, and when I log in through the phpMyAdmin console and click on the 'Status' tab, it's showing crazy high numbers for queries. Within an hour of activating my account I had 1 million queries. At first I thought this was them setting things up, but the number is climbing constantly, averaging 170/second. I've got a support ticket in with Lithium, but I thought I'd ask here if this were a MySQL/shared host thing, because I had the same thing happen with a shared hosting plan through Joyent.

    Read the article

  • Detection of battery status totally messed up

    - by Faabiioo
    I already posted this question in the Ubuntu forum and stackOverflow. I forward it here with the hope to find some different opinions about the problem. I have an Acer TravelMate 5730, which is 3 y.o., running Ubuntu 10.04 LTS. One year ago I changed the battery because the old one died. Since then, everything worked like a charm. A week ago I was using my laptop running on battery; it was charged up to 60%. Suddenly it shut down and for about 24h it was like the battery was totally broken: it didn't charge anymore and the 'upower --dump' said state: critical. I was kind of resigned to buy a new battery, when suddenly the orange light became green: battery was charged and actually working; strangely the battery indicator was stuck to 100%, even after 2 hours running. I tried again with 'upower --dump' or 'acpi -b' commands and it kept saying battery is discharging, though maintaining the percentage to 100%. Thus, battery working fine up to 3 hours, without any warning when it was almost empty, likely to result in a brute shut down. Today something different. the 'upower --dump' command says: ... present: yes rechargeable: yes state: fully-charged energy: 0 Wh energy-empty: 0 Wh energy-full: 65.12 Wh energy-full-design: 65.12 Wh energy-rate: 0 W voltage: 14.481 V percentage: 0% capacity: 100% technology: lithium-ion I tried to boot WinXP and the problem is pretty much the same, with the battery fully-charged, percentage equal to 0% and no way to fix it. While writing, the situation has changed again: present: yes rechargeable: yes state: charging energy: 0 Wh energy-empty: 0 Wh energy-full: 65.12 Wh energy-full-design: 65.12 Wh energy-rate: 0 W voltage: 14.474 V percentage: 0% capacity: 100% technology: lithium-ion ...charging, but it does not charge up. (Recall, the battery lasted 3 hours until yesterday!). So, the big question is: is it an hardware issue, like a dedicated internal circuit is broken? or maybe it is just the battery that must be changed. Or, rather, some BIOS problem that could be fixed in some way. I'd appreciate every help that can shed some light on this annoying problem thanks

    Read the article

  • Any PHP MVC framework planning to use 5.3 features?

    - by alexandrul
    I would like to get started with PHP, and 5.3 release seems to bring many nice features (namespaces, lambda functions, and many others). I have found some MVC frameworks, and some of them support only PHP 5: PHP Frameworks PHP MVC Frameworks Model–view–controller on Wikipedia but can anyone recommend one of those MVC frameworks that plans to actively use PHP 5.3 features, not just being compatible with PHP 5.3? Update Results so far: Zend Framework 2.0 (in development) Lithium (in development, based on CakePHP) Symfony (in development) FLOW3 (in development, alpha)

    Read the article

  • S3200SH error 5220 every boot (CMOS/NVRAM Cleared by jumper)

    - by TechAUmNu
    I have a S3200SH Intel server board with a Intel Xeon 3220 Quad Core. Every time I boot it, I get error 5220 (CMOS/NVRAM Cleared by jumper). The jumper is not installed and I have replaced the lithium battery. The board overheated once, although still seems to work fine apart from this error. Also if I leave the board sitting in the bios for a while it sometimes randomly turns off, with all 4 diagnostic LED's red. I have moved the 2GB DIMM to another slot, which seems to have fixed this problem. Any ideas would be greatly appreciated.

    Read the article

  • Help on Removal of Dynamically Created sprites.

    - by Brrr Ice Tea
    import flash.display.Sprite; import flash.net.URLLoader; var index:int = 0; var constY = 291; var constW = 2; var constH = 40; hydrogenBtn.label = "Hydrogen"; heliumBtn.label = "Helium"; lithiumBtn.label = "Lithium"; hydrogenBtn.addEventListener (MouseEvent.CLICK, loadHydrogen); heliumBtn.addEventListener (MouseEvent.CLICK, loadHelium); lithiumBtn.addEventListener (MouseEvent.CLICK, loadLithium); var myTextLoader:URLLoader = new URLLoader(); myTextLoader.addEventListener(Event.COMPLETE, onLoaded); function loadHydrogen (event:Event):void { myTextLoader.load(new URLRequest("hydrogen.txt")); } function loadHelium (event:Event):void { myTextLoader.load(new URLRequest("helium.txt")); } function loadLithium (event:Event):void { myTextLoader.load(new URLRequest("lithium.txt")); } var DataSet:Array = new Array(); var valueRead1:String; var valueRead2:String; function onLoaded(event:Event):void { var rawData:String = event.target.data; for(var i:int = 0; i<rawData.length; i++){ var commaIndex = rawData.search(","); valueRead1 = rawData.substr(0,commaIndex); rawData = rawData.substr(commaIndex+1, rawData.length+1); DataSet.push(valueRead1); commaIndex = rawData.search(","); if(commaIndex == -1) {commaIndex = rawData.length+1;} valueRead2 = rawData.substr(0,commaIndex); rawData = rawData.substr(commaIndex+1, rawData.length+1); DataSet.push(valueRead2); } generateMask_Emission(DataSet); } function generateMask_Emission(dataArray:Array):void{ var spriteName:String = "Mask"+index; trace(spriteName); this[spriteName] = new Sprite(); for (var i:int=0; i<dataArray.length; i+=2){ this[spriteName].graphics.beginFill(0x000000, dataArray[i+1]); this[spriteName].graphics.drawRect(dataArray[i],constY,constW, constH); this[spriteName].graphics.endFill(); } addChild(this[spriteName]); index++; } Hi, I am relatively new to flash and action script as well and I am having a problem getting the sprite to be removed after another is called. I am making emission spectrum's of 3 elements by dynamically generating the mask over a picture on the stage. Everything works perfectly fine with the code I have right now except the sprites stack on top of each other and I end up with bold lines all over my picture instead of a new set of lines each time i press a button. I have tried using try/catch to remove the sprites and I have also rearranged the entire code from what is seen here to make 3 seperate entities (hoping I could remove them if they were seperate variables) instead of 2 functions that handle the whole process. I have tried everything to the extent of my knowledge (which is pretty minimal @ this point) any suggestions? Thanks ahead of time!

    Read the article

  • What is a good php 5.3.x shared hosting company?

    - by Abba Bryant
    I am looking for the best shared host - features-wise, not price - for hosting CakePHP and Lithium applications. I would like to be able to use MongoDB / MySQL as well as have access to some of the more common PHP extensions like MCrypt, etc. I currently use dreamhost with a custom PHP 5.3.x build on my sandbox domain - Please do not suggest this as a solution. I want to move away from managing my own PHP build if possible. I need ssh access but email support isn't as big of an issue.

    Read the article

  • Gateway ZA8 Netbook graphics Issue

    - by Hansel
    The graphics keep tearing and are barely usable anytime I try to use my Netbook. And I did a full install with Ubuntu so I'm pretty much stuck. These are the specs of the Netbook: Processor AMD Athlon™ 64 L110 Single-Core Processor (1.2GHz, 800MHz FSB, 512KB L2 Cache)6 Operating System Genuine Windows Vista® Home Basic (32-bit) with SP1 Display 11.6" HD WXGA Ultrabright™ LED-backlit Display (1366 x 768 resolution, 16:9 aspect ratio)7 Memory 2048MB DDR2 533MHz SDRAM Single Channel Memory8 Hard Drive 250GB SATA hard drive2 Color Classic and Elegant Design with Cherry Red finish Wireless Network 802.11b/g Wi-Fi CERTIFIED®3 Adapter AC Adapter Application Software Microsoft® Works, Microsoft® Money Essentials, Microsoft® Office Home and Student 2007 (60-day complimentary trial period)1 Battery 6-Cell Lithium Ion (5200mAh) Chassis Chassis with ATI Radeon® X1270 Graphics and AMD RS690E Chipset8 Dimensions (Box) 3.1" (H) x 14.8" (W) x 10.1" (D) or 80mm (H) x 376mm (W) x 256mm (D) Dimensions (System) 1.03" (H) x 11.26" (W) x 7.99" (D) or 26.4mm (H) x 286mm (W) x 203mm (D) External Ports (3) USB 2.0, VGA Connector Keyboard and Mouse Keyboard with Multi-Gesture Touchpad Media Card Reader Multi-in-1 Digital Media Card Reader (Memory Stick®, Memory Stick Pro™, MultiMediaCard, Secure Digital™, xD-Picture Card™) Network 10/100 Ethernet LAN (RJ-45 port) What can I do?

    Read the article

  • Laptop drains of quickly with battery

    - by Shyam
    I am a user since years in ubuntu and I have not come across this problem with ubuntu till date. My battery drains off immediately after I unplug my AC power. The options I tried: 1) checked the battery state with : cat /proc/acpi/battery/BAT0/state present: yes capacity state: ok charging state: charged present rate: 0 mA remaining capacity: 392 mAh present voltage: 12476 mV Initially it was showing charging state: charging after 5mins it started displaying as charged. ! Based on that if I remove my AC Power it shows low battery notification. 2) When I run acpi : acpi -b Battery 0: Unknown, 9% The battery state shows as unknown. But initially when we plug-in to AC adapter acpi -b Battery 0: Charging, 9%, 13:04:00 until charged 3) When the check the same with : upower -i /org/freedesktop/UPower/devices/battery_BAT0 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 vendor: HP power supply: yes updated: Thu Nov 1 16:06:40 2012 (20 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: charging energy: 4.2336 Wh energy-empty: 0 Wh energy-full: 33.1128 Wh energy-full-design: 33.1128 Wh energy-rate: 5.6052 W voltage: 12.474 V time to full: 5.2 hours percentage: 12.7854% capacity: 100% technology: lithium-ion Is the power stats output, It says 5hrs to charge completely, If I charge it even more than 5hrs and unplug the AC power, It again cribs stating LOW BATTERY !! The same thing does not happen with Windows7. Any suggestions/ help will be greatly appreciated.

    Read the article

  • Netbook performs hard shutdown without warning on low battery power

    - by Steve Kroon
    My Asus EEE netbook performs a hard shutdown when it reaches low battery power, without giving any warning - i.e. the power just goes off, without any shutdown process. I can't find anything in the syslog, and no error messages are printed before it happens. I've had this problem on previous (K)Ubuntu versions, and hoped updating to Ubuntu Precise would help resolve the issue, but it hasn't. The option in the Power application for "when power is critically low" is currently blank - the only options are a (grayed-out) hibernate and "Power off". I have re-installed indicator-power to no effect. The time remaining reported by acpi is unstable, as is the time remaining reported by gnome-power-statistics. (For example, running acpi twice in succession, I got 2h16min, and then 3h21min remaining. These sorts of jumps in the remaining time are also in the gnome-power-statistics graphs.) It might be possible to write a script to give me advance warning (as per @RanRag's comment below), but I would prefer to isolate why I don't get a critical battery notification from the system before this happens, so that I can take action as appropriate (suspend/shutdown/plug in power) when I get a notification. Some additional information on the battery: kroon@minia:~$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/PNP0C0A:00/power_supply/BAT0 vendor: ASUS model: 1005P power supply: yes updated: Fri Aug 17 07:31:23 2012 (9 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: charging energy: 33.966 Wh energy-empty: 0 Wh energy-full: 34.9272 Wh energy-full-design: 47.52 Wh energy-rate: 3.7692 W voltage: 12.61 V time to full: 15.3 minutes percentage: 97.248% capacity: 73.5% technology: lithium-ion History (charge): 1345181483 97.248 charging 1345181453 97.155 charging 1345181423 97.062 charging 1345181393 96.970 charging History (rate): 1345181483 3.769 charging 1345181453 3.899 charging 1345181423 4.061 charging 1345181393 4.201 charging kroon@minia:~$ cat /proc/acpi/battery/BAT0/state present: yes capacity state: ok charging state: charging present rate: 332 mA remaining capacity: 3149 mAh present voltage: 12612 mV kroon@minia:~$ cat /proc/acpi/battery/BAT0/info present: yes design capacity: 4400 mAh last full capacity: 3209 mAh battery technology: rechargeable design voltage: 10800 mV design capacity warning: 10 mAh design capacity low: 5 mAh cycle count: 0 capacity granularity 1: 44 mAh capacity granularity 2: 44 mAh model number: 1005P serial number: battery type: LION OEM info: ASUS

    Read the article

  • Which forum software has the most advanced community/GetSatisfaction type features?

    - by Gaia
    I need to assemble a GetSatisfaction/Lithium/Jive type support forum/community. The first is not available in the desired language and the last two are priced for the enterprise market. I did research some other options (open source or SaaS) but they all seem to be either: kind of dead (open source options) too focused in gathering ideas/feedback (uservoice) strictly support without the community/voting features (zendesk) I need an open forum (people powered support/UGC with community/voting features). Therefore I will have to do some of the work on my own. I want to piece things (plugins/mods/etc) on top of a standard forum platform to give it the features I need. For this purpose, I want to use a mature product with widespread userbase, active community and lots of plugin options. I believe most will agree that my options therefore are: vBulletin phpBB SMF Here are the questions: Which one of the three above offers the easier path towards the desired goal? Which one of the three above has the most advanced features related to the desired goal? Of course I dont expect anyone to know these answers cut and dry. I am hoping to hear some experiences and see some examples. Also, it would be great if both those questions had the same answer, but I am not going to get my hopes up... PS: I wish I could add the tags "phpbb" and "smf" ;)

    Read the article

  • Laptop battery charging capacity reduced to 52%

    - by omjaijagdish
    I have been using Ubuntu 11.04 on DELL Inspiron 14R (N5010) laptop for last three months. Before I switch to ubuntu my laptop battery used to give 2.5 hrs to 3 hrs back-up. But since I have been using ubuntu, it has been reduced to 1hr to 1.5 hrs at max. I tried following commands: $ cat /proc/acpi/battery/BAT0/state which gave result as present: yes capacity state: ok charging state: charged present rate: 1 mA remaining capacity: 4400 mAh present voltage: 12407 mV then I tried $ acpi -b the result was.. Battery 0: Unknown, 100% when I gave command as $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 the result was.. native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 model: DELL W7H3N08 serial: 7114 power supply: yes updated: Sat Nov 24 11:25:34 2012 (21 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged energy: 48.4748 Wh energy-empty: 0 Wh energy-full: 48.4748 Wh energy-full-design: 48.9595 Wh energy-rate: 0.011017 W voltage: 12.408 V percentage: 100% **capacity: 52.9253%** technology: lithium-ion Someone please let me know, what is going wrong with my laptop? How can I get charging with full capacity?

    Read the article

  • Problem in installation in My Hp g4 1226se

    - by vivek Verma
    1vivek.100 Dual booting error in Hp pavilion g4 1226se Dear sir or Madam, My name is vivek verma.... I am the user of my Hp laptop which series and model name is HP PAVILION G4 1226SE........ i have purchase in the year of 2012 and month is February.....the windows 7 home basic 64 Bit is already installed in in my laptop.... Now i want to install Ubuntu 12.04 Lts or 13.10 lts..... i have try many time to install in my laptop via live CD or USB installer....and i have try many live CD and many pen drive to install Ubuntu ... but it is not done......now i am in very big problem...... when i put my CD or USB drive to boot and install the Ubuntu......my laptop screen is goes the some black (brightness of my laptop screen is very low and there is very low visibility ) and not showing any thing on my laptop screen..... and when i move the my laptop screen.....then there is graphics option in this screen to installation of the Ubuntu option......and when i press the dual boot with setting button and press to continue them my laptop is goes for shutdown after 2 or 5 minutes..... ...... and Hp service center person is saying to me our laptop hardware has no problem.....please contact to Ubuntu tech support............. show please help me if possible..... My laptop configuration is here...... Hardware Product Name g4-1226se Product Number QJ551EA Microprocessor 2.4 GHz Intel Core i5-2430M Microprocessor Cache 3 MB L3 cache Memory 4 GB DDR3 Memory Max Upgradeable to 4 GB DDR3 Video Graphics Intel HD 3000 (up to 1.65 GB) Display 35,5 cm (14,0") High-Definition LED-backlit BrightView Display (1366 x 768) Hard Drive 500 GB SATA (5400 rpm) Multimedia Drive SuperMulti DVD±R/RW with Double Layer Support Network Card Integrated 10/100 BASE-T Ethernet LAN Wireless Connectivity 802.11 b/g/n Sound Altec Lansing speakers Keyboard Full size island-style keyboard with home roll keys Pointing Device TouchPad supporting Multi-Touch gestures with On/Off button PC Card Slots Multi-Format Digital Media Card Reader for Secure Digital cards, Multimedia cards External Ports 1 VGA 1 headphone-out 1 microphone-in 3 USB 2.0 1 RJ45 Dimensions 34.1 x 23.1 x 3.56 cm Weight Starting at 2.1 kg Power 65W AC Power Adapter 6-cell Lithium-Ion (Li-Ion) What's In The Box Webcam with Integrated Digital Microphone (VGA) Software Operating System: Windows 7 Home Basic 64bit....Genuine..... ......... Sir please help me if possible....... Name =vivek verma Contact no.+919911146737 Email [email protected]

    Read the article

1 2  | Next Page >