Search Results

Search found 234 results on 10 pages for 'avatar'.

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

  • How to invoke WPF Dispatcher in Nunit?

    - by Reporting Avatar
    I want to test an application which renders a text block with a data field value. I would like to get the actual width and actual height, once the rendering completes. Everything works fine. The problem came first, when I tried to test the application. I'm unable to invoke the dispatcher from the test project. Following is the code. this.Loaded += (s, e) => { TextBlock textBlock1 = new TextBlock(); //// Text block value is assigned from data base field. textBlock1.Text = strValueFromDataBaseField; //// Setting the wrap behavior. textBlock1.TextWrapping = TextWrapping.WrapWithOverflow; //// Adding the text block to the layout canvas. this.layoutCanvas.Children.Add(textBlock1); this.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)(() => { //// After rendering the text block with the data base field value. Measuring the actual width and height. this.TextBlockActualWidth = textBlock1.ActualWidth; this.TextBlockActualHeight = textBlock1.ActualHeight; //// Other calculations based on the actual widht and actual height. } )); }; I've just started using the NUnit. So, please help me. Thanks

    Read the article

  • Desine time XAML serialization problem in VS2010 Designer

    - by Reporting Avatar
    The wired problem is, in VS 2008, everything works fine. In VS2010 while serializing, it is missing the "ReportDimensionElements" so I'm unable to get the values back from the serialized value back from the XAML. It says, "'ReportDimensionElements' is null" am I missing anything silly. Note: I have marked the ReportDimensionElements class with [DefaultValue(null)] for avoiding {x:Null} being serialized. Will it be causing this by any way? Serialized XAML .Net 3.5 <Report> <Report.CategoricalAxis> <CategoricalAxis> <CategoricalAxis.ReportDimensionElements> <ReportDimensionElements Capacity="4"> <ReportDimensionElement DimensionName="Customer" HierarchyName="Customer Geography" LevelName="Country" /> </ReportDimensionElements> </CategoricalAxis.ReportDimensionElements> </CategoricalAxis> </Report.CategoricalAxis> </Report> .Net 4.0 <Report> <Report.CategoricalAxis> <CategoricalAxis> <CategoricalAxis.ReportDimensionElements> <ReportDimensionElement DimensionName="Customer" HierarchyName="Customer Geography" LevelName="Country" /> </CategoricalAxis.ReportDimensionElements> </CategoricalAxis> </Report.CategoricalAxis> </Report> Great Thanks

    Read the article

  • Silverlight - Binding ImageSource to Rectangle Fill

    - by Matt.M
    Blend 4 is telling me this is invalid markup and its not telling me why: <ImageBrush Stretch="Fill" ImageSource="{Binding Avatar, Mode=OneWay}"/> I'm pulling data from a Twitter feed, saving to an ImageSource, and then binding it to an ImageBrush(as seen below) to be used as the Fill for a Rectangle. Here is more context: <Rectangle x:Name="Avatar" RadiusY="9" RadiusX="9" Width="45" Height="45" VerticalAlignment="Center" HorizontalAlignment="Center" > <Rectangle.Fill> <ImageBrush Stretch="Fill" ImageSource="{Binding Avatar, Mode=OneWay}"/> </Rectangle.Fill> </Rectangle> I'm using this inside of a Silverlight UserControl, which is used inside of a Silverlight Application. Any Ideas on what the problem could be?

    Read the article

  • Remove trailing slash from comment form

    - by Sergio Vargott
    and i really need a code to remove the ending slash when a user put their link. for example i need them to put their url to grab their avatar, but in some cases they put their url ending with a slash (.com/) how can i remove that slash automatically? because when they put their url like that the avatar doesn't show i need them to end like this (.com) in order to show their avatar. I was looking for a remove trailing slash php code, but any solution will be appreciated. i tried to use this code but didn't work $string = rtrim($string, '/');

    Read the article

  • How to get all the updates for a Second Life Object (prim) using LIBOMV

    - by sura
    Hi All, In Second Life, I have an avatar and a primitive object that are moving with changing velocity. I use the LIBOMV library to create a text client to Second Life. Using this LIBOMV text client, I am trying to record the update packets of that avatar and object that are being sent to my text client by the server. I get frequent update packets for the avatar as its velocity changes, but I do not get update packets for the object that frequently, although it has a changing velocity. I would like to know whether there is any special setting I should use in order to solve this problem. /Su

    Read the article

  • How to properly catch a 404 error in .NET

    - by Luke101
    I would like to know the proper way to catch a 404 error with c# asp.net here is the code I'm using HttpWebRequest request = (HttpWebRequest) WebRequest.Create(String.Format("http://www.gravatar.com/avatar/{0}?d=404", hashe)); // execute the request try { //TODO: test for good connectivity first //So it will not update the whole database with bad avatars HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Response.Write("has avatar"); } catch (Exception ex) { if (ex.ToString().Contains("404")) { Response.Write("No avatar"); } } This code works but I just would like to know if this is the most efficient.

    Read the article

  • paperclipt get error can't dump File when upload video in rails

    - by user3510728
    when i try to upload video using paperclipt, i get error message can't dump File? model video : class Video < ActiveRecord::Base has_attached_file :avatar, :storage => :s3, :styles => { :mp4 => { :geometry => "640x480", :format => 'mp4' }, :thumb => { :geometry => "300x300>", :format => 'jpg', :time => 5 } }, :processors => [:ffmpeg] validates_attachment_presence :avatar validates_attachment_content_type :avatar, :content_type => /video/, :message => "Video not supported" end when i try to create video, im get this error?

    Read the article

  • In java web application, where should i store users photos?

    - by stunaz
    Hello, this questions may be stupid, but i dont really see how to resolve it : lest say that in my application, i have a user. This user edit his profile, and need to edit his avatar. Where should i store the avatar file? first of all i was saving all the files in src\main\webapp\resources , but each time i redeploy that folder empties. so i dedide to place in an other location : c:\wwwdir\resources, but i can't link local resources from remote pages, so i was not able to display any avatar . any idea? advise? link?

    Read the article

  • Impulsioned jumping

    - by Mutoh
    There's one thing that has been puzzling me, and that is how to implement a 'faux-impulsed' jump in a platformer. If you don't know what I'm talking about, then think of the jumps of Mario, Kirby, and Quote from Cave Story. What do they have in common? Well, the height of your jump is determined by how long you keep the jump button pressed. Knowing that these character's 'impulses' are built not before their jump, as in actual physics, but rather while in mid-air - that is, you can very well lift your finger midway of the max height and it will stop, even if with desacceleration between it and the full stop; which is why you can simply tap for a hop and hold it for a long jump -, I am mesmerized by how they keep their trajetories as arcs. My current implementation works as following: While the jump button is pressed, gravity is turned off and the avatar's Y coordenate is decremented by the constant value of the gravity. For example, if things fall at Z units per tick, it will rise Z units per tick. Once the button is released or the limit is reached, the avatar desaccelerates in an amount that would make it cover X units until its speed reaches 0; once it does, it accelerates up until its speed matches gravity - sticking to the example, I could say it accelerates from 0 to Z units/tick while still covering X units. This implementation, however, makes jumps too diagonal, and unless the avatar's speed is faster than the gravity, which would make it way too fast in my current project (it moves at about 4 pixels per tick and gravity is 10 pixels per tick, at a framerate of 40FPS), it also makes it more vertical than horizontal. Those familiar with platformers would notice that the character's arc'd jump almost always allows them to jump further even if they aren't as fast as the game's gravity, and when it doesn't, if not played right, would prove itself to be very counter-intuitive. I know this because I could attest that my implementation is very annoying. Has anyone ever attempted at similar mechanics, and maybe even succeeded? I'd like to know what's behind this kind of platformer jumping. If you haven't ever had any experience with this beforehand and want to give it a go, then please, don't try to correct or enhance my explained implementation, unless I was on the right way - try to make up your solution from scratch. I don't care if you use gravity, physics or whatnot, as long as it shows how these pseudo-impulses work, it does the job. Also, I'd like its presentation to avoid a language-specific coding; like, sharing us a C++ example, or Delphi... As much as I'm using the XNA framework for my project and wouldn't mind C# stuff, I don't have much patience to read other's code, and I'm certain game developers of other languages would be interested in what we achieve here, so don't mind sticking to pseudo-code. Thank you beforehand.

    Read the article

  • How can I render player movement on a 2d plane efficiently?

    - by user422318
    I'm prototyping a 2d HTML5 game with similar interaction to Diablo II. (See an older post of mine describing the interaction here: How can I imitate interaction and movement in Diablo II?) I just got the player click-to-move system working using the Bresenham algorithm but I can't figure out how to efficiently render the player's avatar as he moves across the screen. By the time redraw() is called, the player has already finished moving to the target point. If I try to call redraw() more frequently (based on my game timer), there's incredible system lag and I don't even see the avatar image glide across the screen. I have a game timer based off this awesome timer class: http://www.dailycoding.com/Posts/object_oriented_programming_with_javascript__timer_class.aspx In the future, there will be multiple enemies chasing the player. Fast pace is essential to the experience. What should I do?

    Read the article

  • 3D Collision help

    - by Taylor
    I'm having difficulties with my project. I'm quite new in XNA. Anyway, I'm trying to make 3D game and I'm already stuck on one basic thing. I have terrain made from a heightmap, and an avatar model. I want to set up some collisions for game so the player won't go through the ground. But I just don't know how to detect collisions for so complex an object. I could just make a simple box collision for my avatar, but what about the ground? I already implemented the JigLibX physics engine in my project and I know that I can make a collision map with heightmap, but I can't find any tutorials or help with this. So how can I set proper collision for complex objects? How can I detect heightmap collisions in JigLibX? Just some links to tutorials would be enough. Thanks in advance!

    Read the article

  • Is it better to cut and store all sprites needed from a spritesheet in memory, or cut them out just-in-time?

    - by xLite
    I'm not sure what's best practice here as I have little experience with this. Essentially what I am asking is... if it's better to get your single PNG with all your different sprites on it for use in-game, cut out every sprite on startup and store them in memory, then access the already-cut-out sprite from memory quickly or Only have the single PNG with all the different sprites residing in memory, and when you need, for example, a tree. You cut out the tree from the PNG and then continue to use it as normal. I imagine the former is more CPU friendly than the latter but less memory friendly, vice versa for the latter. I want to know what the norm is for game dev. This is a pixel based game using 2D art. Each PNG is actually an avatar's sprite sheet with each body part separated and then later joined to form the full body of the avatar.

    Read the article

  • Paperclip: delete attachment and "can't convert nil into String" error

    - by snitko
    I'm using Paperclip and here's what I do in the model to delete attachments: def before_save self.avatar = nil if @delete_avatar == 1.to_s end Works fine unless @delete_avatar flag is set when the user is actually uploading the image (so the model receives both params[:user][:avatar] and params[:user][:delete_avatar]. This results in the following error: TypeError: can't convert nil into String from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `dirname' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `flush_writes' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `each' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `flush_writes' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:144:in `save' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:162:in `destroy' from /Work/project/src/app/models/user.rb:72:in `before_save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `callback' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:249:in `create_or_update' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2538:in `save_without_validation' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1078:in `save_without_dirty' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in `save_without_transactions' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in `with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in `rollback_active_record_state!' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:723:in `create' I assume it has something to do with the avatar.dirty? value because when it certainly is true when this happens. The question is, how do I totally reset the thing if there are changes to be saved and abort avatar upload when the flag is set?

    Read the article

  • Paperclip: delete attachments and "can't convert nil into String" error

    - by snitko
    I'm using Paperclip and here's what I do in the model to delete attachments: def before_save self.avatar = nil if @delete_avatar == 1.to_s end Works fine unless @delete_avatar flag is set when the user is actually uploading the image (so the model receives both params[:user][:avatar] and params[:user][:delete_avatar]. This results in the following error: TypeError: can't convert nil into String from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `dirname' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `flush_writes' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `each' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `flush_writes' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:144:in `save' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:162:in `destroy' from /Work/project/src/app/models/user.rb:72:in `before_save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `callback' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:249:in `create_or_update' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2538:in `save_without_validation' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1078:in `save_without_dirty' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in `save_without_transactions' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in `with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in `rollback_active_record_state!' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:723:in `create' I assume it has something to do with the avatar.dirty? value because when it certainly is true when this happens. The question is, how do I totally reset the thing if there are changes to be saved and abort avatar upload when the flag is set?

    Read the article

  • If inside Where mysql

    - by Barno
    Can I do an if inside Where? or something that allows me to do the checks only if the field is not null (path=null) SELECT IF(path IS NOT NULL, concat("/uploads/attachments/",path, "/thumbnails/" , nome), "/uploads/attachments/default/thumbnails/avatar.png") as avatar_mittente FROM prof_foto   WHERE profilo_id = 15  -- only if path != "/uploads/attachments/default/thumbnails/avatar.png" AND foto_eliminata = 0 AND foto_profilo = 1

    Read the article

  • Best way to be able to pick multiple colors/designs of symbols dynamically from flash

    - by Cyprus106
    Sorry the title's so convoluted... I must've tried for ten minutes to get a good, descriptive title! Basically, here's the scenario. Let's say a user can pick fifty different hat colors and styles to put on an avatar. The avatar can move his head around, so we'd need the same types of movements in the symbol for when that happens. Additionally, it gets which hat should be on the 'avatar' from a database. The problem is that we can't just make 50 different frames with a different hat on each. And each hat symbol will have the same movements, it'll just be different styles, colors and sizes. So how can I make one variable that is the HAT, that way we can just put the appropriate hat symbol into the variable and always be able to call Hat.gotoAndplay('tip_hat') or any other generic functions.... Does that make sense? Hope that's not too confusing. Sorry, I'm not great at the visual Flash stuff, but it's gotta be done! Thanks!

    Read the article

  • Struts2 Hibernate Login with User table and group table

    - by J2ME NewBiew
    My problem is, i have a table User and Table Group (this table use to authorization for user - it mean when user belong to a group like admin, they can login into admincp and other user belong to group member, they just only read and write and can not login into admincp) each user maybe belong to many groups and each group has been contain many users and they have relationship are many to many I use hibernate for persistence storage. and struts 2 to handle business logic. When i want to implement login action from Struts2 how can i get value of group member belong to ? to compare with value i want to know? Example I get user from username and password then get group from user class but i dont know how to get value of group user belong to it mean if user belong to Groupid is 1 and in group table , at column adminpermission is 1, that user can login into admincp, otherwise he can't my code: User.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.dejavu.software.model; import java.io.Serializable; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.Table; import javax.persistence.Temporal; /** * * @author Administrator */ @Entity @Table(name="User") public class User implements Serializable{ private static final long serialVersionUID = 2575677114183358003L; private Long userId; private String username; private String password; private String email; private Date DOB; private String address; private String city; private String country; private String avatar; private Set<Group> groups = new HashSet<Group>(0); @Column(name="dob") @Temporal(javax.persistence.TemporalType.DATE) public Date getDOB() { return DOB; } public void setDOB(Date DOB) { this.DOB = DOB; } @Column(name="address") public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } @Column(name="city") public String getCity() { return city; } public void setCity(String city) { this.city = city; } @Column(name="country") public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } @Column(name="email") public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinTable(name="usergroup",joinColumns={@JoinColumn(name="userid")},inverseJoinColumns={@JoinColumn( name="groupid")}) public Set<Group> getGroups() { return groups; } public void setGroups(Set<Group> groups) { this.groups = groups; } @Column(name="password") public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @Id @GeneratedValue @Column(name="iduser") public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } @Column(name="username") public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } @Column(name="avatar") public String getAvatar() { return avatar; } public void setAvatar(String avatar) { this.avatar = avatar; } } Group.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.dejavu.software.model; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; /** * * @author Administrator */ @Entity @Table(name="Group") public class Group implements Serializable{ private static final long serialVersionUID = -2722005617166945195L; private Long idgroup; private String groupname; private String adminpermission; private String editpermission; private String modpermission; @Column(name="adminpermission") public String getAdminpermission() { return adminpermission; } public void setAdminpermission(String adminpermission) { this.adminpermission = adminpermission; } @Column(name="editpermission") public String getEditpermission() { return editpermission; } public void setEditpermission(String editpermission) { this.editpermission = editpermission; } @Column(name="groupname") public String getGroupname() { return groupname; } public void setGroupname(String groupname) { this.groupname = groupname; } @Id @GeneratedValue @Column (name="idgroup") public Long getIdgroup() { return idgroup; } public void setIdgroup(Long idgroup) { this.idgroup = idgroup; } @Column(name="modpermission") public String getModpermission() { return modpermission; } public void setModpermission(String modpermission) { this.modpermission = modpermission; } } UserDAO /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.dejavu.software.dao; import java.util.List; import org.dejavu.software.model.User; import org.dejavu.software.util.HibernateUtil; import org.hibernate.Query; import org.hibernate.Session; /** * * @author Administrator */ public class UserDAO extends HibernateUtil{ public User addUser(User user){ Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); session.save(user); session.getTransaction().commit(); return user; } public List<User> getAllUser(){ Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); List<User> user = null; try { user = session.createQuery("from User").list(); } catch (Exception e) { e.printStackTrace(); session.getTransaction().rollback(); } session.getTransaction().commit(); return user; } public User checkUsernamePassword(String username, String password){ Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); User user = null; try { Query query = session.createQuery("from User where username = :name and password = :password"); query.setString("username", username); query.setString("password", password); user = (User) query.uniqueResult(); } catch (Exception e) { e.printStackTrace(); session.getTransaction().rollback(); } session.getTransaction().commit(); return user; } } AdminLoginAction /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.dejavu.software.view; import com.opensymphony.xwork2.ActionSupport; import org.dejavu.software.dao.UserDAO; import org.dejavu.software.model.User; /** * * @author Administrator */ public class AdminLoginAction extends ActionSupport{ private User user; private String username,password; private String role; private UserDAO userDAO; public AdminLoginAction(){ userDAO = new UserDAO(); } @Override public String execute(){ return SUCCESS; } @Override public void validate(){ if(getUsername().length() == 0){ addFieldError("username", "Username is required"); }if(getPassword().length()==0){ addFieldError("password", getText("Password is required")); } } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } } other question. i saw some example about Login, i saw some developers use interceptor, im cant understand why they use it, and what benefit "Interceptor" will be taken for us? Thank You Very Much!

    Read the article

  • Android How do you save an image with your own unique Image Name?

    - by Usmaan
    This sounds like a issue a beginner like me would only have...this is my code... private void saveAvatar(Bitmap avatar) { String strAvatarFilename = Id + ".jpg"; try { avatar.compress(CompressFormat.JPEG, 100, openFileOutput(strAvatarFilename, MODE_PRIVATE)); } catch (Exception e) { Log.e(DEBUG_TAG, "Avatar compression and save failed.", e); } Uri imageUriToSaveCameraImageTo = Uri.fromFile(new File(PhotoActivity.this.getFilesDir(), strAvatarFilename)); Editor editor = Preferences.edit(); editor.putString(PREFERENCES_AVATAR, imageUriToSaveCameraImageTo.getPath()); editor.commit(); ImageButton avatarButton = (ImageButton) findViewById(R.id.ImageButton_Avatar); String strAvatarUri = Preferences.getString(PREFERENCES_AVATAR, ""); Uri imageUri = Uri.parse(strAvatarUri); avatarButton.setImageURI(null); avatarButton.setImageURI(imageUri); } This does save the image but when i go to look at the image on the sd card ti is called imag001 etc not the ID i am labelling it. How do i save the image with a name i want to call it? regards

    Read the article

  • How to play an MKV 3D side-by-side video?

    - by djechelon
    I have a video in Matroska format (MKV, file extension .mkv), 3D half-SBS, where the 1280x720 frame shows the left-eye frame on the left and the right-eye frame on the right. I don't have a 3DTV, but I have NVidia 3D Vision: I tried to open it with PowerDVD 10 with no result (program hangs). With the same PowerDVD, I tried to play the Avatar 3D trailer downloaded from YouTube (MP4 format), but it now shows it the two frames. PowerDVD 10 is advertised to support 3D and 3D Vision. Why can't I play these videos? NVidia Stereoscopic player plays the Avatar trailer fine, but it doesn't support MKV.

    Read the article

  • Request Coalescing in Nginx

    - by Marcel Jackwerth
    I have an image resize server sitting behind an nginx server. On a cold cache two clients requesting the same file could trigger two resize jobs. client-01.net GET /resize.do/avatar-1234567890/300x200.png client-02.net GET /resize.do/avatar-1234567890/300x200.png It would be great if only one of the requests could go through to the backend in this situation (while the other client is set 'on-hold'). In Varnish there seems to be such a feature, called Request Coalescing. However that seems to be a Varnish-specific term. Is there something similar for Nginx?

    Read the article

  • Hue shift on youtube.com (but not when embedded!)

    - by Mala
    This is easily the oddest problem I've yet had. When I'm on youtube, and I look at a video, the hue is all wrong. Pure red becomes pure blue, and all the other colors shift accordingly. Faces in particular are shades of blue so I call this "avatar mode". Avatar mode happens on any video I view while on youtube.com. BUT, if I view the same video when embedded, colors are fine! EDIT: OS: Gentoo Linux, happens in all browsers

    Read the article

  • The first day of JavaOne is already over!

    - by delabassee
    In the past Sunday used to be a more relaxing day with ‘just’ some JavaOne activities going on. Sunday used to be a soft day to prepare yourself for an exhausting week. This is now over as JavaOne is expanding; Sunday is now an integral part of the conference. One of the side effect of this extra day is that some activities related to JavaOne and OpenWorld such as MySQL Connect are being push to start a day earlier on Saturday (can you spot the pattern here?). On the GlassFish front, Sunday was a very busy day! It started at the Moscone Center with the annual GlassFish Community Event where the Java EE 7 and GF 4 roadmaps were presented and discussed. During the event, different GlassFish users such as ZeroTurnaround (the JRebel guys), Grupo RBS and IDR Solutions shared their views on GF, why they like GF but also what could be improved. The event was also a forum for the GF community to exchange with some of the key Java EE / GlassFish Oracle Executives and the different GF team members. The Strategy keynote and the Technical keynote were held in the Masonic Auditorium later in the after-noon. Oracle executives have presented the plans for Java SE, Java FX and Java EE. As on-demand replays will be available soon, I will not summarize several hours of content but here are some personal takeaways from those keynotes. Modularity Modularity is a big deal. We know by now that Project Jigsaw will not be ready for Java SE 8 but in any case, it is already possible (and encouraged) to test Jigsaw today. In the future, Java EE plan to rely on the modularity features provided by Java SE, so Project Jigsaw is also relevant for Java EE developers. Shorter term, to cover some of the modular requirements, Java SE will adopt the approach that was used for Java EE 6 and the notion of Profiles. This approach does not define a module system per say; Profiles is a way to clearly define different subsets of Java SE to fulfill different needs (e.g. the full JRE is not required for a headless application). The introduction of different Profiles, from the Base profile (10mb) to the Full Profile (+50mb), has been proposed for Java SE 8. Embedded Embedded is a strong theme going forward for the Java Plaform. There is now a dedicated program : Java Embedded @ JavaOne Java by nature (e.g. platform independence, built-in security, ability easily talks to any back-end systems, large set of skills available on the market, etc.) is probably the most suited platform for the Internet of Things. You can quickly be up-to-speed and develop services and applications for that space just by using your current Java skills. All you need to start developing on ARM is a 35$ Raspberry Pi ARM board (25$ if you are cheap and can live without an ethernet connection) and the recently released JDK for Linux/ARM. Obviously, GlassFish runs on Raspberry Pi. If you wan to go further in the embedded space, you should take a look Java SE Embedded, an optimized, low footprint, Java environment that support the major embedded architectures (ARM, PPC and x86). Finally, Oracle has recently introduced Java Embedded Suite, a new solution that brings modern middleware capabilities to the embedded space. Java Embedded Suite is an optimized solution that leverage Java SE Embedded but also GlassFish, Jersey and JavaDB to deploy advanced value added capabilities (eg. sensor data filtering and) deeper in the network, closer to the devices. JavaFX JavaFX is going strong! Starting from Java SE 7u6, JavaFX is bundled with the JDK. JavaFX is now available for all the major desktop platforms (Windows, Linux and Mac OS X). JavaFX is now also available, in developer preview, for low end device running Linux/ARM. During the keynote, JavaFX was shown running on a Raspberry Pi! And as announced during the keynote, JavaFX should be fully open-sourced by the end of the year; contributions are welcome!. There is a strong momentum around JavaFX, it’s the ideal client solution for the Java platform. A client layer that works perfectly with GlassFish on the back-end. If you were not convince by JavaFX, it’s time to reconsider it! As an old Chinese proverb say “One tweet is worth a thousand words!” HTML5, Project Avatar and Java EE 7 HTML5 got a lot of airtime too, it was covered during the Java EE 7 section of the keynote. Some details about Project Avatar, Oracle’s incubator project for a TSA (Thin Server Architecture) solution, were diluted and shown during the keynote. On the tooling side, Project Easel running on NetBeans 7.3 beta was demo’ed, including a cool NetBeans debugging session running in Chrome! HTML 5, Project Avatar and Java EE 7 deserve separate posts... Feedback We need your feedback! There are many projects, JSRs and products cooking : GlassFish 4, Project Jigsaw, Concurrency Utilities for Java EE (JSR 236), OpenJFX, OpenJDK to name just a few. Those projects, those specifications will have a profound impact on the Java platform for the years to come! So if you have the opportunity, download, install, learn, tests them and give feedback! Remember, you can "Make the Future Java!" Finally, the traditional GlassFish Party at the Thirsty Bear concluded the first JavaOne day. This party is another place where the community can freely exchange with the GlassFish team in a more relaxed, more friendly (but sometime more noisy) atmosphere. Arun has posted a set of pictures to reflect the atmosphere of the keynotes and the GlassFish party. You can find more details on the others Java EE and GlassFish activities here.

    Read the article

  • Moving a point along a vector

    - by Chris
    Hello- I have a point defined by x,y and a vector defined by heading, speed. I am attempting to move the point x,y along this vector, at a distance of 'speed'. Below is the code I am currently using: self.x += self.speed * cos(self.heading); self.y += self.speed * sin(self.heading); Heading can be any angle in a full circle - 0 to 2p (0-360 degrees). The problem is the above code: Only moves along the x or y axis when angle is 0-270 for example, when the avatar is facing the top-right corner (45 degrees relative), it moves straight up. Does not move at all when angle is 270-360 heading, speed, X and Y are all doubles, and heading is reported by the user touching a direction-pad in the lower corner. I know the heading is correct because the avatar rotates to the correct direction, it is just the actual movement I am having problems with. Thanks for any help - Chris

    Read the article

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