Search Results

Search found 236 results on 10 pages for 'avatar squadron'.

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

  • jQuery $.ajax response empty, but only in Chrome

    - by roguepixel
    I've exhausted every avenue of research to solve this one so hopefully someone else will think of something I just didn't. Relatively straight forward setup, I have a html page with some javascript that makes an ajax request to a URL (in the same domain) the java web app in the background does its stuff and returns a partial html page (no html, head or body tags, just the content) which should be inserted at a particular point in the page. All sounds pretty easy and the code I have works in IE, Firefox and Safari, but not in Chrome. In Chrome the target element just ends up empty and if I look at the resource request in Chromes developer tools the response content is also empty. All very confusing, I've tried a myriad of things to solve it and I'm just out of ideas. Any help would be greatly appreciated. var container = $('#container'); $.ajax({ type: 'GET', url: '/path/to/local/url', data: data('parameters=value&another=value2'), dataType: 'html', cache: false, beforeSend: requestBefore, complete: requestComplete, success: requestSuccess, error: requestError }); function data(parameters) { var dictionary = {}; var pairs = parameters.split('&'); for (var i = 0; i < pairs.length; i++) { var keyValuePair = pairs[i].split('='); dictionary[keyValuePair[0]] = keyValuePair[1]; } return dictionary; } function requestBefore() { container.find('.message.error').hide(); container.prepend('<div class="modal"><div class="indicator">Loading...</div></div>'); } function requestComplete() { container.find('.modal').remove(); } function requestSuccess(response) { container.empty(); container.html(response); } function requestError(response) { if (response.status == 200 && response.responseText == 'OK') { requestSuccess(response); } else { container.find('.message.error').fadeIn('slow'); } } All of this is executed in a $(document).ready(function() {}); Cheers, Jim @Oleg - Additional information requested, an example of the response that the ajax call might receive. <p class="message error hidden">An unknown error occured while trying to retrieve data, please try again shortly.</p> <div class="timeline"> <a class="icon shuttle-previous" rel="max_id=16470650733&page=1&q=something">Newer Data</a> <a class="icon shuttle-next" rel="max_id=16470650733&page=3&q=something">Older Data</a> </div> <ol class="social"> <li class="even"> <div class="avatar"> <img src="sphere_normal.gif"/> </div> <p> Some Content<br/> <span class="published">Jun 18, 2010 11:29:05 AM</span> - <a target="_blank" href="">Direct Link</a> </p> </li> <li class="odd"> <div class="avatar"> <img src="sphere_normal.gif"/> </div> <p> Some Content<br/> <span class="published">Jun 18, 2010 11:29:05 AM</span> - <a target="_blank" href="">Direct Link</a> </p> </li> </ol> <div class="timeline"> <a class="icon shuttle-previous" rel="max_id=16470650733&page=1&q=something">Newer Data</a> <a class="icon shuttle-next" rel="max_id=16470650733&page=3&q=something">Older Data</a> </div>

    Read the article

  • PHP mysql multi-table search returning different table and field data row after row

    - by Kinyanjui Kamau
    Hi Guys, I am building a social networking site that is dedicated to nightclubs and night events. Among other tables, I have a users table, events table and establishments table. I am really intrigued with how Facebook in particular is able to query and return matches of not just users but also pages, ads etc row after row. Im sure most who are reading this have tried the facebook search My question is in my case, should I: Perform 3 separate LIKE %search% on each of the tables on search.php. Draw up 3 separate tables to show the results of what matches in the relevant queries which are collapsed when empty(on the same search.php) ie In search.php //query users table $query_user = "SELECT user_first_name, user_last_name, username, picture_thumb_url, avatar FROM users JOIN picture ON users.user_id = picture.user_id AND picture.avatar=1 ORDER BY users.user_id"; $result_users = mysql_query($query_user, $connections) or die(mysql_error()); $row_result_users = mysql_fetch_assoc($wid_updates); //query events table $query_event = "SELECT event_thumb_url, event_name, event_venue, event_date FROM event WHERE event_name LIKE '%".$search_value."%'"; $event = mysql_query($query_event, $connections) or die(mysql_error()); $row_event = mysql_fetch_assoc($event); $totalRows_event = mysql_num_rows($event); //query establishments table $query_establishment = "SELECT establishment_thumb_url, establishment_name, location_id, establishment_pricing FROM establishment WHERE establishment_name LIKE '%".$search_value."%'"; $establishment = mysql_query($query_establishment, $connections) or die(mysql_error()); $row_establishment = mysql_fetch_assoc($establishment); $totalRows_establishment = mysql_num_rows($establishment); My html: <table max-width="500" name="users" border="0"> <tr> <td width="50" height="50"></td> <td width="150"></td> <td width="150"></td> <td width="150"></td> </tr> </table> <table width="500" name="events" border="0"> <tr> <td width="50" height="50"><a href="#profile.php"><img src="Images/<?php echo $row_event['event_thumb_url']; ?>" border="0" height="50" width="50"/></a></td> <td width="150"><?php echo $row_event['event_name']; ?></td> <td width="150"><?php echo $row_event['event_venue']; ?></td> <td width="150"><?php echo $row_event['event_date']; ?></td> </tr> </table> <table width="500" name="establishments" border="0"> <tr> <td width="50" height="50"><a href="#profile.php"><img src="Establishment_Images/<?php echo $row_establishment['establishment_thumb_url']; ?>" border="0" height="50" width="50"/></a></td> <td width="150"><?php echo $row_establishment['establishment_name']; ?></td> <td width="150"><?php echo $row_establishment['location_id']; ?></td> <td width="150"><?php echo $row_establishment['establishment_pricing']; ?></td> </tr> </table> I haven't populated the PHP echo's for the user table. This is just to give you an idea of what I am trying to do. Any assistance?

    Read the article

  • What kind of projects are suited as a portfolio? [on hold]

    - by Asyx
    I was thinking about finishing up some hobby projects I used myself or am planing to use myself but I'm not sure if a future employer might be put off by them. For example, if I decided to create a custom website for an online (gaming, maybe) community instead of using an existing CMS, is it a good idea to provide a link to said community website or should I just put up the CMS and pretend like nobody actually uses it? Also, what about very specific things? I like linguistics and constructing languages. Obviously nobody wants to come up with 1000s of words so people usually use word generators or software to emulate sound shift or software to organise everything and produce dictionaries and such. Would such a project be too specific and too abstract for a portfolio or is the "he did programming work simply for enjoyment and his hobby and not just for money or grades" thing more important? It's quite an abstract hobby and most people don't even know that it's a thing and think the languages you hear in Game of Thrones, Avatar or Star Trek are just gibberish. Explaining such things to people is a pain to begin with especially if said people speak no other language. Would such things throw an employer off or is the content itself completely irrelevant? Thanks. Also, if this is not fitting for the programmers stackexchange, then please, don't close the thread right away but tell me where else to go because I got here though a closed question from stackoverflow. Thanks.

    Read the article

  • Having different database sorting order (default_scope) for two different views

    - by Juniper747
    In my model (pins.rb), I have two sorting orders: default_scope order: 'pins.featured DESC' #for adding featured posts to the top of a list default_scope order: 'pins.created_at DESC' #for adding the remaining posts beneath the featured posts This sorting order (above) is how I want my 'pins view' (index.html.erb) to look. Which is just a list of ALL user posts. In my 'users view' (show.html.erb) I am using the same model (pins.rb) to list only current_user pins. HOWEVER, I want to sorting order to ignore the "featured" default scope and only use the second scope: default_scope order: 'pins.created_at DESC' How can I accomplish this? I tried doing something like this: default_scope order: 'pins.featured DESC', only: :index default_scope order: 'pins.created_at DESC' But that didn't fly... UPDATE I updated my model to define a scope: scope :featy, order: 'pins.featured DESC' default_scope order: 'pins.created_at DESC' And updated my pins view to: <%= render @pins.featy %> However, now when I open my pins view, I get the error: undefined method `featy' for #<Array:0x00000100ddbc78> UPDATE 2 User.rb class User < ActiveRecord::Base attr_accessible :name, :email, :username, :password, :password_confirmation, :avatar, :password_reset_token, :password_reset_sent_at has_secure_password has_many :pins, dependent: :destroy #destroys user posts when user is destroyed # has_many :featured_pins, order: 'featured DESC', class_name: "Pin", source: :pin has_attached_file :avatar, :styles => { :medium => "300x300#", :thumb => "120x120#" } before_save { |user| user.email = user.email.downcase } before_save { |user| user.username = user.username.downcase } before_save :create_remember_token before_save :capitalize_name validates :name, presence: true, length: { maximum: 50 } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i VALID_USERNAME_REGEX = /^[A-Za-z0-9]+(?:[_][A-Za-z0-9]+)*$/ validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false } validates :username, presence: true, format: { with: VALID_USERNAME_REGEX }, uniqueness: { case_sensitive: false } validates :password, length: { minimum: 6 }, on: :create #on create, because was causing erros on pw_reset Pin.rb class Pin < ActiveRecord::Base attr_accessible :content, :title, :privacy, :date, :dark, :bright, :fragmented, :hashtag, :emotion, :user_id, :imagesource, :imageowner, :featured belongs_to :user before_save :capitalize_title before_validation :generate_slug validates :content, presence: true, length: { maximum: 8000 } validates :title, presence: true, length: { maximum: 24 } validates :imagesource, presence: { message: "Please search and choose an image" }, length: { maximum: 255 } validates_inclusion_of :privacy, :in => [true, false] validates :slug, uniqueness: true, presence: true, exclusion: {in: %w[signup signin signout home info privacy]} # for sorting featured and newest posts first default_scope order: 'pins.created_at DESC' scope :featured_order, order: 'pins.featured DESC' def to_param slug # or "#{id}-#{name}".parameterize end def generate_slug # makes the url slug address bar freindly self.slug ||= loop do random_token = Digest::MD5.hexdigest(Time.zone.now.to_s + title)[0..9]+"-"+"#{title}".parameterize break random_token unless Pin.where(slug: random_token).exists? end end protected def capitalize_title self.title = title.split.map(&:capitalize).join(' ') end end users_controller.rb class UsersController < ApplicationController before_filter :signed_in_user, only: [:edit, :update, :show] before_filter :correct_user, only: [:edit, :update, :show] before_filter :admin_user, only: :destroy def index if !current_user.admin? redirect_to root_path end end def menu @user = current_user end def show @user = User.find(params[:id]) @pins = @user.pins current_user.touch(:last_log_in) #sets the last log in time if [email protected]? render 'pages/info/' end end def new @user = User.new end pins_controller.rb class PinsController < ApplicationController before_filter :signed_in_user, except: [:show] # GET /pins, GET /pins.json def index #Live Feed @pins = Pin.all @featured_pins = Pin.featured_order respond_to do |format| format.html # index.html.erb format.json { render json: @pins } end end # GET /pins, GET /pins.json def show #single Pin View @pin = Pin.find_by_slug!(params[:id]) require 'uri' #this gets the photo's id from the stored uri @image_id = URI(@pin.imagesource).path.split('/').second if @pin.privacy == true #check for private pins if signed_in? if @pin.user_id == current_user.id respond_to do |format| format.html # show.html.erb format.json { render json: @pin } end else redirect_to home_path, notice: "Prohibited 1" end else redirect_to home_path, notice: "Prohibited 2" end else respond_to do |format| format.html # show.html.erb format.json { render json: @pin } end end end # GET /pins, GET /pins.json def new @pin = current_user.pins.new respond_to do |format| format.html # new.html.erb format.json { render json: @pin } end end # GET /pins/1/edit def edit @pin = current_user.pins.find_by_slug!(params[:id]) end Finally, on my index.html.erb I have: <%= render @featured_pins %>

    Read the article

  • JSON request failing because of line breaks, how to escape them?

    - by mrblah
    Hi, My JSON request seems to be failing because of line breaks (I am programatically weaving my own JSON string). How can I escape for line breaks? {"rc": "200", "m" : "", "o": "<div class='s1'> <div class='avatar'> <a href='\/asdf'>asdf<\/a><br \/> <strong>0<\/strong> <\/div> <div class='sl'> <p> 444444444 <\/p> <\/div> <div class='clear'> <\/div> <\/div>"} string jsonString = BuildJSON(someCollection).Replace(@"/", @"\/");

    Read the article

  • Dojo: drag and drop Stop Drag

    - by Jose L Martinez-Avial
    Hi, I'm trying to use Dojo dnd Source(1.4.2) to create an interface where I can move some objects from a Source to a Target. It is working fine, but I want to change the behaviour in order to execute a check before actually doing the D&D, so if the check fails, an error message is shown to the user, and the D&D is not made. I've tried the following example I found in a blog: dojo.subscribe("/dnd/drop", function(source,nodes,iscopy) { if (nodes[0].id == 'docs_menu'){ dojo.publish("/dnd/cancel"); dojo.dnd.manager().stopDrag(); alert("Drop is not permitted"); } } ); But it fails saying that this.avatar is null. Does anybody know how to do this? Thanks. Jose

    Read the article

  • ASPX ajax form post help

    - by StealthRT
    Hey all, i have this peice of code that allows a user to select a jpg image, resize it and uploads it to the server driectory. The problem being is that it reloads the aspx page when it saves the image. My question is-is there any way to do this same thing but with ajax so that it doesn't leave the page after submitting it? I've done this pleanty of times with classic asp pages but never with a aspx page. Here is the code for the ASPX page: <%@ Page Trace="False" Language="vb" aspcompat="false" debug="true" validateRequest="false"%> <%@ Import Namespace=System.Drawing %> <%@ Import Namespace=System.Drawing.Imaging %> <%@ Import Namespace=System.Drawing.Text %> <%@ Import Namespace=System %> <%@ Import Namespace=System.IO %> <%@ Import Namespace=System.Web %> <%@ Import Namespace=System.ServiceProcess %> <%@ Import Namespace=Microsoft.Data.Odbc %> <%@ Import Namespace=System.Data.Odbc %> <%@ Import Namespace=MySql.Data.MySqlClient %> <%@ Import Namespace=MySql.Data %> <%@ Import Namespace=System.Drawing.Drawing2D %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.ADO" %> <%@ Import Namespace=ADODB %> <SCRIPT LANGUAGE="VBScript" runat="server"> const Lx = 200 const Ly = 60 const upload_dir = "/img/avatar/" const upload_original = "tmpAvatar" const upload_thumb = "thumb" const upload_max_size = 256 dim fileExt dim newWidth, newHeight as integer dim l2 dim fileFld as HTTPPostedFile Dim originalimg As System.Drawing.Image dim msg dim upload_ok as boolean </script> <% Dim theID, theEmail, maleOrFemale theID = Request.QueryString("ID") theEmail = Request.QueryString("eMail") maleOrFemale = Request.QueryString("MF") randomize() upload_ok = false if lcase(Request.ServerVariables("REQUEST_METHOD"))="post" then fileFld = request.files(0) if fileFld.ContentLength > upload_max_size * 1024 then msg = "Sorry, the image must be less than " & upload_max_size & "Kb" else try fileExt = System.IO.Path.GetExtension(fileFld.FileName).ToLower() if fileExt = ".jpg" then originalImg = System.Drawing.Image.FromStream(fileFld.InputStream) if originalImg.Height > Ly then newWidth = Ly * (originalImg.Width / originalImg.Height) newHeight = Ly end if Dim thumb As New Bitmap(newWidth, newHeight) Dim gr_dest As Graphics = Graphics.FromImage(thumb) dim sb = new SolidBrush(System.Drawing.Color.White) gr_dest.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality gr_dest.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality gr_dest.FillRectangle(sb, 0, 0, thumb.Width, thumb.Height) gr_dest.DrawImage(originalImg, 0, 0, thumb.Width, thumb.Height) try originalImg.save(Server.MapPath(upload_dir & upload_original & fileExt), originalImg.rawformat) thumb.save(Server.MapPath(upload_dir & theID & fileExt), originalImg.rawformat) msg = "Uploaded " & fileFld.FileName & " to " & Server.MapPath(upload_dir & upload_original & fileExt) upload_ok = true File.Delete(Server.MapPath(upload_dir & upload_original & fileExt)) catch msg = "Sorry, there was a problem saving your avatar. Please try again." end try if not thumb is nothing then thumb.Dispose() thumb = nothing end if else msg = "That image does not seem to be a JPG. Upload only JPG images." end if catch msg = "That image does not seem to be a JPG." end try end if if not originalImg is nothing then originalImg.Dispose() originalImg = nothing end if end if %><head> <meta http-equiv="pragma" content="no-cache" /> </head> <html> <script type="text/javascript" src="js/jquery-1.3.min.js"></script> <form enctype="multipart/form-data" method="post" runat="server" id="sendImg"> <input type="file" name="upload_file" id="upload_file" style="-moz-opacity: 0; opacity:0; filter: alpha(opacity=0); margin-top: 5px; float:left; cursor:pointer;" onChange="$('#sendImg').submit();" > <input type="submit" value="Upload" style="visibility:hidden; display:none;"> </form> </body> </html> Any help would be great! :o) David

    Read the article

  • Facebook fan page canvas source?

    - by Andre
    Im trying to understand how to learn reading the source of a facebook fan page. So far, I can only get the layout displayed while viewing the source. Here is an example: If you go here: http://www.facebook.com/pages/See-oho-nieps-YothG-RRofiLe/106340746065367#!/pages/Milton-Keynes-United-Kingdom/IF-MR-BEAN-WAS-IN-AVATAR-HE-WOULD-LOOK-LIKE-THIS/302690570115 That canvas page requires you to be a fan of the page. This is done with: content here My question is, why cant I find the FB:visible code in the source of that page? I would be grateful for any guidance!

    Read the article

  • Rails form submission

    - by Danny McClelland
    Hi Everyone, I have a simple form to enter details of a new case (kase), it's working well and clicking submit stores the information and takes the user to the show.html.erb page. However, I wanted to move part of the form to the sidebar - to make things a little easier to see and use for the user, however, when I moved the section to the sidebar - anything entered during either a creation or edit within those sidebar fields is ignored. Any idea how I keep the fields in the sidebar, but include them as before? <% content_for :header do -%> Cases <% end -%> <% form_for(@kase) do |f| %> <%= f.error_messages %> <!-- #START SIDEBAR --> <% content_for :sidebar do -%> <% if @kase.avatar.exists? then %> <%= image_tag @kase.avatar.url %> <% else %> <p style="font-size:smaller"> You can upload an icon for this case that will display here. Usually this would be for the year number icon for easy recognition.</p> <% end %> <div class="js_option"> <h2>Financial Options</h2><p class="finance_showhide"><%= link_to_function "Show","Element.show('finance_showhide');" %> / <%= link_to_function "Hide","Element.hide('finance_showhide');" %></p> </div> <div id="finance_showhide" style="display:none"> <ul id="kases_new_finance"> <li>Invoice Number<span><%= f.text_field :invoicenumber %></span></li> <li>Net Amount<span><%= f.text_field :netamount %></span></li> <li>VAT<span><%= f.text_field :vat %></span></li> <li>Gross Amount<span><%= f.text_field :grossamount %></span></li> <li>Date Closed<span><%= f.text_field :dateclosed %></span></li> <li>Date Paid<span><%= f.text_field :datepaid %></span></li> </ul> </div> <% end -%> <!-- #END SIDEBAR --> <% form_for (@kase), :html => { :multipart => true } do |f| %> <ul id="kases_new"> <li>Job Ref.<span><%= f.text_field :jobno %></span></li> <li>Case Subject<span><%= f.text_field :casesubject %></span></li> <li>Transport<span><%= f.text_field :transport %></span></li> <li>Goods<span><%= f.text_field :goods %></span></li> <li>Date Instructed<span><%= f.date_select :dateinstructed %></span></li> <li>Case Status<span><%= f.select "kase_status", ['Active', 'On Hold', 'Archived', 'Invoice Sent'] %></span></li> <li>Client Reference<span><%= f.text_field :clientref %></span></li> <li>Client Company Name<span><%= f.text_field :clientcompanyname %></span></li> <li>Client Company Address<span><%= f.text_field :clientcompanyaddress %></span></li> <li>Client Company Fax<span><%= f.text_field :clientcompanyfax %></span></li> <li>Case Handler Name<span><%= f.text_field :casehandlername %></span></li> <li>Case Handler Tel<span><%= f.text_field :casehandlertel %></span></li> <li>Case Handler Email<span><%= f.text_field :casehandleremail %></span></li> <li>Claimant Name<span><%= f.text_field :claimantname %></span></li> <li>Claimant Address<span><%= f.text_field :claimantaddress %></span></li> <li>Claimant Contact<span><%= f.text_field :claimantcontact %></span></li> <li>Claimant Tel<span><%= f.text_field :claimanttel %></span></li> <li>Claimant Mob<span><%= f.text_field :claimantmob %></span></li> <li>Claimant Email<span><%= f.text_field :claimantemail %></span></li> <li>Claimant URL<span><%= f.text_field :claimanturl %></span></li> <li>Comments<span><%= f.text_field :comments %></span></li> </ul> <p> <%= f.submit "Create" %> </p> <% end %><% end %> <%= link_to 'Back', kases_path %>

    Read the article

  • GAE images.resize with fixed proportional crop

    - by user288541
    I need to resize and crop to exactly 60x80px from various size and aspect ratio. Just before i put into Datastore. Anyone already got this issue resolved. Currently i already succed to just transform it to exact height (80px) with various width which nott look so good when i try to display it on a list. e.g jcaroussel. My db.put code is like bellow: if users.get_current_user(): personal.personal_id = int(self.request.get('personal_id')) personal.name = self.request.get('name') personal.latitude = self.request.get('latitude') personal.info = self.request.get('info') photo = images.resize(self.request.get('img'), 0, 80) personal.photo = db.Blob(photo) personal.lc_id = int(self.request.get('lc_id')) personal.put() self.redirect('/admin/personal') else: self.response.out.write('I\'m sorry, you don\'t have permission to add this LP Personal Data.') I just want to do similar result when we upload our avatar on google talk/google chat. Anyone solved this? Thx

    Read the article

  • Symfony 1.3 and forms: the password changes when i click on 'Save', why??

    - by user248959
    Hi, i have installed sfDoctrineGuardUser and have created this model that inherits sfGuardUser model: Usuario: inheritance: extends: sfGuardUser type: simple columns: nombre_apellidos: string(60) sexo: boolean fecha_nac: date provincia: string(60) localidad: string(255) email_address: string(255) avatar: string(255) avatar_mensajes: string(255) I have also created a module called 'miembros' based on that model. Well, I log normally through sfGuardAuth/signin, then i go to "miembros/edit/id/$id_of_the_member_i_used_to_log_in" and push 'Save' button. Then i logout. If i try to log in again, it says: "The username and/or password is invalid". Later, i have realized that when click 'Save' the value of the field 'password' changes (well its encrypted version). So that is the reason why i can not then log in. But, why the value of the password change when i click on 'Save' ??? Regards Javi

    Read the article

  • Zend Dd Rowset getting parent row

    - by simple
    I am wondering about using the abstraction in Zend Db RowSet instead of joins, is it possible for instance I am able to get some info from parent table as in here /** * Get default photo info (path , description) */ public function getDefaultPhotoInfo($userdId){ $select = $this->select($this) ->where('id=?', $userdId); $rowset = $this->fetchAll($select); $current = $rowset->current(); $res = $current->findParentRow('UserPhotos', 'Avatar'); if(isset($res)){ return $res->toArray(); } } How can I use Rowset abstraction to get this logic working table( id, pic_path,) table_translation(id, table_id, lang_id, pic_title); the above is representation of two tables , the idea is to get the info from both table specifying the lang_id , it is easy with joins but can I do it with the abstraction of Db Rowset ?

    Read the article

  • protect flash files

    - by user172697
    Hello Ive a website that create avatars for users and provide them with link for avatar to use it in their website or singuters etc , my problems is the website based on flash . the main page has 1 swf file that load other swfs used to create avatars , if someone knows the link for the these swf files he can download them which means he can have all the website lets say: www.test.com as main page which load main swf and other swfs files which located at www.test.com/resources/flash/swffiles/file1.swf anyone can grap these files and have all the website which is a big security breach ive trying so many way protect these files from not download but protecting them means the main swf cant talk to them and cant load the main page correctaly , any suggestion for these .. thanks in advance

    Read the article

  • click buttons error

    - by sara
    I will retrieve student information (id -number- name) from a database (MySQL) as a list view, each student have 2 buttons (delete - alert ) and radio buttons Every thing is ok, but how can I make an onClickListener, for example for the delete button because I try lots of examples, I heard that I can use (custom list or get view or direct onClickListener as in my code (but it is not working ) or Simple Cursor Adapter) I do not know what to use, I looked around for examples that can help me, but in my case but I did not find any so I hope this be reference for anyone have the same problem. this is my code which I use direct onClick with Simple Adapter public class ManageSection extends ListActivity { //ProgresogressDialog pDialog; private ProgressDialog pDialog; // Creating JSON Parser object // Creating JSON Parser object JSONParser jParser = new JSONParser(); //class boolean x =true; Button delete; ArrayList<HashMap<String, String>> studentList; //url to get all products list private static String url_all_student = "http://10.0.2.2/SmsPhp/view_student_info.php"; String cl; // JSON Node names private static final String TAG_SUCCESS = "success"; private static final String TAG_student = "student"; private static final String TAG_StudentID = "StudentID"; private static final String TAG_StudentNo = "StudentNo"; private static final String TAG_FullName = "FullName"; private static final String TAG_Avatar="Avatar"; HashMap<String, String> selected_student; // course JSONArray JSONArray student = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.manage_section); studentList = new ArrayList<HashMap<String, String>>(); ListView list1 = getListView(); list1.setAdapter(getListAdapter()); list1.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int pos, long l) { selected_student =(HashMap<String, String>) studentList.get(pos); //member of your activity. delete =(Button)view.findViewById(R.id.DeleteStudent); cl=selected_student.get(TAG_StudentID); Toast.makeText(getBaseContext(),cl,Toast.LENGTH_LONG).show(); delete.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Log.d("id: ",cl); Toast.makeText(getBaseContext(),cl,Toast.LENGTH_LONG).show(); } }); } }); new LoadAllstudent().execute(); } /** * Background Async Task to Load all student by making HTTP Request * */ class LoadAllstudent extends AsyncTask<String, String, String> { /** * Before starting background thread Show Progress Dialog * */ @Override protected void onPreExecute() { super.onPreExecute(); pDialog = new ProgressDialog(ManageSection.this); pDialog.setMessage("Loading student. Please wait..."); pDialog.setIndeterminate(false); } /** * getting All student from u r l * */ @Override protected String doInBackground(String... args) { // Building Parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL JSONObject json = jParser.makeHttpRequest(url_all_student, "GET", params); // Check your log cat for JSON response Log.d("All student : ", json.toString()); try { // Checking for SUCCESS TAG int success = json.getInt(TAG_SUCCESS); if (success == 1) { // student found // Getting Array of course student = json.getJSONArray(TAG_student); // looping through All courses for (int i = 0; i < student.length(); i++)//course JSONArray { JSONObject c = student.getJSONObject(i); // read first // Storing each json item in variable String StudentID = c.getString(TAG_StudentID); String StudentNo = c.getString(TAG_StudentNo); String FullName = c.getString(TAG_FullName); // String Avatar = c.getString(TAG_Avatar); // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); // adding each child node to HashMap key => value map.put(TAG_StudentID, StudentID); map.put(TAG_StudentNo, StudentNo); map.put(TAG_FullName, FullName); // adding HashList to ArrayList studentList.add(map); } } else { x=false; } } catch (JSONException e) { e.printStackTrace(); } return null; } /** * After completing background task Dismiss the progress dialog * **/ protected void onPostExecute(String file_url) { // dismiss the dialog after getting all products pDialog.dismiss(); if (x==false) Toast.makeText(getBaseContext(),"no student" ,Toast.LENGTH_LONG).show(); ListAdapter adapter = new SimpleAdapter( ManageSection.this, studentList, R.layout.list_student, new String[] { TAG_StudentID, TAG_StudentNo,TAG_FullName}, new int[] { R.id.StudentID, R.id.StudentNo,R.id.FullName}); setListAdapter(adapter); // Updating parsed JSON data into ListView } } } So what do you think, why doesn't the delete button work? There is no error in my log cat. What is the alternative way ?.. what should I do ?

    Read the article

  • Display a MYSQL field using CAKE

    - by adam
    Forgive me if this is a "homework" question. We have a "Rating" table in our mysql db. I want to display this number on our user profile page. JUST BELOW THE GRAVATAR. here is the code in app/views/user/view.ctp <div class="nhplft"> flash(); ? ?d=identicon&s=100" border="0" alt="My Avatar! UID:" / Change Image link("Home",'/items'); ?  |  link('Add',array('controller' = 'items','action'='add')); ?  |  link('Search',array('controller'='items','action'='index')); ?  |  link("Logout",'/users/logout'); } ?

    Read the article

  • Where to store things like user pictures using Azure? Blob Storage?

    - by n26
    I have just migrated a project of mine for test cases to Microsoft's azure. But for functionalities similar to an avatar upload I need write access to the files on the harddrive. But this is a cloud, so this is not possible. How can I build such functionalities instead? Should I use the Blob Storage or is there a better solution? Does it make sense to store all website images (f.e. layout images) in the Blob Storage? So I would have a Cookie-free Domain for my static content?

    Read the article

  • Facebook Like button - comment box with breif description and image

    - by Dave Smith
    On my website when the user selects the facebook like button they have the option to enter comments. This popup window to enter comments only contains the users avatar and place to enter comments. How can i include my pic and a brief description of the site directly below the comment??? At first I thought it was from the HTML title attribute or meta property="og:title" ... but populating these have no affect I have another site that contains both pic and a desc below the comment but the pic seems to be grabed at random -but always the same- from the site and the short desc I thought from the -title- attribute but its not - I changed the -title- and it still shows the same desc, its like its cached??? Any ideas how to control or populate a brief description and image within the comment section of a like button???

    Read the article

  • SimpleDB direct client access

    - by AlexJReid
    One of the useful things about S3 for content storage is that a client can directly make a direct HTTP request to download the object. For instance, this is how Twitter serve up avatar images. SimpleDB provides an HTTP interface to data. Rather than having to write a proxy that sits inbetween SimpleDB and the client, is it possible for client software (i.e. desktop, mobile) to make calls to read values from a SimpleDB domain, without sharing credentials that shouldn't be shared? Or is a proxy in-between the only way to go?

    Read the article

  • StackOverflow WordPress Plugin: Sidebar Widget [closed]

    - by Fernando
    I used the idea from "StackOverflow badge to show in your blog" from here to develop a small WordPress plugin to show your SO reputation and badges on your WordPress weblog sidebar. It's awfully lacking some graphic design, style, color, etc. I also thought of adding the user avatar, and images for the different badges. But it's working so far, and it's pretty late and I have to get some sleep. But I'll add the stuff I mentioned tomorrow. That was quite an interesting PHP challenge. Hope someone finds it as usefull as me (already showing it off on my blog :P ). If you're interested: Download it here

    Read the article

  • Loading external Swf - sandbox violation

    - by Yamen Al-Haj
    Hello Mates , I need a help ... an urgent one !!! i tried so hard to figured it out .. but i couldn't .. so I appreciate your help so much .. I'm developing an Air App using flash ... the app loads an external SWF file dynamically through an xml ... the SWF file has a movieclip that has a listener (ON click ) function mouseDownHandler(event:MouseEvent):void { navigateToURL(new URLRequest(clickURL)); } everything is working fine until i click on this movieclip ... it displays the below message SecurityError: Error #2121: Security sandbox violation: navigateToURL: http://www.mydomain.com/maskot/avatar.swf cannot access YAHOO.COM for example. This may be worked around by calling Security.allowDomain. any help !!! because i really have a deadline ! Thank you so much !

    Read the article

  • Looking for a managed image parser library (JPEG, BMP, PNG, GIF)

    - by usr
    I am writing a discussion board software that will have "avatar" images for the users. I want to resize any picture that gets uploaded to a reasonable size. I could easily do that with System.Drawing but that is relying on GDI+ which has hat security problems before. The problem is that the images are untrusted. So I thought of using a fully managed lib to solve that problem because managed code cannot escape the sandbox (of course it can, but only if the code is user-supplied which it is not in my case). So does anybody know of a managed image parser library for JPEG, BMP, PNG and GIF? If some format is missing than I will have to live with that. Edit: Paint.NET also relies on GDI+. You might be interested in the discussion below, too.

    Read the article

  • Flash CS4/AS3 Writing local file from local game without save dialog prompt?

    - by dragonridingsorceress
    I'm writing a game to be run locally, on the user's computer. NOT over the internet. I want to have a file that will hold the usernames and avatar indices (they're in an array). I want to know if there's a way to write to files through Flash with AS3. I'm using CS4. I'd also like to know if you can delete files through Flash, though that's just optional. Thanks in advance for any help you can give.

    Read the article

  • Comix is an Awesome Comics Archive Viewer for Linux

    - by Asian Angel
    Do you have a terrific collection of comics in electronic form but need a great app to view them with? If you have a Linux system then we have the perfect app for you…Comix, the open source comic reading powerhouse. For our example we installed Comix on our Ubuntu 10.10 system. Just go to the Ubuntu Software Center and conduct a quick search. When you go to install Comix in the Ubuntu Software Center, make sure to scroll all the way to the bottom and select Unarchiver for .rar files. The listing appears as a “non-free version” for some reason, but displays as free once selected. Odd, but nothing to worry about in the end… Once Comix is installed you can find it in the Graphics Section of the Ubuntu Menu. Comix also comes with a nice set of options to let you customize the app to best suit those important comic reading needs. Here is a comprehensive list of the features this little comic reading powerhouse packs into one easy to use package: Fullscreen mode, double page mode, fit-to-screen mode, zooming and scrolling, rotation and mirroring, magnification lens, changeable image scaling quality, image enhancement, can read right-to-left to fit manga, etc., caching for faster page flipping, bookmarks support, customizable GUI, archive comments support, archive converter, thumbnail browser, standards compliant, available in multiple languages (English, Swedish, Simplified Chinese, Spanish, Brazilian Portuguese, & German), reads “JPEG, PNG, TIFF, GIF, BMP, ICO, XPM, & XBM” image formats, reads “ZIP & tar archives natively, RAR archives through the unrar program” runs on Linux, FreeBSD, NetBSD, and virtually any other UNIX-like OS, and more! Have fun reading those comics on your favorite Linux system! Interested in learning more about Comix? Then be certain to drop by the homepage! Comix Homepage Latest Features How-To Geek ETC How to Enable User-Specific Wireless Networks in Windows 7 How to Use Google Chrome as Your Default PDF Reader (the Easy Way) How To Remove People and Objects From Photographs In Photoshop Ask How-To Geek: How Can I Monitor My Bandwidth Usage? Internet Explorer 9 RC Now Available: Here’s the Most Interesting New Stuff Here’s a Super Simple Trick to Defeating Fake Anti-Virus Malware Comix is an Awesome Comics Archive Viewer for Linux Get the MakeUseOf eBook Guide to Speeding Up Windows for Free Need Tech Support? Call the Star Wars Help Desk! [Video Classic] Reclaim Vertical UI Space by Adding a Toolbar to the Left or Right Side of Firefox Androidify Turns You into an Android-style Avatar Reader for Android Updates; Now with Feed Widgets and More

    Read the article

  • Silverlight Cream for April 22, 2010 -- #844

    - by Dave Campbell
    In this Issue: Miroslav Miroslavov, David Anson, Mike Snow, Jason Alderman, Denis Gladkikh, John Papa, Adam Kinney, and CrocusGirl. Shoutout: Mike Snow is moving his blog to Silverlight Tips of The Day... his first is a repeat of number 110 of the last list, but you'll want to bookmark the page. Falling in the 'too cool not to mention' category... Pete Brown posted another MIX10 interview: New Channel 9 Video: Josh Blake on NaturalShow Multi-touch in WPF Adam Kinney announced that the Upgrade to Expression Studio v4 for free – now in writing! From SilverlightCream.com: Visuals staring at the mouse cursor Miroslav Miroslavov at SilverlightShow has a first part post up on the design of the CompleteIT site... going through the 'follow the mouse' effect that is so cool on the main page... with source. Today's DataVisualizationDemos release includes new demos showing off stacked series behavior Falling squarly into the category of "when does he sleep"... David Anson has another Visualization post up today... adding a stacked series and Text-to-Chat sample. Silverlight: Unable to start Debugging. The Silverlight managed debugging package isn’t installed. Mike Snow has a tip up about what to do if you get an "Unable to start debugging" box when you crank up VS ... not a great solution, but it's a solution. Introducing Pillbox for Windows Phone The folks at Veracity definitely have way too much fun with technology :) ... check out the WP7 app that Jason Alderman blogged about... he has a link out to another page with screenshots... oh, AND the code... Export data to Excel from Silverlight/WPF DataGrid Denis Gladkikh demonstrates using COM Interop to export to Excel from both WPF and Silverlight. He discusses isses he had and has all the source for both platforms available. Silverlight TV 21: Silverlight 4 - A Customer's Perspective John Papa has Silverlight TV number 21 up and he's chatting with Franck Jeannin of Ormetis, Ward Bell of IdeaBlade, and Dave Wolf of Cynergy Systems, all presenters in the Keynote at DevConnections. Avatar Mosaic -Experimenting with the Artefact Animator Adam Kinney spent enough time with Artefact Animator to put up a lengthy post about it including his project. Artefact Animator itself is available on CodePlex, and Adam has the link... this looks like good stuff. Windows Phone 7 Design Notes – Part2: Metro + Adrian Frutiger CrocusGirl continues her WP7 Metro discussion with a great long post on background she's researched and some of her own work with typography... a great read. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Don't Miss At Devoxx!!!

    - by Yolande Poirier
    Come by IoT Hack Fest which starts with the session: kickstart your Raspberry Pi and/or Leap Motion project, part II on Tuesday from 9:30am to 12:00pm to learn how to start a project with the Raspberry Pi and Leap Motion. In the afternoon, you can still join a project and create your own project with the help of experts on Raspberry Pi, Leap Motion and other boards.  At the Oracle booth, Java experts will be available  to answer your  questions and demo the new features of the Java Platform, including Java Embedded, JavaFX, Java SE and Java EE. This year, the chess game that was first demoed at JavaOne keynotes last September will be showcased at Devoxx.  Duke is coming to Devoxx this year. You can get your picture taken with Duke on Tuesday, Wednesday and Thursday (Nov. 12-14) from 12:00 to 18:00 Beer bash will be Tuesday from 17:30-19:30 and Wednesday/Thursday from 18:00 to 20:00 at the booth. Oracle is raffling off five Raspberry Pi's and a number of books every day. Make sure to stop by and get your badge scanned to enter the raffle. Raffles are Tuesday at 19:15 and Wednesday/Thursday at 19:45 at the Oracle booth.  The main conference sessions from Oracle Java experts are:  Wednesday 13 November Beyond Beauty: JavaFX, Parallax, Touch, Raspberry Pi, Gyroscopes, and Much More Angela Caicedo, Senior Member, Technical Staff, Oracle Room 7, 12:00–13:00 Lambda: A Peek Under the Hood, Brian Goetz, Software Architect, Oracle Room 8, 12:00–13:00 In Full Flow: Java 8 Lambdas in the Stream, Paul Sandoz, Software Developer, Oracle Room 8, 14:00–15:00 The Modular Java Platform and Project Jigsaw, Mark Reinhold, Chief Architect, Java Platform Group, Oracle, Room 8, 15:10–16:10 The Curious Case of JavaScript on the JVM, Attila Szegedi, Principal Member, Technical Staff, Oracle, Room 5, 16:40–17:40 Is It a Car? Is It a Computer? No, It’s a Raspberry Pi JavaFX Informatics System. Simon Ritter, Principal Technology Evangelist, Oracle Room 7, 16:40–17:40 Thursday 14 November Java EE 7: What’s New in the Java EE Platform Linda DeMichiel, Consulting Member, Technical Staff, Oracle, Room 8, 10:50–11:50 Java Microbenchmark Harness: The Lesser of the Two Evils, Aleksey Shipilev, Principal Member, Technical Staff, Oracle. Room 6, 14:00–15:00 Practical Restful Persistence, Shaun Smith, Senior Principal Product Manager, Oracle Room 8, 17:50–18:50 Friday 15 November Avatar.js, Server-Side JavaScript on the Java Platform, Jean-Francois Denise, Software Developer, Oracle Room 8, 11:50–12:50

    Read the article

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