Search Results

Search found 33227 results on 1330 pages for 'open stackoverflow'.

Page 84/1330 | < Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >

  • Database Tutorial: The method open() is undefined for the type MainActivity.DBAdapter

    - by user2203633
    I am trying to do this database tutorial on SQLite Eclipse: https://www.youtube.com/watch?v=j-IV87qQ00M But I get a few errors at the end.. at db.ppen(); i get error: The method open() is undefined for the type MainActivity.DBAdapter and similar for insert record and close. MainActivity: package com.example.studentdatabase; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import android.app.Activity; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.Toast; public class MainActivity extends Activity { /** Called when the activity is first created. */ //DBAdapter db = new DBAdapter(this); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button addBtn = (Button)findViewById(R.id.add); addBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(MainActivity.this, addassignment.class); startActivity(i); } }); try { String destPath = "/data/data/" + getPackageName() + "/databases/AssignmentDB"; File f = new File(destPath); if (!f.exists()) { CopyDB( getBaseContext().getAssets().open("mydb"), new FileOutputStream(destPath)); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } DBAdapter db = new DBAdapter(); //---add an assignment--- db.open(); long id = db.insertRecord("Hello World", "2/18/2012", "DPR 224", "First Android Project"); id = db.insertRecord("Workbook Exercises", "3/1/2012", "MAT 100", "Do odd numbers"); db.close(); //---get all Records--- /* db.open(); Cursor c = db.getAllRecords(); if (c.moveToFirst()) { do { DisplayRecord(c); } while (c.moveToNext()); } db.close(); */ /* //---get a Record--- db.open(); Cursor c = db.getRecord(2); if (c.moveToFirst()) DisplayRecord(c); else Toast.makeText(this, "No Assignments found", Toast.LENGTH_LONG).show(); db.close(); */ //---update Record--- /* db.open(); if (db.updateRecord(1, "Hello Android", "2/19/2012", "DPR 224", "First Android Project")) Toast.makeText(this, "Update successful.", Toast.LENGTH_LONG).show(); else Toast.makeText(this, "Update failed.", Toast.LENGTH_LONG).show(); db.close(); */ /* //---delete a Record--- db.open(); if (db.deleteRecord(1)) Toast.makeText(this, "Delete successful.", Toast.LENGTH_LONG).show(); else Toast.makeText(this, "Delete failed.", Toast.LENGTH_LONG).show(); db.close(); */ } private class DBAdapter extends BaseAdapter { private LayoutInflater mInflater; //private ArrayList<> @Override public int getCount() { return 0; } @Override public Object getItem(int arg0) { return null; } @Override public long getItemId(int arg0) { return 0; } @Override public View getView(int arg0, View arg1, ViewGroup arg2) { return null; } } public void CopyDB(InputStream inputStream, OutputStream outputStream) throws IOException { //---copy 1K bytes at a time--- byte[] buffer = new byte[1024]; int length; while ((length = inputStream.read(buffer)) > 0) { outputStream.write(buffer, 0, length); } inputStream.close(); outputStream.close(); } public void DisplayRecord(Cursor c) { Toast.makeText(this, "id: " + c.getString(0) + "\n" + "Title: " + c.getString(1) + "\n" + "Due Date: " + c.getString(2), Toast.LENGTH_SHORT).show(); } public void addAssignment(View view) { Intent i = new Intent("com.pinchtapzoom.addassignment"); startActivity(i); Log.d("TAG", "Clicked"); } } DBAdapter code: package com.example.studentdatabase; public class DBAdapter { public static final String KEY_ROWID = "id"; public static final String KEY_TITLE = "title"; public static final String KEY_DUEDATE = "duedate"; public static final String KEY_COURSE = "course"; public static final String KEY_NOTES = "notes"; private static final String TAG = "DBAdapter"; private static final String DATABASE_NAME = "AssignmentsDB"; private static final String DATABASE_TABLE = "assignments"; private static final int DATABASE_VERSION = 2; private static final String DATABASE_CREATE = "create table if not exists assignments (id integer primary key autoincrement, " + "title VARCHAR not null, duedate date, course VARCHAR, notes VARCHAR );"; private final Context context; private DatabaseHelper DBHelper; private SQLiteDatabase db; public DBAdapter(Context ctx) { this.context = ctx; DBHelper = new DatabaseHelper(context); } private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { try { db.execSQL(DATABASE_CREATE); } catch (SQLException e) { e.printStackTrace(); } } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(TAG, "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS contacts"); onCreate(db); } } //---opens the database--- public DBAdapter open() throws SQLException { db = DBHelper.getWritableDatabase(); return this; } //---closes the database--- public void close() { DBHelper.close(); } //---insert a record into the database--- public long insertRecord(String title, String duedate, String course, String notes) { ContentValues initialValues = new ContentValues(); initialValues.put(KEY_TITLE, title); initialValues.put(KEY_DUEDATE, duedate); initialValues.put(KEY_COURSE, course); initialValues.put(KEY_NOTES, notes); return db.insert(DATABASE_TABLE, null, initialValues); } //---deletes a particular record--- public boolean deleteContact(long rowId) { return db.delete(DATABASE_TABLE, KEY_ROWID + "=" + rowId, null) > 0; } //---retrieves all the records--- public Cursor getAllRecords() { return db.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE, KEY_DUEDATE, KEY_COURSE, KEY_NOTES}, null, null, null, null, null); } //---retrieves a particular record--- public Cursor getRecord(long rowId) throws SQLException { Cursor mCursor = db.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE, KEY_DUEDATE, KEY_COURSE, KEY_NOTES}, KEY_ROWID + "=" + rowId, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } return mCursor; } //---updates a record--- public boolean updateRecord(long rowId, String title, String duedate, String course, String notes) { ContentValues args = new ContentValues(); args.put(KEY_TITLE, title); args.put(KEY_DUEDATE, duedate); args.put(KEY_COURSE, course); args.put(KEY_NOTES, notes); return db.update(DATABASE_TABLE, args, KEY_ROWID + "=" + rowId, null) > 0; } } addassignment code: package com.example.studentdatabase; public class addassignment extends Activity { DBAdapter db = new DBAdapter(this); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.add); } public void addAssignment(View v) { Log.d("test", "adding"); //get data from form EditText nameTxt = (EditText)findViewById(R.id.editTitle); EditText dateTxt = (EditText)findViewById(R.id.editDuedate); EditText courseTxt = (EditText)findViewById(R.id.editCourse); EditText notesTxt = (EditText)findViewById(R.id.editNotes); db.open(); long id = db.insertRecord(nameTxt.getText().toString(), dateTxt.getText().toString(), courseTxt.getText().toString(), notesTxt.getText().toString()); db.close(); nameTxt.setText(""); dateTxt.setText(""); courseTxt.setText(""); notesTxt.setText(""); Toast.makeText(addassignment.this,"Assignment Added", Toast.LENGTH_LONG).show(); } public void viewAssignments(View v) { Intent i = new Intent(this, MainActivity.class); startActivity(i); } } What is wrong here? Thanks in advance.

    Read the article

  • SCOM 2007 versus Zenoss (or other open source)

    - by TheCleaner
    I've taken the liberty to test both SCOM 2007 and Zenoss and found the following: SCOM 2007 Pros: Great MS Windows server monitoring and reporting In-depth configuration and easily integrates into a "MS datacenter" Cons: limited network device monitoring support (without 3rd party plugins) expensive difficult learning curve Zenoss Pros: Open Source (free) decent server monitoring for Windows, great monitoring for Linux decent network device monitoring Cons: not as in-depth as SCOM (for Windows at least) So my question to you folks is this: Given the above, and given that I'm trying to monitor 55 Windows servers, 1 Linux server, 2 ESX servers, and Juniper equipment...which would you recommend?

    Read the article

  • Open Elevated "Administrator:" cmd prompt instead of "cmd prompt (Running as Administrator)"

    - by naspinski
    If you open a command prompt with a runas command, you will see a window that shows (Running as some_user) In the title bar, but if you right click on cmd.exe and choose Run as Administrator you will get a window that has: Administrator cmd.exe In the title bar. Oddly enough, these windows exhibit different behavior. My question is how can I get the Administrator cmd.exe command prompt via command line? Or if it is even possible?

    Read the article

  • Open file - Security warning

    - by joker
    Does anyone know how to disable the unknown publisher security warning when running an application in Windows Xp Home? It's pretty annoying to have to click run everytime... I have tried: Run gpedit.msc, and go to Local Computer Policy-User Configuration-Administrative Templates-Windows Components-Attachment Manager and enable "Default risk level for file attachments", and then enable "Inclusion list for low risk file types" and add to this list the file extensions that you want to open without triggering this crap. But this file 'gpedit.msc' doest not exist on my computer, i checked system32 folder also =/ maybe its for xp pro

    Read the article

  • X11 from ssh on Mac OSX to Linux server doesn't work --- Gtk-WARNING **: cannot open display

    - by Cal
    Hello, I installed a program wireshark on my remote linux box and I'm trying to run it with X11 from my mac computer using SSH. Here's my terminal... macosx$ echo $DISPLAY /tmp/launch-f4w6k6/:0 macosx$ ssh -X [email protected] [email protected]'s password: remoteubuntu:~# echo $DISPLAY remoteubuntu:~# wireshark (wireshark:18927): Gtk-WARNING **: cannot open display: Here's a few lines from /etc/ssh/sshd_config X11Forwarding yes X11DisplayOffset 10 PrintMotd no PrintLastLog yes TCPKeepAlive yes #UseLogin no Thanks for the help!

    Read the article

  • why lynx browser sometimes can open a page that normal browser can not

    - by Salvador Dali
    I found a really interesting peculiarity of Lynx while trying to write an application using bitcoin. The problem is that although the bitcoin site does not always open with modern browsers like Google Chrome or Firefox, it always opens using the Lynx browser. The same peculiarity appears with some other web-sites. I was wondering what the reason could be for this but was not able to come up with any. Any ideas, or this is just coincidence?

    Read the article

  • Office 2010 can't open folder at my Skydrive

    - by mrbill.mp
    I followed the steps to upload documents to a folder at Microsofts Skydrive. Backstage,Share,Save to skydrive,(at this point it always shows Sorry, we are unable to connect to Skydrive.) Than I click the Try Again button and It connects. Then I click the folder I wish to put the document into. And click Save As. And I get (Could not open http://etc..........). Why?

    Read the article

  • Create tunnel through an open SSH connection?

    - by criptych
    I have a remote PC (behind NAT and firewall) set up to create a reverse SSH tunnel to my home PC/server (DMZed). Unfortunately, the tunnel hasn't been working lately. Fortunately -- I think -- the remote PC currently has an SFTP session open to the local one. My question is, can I create a tunnel back to the remote PC through that session? Or am I SOL until I can physically get in to restore the reverse tunnel on the remote PC?

    Read the article

  • Quicksilver doesn't open PDF's like it used to

    - by Niels Bom
    I've been using Quicksilver for a while now but lately I've been getting this problem that QS doesn't show the Acrobat Reader icon when a PDF is selected, but goes to the "Open With" tab. See the screenshot here: http://skitch.com/niels.bom/n8nw5/google-reader-1000 Is this a bug? Or did I somehow bork a preference setting? I'm using QS B54, 3815, which is the latest AFAIK and Mac OS X 10.5.8. Thanks!

    Read the article

  • IIS login Problem to open localhost

    - by Shahid Mahmood Adil
    i have winXp sp2 on my machine. i have installed IIS. when i am trying to open my localhost as http://localhost/ it asks for login and password. when i am using my windows authentication to login creates an error message http 500 internal server error and error detail is error '8002801c' Error accessing the OLE registry. /iisHelp/common/500-100.asp, line 17 how can i resolve this problem?

    Read the article

  • open source VDI solution [closed]

    - by sysconfig
    looking to build a 10 node to eventually 50 node VDI solution. the only OS on the desktop will be ubuntu ( or some other linux ) looking for easy setup administration, and remote administration etc. will probably just use diskless PC as clients for now, but would want a solution that can accommodate thin-clients as well, and maybe there its just XDMCP from the server. must be completely open source ( no VMware ) thoughts ?

    Read the article

  • Glassfish installation error: cannot open display

    - by Mannaz
    When trying to extract the Glassfish jar file with java -Xmx256m -jar glassfish-installer-v2.1-b60e-linux.jar i get following error: (.:31766): Gtk-WARNING **: cannot open display: and extraction doesn't happen. It somehow assumes i'm on an real machine rather on a SSH shell. How can i solve this?

    Read the article

  • Typing filename in standard open file dialog (Windows 7) - file name suggestion

    - by bybor
    When you use standard windows open file dialog and start typing it puts files whose name starts with what you type to drop down list. But on another pc with same Windows 7 it also puts first of them into input box in which you type - like FF does with URLS, allowing you to immediately press Enter (without pressing 'Down' to select file). I don't know why this behavior is different, but I want suggested file name shown in input box. How could it be achieved? Thanks.

    Read the article

  • postfix error: open database /var/lib/mailman/data/aliases.db: No such file

    - by Thufir
    In trying to follow the Ubuntu guide for postfix and mailman, I do not understand these directions: This build of mailman runs as list. It must have permission to read /etc/aliases and read and write /var/lib/mailman/data/aliases. Do this with these commands: sudo chown root:list /var/lib/mailman/data/aliases sudo chown root:list /etc/aliases Save and run: sudo newaliases I'm getting this kind of error: root@dur:~# root@dur:~# root@dur:~# telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 dur.bounceme.net ESMTP Postfix (Ubuntu) ehlo dur 250-dur.bounceme.net 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN quit 221 2.0.0 Bye Connection closed by foreign host. root@dur:~# root@dur:~# tail /var/log/mail.log Aug 28 01:16:43 dur postfix/master[19444]: terminating on signal 15 Aug 28 01:16:43 dur postfix/postfix-script[19558]: starting the Postfix mail system Aug 28 01:16:43 dur postfix/master[19559]: daemon started -- version 2.9.1, configuration /etc/postfix Aug 28 01:16:45 dur postfix/postfix-script[19568]: stopping the Postfix mail system Aug 28 01:16:45 dur postfix/master[19559]: terminating on signal 15 Aug 28 01:16:45 dur postfix/postfix-script[19673]: starting the Postfix mail system Aug 28 01:16:45 dur postfix/master[19674]: daemon started -- version 2.9.1, configuration /etc/postfix Aug 28 01:17:22 dur postfix/smtpd[19709]: error: open database /var/lib/mailman/data/aliases.db: No such file or directory Aug 28 01:17:22 dur postfix/smtpd[19709]: connect from localhost[127.0.0.1] Aug 28 01:18:37 dur postfix/smtpd[19709]: disconnect from localhost[127.0.0.1] root@dur:~# root@dur:~# postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix default_transport = smtp home_mailbox = Maildir/ inet_interfaces = loopback-only mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -m "${EXTENSION}" mailbox_size_limit = 0 mailman_destination_recipient_limit = 1 mydestination = dur, dur.bounceme.net, localhost.bounceme.net, localhost myhostname = dur.bounceme.net mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 readme_directory = no recipient_delimiter = + relay_domains = lists.dur.bounceme.net relay_transport = relay relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtp_use_tls = yes smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/dovecot-auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key smtpd_tls_mandatory_ciphers = medium smtpd_tls_mandatory_protocols = SSLv3, TLSv1 smtpd_tls_received_header = yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes tls_random_source = dev:/dev/urandom transport_maps = hash:/etc/postfix/transport root@dur:~# root@dur:~# And am wondering what connection might be. I do see that I don't have the requisite files: root@dur:~# root@dur:~# ll /var/lib/mailman/data/aliases ls: cannot access /var/lib/mailman/data/aliases: No such file or directory root@dur:~# At what stage were those aliases created? How can I create them? Is that what's causing the error error: open database /var/lib/mailman/data/aliases.db: No such file or directory Aug 28 01:17:22 dur postfix/smtpd[19709]: connect from localhost[127.0.0.1]?

    Read the article

  • Remove "Open with GIMP" from context menu?

    - by Ben
    I recently uninstalled GIMP on my Vista laptop, but there is still an Open with GIMP option on the context menu for most image file types, like JPEG and PNG. Clicking this option results in an error dialog. Is there any way to remove it?

    Read the article

  • Lotus Notes doesn't open from Dock

    - by Toby
    Ever since installing Lotus Notes on my mac I haven't been able to properly access it from the dock. If the program is off then it will open up fine the first time but then clicking on the icon will not make Notes jump to the front of the screen. It is only a minor thing but as it is the only program on my dock that I need to CMD-Tab to access it gets pretty annoying! Any help would be greatly appreciated. Notes version - 8.5.1 Mac OS X version - 10.6.2

    Read the article

  • Xubuntu 9.10 LiveCD on USB fails with error can't open /dev/sr0: no medium found

    - by EricJLN
    Using Ubuntu's USB Startup Disk Creator (usb-creator-gtk), I created a LiveUSB from the Xubuntu 9.10 LiveCD. When booting, it stalls up with the Xubuntu mouse splash screen displayed. In attempting to troubleshoot, I used Ctrl-Alt-F1 to check out the first virtual terminal. On that screen, I see over and over again the lines: stdin: I/O error stdin: error 0 /init: line 1: can't open /dev/sr0: No medium found

    Read the article

  • E-Mail wont open from windows 7 search

    - by uwe
    sometimes an element wont open, of I click on it in the start menu in the search results. This occurs most when searching for emails. I use outlook 2007 on windows 7 x64. If I search in outlook for that mail I can simply double-click it an it opens.

    Read the article

  • Open source chat protocol that handles voice & video?

    - by marcusw
    I'm looking for a chat protocol which: Has easy to use clients which will run on both Windows and Linux. Has a server which I can run myself on Linux (preferably easy to set up). Supports duplexed voice and video with minimal hassle (optional). Is open source/free software. Is there a protocol that fulfils these requirements?

    Read the article

  • Can't open Windows firewall?

    - by Mr. Noob.
    I accidentally opened a virus on my windows XP, now i can't open the Windows firewall. Control Panel Click on Windows firewall Gives me this error - "Unable to display Windows Firewall settings due to an unidentified problem" What shall i do? (Sorry for my poor english)

    Read the article

< Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >