Daily Archives

Articles indexed Sunday October 7 2012

Page 10/14 | < Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >

  • Hosting multiple client website on single

    - by Bhavesh Gangani
    I'm WebDesiner and i've currently only a few clients for making website. i've unlimited hosting account and i want to host their websites in my account without reseller account ( actually it is not needed for constness). only my client's need is ftp access to their personal directory. so as i questioned it is possible to give them saperate phpmyadmin access in this strategy ? as per my knowledge it is done with "addon" domain pointing on my hosting account's directory with cpanel, am i right ? or there is another solution for it except reseller account ?

    Read the article

  • What is the best language to learn for WEB Development? [closed]

    - by Spoon Yukina
    I'm an IT student in my second year, and I want to learn a web development language, but I'm confused to choose between these languages: Django-J2EE-PHP-ASP.NET-Ruby & Rails, So what is the best language to learn of these, And which management database can be work perfectly with it? note that I learned these languages: C# - C - Assembly language - Python, for web development : HTML-CSS-JavaScript and for management database : SQL SERVER - ACCESS and for the moment I'm learning Java and C++

    Read the article

  • In China. Want to set up my own private proxy. Already have website/webhosting. Help please! n00b with respect to coding/programming, go easy on me [closed]

    - by user1725461
    I am in China and have used freegate in the past -- http://en.wikipedia.org/wiki/Freegate Recently I've been having too many problems with that and some other web-based proxies I usually use. I have a website that is hosted in the US which I can access from China. Is there an easy way for me to setup my own secure private proxy? I'm sick of all my internet problems and looking for a new workable solution. Thank you! PS: and I really hope this is the right place for such a question...

    Read the article

  • How to open the JavaScript console in different browsers?

    - by Šime Vidas
    Updated on October 7th 2012 Chrome: Press either CTRL + SHIFT + J to open the "Console" tab of the Developer Tools. Alternative method: Press either CTRL + SHIFT + I or F12 to open the Developer Tools. Press ESC (or click on "Show console" in the bottom right corner) to slide the console up. Note: In Chrome's dev tools, there is a "Console" tab. However, a smaller "slide-up" console can be opened while any of the other tabs is active. Safari: Press CTRL + ALT + I to open the Web Inspector. See Chrome's step 2. (Chrome and Safari have pretty much identical dev tools.) Note: Step 1 only works if the "Show Develop menu in menu bar" check box in the Advanced tab of the Preferences menu is checked! IE9: Press F12 to open the developer tools. Click the "Console" tab. Firefox: Press CTRL + SHIFT + K to open the Web console. or, if Firebug is installed (recommended): Press F12 to open Firebug. Click on the "Console" tab. Opera: Press CTRL + SHIFT + I to open Dragonfly. Click on the "Console" tab.

    Read the article

  • Using multiplication and division with delta time

    - by tesselode
    Using delta time with addition and subtraction is easy. player.x += 100 * dt However, multiplication and division complicate things a bit. For example, let's say I want the player to double his speed every second. player.x = player.x * 2 * dt I can't do this because it'll slow down the player (unless delta time is really high). Division is the same way, except it'll speed things way up. How can I handle multiplication and division with delta time?

    Read the article

  • Repeat a part of spritesheet as background

    - by Moiblpadde
    So I'm trying to repeat a part of my spritesheet as a background (js, canvas). My code so far: var canvas = $("#board")[0], ctx = canvas.getContext("2d"), sprite = new Image(); sprite.src = "spritesheet.png"; sprite.onload = function(){ ctx.fillStyle = ctx.createPattern(spriteBg, "repeat"); ctx.fillRect(0, 25, 500, 500); } This is fine, but as you can see, it repeat the whole sprite, not just a part of it, and I just can't figure out how to do it D:

    Read the article

  • How does process of updating code with Continous Integration work?

    - by BleakCabalist
    I want to draw a model of process of updating the source code with the use of Continous Integration. The main issue is I don't really understand how it works when there are several programmers working on various aspects of the code at the same time. I can't visualize it in my mind. Here's what I know but I might be wrong: New code is sent to repository. Continous Integration server asks Version Control System if there is a new code in repository. If there is than CIS executes tests on the code. If tests show there are problems than CIS orders VCS to revert back to working wersion of the code and communicates it to programmer. If tests are passed positively it compiles the repository code and makes new build of a game? New build is made not after ever single change, but at the end of the day I believe? Are my assumptions above correct? If yes, does it also work when there are several programmers updating repository at once? Is this enough to draw a model of the process in your opinions or did I miss something? Also, what software would I need for above process? Can you guys give examples for CIS software and VCS software and whatever else I need? Does CIS software perform code tests or do I need another tool for that and integrate it with CIS? Is there a repository software?

    Read the article

  • Extract derived 3D scaling from a 3D Sprite to set to a 2D billboard

    - by Bill Kotsias
    I am trying to get the derived position and scaling of a 3D Sprite and set them to a 2D Sprite. I have managed to do the first part like this: var p:Point = sprite3d.local3DToGlobal(new Vector3D(0,0,0)); billboard.x = p.x; billboard.y = p.y; But I can't get the scaling part correctly. I am trying this: var mat:Matrix3D = sprite3d.transform.getRelativeMatrix3D(stage); // get derived matrix(?) var scaleV:Vector3D = mat.decompose()[2]; // get scaling vector from derived matrix var scale:Number = scaleV.length; billboard.scaleX = scale; billboard.scaleY = scale; ...but the result is apparently wrong. PS. One might ask what I am trying to achieve. I am trying to create "billboard" 3D sprites, i.e. sprites which are affected by all 3D transformations except rotations, thus they always face the "camera".

    Read the article

  • Moving in a diamond - enemy gets stuck

    - by Fibericon
    I have an enemy that I would like to move as follows: Start at (0, 200, 0) Move to (200, 0, 0) Move to (0, -200, 0) Move to (-200, 0, 0) Move to start point, repeat as long as it remains active. This is what I've done to achieve that: if (position.X < 200 && position.Y > 0) { Velocity = new Vector3(1, -1, 0) * speed; } else if (position.X >= 200 && position.Y <= 0 && position.Y > -200) { Velocity = new Vector3(-1, -1, 0) * speed; } else if (position.X <= 0 && position.Y <= -200) { Velocity = new Vector3(-1, 1, 0) * speed; } else { Velocity = new Vector3(1, 1, 0) * speed; } It moves to the second point, but then gets stuck and appears to vibrate in place. How should I be doing this?

    Read the article

  • Issue with Mapping Textures to Models in Blender

    - by Passage
    I've been trying to texture a model using Blender, but when I draw on the UV Editor it doesn't show up on the model, and I can't draw on the model itself. I've tried saving the image and the 3D View is set to Texture. Everything seems to be in order and I've followed several tutorials, but none of them seem to work with the version I'm using (2.64-- update was necessary for import plugin) and I'm absolutely stumped. How can I draw textures to the model? If not within Blender itself, how do I export/import the textures? EDIT: Vertex Paint works, though it is insufficient for my purposes. In addition, moving to the rendered view produces a solid-color model with none of the applied textures.

    Read the article

  • draw bullet at the end of the barrel

    - by Alberto
    excuse my awkwardness, i have this code: [syntax="java"] int x2 = (int) (canon.getSceneCenterCoordinates()[0] + LENGTH_SPRITE/2* Math.cos(canon.getRotation())); int y2 = (int) (canon.getSceneCenterCoordinates()[1] + LENGTH_SPRITE/2* Math.sin(canon.getRotation())); projectile = new Sprite( (float) x2, (float) y2, mProjectileTextureRegion,this.getVertexBufferObjectManager() ); mMainScene.attachChild(projectile); [/syntax] and the bullet are drawn around the cannon in circle.. but not from the end of cannon :( help!

    Read the article

  • Matching process , issue with query

    - by Blerta Blerta
    i have this code which helps me match two different tables.. now, each of this tables, has a epos_id and a rbpos_id ! I have another table which has pairs of rbpos_id and epos_id, something like: id | epos_id | rbpos_id 1 a3566 465jd 2 hkiyb rbposi When i join this other table, i need to check this condition, i mean, the matching should be done, only and if, the epos_id and rbpos_id of the join i'm doing, have the same id,i mean, belong to the same row.. Here is my current query... Thanks! SELECT retailer.date, retailer.time, retailer.location, retailer.user_id,imovo.mobile_number ". "FROM retailer LEFT JOIN imovo ". " ON addtime(retailer.time, '0:0:50')>imovo.time AND retailer.time <imovo.time AND retailer.date=imovo.date

    Read the article

  • The best JSF coding pattern for editing JPA entities using @RequestScoped only

    - by AlanObject
    I am in a project where I will write a lot of pages like this, so I want to use the most efficient (to write) coding pattern. Background: In the past I have used CODI's @ViewAccessScoped to preserve state between requests, and more recently I have started using flash scoped objects to save state. I can't use JSF @ViewScoped because I use CDI and they don't play well together. So I want to see if I can do this with only @RequestScoped backing beans. The page is designed like this (the p namespace is Primefaces): <f:metadata> <f:viewParam name="ID" value="#{backing.id}" /> </f:metadata> .... <h1>Edit Object Page</h1> <h:form id="formObj" rendered="#{backing.accessOK}"> <p:panelGrid columns="2"> <h:outputLabel value="Field #1:"/> <p:inputText value="#{backing.record.field1}" /> (more input fields) <h:outputLabel value="Action:" /> <h:panelGroup> <p:commandButton value="Save" action="#{backing.save}" /> <p:commandButton value="Cancel" action="backing.cancel" /> </h:panelGroup> </p:panelGrid> <p:messages showDetail="true" showSummary="true" /> </h:form> If the page is requested, the method accessOK() has the ability to keep the h:form from being rendered. Instead, the p:messages is shown with whatever FacesMessage(s) the accessOK() method cares to set. The pattern for the bean backing looks like this: @Named @RequestScoped public class Backing { private long id; private SomeJPAEntity record; private Boolean accessOK; public long getId() { return id; } public void setId(long value) { id = value; } public boolean accessOK() { if (accessOK != null) return accessOK; if (getRecord() == null) { // add a FacesMessage that explains the record // does not exist return accessOK = false; // note single = } // do any other access checks, such as write permissions return accessOK = true; } public SomeJPAEntity getRecord() { if (record != null) return record; if (getId() > 0) record = // get the record from DB else record = new SomeJPAEntity(); return record; } public String execute() { if (!accessOK()) return null; // bad edit // do other integrity checks here. If fail, set FacesMessages // and return null; if (getId() > 0) // merge the record back into the data base else // persist the record } } Here is what goes wrong with this model. When the Save button is clicked, a new instance of Backing is built, and then there are a lot of calls to the getRecord() getter before the setID() setter is called. So the logic in getRecord() breaks because it cannot rely on the id property being valid when it is called. When this was a @ViewAccessScoped (or ViewScoped) backing bean, then both the id and record properties are already set when the form is processed with the commandButton. Alternatively you can save those properties in flash storage but that has its own problems I want to avoid. So is there a way to make this programming model work within the specification?

    Read the article

  • retrieving value from database in java

    - by Akcire Atienza
    I am making AGAIN another program that retrieves the inputted data/values of fields from the database I created. but this time, my inputted value will be coming from the JtextField I created. I wonder what's wrong in here bec when I'm running it the output is always null. in this program i will convert the inputted value of my JTextField into int. here it is: public class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { if(e.getSource() == extendB) { ExtensionForm extend = new ExtensionForm(); extend.setVisible(true); } else if(e.getSource()== searchB) { //get text from the textField String guest = guestIDTF.getText(); //parse the string to integer for retrieving of data int id = Integer.parseInt(guest); GuestsInfo guestInfo = new GuestsInfo(id); Room roomInfo = new Room(id); String labels[] = {guestInfo.getFirstName()+" "+guestInfo.getLastName(),""+roomInfo.getRoomNo(),roomInfo.getRoomType(),guestInfo.getTime(),"11:00"}; for(int z = 0; z<labels.length; z++) { labelDisplay[z].setText(labels[z]); } in my second class it retrieves the inputted values of fields from the database I created here's the code: import java.sql.*; public class Room { private String roomType; private int guestID, roomNo; private Connection con; private PreparedStatement statement; public Room(){ try { Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/3moronsdb","root",""); } catch (Exception e) { e.printStackTrace(); } } public Room(int guestsID) { this(); try{ statement = con.prepareStatement("SELECT * FROM guest WHERE guestID=?"); statement.setInt(1, guestID); ResultSet rs = statement.executeQuery(); while(rs.next()){ this.guestID = rs.getInt(1); this.roomType = rs.getString(2); this.roomNo = rs.getInt(3); } }catch(Exception e){ System.out.print(e); } } //Constructor for setting rate public Room(String roomType, int roomNo) { this(); try { statement = con.prepareStatement("Insert into room(roomType, roomNo) values(?,?)"); statement.setString(1, roomType); statement.setInt(2, roomNo); statement.executeUpdate(); } catch(Exception e) { e.printStackTrace(); return; } } //getting roomType public String getRoomType(){ return roomType; } //getting roomNo public int getRoomNo(){ return roomNo; } //getting guestID public int getGuestId(){ return guestID; } } i already insert some values in my 3moronsdb which are ( 1, Classic , 103). here's my TEST main class: public class TestMain { public static void main(String [] a){ GuestsInfo guest = new GuestsInfo(1); //note that this instantiation is the other class which i just ask the other day.. (http://stackoverflow.com/questions/12762835/retrieving-values-from-database-in-java) Room rum = new Room(1); System.out.print(rum.getRoomType()+" "+ guest.getFirstName()); } } when i'm running it it only gives me null output for the Room class but i am getting the output of the GuestsInfo class which is 'Ericka'. Can you help me guys? I know I ask this kind of problem yesterday but i really don't know what's wrong in here now..

    Read the article

  • Error processing Spree sample images - file not recognized by identify command in paperclip geometry.rb:29

    - by purpletonic
    I'm getting an error when I run the Spree sample data. It occurs when Spree tries to load in the product data, specifically the product images. Here's the error I'm getting: * Execute db:load_file loading ruby <GEM DIR>/sample/lib/tasks/../../db/sample/spree/products.rb -- Processing image: ror_tote.jpeg rake aborted! /var/folders/91/63kgbtds2czgp0skw3f8190r0000gn/T/ror_tote.jpeg20121007-21549-2rktq1 is not recognized by the 'identify' command. <GEM DIR>/paperclip-2.7.1/lib/paperclip/geometry.rb:31:in `from_file' <GEM DIR>/spree/core/app/models/spree/image.rb:35:in `find_dimensions' I've made sure ImageMagick is installed correctly, as previously I was having problems with it. Here's the output I'm getting when running the identify command directly. $ identify Version: ImageMagick 6.7.7-6 2012-10-06 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC Features: OpenCL ... other usage info omitted ... I also used pry with the pry-debugger and put a breakpoint in geometry.rb inside of Paperclip. Here's what that section of geometry.rb looks like: # Uses ImageMagick to determing the dimensions of a file, passed in as either a # File or path. # NOTE: (race cond) Do not reassign the 'file' variable inside this method as it is likely to be # a Tempfile object, which would be eligible for file deletion when no longer referenced. def self.from_file file file_path = file.respond_to?(:path) ? file.path : file raise(Errors::NotIdentifiedByImageMagickError.new("Cannot find the geometry of a file with a blank name")) if file_path.blank? geometry = begin silence_stream(STDERR) do binding.pry Paperclip.run("identify", "-format %wx%h :file", :file => "#{file_path}[0]") end rescue Cocaine::ExitStatusError "" rescue Cocaine::CommandNotFoundError => e raise Errors::CommandNotFoundError.new("Could not run the `identify` command. Please install ImageMagick.") end parse(geometry) || raise(Errors::NotIdentifiedByImageMagickError.new("#{file_path} is not recognized by the 'identify' command.")) end At the point of my binding.pry statement, the file_path variable is set to the following: file_path => "/var/folders/91/63kgbtds2czgp0skw3f8190r0000gn/T/ror_tote.jpeg20121007-22732-1ctl1g1" I've also double checked that this exists, by opening my finder in this directory, and opened it with preview app; and also that the program can run identify by running %x{identify} in pry, and I receive the same version Version: ImageMagick 6.7.7-6 2012-10-06 Q16 as before. Removing the additional digits (is this a timestamp?) after the file extension and running the Paperclip.run command manually in Pry gives me a different error: Cocaine::ExitStatusError: Command 'identify -format %wx%h :file' returned 1. Expected 0 I've also tried manually updating the Paperclip gem in Spree to 3.0.2 and still get the same error. So, I'm not really sure what else to try. Is there still something incorrect with my ImageMagick setup?

    Read the article

  • Received memory warning on setimage

    - by Sam Budda
    This problem has completely stumped me. This is for iOS 5.0 with Xcode 4.2 What's going on is that in my app I let user select images from their photo album and I save those images to apps document directory. Pretty straight forward. What I do then is that in one of the viewController.m files I create multiple UIImageViews and I then set the image for the image view from one of the picture that user selected from apps dir. The problem is that after a certain number of UIImage sets I receive a "Received memory warning". It usually happens when there are 10 pictures. If lets say user selected 11 pictures then the app crashes with Error (GBC). NOTE: each of these images are at least 2.5 MB a piece. After hours of testing I finally narrowed down the problem to this line of code [button1AImgVw setImage:image]; If I comment out that code. All compiles fine and no memory errors happen. But if I don't comment out that code I receive memory errors and eventually a crash. Also note it does process the whole CreateViews IBAction but still crashes at the end. I cannot do release or dealloc since I am running this on iOS 5.0 with Xcode 4.2 Here is the code that I used. Can anyone tell me what did I do wrong? - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self CreateViews]; } -(IBAction) CreateViews { paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask ,YES); documentsPath = [paths objectAtIndex:0]; //here 15 is for testing purposes for (int i = 0; i < 15; i++) { //Lets not get bogged down here. The problem is not here UIImageView *button1AImgVw = [[UIImageView alloc] initWithFrame:CGRectMake(10*i, 10, 10, 10)]; [self.view addSubview:button1AImgVw]; NSMutableString *picStr1a = [[NSMutableString alloc] init]; NSString *dataFile1a = [[NSString alloc] init]; picStr1a = [NSMutableString stringWithFormat:@"%d.jpg", i]; dataFile1a = [documentsPath stringByAppendingPathComponent:picStr1a]; NSData *potraitImgData1a =[[NSData alloc] initWithContentsOfFile:dataFile1a]; UIImage *image = [[UIImage alloc] initWithData:potraitImgData1a]; // This is causing my app to crash if I load more than 10 images! //[button1AImgVw setImage:image]; } NSLog(@"It went to END!"); } //Error I get when 10 images are selected. App does launch and work 2012-10-07 17:12:51.483 ABC-APP[7548:707] It went to END! 2012-10-07 17:12:51.483 ABC-APP [7531:707] Received memory warning. //App crashes with this error when there are 11 images 2012-10-07 17:30:26.339 ABC-APP[7548:707] It went to END! (gdb)

    Read the article

  • C++11: thread_local or array of OpenCL 1.2 cl_kernel objects?

    - by user926918
    I need to run several C++11 threads (GCC 4.7.1) parallely in host. Each of them needs to use a device, say a GPU. As per OpenCL 1.2 spec (p. 357): All OpenCL API calls are thread-safe75 except clSetKernelArg. clSetKernelArg is safe to call from any host thread, and is safe to call re-entrantly so long as concurrent calls operate on different cl_kernel objects. However, the behavior of the cl_kernel object is undefined if clSetKernelArg is called from multiple host threads on the same cl_kernel object at the same time. An elegant way would be to use thread_local cl_kernel objects and the other way I can think of is to use an array of these objects such that i'th thread uses i'th object. As I have not implemented these earlier I was wondering if any of the two are good or are there better ways of getting things done. TIA, S

    Read the article

  • DataGrid rendering fails

    - by patryk.beza
    I have DataGrid with groups of data. The problem is that after binding data I have strange effect (text was blured by me; the problem are cells' paddings/margins). This effect can be easily 'fixed' by user because after one click on top expander data hides and after second click on the expander, rows in DataGrid are displayed correctly. My XAML code: <DataGrid Name="myDataGrid" Grid.Row="0" ItemsSource="{Binding}" AutoGenerateColumns="False" Background="White" RowBackground="#FBFFFA" AlternatingRowBackground="#EEFAEB" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> <DataGrid.Columns> <!-- Columns definitions with binding ( . . . ) --> </DataGrid.Columns> <DataGrid.CellStyle> <Style TargetType="{x:Type DataGridCell}"> <Setter Property="Padding" Value="7,3"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type DataGridCell}"> <Border Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"> <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" /> </Border> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="DataGridCell.IsSelected" Value="True"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush EndPoint="0.504,1.5" StartPoint="0.504,0.03"> <GradientStop Color="#008C13" Offset="0"/> <GradientStop Color="#19FF38" Offset="0.8"/> </LinearGradientBrush> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> </DataGrid.CellStyle> <DataGrid.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Path=Name}" FontWeight="Bold" Padding="3" /> </StackPanel> </DataTemplate> </GroupStyle.HeaderTemplate> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <Expander> <Expander.Header> <StackPanel Orientation="Horizontal"> <TextBlock Text="Rok " /> <TextBlock Text="{Binding Name}" /> </StackPanel> </Expander.Header> <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </Style> </GroupStyle.ContainerStyle> </GroupStyle> </DataGrid.GroupStyle> </DataGrid> DataGrid's DataContext is set from code (rows with data in DataGrid are displayed after clicking proper button): ICollectionView myView = CollectionViewSource.GetDefaultView(myList); if (operationsView.GroupDescriptions.Count > 0) operationsView.GroupDescriptions.Clear(); operationsView.GroupDescriptions.Add(new PropertyGroupDescription("myGroupDescProperty")); FinancialIncomeOperationsListDataGrid.DataContext = operationsView; Is there any way to manually update layout of the DataGrid? Or maybe there is a better solution?

    Read the article

  • Twig Template For loop Results

    - by user981480
    I am trying to print out a the contents of an array but am not getting the expected results. any help is much appreciated: PHP code: $list[1]['first_name'] = 'Joe'; $list[1]['last_name'] = 'Smith'; $list[2]['first_name'] = 'John'; $list[2]['last_name'] = 'brand'; $data = array( 'customer' => $list ); echo $template->render($data); Template Markup: <html> <head><title>My first Twig template!</title></head> <body> {% for person in customer %} {{ person.first_name }} {% endfor %} </body> RESULTS: Array ( [first_name] = Joe [last_name] = Smith ) first_name Joe Array ( [first_name] = John [last_name] = brand ) first_name John

    Read the article

  • wordpress displaying the post in a specific categories

    - by Juliver Galleto
    I have this php code below for displaying the post from the specific categories. <ul id="sliderx"> <?php query_posts('category_name=slideshow&showposts=10'); while (have_posts()) : the_post(); echo "<li>".the_content()."</li>"; endwhile;?> </ul> as you can see, it display those post in the category slideshow and the structure of that should be this. <ul id="sliderx"> <li>the post 1</li> <li>the post 2</li> <li>the post 3</li> </ul> but the output that is generated is this. <ul id="sliderx"> <p>three</p> <li></li><p>two</p> <li></li><p>one</p> <li></li> </ul> and the generated structure should not look like that and it looks nasty at all, so im having a problem on this on how to display it properly like to display into this structure. <ul id="sliderx"> <li>the post 1</li> <li>the post 2</li> <li>the post 3</li> </ul> So Im wondering if there's someone who could tell me how to fix this. Im open into any suggestions, recommendations and suggestions. Thank you.

    Read the article

  • ios - compile error: redefinition of label openURL

    - by GeekedOut
    I have a method like this: - (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ([request.URL.scheme isEqualToString:@"aaa"]) { openURL:[NSURL URLWithString:@"www.firstwebsite.com"]; } if ([request.URL.scheme isEqualToString:@"abc"]) { openURL:[NSURL URLWithString:@"http://www.someurl.com"]; } if ([request.URL.scheme isEqualToString:@"xyz"]) { openURL:[NSURL URLWithString:@"http://www.anothersite.com"]; } return YES; } and on the second and third uses of openURL I get a compile error: redefinition of label openURL Any idea why that happens and how to resolve it? Thanks!

    Read the article

  • CSS Print Style Sheets - Examples

    - by bsreekanth
    Trying to learn about how to effectively use print.css, so that graphical and navigational elements are not shown in print preview/print. Read some articles, and part of print css of html5 boilerplate. Two sites, which was quite impressive the way they change the look during print are http://css-tricks.com/ http://bottlerocketcreative.com/ But I cannot see the css related to print. Can you please point to the css they use to learn how to do similar transformation. thanks.

    Read the article

  • Grails GORM rarely works in domain classes

    - by Vena
    I have many to many relationship between User and Organization. I want to delete user from all his organizations when the user is being deleted, so this is basically what I came up with: class User { ... def beforeDelete() { def user = User.get(id) Organization.all.each { it.removeFromMembers(user) it.save() } } } This surprisingly doesn't work because User.get(id) returns null even though the user with the given id is in the database, when I look at the log, no sql statement is even executed. So I tried to use load() method insted. ObjectNotFoundException is the result then. So I tried this as I was quite desperate: def user = User.find("from User as u where u.id = ?", [1L]) This, for some reason, works. But now, the line with it.removeFromMembers(user) throws NullPointerException. I tried to put this logic in my UserController and it works! Why is this? Why can't I do this in domain classes? This makes beforeDelete hook (and all the others too) pretty useless.

    Read the article

  • Is glDisableClientState required?

    - by Shawn
    Every example I've come across for rendering array data is similar to the following code, in which in your drawing loop you first call glEnableClientState for what you will be using and when you are done you call glDisableClientState: void drawScene(void) { glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glBindTexture(GL_TEXTURE_2D, texturePointerA); glTexCoordPointer(2, GL_FLOAT, 0,textureCoordA); glVertexPointer(3, GL_FLOAT, 0, verticesA); glDrawElements(GL_QUADS, numPointsDrawnA, GL_UNSIGNED_BYTE, drawIndicesA); glBindTexture(GL_TEXTURE_2D, texturePointerB); glTexCoordPointer(2, GL_FLOAT, 0,textureCoordB); glVertexPointer(3, GL_FLOAT, 0, verticesB); glDrawElements(GL_QUADS, numPointsDrawnB, GL_UNSIGNED_BYTE, drawIndicesB); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); } In my program I am always using texture coordinates and vertex arrays, so I thought it was pointless to keep enabling and disabling them every frame. I moved the glEnableClientState outside of the loop like so: bool initGL(void) { //... glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); } void drawScene(void) { glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glBindTexture(GL_TEXTURE_2D, texturePointerA); glTexCoordPointer(2, GL_FLOAT, 0,textureCoordA); glVertexPointer(3, GL_FLOAT, 0, verticesA); glDrawElements(GL_QUADS, numPointsDrawnA, GL_UNSIGNED_BYTE, drawIndicesA); glBindTexture(GL_TEXTURE_2D, texturePointerB); glTexCoordPointer(2, GL_FLOAT, 0,textureCoordB); glVertexPointer(3, GL_FLOAT, 0, verticesB); glDrawElements(GL_QUADS, numPointsDrawnB, GL_UNSIGNED_BYTE, drawIndicesB); } It seems to work fine. My question is: Do I need to call glDisableClientState somewhere; perhaps when the program is closed?. Also, is it ok to do it like this? Is there something I'm missing since everyone else enables and disables each frame?

    Read the article

  • Math.max and Math.min outputting highest and lowest values allowed

    - by user1696162
    so I'm trying to make a program that will output the sum, average, and smallest and largest values. I have everything basically figured out except the smallest and largest values are outputting 2147483647 and -2147483647, which I believe are the absolute smallest and largest values that Java will compute. Anyway, I want to compute the numbers that a user enters, so this obviously isn't correct. Here is my class. I assume something is going wrong in the addValue method. public class DataSet { private int sum; private int count; private int largest; private int smallest; private double average; public DataSet() { sum = 0; count = 0; largest = Integer.MAX_VALUE; smallest = Integer.MIN_VALUE; average = 0; } public void addValue(int x) { count++; sum = sum + x; largest = Math.max(x, largest); smallest = Math.min(x, smallest); } public int getSum() { return sum; } public double getAverage() { average = sum / count; return average; } public int getCount() { return count; } public int getLargest() { return largest; } public int getSmallest() { return smallest; } } And here is my tester class for this project: public class DataSetTester { public static void main(String[] arg) { DataSet ds = new DataSet(); ds.addValue(13); ds.addValue(-2); ds.addValue(3); ds.addValue(0); System.out.println("Count: " + ds.getCount()); System.out.println("Sum: " + ds.getSum()); System.out.println("Average: " + ds.getAverage()); System.out.println("Smallest: " + ds.getSmallest()); System.out.println("Largest: " + ds.getLargest()); } } Everything outputs correctly (count, sum, average) except the smallest and largest numbers. If anyone could point me in the right direction of what I'm doing wrong, that would be great. Thanks.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >