Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 165/433 | < Previous Page | 161 162 163 164 165 166 167 168 169 170 171 172  | Next Page >

  • How to send multiple MVP matrices to a vertex shader in OpenGL ES 2.0

    - by Carbon Crystal
    I'm working my way through optimizing the rendering of sprites in a 2D game using OpenGL ES and I've hit the limit of my knowledge when it comes to GLSL and vertex shaders. I have two large float buffers containing my vertex coordinates and texture coordinates (eventually this will be one buffer) for multiple sprites in order to perform a single glDrawArrays call. This works but I've hit a snag when it comes to passing the transformation matrix into the vertex shader. My shader code is: uniform mat4 u_MVPMatrix; attribute vec4 a_Position; attribute vec2 a_TexCoordinate; varying vec2 v_TexCoordinate; void main() { v_TexCoordinate = a_TexCoordinate; gl_Position = u_MVPMatrix * a_Position; } In Java (Android) I am using a FloatBuffer to store the vertex/texture data and this is provided to the shader like so: mGlEs20.glVertexAttribPointer(mVertexHandle, Globals.GL_POSITION_VERTEX_COUNT, GLES20.GL_FLOAT, false, 0, mVertexCoordinates); mGlEs20.glVertexAttribPointer(mTextureCoordinateHandle, Globals.GL_TEXTURE_VERTEX_COUNT, GLES20.GL_FLOAT, false, 0, mTextureCoordinates); (The Globals.GL_POSITION_VERTEX_COUNT etc are just integers with the value of 2 right now) And I'm passing the MVP (Model/View/Projection) matrix buffer like this: GLES20.glUniformMatrix4fv(mMVPMatrixHandle, 1, false, mModelCoordinates); (mModelCoordinates is a FloatBuffer containing 16-float sequences representing the MVP matrix for each sprite) This renders my scene but all the sprites share the same transformation, so it's obviously only picking the first 16 elements from the buffer which makes sense since I am passing in "1" as the second parameter. The documentation for this method says: "This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices." So I tried modifying the shader with a fixed size array large enough to accomodate most of my scenarios: uniform mat4 u_MVPMatrix[1000]; But this lead to an error in the shader: cannot convert from 'uniform array of 4X4 matrix of float' to 'Position 4-component vector of float' This just seems wrong anyway as it's not clear to me how the shader would know when to transition to the next matrix anyway. Anyone have an idea how I can get my shader to pick up a different MVP matrix (i.e. the NEXT 16 floats) from my MVP buffer for every 4 vertices it encounters? (I am using GL_TRIANGLE_STRIP so each sprite has 4 vertices). Thanks!

    Read the article

  • Access Control Service v2: Registering Web Identities in your Applications [code]

    - by Your DisplayName here!
    You can download the full solution here. The relevant parts in the sample are: Configuration I use the standard WIF configuration with passive redirect. This kicks automatically in, whenever authorization fails in the application (e.g. when the user tries to get to an area the requires authentication or needs registration). Checking and transforming incoming claims In the claims authentication manager we have to deal with two situations. Users that are authenticated but not registered, and registered (and authenticated) users. Registered users will have claims that come from the application domain, the claims of unregistered users come directly from ACS and get passed through. In both case a claim for the unique user identifier will be generated. The high level logic is as follows: public override IClaimsPrincipal Authenticate( string resourceName, IClaimsPrincipal incomingPrincipal) {     // do nothing if anonymous request     if (!incomingPrincipal.Identity.IsAuthenticated)     {         return base.Authenticate(resourceName, incomingPrincipal);     } string uniqueId = GetUniqueId(incomingPrincipal);     // check if user is registered     RegisterModel data;     if (Repository.TryGetRegisteredUser(uniqueId, out data))     {         return CreateRegisteredUserPrincipal(uniqueId, data);     }     // authenticated by ACS, but not registered     // create unique id claim     incomingPrincipal.Identities[0].Claims.Add( new Claim(Constants.ClaimTypes.Id, uniqueId));     return incomingPrincipal; } User Registration The registration page is handled by a controller with the [Authorize] attribute. That means you need to authenticate before you can register (crazy eh? ;). The controller then fetches some claims from the identity provider (if available) to pre-fill form fields. After successful registration, the user is stored in the local data store and a new session token gets issued. This effectively replaces the ACS claims with application defined claims without requiring the user to re-signin. Authorization All pages that should be only reachable by registered users check for a special application defined claim that only registered users have. You can nicely wrap that in a custom attribute in MVC: [RegisteredUsersOnly] public ActionResult Registered() {     return View(); } HTH

    Read the article

  • Mouse Not Working Properly

    - by James
    I just did a clean install of Ubuntu 11.10 but for some reason the mouse isn't working properly. Problems I'm experiencing are: left button on the mouse doesn't work, the cursor doesn't highlight anything, as well, the right side will not do a double click function. Doesn't seem to bring up the mouse menu to "go back" as well, "go forward" options. In order to make things work, I have to use the Enter key, and arrow keys.

    Read the article

  • NUnit SetUp and TearDown

    - by Lijo
    I have some experience in MS Test but new to NUnit. Whether NUnit [Setup] is corresponding to [ClassInitialize] or [TestInitialize] in MS Test? What is the NUnit attribute corresponding to [TestInitialize]? REFERENCE: http://stackoverflow.com/questions/1873191/testinitialize-gets-fired-for-every-test-in-my-visual-studio-unit-tests http://stackoverflow.com/questions/4602288/nunit-testcontext-currentcontext-test-not-working

    Read the article

  • How to get around the Circular Reference issue with JSON and Entity

    - by DanScan
    I have been experimenting with creating a website that leverages MVC with JSON for my presentation layer and Entity framework for data model/database. My Issue comes into play with serializing my Model objects into JSON. I am using the code first method to create my database. When doing the code first method a one to many relationship (parent/child) requires the child to have a reference back to the parent. (Example code my be a typo but you get the picture) class parent { public List<child> Children{get;set;} public int Id{get;set;} } class child { public int ParentId{get;set;} [ForeignKey("ParentId")] public parent MyParent{get;set;} public string name{get;set;} } When returning a "parent" object via a JsonResult a circular reference error is thrown because "child" has a property of class parent. I have tried the ScriptIgnore attribute but I lose the ability to look at the child objects. I will need to display information in a parent child view at some point. I have tried to make base classes for both parent and child that do not have a circular reference. Unfortunately when I attempt to send the baseParent and baseChild these are read by the JSON Parser as their derived classes (I am pretty sure this concept is escaping me). Base.baseParent basep = (Base.baseParent)parent; return Json(basep, JsonRequestBehavior.AllowGet); The one solution I have come up with is to create "View" Models. I create simple versions of the database models that do not include the reference to the parent class. These view models each have method to return the Database Version and a constructor that takes the database model as a parameter (viewmodel.name = databasemodel.name). This method seems forced although it works. NOTE:I am posting here because I think this is more discussion worthy. I could leverage a different design pattern to over come this issue or it could be as simple as using a different attribute on my model. In my searching I have not seen a good method to overcome this problem. My end goal would be to have a nice MVC application that heavily leverages JSON for communicating with the server and displaying data. While maintaining a consistant model across layers (or as best as I can come up with).

    Read the article

  • MacBook Pro (5,3) Keyboard Weirdness

    - by schwuk
    My MacBook Pro (5,3) works almost completely OOTB (with restricted video and WiFi drivers), but I am experiencing some keyboard weirdness. Specifically to get either (` and ~) or (´ and ¨) I have to press the key twice. Only these two keys behave this way - every other key mapping works. Keyboard settings are: Model: Apple Laptop (due to #538474) Layout: United Kingdom Macintosh (International)

    Read the article

  • Can I use wikipedia/commons images to create a logo for my program?

    - by bitmask
    I'm not perfectly clear on the implications of the GFDL for reusing pictures in this manner. Would adding a reference in the git's root folder's README suffice, or would that clutter every use of the logo, as you would have to attribute all original contributors on every single usage (like, e.g. presentations, flyers, websites, ...)? The software itself qualifies as FOSS, although it doesn't have a GNU* license.

    Read the article

  • Button in C#

    Button class in Windows Forms represents a Button control. A Button control is a child control placed on a Form and used to process click event and can be clicked by a mouse click or by pressing ENTER or ESC keys.

    Read the article

  • Ubuntu 12.10 wont fully load

    - by Steve
    I want to try Ubuntu from my 16Gb stick without ditching Win7 just yet. Everything boots up fine, I get the spash screen, I get the question screen (Do you want to try Ubuntu or install (or something like that)) I select try and then my screen goes black with what appears to be a DOS prompt. No keyboard keys work at this time. Have tried re-downloading Ubuntu, rebooting etc. Any help very much appreciated. Regards Steve

    Read the article

  • Easy QueryBuilder - A User-Friendly Ad-Hoc Advanced Search Solution

    Constructing an easy and powerful QueryBuilder interface becomes more important for complex data grid filtering and accurate reporting services. In this article, I'll discuss how to build a query search engine using ASP.NET AJAX and dynamic SQL. The main goal is to provide an interactive interface to allow users select query attributes, operators, attribute values, and T-SQL operators so that the data context query list can be easily composed and a search engine is invoked.

    Read the article

  • Cheat implementation

    - by user5925
    I have added an interface to input cheats, and of course the backend of this. Current cheats include: unlimited health unlimited time faster movement no need to use keys (i have a door/key system) triple firing lasers (normally there is only one) grenades (changes your weapon to grenades) But the question is, how will i tell the user the cheat codes? Normally cheats would be sold by the programmer, but this isn't that sort of game currently!

    Read the article

  • Compiz Cube bindings don't seem to work

    - by Giancarlo Palmiotti
    I have been trying to get the 3D Cube to work however, despite setting a combination for various keys from S1 (VAIO/VAIOFW) to F7 to no avail. What is "Primary" and I am not going to use the "Rotate Cube" as I have a touchpad and I cannot use the Keyboard functions if I am correct? I've tried several other similar questions while asking this but they do not seem to work. Ubuntu-12.04.1 LTS Sincerely: Giancarlo Palmiotti

    Read the article

  • Putty-like copy/paste

    - by BarsMonster
    For ages I've been using Putty when working with *nix servers, and I really got used to it's copy&paste method: select, left-click - for copy, just right-click - for paste. How can I set Ubuntu terminal the same way? I see there is a shortcuts configuration, but it does not allow me to set keys I need. Ctrl+Shift+C, Ctrl+Shift+V is just braking my fingers. I know there is a menu on right-click, but I don't need it.

    Read the article

  • How to fix laggy mouse and keyboard on Ubuntu 10.04 LTS 64bit?

    - by Goi
    I've just installed Ubuntu 10.04 LTS 64bi on my i5-2400 system, and I'm experiencing very laggy keyboard and mouse input. I have to type really slowly or I some keys will not get registered. Also, the mouse cursor moves around very slowly at a very low frame rate. I've checked my keyboard and mouse settings and they seem to be fine. System monitor doesn't show any processes taking up significant CPU utilization. What else could be wrong?

    Read the article

  • How would one build a relational database on a key-value store, a-la Berkeley DB's SQL interface?

    - by coleifer
    I've been checking out Berkeley DB and was impressed to find that it supported a SQL interface that is "nearly identical" to SQLite. http://docs.oracle.com/cd/E17076_02/html/bdb-sql/dbsqlbasics.html#identicalusage I'm very curious, at a high-level, how this kind of interface might have been architected. For instance: since values are "transparent", how do you efficiently query and sort by value how are limits and offsets performed efficiently on large result sets how would the keys be structured and serialized for good average-case performance

    Read the article

  • Silverlight and WCF caching

    - by subodhnpushpak
    There are scenarios where Silverlight client calls WCF (or REST) service for data. Now, if the data is cached on the WCF layer, the calls can take considerable resources at the server if NOT cached. Keeping that in mind along with the fact that cache is an cross-cutting aspect, and therefore it should be as easy as possible to put Cache wherever required. The good thing about the solution is that it caches based on the inputs. The input can be basic type of any complex type. If input changes the data is fetched and then cached for further used. If same input is provided again, data id fetched from the cache. The cache logic itself is implemented as PostSharp aspect, and it is as easy as putting an attribute over service call to switch on cache. Notice how clean the code is:        [OperationContract]       [CacheOnArgs(typeof(int))] // based on actual value of cache        public string DoWork(int value)        {            return string.Format("You entered: {0} @ cached time {1}", value, System.DateTime.Now);        } The cache is implemented as POST Sharp as below 1: public override void OnInvocation(MethodInvocationEventArgs eventArgs) 2: { 3: try 4: { 5: object value = new object(); 6: object[] args = eventArgs.GetArgumentArray(); 7: if (args != null || args.Count() > 0) 8: { 9:   10: string key = string.Format("{0}_{1}", eventArgs.Method.Name, XMLUtility<object>.GetDataContractXml(args[0], null));// Compute the cache key (details omitted). 11:   12: 13: value = GetFromCache(key); 14: if (value == null) 15: { 16: eventArgs.Proceed(); 17: value = XMLUtility<object>.GetDataContractXml(eventArgs.ReturnValue, null); 18: value = eventArgs.ReturnValue; 19: AddToCache(key, value); 20: return; 21: } 22:   23:   24: Log(string.Format("Data returned from Cache {0}",value)); 25: eventArgs.ReturnValue = value; 26: } 27: } 28: catch (Exception ex) 29: { 30: //ApplicationLogger.LogException(ex.Message, Source.UtilityService); 31: } 32: } 33:   34: private object GetFromCache(string inputKey) { if (ServerConfig.CachingEnabled) { return WCFCache.Current[inputKey]; } return null; }private void AddToCache(string inputKey,object outputValue) 35: { 36: if (ServerConfig.CachingEnabled) 37: { 38: if (WCFCache.Current.CachedItemsNumber < ServerConfig.NumberOfCachedItems) 39: { 40: if (ServerConfig.SlidingExpirationTime <= 0 || ServerConfig.SlidingExpirationTime == int.MaxValue) 41: { 42: WCFCache.Current[inputKey] = outputValue; 43: } 44: else 45: { 46: WCFCache.Current.Insert(inputKey, outputValue, new TimeSpan(0, 0, ServerConfig.SlidingExpirationTime), true); 47:   48: // _bw.DoWork += bw_DoWork; 49: //string arg = string.Format("{0}|{1}", inputKey,outputValue); 50: //_bw.RunWorkerAsync(inputKey ); 51: } 52: } 53: } 54: }     The cache class can be extended to support Velocity / memcahe / Nache. the attribute can be used over REST services as well. Hope the above helps. Here is the code base for the same.   Please do provide your inputs / comments.

    Read the article

  • SQL Server Management Studio keyboard shortcuts - Part 1

    As responsibilities are growing every day, a DBA or developer needs to improve his/her productivity. One way to do this is to use as many shortcuts as possible instead of using your mouse and the menus. In this tip we take a look at common tasks you may perform when using SSMS and the associated shortcut keys. SQL Backup Pro SQL Backup Pro was the smartest kid at school. Discover why.

    Read the article

  • No public key GPG error when submitting quickly application

    - by Roberto
    I try to submit my app with the command in the title, but the build failed: Error message: W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY * * is my key (don't know it is safe to share it) If i run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ****** It is said my key isn't change (so don't need to add it again). Any idea?

    Read the article

  • Strategy for avoiding duplicate object ids for data shared across devices using iCloud

    - by rmaddy
    I have a data intensive iOS app that is not using CoreData nor does it support iCloud synching (yet). All of my objects are created with unique keys. I use a simple long long initialized with the current time. Then as I need a new key I increment the value by 1. This has all worked well for a few years with the app running isolated on a single device. Now I want to add support for automatic data sync across devices using iCloud. As my app is written, there is the possibility that two objects created on two different devices could end up with the same key. I need to avoid this possibility. I'm looking for ideas for solving this issue. I have a few requirements that the solution must meet: 1) The key needs to remain a single integral data type. Converting all existing keys to a compound key or to a string or other type would affect the entire code base and likely result in more bugs than it's worth. 2) The solution can't depend on an Internet connection. A user must be able to run the app and add data even with no Internet connection. The data should still resolve properly later when the data syncs through iCloud once a connection is available. I'll accept one exception to this rule. If no other option is available, I may be open to requiring an Internet connection the first time the app's data is initialized. One idea I have been toying around with in my head is logically splitting the integer key into two parts. The high 4 or 5 bits could be used as some sort of device id while the rest represents the actual key. The fuzzy part is figuring out how to come up with non-conflicting device ids that fit in a few bits. This should be viable since I don't need to deal will millions of devices. I just need to deal with the few devices that would be shared by a given iCloud account. I'm open to suggestions. Thanks.

    Read the article

  • How do I change my username?

    - by Takkat
    Some time ago when I installed Ubuntu I chose a rather stupid username for my account that I do not want to use anymore. How do I change this (including the name of my home directory) without loosing settings for applications? How do I keep permissions and my keys for various authentification (e.g. email, SSH, GPG and more)? What settings could possibly get lost if I changed my username? Both, command-line and graphical solutions are appreciated.

    Read the article

  • What is the shortcut key to skip the song in rhythmbox?

    - by orca
    When Rhythmbox is not active/not focused and when I am on some other application window. How to skip/stop/resume songs that are playing in Rhythmbox. Is there any shortcut key to do that? I know when I am on Ubuntu desktop I can press Alt+10 to get the focus of indicator applets from there I can navigate to Rhythmbox and use arrow keys to skip it ( <- / - ) but is there any other direct shortcut to do this? Thanks

    Read the article

  • ubuntu 14.04 freezes randomly

    - by rajesh chowdary
    I have installed Ubuntu 14.04 version along side with windows 7. Ubuntu freezes randomly I am unable to use any keys on keyboard since they are not working even mouse is not working.the only solution to get off from this freeze is restarting my computer.I have ATi/AMD graphic card but I removed it before installing Ubuntu 14.04.I have run memory test no problem with ram.please give some solution to get rid of this abnormal freeze. thanks in advance. system configuration CPU=Intel core 2 duo e7500 2.93ghz motherboard=Intel dg41wv hard disk=Seagate 500gb ram=4gb

    Read the article

  • An Introduction to Keyword Research

    Everyone knows that good keyword research is one of the keys to getting people to go to your website. When they type in certain search keywords or keyword phrases, you want them to find you! Here's an introduction to keyword research.

    Read the article

< Previous Page | 161 162 163 164 165 166 167 168 169 170 171 172  | Next Page >