Search Results

Search found 3309 results on 133 pages for 'relative positioning'.

Page 90/133 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • How to save an image in it's original format?

    - by Patrick Klug
    I am trying to figure out how I can get the original format of an image so that I can store it with the same encoding. It seems that the only way to save an Image is by using a BitmapEncoder but I don't know how I can get the correct format from the image. Example: Clipboard.GetImage() returns a InteropBitmap which doesn't seem to contain any information about the original format. I also tried using an Extension method: public static void Save(this BitmapImage image, System.IO.Stream stream) { var decoder = BitmapDecoder.Create(image.StreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); var encoder = BitmapEncoder.Create(decoder.CodecInfo.ContainerFormat); foreach (var frame in decoder.Frames) { encoder.Frames.Add(BitmapFrame.Create(decoder.Frames[0])); } encoder.Save(stream); } but the problem is that a) the ImageSource is not always a BitmapImage (Clipboard.GetImage()) for example and b) the image.StreamSource can be null in some cases (seems to be when the image is loaded via a relative Uri)

    Read the article

  • how do i use htaccess to make http requests work properly

    - by Gabriel
    I currently have css and javascript file calls (amongst other things) like the following: href="/css/default.css" src="/js/ui_control.js" putting the preceding / in to make the files relative to the root. This works great when my page is in the root of the domain. However, I'm currently in the middle of transferring my site to a new hosting provider and as such have a temporary URL which is: HOST-IP/~username As such, all file calls are trying to be called from HOST-IP/css/default.css etc instead of within the ~username sub-folder. Of course I can wait until the domain name servers propagate but that's beside the point. How would I go about writing a rule in the .htaccess file that would redirect all file calls that start with a /, from going to HOST-IP/FILE-CALL, and instead to go to HOST-IP/~USERNAME/FILE-CALL. ? Any ideas?

    Read the article

  • silverlight adding single prism command delegate to a list of items in xaml

    - by bobwah
    I'm building a menu using Prism (using a trtelerik tree view with hierarchy data templates but hopefully the details don't matter) and I'm trying to set up a Click.Command on each menu items bindings that will all call the same delegate command which is defined in the view model. The menu is built up out of items which I don't really want to put any references to the command in. How do I bind the command to each of these items in xaml? I've looked around and it looks like in WPF I could use a relative source binding and find ancestors but there doesn't seem to be a way of doing this in silverlight. Can I setup the delegate as a static resource somehow? I don't think I can create a static resource to the view model as this uses Unity to resolve paramters to it's constructor.

    Read the article

  • Access files (.wav) in java package

    - by Highmastdon
    I want to access my .wav files which are in a package inside my project. For example I got two packages: package program package sounds From inside the program/something.class I'd like to play the sounds/asound.wav. How is this possible. clip.open(AudioSystem.getAudioInputStream(new File(filename))); clip.start(); //.... something inbetween clip.stop(); Here filename is C:\\projects\\something\\sounds\\, but how is it possible to just give a relative path to the asound.wav in the package?

    Read the article

  • Stable separation for two classes of elements in an array

    - by AndreyT
    Consider the following problem. We are given an array of elements belonging to one two classes: either red or blue. We have to rearrange the elements of the array so that all blue elements come first (and all red elements follow). The rearrangement must be done is stable fashion, meaning that the relative order of blue elements must be preserved (same for red ones). Is there a clever algorithm that would perform the above rearrangement in-place? A non-in place solution is, of course, straightforward. An obvious in-place solution would be to apply any stable sorting algorithm to the array. However, using a full-fledged sorting algorithm on an array intuitively feels like an overkill, especially taking into account the fact that we are only dealing with two classes of elements. Any ideas greatly appreciated.

    Read the article

  • Where does the compiler store methods for C++ classes?

    - by Mashmagar
    This is more a curiosity than anything else... Suppose I have a C++ class Kitty as follows: class Kitty { void Meow() { //Do stuff } } Does the compiler place the code for Meow() in every instance of Kitty? Obviously repeating the same code everywhere requires more memory. But on the other hand, branching to a relative location in nearby memory requires fewer assembly instructions than branching to an absolute location in memory on modern processors, so this is potentially faster. I suppose this is an implementation detail, so different compilers may perform differently. Keep in mind, I'm not considering static or virtual methods here.

    Read the article

  • How can I link in both remote and local assets into a webview?

    - by Greg
    I'm loading HTML-formatted content into my app from a web service, then plugging that into a local HTML template that lives within the app. Now, I need to set the UIWebView's BaseURL to point at the remote server so that all relative image links will load. However, I'm also trying to link in some local assets (CSS, JavaScript). Thus far, I have not found any documentation on how to link in local assets without relying on the UIWebView's baseURL. I've tried injecting the absolute file path of my CSS and JS into my HTML template, but it hasn't worked... I don't know if that means that it doesn't work, or if I'm just doing it wrong. Has anyone ever run into this scenario, and if so, how did you address it? Thanks in advance, I really appreciate any tips!

    Read the article

  • in-place permutation of a array follows this rule

    - by Mgccl
    Suppose there is an array, we want to find everything in the odd index, and move it to the end. Everything in the even index move it to the beginning. The relative order of all odd index items and all even index items are preserved. Suppose the values of the array, a[i] = i, n is even. Then we have. 0,1,2,3,4,5,...,n-1 after the operation 0,2,4,6,...,n-2,1,3,5,7,...,n-1 Can this be done in-place and in O(n) time?

    Read the article

  • Tying in .addClass() with other functions?

    - by Anders H
    Assuming an accordion dropdown with the standard form of: <ul> <li> <a href="#">Main Element</a> <ul> <li> <a href="#">Dropdown Element</a> </li> </ul> </li> </ul> I'm using jQuery to expand when the parent element link is clicked: var $j = jQuery.noConflict(); function initMenus() { $j('ul.menu ul').hide(); $j.each($j('ul.menu'), function(){ $j('#' + this.id + '.expandfirst ul:first').show(); }); $j('ul.menu li a').click( function() { var checkElement = $j(this).next(); var parent = this.parentNode.parentNode.id; if($j('#' + parent).hasClass('noaccordion')) { $j(this).next().slideToggle('normal'); return false; } if((checkElement.is('ul')) && (checkElement.is(':visible'))) { if($j('#' + parent).hasClass('collapsible')) { $j('#' + parent + ' ul:visible').slideUp('normal'); } return false; } if((checkElement.is('ul')) && (!checkElement.is(':visible'))) { $j('#' + parent + ' ul:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; } } ); } $j(document).ready(function() {initMenus();}); To add a class to the Main Element when clicked (aka the class is enabled anytime the dropdown is expanded) I'm trying to use .toggleClass(className) without luck, most likely to my positioning. Where can I add this element to get the desired effect?

    Read the article

  • How do i get file path of my file in java enterprise application?

    - by Nitesh Panchal
    Hello, I created java enterprise application and it consists of ejb module and web application. I have plain old xml file in source packages folder in package "common" in my ejb module. I want to pass this file path in File() constructor for one class in ejb module. How do i do it? If i pass any of the below it doesn't work :- new File("abc.xml"); //this take file from glassfish/domains/domain1 :( new File("./abc.xml"); I don't want to pass hardcode path like /home/administrator/appname/module/etc.. I want the path relative from my ejb module. Please help me. I've tried all things. Actually when i created a class in same folder and then try classname.getResource("abc.xml").getPath() it works fine. But what if i don't have any class in that folder. Waiting for your replies

    Read the article

  • Which data structure(s) to back a Final Fantasy ATB-style queue? (a delay queue)

    - by ZoFreX
    Situation: There are several entities in a simulated environment, which has an artificial notion of time called "ticks", which has no link to real time. Each entity takes it in turns to move, but some are faster than others. This is expressed by a delay, in ticks. So entity A might have a delay of 10, and B 25. In this case the turn order would go: A A B A A I'm wondering what data structure to use. At first I automatically thought "priority queue" but the delays are relative to "current time" which complicates matters. Also, there will be entities with larger delays and it's not unforseeable that the program will run through millions of ticks. It seems silly for an internal counter to be building higher and higher when the delays themselves stay relatively small and don't increase. So how would you solve this?

    Read the article

  • Google maps z-index problem in IE

    - by Bas van de Lustgraaf
    I'm loading my google maps into div class="extra" style="display: none;" /. As soon as the AJAX request is complete, the map_canvas div is placed inside the hidden div and the hidden div will be vissible with the toggleDown jquery effect. In FF it's working perfect, but in IE the Google maps (map_canvas div) is already visible before the toggleDown effect is started. I think the z-index and the relative position of the map_canvas div wich is loaded into the hidden div will place the map_canvas div on top of the hidden div. What do i have to change to make sure the map_canvas div is not on top of the hidden div? While toggleDown in FF: http:// img169.imageshack.us/img169/9274/50485429.jpg While toggleDown in IE: http://img188.imageshack.us/img188/2110/93959677.jpg

    Read the article

  • How can I navigate through xaml pages with Monogame in a Windows Phone 8 project?

    - by misiMe
    I finished to develop an XNA game, then I created the Monogame project, and tested it on my device. Now I made some other pages such as an "about" page. How can I go to that page considering I have a Monogame project and just an XNA code? In particular inside my game I made a Main Menu where you can click the "about" button and know if someone has clicked: how can I link that event to the "go to about.xaml" function? Inside XNA, update method: if (about_button.IsClicked()) { // Go to about.xaml } I tried: if (about_button.IsClicked()) { ((PhoneApplicationFrame)Application.Current.RootVisual).Navigate(new Uri("/About.xaml", UriKind.Relative)); } But it throws: System.UnauthorizedAccessException

    Read the article

  • JApplet behaving unexpectedly

    - by JohnW
    import java.awt.Graphics; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JApplet; import javax.swing.Timer; public class CountingSheep extends JApplet { private Image sheepImage; private Image backgroundImage; private GameBoard gameBoard; private scoreBoard scoreBoard; public void init() { loadImages(); gameBoard = new GameBoard(sheepImage, backgroundImage); scoreBoard = new scoreBoard(); getContentPane().add(gameBoard); getContentPane().add(scoreBoard); } public void loadImages() { sheepImage = getImage(getDocumentBase(), "sheep.png"); backgroundImage = getImage(getDocumentBase(), "bg.jpg"); } } Update guys: Alright, first of all, thank you very much for all the help you've given so far (specifically creemam and Hovercraft Full of Eels), and your persistence. You've helped me out a lot as this is incredibly important (i.e. me passing my degree). The problem now is: The program works correctly when nothing but the GameBoard class is added to the JApplet, however, when I try to add the ScoreBoard class, both Panel classes do not show on the Applet. I'm guessing this is now down to positioning? Any ideas? EDIT: Gone back to the previously asked question Hovercraft, and found it was due to the layout of the contentPane and the order at with the components were added. Thanks to all of you so much. People like you make the development community a bit of alright.

    Read the article

  • How to detect what allowed character in current Regular Expression by using JavaScript?

    - by Soul_Master
    In my web application, I create some framework that use to bind model data to control on page. Each model property has some rule like string length, not null and regular expression. Before submit page, framework validate any binded control with defined rules. So, I want to detect what character that is allowed in each regular expression rule like the following example. "^[0-9]$" allow only digit characters like 1, 2, 3. "^[a-zA-Z_][a-zA-Z_-0-9]+$" allow only a-z, - and _ characters However, this function should not care about grouping, positioning of allowed character. It just tells about possible characters only. By the way, complex regular expression like find two words near(\bword1\W+(?:\w+\W+){1,6}?word2\b) must be ignore to verify and it should return any characters is possible. Do you have any idea for creating this function? PS. I know it easy to create specified function like numeric only for allowing only digit characters. But I need share/reuse same piece of code both data tier(contains all model validator) and UI tier without modify anything. Thanks

    Read the article

  • CSS horizontal scrolling overflow with jQuery slider

    - by Jeffrey
    I'm trying to setup a full screen jquery slider. I've broken the project into two steps 1) css and 2) js. 1) CSS, below is a picture of what I'm shooting for (no fixed height) and below that is the code I have so far that doesn't work. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <style type="text/css"> /* Positioning */ #container { width: 2500px; } .block { display: inline; } /* Styling */ .block img { padding: 5px; } </style> </head> <body> <div id="container"> <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div> <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div> <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div> </div> </body> </html> 2) Javascript, using jquery I'd like the divs to slide left when clicked on them... like the jQuery Coda Slider if possible. Thanks, any help is appreciated.

    Read the article

  • cocoa - referencing a method on the parent

    - by Mike
    I had a method on my main view controller named "calculateThis". This method was run, obviously, as int newValue = [self calculateThis:myVariable]; when I run it from inside the view controller. Then I created a static class and I need to run this method from there. How do I reference this method from that class using just relative references, as super, superview, delegate, etc. I cannot use the class name defined on the delegate because this static class is used in several apps of mine.

    Read the article

  • How do I prevent an https response from throwing an AuthenticationException with Fiddler running?

    - by Ichabod Clay
    Relative newbie to C# here :) I'm currently creating a web link scraper and having issues with the responses I'm getting when trying to login to the website via my program. I'm trying to use Fiddler to see if my program is sending the proper data, but my program is throwing an AuthenticationException when trying to get a response from the site with Fiddler running. The requests are being sent over HTTPS and Fiddler's certificate is the cause of the excepting being thrown. My question is, what can I implement into my program to have it disregard the certificate authentication? As far as my program goes, the requests and responses are being handled by HttpWebRequest and HttpWebResponse classes.

    Read the article

  • jQuery create new div with ID?

    - by John
    Hello, I have form in my ASP.NET masterPage.master and if i click on submit it call some method from masterPage.master.cs file by ajax (i have it in update panel). But i want improve it with jQuery. So i have this: $('#submit').click(function () { $.ajax({ type: "POST", url: '<% Response.Write("~"+Request.Path); %>', beforeSend: function () { $(document.createElement('div')).width($('#formBox').width()) .height($('#formBox').height()) .css({ backgroundImage: 'url(/Static/Img/bc_overlay.png)', position: 'absolute', left: 0, top: 0, margin: "5px", textAlign: "center", color: "#000", display: "none" }) .append("<strong>Nacítám</strong><br /><img src='Static/Img/ajax-loader.gif' width='33px' height='33px' alt='loading' />") .fadeIn("slow") .prependTo($('#formBox')); $('#formBox').css('position', 'relative'); }, success: function () { } }); }); So if i click on submit, new div is creating (there is loading text and image, and cool opacity overlay), but how i give to this div some ID? Because i need use it in success: function () { } i need clear this box and write here some text (error or success).

    Read the article

  • How should I think about perspectives and rotation in OpenGL ES?

    - by Omega
    As I start to write rendering code, how do I want to consider my drawing operations? Will they always be relative to a fixed coordinate system on the screen, or does this change based on the camera perspective? The best example I can try to come up with is say I'm at (0,0,0) and I draw a line to (3,3,3). If I change the perspective +1 on the X axis and conduct the same operation, does it happen at (4,3,3), or am I just getting a new view of the line still being made at (3,3,3)? When doing rotation, am I moving the point from which a frustum emanates, or am I moving the rendering underneath?

    Read the article

  • Why do debug symbols so adversely affect the performance of threaded applications on Linux?

    - by fluffels
    Hi. I'm writing a ray tracer. Recently, I added threading to the program to exploit the additional cores on my i5 Quad Core. In a weird turn of events the debug version of the application is now running slower, but the optimized build is running faster than before I added threading. I'm passing the "-g -pg" flags to gcc for the debug build and the "-O3" flag for the optimized build. Host system: Ubuntu Linux 10.4 AMD64. I know that debug symbols add significant overhead to the program, but the relative performance has always been maintained. I.e. a faster algorithm will always run faster in both debug and optimization builds. Any idea why I'm seeing this behavior?

    Read the article

  • Why are changes to classes ignored after dom changes?

    - by Lg102
    I have a price grid that uses relative positioning to move a field around, beneath a box with: overflow: hidden;. In this is field, there are absolute-positioned boxes containing prices. When this box is hovered, the matching values above and left of the will change color. In order to achieve this, a class is toggled using jQuery. This initially works. However, after the grid is moved, the class change doesn't affect the block above the grid anymore. In the Chrome console, i can see the class being added, but it's css-styling isn't applied. No other styles for the element have changed. I am 100% sure there is no other style-rule influencing the element, it just stops responding to the change in class after the DOM has been altered. Can i 'refresh' the DOM somehow? Edit: I've tried to get the relevant code only: Adding the cell in the first place: $("#price_dates_cells").append("<div id='"+weekday[theBeginDate.getDay()]+"-"+theBeginDate.getDate()+"-"+(theBeginDate.getMonth()-1)+"' class='datecell' style='left: "+( Math.floor( difference / ( 3600 * 24 * 1000) ) * ( cellwidth ) )+"px'>"+weekday[theBeginDate.getDay()]+"<br>"+theBeginDate.getDate()+" "+yearmonth[theBeginDate.getMonth()]+"</div>"); Toggle the class: var str_element = "#"+weekday[Bdate.getDay()]+"-"+Bdate.getDate()+"-"+(Bdate.getMonth()-1); $(str_element).toggleClass("red"); and the movement that seems to cause the problem: $('#price_grid').animate({"top": (( ( horizontalMovement ) * cellheight)) }, 'fast', 'linear');

    Read the article

  • CSS 100 percent height body and element

    - by Tim
    I am having an issue making one of my elements 100% within an overall layout that is 100%. I have tried different positioning solutions and I either end up with hidden content the floats behind the footer at the bottom, or the content ends up going behind the footer, and carrys on after the footer. Here is what I have for the page layout. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> <head> <style> *{margin:0} html,body{margin:0; padding:0; height:100%} .wrapper{position:relative; margin:0 auto -200px; height:auto !important; height:100%; min-height:100%} .container{width:930px; margin:0 auto; text-align:left} .right{float:right; width:680px; background:#FFF; margin:60px 10px 0 0; padding:0} .left{float:left; width:240px} .content{padding:10px} .footer{position:absolute; width:100%} .footer,.push{height:200px} </style> </head> <body> <div class="wrapper"> left content footer </div> </body> </html> The layout for the page being 100% height and footer at the bottom works it just the div with the class name content that I would like to be 100% as well and push the footer further down if the content reaches the footer and not disappear. Any help most appreciated. http://img686.imageshack.us/img686/7725/screenshotbj.png

    Read the article

  • Windows Server 2003

    - by user229133
    I have a website that is using Windows Server 2003. The site is called https://mysite.com/ and at ip address 111.1.1.1. Now when I log into the site all my relative links that are generated using NavURL (<%# NavURL("Images/Menu/img.gif")%) are saying "http://111.1.1.1/Images/Menu/img.gif" instead of "https://mysite.com/Images/Menu/img.gif". This is causing an error because it needs to be secure. I'm sure there is a setting on the server somewhere to point to the name and not the ip, but I don't know where. Thanks for your help.

    Read the article

  • Formula for Live Video Streaming Bitrate

    - by MD
    I am simply looking for the formula that should be used here. All the results I've found base "finding the bitrate" off of already existing video. I'm talking about LIVE streaming. (indeterminate length) So, I know some basic parts of it, but I just need to know if I'm right or missing anything. For Kbps: Resolution * Framerate / 1024 Is it really that simple? Audio would be a separate element for our purposes here. Am I missing anything from this formula? (Coming up with a proposal of what amount of bandwidth would be required, relative to possible resolution options, so I just need to be sure that I'm not missing anything or inaccurate about it)

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >