Search Results

Search found 7801 results on 313 pages for 'lazy loading'.

Page 43/313 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • Efficient counting of an association’s association

    - by Matthew Robertson
    In my app, when a User makes a Comment in a Post, Notifications are generated that marks that comment as unread. class Notification < ActiveRecord::Base belongs_to :user belongs_to :post belongs_to :comment class User < ActiveRecord::Base has_many :notifications class Post < ActiveRecord::Base has_many :notifications I’m making an index page that lists all the posts for a user and the notification count for each post for just that user. # posts controller @posts = Post.where( :user_id => current_user.id ) .includes(:notifications) # posts view @posts.each do |post| <%= post.notifications.count %> This doesn’t work because it counts notifications for all users. What’s an efficient way to do this without running a separate query for each post?

    Read the article

  • Problem loading XMLDocument with non standard tags

    - by David Conde
    Hi, I have a code needed to load an XML document from a reader, something like this: private static XmlDocument GetDocumentStream(string xmlAddress) { var settings = new XmlReaderSettings(); settings.DtdProcessing = DtdProcessing.Ignore; settings.ValidationFlags = XmlSchemaValidationFlags.None; var reader = XmlReader.Create(xmlAddress, settings); document.Load(reader); return document; } But in my XML document, I have nodes like this one: <link rel="edit-media" title="Package" href="Packages(Id='51Degrees.mobi',Version='0.1.11.9')/$value" /> Is to my understanding that the node should be like <link rel="edit-media" title="Package"></link> But, I don't create the Xml document and I certainly don't want to change it, but when I try to load the XML document, the document.Load line throws an exception. To be more specific, the XML file is the RSS source for the nuPack project. Any ideas would be very appreaciated on how to be able to read this document properly.

    Read the article

  • [OpenGl] Loading new texture into already defined texture name

    - by Dan Vogel
    I have an OpenGl program in which I am displaying an image using textures. I want to be able to load a new image to be displayed. In my Init function I call: Gl.glGenTextures(1, mTextures); Since only one image will be displayed at time, I am using the same texture name for each image. Each time a new image is loaded I call the following: Gl.glBindTexture(Gl.GL_TEXTURE_2D, mTexture[0]); Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_LUMINANCE, mTexSizeX, mTexSizeY, 0, Gl.GL_LUMINANCE, Gl.GL_UNSIGNED_SHORT, mTexBuffer); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_LINEAR); The first image will display as expected. However, all images load after the first, display as all black. What am I doing wrong?

    Read the article

  • Cufon JS is not loading

    - by UXdesigner
    I've developed a website in html/css and it works perfectly fine. Now I'm working with the coder, integrating this to a .NET framework, changing the website to .apsx instead of html, but during the build of the website, the only error that is marked is the load of Cufon , it simply can't load and the structure and syntax of all the commands are the same I used with the html site that actually works. There are no path problems so far. What do you guys think would be this problem ? Thank you for your kind help.

    Read the article

  • AndEngine Physics Editor loading level

    - by Khawar Raza
    I have created a .pes file using PhysicsEditor and imported as xml and have added to my project. When I parsed it and created bodies, it is showing strange behavior. The mapping of bodies that I created in PhysicsEditor is totally different what I see in my application means the shapes I draw in PhysicsEditor are rendering differently in my app. Here is my xml and code to parse and add bodies to scene. PhysicsEditor XML file: <?xml version="1.0" encoding="UTF-8"?> <!-- created with http://www.physicseditor.de --> <bodydef version="1.0"> <bodies numBodies="1"> <body name="car_path" dynamic="false" numFixtures="1"> <fixture density="2" friction="1" restitution="0" filter_categoryBits="1" filter_groupIndex="0" filter_maskBits="65535" isSensor="false" type="POLYGON" numPolygons="20" > <polygon numVertexes="6"> <vertex x="277.0000" y="152.0000" /> <vertex x="356.0000" y="172.0000" /> <vertex x="413.0000" y="194.0000" /> <vertex x="476.0000" y="223.0000" /> <vertex x="173.0000" y="232.0000" /> <vertex x="174.0000" y="148.0000" /> </polygon> <polygon numVertexes="4"> <vertex x="1556.0000" y="221.0000" /> <vertex x="1142.0000" y="94.0000" /> <vertex x="1255.0000" y="-15.0000" /> <vertex x="1554.0000" y="-14.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="-192.0000" y="177.0000" /> <vertex x="-888.0000" y="139.0000" /> <vertex x="-549.0000" y="-125.0000" /> </polygon> <polygon numVertexes="6"> <vertex x="1762.0000" y="24.0000" /> <vertex x="1862.0000" y="27.0000" /> <vertex x="1927.0000" y="68.0000" /> <vertex x="2078.0000" y="222.0000" /> <vertex x="1643.0000" y="212.0000" /> <vertex x="1642.0000" y="38.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="-1150.0000" y="146.0000" /> <vertex x="-1776.0000" y="140.0000" /> <vertex x="-1476.0000" y="-25.0000" /> </polygon> <polygon numVertexes="4"> <vertex x="-2799.0000" y="103.0000" /> <vertex x="-2684.0000" y="223.0000" /> <vertex x="-3112.0000" y="256.0000" /> <vertex x="-3108.0000" y="98.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="3112.0000" y="255.0000" /> <vertex x="2422.0000" y="222.0000" /> <vertex x="3120.0000" y="-71.0000" /> </polygon> <polygon numVertexes="4"> <vertex x="1142.0000" y="94.0000" /> <vertex x="1556.0000" y="221.0000" /> <vertex x="709.0000" y="226.0000" /> <vertex x="911.0000" y="93.0000" /> </polygon> <polygon numVertexes="6"> <vertex x="-2111.0000" y="89.0000" /> <vertex x="-2067.0000" y="94.0000" /> <vertex x="-2002.0000" y="139.0000" /> <vertex x="-2344.0000" y="223.0000" /> <vertex x="-2196.0000" y="112.0000" /> <vertex x="-2153.0000" y="91.0000" /> </polygon> <polygon numVertexes="4"> <vertex x="105.0000" y="233.0000" /> <vertex x="-94.0000" y="178.0000" /> <vertex x="69.0000" y="106.0000" /> <vertex x="91.0000" y="104.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="-2002.0000" y="139.0000" /> <vertex x="-2067.0000" y="94.0000" /> <vertex x="-2032.0000" y="110.0000" /> </polygon> <polygon numVertexes="4"> <vertex x="-1150.0000" y="146.0000" /> <vertex x="105.0000" y="233.0000" /> <vertex x="-2344.0000" y="223.0000" /> <vertex x="-2002.0000" y="139.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="413.0000" y="194.0000" /> <vertex x="356.0000" y="172.0000" /> <vertex x="376.0000" y="176.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="105.0000" y="233.0000" /> <vertex x="-192.0000" y="177.0000" /> <vertex x="-94.0000" y="178.0000" /> </polygon> <polygon numVertexes="4"> <vertex x="105.0000" y="233.0000" /> <vertex x="-1150.0000" y="146.0000" /> <vertex x="-888.0000" y="139.0000" /> <vertex x="-192.0000" y="177.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="3112.0000" y="255.0000" /> <vertex x="-3112.0000" y="256.0000" /> <vertex x="-2684.0000" y="223.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="3112.0000" y="255.0000" /> <vertex x="1556.0000" y="221.0000" /> <vertex x="1643.0000" y="212.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="709.0000" y="226.0000" /> <vertex x="173.0000" y="232.0000" /> <vertex x="476.0000" y="223.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="3112.0000" y="255.0000" /> <vertex x="2078.0000" y="222.0000" /> <vertex x="2422.0000" y="222.0000" /> </polygon> <polygon numVertexes="3"> <vertex x="3112.0000" y="255.0000" /> <vertex x="105.0000" y="233.0000" /> <vertex x="173.0000" y="232.0000" /> </polygon> </fixture> </body> </bodies> <metadata> <format>1</format> <ptm_ratio></ptm_ratio> </metadata> </bodydef> And here is my code: private void loadLevel() { // TODO Auto-generated method stub AssetManager assetManager = getAssets(); try { InputStream stream = assetManager.open("tmx/path1.xml"); if(stream != null) { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(false); dbf.setIgnoringComments(false); dbf.setIgnoringElementContentWhitespace(true); dbf.setNamespaceAware(true); DocumentBuilder db = null; db = dbf.newDocumentBuilder(); Document document = db.parse(stream); Element root = document.getDocumentElement(); NodeList bodiesNodeList = root.getElementsByTagName("bodies"); for(int i = 0; i < bodiesNodeList.getLength(); i++) { BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyType.StaticBody; bodyDef.fixedRotation = true; Element bodiesElement = (Element)bodiesNodeList.item(i); NodeList bodyList = bodiesElement.getElementsByTagName("body"); for(int j = 0; j < bodyList.getLength(); j++) { Element bodyElement = (Element)bodyList.item(j); Body body = mPhysicsWorld.createBody(bodyDef); NodeList fixtureList = bodyElement.getElementsByTagName("fixture"); for(int k = 0; k < fixtureList.getLength(); k++) { Element fixtureElement = (Element)fixtureList.item(k); FixtureDef fixtureDef = new FixtureDef(); if(fixtureElement != null) { String density = fixtureElement.getAttribute("density"); String friction = fixtureElement.getAttribute("friction"); String restitution = fixtureElement.getAttribute("restitution"); fixtureDef = PhysicsFactory.createFixtureDef(Float.parseFloat(density), Float.parseFloat(friction), Float.parseFloat(restitution)); } NodeList polygonList = fixtureElement.getElementsByTagName("polygon"); if(polygonList != null && polygonList.getLength() > 0) { for(int m = 0; m < polygonList.getLength(); m++) { PolygonShape polyShape = new PolygonShape(); Element polygonElement = (Element)polygonList.item(m); NodeList vertexList = polygonElement.getElementsByTagName("vertex"); if(vertexList != null && vertexList.getLength() > 0) { Vector2 [] vectors = new Vector2[vertexList.getLength()]; for(int n = 0; n < vertexList.getLength(); n++) { Element vertexElement = (Element)vertexList.item(n); if(vertexElement != null) { float x = Float.parseFloat(vertexElement.getAttribute("x")); float y = Float.parseFloat(vertexElement.getAttribute("y")); vectors[n] = new Vector2(x/PIXEL_TO_METER_RATIO_DEFAULT, y/PIXEL_TO_METER_RATIO_DEFAULT); } } polyShape.set(vectors); fixtureDef.shape = polyShape; } body.createFixture(fixtureDef); } } } mScene.attachChild(bgSprite); mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(bgSprite, body, false, false)); } } } catch(Exception e) { e.printStackTrace(); } } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } Any idea where I am going wrong?

    Read the article

  • Lightbox not loading.

    - by Nimbuz
    // Lightbox $('a.lightbox').click(function () { $.getScript("js/lightbox.js", function () { alert('Load Complete'); $("a.lightbox").lightbox({ 'type': 'iframe', 'overlayOpacity': 0.6, 'width': 940, 'hideOnContentClick': false }); }); }); I want to load script on first request, but it doesn't seem to work, the page just redirects to the linked website, does not open iframe in lightbox. Thanks for your help.

    Read the article

  • Prism - loading modules causes activation error

    - by Noich
    I've created a small Prism application (using MEF) with the following parts: - Infrastructure project, that contains a global file of region names. - Main project, that has 2 buttons to load other modules. - ModulesInterfaces project, where I've defined an IDataAccess interface for my DataAccess module. - DataAccess project, where there are several files but one main DataAccess class that implements both IDataAccess and IModule. When the user click a button, I want to show him a list of employees, so I need the DataAccess module. My code is as follows: var namesView = new EmployeesListView(); var namesViewModel = new EmployeesListViewModel(employeeRepository); namesView.DataContext = namesViewModel; namesViewModel.EmployeeSelected += EmployeeSelected; LocateManager(); manager.Regions["ContentRegion"].Add(new NoEmployeeView(), "noEmployee"); manager.Regions["NavigationRegion"].Add(namesView); I get an exception in my code when I'm trying to get DataAccess as a service (via ServiceLocator). I'm not sure if that's the right way to go, but trying to get it from the ModuleCatalog (as a type IDataAccess returns an empty enumeration). I'd appreciate some directions. Thanks. The problematic code line: object instance = ServiceLocator.Current.GetInstance(typeof(DataAccess.DataAccess)); The exact exception: Activation error occured while trying to get instance of type DataAccess, key "" The inner exception is null, the stack trace: at Microsoft.Practices.Prism.MefExtensions.MefServiceLocatorAdapter.DoGetInstance(Type serviceType, String key) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism.MefExtensions\MefServiceLocatorAdapter.cs:line 76 at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) Edit The same exception is thrown for: container = (CompositionContainer)ServiceLocator.Current.GetInstance(typeof(CompositionContainer));

    Read the article

  • Loading an external SWF App in a new Air window with resize functionality

    - by t.stamm
    Hello everyone, i'm trying to load a local SWF Application in my Air Application via the SWFLoader class. The SWFLoader class is displayed in a new Window. Therefore, i'm trying to resize the window automatically, when the Flash Application is resizing. But here's the problem. The SWFLoader does not get any events when the loader App has been resized. The Problem seems to be the Sandbox Restrictions. I'm able to call methods in the childSandboxBridge and parentSandboxBridge Objects that i've set in the LoaderInfo of the SWFLoaders content (the loaded SWF Application). But i cannot listen to any ResizeEvents or something like that when i'm resizing the loaded App. I'm aware of the workaround with the Loader Class and the codeExecution Property, but i don't want to bypass the Air Sandbox - if possible. Can anyone help me with this? Thanks in advance

    Read the article

  • MKMapView Not Loading When Called on an NSThread?

    - by Chris
    I am creating a MKMapView in a method named "generateMap". From inside viewDidLoad, this works: [self generateMap]; but this causes the map to quickly load and then disappear, leaving only the blank grey grid: [NSThread detachNewThreadSelector:@selector(spinTheSpinner) toTarget:self withObject:nil]; Any ideas why this might be happening when I call the method through a thread?

    Read the article

  • Connecting a DomainContext and loading data manually in Silverlight 4 RC application

    - by Redburn
    I am new to WCF & RIA services and have what seems like a basic problem. I have multiple times in my silverlight 4 RC application dragged and dropped from my datasource window to my form and have returned information from the database. However I have a need to query the database for other information (Building a report) When I try to use the following code, I recieve no error, but I also do not get any information back from the service. //Global public UMSDomainContext _umsDomainContext = new UMSDomainContext(); //In the Initialization portion _umsDomainContext.Load(_umsDomainContext.GetUMOptionsQuery()); //Queries var name = from n in _umsDomainContext.UMOptions select n.DistrictName; var street1 = from c in _umsDomainContext.UMOptions select c.Address1; var street2 = from c in _umsDomainContext.UMOptions select c.Address2; var city = from c in _umsDomainContext.UMOptions select c.City; var zip = from c in _umsDomainContext.UMOptions select c.Zip; Im calling the current additional assem. using System.Linq; using System.ServiceModel.DomainServices.Client; using System.ComponentModel.DataAnnotations; using MTT.Web;

    Read the article

  • Post Loading ads - using appendChild to move an IFRAME with text link ads

    - by Prem
    I have changed code around to basically load an add the bottom of the page in a hidden div and attached an onload event handler that called document.getElementById(xxx).appendChild() to take the hidden ad and move it into the right spot in my page. This works GREAT.. however when the ad is a text ad it AFTER i move the ad there is nothing in the rendered Iframe. I did tests to see what it looks like before i move it and sure enough the text links load in the IFRAME but the second i do the appendChild call to move the div that contains the ad i seem to loose the contents of the Iframe. Any ideas whats going on <div id="myad" style="display: none;"> GA_googleFillSlot("MyADSlotName"); </div> <script> window.onload = function() { // leader board document.getElementById('adplaceholder').appendChild(document.getElementById('myAd')); document.getElementById('myAd').style.display = ''; </script> UPDATE: I think what the problem here is that on text ads google writes to the iframe directly inserting the relevant text links where are on other ads it uses the iframe to just point to some src. seems like when i do the appendchild, if there is no "src" set for the iframe after the copy is done the iframe in the new location contains nothing... guess it does a reload on the src? Any way around this??

    Read the article

  • Loading JSON-encoded AJAX content into jQuery UI tabs

    - by pocketfullofcheese
    We want our of our AJAX calls in our web app to receive JSON-encoded content. In most places this is already done (e.g. in modals) and works fine. However, when using jQueryUI's tabs (http://jqueryui.com/demos/tabs/) and their ajax functionality, only plaintext HTML can be returned (i.e. from the URLs specified in the a tags below). How do I get the tab function to recognize that on each tab's click, it will be receiving JSON-encoded data from the specified URL, and to load in the .content index of that JSON? $(function() { $('div#myTabs').tabs(); }); <div id="mytabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"> <li class="ui-state-default ui-corner-top"><a href="/url/one">Tab one</a></li> <li class="ui-state-default ui-corner-top"><a href="/url/two">Tab two</a></li> </ul> </div>

    Read the article

  • loading js files dynamically via another js file?

    - by mark smith
    Hi there, is there anyway to load other JS files from within a single JS file. I would like to point my individual pages "ITS" js file and that js file would load jquery, other js files. I know i can just pop all these into the html i.e. I was thinking of separations of concerns so i was wondering if anything exists already without me reinventing the wheel.... That i would just need to edit home.js to change what other js (jquery etc) are loaded for home.htm ... home.htm would just point to home.js Thanks

    Read the article

  • Loading Liferay Properties from Spring IoC container (to get jdbc connection parameters)

    - by mox601
    I'm developing some portlets for Liferay Portal 5.2.3 with bundled tomcat 6.0.18 using Spring IoC container. I need to map the User_ table used in Liferay database to an entity with Hibernate, so I need to use two different dataSources to separate the liferay db from the db used by portlets. My jdbc.properties has to hold all connection parameters for both databases: no problem for the one used by portlets, but I am having issues determining which database uses liferay to hold its data. My conclusion is that i should have something like this: liferayConnection.url=jdbc:hsqldb:${liferay.home}/data/hsql/lportal in order to get the database url dynamically loaded, according to Liferay properties found in portal-ext.properties. (Or, better, load the whole portal-ext.properties and read database properties from there). The problem is that the placeholder is not resolved: Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'liferayDataSource' defined in class path resource [WEB-INF/applicationContext.xml]: Could not resolve placeholder 'liferay.home' To dodge this problem I tried to load explicitly portal-ext.properties with a Spring bean: <bean id="liferayPropertiesConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:location="../../portal-ext.properties"/> but no luck: liferay.home is not resolved but there aren't other errors. How can I resolve the placeholder defined by Liferay? Thanks

    Read the article

  • Loading HTML into <div> with jQuery-ajax

    - by ehehhh
    Hello everyone, I ran into a bit of trouble while trying to load an external HTML page into a div using jQuery-ajax. I had this div: <div id="content"></div> and wanted to fill it with $("#content").load("include/add.html"); It loads the HTML file perfectly, but inside that add.html is a button that should load add2.html(also using .load), but it seems that neither the button nor the datepicker in that file won't work. I'm guessing the .load function is responsible for that? This is the content of add2.html: <p>Nr: <input type="text"></input></p> <p>Name: <input type="text"></input></p> <p>Date: <input type="text" id="datepicker"></input></p> <a href="#" id="button1">Next</a> Please help, I'm desperate :D

    Read the article

  • Jersey / ServletContext and resource loading on startup.

    - by Raphael Jolivet
    Hello, I'm kind of new in web development with Java. I am developing a web service and I've chosen REST / Jersey for it. I want to init some stuff on startup of the service and to keep them all along the life of the service. First question : Is the constructor of the Jersey Servlet a good place to do that ? Basically, what I want to do is to load a config.ini file located in my WEB-INF directory. Following this help, I understand I need a ServletContext to load my file as a resource. However, it is not clear to me how to get this ServletContext in a Jersey Servlet, as it is not really an instance of a servlet, but rather a POJO with some annotations. I wanted to try this tip, but the attribute "context" is null in the constructor. I think that Jersey might populate it after the constructor. Right ? So how is the right way to do this ? Here is my code so far : /** Main REST servlet */ @Path("/") public class Servlet { // ---------------------------------------------------- // Constants // ---------------------------------------------------- static private final String CONFIG_PATH = "/WEB-INF/config.ini"; // ---------------------------------------------------- // Attributes // ---------------------------------------------------- /** Context */ @Context ServletContext context; // ---------------------------------------------------- // Constructor // ---------------------------------------------------- /** Init the servlet */ public Servlet() { // Load config.ini from WEB-INF Config.config = new Config( this.context.getResourceAsStream(CONFIG_PATH)); // FAIL! this.context is null ... } // ---------------------------------------------------- // URI Handlers // ---------------------------------------------------- /** Welcome page */ @GET @Path("/") @Produces(MediaType.TEXT_HTML) public String welcome() { return "<h1>Hi there.</h1>"; } } Any help would be much appreciated. Thanks in advance, Raphael

    Read the article

  • Problem when loading image from google chart api URL

    - by user304839
    I want to show concentric charts of google api in iphone, but the imageData varible returns null value and image does not loaded from url to image view this is code: NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://chart.apis.google.com/chart?cht=pc&chd=t:120,45|120,60,50,70,60&chs=300x200&chl=||helo|wrd|india|pak|ban&chco=FFFFFF|FFFFFF,e72a28|a9d331|ffce08|8a2585|184a7d"]]; NSLog(@"%@",imageData); UIImage *myimage = [[UIImage alloc] initWithData:imageData]; self.myImageView.image=myimage; please any one help me to overcome on this problem

    Read the article

  • jTabbedPane opens different tab on loading

    - by Santeron
    Hey mates, First of all I'm using netbeans as my IDE and I don't know if this is causing it. When I run my program (even if I have build it and run the .jar) I think it selects the tab that was previously selected (before quiting). So if for example I close the app with the third tab selected, it starts up with that selected again. Is there a known solution for this? The selectedIndex property on the jTabbedPane is set to 0. Shouldn't this property be the default onLoad value? Thx in advance, Jimmy PS. BTW for some reason it didn't submit my question in Opera (?)

    Read the article

  • loading "child page" inside "parent page" through javascript and functionality of "child page" throws ERROR

    - by user1304589
    i have a masterpage. Its content place holder i.e page "parent page", contains a button "Call Batch". On click "Call Batch", the "child page" is loaded in div of "parent page" using javascript without refresh! Now this "Child Page" contains a label and a button. On click of button the text of label shoud change. I want the functionality of "child page" on "parent page". I got the "child page" in "parent page" div but the functionality of "child page" is lost and i am getting error.Where to put the code of button click event which changes the text of label? Please Help.

    Read the article

  • question about joGL (glTexImage2D)

    - by Nour
    Hi everybody I was trying to load a texture using joGL library but it seems that something is missing when using this method glTexImage2D at : IOStream wdis = new IOStream(fileName); wdis.skipBytes(18); int width = wdis.readIntW(); // dis.skipBytes(2); int height = wdis.readIntW(); // dis.skipBytes(2); wdis.skipBytes(28); byte buf[] = new byte[wdis.available()]; wdis.read(buf); wdis.close(); gl.glBindTexture(GL.GL_TEXTURE_2D, BMPtextures[index]); gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, 3, width, height, 0, GL.GL_BGR, GL.GL_UNSIGNED_BYTE, buf); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); as IOStream is a class that extends DataInputStream it shows a message that glTexImage2D(int,int,int,int,int,int,int,int,byte[]) is not found at javax.media.opengl.GL I couldn't figure the problem her because it's an open source code and it seems to work perfectly with my friends but unfortunately not with me even though we are using the same library and the same JDK version what shall I do ??

    Read the article

  • NSBundle loading a NSViewController

    - by Staros
    Hey all, I'm looking into a project that would upload custom NSBundles that include a NSViewController. In my main program I've got this code to deal with the bundle after it's been loaded... id principalClass = [loadedBundle principalClass]; id instance = [[principalClass alloc] init]; [localLabel setStringValue:[instance name]]; NSView *incomingView = [[instance viewController] view]; [localView addSubview:incomingView]; [localView display]; And the principal classes init method in the bundle looks like this... -(id) init { if(self = [super init]){ name = @"My Plugin"; viewController = [[ViewController alloc] initWithNibName:@"View" bundle:nil]; } return self; } View.nib is a nib located in the bundles project. But whenever I load the bundle I get this error... 2010-05-27 09:11:18.423 PluginLoader[45032:a0f] unable to find nib named: View in bundle path: (null) 2010-05-27 09:11:18.424 PluginLoader[45032:a0f] -[NSViewController loadView] could not load the "View" nib. I know I've got everything wired up because the line [label setStringValue:[instance name]]; sets the label text correctly. Plus, if I take all of the clases in the bundle and load them into my main applications project everything works as expect. Any thoughts on how I can correctly reference "View" in my bundle? Thanks!

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >