Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 73/584 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • How do I apply a ViewModel to the UserControl inside of a Page?

    - by Mike
    Doing something like this: <DataTemplate DataType="{x:Type vm:AllCustomersViewModel}"> <vw:AllCustomersView /> </DataTemplate> works in a ResourceDictionary for when I want to apply a ViewModel to a UserControl as root, but how do I the same thing when I have a UserControl inside of a Page? Would I create a ResourceDictionary for all my Pages then at the top of each Page do something like: <Page.Resources> <ResourceDictionary Source="../MainWindowResources.xaml"/> </Page.Resources> Any help is greatly appreciated, thanks!

    Read the article

  • How can I allow text to wrap inside a word if necessary?

    - by OrbMan
    I am looking for the best solution to allow text to wrap in the middle of a word if necessary. By best, I mean most browser-compatible, and will favor word breaks before it breaks inside a word. It would also help if the markup looked nicer than mine (see my answer). Edit: Note this is specifically for user-generated content. Edit 2: About 25% of Firefox users on the site in question are still using v3.0 or below, so it is critical to support them. This is based on the last month worth of data (about 121,000 visits).

    Read the article

  • How to write to an XML file inside a jar file?

    - by cancelledout
    Hi Java programmers. I badly need your help. I have a JavaFX/Java ME application. I'm trying to modify an XML file inside my project's folder (soon to be packaged jar file). The path of the file I want to write: /parseExample/service1.xml Sadly, my application is a JavaFx/JavaME so it doesn't contain the library java.util.jar. So I can't use the jar classes. Are there other ways to do that?

    Read the article

  • Test if current page is inside a shadowbox? (so i can close the shadowbox and reopen that page in t

    - by Max Williams
    Hi all I have a couple of pages in my site which open in a shadowbox window rather than the main window. My problem is that if the user session expires, then the user clicks on one of the links that open in a shadowbox, they are redirected to the login page INSIDE THE SHADOWBOX, which i don't want. I've been trying to think of the best way to handle this - one way i thought of, which seems a bit clumsy tbh, was on the login page to test if we're in a shadowbox, and if we are then close it and redirect the parent window to the login page. a) does this seem like a sensible plan? I added the following to my login page, which works: $(document).ready(function(){ if(window.parent.location != window.location){ window.parent.location.href = window.location; } } but i have to wait for the shadowbox to finish loading the page and then redirect. So it's working but like i say a bit clumsy. Is there a nicer way? grateful for any advice - max

    Read the article

  • Is it okay to use try catch inside finally?

    - by Hiral Lakdavala
    Hi, I am using a buffered writer and my code, closes the writer in the finally block. My code is like this. ........... BufferedWriter theBufferedWriter = null; try{ theBufferedWriter =..... .... ...... ..... } catch (IOException anException) { .... } finally { try { theBufferedWriter.close(); } catch (IOException anException) { anException.printStackTrace(); } } I have to use the try catch inside the clean up code in finally as theBufferedWriter might also throw an IOException. I do not want to throw this exception to the calling methos. Is it a good practice to use a try catch in finally? If not what is the alternative? Please suggest. Regards, Hiral

    Read the article

  • How to detect an 'image area' percentage inside an image?

    - by DaNieL
    Mhh, kinda hard to explain with my poor english ;) So, lets say I have an image, doesnt matter what kind of (gif, jpg, png) with 200x200 pixel size (total area 40000 pixels) This image have a background, that can be trasparent, or every color (but i know the background-color in advance). Lets say that in the middle of this image, there is a picture (for keep the example simple lets suppose is a square drawn), of 100x100 pixels (total area 10000 pixels). I need to know the area percentage that the small square fill inside the image. So, in i know the full image size and the background-color, there is a way in php/python to scan the image and retrieve that (in short, counting the pixel that are different from the given background)? In the above example, the result should be 25%

    Read the article

  • Why Date Format in ASP NET MVC Differs when used inside Html Helper?

    - by Marcio Gabe
    Hi, I just came across a very interesting issue. If I use ViewData to pass a DateTime value to the view and then display it inside a textbox, even though I'm using String.Format in the exact same manner, I get different formatting results when using the Html.TextBox helper. <%= Html.TextBox("datefilter", String.Format("{0:d}", ViewData["datefilter"]))%> <input id="test" name="test" type="text" value="<%: String.Format("{0:d}", ViewData["datefilter"]) %>" /> The above code renders the following html: <input id="datefilter" name="datefilter" type="text" value="2010-06-18" /> <input id="test" name="test" type="text" value="18/06/2010" /> Notice how the fist line that uses the Html helper produces the date format in one way while the second one produces a very different output. Any ideas why? Note: I'm currently in Brazil, so the standard short date format here is dd/MM/yyyy.

    Read the article

  • Why don't Domain class static methods work from inside a grails "service"?

    - by ?????
    I want a grails service to be able to access Domain static methods, for queries, etc. For example, in a controller, I can call IncomingCall.count() to get the number of records in table "IncomingCall" but if I try to do this from inside a service, I get the error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'incomingStatusService': Invocation of init method failed; nested exception is groovy.lang.MissingMethodException: No signature of method: static ms.wdw.tropocontrol.IncomingCall.count() is applicable for argument types: () values: [] How do these methods get injected? There's no magic def statement in a controller that appears to do this. Or is the problem that Hibernate isn't available from my Service class?

    Read the article

  • How do I get element's className inside loop of elements?

    - by crosenblum
    I am doing a loop of all elements inside a div, and I now need to get the classname of the element that I am looping by. Then i can check if the current element's class is one, I need to do something with... // var children = parent.childNodes, child; var parentNode = divid; // start loop thru child nodes for(var node=parentNode.firstChild;node!=null;node=node.nextSibling){ var myclass = (node.className ? node.className.baseVal : node.getAttribute('class')); } But this code for getting the classname only get's null values. Any suggestions?

    Read the article

  • How to nest a Location directive inside a virtual host config?

    - by Josh
    I am trying nest a Location directive inside a virtual host config like this: <VirtualHost *:80> ServerName mysite.com DocumentRoot /home/deployer/apps/mysite/current/public ErrorLog /var/log/prod.log <Location "/shop"> DocumentRoot /home/deployer/apps/mysite_shop/current/public ErrorLog /var/log/prod.log </Location> </VirtualHost> What I want to do is go to mysite.com/shop, and point it to another application. Is this possible? Is there another method of doing this? I get an error because apparently Location directives do not accept DocumentRoot. Thanks.

    Read the article

  • Is it a bad idea to have a login dialog inside an iframe?

    - by AyKarsi
    We're creating a website where we will be giving out code snippets to our users which they can place on their own websites. These snippets contain a link a javascript include. When clicking the link, an iframe containing the login dialog to our site opens. The user then authenticates inside the iframe, does his work and when he leaves the iframe his session is closed. We've got it working allready and it's very slick. Our main concern though is phishing. The user has absolutely now way of veryifying where the login page is really coming from. On the other hand, phising attacks are also succesfull even if the user can see the fake-url in the address bar. Would you enter your (OpenId) credentials in an iframe? Does anyone know a pattern with which we could minimise the chances of a phishing attack?

    Read the article

  • How can I debug or set a break statement inside an expression tree?

    - by Abel
    When an external library contains a LINQ provider, and it throws an exception when executing a dynamic expression tree, how can I break when that expression is thrown? For example, I use a third party LINQ2CRM provider, which allows me to call the Max<TSource, TResult>() method of IQueryable, but when it throws an InvalidCastException, I fail to break on the spot when the exception is thrown, making it hard to review the stack-trace because it's already unwinded when the debugger breaks it in my code. I've set "break on throw" for the mentioned exception. My debug settings are: Clarification on where exactly I'd want to break. I do not want to break in side the LINQ Expression, but instead, I want to break when the expression tree is executed, or, put in other words, when the IQueryable extension method Max() calls the override provided by the LINQ provider. The top of the stacktrace looks like this, which is where I would like to break inside (or step through, or whatever): at XrmLinq.QueryProviderBase.Execute[T](Expression expression) at System.Linq.Queryable.Max[TSource,TResult](IQueryable`1 source, Expression`1 selector)

    Read the article

  • How can I access and modify objects inside frames with AS3 in a permanent way?

    - by curro
    I have a MovieClip symbol created with flash in a fla file library. There is a textfield in frame one of this movieclip's timeline . There is another frame in the movieclip timeline. There is a custon class definition for this symbol. It is a flipping card in a memory game. I access the textfield by going to frame 2 (gotoAndStop(2)) and setting the textfield's text property ( this.field.text = "hello" ). However if I go to frame 1 and then return to frame 2, the text becomes the original one in the library's symbol. I have to modify the text propery again in a showFace method I've written. Besides, I cannot pass parameters in the constructor because it is a symbol in the library and that would give errors. I find this behaviour of flash extremely weird. Is there a way I can set properties inside frames permanently? Thank you

    Read the article

  • How to create a GUI inside a function in Matlab?

    - by Paperflyer
    Is there a possibility to write a GUI from inside a function? The Problem is: The callback of all GUI-functions work in the global workspace. But functions have their own workspace and can not access variables in the global workspace. Is there a possibility to make the GUI-functions use the workspace of the function? function myvar = myfunc() myvar = true; h_fig = figure; % create a useless button uicontrol( h_fig, 'style', 'pushbutton', ... 'string', 'clickme', ... 'callback', 'myvar = false' ); % wait for the button to be pressed while myvar pause( 0.2 ); end close( h_fig ); disp( 'this will never be displayed' ); end This event-loop will run indefinitely, since the callback will not modify myvar in the function. Instead it will create a new myvar in the global workspace.

    Read the article

  • How can I call python module inside versioned package folder?

    - by Yanhua
    I need write python codes which run inside a host application. The python codes should be deployed under a specific folder of the host application. I must put my entry python module under the root of the specific folder. And I want put all my other python codes and c/c++ dll under a sub folder, I prefer to name the sub folder like XXX-1.0, the number is the version of my python codes. The entry python module is just simple call a python module under the sub-folder. By this way different version python codes can be deployed together without collision. May I know it is possible or not? Thanks.

    Read the article

  • Is it bad practice to change state inside of an if statement?

    - by Benjamin
    I wrote some code that looks similar to the following: String SKIP_FIRST = "foo"; String SKIP_SECOND = "foo/bar"; int skipFooBarIndex(String[] list){ int index; if (list.length >= (index = 1) && list[0].equals(SKIP_FIRST) || list.length >= (index = 2) && (list[0] + "/" + list[1]).equals(SKIP_SECOND)){ return index; } return 0; } String[] myArray = "foo/bar/apples/peaches/cherries".split("/"); print(skipFooBarIndex(myArray); This changes state inside of the if statement by assigning index. However, my coworkers disliked this very much. Is this a harmful practice? Is there any reason to do it?

    Read the article

  • Java: how to have global values inside a class?

    - by HH
    I want less methods. I want a common global TestClass from which I could use any of its value inside the class. import java.util.*; import java.io.*; public class TestClass { TestClass(String hello){ String hallo = hello; String halloSecond = "Saluto!"; } public static void main(String[] args) { TestClass test = new TestClass("Tjena!"); System.out.println("I want "Tjena!": " + test.hallo); TestClass testSecond = new TestClass("1"); System.out.println("I want Saluto!:" + test.halloSecond); System.out.println("I want Saluto!:" + testSecond.halloSecond); // How can I get glob.vars like the "Saluto!"? } }

    Read the article

  • How to change the coordinate of a point that is inside a GraphicsPath?

    - by Ben
    Is there anyway to change the coordinates of some of the points within a GraphicsPath object while leaving the other points where they are? The GraphicsPath object that gets passed into my method will contain a mixture of polygons and lines. My method would want to look something like: void UpdateGraphicsPath(GraphicsPath gPath, RectangleF regionToBeChanged, PointF delta) { // Find the points in gPath that are inside regionToBeChanged // and move them by delta. // gPath.PathPoints[i].X += delta.X; // Compiles but doesn't work } GraphicsPath.PathPoints seems to be readonly, so does GraphicsPath.PathData.Points. So I am wondering if this is even possible. Perhaps generating a new GraphicsPath object with an updated set of points? How can I know if a point is part of a line or a polygon? If anyone has any suggestions then I would be grateful.

    Read the article

  • What could possibly cause this error when declaring an object inside a class?

    - by M4design
    I'm battling with this assignment :) I've got two classes: Ocean and Grid. When I declare an object of the Grid inside the Ocean: unsigned int sharkCount; Grid grid; The compiler/complainer says: error C2146: syntax error : missing ';' before identifier 'grid' Can you possibly predict what produces this error with the limited info I provided? It seems that as if the Ocean doesn't like the Grid class. Could this be because of the poor implementation of the grid class. BTW the Grid has a default constructor. Yet the error happens in compiling time!. EDIT: They're each in separate header file, and I've included the Grid.h in the Ocean.h.

    Read the article

  • Is it "legal" for C++ runtime to call terminate() when the C++ code is used inside some non-C++ prog

    - by sharptooth
    In certain cases - especially when an exception escapes a destructor during stack unwinding - C++ runtime calls terminate() which must do something reasonable post-mortem and then exit the program. When a question "why so harsh" arises the answer is usually "there's nothing more reasonable to do in such error situations". That sounds reasonable if the whole program is in C++. Now what if the C++ code is in a library and the program that uses the library is not in C++? This happens quite often - for example I might have a native C++ COM component consumed by a .NET program. Once terminate() is called inside the component code the .NET program suddenly ends abnormally. The program author will first of all think "I don't care of C++, why the hell is this library make my program exit?" How do I handle the latter scenario when developing libraries in C++? Is it reasonable that terminate() unexpectedly ends the program? Is there a better way to handle such situations?

    Read the article

  • How to access a function inside a function? Python

    - by viddhart
    I am wondering how I can access a function inside another function. I saw code like this: >>> def make_adder(x): def adder(y): return x+y return adder >>> a = make_adder(5) >>> a(10) 15 So, is there another way to call the adder function? And my second question is why in the last line I call adder not adder(...)? Good explanations are much appreciated.

    Read the article

  • What could possibly cause this error(when declaring an object inside a class) ? //noobie question

    - by M4design
    I'm battling with this assignment :) I've got two classes: Ocean and Grid. When I declare an object of the Grid inside the Ocean: unsigned int sharkCount; Grid grid; The compiler/complainer says: error C2146: syntax error : missing ';' before identifier 'grid' Can you possibly predict what produces this error with the limited info' I provided? It seems that as if the Ocean doesn't like the Grid class. Could this be because of the poor implementation of the grid class. BTW the Grid has a default constructor. Yet the error happens in compiling time!. Thanks. EDIT: They're each in separate header file, and I've included the Grid.h in the Ocean.h.

    Read the article

  • What happens to an instance of ServerSocket blocked inside accept(), when I drop all references to i

    - by Hanno Fietz
    In a multithreaded Java application, I just tracked down a strange-looking bug, realizing that what seemed to be happening was this: one of my objects was storing a reference to an instance of ServerSocket on startup, one thread would, in its main loop in run(), call accept() on the socket while the socket was still waiting for a connection, another thread would try to restart the component under some conditions, the restart process missed the cleanup sequence before it reached the initialization sequence as a result, the reference to the socket was overwritten with a new instance, which then wasn't able to bind() anymore the socket which was blocking inside the accept() wasn't accessible anymore, leaving a complete shutdown and restart of the application as the only way to get rid of it. Which leaves me wondering: with no references left to the ServerSocket instance, what would free the socket for a new connection? At what point would the ServerSocket become garbage collected? In general, what are good practices I can follow to avoid this type of bug?

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >