Daily Archives

Articles indexed Monday April 9 2012

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

  • google-chrome video application association

    - by Ben Lee
    Is there any way to tell google-chrome to launch video files of particular types in an external application (or even just to bring up the download box as if the type was un-handled), instead of showing the video inside the browser? Searching online, it seems that chrome is supposed to use xdg-mime for file associations, but apparently is ignoring this for video. For example, when I do: xdg-mime query default video/mpeg It returns dragonplayer.desktop. But when I click on a mpeg video link, chrome displays it internally instead of launching Dragon Player (if I double click on a mpeg file in my file manager, on the other hand, it does open Dragon Player). So is there a way to tell chrome to respect this setting, or another way to coax chrome into opening the file externally? If it matters, I'm running the latest version of google-chrome stable (not chromium) at the time of writing, v. 18.0.1025.151, on kubuntu 11.10.

    Read the article

  • How can I back up my ubuntu system?

    - by Eloff
    I'm sure there's a lot of questions on here similar to this, and I've been reading them, but I still feel this warrants a new question. I want nightly, incremental backups (full disk images would waste a lot of space - unless compressed somehow.) Preferably rotating or deleting old backups when running out of space or after a fixed number of backups. I want to be able to quickly and painlessly restore my system from these backups. This is my first time running ubuntu as my main development machine and I know from my experience with it as a server and in virtual machines that I regularly manage to make it unbootable or damage it to the point of being unable to rescue it. So how would you recommend I do this? There are so many options out there I really don't know where to start. There seems to be a vocal school of thought that it's sufficient to backup your home directory and the list of installed packages from the package manager. I've already installed lots of things from source, or outside of the package manager (development tools, ides, compilers, graphics drivers, etc.) So at the very least, if I do not back up the operating system itself I need to grab all config files, all program binaries, all created but required files, etc. I'd rather backup too much than too little - an ubuntu install is tiny anyway. Also this drastically reduces the restore time, which would cost me more in my time than the extra storage space. I tried using Deja Dup to backup the root partition, excluding some things like /mnt /media /dev /proc etc. Although many websites assured me you can backup a running linux system this way - that seems to be false as it complained that it could not backup the following files: /boot/System.map-3.0.0-17-generic /boot/System.map-3.2.0-22-generic /boot/vmcoreinfo-3.0.0-17-generic /boot/vmlinuz-3.0.0-17-generic /boot/vmlinuz-3.2.0-22-generic /etc/.pwd.lock /etc/NetworkManager/system-connections/LAN Connection /etc/apparmor.d/cache/lightdm-guest-session /etc/apparmor.d/cache/sbin.dhclient /etc/apparmor.d/cache/usr.bin.evince /etc/apparmor.d/cache/usr.lib.telepathy /etc/apparmor.d/cache/usr.sbin.cupsd /etc/apparmor.d/cache/usr.sbin.tcpdump /etc/apt/trustdb.gpg /etc/at.deny /etc/ati/inst_path_default /etc/ati/inst_path_override /etc/chatscripts /etc/cups/ssl /etc/cups/subscriptions.conf /etc/cups/subscriptions.conf.O /etc/default/cacerts /etc/fuse.conf /etc/group- /etc/gshadow /etc/gshadow- /etc/mtab.fuselock /etc/passwd- /etc/ppp/chap-secrets /etc/ppp/pap-secrets /etc/ppp/peers /etc/security/opasswd /etc/shadow /etc/shadow- /etc/ssl/private /etc/sudoers /etc/sudoers.d/README /etc/ufw/after.rules /etc/ufw/after6.rules /etc/ufw/before.rules /etc/ufw/before6.rules /lib/ufw/user.rules /lib/ufw/user6.rules /lost+found /root /run/crond.reboot /run/cups/certs /run/lightdm /run/lock/whoopsie/lock /run/udisks /var/backups/group.bak /var/backups/gshadow.bak /var/backups/passwd.bak /var/backups/shadow.bak /var/cache/apt/archives/lock /var/cache/cups/job.cache /var/cache/cups/job.cache.O /var/cache/cups/ppds.dat /var/cache/debconf/passwords.dat /var/cache/ldconfig /var/cache/lightdm/dmrc /var/crash/_usr_lib_x86_64-linux-gnu_colord_colord.102.crash /var/lib/apt/lists/lock /var/lib/dpkg/lock /var/lib/dpkg/triggers/Lock /var/lib/lightdm /var/lib/mlocate/mlocate.db /var/lib/polkit-1 /var/lib/sudo /var/lib/urandom/random-seed /var/lib/ureadahead/pack /var/lib/ureadahead/run.pack /var/log/btmp /var/log/installer/casper.log /var/log/installer/debug /var/log/installer/partman /var/log/installer/syslog /var/log/installer/version /var/log/lightdm/lightdm.log /var/log/lightdm/x-0-greeter.log /var/log/lightdm/x-0.log /var/log/speech-dispatcher /var/log/upstart/alsa-restore.log /var/log/upstart/alsa-restore.log.1.gz /var/log/upstart/console-setup.log /var/log/upstart/console-setup.log.1.gz /var/log/upstart/container-detect.log /var/log/upstart/container-detect.log.1.gz /var/log/upstart/hybrid-gfx.log /var/log/upstart/hybrid-gfx.log.1.gz /var/log/upstart/modemmanager.log /var/log/upstart/modemmanager.log.1.gz /var/log/upstart/module-init-tools.log /var/log/upstart/module-init-tools.log.1.gz /var/log/upstart/procps-static-network-up.log /var/log/upstart/procps-static-network-up.log.1.gz /var/log/upstart/procps-virtual-filesystems.log /var/log/upstart/procps-virtual-filesystems.log.1.gz /var/log/upstart/rsyslog.log /var/log/upstart/rsyslog.log.1.gz /var/log/upstart/ureadahead.log /var/log/upstart/ureadahead.log.1.gz /var/spool/anacron/cron.daily /var/spool/anacron/cron.monthly /var/spool/anacron/cron.weekly /var/spool/cron/atjobs /var/spool/cron/atspool /var/spool/cron/crontabs /var/spool/cups

    Read the article

  • How can I install Adobe AIR?

    - by Vamsi Emani
    I am a heavy user of Tweetdeck and few other apps that are built on AIR. It appears that AIR has discontinued support for Linux. Even the older versions in the Adobe AIR Archives seem to support only 32 bit Linux distros and I am on 64 bit Oneiric currently. Is there even a slight possibility that I could run AIR in these conditions? If so, can you please tell me where can I get a detailed step by step installation for this?

    Read the article

  • Hotmail — avoid sign up confirmation / lost password being marked as spam

    - by Xerxes Cameron
    When sending legit large volume Emails from our IP (e.g. for sign up confirmation or Lost password) it gets marked as Junk in Hotmail. In the past, there was the Sender ID SPF Record Submission Form, where you could put yourself on the radar of Microsoft. See this old discussion. However, as of April 2012 this has been abandoned. Any hints what to do now? What is a good way to contact the Hotmail team?

    Read the article

  • Jokes search engine / PHP based search engine on database

    - by matt74tm
    I'm looking for a script, functioning like the Google homepage that fetches data from a database rather than the internet. This is not intended to be a search engine, but a repository of jokes that can be pulled depending on the keywords typed. No sophisticated search techniques are required - keyword based is perfectly fine. If some mechanism of up/down-voting jokes can be incorporated, that would be fantastic, but I'm presuming that will be an entirely different game.

    Read the article

  • Can I host a high traffic website at home?

    - by eric01
    I've been searching this up on google but I can't formulate my google search with the right terms to find an accurate answer to my question. Is it possible to have a super-fast connection at home to host a high traffic website? What is the generic term for that kind of connection? What's the major drawback of hosting at home? (I have no idea of the price range but it's probably quite expensive) Do you have to be a company to have the right to own such a connection?

    Read the article

  • Triangle Picking Picking Back faces

    - by Tangeleno
    I'm having a bit of trouble with 3D picking, at first I thought my ray was inaccurate but it turns out that the picking is happening on faces facing the camera and faces facing away from the camera which I'm currently culling. Here's my ray creation code, I'm pretty sure the problem isn't here but I've been wrong before. private uint Pick() { Ray cursorRay = CalculateCursorRay(); Vector3? point = Control.Mesh.RayCast(cursorRay); if (point != null) { Tile hitTile = Control.TileMesh.GetTileAtPoint(point); return hitTile == null ? uint.MaxValue : (uint)(hitTile.X + hitTile.Y * Control.Generator.TilesWide); } return uint.MaxValue; } private Ray CalculateCursorRay() { Vector3 nearPoint = Control.Camera.Unproject(new Vector3(Cursor.Position.X, Control.ClientRectangle.Height - Cursor.Position.Y, 0f)); Vector3 farPoint = Control.Camera.Unproject(new Vector3(Cursor.Position.X, Control.ClientRectangle.Height - Cursor.Position.Y, 1f)); Vector3 direction = farPoint - nearPoint; direction.Normalize(); return new Ray(nearPoint, direction); } public Vector3 Camera.Unproject(Vector3 source) { Vector4 result; result.X = (source.X - _control.ClientRectangle.X) * 2 / _control.ClientRectangle.Width - 1; result.Y = (source.Y - _control.ClientRectangle.Y) * 2 / _control.ClientRectangle.Height - 1; result.Z = source.Z - 1; if (_farPlane - 1 == 0) result.Z = 0; else result.Z = result.Z / (_farPlane - 1); result.W = 1f; result = Vector4.Transform(result, Matrix4.Invert(ProjectionMatrix)); result = Vector4.Transform(result, Matrix4.Invert(ViewMatrix)); result = Vector4.Transform(result, Matrix4.Invert(_world)); result = Vector4.Divide(result, result.W); return new Vector3(result.X, result.Y, result.Z); } And my triangle intersection code. Ripped mainly from the XNA picking sample. public float? Intersects(Ray ray) { float? closestHit = Bounds.Intersects(ray); if (closestHit != null && Vertices.Length == 3) { Vector3 e1, e2; Vector3.Subtract(ref Vertices[1].Position, ref Vertices[0].Position, out e1); Vector3.Subtract(ref Vertices[2].Position, ref Vertices[0].Position, out e2); Vector3 directionCrossEdge2; Vector3.Cross(ref ray.Direction, ref e2, out directionCrossEdge2); float determinant; Vector3.Dot(ref e1, ref directionCrossEdge2, out determinant); if (determinant > -float.Epsilon && determinant < float.Epsilon) return null; float inverseDeterminant = 1.0f/determinant; Vector3 distanceVector; Vector3.Subtract(ref ray.Position, ref Vertices[0].Position, out distanceVector); float triangleU; Vector3.Dot(ref distanceVector, ref directionCrossEdge2, out triangleU); triangleU *= inverseDeterminant; if (triangleU < 0 || triangleU > 1) return null; Vector3 distanceCrossEdge1; Vector3.Cross(ref distanceVector, ref e1, out distanceCrossEdge1); float triangleV; Vector3.Dot(ref ray.Direction, ref distanceCrossEdge1, out triangleV); triangleV *= inverseDeterminant; if (triangleV < 0 || triangleU + triangleV > 1) return null; float rayDistance; Vector3.Dot(ref e2, ref distanceCrossEdge1, out rayDistance); rayDistance *= inverseDeterminant; if (rayDistance < 0) return null; return rayDistance; } return closestHit; } I'll admit I don't fully understand all of the math behind the intersection and that is something I'm working on, but my understanding was that if rayDistance was less than 0 the face was facing away from the camera, and shouldn't be counted as a hit. So my question is, is there an issue with my intersection or ray creation code, or is there another check I need to perform to tell if the face is facing away from the camera, and if so any hints on what that check might contain would be appreciated.

    Read the article

  • Partial recalculation of visibility on a 2D uniform grid

    - by Martin Källman
    Problem Imagine that we have a 2D uniform grid of dimensions N x N. For this grid we have also pre-computed a visibility look-up table, e.g. with DDA, which answers the boolean query is cell X visible from cell Y? The look-up table is a complete graph KN of the cells V in the grid, with each edge E being a binary value denoting the visibility between its vertices. Question If any given cell has its visibility modified, is it possible to extract the subset Edelta of edges which must have their visibility recomputed due to the change, so as to avoid a full-on recomputation for the entire grid? (Which is N(N-1) / 2 or N2 depending on the implementation) Update If is not possible to solve thi in closed form, then maintaining a separate mapping of each cell and every cell pair who's line intersects said cell might also be an option. This obviously consumes more memory, but the data is static. The increased memory requirement could be reduced by introducing a hierarchy, subdividing the grid into smaller parts, and by doing so the above mapping can be reused for each sub-grid. This would come at a cost in terms of increased computation relative to the number of subdivisions; also requiring a resumable ray-casting algorithm.

    Read the article

  • How to stop a tap event from propagating in a XNA / Silverlight game

    - by Mech0z
    I have a game with Silverlight / XNA game where text and buttons are created in Silverlight while 3d is done in XNA. The Silverlight controls are drawn ontop of the 3D and I dont want a click on a button to interact with the 3D underneath So I have private void ButtonPlaceBrick_Tap(object sender, GestureEventArgs e) { e.Handled = true; But my gesture handling on the 3d objects still runs even though I have set handled to true. private void OnUpdate(object sender, GameTimerEventArgs e) { while (TouchPanel.IsGestureAvailable) { // Read the next gesture GestureSample gesture = TouchPanel.ReadGesture(); switch (gesture.GestureType) How am I supposed to stop it from propagating?

    Read the article

  • Can I get a person's display name or composite name from Apple AddressBook on OSX platform?

    - by AlexT
    I have come across ABRecordCopyCompositeName() in these pages but, having Spotlighted it, have a hunch it's only available for the IOS platform. The AddressBook app itself, and ABPeoplePicker obviously do something similar internally, so is there an equivalent API for OSX? It's a tedious thing to retrieve title, first name, middle name, last name, suffix and work out if it's a company before building it yourself.

    Read the article

  • Eliminating static properties - What patterns do I have at my disposal?

    - by Jamie Dixon
    I currently have a type that I inject into my controllers that's used for getting and setting session data. I use this so that I can obtain relevant session information as _sessionData.Username rather than using Session["username"]. I'd like to use this session information across all of my views and would previously have done this by making the SessionData members static instead of injecting the SessionData class into my controller. I want to avoid using static members as well as having to pass the object to the view in each controller. What patterns best suit this type of scenario? What do you do to solve this same problem?

    Read the article

  • Common views in viewControllers - Code re-usability

    - by Nitish
    I have few common views in most of my viewControllers. What I noticed is that I can reuse single code for all viewControllers which is absolutely wise. For this I decided to create a class Utils which has static methods like +(void)createCommonViews:(float)yAxis:(NSString*)text; In my case common views are three labels and two images. Problem : I am not able to add these views from Utils. I am wondering how can I send self as a parameter so that I may add the views from Utils. It may be wrong to add views outside the viewController. In that case what can be the solution? Taking all these views in a UIView, setting return type of Utils method as UIView and then adding UIView to viewController(after calling method from viewController) might solve my problem. But what I am looking for is some other solution. Thanks, Nitish

    Read the article

  • can't query from dbpedia with a sparql

    - by austin powers
    I want to query from dbpedia using their sparql interface (http://dbpedia.org/sparql) I want to get the abstract of http://dbpedia.org/page/Herbie_Mann I know that I have to call abstract ontology http://dbpedia.org/ontology/abstract and my final sparsql query is like following : SELECT ?abstract WHERE { { <http://dbpedia.org/page/Herbie_Mann> <http://dbpedia.org/ontology/abstract> ?abstract} } but yet I'm not able to see anything. please help me as I am beginner in semantic web!

    Read the article

  • Apple Magic Trackpad Gestures carried out as personalized Commands in Windows

    - by Adele
    I want to have the Apple Magic Trackpad to work on Windows, but NOT as a regular Mouse! I will need the normal Trackpad Gestures to work with a c# Application (i.e. when carring out a 2 finger swipe to the left, it will start playing a song...). I guess I´ll have to write my own driver? Is there a way to use Apples MAgic Trackpad Driver for Windows and re-write that one? OR is there any way (API, self-written driver), so that I could just hook the gestures to my Commands? Or any RAW Input examples? Does anybody know how to do that, or where to start? Thank you so much, I´m really lost.

    Read the article

  • Maze not generating properly. Out of bounds exception. need quick fix

    - by Dan Joseph Porcioncula
    My maze generator seems to have a problem. I am trying to generate something like the maze from http://mazeworks.com/mazegen/mazetut/index.htm . My program displays this http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s320x320/374060_426350204045347_100000111130260_1880768_1572427285_n.jpg and the error Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at Grid.genRand(Grid.java:73) at Grid.main(Grid.java:35) How do I fix my generator program? import java.awt.*; import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import javax.swing.*; import java.util.ArrayList; public class Grid extends Canvas { Cell[][] maze; int size; int pathSize; double width, height; ArrayList<int[]> coordinates = new ArrayList<int[]>(); public Grid(int size, int h, int w) { this.size = size; maze = new Cell[size][size]; for(int i = 0; i<size; i++){ for(int a =0; a<size; a++){ maze[i][a] = new Cell(); } } setPreferredSize(new Dimension(h, w)); } public static void main(String[] args) { JFrame y = new JFrame(); y.setLayout(new BorderLayout()); Grid f = new Grid(25, 400, 400); y.add(f, BorderLayout.CENTER); y.setSize(450, 450); y.setVisible(true); y.setDefaultCloseOperation(y.EXIT_ON_CLOSE); f.genRand(); f.repaint(); } public void push(int[] xy) { coordinates.add(xy); int i = coordinates.size(); coordinates.ensureCapacity(i++); } public int[] pop() { int[] x = coordinates.get((coordinates.size())-1); coordinates.remove((coordinates.size())-1); return x; } public int[] top() { return coordinates.get((coordinates.size())-1); } public void genRand(){ // create a CellStack (LIFO) to hold a list of cell locations [x] // set TotalCells = number of cells in grid int TotalCells = size*size; // choose a cell at random and call it CurrentCell int m = randomInt(size); int n = randomInt(size); Cell curCel = maze[m][n]; // set VisitedCells = 1 int visCel = 1,d=0; int[] q; int h,o = 0,p = 0; // while VisitedCells < TotalCells while( visCel < TotalCells){ // find all neighbors of CurrentCell with all walls intact if(maze[m-1][n].countWalls() == 4){d++;} if(maze[m+1][n].countWalls() == 4){d++;} if(maze[m][n-1].countWalls() == 4){d++;} if(maze[m][n+1].countWalls() == 4){d++;} // if one or more found if(d!=0){ Point[] ls = new Point[4]; ls[0] = new Point(m-1,n); ls[1] = new Point(m+1,n); ls[2] = new Point(m,n-1); ls[3] = new Point(m,n+1); // knock down the wall between it and CurrentCell h = randomInt(3); switch(h){ case 0: o = (int)(ls[0].getX()); p = (int)(ls[0].getY()); curCel.destroyWall(2); maze[o][p].destroyWall(1); break; case 1: o = (int)(ls[1].getX()); p = (int)(ls[1].getY()); curCel.destroyWall(1); maze[o][p].destroyWall(2); break; case 2: o = (int)(ls[2].getX()); p = (int)(ls[2].getY()); curCel.destroyWall(3); maze[o][p].destroyWall(0); break; case 3: o = (int)(ls[3].getX()); p = (int)(ls[3].getY()); curCel.destroyWall(0); maze[o][p].destroyWall(3); break; } // push CurrentCell location on the CellStack push(new int[] {m,n}); // make the new cell CurrentCell m = o; n = p; curCel = maze[m][n]; // add 1 to VisitedCells visCel++; } // else else{ // pop the most recent cell entry off the CellStack q = pop(); m = q[0]; n = q[1]; curCel = maze[m][n]; // make it CurrentCell // endIf } // endWhile } } public int randomInt(int s) { return (int)(s* Math.random());} public void paint(Graphics g) { int k, j; width = getSize().width; height = getSize().height; double htOfRow = height / (size); double wdOfRow = width / (size); //checks verticals - destroys east border of cell for (k = 0; k < size; k++) { for (j = 0; j < size; j++) { if(maze[k][j].checkWall(2)){ g.drawLine((int) (k * wdOfRow), (int) (j * htOfRow), (int) (k * wdOfRow), (int) ((j+1) * htOfRow)); }} } //checks horizontal - destroys north border of cell for (k = 0; k < size; k++) { for (j = 0; j < size; j++) { if(maze[k][j].checkWall(3)){ g.drawLine((int) (k * wdOfRow), (int) (j * htOfRow), (int) ((k+1) * wdOfRow), (int) (j * htOfRow)); }} } } } class Cell { private final static int NORTH = 0; private final static int EAST = 1; private final static int WEST = 2; private final static int SOUTH = 3; private final static int NO = 4; private final static int START = 1; private final static int END = 2; boolean[] wall = new boolean[4]; boolean[] border = new boolean[4]; boolean[] backtrack = new boolean[4]; boolean[] solution = new boolean[4]; private boolean isVisited = false; private int Key = 0; public Cell(){ for(int i=0;i<4;i++){wall[i] = true;} } public int countWalls(){ int i, k =0; for(i=0; i<4; i++) { if (wall[i] == true) {k++;} } return k;} public boolean checkWall(int x){ switch(x){ case 0: return wall[0]; case 1: return wall[1]; case 2: return wall[2]; case 3: return wall[3]; } return true; } public void destroyWall(int x){ switch(x){ case 0: wall[0] = false; break; case 1: wall[1] = false; break; case 2: wall[2] = false; break; case 3: wall[3] = false; break; } } public void setStart(int i){Key = i;} public int getKey(){return Key;} public boolean checkVisit(){return isVisited;} public void visitCell(){isVisited = true;} }

    Read the article

  • cron job for updating user profile data imported via facebook connect

    - by Abidoon Nadeem
    I want to write a cron job for updating user profile data on my website that I pull for users that register via facebook connect on my website. The objective is to keep their profile data on my website in sync with their profile data on facebook. So if a user updates their profile picture on facebook. I want to update his profile picture on my website as well via a cron job which will run every 24 hours. I wanted to know if this is possible and secondly if this is in violation of facebook privacy policy. Based on my research it seems doable but I wanted to know if anyone has already done something like this before. It would really help.

    Read the article

  • Why does Rake task enhancement differ between my local environment and when deploying to Heroku Cedar?

    - by John Bachir
    I have this in lib/tasks/foo.rake: Rake::Task["assets:precompile"].enhance do print ">>>>>>>> hello from precompile" end Rake::Task["assets:precompile:nondigest"].enhance do print ">>>>>>>> hello from precompile:nondigest" end When I run rake assets:precompile locally, both messages are printed. When I push to heroku, only the nondigest message is printed. However, according to the buildpack, the push is executing the exact same command as I am locally. Why does the enhancement to the base assets:precompile case not work on heroku but does work locally?

    Read the article

  • Android OnClick in ListView calling parent function

    - by user1321683
    I have an Android application with a ListView in it, the ListView will setup fine but now I want a image in the ListView to be clickable. I do this by using 2 classes, the Activity class (parent) and an ArrayAdapter to fill the list. In the ArrayAdapter I implement a OnClickListener for the image in the list that I want to be clickable. So far it all works. But now I want to run a function from the activity class when the onClick, for the image in the list, is run but I do not know how. Below are the 2 classes that I use. First the Activity class: public class parent_class extends Activity implements OnClickListener, OnItemClickListener { child_class_list myList; ListView myListView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // setup the Homelist data myList = new child_class_list (this, Group_Names, Group_Dates); myListView = (ListView) findViewById(R.id.list); // set the HomeList myListView.setAdapter( myList ); myListView.setOnItemClickListener(this); } void function_to_run() { // I want to run this function from the LiscView Onclick } public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // do something } } And the ArrayAdapter from where I want to call a function from the Activity class: public class child_class_list extends ArrayAdapter<String> { // private private final Context context; private String[] mName; private String[] mDate; public child_class_list (Context context, String[] Name, String[] Date) { super(context, R.layout.l_home, GroupName); this.context = context; this.mName = Name; this.mDate = Date; } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView = inflater.inflate(R.layout.l_home, parent, false); ImageView selectable_image = (ImageView) rowView.findViewById(R.id.l_selectable_image); selectable_image.setOnClickListener(new OnClickListener() { public void onClick(View v) { // I want to run the function_to_run() function from the parant class here } } ); // get the textID's TextView tvName = (TextView) rowView.findViewById(R.id.l_name); TextView tvDate = (TextView) rowView.findViewById(R.id.l_date); // set the text tvName.setText (mName[position]); tvDate.setText (mDate[position]); return rowView; } } If anyone knows how to run the function in the activity class from the arrayadapter or how to set the image onClickListener in the Activity Class I would greatly apriciate the help.

    Read the article

  • BASH Install Of Wordpress, Without Visiting wp-admin/install.php

    - by user916825
    I wrote this little BASH script that creates a folder,unzips Wordpress and creates a database for a site. The final step is actually installing Wordpress, which usually involves pointing your browser to install.php and filling out a form in the GUI. I want to do this from the BASH shell, but can't figure out how to invoke wp_install() and pass it the parameters it needs: -admin_email -admin_password -weblog_title -user_name (line 85 in install.php) Here's a similar question, but in python #!/bin/bash #ask for the site name echo "Site Name:" read name # make site directory under splogs mkdir /var/www/splogs/$name dirname="/var/www/splogs/$name" #import wordpress from dropbox cp -r ~/Dropbox/Web/Resources/Wordpress/Core $dirname cd $dirname #unwrap the double wrap mv Core/* ./ rm -r Core mv wp-config-sample.php wp-config.php sed -i 's/database_name_here/'$name'/g' ./wp-config.php sed -i 's/username_here/root/g' ./wp-config.php sed -i 's/password_here/mypassword/g' ./wp-config.php cp -r ~/Dropbox/Web/Resources/Wordpress/Themes/responsive $dirname/wp-content/t$ cd $dirname CMD="create database $name" mysql -uroot -pmypass -e "$CMD" How do I alter the script to automatically run the installer without the need to open a browser?

    Read the article

  • Counting the number of words in a text area

    - by user1320483
    Hello everyone my first question on stack overflow import javax.swing.*; import java.util.*; import java.awt.event.*; public class TI extends JFrame implements ActionListener { static int count=0; String ct; JTextField word; JTextArea tohide; public static void main(String arg[]) { TI ti=new TI(); } public TI() { JPanel j=new JPanel(); JLabel def=new JLabel("Enter the text to be encrypted"); word=new JTextField("",20); tohide=new JTextArea("",5,20); JButton jb=new JButton("COUNT"); tohide.setBorder(BorderFactory.createLoweredBevelBorder()); j.add(def); j.add(tohide); j.add(word); j.add(jb); add(j); setSize(500,500); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLocationRelativeTo(null); jb.addActionListener(this); } public void actionPerformed(ActionEvent ae) { String txt=tohide.getText(); StringTokenizer stk=new StringTokenizer(txt," "); while(stk.hasMoreTokens()) { String token=stk.nextToken(); count++; } ct=Integer.toString(count);; word.setText(ct); } } I want to count the number of words that are being typed in the textarea.There is a logical error.As I keep clicking the count button the word count increases.

    Read the article

  • Jquery infinite scroll - with div not scrollbar of body

    - by Thomas
    suppose i have div and i want to fetch data and push data into that div. when user will drag scroll bar of div then next set of data will be fetch and pushed into div. how to detect when scroll bar of div drag to end by jquery. i don't want to use any plugin rather i need jquery code. here is the sample link i like it http://www.stevefenton.co.uk/cmsfiles/assets/File/infinitescroller.html but it used plugin. please help me with sample code for detecting scroll bar drag to end of div. thanks

    Read the article

  • Mac OS X Lion no longer recognizes environment.plist?

    - by Michael Irwin
    Just installed Lion today and my PATH env variable is no longer being set by ~/.MacOSX/environment.plist. Did something change? Can't seem to find any info on that or how to fix. Any ideas? Here's the contents of the PLIST: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PATH</key> <string>/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11/bin:/Users/mdi/bin</string> </dict> </plist>

    Read the article

  • Attribute value nil

    - by mridula
    Can someone tell me why is this happening? I have created a social networking website using Ruby on Rails. This is my first time programming with RoR. I have a model named "Friendship" which contains an attribute "blocked" to indicate whether the user has blocked another user. When I run the following in IRB - friendship = u.friendships.where(:friend_id => 22).first IRB gives me - Friendship Load (0.6ms) SELECT `friendships`.* FROM `friendships` WHERE `friendships`.`user_id` = 17 AND `friendships`.`friend_id` = 22 LIMIT 1 => #<Friendship id: 33, user_id: 17, friend_id: 22, created_at: "2012-04-07 10:29:49", updated_at: "2012-04-07 10:29:49", blocked: 1> As u can see, the "blocked" attribute has value '1'. But when I run the following 1.9.2-p290 :030 > friendship.blocked => nil - it says, the value of blocked is 'nil' and not '1'. Why is this happening? This could be a very silly mistake but I am new to RoR, so kindly help me! I initially didn't include the accessor method for 'blocked'.. I tried that, and still its giving the same result.. Following is the Friendship model.. class Friendship < ActiveRecord::Base belongs_to :friend, :class_name => "User" validates_uniqueness_of :friend_id , :scope => :user_id attr_accessor :blocked attr_accessible :blocked end Here is the schema of the table: 1.9.2-p290 :009 > friendship.class => Friendship(id: integer, user_id: integer, friend_id: integer, created_at: datetime, updated_at: datetime, blocked: integer)

    Read the article

  • Removing multiple files from a Git repo that have already been deleted from disk

    - by Codebeef
    I have a Git repo that I have deleted four files from using rm (not git rm), and my Git status looks like this: # deleted: file1.txt # deleted: file2.txt # deleted: file3.txt # deleted: file4.txt How do I remove these files from Git without having to manually go through and add each file like this: git rm file1 file2 file3 file4 Ideally, I'm looking for something that works in the same way that git add . does, if that's possible.

    Read the article

  • event.stopPropagation(); doesn't behave as expected

    - by Ciprian Amaritei
    I read couple articles related to event.stopPropagation(); but none of the solutions provided works for me. Basically what I have is an accordion widget with all the elements collapsed by default. On each element header (dt tag) there is also a checkbox. Clicking the checkbox shouldn't trigger the accordion to make its elements expand. <dt data-toggle="collapse"> <span class="subscribe-checkbox"><button type="button" class="btn toggle-btn" data-toggle="button"></button></span> </dt> <dd> <p>Accordion content...</p> </dd> Clicking the span (which should act as a checkbox ) should add class "checked" to it. However it also expands the accordion element (dd tag). What I'm doing in jQuery is: $('.accordion-group .btn.toggle-btn').click(function (event) { event.stopPropagation(); }); While the accordion content isn't shown ( which is good) the element doesn't change class either, so it doesn't become 'checked'. I tried with .live() too and didn't work either. Thanks in advance, Ciprian.

    Read the article

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