Search Results

Search found 3393 results on 136 pages for 'friend of george'.

Page 6/136 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • ExpandoObject (dynamics) my greatest friend or my new greatest foe?

    - by WeNeedAnswers
    Yes I know that it shouldn't be abused and that C# is primariy used as a static language. But seriously folks if you could just dirty up some code, in the python style, or create some dynamic do hicky, would you? My mind is working overtime on this having spent a while loving the dynamics of python, is c# going over to the dark side through the back door? Is the argument for static typing a dead one with this obvious addition? Is the argument for less Unit testing a bit silly when we are all grown ups? Or has the addition of dynamics ruined a strongly static typed and well designed language?

    Read the article

  • Rails: show some examples of code from controllers, models and views

    - by Totty
    Hy, my controller example: class FriendsController < ApplicationController before_filter :authorize, :except => [:friends] ############## ############## ## REQUESTS ## ############## ############## ################## # GET MY FRIENDS # ################## # Get my friends. def friends @friends = @my_profile.friends.paginate({:page => params[:page], :per_page => 3}) @profile = @my_profile end ################### # REMOVED FRIENDS # ################### # Get my deleted friends. def removed_friends @removed_friends = @my_profile.friends('removed_friends', params[:page]) end ################### # PENDING FRIENDS # ################### # Friend requests made by other profiles to me. def pending_friends @pending_friends = @my_profile.friends('pending_friends', params[:page]) end ############################ # REJECTED PENDING FRIENDS # ############################ # Rejected friend requests made by other profiles to me. def rejected_pending_friends @rejected_pending_friends = @my_profile.friends('rejected_pending_friends', params[:page]) end ##################### # REQUESTED FRIENDS # ##################### # The friend requests I've sent to others profiles. def requested_friends @requested_friends = @my_profile.friends('requested_friends', params[:page]) end ############################# # DELETED REQUESTED FRIENDS # ############################# # The requests I've sent to others # profiles and then canceled. def deleted_requested_friends @deleted_requested_friends = @my_profile.friends('deleted_requested_friends', params[:page]) end ############# ############# ## ACTIONS ## ############# ############# ########################## # ADD FRIENDSHIP REQUEST # ########################## # Add a friendship request. def add_friendship_request friendship = @my_profile.add_friendship_request(params[:profile_id]) render :json => friendship end ############################# # REMOVE FRIENDSHIP REQUEST # ############################# # Removes a friendship request I've done. def remove_friendship_request friendship = @my_profile.remove_friendship_request(params[:profile_id]) render :json => friendship end ###################### # PROCESS FRIENDSHIP # ###################### # Process friendship: accept or reject a friend. # This will make a new friend or # will make a new rejected pending friend. def process_friendship friendship = @my_profile.process_friendship(params[:profile_id].to_i, params[:accepted].to_i) render :json => friendship end ################### # REMOVE A FRIEND # ################### # Remove a friend from my friends by id. def remove_friend friendship = @my_profile.remove_friend(params[:profile_id]) render :json => friendship end end

    Read the article

  • Binding, Prefixes and generated HTML

    - by Vman
    MVC newbie question re binders. Supposing I have two strongly typed partial actions that happen to have a model attributes with the same name, and are rendered in the same containing page i.e.: Class Friend {string Name {get; set ;} DateTime DOB {get; set ;}} Class Foe {string Name {get; set ;} string ReasonForDislike {get; set ;}} Both partials will have a line: <%= Html.TextBoxFor(model => model.Name) %> And associated controller actions: public ActionResult SaveFriend(Friend friend) public ActionResult SaveFoe(Foe foe) My problem is that both will render on my containing page with the same id (of course, bad for lots of reasons). I’m aware of the [Bind] attribute that allows me add a prefix, resulting in code: public ActionResult SaveFriend([Bind(Prefix = “friend”)] Friend friend) <%= Html.TextBox("friend.Name", Model. Name) %> //Boo, no TextBoxFor :( But this still doesn’t cut it. I can just about tolerate the loss of the strongly typed TextBoxFor helpers but I’ve yet to get clientside validation to work with prefixes: I’ve tried: <%= Html.ValidationMessage("friend.Name") %> ...and every other variant I can think of. I seem to need the model to be aware of the prefix in both directions but bind only applies when mapping the inbound request. It seems (to me) a common scenario but I’m struggling to find examples out there. What am I missing! Thanks in advance.

    Read the article

  • With a username passed to a script, find the user's home directory

    - by Clinton Blackmore
    I am writing a script that gets called when a user logs in and check if a certain folder exists or is a broken symlink. (This is on a Mac OS X system, but the question is purely bash). It is not elegant, and it is not working, but right now it looks like this: #!/bin/bash # Often users have a messed up cache folder -- one that was redirected # but now is just a broken symlink. This script checks to see if # the cache folder is all right, and if not, deletes it # so that the system can recreate it. USERNAME=$3 if [ "$USERNAME" == "" ] ; then echo "This script must be run at login!" >&2 exit 1 fi DIR="~$USERNAME/Library/Caches" cd $DIR || rm $DIR && echo "Removed misdirected Cache folder" && exit 0 echo "Cache folder was fine." The crux of the problem is that the tilde expansion is not working as I'd like. Let us say that I have a user named george, and that his home folder is /a/path/to/georges_home. If, at a shell, I type: cd ~george it takes me to the appropriate directory. If I type: HOME_DIR=~george echo $HOME_DIR It gives me: /a/path/to/georges_home However, if I try to use a variable, it does not work: USERNAME="george" cd ~$USERNAME -bash: cd: ~george: No such file or directory I've tried using quotes and backticks, but can't figure out how to make it expand properly. How do I make this work?

    Read the article

  • A friend told me Python is garbage, I'm taking web design classes in the Spring and I have a textbook on C++. What should I do? [on hold]

    - by user107165
    I dont know if I should start digging into Python beforehand just to get acquanited with programming and "whet my appetite" or if I should work on the C++ book... Python definitely has more resources around town and I like the beginner friendly approach that seems to go along with every site that appeals to it. Or should I just wait for my assignments that start in 4 months? Any tips for an aspiring programmer?

    Read the article

  • Soapi.CS : A fully relational fluent .NET Stack Exchange API client library

    - by Sky Sanders
    Soapi.CS for .Net / Silverlight / Windows Phone 7 / Mono as easy as breathing...: var context = new ApiContext(apiKey).Initialize(false); Question thisPost = context.Official .StackApps .Questions.ById(386) .WithComments(true) .First(); Console.WriteLine(thisPost.Title); thisPost .Owner .Questions .PageSize(5) .Sort(PostSort.Votes) .ToList() .ForEach(q=> { Console.WriteLine("\t" + q.Score + "\t" + q.Title); q.Timeline.ToList().ForEach(t=> Console.WriteLine("\t\t" + t.TimelineType + "\t" + t.Owner.DisplayName)); Console.WriteLine(); }); // if you can think it, you can get it. Output Soapi.CS : A fully relational fluent .NET Stack Exchange API client library 21 Soapi.CS : A fully relational fluent .NET Stack Exchange API client library Revision code poet Revision code poet Votes code poet Votes code poet Revision code poet Revision code poet Revision code poet Votes code poet Votes code poet Votes code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Votes code poet Comment code poet Revision code poet Votes code poet Revision code poet Revision code poet Revision code poet Answer code poet Revision code poet Revision code poet 14 SOAPI-WATCH: A realtime service that notifies subscribers via twitter when the API changes in any way. Votes code poet Revision code poet Votes code poet Comment code poet Comment code poet Comment code poet Votes lfoust Votes code poet Comment code poet Comment code poet Comment code poet Comment code poet Revision code poet Comment lfoust Votes code poet Revision code poet Votes code poet Votes lfoust Votes code poet Revision code poet Comment Dave DeLong Revision code poet Revision code poet Votes code poet Comment lfoust Comment Dave DeLong Comment lfoust Comment lfoust Comment Dave DeLong Revision code poet 11 SOAPI-EXPLORE: Self-updating single page JavaSript API test harness Votes code poet Votes code poet Votes code poet Votes code poet Votes code poet Comment code poet Revision code poet Votes code poet Revision code poet Revision code poet Revision code poet Comment code poet Revision code poet Votes code poet Comment code poet Question code poet Votes code poet 11 Soapi.JS V1.0: fluent JavaScript wrapper for the StackOverflow API Comment George Edison Comment George Edison Comment George Edison Comment George Edison Comment George Edison Comment George Edison Answer George Edison Votes code poet Votes code poet Votes code poet Votes code poet Revision code poet Revision code poet Answer code poet Comment code poet Revision code poet Comment code poet Comment code poet Comment code poet Revision code poet Revision code poet Votes code poet Votes code poet Votes code poet Votes code poet Comment code poet Comment code poet Comment code poet Comment code poet Comment code poet 9 SOAPI-DIFF: Your app broke? Check SOAPI-DIFF to find out what changed in the API Votes code poet Revision code poet Comment Dennis Williamson Answer Dennis Williamson Votes code poet Votes Dennis Williamson Comment code poet Question code poet Votes code poet About A robust, fully relational, easy to use, strongly typed, end-to-end StackOverflow API Client Library. Out of the box, Soapi provides you with a robust client library that abstracts away most all of the messy details of consuming the API and lets you concentrate on implementing your ideas. A few features include: A fully relational model of the API data set exposed via a fully 'dot navigable' IEnumerable (LINQ) implementation. Simply tell Soapi what you want and it will get it for you. e.g. "On my first question, from the author of the first comment, get the first page of comments by that person on any post" my.Questions.First().Comments.First().Owner.Comments.ToList(); (yes this is a real expression that returns the data as expressed!) Full coverage of the API, all routes and all parameters with an intuitive syntax. Strongly typed Domain Data Objects for all API data structures. Eager and Lazy Loading of 'stub' objects. Eager\Lazy loading may be disabled. When finer grained control of requests is desired, the core RouteMap objects may be leveraged to request data from any of the API paths using all available parameters as documented on the help pages. A rich Asynchronous implementation. A configurable request cache to reduce unnecessary network traffic and to simplify your usage logic. There is no need to go out of your way to be frugal. You may set a distinct cache duration for any particular route. A configurable request throttle to ensure compliance with the api terms of usage and to simplify your code in that you do not have to worry about and respond to 50X errors. The RequestCache and Throttled Queue are thread-safe, so can make as many requests as you like from as many threads as you like as fast as you like and not worry about abusing the api or having to write reams of management/compensation code. Configurable retry threshold that will, by default, make up to 3 attempts to retrieve a request before failing. Every request made by Soapi is properly formed and directed so most any http error will be the result of a timeout or other network infrastructure. A retry buffer provides a level of fault tolerance that you can rely on. An almost identical javascript library, Soapi.JS, and it's full figured big brother, Soapi.JS2, that will enable you to leverage your server cycles and bandwidth for only those tasks that require it and offload things like status updates to the client's browser. License Licensed GPL Version 2 license. Why is Soapi.CS GPL? Can I get an LGPL license for Soapi.CS? (hint: probably) Platforms .NET 3.5 .NET 4.0 Silverlight 3 Silverlight 4 Windows Phone 7 Mono Download Source code lives @ http://soapics.codeplex.com. Binary releases are forthcoming. codeplex is acting up again. get the source and binaries @ http://bitbucket.org/bitpusher/soapi.cs/downloads The source is C# 3.5. and includes projects and solutions for the following IDEs Visual Studio 2008 Visual Studio 2010 ModoDevelop 2.4 Documentation Full documentation is available at http://soapi.info/help/cs/index.aspx Sample Code / Usage Examples Sample code and usage examples will be added as answers to this question. Full API Coverage all API routes are covered Full Parameter Parity If the API exposes it, Soapi giftwraps it for you. Building a simple app with Soapi.CS - a simple app that gathers all traces of a user in the whole stackiverse. Fluent Configuration - Setting up a Soapi.ApiContext could not be easier Bulk Data Import - A tiny app that quickly loads a SQLite data file with all users in the stackiverse. Paged Results - Soapi.CS transparently handles multi-page operations. Asynchronous Requests - Soapi.CS provides a rich asynchronous model that is especially useful when writing api apps in Silverlight or Windows Phone 7. Caching and Throttling - how and why Apps that use Soapi.CS Soapi.FindUser - .net utility for locating a user anywhere in the stackiverse Soapi.Explore - The entire API at your command Soapi.LastSeen - List users by last access time Add your app/site here - I know you are out there ;-) if you are not comfortable editing this post, simply add a comment and I will add it. The CS/SL/WP7/MONO libraries all compile the same code and with the exception of environmental considerations of Silverlight, the code samples are valid for all libraries. You may also find guidance in the test suites. More information on the SOAPI eco-system. Contact This library is currently the effort of me, Sky Sanders (code poet) and can be reached at gmail - sky.sanders Any who are interested in improving this library are welcome. Support Soapi You can help support this project by voting for Soapi's Open Source Ad post For more information about the origins of Soapi.CS and the rest of the Soapi eco-system see What is Soapi and why should I care?

    Read the article

  • Designing for mobile (aka designing for everything)

    - by ihaynes
    Last Saturday I went to 'Developer Developer Developer 10' on the Microsoft campus at Reading (UK). This is one of a series of regular events put on by the developer community for the developer community. The guys who organise these events put in a huge amount of time and effort into them and they are well worth getting to if you can.I enjoy these events because there's always something currently relevant but also I can get an insight into things I don't normally come across or work with.Having said that, it's web related things that always grab my attention and this year one of my favourite speakers, George Adamson, gave a session on 'Designing for mobile (aka designing for everything)'. This is a subject close to my heart and I've tried to put the argument forward myself on http://www.ew-resource.co.uk/mobile/ but George makes a far better job of it that I can.His slideshow from the session is available on http://www.slideshare.net/george.adamson and although you won't get his unique presentation style in the static slideshow, this is well worth watching if you have the time.

    Read the article

  • View Script Over SSH?

    - by user74781
    A friend, using a remote machine, ran a script that SSHed to my machine, and ran the following python script that resides on my machine: while (1): ....print "hello world" (this script simply prints 'hello world' continuously). I am now logged in to my machine. How can I see the output of the script my friend was running? if it helps, I can 'spot' the script my friend is using: me@home:~$ ps aux | grep justprint.py **friend 7494 12.8 0.3 7260 3300 ? Ss 17:24 0:06 python TEST_AREA/justprint.py** friend 7640 0.0 0.0 3320 800 pts/3 S+ 17:25 0:00 grep --color=auto just what steps should I take in order to view the "hello world" messages on my screen?

    Read the article

  • iOS: game with facebook challenges

    - by nazz_areno
    I created a game for iPad and I want to challenge my facebook friends. I follow the iOS tutorial in "facebook dev docs", with the "Smash game", but it doesn't explain how to challenge a friend directly to a game. I will explain with an example: I want to start a new match and I want challenge a friend on facebook. Then I send him a request to install the app and when I detect that its app is installed I send him a request to play vs me. Then, when I finish the match I sent him my result and my friend do the same thing. But if I and my friend don't finish the match it is not possible to send another challenge. This scenario is not explained by facebook sdk. Is it necessary to use another instrument to do this situation?

    Read the article

  • Delegates: A Practical Understanding

    - by samerpaul
    It's been a while since I have written on this blog, and I'm planning on reviving it this summer, since I have more time to do so again.I've also recently started working on the iPhone platform, so I haven't been as busy in .NET as before.In either case, today's blog post applies to both C# and Objective-C, because it's more about a practical understanding of delegates than it is about code. When I was learning coding, I felt like delegates was one of the hardest things to conceptually understand, and a lot of books don't really do a good job (in my opinion) of explaining it. So here's my stab at it.A Real Life Example of DelegatesLet's say there are three of you. You, your friend, and your brother. You're each in a different room in your house so you can't hear each other, even if you shout. 1)You are playing a computer game2) Friend is building a puzzle3) Brother is nappingNow, you three are going to stay in your room but you want to be informed if anything interesting is happening to the one of you. Let's say you (playing the computer game) want to know when your brother wakes up.You could keep walking to the room, checking to see if he's napping, and then walking back to your room. But that would waste a lot of time / resources, and what if you miss when he's awake before he goes back to sleep? That would be bad.Instead, you hand him a 2-way radio that works between your room and his room. And you inform him that when he wakes up, he should press a button on the radio and say "I'm awake". You are going to be listening to that radio, waiting for him to say he's awake. This, in essence, is how a delegate works.You're creating an "object" (the radio) that allows you to listen in on an event you specify. You don't want him to send any other messages to you right now, except when he wakes up. And you want to know immediately when he does, so you can go over to his room and say hi. (the methods that are called when a delegate event fires). You're also currently specifying that only you are listening on his radio.Let's say you want your friend to come into the room at the same time as you, and do something else entirely, like fluff your brother's pillow. You will then give him an identical radio, that also hooks into your brother's radio, and inform him to wait and listen for the "i'm awake" signal.Then, when your brother wakes up, he says "I'm awake!" and both you and your friend walk into the room. You say hi, and your friend fluffs the pillow, then you both exit.Later, if you decide you don't care to say hi anymore, you turn off your radio. Now, you have no idea when your brother is awake or not, because you aren't listening anymore.So again, you are each classes in this example, and each of you have your own methods. You're playing a computer game (PlayComputerGame()), your friend is building a puzzle (BuildPuzzle()) and your brother is napping (Napping()). You create a delegate (ImAwake) that you set your brother to do, when he wakes up. You listen in on that delegate (giving yourself a radio and turning it on), and when you receive the message, you fire a new method called SayHi()). Your friend is also wired up to the same delegate (using an identical radio) and fires the method FluffPillow().Hopefully this makes sense, and helps shed some light on how delegates operate. Let me know! Feel free to drop me a line at Twitter (preferred method of contact) here: samerabousalbi

    Read the article

  • uploading image & getting back from database

    - by Anup Prakash
    Putting a set of code which is pushing image to database and fetching back from database: <!-- <?php error_reporting(0); // Connect to database $errmsg = ""; if (! @mysql_connect("localhost","root","")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("test"); $q = <<<CREATE create table image ( pid int primary key not null auto_increment, title text, imgdata longblob, friend text) CREATE; @mysql_query($q); // Insert any new image into database if (isset($_POST['submit'])) { move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.img"); $instr = fopen("latest.img","rb"); $image = addslashes(fread($instr,filesize("latest.img"))); if (strlen($instr) < 149000) { $image_query="insert into image (title, imgdata,friend) values (\"". $_REQUEST['title']. "\", \"". $image. "\",'".$_REQUEST['friend']."')"; mysql_query ($image_query) or die("query error"); } else { $errmsg = "Too large!"; } $resultbytes=''; // Find out about latest image $query = "select * from image where pid=1"; $result = @mysql_query("$query"); $resultrow = @mysql_fetch_assoc($result); $gotten = @mysql_query("select * from image order by pid desc limit 1"); if ($row = @mysql_fetch_assoc($gotten)) { $title = htmlspecialchars($row[title]); $bytes = $row[imgdata]; $resultbytes = $row[imgdata]; $friend=$row[friend]; } else { $errmsg = "There is no image in the database yet"; $title = "no database image available"; // Put up a picture of our training centre $instr = fopen("../wellimg/ctco.jpg","rb"); $bytes = fread($instr,filesize("../wellimg/ctco.jpg")); } if ($resultbytes!='') { echo $resultbytes; } } ?> <html> <head> <title>Upload an image to a database</title> </head> <body bgcolor="#FFFF66"> <form enctype="multipart/form-data" name="file_upload" method="post"> <center> <div id="image" align="center"> <h2>Heres the latest picture</h2> <font color=red><?php echo $errmsg; ?></font> <b><?php echo $title ?></center> </div> <hr> <h2>Please upload a new picture and title</h2> <table align="center"> <tr> <td>Select image to upload: </td> <td><input type="file" name="imagefile"></td> </tr> <tr> <td>Enter the title for picture: </td> <td><input type="text" name="title"></td> </tr> <tr> <td>Enter your friend's name:</td> <td><input type="text" name="friend"></td> </tr> <tr> <td><input type="submit" name="submit" value="submit"></td> <td></td> </tr> </table> </form> </body> </html> --> Above set of code has one problem. The problem is whenever i pressing the "submit" button. It is just displaying the image on a page. But it is leaving all the html codes. even any new line message after the // Printing image on browser echo $resultbytes; //************************// So, for this i put this set of code in html tag: This is other sample code: <!-- <?php error_reporting(0); // Connect to database $errmsg = ""; if (! @mysql_connect("localhost","root","")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("test"); $q = <<<CREATE create table image ( pid int primary key not null auto_increment, title text, imgdata longblob, friend text) CREATE; @mysql_query($q); // Insert any new image into database if (isset($_POST['submit'])) { move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.img"); $instr = fopen("latest.img","rb"); $image = addslashes(fread($instr,filesize("latest.img"))); if (strlen($instr) < 149000) { $image_query="insert into image (title, imgdata,friend) values (\"". $_REQUEST['title']. "\", \"". $image. "\",'".$_REQUEST['friend']."')"; mysql_query ($image_query) or die("query error"); } else { $errmsg = "Too large!"; } $resultbytes=''; // Find out about latest image $query = "select * from image where pid=1"; $result = @mysql_query("$query"); $resultrow = @mysql_fetch_assoc($result); $gotten = @mysql_query("select * from image order by pid desc limit 1"); if ($row = @mysql_fetch_assoc($gotten)) { $title = htmlspecialchars($row[title]); $bytes = $row[imgdata]; $resultbytes = $row[imgdata]; $friend=$row[friend]; } else { $errmsg = "There is no image in the database yet"; $title = "no database image available"; // Put up a picture of our training centre $instr = fopen("../wellimg/ctco.jpg","rb"); $bytes = fread($instr,filesize("../wellimg/ctco.jpg")); } } ?> <html> <head> <title>Upload an image to a database</title> </head> <body bgcolor="#FFFF66"> <form enctype="multipart/form-data" name="file_upload" method="post"> <center> <div id="image" align="center"> <h2>Heres the latest picture</h2> <?php if ($resultbytes!='') { // Printing image on browser echo $resultbytes; } ?> <font color=red><?php echo $errmsg; ?></font> <b><?php echo $title ?></center> </div> <hr> <h2>Please upload a new picture and title</h2> <table align="center"> <tr> <td>Select image to upload: </td> <td><input type="file" name="imagefile"></td> </tr> <tr> <td>Enter the title for picture: </td> <td><input type="text" name="title"></td> </tr> <tr> <td>Enter your friend's name:</td> <td><input type="text" name="friend"></td> </tr> <tr> <td><input type="submit" name="submit" value="submit"></td> <td></td> </tr> </table> </form> </body> </html> --> ** But in this It is showing the image in format of special charaters and digits. 1) So, Please help me to print the image with some HTML code. So that i can print it in my form to display the image. 2) Is there any way to convert the database image into real image, so that i can store it into my hard-disk and call it from tag? Please help me.

    Read the article

  • android custom dialog imageButton onclicklistener

    - by Asaf Nevo
    this is my custom dialog class: package com.WhosAround.Dialogs; import com.WhosAround.AppVariables; import com.WhosAround.R; import com.WhosAround.AsyncTasks.LoadUserStatus; import com.WhosAround.Facebook.FacebookUser; import android.app.Dialog; import android.content.Context; import android.graphics.drawable.Drawable; import android.view.MotionEvent; import android.view.View; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; public class MenuFriend extends Dialog{ private FacebookUser friend; private AppVariables app; public MenuFriend(Context context, FacebookUser friend) { super(context, android.R.style.Theme_Translucent_NoTitleBar); this.app = (AppVariables) context.getApplicationContext(); this.friend = friend; } public void setDialog(String userName, Drawable userProfilePicture) { setContentView(R.layout.menu_friend); setCancelable(true); setCanceledOnTouchOutside(true); TextView name = (TextView) findViewById(R.id.menu_user_name); TextView status = (TextView) findViewById(R.id.menu_user_status); ImageView profilePicture = (ImageView) findViewById(R.id.menu_profile_picture); ImageButton closeButton = (ImageButton) findViewById(R.id.menu_close); name.setText(userName); profilePicture.setImageDrawable(userProfilePicture); if (friend.getStatus() != null) status.setText(friend.getStatus()); else new LoadUserStatus(app, friend, status).execute(0); closeButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dismiss(); } }) } } for some reason eclipse tells me the following errors on closeButton imageButton: The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (new DialogInterface.OnClickListener(){}) The type new DialogInterface.OnClickListener(){} must implement the inherited abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int) The method onClick(View) of type new DialogInterface.OnClickListener(){} must override or implement a supertype method why is that ?

    Read the article

  • Issues installing synapse launcher

    - by George Morton
    I am trying to install synapse launcher on my desktop . I am using these two commands: sudo add-apt-repository ppa:synapse-core/ppa sudo apt-get update && sudo apt-get install synapse However I am getting an error with the second command saying E: Some index files failed to download, they have been ignored, or old ones used instead. I presume this has something to do with my connection to the hosting servers. But what I don't understand is the fact that synaptic is working it just seems to be something about that ppa. I don't know what I am doing wrong as the commands are widely suggested around the web, But they don't seem to work for me! I would greatly appreciate some advice on this as it is proving to be very frustrating. Many thanks, George

    Read the article

  • Override Javascript Function Based on Passed Parameters

    - by George
    Is it possible to override a function based on the number of parameters that you are passing into it? For instance: function abc(name) { document.write ('My name is' + name); } function abc(name,friend) { document.write ('My name is' + name + 'and my best friend\'s name is' + friend); } So in the HTML if I just called abc(george) it would use the first version of the function, but if I called abc(george,john) it would use the second version. There may be other ways to accomplish the example I used, but I'm just wondering if the concept is sound in javascript.

    Read the article

  • Should i repeat person name in alt text of <img> if name is already in source under image?

    - by metal-gear-solid
    if I'm already having person name under/over image then should i use same name in ALT text? <p><img width="125" height="157" alt="George Washington" src="media/gw.jpg"><span>George Washington</span><p> <p><span>George Washington</span> <img width="125" height="157" alt="George Washington" src="media/gw.jpg"><p> Should i repeat <span> in alt in both condition ? image has no link.

    Read the article

  • How to deal with arrays of data in cookies

    - by peter
    Hi all, I want to store data in a cookie and I am not exactly sure how I will go about it. The data is the UserName, and Password values for the users that are logging into a website, e.g. sometime like this UserName = bob, Password=Passw0rd1 UserName = harry, Password=BLANK UserName = george, Password=R0jjd6s What this means is that bob and george logged into the site and chose to have their password remembered, but harry chose for his password not to be remembered. So on the login dialog a dropdown will be present with all the usernames in it 'bob', 'harry', 'george'. If they select the username bob the password will automatically be filled in, etc. So how does that information need to be stored in the cookie? Like it is above, or does it have to be, UserName1 = bob, Password1=Passw0rd1 UserName2 = harry, Password2=BLANK UserName3 = george, Password3=R0jjd6s Are the username and password values actually stored in the same cookie, or is each piece of data separate? Any information would be good.

    Read the article

  • Runescape Private Server - How does it work?

    - by Friend of Kim
    I've seen a lot of Runescape private servers lately. How do they work? Most of them are based on the old Runescape, but a few look exactly like the real Runescape. How do they make the servers? Has the source code of the game been leaked on several occasions, and is that used to make Runescape servers? Or have some people just replicated Runescape, and tried to make the same game themselves (and "stolen" the 3D objects and texture from Jagex to make it look the same, and written the code to be able to replicate most functions of Runescape)?

    Read the article

  • How to setup Java-Home and Path in Ubuntu 12.04

    - by ur truly friend
    we are new to Ubuntu.Recently we changed my server OS to ubuntu 12.04 from windows 7 . every one have their own login details. one of my college installed Open-Jdk7. I asked him, where you installed JAVA, then he suggested to switch the following directory su root cd /usr/lib/Jvm Totally 3 folders are there in JVM folder. names are. java-1.7.0-openjdk-amd64 java-7-openjdk-amd64 java-7-openjdk-common generally, If you install Java in Windows, we will get 2 folder. 1 folder is for JDKand another points to JRE. but, in Ubuntu we have 3 folders. is it right? for my conformation, whether he installed correctly or not. I open Terminal. I run the following 2 commands javac java -version both commands are working fine. now I want to set-up Java-Home and Path for all users at same place.because everyone is working on Application server. Can anyone explain step-by-step. Thanks.

    Read the article

  • Will I be able to get programming interviews at good software companies with a non-CS degree?

    - by friend
    I'll be graduating in a year, but I'll have a degree in Economics. I'm pretty much done with my Economics coursework, and by the time next year comes around I will have devoted 1.5 years to learning CS. I will have almost finished the requirements to graduate with a degree in CS, but unfortunately my school requires a science series that would add another 6-9 months of study if I were to try and get the degree (not to mention a max unit cap). I have or will have taken: Objected Oriented Programming Discrete Math Data structures Calculus through multivariable (doubt this matters at all) Linear Algebra (same) Computer Organization Operating Systems Computational Statistics (many data mining projects in R) Parallel Programming Programming Languages Databases Algorithms Compilers Artificial Intelligence I've done well in the ones I've taken, and I hope to do well in the rest, but will that matter if I can't say to the HR people that I have a CS degree? I'd be happy to get an internship at first too, so should I just apply as if I'm an intern and not looking for fulltime, and then try and parlay that into something? Sidenote if you have time -- Is a computer networks or theory of computation class important? Would it be worth taking either of those in lieu of a class on my list? edit -- I know this isn't AskReddit or College Confidential; I know there will be some outrage at posting a question like this. I'm merely looking for insight into a situation that I've been struggling with, and I think this is the absolute best place to find an answer to this question. Thanks.

    Read the article

  • Fast language for problem solving? [closed]

    - by Friend of Kim
    I learned PHP to make websites. After some years I've started using programming for solving what is difficult tasks for my level. Now I want to make a program that solves equations. (I want to write it myself, not use an API. Because I'm doing this for the sake of the challenge, not for the result..) Because of this, I'm going to learn a new and faster/better language. It's going to be C++, Java, Python or C#. What are the benefits of each language, and which language is best for speed compared to speed of writing and readability? Using C would be lightning fast, but the lack of OO is making for more complex code and reduces the readability, for example..

    Read the article

  • github like workflow on private server over ssh

    - by Jesse
    I have an server (available via ssh) on the internet that my friend and I use for working on projects together. We have started using git for source control. Our setup currently is as follows: Friend created repository on server with git init named project.friend.git I cloned project.friend.git on server to project.jesse.git I then cloned project.jesse.git on server to my local machine using git clone jesse@server:/git_repos/project.jesse.git I work on my local machine and commit to the local machine. When I want to push my changes to the project.jesse.git on server I use git push origin master. My friend is working on project.friend.git. When I want to get his changes I do pull jesse@server:/git_repos/project.friend.git. Everything seems to be working fine, however, I am now getting the following error when I do git push origin master: localpc:project.jesse jesse$ git push origin master Counting objects: 100, done. Delta compression using up to 2 threads. Compressing objects: 100% (76/76), done. Writing objects: 100% (76/76), 15.98 KiB, done. Total 76 (delta 50), reused 0 (delta 0) warning: updating the current branch warning: Updating the currently checked out branch may cause confusion, warning: as the index and work tree do not reflect changes that are in HEAD. warning: As a result, you may see the changes you just pushed into it warning: reverted when you run 'git diff' over there, and you may want warning: to run 'git reset --hard' before starting to work to recover. warning: warning: You can set 'receive.denyCurrentBranch' configuration variable to warning: 'refuse' in the remote repository to forbid pushing into its warning: current branch. warning: To allow pushing into the current branch, you can set it to 'ignore'; warning: but this is not recommended unless you arranged to update its work warning: tree to match what you pushed in some other way. warning: warning: To squelch this message, you can set it to 'warn'. warning: warning: Note that the default will change in a future version of git warning: to refuse updating the current branch unless you have the warning: configuration variable set to either 'ignore' or 'warn'. To jesse@server:/git_repos/project.jesse.git c455cb7..e9ec677 master -> master Is this warning anything I need to be worried about? Like I said, everything seems to be working. My friend is able to pull my changes in from my branch. I have the clone on the server so he can access it since he does not have access to my local machine. Is there something that could be done better? Thanks!

    Read the article

  • How to get a profile picture from fb:friends selector

    - by malshan
    Im a Newbie to PHP and FBML(Facebook Markup Language).....so now im coding a Facebook app so I need to get profile picture and friend name when I select a name from FB:Friend Selector Select a Friend <fb:friend-selector uid="exclude_ids" name="pal" idname="friend_sel" /> I use exclude_ids to see all friends in my selector so how to get profile picture? I can get name from this but how to get the profile pic large?

    Read the article

  • Missing /dev/xconsole causes rsyslog to stop as well as all other services

    - by George Van Tuyl
    We are running Ubuntu-10.04.04LTS in Hyper-V environments. We found that the services ssh http or anything else stopped because the rsyslog daemon had died with the message unable to find the /dev/xconsole file. I fixed it temporarily with the following. FILE=/dev/xconsole if [ -e $FILE ]; then echo "$FILE exists Carry on!" else mknod -m 640 /dev/xconsole c 1 3 chown syslog:adm /dev/xconsole echo "Created $FILE." fi The problem is that I can not get rsyslog daemon to process these 8 lines when I restart the daemon. Also restarting the daemon removes the /dev/xconsole file and we are back to all service stopped. In addressing this problem I have inserted the if--fi lines after the start and restart conditions in the rsyslog script. The problem is I do not get an echo to stdio. Does someone have an idea on how to make the rsyslog report to stdio when it creates the /dev/xconsole device. Thanks George Van Tuyl

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >