Daily Archives

Articles indexed Sunday April 8 2012

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

  • Wake laptop when lid is opened?

    - by crackout12
    I have a SAMSUNG laptop, which by the experience in the last months, has been a great one. I am actually implementing some functionality to it, and since I noticed, I am able to wake up my laptop from sleep by just opening the lid on Windows 7, however, I need to press to power button to wake up in Ubuntu. Using a program called i-nex, I noted that the kernel DOES dettect a "lid switch", and I am looking forward to use it to wake up function. Any ideas? UPDATE: Thanks @yossile for bringing up some clues! However, output of command cat /proc/acpi/wakeup does not show the LID device. I still tried the second set of commands you gave me with no effect. Then I tried experimenting, guessing that LID should be named by other value, so I tried enabling the others. No victory so far. But I noticed that devices that did not have any pci listings were disabled at all time no matter what I tried. Here is the output of command cat /proc/acpi/wakeup: root@samsung:~# cat /proc/acpi/wakeup Device S-state Status Sysfs node PCE4 S4 *disabled pci:0000:00:04.0 SBAZ S4 *disabled pci:0000:00:14.2 P0PC S4 *disabled pci:0000:00:14.4 GEC S4 *disabled PE20 S4 *disabled pci:0000:00:15.0 PE21 S4 *disabled PE22 S4 *disabled pci:0000:00:15.2 PE23 S4 *disabled PWRB S5 *enabled So maybe it could be that LID is either GEC,PE21, or PE23? Still, there is /proc/acpi/button/lid/LID/state file which shows that LID is opened. Any more ideas?

    Read the article

  • How to edit pdf metadata from command line?

    - by bdr529
    I need a command line tool for editing metadata of pdf-files. I'm using a Aiptek MyNote Premium tablet for writing my notes and minutes on this device, import them later and convert them to pdf automatically with a simple script using inkscape and ghostscript. Is there any command line tool to add some categories to the pdf's metadata, so i can find the pdf later (e.g. with gnome-do) by categories? Update: I tried the solution with pdftk and it works, but it seems that gnome-do doesn't take care of pdf-metadata. Is there a way to get gnome-do to do that?

    Read the article

  • How to fix AVI index error

    - by Tim
    I try to open an AVI file. The first software I tried is VLC media player. It reports some error about AVI index: This AVI file is broken. Seeking will not work correctly. Do you want to try to fix it? This might take a long time. I chose yes, and it began fixing AVI index and existed when the repair progress bar reaches 20% or so. Then the video started playing and stopped much earlier than when it is supposed to finish. Next I tried to open it in Totem Movie Player, which also stopped earlier at the same place as in VLC player. I tried to play it in GMplayer. Now the entire AVI file can be played from start to finish, but it is impossible to drag playing progress bar while it was possible in VLC player and Totem player. I heard that Avidemux can fix AVI index error, but later discovered it even failed to open the AVI file before it could try to fix the error. So I was wondering how I can fix the AVI index error, or at least drag the playing progress bar in GMplayer? Thanks and regards!

    Read the article

  • Can't open DDMS

    - by Emerald214
    When I open a standalone DDMS besides Eclipse, it generates the below error. hieund@hieund:~$ ddms 01:51:58 E/ddms: Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences. (DDMS:6904): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 17 (DDMS:6904): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 17 01:52:18 E/DDMS: device offline com.android.ddmlib.AdbCommandRejectedException: device offline at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373) at com.android.ddmlib.Device.executeShellCommand(Device.java:364) at com.android.ddmuilib.SysinfoPanel.loadFromDevice(SysinfoPanel.java:159) at com.android.ddmuilib.SysinfoPanel.deviceSelected(SysinfoPanel.java:126) at com.android.ddmuilib.SelectionDependentPanel.deviceSelected(SelectionDependentPanel.java:52) at com.android.ddms.UIThread.selectionChanged(UIThread.java:1721) at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:752) at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:740) at com.android.ddmuilib.DevicePanel.access$1100(DevicePanel.java:56) at com.android.ddmuilib.DevicePanel$1.widgetSelected(DevicePanel.java:357) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at com.android.ddms.UIThread.runUI(UIThread.java:517) at com.android.ddms.Main.main(Main.java:116) 01:52:32 E/ddms: shutting down due to uncaught exception 01:52:32 E/ddms: Failed to execute runnable (java.lang.ArrayIndexOutOfBoundsException: -1) org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.ArrayIndexOutOfBoundsException: -1) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at com.android.ddms.UIThread.runUI(UIThread.java:517) at com.android.ddms.Main.main(Main.java:116) Caused by: java.lang.ArrayIndexOutOfBoundsException: -1 at org.eclipse.jface.viewers.AbstractTableViewer$VirtualManager.resolveElement(AbstractTableViewer.java:100) at org.eclipse.jface.viewers.AbstractTableViewer$1.handleEvent(AbstractTableViewer.java:70) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Table.checkData(Unknown Source) at org.eclipse.swt.widgets.Table.cellDataProc(Unknown Source) at org.eclipse.swt.widgets.Display.cellDataProc(Unknown Source) at org.eclipse.swt.internal.gtk.OS._gtk_list_store_append(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_list_store_append(Unknown Source) at org.eclipse.swt.widgets.Table.setItemCount(Unknown Source) at org.eclipse.jface.viewers.TableViewer.doSetItemCount(TableViewer.java:217) at org.eclipse.jface.viewers.AbstractTableViewer.internalVirtualRefreshAll(AbstractTableViewer.java:661) at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:635) at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:620) at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1430) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1365) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1328) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1428) at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:537) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1387) at com.android.ddmuilib.logcat.LogCatPanel$LogCatTableRefresherTask.run(LogCatPanel.java:1000) at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source) ... 5 more I tried to change port for DDMS in Eclipse but it still doesn't work.

    Read the article

  • Site Description h2 vs p

    - by user1010609
    I tend to follow this html structure while creating new site on my main page: <div class="header"> <img alt="keyword" title="keyword logo" src="keyword.png" /> <div> <h1>keyword</h1> <p><b>keyword + hierarchy keywords</b></p> </div> </div> As you can see Im using <p><b></b></p> to put short description of the site in it but I was wondering If maybe h2 would be better to use here?

    Read the article

  • How can I determine the trending pages on my site?

    - by Dogweather
    I'm looking to what what the "hot" pages are on one of my sites. I want to see for various timeframes, what the top-50 pages are. I'm going to create a data feed with this info which will be input to another app. I have Apache logs, and complete control of the machine to install what I want. I'm mostly wondering if there's something out there already that I can use, or if I have to implement it myself, what good algorithms or strategies might be. Thanks.

    Read the article

  • Analiytics: Can I set a goal on multiple events?

    - by David Parks
    We have a popup dialogue that requests users email address or facebook login. The page behind the popup loads, so a page view is counted. We want to measure: How many users ignored the popup completely How many users engaged the popup, but don't complete the process (we trigger an event when the user performs actions defined as "engaging") How many users completed the popup Bounce rates aren't telling because some users won't receive the popup. We are basically triggering events "PopupDisplayed" "PopupEngaged" and "PopupComplete", with labels to differentiate between email and facebook. But I don't think I can set goals to count "Users who received 'PopupDisplayed' AND 'PopupComplete'" events, so I can count how many users both saw the popup and completed it.

    Read the article

  • Is traditional JavaScript image pre-loading taboo

    - by Evan Plaice
    I remember the good-old-days (not really) back when I was still sucking the teet of Dreamweaver to build websites and the lure of playing copypasta with fancy built-in scripts (ex, image-swap) was like black magic. I'm pretty far removed from that now days but I was adapting a small site from it's original FrontPage (::cringe::) format to a standard HTML/CSS implementation and couldn't help wondering... should I should re-implement the JavaScript image pre-loading into the current version? Or, is there a better way? I don't want to block the page from loading by requiring the user to request all the assets withing the page by using the traditional JavaScript pre-loader method. I value giving the user something to look at ASAP, and there's some potential harm to my Google mojo by doing so. Is there a cleaner solution to prevent unnecessary page-reflows during loading? Such as, setting the static width/height dimensions through a CSS style attribute on the image element.

    Read the article

  • Keystone Correction using 3D-Points of Kinect

    - by philllies
    With XNA, I am displaying a simple rectangle which is projected onto the floor. The projector can be placed at an arbitrary position. Obviously, the projected rectangle gets distorted according to the projectors position and angle. A Kinect scans the floor looking for the four corners. Now my goal is to transform the original rectangle such that the projection is no longer distorted by basically pre-warping the rectangle. My first approach was to do everything in 2D: First compute a perspective transformation (using OpenCV's warpPerspective()) from the scanned points to the internal rectangle's points und apply the inverse to the rectangle. This seemed to work but was too slow as it couldn't be rendered on the GPU. The second approach was to do everything in 3D in order to use XNA's rendering features. First, I would display a plane, scan its corners with Kinect and map the received 3D-Points to the original plane. Theoretically, I could apply the inverse of the perspective transformation to the plane, as I did in the 2D-approach. However, in since XNA works with a view and projection matrix, I can't just call a function such as warpPerspective() and get the desired result. I would need to compute the new parameters for the camera's view and projection matrix. Question: Is it possible to compute these parameters and split them into two matrices (view and projection)? If not, is there another approach I could use?

    Read the article

  • Ledge grab and climb in Unity3D

    - by BallzOfSteel
    I just started on a new project. In this project one of the main gameplay mechanics is that you can grab a ledge on certain points in a level and hang on to it. Now my question, since I've been wrestling with this for quite a while now. How could I actually implement this? I have tried it with animations, but it's just really ugly since the player will snap to a certain point where the animation starts.

    Read the article

  • help animating a player in Corona SDK

    - by andrew McCutchan
    Working on a game in the Corona SDK with Lua and I need help so the player animates on the line drawn. Right now he animates at the beggining and the end but not on the line. Here is the player code: function spawnPlayerObject(xPlayerSpawn,yPlayerSpawn,richTurn) --spawns Rich where we need him. -- riches sprite sheet and all his inital spirites. We need to adjust this so that animations 3-6 are the only ones that animate when moving horizontally local richPlayer = sprite.newSpriteSet(richSheet1,1,6) sprite.add(richPlayer, "rich", 1,6,500,1) rich = sprite.newSprite(richPlayer) rich.x = xPlayerSpawn rich.y = yPlayerSpawn rich:scale(_W*0.0009, _W*0.0009) -- scale is used to adjust the size of the object. richDir = richTurn rich.rotation = richDir rich:prepare("rich") rich:play() physics.addBody( rich, "static", { friction=1, radius = 15 } ) -- needs a better physics body for collision detection. end And here is the code for the line: function movePlayerOnLine(event) --for the original image replace all rich with player. if posCount ~= linePart then richDir = math.atan2(ractgangle_hit[posCount].y-rich.y,ractgangle_hit[posCount].x-rich.x)*180/math.pi playerSpeed = 5 rich.x = rich.x + math.cos(richDir*math.pi/180)*playerSpeed rich.y = rich.y + math.sin(richDir*math.pi/180)*playerSpeed if rich.x < ractgangle_hit[posCount].x+playerSpeed*10 and rich.x > ractgangle_hit[posCount].x-playerSpeed*10 then if rich.y < ractgangle_hit[posCount].y+playerSpeed*10 and rich.y > ractgangle_hit[posCount].y-playerSpeed*10 then posCount = posCount + 1 end end I don't think anything has changed recently but I have been getting an error when testing of "attempt to upvalue "rich" a nil value" on the second line, richDir = etc.

    Read the article

  • Line Text with Nav Bar in HTML

    - by Eric
    I have a navbar right under the title to the site, but I want to be line up the first and last items in the navbar with the beginning and end of the Title. I don't have a live preview, but I attached an image. I can get it to line up in one browser, but when I open it in the other, its off again. Is there an easy way to line the text up so it works for everything? thank you HTML: <body onload="play()"> <div class="heading">UPRISING</div> <div class="container_12"> <div id="topnav" align="center"> <ul id="list-nav"> <li><a href="home.html">HOME</a></li> <li><a href="about.html">ABOUT</a></li> <li><a href="trailer.html">TRAILER</a></li> <li><a href="stills.html">STILLS</a></li> <li><a href="news.html">NEWS</a></li> <li><a href="contact.html">CONTACT</a></li> <!-- <li><a href="distribution.html">DISTRIBUTION</a></li> --> </ul> </div> <!-- START OF CONTAINER --> <div class="trailer"> <img id="imgHolder" /> </div> </div> <!-- END OF CONTAINER 12 --> CSS: #topnav li { margin-right: 110px; } #topnav li:nth-last-child(1) { margin-right: 0px; }

    Read the article

  • rails 3.1 partial_updates doesn't seem to work with password

    - by user1306769
    i have a user model with a password attribute, which gets saved as password_digest. What i want to do is have the edit user page and the edit password page separated, so that the admin doesn't need to input the password everytime he needs to change something else. For this i have made an extra action / view. My problem is that when i update the user info, i get password validation errors even though i have no password field in the form. Which leads me to the conclusion that partial_updates isn't working with the password attribute (as i have already tested in the console that it is enabled, and it is) Is this me doing something wrong, or should i approach this differently?

    Read the article

  • Facebook iFrame APP not working in IE, works on every other browser

    - by Sean Ashmore
    So im getting a blank page when loading this page within an iFrame on Internet explorer, every other browser works fine.. I have also tried using p3p headers as other people have suggested, but to no avail. <?php require ("connect.php"); require ("config.php"); require ("fb_config.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Login handler</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="css/login.css" type="text/css"> </head> <body> <?//=$user?> <?php if($user == 0) { echo "You are not logged into facebook. Nice try."; }else{ $query = "SELECT id,fb_id,login_ip,login_count,activated,sitestate FROM login WHERE fb_id='".mysql_real_escape_string($user)."'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); if (mysql_num_rows($result) == 0) { $sql = "INSERT INTO login SET id = '', fb_id ='" .mysql_real_escape_string($user). "', name = '" .rand(10000000000000000,99999999999999999999). "', signup =NOW() , password = '" .mysql_real_escape_string($pass). "', state = '0', mail = '" .mysql_real_escape_string($_POST['mail']). "',location='".mysql_real_escape_string($randomlocation)."',location_start='".mysql_real_escape_string($randomlocation)."', signup_ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."',ref='".mysql_real_escape_string($_POST['ref'])."', activation_id = '" .mysql_real_escape_string($activation_link). "',activated='2', killprotection = '$twodayprot',gender='" .mysql_real_escape_string($_POST["gender"]). "'"; $res = mysql_query($sql); } //if($row['fb_id'] != $user){ //echo "Your facebook ID: $user is NOT in the MW DB."; //exit(); //}else{ if(empty($row['login_ip'])){ $row['login_ip'] = $_SERVER['REMOTE_ADDR']; }else{ $ip_information = explode("-", $row['login_ip']); if (in_array($_SERVER['REMOTE_ADDR'], $ip_information)) { $row['login_ip'] = $row['login_ip']; }else{ $row['login_ip'] = $row['login_ip']."-".$_SERVER['REMOTE_ADDR']; } } $update_login = mysql_query("UPDATE login SET login_count=login_count+'1' WHERE name='".mysql_real_escape_string($_POST['username'])."'") or die(mysql_error()); $_SESSION['user_id'] = $row['id']; $result = mysql_query("UPDATE login SET userip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."',login_ip='".mysql_real_escape_string($row['login_ip'])."',login_count='0' WHERE id='".mysql_real_escape_string($_SESSION['user_id'])."'") or die(mysql_error()); if ($row['sitestate'] == 0){ header("location: home.php"); } elseif ($row['sitestate'] == 2) { header("location: killed.php?id={$row['id']}&encrypted={$row['password']}"); } else { header("location: banned.php?id={$row['id']}&encrypted={$row['password']}"); } }// id check. ?> </body> </html>

    Read the article

  • Can you make a python script behave differently when imported than when run directly?

    - by futuraprime
    I often have to write data parsing scripts, and I'd like to be able to run them in two different ways: as a module and as a standalone script. So, for example: def parseData(filename): # data parsing code here return data def HypotheticalCommandLineOnlyHappyMagicFunction(): print json.dumps(parseData(sys.argv[1]), indent=4) the idea here being that in another python script I can call import dataparser and have access to dataParser.parseData in my script, or on the command line I can just run python dataparser.py and it would run my HypotheticalCommandLineOnlyHappyMagicFunction and shunt the data as json to stdout. Is there a way to do this in python?

    Read the article

  • How do i call bash script function using exec function by passing parameter in php?

    - by Stan
    I have created a bash script that install magento in a cpanel. but i have a problem regarding the exec function. $function_path = Mage::getBaseDir()."/media/installer/function.sh"; exec("$function_path $db_host $db_name $db_user $db_pass $url $ad_user $ad_pass $ad_email"); This the bash shell script function.sh #!/bin/bash magento_detail $dbhost $dbname $dbuser $dbpass $url $admin_username $admin_password $admin_email function magento_detail() { stty erase '^?' echo "To install Magento, you will need a blank database ready with a user assigned to it." echo -n "Do you have all of your database information" dbinfo = "y" echo $dbinfo if [ "$dbinfo" -eq 'y' ] then echo "Database Host (usually localhost) : $dbhost " echo "Database Name : $dbname " echo "Database User : $dbuser " echo "Database Password : $dbpass " echo "Store Url : $url " echo "Admin Username : $admin_username " echo "Admin Password : $admin_password " echo "Admin Email Address : $admin_email " echo -n "Include Sample Data? (y/n) " echo sample = "y" if [ "$sample" -eq "y" ]; then echo echo "Now installing Magento with sample data..." echo echo "Downloading packages..." echo wget http://www.magentocommerce.com/downloads/assets/1.5.1.0/magento-1.5.1.0.tar.gz wget http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz echo echo "Extracting data..." echo tar -zxvf magento-1.5.1.0.tar.gz tar -zxvf magento-sample-data-1.2.0.tar.gz echo echo "Moving files..." echo mv magento-sample-data-1.2.0/media/* magento/media/ mv magento-sample-data-1.2.0/magento_sample_data_for_1.2.0.sql magento/data.sql mv magento/index.php magento/.htaccess ./$test1 echo echo "Setting permissions..." echo chmod o+w var var/.htaccess app/etc chmod -R o+w media echo echo "Importing sample products..." echo mysql -h $dbhost -u $dbuser -p$dbpass $dbname < data.sql echo echo "Initializing PEAR registry..." echo chmod 550 mage ./mage mage-setup . echo echo "Downloading packages..." echo echo echo "Cleaning up files..." echo rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* rm -rf magento/ magento-sample-data-1.2.0/ rm -rf magento-1.5.1.0.tar.gz magento-sample-data-1.2.0.tar.gz data.sql rm -rf index.php.sample .htaccess.sample php.ini.sample LICENSE.txt STATUS.txt data.sql echo echo "Installing Magento..." echo php -f install.php --license_agreement_accepted "yes" --locale "en_US" --timezone "America/Los_Angeles" --default_currency "USD" --db_host "$dbhost" --db_name "$dbname" --db_user "$dbuser" --db_pass "$dbpass" --url "$url" --use_rewrites "yes" --use_secure "no" --secure_base_url "" --use_secure_admin "no" --admin_email "$admin_email" --admin_username "$admin_username" --admin_password "$admin_password" echo echo "Finished installing Magento" echo exit else echo "Now installing Magento without sample data..." echo echo "Downloading packages..." echo wget http://www.magentocommerce.com/downloads/assets/1.5.1.0/magento-1.5.1.0.tar.gz echo echo "Extracting data..." echo tar -zxvf magento-1.5.1.0.tar.gz echo echo "Moving files..." echo mv magento/* magento/.htaccess . echo echo "Setting permissions..." echo chmod o+w var var/.htaccess app/etc chmod -R o+w media echo echo "Initializing PEAR registry..." echo chmod 550 mage ./mage mage-setup . echo echo "Downloading packages..." echo echo echo "Cleaning up files..." echo rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* rm -rf magento/ magento-1.5.1.0.tar.gz rm -rf index.php.sample .htaccess.sample php.ini.sample LICENSE.txt STATUS.txt echo echo "Installing Magento..." echo php -f install.php --license_agreement_accepted "yes" --locale "en_US" --timezone "America/Los_Angeles" --default_currency "USD" --db_host "$dbhost" --db_name "$dbname" --db_user "$dbuser" --db_pass "$dbpass" --url "$url" --use_rewrites "yes" --use_secure "no" --secure_base_url "" --use_secure_admin "no" --admin_email "$admin_email" --admin_username "$admin_username" --admin_password "$admin_password" echo echo "Finished installing Magento else part" exit fi else echo "Please setup a database first. Don't forget to assign a database user!" exit fi }` when i run this exec command,at that time it calls bash script function magento_installer() which contains arguments $db_host $db_name $db_user $db_pass $url $ad_user $ad_pass $ad_email. above arguments i'll pass in exec command to call magento_installer() function of bash script. so, is it right way of calling a bash script function? It directly goes to the last step of if condition and prints "Please setup a database first. Don't forget to assign a database user!". It cant enter it in if condition and directly goes to else condition. so please help me?

    Read the article

  • Not able to play videos (from youtube) in WebView

    - by user1205193
    I am using a webview to display a video (could be from youtube or vimeo) in my app. In order to not load the video webpages in the default Android Browser, I am also extending the WebViewClient so I can override the shouldOverrideUrlLoading method. This way the video webpage loads successfully in the WebView. However, when I click on the embedded video on the WebView, it does not play. If I do not override the shouldOverrideUrlLoading method, and let the video webpages load in the default Android browser, the videos work just fine. Any ideas why the videos are not working in the WebView? Also, the main reason why I overrode the shouldOverrideUrlLoading method is because if I do not do that, then when I exit the Android browser to come back to my activity (by hitting the back button on the phone), I see a white screen. Upon hitting the back button twice, I am able to get back to my Activity. I am using the emulator to do this test. Here is my code: public class YoutubeLink extends Activity { WebView myWebView; String video_url; private class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.youtubelink); //Retrieving data from ListSample.java Bundle extras = getIntent().getExtras(); if(extras !=null) { video_url = extras.getString("video_url"); Log.d("inside YoutubeLink.java", video_url); } myWebView = (WebView) findViewById(R.id.web); myWebView.getSettings().setJavaScriptEnabled(true); myWebView.setWebViewClient(new HelloWebViewClient()); myWebView.loadUrl(video_url); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK) && myWebView.canGoBack()) { myWebView.goBack(); return true; } return super.onKeyDown(keyCode, event); }}

    Read the article

  • Memory leak - debugger and memory analyzer disagreeing

    - by Joe
    There is a memory leak in my android game - I've managed to narrow it down to a certain object, which has a list of objects to render on a texture. This object clears the list every time it draws though - so I can't work out how its managed to get thousands of elements in the list. I checked in the debugger and it doesn't have all these thousands of elements - usually about 2-20 which is what I'd expect... The game definitely slows down progressively only if I have rendering to texturing on. Here is a picture of Memory Analyzer showing 6,111 items: Memory Analyzer Here is a picture of the debugger showing 2: Debugger Can anyone help me find out whats wrong?

    Read the article

  • Confused as to how to validate spring mvc form, what are my options?

    - by Blankman
    Latest spring mvc, using freemarker. Hoping someone could tell me what my options are in terms of validating a form with spring mvc, and what the recommend way would be to do this. I have a form that doesn't map directly to a model, it has input fields that when posted, will be used to initialze 2 model objects which I will then need to validate, and if they pass I will save them. If they fail, I want to return back to the form, pre-fill the values with what the user entered and display the error messages. I have read here and there about 2 methods, once of which I have done and understand how it works: @RequestMapping(...., method = RequestMethod.POST) public ModelAndView myMethod(@Valid MyModel, BindingResult bindingResult) { ModelAndView mav = new ModelAndView("some/view"); mav.addObject("mymodel", myModel); if(bindingResult.hasErrors()) { return mav; } } Now this worked if my form mapped directly to the form, but in my situation I have: form fields that don't map to any specific model, they have a few properties from 2 models. before validation occurrs, I need to create the 2 models manually, set the values from the values from the form, and manually set some properties also: Call validate on both models (model1, model2), and append these error messages to the errors collection which I need to pass back to the same view page if things don't work. when the form posts, I have to do some database calls, and based on those results may need to add additional messages to the errors collection Can someone tell me how to do this sort of validation? Pseudo code below: Model1 model1 = new Model1(); Model2 model2 = new Model2(); // manually or somehow automatically set the posted form values to model1 and model2. // set some fields manually, not from posted form model1.setProperty10(GlobalSettings.getDefaultProperty10()); model2.setProperty11(GlobalSettings.getDefaultProperty11()); // db calls, if they fail, add to errors collection if(bindingResult.hasErrors()) { return mav; } // validation passed, save Model1Service.save(model1); Model2Service.save(model2); redirect to another view Update I have using the JSR 303 annotations on my models right now, and it would great if I can use those still. Update II Please read the bounty description below for a summary of what I am looking for.

    Read the article

  • Most efficient way to LIMIT results in a JOIN?

    - by johnnietheblack
    I have a fairly simple one-to-many type join in a MySQL query. In this case, I'd like to LIMIT my results by the left table. For example, let's say I have an accounts table and a comments table, and I'd like to pull 100 rows from accounts and all the associated comments rows for each. Thy only way I can think to do this is with a sub-select in in the FROM clause instead of simply selecting FROM accounts. Here is my current idea: SELECT a.*, c.* FROM (SELECT * FROM accounts LIMIT 100) a LEFT JOIN `comments` c on c.account_id = a.id ORDER BY a.id However, whenever I need to do a sub-select of some sort, my intermediate level SQL knowledge feels like it's doing something wrong. Is there a more efficient, or faster, way to do this, or is this pretty good? By the way... This might be the absolute simplest way to do this, which I'm okay with as an answer. I'm simply trying to figure out if there IS another way to do this that could potentially compete with the above statement in terms of speed.

    Read the article

  • PHP include doesn't work

    - by Chris
    I'm not sure how simple is this to solve, but I assume I'm doing something wrong. I'm new to PHP, so bear with me, please. When I started learning PHP, I always placed all my project files into the same folder along with index.php and thus included everything like this: <?php include('./translation.php'); ?> Later on in the process of learning as I gained experience and my skill increased, I had to start using folders and place my files into sub folders. I ended up successfully including my files with the following: <?php include('../translation.php'); ?> My trouble-free coding took an unexpected turn when I decided to start using sub-sub folders. After placing all the files even deeper into the file structure I was shocked to find out that I cannot include them anymore, using: <?php include('.../translation.php'); ?> Now I'm lost. What did I do wrong? Am I to understand that I cannot include files deeper than 2 directories in the project? Should I start using a different file system?

    Read the article

  • innerhtml not working on blogger

    - by HAnlin Cal
    I'm working on a simple vote system. It works fine when the two files are together(locally). However, when I publish it on blogger, it is unable to output the results. (on click the vote gets registered on the webhost, but the results just don't show!) heres my code: <script type="text/javascript"> function getVote(int) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("poll").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","http://pacontest.eu.pn/poll_vote.php?vote="+int,true); xmlhttp.send(); } </script> <div id="poll"> <h3>Do you like this?</h3> <form> Yes: <input type="radio" name="vote" value="0" onclick="getVote(this.value)" /> No: <input type="radio" name="vote" value="1" onclick="getVote(this.value)" /> </form> </div>

    Read the article

  • Split by Caps in Javascript,

    - by user1294188
    I am trying to split up a string by caps using Javascript, Examples of what Im trying to do: "HiMyNameIsBob" -> "Hi My Name Is Bob" "GreetingsFriends" -> "Greetings Friends" I am aware of the str.split() function, however I am not sure how to make this function work with capital letters. I've tried: str.split("(?=\\p{Upper})") Unfortunately that doesn't work, any help would be great.

    Read the article

  • App crashes when adding array data to table cells

    - by bassmandan
    I am trying to create a table view that loads a number of tweets into the table (one per cell etc). I am using NSXMLParser to get the information and have got as far as creating an array with the selection of tweets that I want. However, when I try to add them to the table cells, the app crashes on the line: cell.textLabel.text = cellValue; An NSLog before this shows in the console that the app is getting the correct data, so I am a bit stumped as to why this isn't working. This is the block of code that appears to be having the problem: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } // Set up the cell... NSString *cellValue = [statuses objectAtIndex:indexPath.row]; NSLog(@"%@", cellValue); cell.textLabel.text = cellValue; return cell;} If it makes a difference, I am using ARC and the latest version of XCode. I'm still quite new to all this, so if I need to give some extra information, let me know. Thanks in advance. Edit: Backtrace gives the following: * thread #1: tid = 0x2003, 0x918a19c6 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT frame #0: 0x918a19c6 libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x9968ff78 libsystem_c.dylib`pthread_kill + 106 frame #2: 0x99680bdd libsystem_c.dylib`abort + 167 frame #3: 0x03c93e78 libc++abi.dylib`_Unwind_DeleteException frame #4: 0x03c9189e libc++abi.dylib`_ZL17default_terminatev + 34 frame #5: 0x0154df4b libobjc.A.dylib`_objc_terminate + 94 frame #6: 0x03c918de libc++abi.dylib`_ZL19safe_handler_callerPFvvE + 13 frame #7: 0x03c91946 libc++abi.dylib`std::terminate() + 23 frame #8: 0x03c92ab2 libc++abi.dylib`__cxa_throw + 110 frame #9: 0x0154de15 libobjc.A.dylib`objc_exception_throw + 311 frame #10: 0x013bdced CoreFoundation`-[NSObject doesNotRecognizeSelector:] + 253 frame #11: 0x01322f00 CoreFoundation`___forwarding___ + 432 frame #12: 0x01322ce2 CoreFoundation`_CF_forwarding_prep_0 + 50 frame #13: 0x0015168f UIKit`-[UILabel setText:] + 56 frame #14: 0x00003088 Twitter`-[TwitterViewController tableView:cellForRowAtIndexPath:] + 376 at TwitterViewController.m:131 frame #15: 0x000ace0f UIKit`-[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 494 frame #16: 0x000ad589 UIKit`-[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 69 frame #17: 0x00098dfd UIKit`-[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1350 frame #18: 0x000a7851 UIKit`-[UITableView layoutSubviews] + 242 frame #19: 0x00052301 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 145 frame #20: 0x013bde72 CoreFoundation`-[NSObject performSelector:withObject:] + 66 frame #21: 0x01d6692d QuartzCore`-[CALayer layoutSublayers] + 266 frame #22: 0x01d70827 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 231 frame #23: 0x01cf6fa7 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 377 frame #24: 0x01cf8ea6 QuartzCore`CA::Transaction::commit() + 374 frame #25: 0x01d8430c QuartzCore`+[CATransaction flush] + 52 frame #26: 0x000124c6 UIKit`-[UIApplication _reportAppLaunchFinished] + 39 frame #27: 0x00012bd6 UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 1324 frame #28: 0x00021743 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1027 frame #29: 0x000221f8 UIKit`-[UIApplication sendEvent:] + 68 frame #30: 0x00015aa9 UIKit`_UIApplicationHandleEvent + 8196 frame #31: 0x012a6fa9 GraphicsServices`PurpleEventCallback + 1274 frame #32: 0x013901c5 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53 frame #33: 0x012f5022 CoreFoundation`__CFRunLoopDoSource1 + 146 frame #34: 0x012f390a CoreFoundation`__CFRunLoopRun + 2218 frame #35: 0x012f2db4 CoreFoundation`CFRunLoopRunSpecific + 212 frame #36: 0x012f2ccb CoreFoundation`CFRunLoopRunInMode + 123 frame #37: 0x000122a7 UIKit`-[UIApplication _run] + 576 frame #38: 0x00013a9b UIKit`UIApplicationMain + 1175 frame #39: 0x0000239d Twitter`main + 141 at main.m:16 frame #40: 0x00002305 Twitter`start + 53 Debugging console shows this: 2012-04-08 10:10:05.084 Twitter[25309:f803] ( { text = "Have you shared the Shakedown yet? http://t.co/WHrIC9w7"; }, { text = "For all you closet rocknrollas pencil in Sat 12th May The Rebirth of Rock n Roll Party. Haywire Saint @ The Good... http://t.co/OXHKlLIV"; }, { text = "4 weeks today: Vocal tracks will be getting recorded at The Premises Studios"; }, { text = "Rehearsal tonight in preparation to some big recording next month!"; }, { text = "haywire saint 'great taste.' Tune. \n\nhttp://t.co/GKmu5Lna http://t.co/0fii55Hw"; }, { text = "Meeting up with an old roadie for The Cure today. oh the stories...... http://t.co/UeUYccme"; }, { text = "Satisfying day of programming today.. Haywire Saint app coming along nicely with the custom music player ready to rock 'n' roll!"; }, { text = "Happy Friday Everyone!"; }, { text = "We had a great time at The Premises Studios yesterday. We'll be back there before long :D x"; }, { text = "I posted a new photo to Facebook http://t.co/73qAnCvk"; } ) 2012-04-08 10:10:05.093 Twitter[25309:f803] { text = "Have you shared the Shakedown yet? http://t.co/WHrIC9w7"; } 2012-04-08 10:10:05.094 Twitter[25309:f803] -[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x6877a50 2012-04-08 10:10:05.096 Twitter[25309:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x6877a50' *** First throw call stack: (0x13bc052 0x154dd0a 0x13bdced 0x1322f00 0x1322ce2 0x15168f 0x3088 0xace0f 0xad589 0x98dfd 0xa7851 0x52301 0x13bde72 0x1d6692d 0x1d70827 0x1cf6fa7 0x1cf8ea6 0x1d8430c 0x124c6 0x12bd6 0x21743 0x221f8 0x15aa9 0x12a6fa9 0x13901c5 0x12f5022 0x12f390a 0x12f2db4 0x12f2ccb 0x122a7 0x13a9b 0x239d 0x2305) terminate called throwing an exception2012-04-08 10:10:05.924 Twitter[25309:f803] -[__NSCFConstantString count]: unrecognized selector sent to instance 0x5b30

    Read the article

  • How to change the css class="current" when using page jumping (single page website)?

    - by Bryan
    Morning, I must be asking google all the wrong questions, because I can't find anything similar. I have a standard navigation list, but I'm using page jumping because I wanted a single web page. <ul> <li><a href="#livestream">Livestream</a></li> <li><a href="#media">Media</a></li> <li><a href="#crew">Crew</a></li> <li><a href="#services">Services</a></li> <li><a href="#contact">Contact</a></li> </ul> But I can't for the life of me figure out how to make the class="current" when using page jumping. I've tried this bit of jquery because it appears to be what I'm looking for, but it did nothing. I don't think it'll work for #links. Any ideas?

    Read the article

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