Search Results

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

Page 82/584 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • How to get pixel information inside a fragment shader?

    - by user697111
    In my fragment shader I can load a texture, then do this: uniform sampler2D tex; void main(void) { vec4 color = texture2D(tex, gl_TexCoord[0].st); gl_FragColor = color; } That sets the current pixel to color value of texture. I can modify these, etc and it works well. But a few questions. How do I tell "which" pixel I am? For example, say I want to set pixel 100,100 (x,y) to red. Everything else to black. How do I do a : "if currentSelf.Position() == (100,100); then color=red; else color=black?" ? I know how to set colors, but how do I get "my" location? Secondly, how do I get values from a neighbor pixel? I tried this: vec4 nextColor = texture2D(tex, gl_TexCoord[1].st); But not clear what it is returning? if I'm pixel 100,100; how do I get the values from 101,100 or 100,101?

    Read the article

  • How to load a NIB inside of a view in another NIB?

    - by Sheehan Alam
    I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib contains a UIButton I want ChildViewController.xib to load in the ParentViewController.xib's UIView I have done the following: Created @property for UIView in ParentViewController Connected File's Owner to UIView in ParentViewController Set UIViewController in ParentViewController's NIB Name property to ChildViewController in Interface Builder Set ChildViewController view property to UIView in ParentViewController I was hoping this would load ChildViewController into my UIView in ParentViewController but no luck. I did get the following warning, which could be the culprit: 'View Controller (Child View)' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported. I also have added additional code in ParentViewController's viewDidLoad(): - (void)viewDidLoad { [super viewDidLoad]; ChildViewController *childViewController = [[ChildViewController alloc]initWithNibName:@"ChildViewController" bundle:nil]; childViewController.view = self.myView; } Any thoughts on why ChildViewController does not load in the UIView of ParentViewController?

    Read the article

  • How to preview any files inside a Java application ?

    - by Studer
    I'm using a JTree to browse the content of a folder and I want that when a user click on a file, the software shows a preview of it (a screenshot of its first page). The files are mostly Office documents and PDF. I manage to do it for PDF file using a module downloaded from Sun, but I'd like to know if there is a way to do it using any software (JARs preferably) or even the built-in Windows API. I was thinking of converting the file to PDF then do a preview of this PDF but this isn't optimal. Any ideas ?

    Read the article

  • Zend Framework - Can view helpers be user inside of partials?

    - by Bob Spryn
    Working on implementing view helpers and partials to create a group of reusable display objects. Previously addressed in my question here: http://stackoverflow.com/questions/2389531/zend-framework-when-to-use-viewscripts-partials-vs-view-helpers Wondering if partials can call view helpers of their own, and if they can whether those helpers will have access to the original view (since the partials don't).

    Read the article

  • How to access the value of the Label present inside Datagrid asp.net using jquery?

    - by vini
    <asp:DataGrid ID="datagrid1" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyField="Expr1" OnItemCommand="datagrid1_ItemCommand" EmptyDataText="No Records Found" > <HeaderStyle BackColor="#2E882E" Font-Bold="True" ForeColor="#FFFFCC" HorizontalAlign="Left" /> <Columns> <asp:TemplateColumn HeaderText=""> <ItemTemplate> <table> <tr> <td class="style1"> <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status") %>'></asp:Label> </td> </tr> </table> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> How can i access this Status Label value using jquery Please help var DataGrid1 = $("<%=datagrid1.ClientID %>"); var status = $(DataGrid1).children("lblStatus").get(0).innerHTML; Will the above code work?

    Read the article

  • problem in below table:i had table inside table .my inner table contains some text.

    - by Ayyappan.Anbalagan
    Heading ## <tr style=" width:500px; float:left;"> <td style="border: thin ridge #008000; text-align:left;" align="left"; > <table class="" style=" border: 1px solid #800000; width:200px; float:left; height: 200px;"> <tr> <td>&nbsp;stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow&nbsp; </td> </tr> </table> stackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow stackoverflowstackoverflow statackoverflow sta</td> </tr> </table>

    Read the article

  • Flash player inside a div is moving the whole page wrapper down in IE (why?)

    - by janoChen
    I placed the flash player using: position: absolute; top: 20; right: 40; in the div around it. css: #page { position: relative; } #flashplayer { position: absolute; top: 10px; right: 30px; } (as you can see #page is relative) html: <div id="page"> <div id="flashplayer"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="300" height="35"> <param name="movie" value="music_player/player_mini.swf" /> <param name="quality" value="high" /> <embed src="music_player/player_mini.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="300" height="35"></embed> </object> </div> <div id="formfloat"> the page: http://ada.kiexpro.com/test/

    Read the article

  • Are function-local typedefs visible inside C++0x lambdas?

    - by GMan - Save the Unicorns
    I've run into a strange problem. The following simplified code reproduces the problem in MSVC 2010 Beta 2: template <typename T> struct dummy { static T foo(void) { return T(); } }; int main(void) { typedef dummy<bool> dummy_type; auto x = [](void){ bool b = dummy_type::foo(); }; // auto x = [](void){ bool b = dummy<bool>::foo(); }; // works } The typedef I created locally in the function doesn't seem to be visible in the lambda. If I replace the typedef with the actual type, it works as expected. Here are some other test cases: // crashes the compiler, credit to Tarydon int main(void) { struct dummy {}; auto x = [](void){ dummy d; }; } // works as expected int main(void) { typedef int integer; auto x = [](void){ integer i = 0; }; } I don't have g++ 4.5 available to test it, right now. Is this some strange rule in C++0x, or just a bug in the compiler? From the results above, I'm leaning towards bug. Though the crash is definitely a bug. For now, I have filed two bug reports. All code snippets above should compile. The error has to do with using the scope resolution on locally defined scopes. (Spotted by dvide.) And the crash bug has to do with... who knows. :) Update According to the bug reports, they have both been fixed for the next release of Visual Studio 2010.

    Read the article

  • C++ - Opening a file inside a function using fopen. (Noob problem)

    - by Josh
    I am using Visual Studio 2005 (C++). I am passing a string into a function as a char array. I want to open the file passed in as a parameter and use it. I know my code works to an extent, because if I hardcode the filename as the first parameter it works perfectly. I do notice if I look at the value as a watch, the value includes the address aside the string literal. I have tried passing in the filename as a pointer, but it then complains about type conversion with __w64. As I said before it works fine with "filename.txt" in place of fileName. I am stumped. void read(char fileName[50],int destArray[MAX_R][MAX_C],int demSize[2]) { int rows=0; int cols=0; int row=0; int col=0; FILE * f = fopen(fileName,"r"); ...

    Read the article

  • How to use a 3rd party control inside the viewmodel?

    - by Sander
    I have a 3rd party control which among other things performs loading of some data. I want my viewmodel to keep track of this load operation and adjust its own state accordingly. If it were up to me, I'd do the data loading far away from the view, but it is not. So, I seem to be in the situation where my viewmodel depends on my view. How do I best handle this? I feel rather dirty making the view publish events to the viewmodel but I don't see any other reasonable way to get this info into the viewmodel. A similar situation might crop up with standard controls, too - imagine if your viewmodel depends on the events coming from a MediaElement - how do you properly model this? Do you put the MediaElement into the viewmodel? That doesn't sound right. If publishing the events to the viewmodel is indeed the most reasonable way, is there some common pattern used for this? How do you do it?

    Read the article

  • Why does jQuery fadeOut not work inside this setInterval loop?

    - by Clay McClure
    I'm trying to load random items into a div every few seconds, with a nice fadeOut/fadeIn transition between each load. Here's the code: <html> <body> <div id="item"></div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> // Load a random item var item = $('#item'); function load_item() { item.fadeOut(5000, function() { item.load('http://dynamic.xkcd.com/comic/random/ #middleContent img', null, function() { item.fadeIn(5000); }); }); }; // Load initial featured item load_item(); // Schedule repeated loading setInterval(load_item, 15000); </script> </body> </html> This works fine the first time through, but on subsequent calls to load_item, the fadeOut() seems to stop working. It doesn't actually fade the #item div out, but jumps immediately into the callback function, ignoring the 5000 delay. What am I doing wrong?

    Read the article

  • Why would an error get thrown inside my try-catch?

    - by George Johnston
    Why would my try-catch block still be throwing an error when it's handled? Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Try Here >> : _MemoryStream.Seek(6 * StartOffset, 0) _MemoryStream.Read(_Buffer, 0, 6) Catch ex As IOException // Handle Error End Try Edit: Cleaned the question up to remove the extraneous information.

    Read the article

  • How to insert multiple check-box values inside database when one or more will be left unchecked?

    - by Sally
    I have a form that contains 5 check boxes. The user may select one or more of these check boxes. The user may select 2 and leave 3 unchecked or select 4 and leave one unchecked and so on, in that case how can I write the php/mysql code that will insert the form data into the database. With just one selection it's easy, I would do: $checkbox_value = $_POST['i_agree']; mysql_query("INSERT INTO terms (user, pass, conditions) VALUES ('$user','$pass','$checkbox_value')"); But how can I write this when there are multiple check box options and only one or more of them will be checked? I want to insert them all in one column called "tags" separated by commas.

    Read the article

  • Is it possible to center an image on both axis inside a div?

    - by Noor
    I have a script that loads in a div with images running jQuery Cycle Lite Plugin. I got the tip that I could us the "after" function in that plugin to make changes to the picture each time the image is refreshed. So I wrote this: $("#display div").css({ margin: "0 auto", "text-align": "center", }); The html built like this: <div id="display"> <div id="slideshow1"> <img ... /> </div> </div> This isn't working, whats wrong? ( this is supposed to center it horizontally, i need to center it vertically to )..

    Read the article

  • I need to know inside of "while(fscanf != EOF){blah}" if the next fscanf is going to return EOF-- be

    - by Rancur3p1c
    I've got some code executing in a while(fscanf != EOF) loop. However, even when fscanf has finished executing, I need to keep running that code until some conditions are met. I mean I guess I could copy/paste the code to outside the while(fscanf) loop, and only use global variables, but that seems messy. Surely someone has encountered something like this before and has a cleaner solution.

    Read the article

  • Does C# compile code inside an if(false) block?

    - by aximili
    I am just wondering if these code blocks gets compiled into .dll I don't think this one gets compiled at all #if SOMETHING_UNDEFINED // some code - this is ignored by the compiler #endif Now what about these? 1. if(false) { // some code - is this compiled? } 2. const bool F = false; if(F) { // some code - is this compiled? } 3. bool F = false; if(F) { // some code - is this compiled? }

    Read the article

  • Using a MockContext inside a Java package not an Android Package.

    - by jax
    I have moved most of my Android code into a separate Java package. I want to run some JUnit4 tests however I can't seem to get a MockContext working. I have extended MockContext() but have not done anything with it yet as I don't know what need to be done. At: private static MyMockContext context = new MyMockContext(); I get java.lang.ExceptionInInitializerError at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.RuntimeException: Stub! at android.content.Context.<init>(Context.java:4) at android.test.mock.MockContext.<init>(MockContext.java:5) at com.example.zulu.MyMockContext.<init>(MyMockContext.java:34) at com.example.zulu.RoomCoreImplTest.<clinit>(RoomCoreImplTest.java:15) ... 16 more

    Read the article

  • How can invoke a shell to make a new environment to run a make inside another make?

    - by WilliamKF
    I would like in my GNUmakefile to have a target rule that invokes a new shell and then with the clean slate of the new shell invokes a new make. What is the syntax to do this? I tried this but it didn't work: .PHONY: setup setup: shell cd myDir; make; cd .. It gets infinite repeat of the following error: make[1]: Entering directory `/disk4/home/user/parent' shell cd myDir; make; cd .. /bin/sh: shell: command not found make[1]: Entering directory `/disk4/home/user/parent' shell cd myDir; make; cd .. /bin/sh: shell: command not found [...]

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >