Daily Archives

Articles indexed Monday April 16 2012

Page 3/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • Multiple render targets and gamma correctness in Direct3D9

    - by Mario
    Let's say in a deferred renderer when building your G-Buffer you're going to render texture color, normals, depth and whatever else to your multiple render targets at once. Now if you want to have a gamma-correct rendering pipeline and you use regular sRGB textures as well as rendertargets, you'll need to apply some conversions along the way, because your filtering, sampling and calculations should happen in linear space, not sRGB space. Of course, you could store linear color in your textures and rendertargets, but this might very well introduce bad precision and banding issues. Reading from sRGB textures is easy: just set SRGBTexture = true; in your texture sampler in your HLSL effect code and the hardware does the conversion sRGB-linear for you. Writing to an sRGB rendertarget is theoretically easy, too: just set SRGBWriteEnable = true; in your effect pass in HLSL and your linear colors will be converted to sRGB space automatically. But how does this work with multiple rendertargets? I only want to do these corrections to the color textures and rendertarget, not to the normals, depth, specularity or whatever else I'll be rendering to my G-Buffer. Ok, so I just don't apply SRGBTexture = true; to my non-color textures, but when using SRGBWriteEnable = true; I'll do a gamma correction to all the values I write out to my rendertargets, no matter what I actually store there. I found some info on gamma over at Microsoft: http://msdn.microsoft.com/en-us/library/windows/desktop/bb173460%28v=vs.85%29.aspx For hardware that supports Multiple Render Targets (Direct3D 9) or Multiple-element Textures (Direct3D 9), only the first render target or element is written. If I understand correctly, SRGBWriteEnable should only be applied to the first rendertarget, but according to my tests it doesn't and is used for all rendertargets instead. Now the only alternative seems to be to handle these corrections manually in my shader and only correct the actual color output, but I'm not totally sure, that this'll not have any negative impact on color correctness. E.g. if the GPU does any blending or filtering or multisampling after the Linear-sRGB conversion... Do I even need gamma correction in this case, if I'm just writing texture color without lighting to my rendertarget? As far as I know, I DO need it because of the texture filtering and mip sampling happening in sRGB space instead, if I don't correct for it. Anyway, it'd be interesting to hear other people's solutions or thoughts about this.

    Read the article

  • How is the iOS support in UDK compared to Unity?

    - by Joe
    I have some significant experience in Unity for web clients, but I'm skeptical about the 3K$ price tag to create/deploy iOS games. I noticed UDK now supports iOS, and appears to have "free" version control- and it's only 100$ from what I can tell. My primary question is: Does UDK make iOS development and deployment easy, or do you have to jump through a couple of hoops to make it work? A few side questions not worth another post: How hard is the transition from Unity to UDK? Is UnrealScript easy to pick up from a C/C# background? Does the UDK have good documentation compared to Unity?

    Read the article

  • Displaying a grid based map using C++ and sdl

    - by user15386
    I am trying to create a roguelike game using c++ and SDL. However, I am having trouble getting it to display the map, which is represented by a 2d array of a tile class. Currently, my code is this: for (int y = 0; y!=MAPHEIGHT; y++) { for (int x = 0; x!=MAPWIDTH 1; x++) { apply_surface( x * TILEWIDTH, y * TILEHEIGHT, mymap[x][y].image, screen ); } } However, running this code causes it to both dither for a while before opening the SDL window, and (usually) tell me there is an access violation. How can I display my map?

    Read the article

  • Wordpress Query Compare operator not working?

    - by Liam
    I have the following wordpress query... $args = array('orderby' => 'meta_value_num', 'meta_key' => 'order', 'order' => 'ASC', 'meta_query' => array( array( 'key' => $customkey, 'value' => $customvalue, 'compare' => '=' ), array( 'key' => $customkey1, 'value' => $customvalue1, 'compare' => '=' ), array( 'key' => 'coverageRegion', 'value' => 'national', 'compare' => '=' ), array( 'key' => 'vehicleType', 'value' => 'psv', 'compare' => '!=' ) ) ); I want to return posts where there custom field 'Vechicle Type' is not PSV, The above however returns posts with exactly that, has anybody come across this before? Seems im not the only one neither... http://wordpress.org/support/topic/meta_query-without-key-results-in-compare-of-not-like-not-working

    Read the article

  • Is there a way to make XmlDocument parsing less strict

    - by Istrebitel
    I am making a program that will store its data in an XML file. When people write XML they can make subtle mistakes, like ending a comment with - so it looks like <!-- comment ---> or adding a </>inside an attribute. Naturally, the XML still can be read all right, but trying to input this text into XmlDocument will give a syntax error (and it wont be parsed). Is there a way to make XmlDocument less strict and make it ignore violations of the standard that do not make the document unparseable? For example, its clear that <!-- comment ---> is still a comment even though it contains - at the end which is against the standard specification).

    Read the article

  • Mono-LibreOffice System.TypeLoadException

    - by Marco
    In the past I wrote a C# library to work with OpenOffice and this worked fine both in Windows than under Ubuntu with Mono. Part of this library is published here as accepted answer. In these days I discovered that Ubuntu decided to move to LibreOffice, so I tried my library with LibreOffice latest stable release. While under Windows it's working perfectly, under Linux I receive this error: Unhandled Exception: System.TypeLoadException: A type load exception has occurred. [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: A type load exception has occurred. Usually Mono tells us which library can't load, so I can install correct package and everything is OK, but in this case I really don't know what's going bad. I'm using Ubuntu oneiric and my library is compiled with Framework 4.0. Under Windows I had to write this into app.config: <?xml version="1.0"?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/> </startup> </configuration> because LibreOffice assemblies uses Framework 2.0 (I think). How can I find the reason of this error to solve it? Thanks UPDATE: Even compiling with Framework 2.0 problem (as expected) is the same. Problem (I think) is that Mono is not finding cli-uno-bridge package (installable on previous Ubuntu releases and now marked as superseded), but I cannot be sure. UPDATE 2: I created a test console application referencing cli-uno dlls on Windows (they are registered in GAC_32 and GAC_MSIL). CONSOLE app static void Main(string[] args) { Console.WriteLine("Starting"); string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string doc = Path.Combine(dir, "Liberatoria siti web.docx"); using (QOpenOffice.OpenOffice oo = new QOpenOffice.OpenOffice()) { if (!oo.Init()) return; oo.Load(doc, true); oo.ExportToPdf(Path.ChangeExtension(doc, ".pdf")); } } LIBRARY: using unoidl.com.sun.star.lang; using unoidl.com.sun.star.uno; using unoidl.com.sun.star.container; using unoidl.com.sun.star.frame; using unoidl.com.sun.star.beans; using unoidl.com.sun.star.view; using unoidl.com.sun.star.document; using System.Collections.Generic; using System.IO; using System; namespace QOpenOffice { class OpenOffice : IDisposable { private XComponentContext context; private XMultiServiceFactory service; private XComponentLoader component; private XComponent doc; public bool Init() { Console.WriteLine("Entering Init()"); try { context = uno.util.Bootstrap.bootstrap(); service = (XMultiServiceFactory)context.getServiceManager(); component = (XComponentLoader)service.createInstance("com.sun.star.frame.Desktop"); XNameContainer filters = (XNameContainer)service.createInstance("com.sun.star.document.FilterFactory"); return true; } catch (System.Exception ex) { Console.WriteLine(ex.Message); if (ex.InnerException != null) Console.WriteLine(ex.InnerException.Message); return false; } } } } but I'm not able to see "Starting" !!! If I comment using(...) on application, I see line on console... so I think it's something wrong in DLL. There I'm not able to see "Entering Init()" message on Init(). Behaviour is the same when LibreOffice is not installed and when it is !!! try..catch block is not executed...

    Read the article

  • xDebug cant find my files. Always looks in localhost

    - by sleeper
    I'm running win7-64bit, NetBeans 7.1.1 and WampServer 2.2 (which has xDebug) I've configured php.ini (xdebug.remote_enable=on, etc.) I create a directory (virtual host called example.dev) and add a test file. (c:/wamp/example/test-xdebug.php) I run debug in NetBeans and the following url displays: http://localhost/example/test-xdebug.php?XDEBUG_SESSION_START=netbeans-xdebug This fails. The browser coughs up the following error message. Not Found. The requested URL /example/test-xdebug.php was not found on this server. I add the correct path to the virtual host, and xDebug Runs Flawlessly: http://example.dev/test-xdebug.php?XDEBUG_SESSION_START=netbeans-xdebug Tried every configuration I could think of. If this is a php.ini config issue, I sure as heck cant find it. If its a NetBeans issue, there is not an option/interface to modify i (that I can find). Please illuminate! thanks sleeper

    Read the article

  • how to Retrieve the parameters of document.write to detect the creation of dynamic tags

    - by user1335906
    In my Project i am supposed to identify the dynamically created tags which can be done in scripts through document.write("<script src='jquery.js'></script>") For this i used Regular expressions and my code is as follows function find_tag_docwrite(text) { var attrib=new Object; var pat_tag=/<((\S+)\s(.*))>/g; while(t=pat_tag.exec(text) { var tag=RegExp.$1; for(i=0;i<tags.length;i++) { var pat=/(\S+)=((['"]*)(\S+)(['"]*)\3)/g; while(p=pat.exec(f)) { attr=RegExp.$1;val=RegExp.$4; attrib[attr]=val; } } } } in the above function text is parameters of document.write function. Now through this code i am getting the tag names and all the attributes of the tags. But for the below example the above code is not working var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); In such cases Regular expressions does not work so after searching some time where i found hooks on dom methods. so by using this i thought of creating hook for document.write method but i am able to understand how it is done i included the following code in my program but it is not working. function someFunction(text) { console.log(text); } document.write = someFunction; where text is the parameters of document.write. Another problem is After monitoring all the document.write methods using hooks again i have to use regex for finding tag creations. Is there Any alternative

    Read the article

  • Adding a column to a data.frame

    - by Susanne Dreisigacker
    I have the data.frame below. I want to add a column that classifies my data according to column 1 (h_no) in that way that the first series of h_no 1,2,3,4 is class 1, the second series of h_no (1 to 7) is class 2 etc. such as indicated in the last column. h_no h_freq h_freqsq 1 0.09091 0.008264628 1 2 0.00000 0.000000000 1 3 0.04545 0.002065702 1 4 0.00000 0.000000000 1 1 0.13636 0.018594050 2 2 0.00000 0.000000000 2 3 0.00000 0.000000000 2 4 0.04545 0.002065702 2 5 0.31818 0.101238512 2 6 0.00000 0.000000000 2 7 0.50000 0.250000000 2 1 0.13636 0.018594050 3 2 0.09091 0.008264628 3 3 0.40909 0.167354628 3 4 0.04545 0.002065702 3

    Read the article

  • How can I exclude LEFT JOINed tables from TOP in SQL Server?

    - by Kalessin
    Let's say I have two tables of books and two tables of their corresponding editions. I have a query as follows: SELECT TOP 10 * FROM (SELECT hbID, hbTitle, hbPublisherID, hbPublishDate, hbedID, hbedDate FROM hardback LEFT JOIN hardbackEdition on hbID = hbedID UNION SELECT pbID, pbTitle, pbPublisher, pbPublishDate, pbedID, pbedDate FROM paperback Left JOIN paperbackEdition on pbID = pbedID ) books WHERE hbPublisherID = 7 ORDER BY hbPublishDate DESC If there are 5 editions of the first two hardback and/or paperback books, this query only returns two books. However, I want the TOP 10 to apply only to the number of actual book records returned. Is there a way I can select 10 actual books, and still get all of their associated edition records? In case it's relevant, I do not have database permissions to CREATE and DROP temporary tables. Thanks for reading! Update To clarify: The paperback table has an associated table of paperback editions. The hardback table has an associated table of hardback editions. The hardback and paperback tables are not related to each other except to the user who will (hopefully!) see them displayed together.

    Read the article

  • How Proxy server works with tcp/http connections?

    - by Vivek
    Since I am a beginner in the world of internet/networking, I always mess up with these kinds of doubts in my head while programming ;) .. My doubts are, While working behind a proxy, how my requests and responses work? Means my request headers and data will first reach to Proxy server- then proxy server sends it(same headers and data) to corresponding server. And server responses to it with a response header and body to the proxy server-then proxy server sends it to my computer. Wright? While using websockets we are upgrading our http connection to tcp. At this time what is happening @ Proxy server? Does the proxyserver also upgrades its connection to plain TCP? After opening such TCP connections, does the proxy server able to track/log those socket messsages? And most importantly, Is the proxy server transparent or acting like an original server infront of a client? Thanks for any answers or helpful links in advance.

    Read the article

  • How to transfer large file (File size > Heap Size) over the network?

    - by neo
    How to transfer large file (File size Heap/RAM Size) over the network ? Lets say I have file (size 10GB) I want to transfer it machine a (RAM 512mb) to machine b (RAM 512mb). Want achieve this using java code. First, is it possible ? Any recommendation on framework. If possible, can we speed this up using threading ? Important criteria: file's data sequence needs to be maintained during transfer. Any example will be great help.

    Read the article

  • SA_OAuthTwitterEngine and MGTwitterEngine retweet doesn't works

    - by NemeSys
    I'm developing an iOS app with Twitter features. To do that I'm using SA_OAuthTwitterEngine and MGTwitterEngine wrappers. I've followed this post. I'm trying to retweet a tweet from the followed user timeline. This is what I send/receive: 2012-04-12 18:34:00.291 Project[13605:207] INFO -> Twitter URL: https://api.twitter.com/1/statuses/retweet/190459190869753856.xml 2012-04-12 18:34:00.292 Project[13605:207] INFO -> retweet response: 0AFF2EF9-6BCC-4B1E-B65A-02BD24A38C18 Here I pass to the API the id field of the selected tweet which I want to retweet. But after execute the method, the retweeted doesn't appears in the user timeline, where I'm getting the user tweets and tweets retweeted by user. What I'm loosing here? According with this the request to the Twitter API is ok. And I've checked the app permissions setted in twitter and have all: read/write and direct messages. Thanks.

    Read the article

  • Webrick:: Access to public folders (css, js etc)

    - by Nikita Kuhta
    Webrick serves "/" path, but I want to have direct access to css, js and other public folders. if I use DocumentRoot, will handle all public paths too (like css/style.css), because it hadles root path: server = WEBrick::HTTPServer.new( :DocumentRoot => Dir::pwd, :Port=>8080 ) I need to mount_proc my root: server.mount_proc('/') {|req,resp| ...... How to give access to public folders?

    Read the article

  • FindWindowEx from user32.dll is returning a handle of Zero and error code of 127 using dllimport

    - by puretechy
    I need to handle another windows application programatically, searching google I found a sample which handles windows calculator using DLLImport Attribute and importing the user32.dll functions into managed ones in C#. The application is running, I am getting the handle for the main window i.e. Calculator itself, but the afterwards code is not working. The FindWindowEx method is not returning the handles of the children of the Calculator like buttons and textbox. I have tried using the SetLastError=True on DLLImport and found that I am getting an error code of 127 which is "Procedure not found". This is the link from where I got sample application: http://www.codeproject.com/script/Articles/ArticleVersion.aspx?aid=14519&av=34503 Please help if anyone knows how to solve it. UPDATE: The DLLImport is: [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle); The Code that is not working is: hwnd=FindWindow(null,"Calculator"); // This is working, I am getting handle of Calculator // The following is not working, I am getting hwndChild=0 and err = 127 hwndChild = FindWindowEx((IntPtr)hwnd,IntPtr.Zero,"Button","1"); Int32 err = Marshal.GetLastWin32Error();

    Read the article

  • BroadCast Receiver calling intent after some time android

    - by khushi
    public class myReceiver extends BroadcastReceiver { public static boolean wasScreenOn = true; @Override public void onReceive(final Context context, Intent recievedIntent) { if (recievedIntent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { wasScreenOn = false; Intent intent = new Intent(context, myActivity.class); intent.setAction(Intent.ACTION_MAIN); intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION); intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); intent.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); context.startActivity(intent .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); } else if (recievedIntent.getAction().equals(Intent.ACTION_SCREEN_ON)) { wasScreenOn = true; } } } The activity display after when action screen on is call.

    Read the article

  • GTK+ (2.0) - signal "clicked" on GtkEntry?

    - by Lght
    i'm testing some signals with Gtk+ 2.0. Actually, i'm looking for a way to get the signal emitted when i click on a GtkEntry. if (widgets_info[i].action & IG_INPUT) { widget->frame[i] = gtk_entry_new_with_max_length(MAX_INPUT_LENGTH); gtk_entry_set_text(widget->frame[i], widgets_info[i].text); catch_signal(widget->frame[i], MY_SIGNAL, &change_entry, widget); } I have a pre-selected text in my entry (widgets_info[i].text) and i want this text to disappear if the user click on my GtkEntry. Does someone knows what is this signal ? Sincerely, Lght (sorry for my english)

    Read the article

  • How to move many files in multiple different directories (on Linux)

    - by user1335982
    My problem is that I have too many files in single directory. I cannot "ls" the directory, cos is too large. I need to move all files in better directory structure. I'm using the last 3 digits from ID as folders in reverse way. For example ID 2018972 will gotta go in /2/7/9/img_2018972.jpg. I've created the directories, but now I need help with bash script. I know the IDs, there are in range 1,300,000 - 2,000,000. But I can't handle regular expressions. I wan't to move all files like this: /images/folder/img_2018972.jpg -> /images/2/7/9/img_2018972.jpg I will appreciate any help on this subject. Thanks!

    Read the article

  • Not able to access any mothod with the attribute [webinvoke ] in WCF Restful services

    - by user1335978
    I am not able to access any method with the attribute [webinvoke] in a RESTful WCF service. My code is like this: [OperationContract] [WebInvoke(Method = "Post", UriTemplate = "Comosite/{composite}", ResponseFormat = WebMessageFormat.Xml)] CompositeType GetDataUsingDataContract(string composite); On executing the above service I am getting an error message Method not allowed. I tried many ways, by modifying the urltemplate, method name and method type etc. but nothing is working out. But if I use the [WebGet] attribute the the service method is working fine. Can anybody suggest me what can I do make it work? Thanks in advance... :)

    Read the article

  • What is the best way to bind PhoneGap events (like backbutton) to views in ember.js

    - by Fedor
    I'm playing with PhoneGap and emberjs (trying to build "proof of concept" mobile/HTML5 application based on ember.js). Ember.js itself works fine, but I haven't found any good way to "bind" PhoneGap events to views. For instance, I would like to handle backbutton event and remove a view on it. It would be nice to define behavior in view class and call document.addEventListener when instance of the view is appended and call document.removeEventListener when view instance removed.

    Read the article

  • How to test for secure SMTP mail service on a mail server

    - by Vinay S Shenoy
    I'm working on a project to auto-configure a user's email server settings in Java. I am extracting the mail server from his email address and looking up the MX records of that mail server using the DirContext class with com.sun.jndi.dns.DnsContextFactory. Then I'm opening a Socket to each server and testing them using a HELO command and checking the responses. My problem is that this works only when I test it with the unsecure SMTP port 25. How can I use it with the secure port 465? I tried using Secure Sockets by using SSLSocketFactory sslsocketfactory = (SSLSocketFactory)SSLSocketFactory.getDefault(); SSLSocket socket = (SSLSocket)sslsocketfactory.createSocket(mailserver, STANDARD_SMTP_PORT); But all connections get a timeout exception as follows alt1.gmail-smtp-in.l.google.com. java.net.ConnectException: Operation timed out Please help.

    Read the article

  • StringCollection changes on Settings.Default.Reload()

    - by Ask
    In my app Settings.Default.test is a StringCollection. I don't understand why this code StringCollection col = new StringCollection(); col.Add("1\r\n2\r\n"); Settings.Default.test = col; Settings.Default.Save(); Settings.Default.Reload(); Changes my text 1\r\n2\r\n to 1\n2\n on Reload. Is it default behavior or what? How to restore multiline text in my textbox on restart of my application?

    Read the article

  • WeakReferences are not freed in embedded OS

    - by Carsten König
    I've got a strange behavior here: I get a massive memory leak in production running a WPF application that runs on a DLOG-Terminal (Windows Embedded Standard SP1) that behaves perfectly fine if I run it localy on a normal desktop (Win7 prof.) After many unsucessful attempts to find any problem I put one of those directly beside my monitor, installed the ANTs MemoryProfiler and did one hour test run simulating user operations on both the terminal and my development PC. Result is, that due to some strange reasons the embedded system piles up a huge amount of WeakReference and EffectiveValueEntry[] Objects. Here are are some pictures: Development (PC): And the terminal: Just look at the class list... Has anyone seen something like this before and are there known solutions to this? Where can I get help? (PS the terminals where installed with images prepared for .net4)

    Read the article

  • Windows theme affecting ListView header

    - by LihO
    I've created new Windows Forms Application (C#) with one simple form containing ListView. Then I changed the View Property to Details and increased the size of the font used in this ListView and here's the result: This is how it looks on Windows XP with Windows Classic theme: and here's the result with Windows XP theme: Creating the same Windows Forms Application in Visual C++ instead of C# yields same result. EDIT : Thanks to Kamil Lach, we already know that Visual Styles is what makes the appearance of ListView change. This can be avoided either by removing Application.EnableVisualStyles() call or by changing the Application.VisualStyleState. Both of these solutions yield the following result: This looks fine, but this change affects the appearance of other controls which is not good. I'd like my ListView to be the only control that is not affected by Visual Styles. I've also found similar questions that try to deal with it: Can you turn off visual styles/theming for just a single windows control? How do I disable visual styles for just one control, and not its children? Unfortunately, none of mentioned solutions works. Any C# solution that would make the ListView header have the correct height would be appreciated.

    Read the article

  • Does anyone use AODL in a real application?

    - by HyperQuantum
    We are currently using the Excel interop API in .NET to generate simple spreadsheet documents from a template. So we load the template first, insert some rows, fill in some data (dates, text, and numbers), and make Excel visible so that the user can print or save the document we just generated. But I'd like to get rid of the Excel dependency, and switch to the ODF format as well. Googling suggests AODL (C# libs for generating ODF docs) as the most obvious solution. But their last release is 1.3.0.0 BETA, and seems to be 3 years old. So I'm not sure if it's a good idea to depend on a potentially dead project... In that case, I'd need to find another solution. Any ideas? Or maybe someone could assure me that AODL is still alive?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >