Daily Archives

Articles indexed Sunday November 10 2013

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

  • Netbeans doesn't start, Java fatal error, unless sudo

    - by elect
    Fresh 13.10 64b Openjdk 6 is there, I just installed Netbeans 7.01 from the repo, but it doesn't work, I open then a console elect@elect-desktop:~$ netbeans # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007faebdf79325, pid=5251, tid=140388628424448 # # JRE version: 6.0_27-b27 # Java VM: OpenJDK 64-Bit Server VM (20.0-b12 mixed mode linux-amd64 compressed oops) # Derivative: IcedTea6 1.12.6 # Distribution: Ubuntu Saucy Salamander (development branch), package 6b27-1.12.6-1ubuntu2 # Problematic frame: # C [libgobject-2.0.so.0+0x14325] g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv+0x985 # # An error report file with more information is saved as: # /home/elect/hs_err_pid5251.log [thread 140386948781824 also had an error] # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # https://bugs.launchpad.net/ubuntu/+source/openjdk-6/ # /usr/share/netbeans/7.0.1/bin/../platform/lib/nbexec: line 548: 5251 Aborted (core dumped) "/usr/lib/jvm/java-6-openjdk-amd64/bin/java" -Djdk.home="/usr/lib/jvm/java-6-openjdk-amd64" -Djava.library.path=/usr/lib/jni -classpath "/usr/share/netbeans/7.0.1/platform/lib/boot.jar:/usr/share/netbeans/7.0.1/platform/lib/org-openide-modules.jar:/usr/share/netbeans/7.0.1/platform/lib/org-openide-util.jar:/usr/share/netbeans/7.0.1/platform/lib/org-openide-util-lookup.jar:/usr/lib/jvm/java-6-openjdk-amd64/lib/dt.jar:/usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar" -Dnetbeans.system_http_proxy="DIRECT" -Dnetbeans.system_http_non_proxy_hosts="" -Dnetbeans.dirs="/usr/share/netbeans/7.0.1/nb:/usr/share/netbeans/7.0.1/bin/../ergonomics:/usr/share/netbeans/7.0.1/ide:/usr/share/netbeans/7.0.1/java:/usr/share/netbeans/7.0.1/bin/../xml:/usr/share/netbeans/7.0.1/apisupport:/usr/share/netbeans/7.0.1/bin/../webcommon:/usr/share/netbeans/7.0.1/bin/../websvccommon:/usr/share/netbeans/7.0.1/bin/../enterprise:/usr/share/netbeans/7.0.1/bin/../mobility:/usr/share/netbeans/7.0.1/bin/../profiler:/usr/share/netbeans/7.0.1/bin/../ruby:/usr/share/netbeans/7.0.1/bin/../python:/usr/share/netbeans/7.0.1/bin/../php:/usr/share/netbeans/7.0.1/bin/../visualweb:/usr/share/netbeans/7.0.1/bin/../soa:/usr/share/netbeans/7.0.1/bin/../identity:/usr/share/netbeans/7.0.1/bin/../uml:/usr/share/netbeans/7.0.1/harness:/usr/share/netbeans/7.0.1/bin/../cnd:/usr/share/netbeans/7.0.1/bin/../dlight:/usr/share/netbeans/7.0.1/bin/../groovy:/usr/share/netbeans/7.0.1/bin/../extra:/usr/share/netbeans/7.0.1/bin/../javafx:/usr/share/netbeans/7.0.1/bin/../javacard:" -Dnetbeans.home="/usr/share/netbeans/7.0.1/platform" '-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade' '-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense' '-XX:MaxPermSize=384m' '-Xmx768m' '-client' '-Xss2m' '-Xms32m' '-XX:PermSize=32m' '-Dapple.laf.useScreenMenuBar=true' '-Dapple.awt.graphics.UseQuartz=true' '-Dsun.java2d.noddraw=true' '-Dsun.java2d.pmoffscreen=false' -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="/home/elect/.netbeans/7.0/var/log/heapdump.hprof" org.netbeans.Main --userdir "/home/elect/.netbeans/7.0" "--branding" "nb" 0<&0 Looking around, the second answer, here Vigintas Labakojis, points out something regarding permission, I just try sudo netbeans, it works.. Then I look for the ~/.cache/netbeans/ I dont have, I have instead ~/.netbeans/ Then I run his commands on those folder, it doesn't work.. It must be something else, do you have any idea? In any case, my log /home/elect/hs_err_pid5251.log is here

    Read the article

  • Cannot boot computer, help please :(

    - by Austin
    Ok so here is more descriptions, I REALLY NEED HELP! I installed Ubuntu on a disk (unsure of v. I can't check.. Computer is broke :/ ) I then burned the disk I restarted computer pressed f12 blah blah it came up, I pressed enter for English, I plugged an Ethernet card in for better connection, and then started the installation.... I did the basics, and I entered a host name, and a user name and pass all that, when it came to partition page, I presse enter for no and then it went back to the installation page, I pressed install again, and it brought me back, so I selected yes , it loaded an it asked what software to instal I selected sh ( it was first option and I didn't know which to do ) so after everything finished loading, my disk was ejected the process finish, I run my computer and it opens up in log in page on cmd script I didn't know it, so I ran disk again makin a user and pass to remember.... Going back to login thing I logged in, and all it did was say my username... I didn't know what to do from there, I looked online found nothing but grub stuff, so I went to "Advanced Ubuntu options" and then "(Recovery Mode) and went to update grub... In middle o loading it asked to continue (Y/n) I typed Y and it finished, it went back to the options located in (Recovery Mode) and I closed it, and it loaded... And then showed up in another script screen, saying a paragraph on top, and on left side ( where login: would be located etc. ) it says "Grub" and I don't know what to type, if I turn off computer and turn back on it just goes straight to that again... PLEASE HELP:(

    Read the article

  • Duplicate (Spotify) Icon in launcher

    - by user191231
    I have installed spotify on Ubuntu 13.04 and have locked the icon on the launcher. But when I exit the program fully or even restart and use that icon to open spotify, a new icon is created or a different icon is generated with a ? on it. It is a clean install of Ubuntu 13.04 so was wondering if this is a known bug or if there was a way of making sure it just doesn't created a duplicate icon? N.B it has not happened as of yet to any other program I have installed (Chrome & Steam)

    Read the article

  • In 13.04 using Unity Tweak Tool hot corners stops working after reboot

    - by Sanseriff Sanseriff
    I have 13.04 64 bit Ubuntu installed and I'm using Unity Tweak tool to enable hot corners everything works as it should as long as I don't reboot as soon as I do hotcorners stops working. In order to get them functioning again I have to open the tweak tool and turn hotcorners off and then back on after every reboot. This I admit isn't a huge issue but is annoying is there anyway to get hotcorners to work properly after reboot with out having to reset them every time?

    Read the article

  • Unable to run Tor even in terminal, Vidalia exit code 127

    - by Ubuntu Newb
    I'm using Ubuntu 12.10 (quantal) and I recently installed Tor (32 bits) following the instructions on the Tor project's page. Then I started the script after having it extracted from the console and got this: master@ubuntu:~/tor-browser_en-US$ ./start-tor-browser Launching Tor Browser Bundle for Linux in /home/master/tor-browser_en-US ./start-tor-browser: 225: ./start-tor-browser: ./App/vidalia: not found Vidalia exited abnormally. Exit code: 127 Then I ran Vidalia from the console and: master@ubuntu:~/tor-browser_en-US$ vidalia (<unknown>:11354): IBUS-WARNING **: Unable to load /var/lib/dbus/machine-id: Failed to open file '/var/lib/dbus/machine-id': Permission denied master@ubuntu:~/tor-browser_en-US$ vidalia (<unknown>:11358): IBUS-WARNING **: Unable to load /var/lib/dbus/machine-id: Failed to open file '/var/lib/dbus/machine-id': Permission denied And after Vidalia's GUI opens I get the error prompt about starting Tor: "Vidalia was unable to start Tor. Check your settings to ensure the correct name and location of your Tor executable is specified." How can I start Tor?

    Read the article

  • phpMyAdmin - Display all queries

    - by Carlos Fernández San Millán
    I have installed a fresh desktop with ubuntu quantal and the following packages versions: MySQL: 5.5.28-0ubuntu0.12.10.1 Apache: 2.2.22 (Ubuntu) phpMyAdmin: 3.4.11.1deb1 I would like phpmyadmin to display all the queries I run. How can I do it? Thank you very much. UPDATE To be more specific, there are some queries showing into the query box, but I would like phpMyAdmin to show ALL of them including when I export a Database (if possible). Thank you.

    Read the article

  • SEO: Single URL rewrite from one app to another

    - by user1909186
    I have two web applications running on two different servers. I want one, example.com/hello, to redirect to the second, hello.com. But I want both to contribute to each other's SEO ranking. What is the best way to accomplish this primarily for google search and for other search engines? I currently do a rewrite with permanent from example.com/hello to hello.com using nginx. Thanks for your help

    Read the article

  • Blogger Template: How is inline style tag getting attached to img? [migrated]

    - by john Smith
    Examining a blogger template's img tag (data:post.thumbnailUrl) i've approached a mystery. An inline style tag controlling the width, margin and heigh perimeters are getting added to my img element. They are auto adjusting the images ratio to fit a smaller size. But I can't figure-out where this style tag script lives and how it's happening in my template. My template has no special javascript or jquery scripts. The full size images in the single posts page don't have this style tag. Is this a css or xml feature? element.style { margin-top: 0px; width: 301.0033444816054px; height: 200px; margin-left: -0.5016722408026908px; }

    Read the article

  • Repeating keywords in inbound links

    - by JJ_Jason
    Hy. I have a service similar to bit.ly. The link generation method is similar but the site is not. A user uses my site just like the mentioned bit.ly, but i offer a differnet kind of service for which i would want to rank (on Google) for. If i were to generate links such as: mysite.com/my-keywords/1Asdf34 would it be considered spammy or black hat? The same for bit.ly would be: bit.ly/url-shortening-services/3k1dS4sd For bit.ly it would defeat the purpose, but url length in my case does not have to be short.

    Read the article

  • Bootstrap 3.0.0: How to use data-slide-to outside of indicators?

    - by Griffin
    I am attempting to make a small gallery like the one shown below - I'm sure you've all seen them considering they are fairly common. When trying to make one using bootstrap I ran into a major problem. I can't seem to link the smaller bottom images to the larger top one that was when one of the smaller ones is clicked it changes to the selected image. I am attempting to use data-slide-to however it does not seem to work outside of the "carousel-indicators". I can't put it into the carousel indicators list because that moves the images up into the gallery (It may be possible to fix this with CSS but my attempts have been worthless). Does anyone know the problem? I've tried tags around each image that didn't seem to work then I tried divs. Still nothing. Things to note: I am using 3.0.0 All images are generated (if you haven't guessed already) Smaller images are separate from larger one (not auto scaled down)

    Read the article

  • JavaScript loaded external content SEO

    - by user005569871
    I wonder what is the best way to have Javascript loaded content indexed by search engines. I know that search engines don't execute Javascript, but I am thinking more of an progressive enchantment. I am creating a responsive website, and on the home page I will have some sections about most visited products and recommended product that I plan to load depending on the device detected. These products will be in sliders with thumbnail images and names of the products. If mobile is detected slider content will not load, ant the link to the external page will be shown. I know that external content will be indexed via link to those resources. Where will the users be directed from search in this case? To the external page or home page? Will it be bad for SEO if I show only product names on front page so they can be indexed and hide them with CSS? What is the best way to index that content and possibly direct users from search to home page? Also, i've seen the Ajax crawling but iI would like not to use that if there is any better way.

    Read the article

  • Seeking .htaccess help: Converting multiple subdomains (both HTTP and HTTPS) to www.domain.com using .htaccess

    - by Joshua Dorkin
    I've been trying to get an answer to this question on other forums (the folks at SuperUser thought this was the place I needed to post) and via my connections, but I haven't gotten very far. Hopefully you guys can help me find an answer. I've got a dozen old subdomains that have been indexed by Google. These have been indexed as both HTTP AND HTTPS. I've managed to redirect all the subdomains properly, provided they are not HTTPS, but can't get any of the HTTPS subdomains to property redirect. Here's the code I'm using: RewriteCond %{HTTP_HOST} ^subdomain1.mysite.com$ [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^subdomain2.mysite.com$ [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^subdomain3.mysite.com$ [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L] This works great until someone goes to: https://subdomain2.mysite.com$ which is not redirected back to http://www.mysite.com$ How can I get this to work? Additionally, I'm guessing there is an easier way to make it happen than setting up a dozen pairs of RewriteCond/RewriteRule? Is there any way to do this in just a few lines, including one where I list all the subdomains? I'd actually also like to redirect everything on https://www.mysite.com$ to http://www.mysite.com$ except for 3 folders. These are mysite.com/secure, mysite.com/store, mysite.com/user. Is there any good way to add this to the .htaccess file?

    Read the article

  • What's the best way to start up a opengl context in my setup?

    - by NoobScratcher
    Would it be better to create a callback function which contains a OpenGL 3.0+ Context including viewport, matrix, etc or setup OpenGL in a function called GL_StartUp and use that GL_StartUp Function in the mainloop and callback function to that Function. I want my program to only show a OpenGL default scene when the user clicks on the New Game menu item in the menu bar rather then just have one setup when the program starts. I'm using Ubuntu 64bit, GTK 3.0 and GTK OpenGL

    Read the article

  • Lwjgl or opengl double pixels

    - by Philippe Paré
    I'm working in java with LWJGL and trying to double all my pixels. I'm trying to draw in an area of 800x450 and then stretch all the frame image to the complete 1600x900 pixels without them getting blured. I can't figure out how to do that in java, everything I find is in c++... A hint would be great! Thanks a lot. EDIT : I've tried drawing to a texture created in opengl by setting it to the framebuffer, but I can't find a way to use glGenTextures() in java... so this is not working... also I though about using a shader but I would not be able to draw only in the smaller region...

    Read the article

  • c++ most used libraries [on hold]

    - by Basaa
    I'm trying to find out whether or not I want to switch from Java to c++ for my OpenGL game programming. I now have setup a test project in VS 11 professional, with GLUT. I created my windows with GLUT, and I can render OpenGL primitives without any problems. Now my question: What library(s) is/are used mostly in the indie/semi professional industry for using OpenGL in c++? With 'using OpenGL' I mean: Creating and managing an OpenGL window Actually using the OpenGL API Handling user-input (keyboard/mouse)

    Read the article

  • Bump mapping Problem GLSL

    - by jmfel1926
    I am having a slight problem with my Bump Mapping project. Although everything works OK (at least from what I know) there is a slight mistake somewhere and I get incorrect shading on the brick wall when the light goes to the one side or the other as seen in the picture below: The light is on the right side so the shading on the wall should be the other way. I have provided the shaders to help find the issue (I do not have much experience with shaders). Shaders: varying vec3 viewVec; varying vec3 position; varying vec3 lightvec; attribute vec3 tangent; attribute vec3 binormal; uniform vec3 lightpos; uniform mat4 cameraMat; void main() { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = ftransform(); position = vec3(gl_ModelViewMatrix * gl_Vertex); lightvec = vec3(cameraMat * vec4(lightpos,1.0)) - position ; vec3 eyeVec = vec3(gl_ModelViewMatrix * gl_Vertex); viewVec = normalize(-eyeVec); } uniform sampler2D colormap; uniform sampler2D normalmap; varying vec3 viewVec; varying vec3 position; varying vec3 lightvec; vec3 vv; uniform float diffuset; uniform float specularterm; uniform float ambientterm; void main() { vv=viewVec; vec3 normals = normalize(texture2D(normalmap,gl_TexCoord[0].st).rgb * 2.0 - 1.0); normals.y = -normals.y; //normals = (normals * gl_NormalMatrix).xyz ; vec3 distance = lightvec; float dist_number =length(distance); float final_dist_number = 2.0/pow(dist_number,diffuset); vec3 light_dir=normalize(lightvec); vec3 Halfvector = normalize(light_dir+vv); float angle=max(dot(Halfvector,normals),0.0); angle= pow(angle,specularterm); vec3 specular=vec3(angle,angle,angle); float diffuseterm=max(dot(light_dir,normals),0.0); vec3 diffuse = diffuseterm * texture2D(colormap,gl_TexCoord[0].st).rgb; vec3 ambient = ambientterm *texture2D(colormap,gl_TexCoord[0].st).rgb; vec3 diffusefinal = diffuse * final_dist_number; vec3 finalcolor=diffusefinal+specular+ambient; gl_FragColor = vec4(finalcolor, 1.0); }

    Read the article

  • pointToPosition in GridView does not work

    - by Unstoppable
    I have this code: long position = imageAdapter.getItemId (gridView.pointToPosition( (int) event.getX() (int) event.getY())); Theoretically, this code should work, but when I display information Log.d function, I always get a "0" position. What am I doing wrong? PS. The code I have implemented the method public void onMyGridTouch from this topic - Dynamically change the image color layout in a row in a GridView

    Read the article

  • Sending email using Perl using sendmail

    - by i.h4d35
    I am following the example from this website to send an email using Perl. The code looks like so: my $hostname = `hostname`; my $this_day = `date`; my $email = "i.h4d35\@gmail.com"; my $to = "$email"; my $from = "admin\@$hostname"; my $subject = "SCHEDULE COMPLETE - $this_day"; my $message = "Student schedule for today, completed for the following students: \n\n$names\n\nHave a nice day..."; open(MAIL, "|/usr/sbin/sendmail -t"); print MAIL "To: $to\n"; print MAIL "From: $from\n"; print MAIL "Subject: $subject\n\n"; print MAIL $message; close(MAIL); The mail gets sent but the subject appears in the body of the mail and the email has no subject. How do I fix this? PS: Have not gotten around to using MIME::Lite yet as I am still learning this.

    Read the article

  • minimal cover for functional dependencies

    - by user2975836
    I have the following problem: AB -> CD H->B G ->DA CD-> EF A -> HJ J>G I understand the first step (break down right hand side) and get the following results: AB -> C AB -> D H -> B G -> D G -> A CD -> E CD -> F A -> H A -> J J -> G I understand that A - h and h - b, therefore I can remove the B from AB - c and ab - D, to get: A -> C A -> D H -> B G -> D G -> A CD -> E CD -> F A -> H A -> J J -> G The step that follows is what I can't compute (reduce the left hand side) Any help will be greatly appreciated.

    Read the article

  • httprequest handle time delays till having response

    - by bourax webmaster
    I have an application that calls a function to send JSON object to a REST API, my problem is how can I handle time delays and repeat this function till i have a response from the server in case of interrupted network connexion ?? I try to use the Handler but i don't know how to stop it when i get a response !!! here's my function that is called when button clicked : protected void sendJson(final String name, final String email, final String homepage,final Long unixTime,final String bundleId) { Thread t = new Thread() { public void run() { Looper.prepare(); //For Preparing Message Pool for the child Thread HttpClient client = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); //Timeout Limit HttpResponse response; JSONObject json = new JSONObject(); //creating meta object JSONObject metaJson = new JSONObject(); try { HttpPost post = new HttpPost("http://util.trademob.com:5000/cards"); metaJson.put("time", unixTime); metaJson.put("bundleId", bundleId); json.put("name", name); json.put("email", email); json.put("homepage", homepage); //add the meta in the root object json.put("meta", metaJson); StringEntity se = new StringEntity( json.toString()); se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); post.setEntity(se); String authorizationString = "Basic " + Base64.encodeToString( ("tester" + ":" + "tm-sdktest").getBytes(), Base64.NO_WRAP); //Base64.NO_WRAP flag post.setHeader("Authorization", authorizationString); response = client.execute(post); String temp = EntityUtils.toString(response.getEntity()); Toast.makeText(getApplicationContext(), temp, Toast.LENGTH_LONG).show(); } catch(Exception e) { e.printStackTrace(); } Looper.loop(); //Loop in the message queue } }; t.start(); }

    Read the article

  • Rails Heroku Gemfile.lock error - push rejected (open source)

    - by KJ50
    I am trying to push my open source RoR application to Heroku but I'm having an issue making the initial push. I have read many similar questions, but none of those answers has helped to solve my problem. I have tried bundle update and bundle install various times. I also have tried removing and then re-committing my Gemfile.lock file, however I get this same error still... $ git push heroku master Counting objects: 5199, done. Compressing objects: 100% (3086/3086), done. Writing objects: 100% (5199/5199), 4.57 MiB | 131 KiB/s, done. Total 5199 (delta 3418), reused 3152 (delta 1962) -----> Removing .DS_Store files -----> Ruby app detected -----> Compiling Ruby/NoLockfile ! ! Gemfile.lock required. Please check it in. ! ! Push rejected, failed to compile Ruby app To [email protected]:frozen-springs-4725.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:frozen-springs-4725.git' Since my application uses MongoDB with MongoMapper, I suspect that I have some configuration incorrect. My code can be found here on Github (I'm currently working on the heroku branch). Feel free to clone our repository and try it yourself. If anyone has any insight which could help me resolve this issue I would be very thankful!

    Read the article

  • Oracle sql developer can acess from loalhost but not ip address

    - by Welcome Always
    Here i have installed widows server 2008 64 orale 11g r2 64 now i want to access this from the ip address that i have set to my server not working i can't access trough the ip address.... when i use on my application .....local host it can get connected but when i add the ip for example 10.0.0.2 it's not connecting now simply also on local when i write the ip address it's not connecting but with localhost works fine..... so even i have used listener. regards

    Read the article

  • How to transfer visitors to the servers closes to them and where to place the servers?

    - by user2971623
    I am focusing on providing fast page refreshes for my visitors and I wonder where is the smartest spot to place my servers on? I understand that the best would be to place a server in every country or even city, but that is of course not doable with my economy. I am thinking of maybe setting up three servers, one in the middle of USA (Kansas?), one in Italy and one in Sweden. What do you think about that? I don't care about Africa since they haven't even got computers so I won't get traffic from there anyway. China, North Korea etc are probably just visiting chinese websites, they barely know english anway... The next problem is how do I redirect a visitor from Finland to the Swedish server? I don't want the visitor from Finland to be using the USA server or vice versa.

    Read the article

  • How do I create an instance of this class in Android?

    - by Lloyd Banks
    I was wondering if it is possible to create an instance of this class (from the link, which creates a listview) from another class so that I can call on either lazyadapter.java or customizedlistview.java (not sure which one) to inflate that same listview. Is this possible? This is what I tried (obviously incorrect): CustomizedListView clv = new CustomizedListView(); clv.onCreate(...); source: http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/ LazyAdapter.java import java.util.ArrayList; import java.util.HashMap; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; public class LazyAdapter extends BaseAdapter { private Activity activity; private ArrayList&lt;HashMap&lt;String, String&gt;&gt; data; private static LayoutInflater inflater=null; public ImageLoader imageLoader; public LazyAdapter(Activity a, ArrayList&lt;HashMap&lt;String, String&gt;&gt; d) { activity = a; data=d; inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); imageLoader=new ImageLoader(activity.getApplicationContext()); } public int getCount() { return data.size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { View vi=convertView; if(convertView==null) vi = inflater.inflate(R.layout.list_row, null); TextView title = (TextView)vi.findViewById(R.id.title); // title TextView artist = (TextView)vi.findViewById(R.id.artist); // artist name TextView duration = (TextView)vi.findViewById(R.id.duration); // duration ImageView thumb_image=(ImageView)vi.findViewById(R.id.list_image); // thumb image HashMap&lt;String, String&gt; song = new HashMap&lt;String, String&gt;(); song = data.get(position); // Setting all values in listview title.setText(song.get(CustomizedListView.KEY_TITLE)); artist.setText(song.get(CustomizedListView.KEY_ARTIST)); duration.setText(song.get(CustomizedListView.KEY_DURATION)); imageLoader.DisplayImage(song.get(CustomizedListView.KEY_THUMB_URL), thumb_image); return vi; } } CustomizedListView.java import java.util.ArrayList; import java.util.HashMap; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; public class CustomizedListView extends Activity { // All static variables static final String URL = "http://api.androidhive.info/music/music.xml"; // XML node keys static final String KEY_SONG = "song"; // parent node static final String KEY_ID = "id"; static final String KEY_TITLE = "title"; static final String KEY_ARTIST = "artist"; static final String KEY_DURATION = "duration"; static final String KEY_THUMB_URL = "thumb_url"; ListView list; LazyAdapter adapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;(); XMLParser parser = new XMLParser(); String xml = parser.getXmlFromUrl(URL); // getting XML from URL Document doc = parser.getDomElement(xml); // getting DOM element NodeList nl = doc.getElementsByTagName(KEY_SONG); // looping through all song nodes &lt;song&gt; for (int i = 0; i &lt; nl.getLength(); i++) { // creating new HashMap HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); Element e = (Element) nl.item(i); // adding each child node to HashMap key =&gt; value map.put(KEY_ID, parser.getValue(e, KEY_ID)); map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE)); map.put(KEY_ARTIST, parser.getValue(e, KEY_ARTIST)); map.put(KEY_DURATION, parser.getValue(e, KEY_DURATION)); map.put(KEY_THUMB_URL, parser.getValue(e, KEY_THUMB_URL)); // adding HashList to ArrayList songsList.add(map); } list=(ListView)findViewById(R.id.list); // Getting adapter by passing xml data ArrayList adapter=new LazyAdapter(this, songsList); list.setAdapter(adapter); // Click event for single list row list.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { } }); } }

    Read the article

  • How can I safely decide if a variable is a string of more than one characters?

    - by Alan
    I am using the following Javascript: if (typeof content !== 'undefined' && content.length > 0) { $state.transitionTo('admin.content', { content: content }) } I thought this was safe to use but it gives me an error saying: TypeError: Cannot read property 'length' of null I am using the following function to decide if something is a number: isNumber: function (num) { // Return false if num is null or an empty string if (num === null || (typeof num === "string" && num.length === 0)) { return false; } var rtn = !isNaN(num) return rtn; }, How can I write a similar function that would very safely determine if something is a string with a length of more than 0?

    Read the article

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