Search Results

Search found 11930 results on 478 pages for 'media center'.

Page 96/478 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • How can I scale an OSMF player in ActionScript 3/Flex

    - by Greg Hinch
    I am trying to create a simple video player SWF using the open source media framework in Flex 4. I want to make it dynamically scale based on the dimensions of the video, input by the user. I am following the directions on the Adobe help site, but the video does not seem to scale properly. Depending on the size, sometimes videos play larger than the space allotted on the webpage, and sometimes smaller. The only way I have been able to get it to work properly is by including a SWF metadata tag hardcoding the width and height, but I can't use that if I want to make the player dynamically sized. My code is : package { import flash.display.Sprite; import flash.events.Event; import org.osmf.media.MediaElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.layout.LayoutMetadata; public class GalleryVideoPlayer extends Sprite { private var videoElement:VideoElement; private var mediaPlayer:MediaPlayer; private var mediaContainer:MediaContainer; private var flashVars:Object; public function GalleryVideoPlayer() { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); flashVars = loaderInfo.parameters; mediaPlayer = new MediaPlayer(); videoElement = new VideoElement(new URLResource(flashVars.file)); mediaContainer = new MediaContainer(); var layoutMetadata:LayoutMetadata = new LayoutMetadata(); layoutMetadata.width = Number(flashVars.width); layoutMetadata.height = Number(flashVars.height); videoElement.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, layoutMetadata); mediaPlayer.media = videoElement; mediaContainer.addMediaElement(videoElement); addChild(mediaContainer); } }}

    Read the article

  • What is the maximum sandbox size on iPad?

    - by John Alexander
    I'm writing an iPad app that acts as a media player (video and photos). I know there is a 2GB size limit on apps, however is this the size limit on an app when downloaded? Or the limit on the size of your sandbox throughout the life of the app? For example what if my small app later on downloads various media files to its sandbox that put the user over 2GB total (app + downloaded media)? Thanks!

    Read the article

  • making the div width stretch to fit its contents

    - by Lina
    Hi, I have the following html code: <table> <tr> <td> <div id="fixmywidth" style="position:relative; height:30px;"> <div style="z-index: 2000; margin-top: 5px; height: inherit; position: absolute;"> <table style="height:inherit"> <tr style="height:inherit"> <td align="center" style="width: 31px; height: inherit;">&nbsp;</td> <td align="center" style="width: 31px; height: inherit;">&nbsp;</td> <td align="center" style="width: 31px; height: inherit;">&nbsp;</td> <td align="center" style="width: 31px; height: inherit;">&nbsp;</td> <td align="center" style="width: 31px; height: inherit;">&nbsp;</td> <td align="center" style="width: 31px; height: inherit;">&nbsp;</td> ........300 tds later <td align="center" style="width: 31px; height: inherit;">&nbsp;</td> </tr> </table> </div> </div> </td> </tr> </table> how do i make the div with the id "fixmywidth" width fit the width of the containing elemets? i tried width=100% and widht = auto but they wouldn't work thanks a trillion in advance, Lina

    Read the article

  • Django + Apache wsgi = paths problem

    - by Shamanu4
    Hello. I have this view which generates interface language options menu def lang_menu(request,language): lang_choices = [] import os.path for lang in settings.LANGUAGES: if os.path.isfile("gui/%s.py" % lang) or os.path.isfile("gui/%s.pyc" % lang): langimport = "from gui.%s import menu" % lang try: exec(langimport) except ImportError: lang_choices.append({'error':'invalid language file'}) else: lang_choices.append(menu) else: lang_choices.append({'error':'lang file not found'}) t = loader.get_template('gui/blocks/lang_menu_options.html') data = '' for lang in lang_choices: if not 'error' in lang: data = "%s\n%s" % (data,t.render(Context(lang))) if not data: data = "Error! No languages configured or incorrect language files!" return Context({'content':data}) When I'am using development server (python manage.py runserver ...) it works fine. But when I ported my app to apache wsgi server I've got error "No languages configured or incorrect language files!" Here is my Apache config <VirtualHost *:9999> WSGIScriptAlias / "/usr/local/etc/django/terminal/django.wsgi" <Directory "/usr/local/etc/django/terminal"> Options +ExecCGI Allow From All </Directory> Alias /media/ "/usr/local/lib/python2.5/site-packages/django/contrib/admin/media/" <Location /media/> SetHandler None </Location> <Directory "/usr/local/lib/python2.5/site-packages/django/contrib/admin/media/> Allow from all </Directory> Alias /static/ "/usr/local/etc/django/terminal/media/" <Location /static/> SetHandler None </Location> ServerName ******* ServerAlias ******* ErrorLog /var/log/django.error.log TransferLog /var/log/django.access.log </VirtualHost> django.wsgi: import os, sys sys.path.append('/usr/local/etc/django') sys.path.append('/usr/local/etc/django/terminal') os.environ['DJANGO_SETTINGS_MODULE'] = 'terminal.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() It's look like as problem with path configuration but I'm stuck here ...

    Read the article

  • Android - Audio recorder FileNotFound

    - by david
    Hi, I'm trying to record audio this.recorder = new android.media.MediaRecorder(); this.recorder.setAudioSource(android.media.MediaRecorder.AudioSource.MIC); this.recorder.setOutputFormat(android.media.MediaRecorder.OutputFormat.DEFAULT); this.recorder.setAudioEncoder(android.media.MediaRecorder.AudioEncoder.DEFAULT); this.recorder.setOutputFile("pruebaAudioRecorder.mp4"); this.recorder.prepare(); this.recorder.start(); but when i call prepare method throws the FileNotFound exception. Should I create the file before prepare method? something like new File(...) If so, which should be the file path? thx a lot.

    Read the article

  • .hgignore whole directory tree excepting one specific file

    - by John Mee
    Can anyone tell me the .hgignore pattern to track one specific file in a directory and to ignore everything else? I have a "media" directory which contains a "default.png", for obvious purposes, and the rest of the directory will hold user media. We want hg to ignore everything in the media directory excepting the default file.

    Read the article

  • Dynamic mass hosting using mod_wsgi

    - by Virgil Balibanu
    Hi, I am trying to configure an apache server using mod_wsgi for dynamic mass hosting. Each user will have it's own instance of a python application located in /mnt/data/www/domains/[user_name] and there will be a vhost.map telling me which domain maps to each user's directory (the directory will have the same name as the user). What i do not know is how to write the WSGIScriptAliasMatch line so that it also takes the path from the vhost.map file. What i want to do is something like this: I can have on my server different domains like www.virgilbalibanu.com or virgil.balibanu.com and flaviu.balibanu.com where each domain would belog to another user, the user name having no neccesary connection to the domain name. I want to do this beacuse a user, wehn he makes an acoount receives something like virgil.mydomain.com but if he has his own domain he can change it later to that, for example www.virgilbalibanu.ro, and this way I would only need to chenage the line in the vhost.map file So far I have something like this: Alias /media/ /mnt/data/www/iitcms/media/ #all media is taken from here RewriteEngine on RewriteMap lowercase int:tolower # define the map file RewriteMap vhost txt:/mnt/data/www/domains/vhost.map #this does not work either, can;t say why atm RewriteCond %{REQUEST_URI} ^/uploads/ RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$ RewriteCond ${vhost:%1} ^(/.*)$ RewriteRule ^/(.*)$ %1/media/uploads/$1 #---> this I have no ideea how i could do WSGIScriptAliasMatch ^([^/]+) /mnt/data/www/domains/$1/apache/django.wsgi <Directory "/mnt/data/www/domains"> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <DirectoryMatch ^/mnt/data/www/domains/([^/]+)/apache> AllowOverride None Options FollowSymLinks ExecCGI Order deny,allow Allow from all </DirectoryMatch> <Directory /mnt/data/www/iitcms/media> AllowOverride None Options Indexes FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> <DirectoryMatch ^/mnt/data/www/domains/([^/]+)/media/uploads> AllowOverride None Options Indexes FollowSymLinks MultiViews Order allow,deny Allow from all </DirectoryMatch> I know the part i did with mod_rewrite doesn't work, couldn't really say why not but that's not as important so far, I am curious how could i write the WSGIScriptAliasMatch line so that to accomplish my objective. I would be very grateful for any help, or any other ideas related to how i can deal with this. Also it would be great if I'd manage to get each site to run in wsgi daemon mode, thou that is not as important. Thanks, Virgil

    Read the article

  • how to read a static file in .py file using django ..

    - by zjm1126
    this is my error code: text = open('/media/a.txt', 'rb').read() and my perplexed is: when i use this : text = open('a.txt', 'rb').read() it can be running but when i put the 'a.txt' to the 'media' folder, i can't running , why ? thanks IOError at / [Errno 13] file not accessible: '/media/a.txt'

    Read the article

  • Error in playing a swf file on internet explorer

    - by Rajeev
    In the below code i get an error saying Error #2007: Parameter url must be non-null on Ineternet explorer only.What am i doing wrong here html <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="50" HEIGHT="50" id="myMovieName"> <PARAM NAME="movie" VALUE="/media/players/testsound.swf" /> <PARAM NAME="quality" VALUE="high" /> <PARAM NAME="bgcolor" VALUE="#FFFFFF" /> <EMBED href="/media/players/testsound.swf" src="/media/players/testsound.swf" flashvars="soundUrl=sound.mp3" quality=high bgcolor=#FFFFFF NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"> </EMBED> </OBJECT> mxml ; import flash.net.; import mx.controls.Alert; import mx.controls.Button; import flash.events.Event; import flash.media.Sound; import flash.net.URLRequest; private function clickhandler(event:Event):void { var musicfile:String; var s:Sound = new Sound(); s.addEventListener(Event.COMPLETE, onSoundLoaded); var req:URLRequest = new URLRequest("/opt/cloodon/site/media/players/sound.mp3"); //musicfile = stage.loaderInfo.parameters["soundUrl"]; //var req:URLRequest = new URLRequest(musicfile); s.load(req); } private function onSoundLoaded(event:Event):void { //Alert.show("1"); //var localSound:Sound = event.currentTarget as Sound; var localSound:Sound = event.target as Sound; localSound.play(); } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <!--<mx:Button id="play" label="PLAY" click="clickhandler(event)" />--> <mx:Image id="loader1" source="@Embed(source='/opt/cloodon/site/media/img/speaker.gif')" click="clickhandler(event)" /> </s:Application>

    Read the article

  • Facebook Stream.Get -- How to access data in array?

    - by user316841
    On stream.get, I try to echo $feeds["posts"][$i]["attachment"]["href"]; It return the URL, but, in the same array scope where "type" is located (which returns string: video, etc), trying $feeds["posts"][$i]["attachment"]["type"] returns nothing at all! Here's an array through PHP's var_dump: http://pastie.org/930475 So, from testing I suppose this is protected by Facebook? Does that makes sense at all? Here it's full: http://pastie.org/930490, but not all attachment/media/types has values. It's also strange, because I can't access through [attachment][media][href] or [attachment][media][type], and if I try [attachment][media][0][type] or href, it gives me a string offset error. ["attachment"]=> array(8) { ["media"]=> array(1) { [0]=> array(5) { ["href"]=> string(55) "http://www.facebook.com/video/video.php?v=1392999461587" ["alt"]=> string(13) "IN THE STUDIO" ["type"]=> string(5) "video" My question is, is this protected by Facebook? Or we can actually access this array position?

    Read the article

  • What does upload in Google AppEngine app.yaml do?

    - by Great Turtle
    I am going through the various Google AppEngine tutorials sometimes, and I just noticed something odd in a StackOverflow question about favicon.ico - specifically this question: http://stackoverflow.com/questions/887328/favicon-ico-not-found-error-in-app-engine - url: /favicon.ico static_files: media/img/favicon.ico upload: media/img/favicon.ico - url: /robots.txt static_files: media/robots.txt upload: media/robots.txt All of the posters included an "upload:" line in their app.yaml definitions The application appears to work the same with or without the upload: line, and I have not seen any mention of it in the official documentation. Where is it used, or what difference does it make if this line is included or not?

    Read the article

  • Parsing the Youtube API with DOM

    - by Kirk
    I'm using the Youtube API and I can retrieve the date information without a problem, but don't know how to retrieve the description information. My Code: <?php $v = "dQw4w9WgXcQ"; $url = "http://gdata.youtube.com/feeds/api/videos/". $v; $doc = new DOMDocument; $doc->load($url); $pub = $doc->getElementsByTagName("published")->item(0)->nodeValue; $desc = $doc->getElementsByTagName("media:description")->item(0)->nodeValue; echo "<b>Video Uploaded:</b> "; echo date( "F jS, Y", strtotime( $pub ) ); echo '<br>'; if (isset ($desc)) { echo "<b>Description:</b> "; echo $desc; echo '<br>'; } ?> Here's a link to the feed: http://gdata.youtube.com/feeds/api/videos/dQw4w9WgXcQ?prettyprint=true And the excerpt of code I don't know how to retrieve data from: <media:group> <media:description type='plain'>Music video by Rick Astley performing Never Gonna Give You Up. (C) 1987 PWL</media:description> </media:group> Thanks in advance.

    Read the article

  • Jquery hover function doesn't work for a table...

    - by chandru_cp
    I dynamically added rows to a table but it doesn't seem to take hover effects given in jquery... Here is my code, <table id="chkbox" cellpadding="0" cellspacing="2" width="100%" class="table_Style_Border"> <tr> <td style="width:150px" class="grid_header" align="center">RackName</td> <td style="width:150px" class="grid_header" align="center">LibraryName</td> <td style="width:200px" class="grid_header" align="center">LibrarianName</td> <td style="width:200px" class="grid_header" align="center">Location</td> <td style="width:1%" class="grid_header"></td> </tr> <? if(isset($comment)) { echo '<tr><td class=table_label colspan=5>'.$comment.'</td></tr>'; } ?> <?php foreach($rackData as $key => $row) { ?> <?php printf('<tr class="%s">', ($key % 2) ? 'rowcolor' : 'alternaterowcolor'); ?> <td align="left" class="table_label"> <?=$row['rack_name']?> </td> <td align="left" class="table_label"> <?=$row['library_name']?> </td> <td align="center" class="table_label"> <?=$row['librarian']?> </td> <td align="center" class="table_label"> <?=$row['location']?> </td> <td align="center"> <input type="checkbox" name="group" id="group" value="<?=$row['rack_id']?>" onclick="display(this);" > </td> </tr> <? } ?> </table><div align="right" class="pagination"> <?php /*?><?php echo $links;?><?php */?></div> <script type="text/javascript"> $("#chkbox").hover(function() { $(this).addClass("resultshover"); }, function() { $(this).removeClass("resultshover"); }); </script>

    Read the article

  • change Magento to new server, images of existing product do not shown in frontend

    - by forrest gump
    I have moved a Magento website to a new server to optimize speed. All images appear to be replaced by image placeholders. I tried to set permission for media to 777, when I delete cache media folder and refresh, a new cache folder is created automatically, but only with placeholder images inside. I flushed image cache, reindex in magento backend but still no hope. What should I do now? Somethings might be helpful: . It's fine to create new product with images . Flush cache, only placeholders images are created . tried to use magento-cleanup.php, no hope . tried to remove .htaccess in media folder . the images of products are there in the media folder, just not in cache folder. Magento only looks at the cache folder for image :(

    Read the article

  • A case-insensitive related implementation problem

    - by Robert
    Hi All, I am going through a final refinement posted by the client, which needs me to do a case-insesitive query. I will basically walk through how this simple program works. First of all, in my Java class, I did a fairly simple webpage parsing: title=(String)results.get("title"); doc = docBuilder.parse("http://" + server + ":" + port + "/exist/rest/db/wb/xql/media_lookup.xql?" + "&title=" + title); This Java statement references an XQuery file "media_lookup.xql" which is stored on localhost, and the only parameter we are passing is the string "title". Secondly, let's take at look at that XQuery file: $title := request:get-parameter('title',""), $mediaNodes := doc('/db/wb/portfolio/media_data.xml'), $query := $mediaNodes//media[contains(title,$title)], Then it will evaluate that query. This XQuery will get the "title" parameter that are passes from our Java class, and query the "media_data" xml file stored in the database, which contains a bunch of media nodes with a 'title' element node. As you may expect, this simple query will just match those media nodes whose 'title' element contains a substring of what the value of string 'title' is. So if our 'title' is "Chi", it will return media nodes whose title may be "Chicago" or "Chicken". The refinment request posted by the client is that there should be NO case-sensitivity. The very intuitive way is to modify the XQuery statement by using a lower-case funtion in it, like: $query := $mediaNodes//media[contains(lower-case(title/text(),lower-case($title))], However, the question comes: this modified query will run my machine into memory overflow. Since my "media_data.xml" is quite huge and contains thouands of millions of media nodes, I assume the lower-case() function will run on each of the entries, thus causing the machine to crash. I've talked with some experienced XQuery programmer, and they think I should use an index to solve this problem, and I will definitely research into that. But before that, I am just posting this problem here to get other ideas or any suggestions, do you think any other way may help? for example, could I tweak the Java parse statement to realize the case-insensitivity? Since I think I saw some people did some string concatination by using "contains." in Java before passing it to the server. Any idea or help is welcomed, thanks in advance.

    Read the article

  • Streaming video using realnetwork helix

    - by aspdotnetjunkie
    Hi all and thanks in advance. I'm new to streaming media. I've just signed up for streaming services from gate.com for my website. They provided me with the following info. It says it's provided by realnetwork Helix This is all they gave me, with no instructions of how to do it. UN:media.mydomain.com Password:xxxxxx Hostname: rtsp://media.mydomain.com:554/media.mydomain.com/FileName.rm Questions: How do I upload videos to my new account? Can I play them using flash player? Thank you,

    Read the article

  • Android list all images available

    - by Javadid
    hi friends, I m making an application which requires me to list all the images available on the SD-Card of the phone. i tried querying the ContentResolver way i.e. Cursor image = getContentResolver().query(Images.Media.EXTERNAL_CONTENT_URI, new String[]{Images.Media._ID,Images.Media.DATA,Images.Media.DISPLAY_NAME}, null, null, null); but without any result. Is there any way i can get the list or if thats not possible then is there any possible intent (e.g. PICK) by which i can allow the user to select a file and then access the path of the file the user selected?? Helppppp guys...

    Read the article

  • How to set alternate row color for an iterated table in php?

    - by chandru_cp
    I am using php and i am iterating a table with a result array ... I want to add row color and alternate row color to it.... How to do so? Any suggestion... <table id="chkbox" cellpadding="0" cellspacing="2" width="100%" class="table_Style_Border"> <tr> <td style="width:150px" class="grid_header" align="center">RackName</td> <td style="width:150px" class="grid_header" align="center">LibraryName</td> <td style="width:200px" class="grid_header" align="center">LibrarianName</td> <td style="width:200px" class="grid_header" align="center">Location</td> <td style="width:1%" class="grid_header"></td> </tr> <? if(isset($comment)) { echo '<tr> <td class=table_label colspan=5>'.$comment.'</td></tr>'; } ?> <?php foreach($rackData as $row) { ?> <tr> <td align="left" class="table_label"> <?=$row['rack_name']?> </td> <td align="left" class="table_label"> <?=$row['library_name']?> </td> <td align="center" class="table_label"> <?=$row['librarian']?> </td> <td align="center" class="table_label"> <?=$row['location']?> </td> <td align="center"> <input type="checkbox" name="group" id="group" value="<?=$row['rack_id']?>" onclick="display(this);" > </td> </tr> <? } ?> <table>

    Read the article

  • How to release audio properly? (AVAudioPlayer)

    - by Aluminum
    Hello everyone! I need help with my iOS application ^^,. I want to know if I'm releasing AVAudioPlayer correctly. MyViewController.h #import <UIKit/UIKit.h> @interface MyViewController : UIViewController { NSString *Path; } - (IBAction)Playsound; @end MyViewController.m #import <AVFoundation/AVAudioPlayer.h> #import "MyViewController.h" @implementation MyViewController AVAudioPlayer *Media; - (IBAction)Playsound { Path = [[NSBundle mainBundle] pathForResource:@"Sound" ofType:@"wav"]; Media = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:Path] error:NULL]; [Media play]; } - (void)dealloc { [Media release]; [super viewDidUnload]; } @end

    Read the article

  • driver.findElement() with iframe and elements without ID

    - by user1864657
    Java Code: driver.switchTo().frame(0); WebElement elemText = driver.findElement(By.xpath("/html/body[contains(@class='forum')]")); //WebElement elemText = driver.findElement(By.xpath("//td[@id='cke_contents_vB_Editor_001_editor']/textarea")); elemText.sendKeys(message); elemText.submit(); forumLink = driver.getCurrentUrl(); HTML Code: <td id="cke_contents_vB_Editor_001_editor" class="cke_contents" style="height:1726px" role="presentation"> <iframe style="width:100%;height:100%" frameborder="0" title="Rich text editor, vB_Editor_001_editor, press ALT 0 for help." src="" tabindex="-1" allowtransparency="true"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="ltr" lang="en" contenteditable="true"> <head> <title data-cke-title="Rich text editor, vB_Editor_001_editor, press ALT 0 for help.">Rich text editor, vB_Editor_001_editor, press ALT 0 for help.</title> <base href="http://fairplay.garena.com/" data-cke-temp="1"> <link type="text/css" rel="stylesheet" href="http://fairplay.garena.com/clientscript/vbulletin_css/style00008l/editor_contents.css"> <style type="text/css" data-cke-temp="1"> form{border: 1px dotted #FF0000;padding: 2px;} img.cke_hidden{background-image: url(http://fairplay.garena.com/clientscript/ckeditor/plugins/forms/images/hiddenfield.gif?t=B37D54V);background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;} img.cke_iframe{background-image: url(http://fairplay.garena.com/clientscript/ckeditor/plugins/iframe/images/placeholder.png?t=B37D54V);background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;} img.cke_anchor{background-image: url(http://fairplay.garena.com/clientscript/ckeplugins/vblink/images/anchor.gif?t=B37D54V);background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 18px !important;height: 18px !important;} a.cke_anchor{background-image: url(http://fairplay.garena.com/clientscript/ckeplugins/vblink/images/anchor.gif?t=B37D54V);background-position: left center;background-repeat: no-repeat;border: 1px solid #a9a9a9;padding-left: 18px;} </style> </head> <body class="forum" spellcheck="true"> </body> </html> </iframe> </td> Image: http://s9.postimage.org/nwyvq3san/Screen_Shot038.jpg I can't find a way to get elements inside a iframe and without id. Can you help me?

    Read the article

  • Finding files with bash and copy to another location and reducing depth of folders

    - by Kevin F
    I'm trying to recover a mates hard drive, there is no structure what so ever so music and images are everywhere but in named folders sometimes 5 folders deep, I've managed to write a one-liner that finds the files and copies them to a mounted drive but it preserves the file structure completely. What I'm after is a bit of code that searches the drive and copies to another location and copies just the parent folder with the mp3/jpg files within and not the complete path. The other issue I have is the music is /folder/folder/folder/Artist/1.mp3..2.mp3..10.mp3 etc etc so I have to preserve the folder 'Artist' to give him any hope of finding his tracks again. What I have working currently: find /media/HP/ -name *.mp3 -fprintf /media/HP/MUSIC/Script.sh 'mkdir -p "/media/HP/MUSIC/%h" \n cp "%h/%f" "/media/HP/MUSIC/%h/"\n' I then run the script.sh and it does all the copying. Many Thanks

    Read the article

  • ThickBox - update inside without redirect

    - by Alex Maslakov
    ASP.NET MVC and jQuery ThickBox. I show some content in ThickBox. It includes file upload form The view multi-media.apsx (it's strange, the this editor doesn't allow start the line with "<" in the code) form action="/upload/multi-media" method="post" enctype="multipart/form-data" label for="file"File name: input type="file" name="file" id="file" / input type="submit" value="Upload" / <% if (Model.Count > 0) { foreach (FileInfo mediaFile in Model) { <img width="100px" height="100px" src="<%: ResolveUrl("~/audio.png") %>" border="0" alt="<%: mediaFile.Name %>" / //................ After file upload I redirect to /upload/multi-media action and content shows in normal window, not in ThickBox. [ActionName("multi-media"), HttpPost] public ActionResult MultiMedia(HttpPostedFileBase file) { if (file.ContentLength > 0) { file.SaveAs(GenerateNewFileName(fullFileName)); return View("multi-media", model); } } How can I stay into ThickBox after file upload? I need show content in ThickBox all the time, even after the file upload.

    Read the article

  • C# XNA Handle mouse events?

    - by user406470
    I'm making a 2D game engine called Clixel over on GitHub. The problem I have relates to two classes, ClxMouse and ClxButton. In it I have a mouse class - the code for that can be viewed here. ClxMouse using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; namespace org.clixel { public class ClxMouse : ClxSprite { private MouseState _curmouse, _lastmouse; public int Sensitivity = 3; public bool Lock = true; public Vector2 Change { get { return new Vector2(_curmouse.X - _lastmouse.X, _curmouse.Y - _lastmouse.Y); } } private int _scrollwheel; public int ScrollWheel { get { return _scrollwheel; } } public bool LeftDown { get { if (_curmouse.LeftButton == ButtonState.Pressed) return true; else return false; } } public bool RightDown { get { if (_curmouse.RightButton == ButtonState.Pressed) return true; else return false; } } public bool MiddleDown { get { if (_curmouse.MiddleButton == ButtonState.Pressed) return true; else return false; } } public bool LeftPressed { get { if (_curmouse.LeftButton == ButtonState.Pressed && _lastmouse.LeftButton == ButtonState.Released) return true; else return false; } } public bool RightPressed { get { if (_curmouse.RightButton == ButtonState.Pressed && _lastmouse.RightButton == ButtonState.Released) return true; else return false; } } public bool MiddlePressed { get { if (_curmouse.MiddleButton == ButtonState.Pressed && _lastmouse.MiddleButton == ButtonState.Released) return true; else return false; } } public bool LeftReleased { get { if (_curmouse.LeftButton == ButtonState.Released && _lastmouse.LeftButton == ButtonState.Pressed) return true; else return false; } } public bool RightReleased { get { if (_curmouse.RightButton == ButtonState.Released && _lastmouse.RightButton == ButtonState.Pressed) return true; else return false; } } public bool MiddleReleased { get { if (_curmouse.MiddleButton == ButtonState.Released && _lastmouse.MiddleButton == ButtonState.Pressed) return true; else return false; } } public MouseState CurMouse { get { return _curmouse; } } public MouseState LastMouse { get { return _lastmouse; } } public ClxMouse() : base(ClxG.Textures.Default.Cursor) { _curmouse = Mouse.GetState(); _lastmouse = _curmouse; CollisionBox = new Rectangle(ClxG.Screen.Center.X, ClxG.Screen.Center.Y, Texture.Width, Texture.Height); this.Solid = false; DefaultPosition = new Vector2(CollisionBox.X, CollisionBox.Y); Mouse.SetPosition(CollisionBox.X, CollisionBox.Y); } public ClxMouse(Texture2D _texture) : base(_texture) { _curmouse = Mouse.GetState(); _lastmouse = _curmouse; CollisionBox = new Rectangle(ClxG.Screen.Center.X, ClxG.Screen.Center.Y, Texture.Width, Texture.Height); DefaultPosition = new Vector2(CollisionBox.X, CollisionBox.Y); } public override void Update() { _lastmouse = _curmouse; _curmouse = Mouse.GetState(); if (_curmouse != _lastmouse) { if (ClxG.Game.IsActive) { _scrollwheel = _curmouse.ScrollWheelValue; Velocity = new Vector2(Change.X / Sensitivity, Change.Y / Sensitivity); if (Lock) Mouse.SetPosition(ClxG.Screen.Center.X, ClxG.Screen.Center.Y); _curmouse = Mouse.GetState(); } base.Update(); } } public override void Draw(SpriteBatch _sb) { base.Draw(_sb); } } } ClxButton using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace org.clixel { public class ClxButton : ClxSprite { /// <summary> /// The color when the mouse is over the button /// </summary> public Color HoverColor; /// <summary> /// The color when the color is being clicked /// </summary> public Color ClickColor; /// <summary> /// The color when the button is inactive /// </summary> public Color InactiveColor; /// <summary> /// The color when the button is active /// </summary> public Color ActiveColor; /// <summary> /// The color after the button has been clicked. /// </summary> public Color ClickedColor; /// <summary> /// The text to be displayed on the button, set to "" if no text is needed. /// </summary> public string Text; /// <summary> /// The ClxText object to be displayed. /// </summary> public ClxText TextRender; /// <summary> /// The ClxState that should be ResetAndShow() when the button is clicked. /// </summary> public ClxState ClickState; /// <summary> /// Collision check to make sure onCollide() only runs once per frame, /// since only the mouse needs to be collision checked. /// </summary> private bool _runonce = false; /// <summary> /// Gets a value indicating whether this instance is colliding. /// </summary> /// <value> /// <c>true</c> if this instance is colliding; otherwise, <c>false</c>. /// </value> public bool IsColliding { get { return _runonce; } } /// <summary> /// Initializes a new instance of the <see cref="ClxButton"/> class. /// </summary> public ClxButton() : base(ClxG.Textures.Default.Button) { HoverColor = Color.Red; ClickColor = Color.Blue; InactiveColor = Color.Gray; ActiveColor = Color.White; ClickedColor = Color.Yellow; Text = Name + ID + " Unset!"; TextRender = new ClxText(); TextRender.Text = Text; TextRender.TextPadding = new Vector2(5, 5); ClickState = null; CollideObjects(ClxG.Mouse); } /// <summary> /// Initializes a new instance of the <see cref="ClxButton"/> class. /// </summary> /// <param name="_texture">The button texture.</param> public ClxButton(Texture2D _texture) : base(_texture) { HoverColor = Color.Red; ClickColor = Color.Blue; InactiveColor = Color.Gray; ActiveColor = Color.White; ClickedColor = Color.Yellow; Texture = _texture; Text = Name + ID; TextRender = new ClxText(); TextRender.Name = this.Name + ".TextRender"; TextRender.Text = Text; TextRender.TextPadding = new Vector2(5, 5); TextRender.Reset(); ClickState = null; CollideObjects(ClxG.Mouse); } /// <summary> /// Draws the debug information, run from ClxG.DrawDebug unless manual control is assumed. /// </summary> /// <param name="_sb">SpriteBatch used for drawing.</param> public override void DrawDebug(SpriteBatch _sb) { _runonce = false; TextRender.DrawDebug(_sb); _sb.Draw(Texture, ActualRectangle, new Rectangle(0, 0, Texture.Width, Texture.Height), DebugColor, Rotation, Origin, Flip, Layer); _sb.Draw(ClxG.Textures.Default.DebugBG, new Rectangle(ActualRectangle.X - DebugLineWidth, ActualRectangle.Y - DebugLineWidth, ActualRectangle.Width + DebugLineWidth * 2, ActualRectangle.Height + DebugLineWidth * 2), new Rectangle(0, 0, ClxG.Textures.Default.DebugBG.Width, ClxG.Textures.Default.DebugBG.Height), DebugOutline, Rotation, Origin, Flip, Layer - 0.1f); _sb.Draw(ClxG.Textures.Default.DebugBG, ActualRectangle, new Rectangle(0, 0, ClxG.Textures.Default.DebugBG.Width, ClxG.Textures.Default.DebugBG.Height), DebugBGColor, Rotation, Origin, Flip, Layer - 0.01f); } /// <summary> /// Draws using the SpriteBatch, run from ClxG.Draw unless manual control is assumed. /// </summary> /// <param name="_sb">SpriteBatch used for drawing.</param> public override void Draw(SpriteBatch _sb) { _runonce = false; TextRender.Draw(_sb); if (Visible) if (Debug) { DrawDebug(_sb); } else _sb.Draw(Texture, ActualRectangle, new Rectangle(0, 0, Texture.Width, Texture.Height), Color, Rotation, Origin, Flip, Layer); } /// <summary> /// Updates this instance. /// </summary> public override void Update() { if (this.Color != ActiveColor) this.Color = ActiveColor; TextRender.Layer = this.Layer + 0.03f; TextRender.Text = Text; TextRender.Scale = .5f; TextRender.Name = this.Name + ".TextRender"; TextRender.Origin = new Vector2(TextRender.CollisionBox.Center.X, TextRender.CollisionBox.Center.Y); TextRender.Center(this); TextRender.Update(); this.CollisionBox.Width = (int)(TextRender.CollisionBox.Width * TextRender.Scale) + (int)(TextRender.TextPadding.X * 2); this.CollisionBox.Height = (int)(TextRender.CollisionBox.Height * TextRender.Scale) + (int)(TextRender.TextPadding.Y * 2); base.Update(); } /// <summary> /// Collide event, takes the colliding object to call it's proper collision code. /// You'd want to use something like if(typeof(collider) == typeof(ClxObject) /// </summary> /// <param name="collider">The colliding object.</param> public override void onCollide(ClxObject collider) { if (!_runonce) { _runonce = true; UpdateEvents(); base.onCollide(collider); } } /// <summary> /// Updates the mouse based events. /// </summary> public void UpdateEvents() { onHover(); if (ClxG.Mouse.LeftReleased) { onLeftReleased(); return; } if (ClxG.Mouse.RightReleased) { onRightReleased(); return; } if (ClxG.Mouse.MiddleReleased) { onMiddleReleased(); return; } if (ClxG.Mouse.LeftPressed) { onLeftClicked(); return; } if (ClxG.Mouse.RightPressed) { onRightClicked(); return; } if (ClxG.Mouse.MiddlePressed) { onMiddleClicked(); return; } if (ClxG.Mouse.LeftDown) { onLeftClick(); return; } if (ClxG.Mouse.RightDown) { onRightClick(); return; } if (ClxG.Mouse.MiddleDown) { onMiddleClick(); return; } } /// <summary> /// Shows the state of the click. /// </summary> public void ShowClickState() { if (ClickState != null) { ClickState.ResetAndShow(); } } /// <summary> /// Hover event /// </summary> virtual public void onHover() { this.Color = HoverColor; } /// <summary> /// Left click event /// </summary> virtual public void onLeftClick() { this.Color = ClickColor; } /// <summary> /// Right click event /// </summary> virtual public void onRightClick() { } /// <summary> /// Middle click event /// </summary> virtual public void onMiddleClick() { } /// <summary> /// Left click event, called once per click /// </summary> virtual public void onLeftClicked() { ShowClickState(); } /// <summary> /// Right click event, called once per click /// </summary> virtual public void onRightClicked() { this.Reset(); } /// <summary> /// Middle click event, called once per click /// </summary> virtual public void onMiddleClicked() { } /// <summary> /// Ons the left released. /// </summary> virtual public void onLeftReleased() { this.Color = ClickedColor; } virtual public void onRightReleased() { } virtual public void onMiddleReleased() { } } } The issue I have is that I have all these have event styled methods, especially in ClxButton with all the onLeftClick, onRightClick, etc, etc. Is there a better way for me to handle these events to be a lot more easier for a programmer to use? I was looking at normal events on some other sites, (I'd post them but I need more rep.) and didn't really see a good way to implement delegate events into my framework. I'm not really sure how these events work, could someone possibly lay out how these events are processed for me? TL:DR * Is there a better way to handle events like this? * Are events a viable solution to this problem? Thanks in advance for any help.

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >