Daily Archives

Articles indexed Saturday December 25 2010

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

  • SQLiteOpenHelper problem

    - by Harsha M V
    I have created SQLiteOpenHelper class to help me open write the database. but i am not able to invoke it from the main.java activity I have created an Class which extends the Database Helper which is stored at /Messaging/src/com/v3/messaging/DatabaseHelper.java Code: http://pastebin.com/Z5qp32xu now i have this class called Main.java which will be the first activity on the launch of the application. But how can i make the DatabaseHelper.java run just to create the database but still be at the Main.java file. The database should be created with the tables only when the db or the tables dont exist. Main.java code: http://pastebin.com/LVFVuhA0 Now when i run the program. the database is not being created :( I am trying to learn Android. So please excuse me if i forgot to tell something.

    Read the article

  • New apache on mac

    - by Keith
    I have installed php5 apache2 mysql5 and postgresql84 using MacPorts. I realize my mac already has apache but it didn't have apache2 nor postgesql hooked up to use with php. I want to not use the default apple apache and use the new macports install. How do I tell my computer to stop looking at the old apache? When I do apachectl in the terminal I believe it is using the old apache. I would like to hook it up to use the new one. How would I do that? The new stuff is installed at /opt/local/apache2 and the old stuff is installed at /private/etc/apache2 I went to system preferences...Sharing...and shut off Web Sharing but when I do apachectl's that turns it on and off in the preferences. I'm running in Snow Leopard.

    Read the article

  • HVM virtualization with PV drivers on XenServer

    - by Nathan
    Is it possible to create an HVM guest in XenServer 5.5 that uses PV drivers for disk and network without being fully paravirutalized? This should give me decent performance from the VM without having to jump through hoops to create a PV guest when a pre-built template doesn't exist. Since PV drivers exist for Windows, and XenServer provides templates for windows that use HVM virtualization this must be possible, I just don't see how to configure this myself.

    Read the article

  • Using sed to convert hex characters in postgresql dump file

    - by Bernt
    I am working on moving several databases from a Postgresql 8.3 server to a Postgresql 8.4 server. It has worked fine so far, but one base has given me some trouble. The database is listed as unicode-encoded in the 8.3-server, but somehow a client program has managed to inject some invalid unicode data into it. When I do a normal dump and restore using postgres' custom format, the new server won't accept it, complaining about unicode errors. My plan is to do a plain text dump of the database, then use sed to replace the invalid characters with nothing (they are not needed). But how do you make sed work on hex/binary values in a file?

    Read the article

  • Postgres pgpass windows - not working

    - by Scott
    DB: Postgres 9.0 Client: Windows 7 Server Windows 2008, 64bit I'm trying to connect remotely to a postgres instance for purposes of performing a pg_dump to my local machine. Everything works from my client machine, except that I need to provide a password at the password prompt, and I'd ultimately like to batch this with a script. I've followed the instructions here: http://www.postgresql.org/docs/current/static/libpq-pgpass.html but it's not working. To recap, I've created a file on the client (and tried the server as well): C:/Users/postgres/AppData/postgresql/pgpass.conf, where postgresql is the db user. The file has one line with the following data: *:5432:*postgres:[mypassword] (also tried explicit ip/dbname values, all asterisks, and every combination in between. (I've also tried replacing each '*' with [localhost|myip] and [mydatabasename] respectively. From my client machine, I connect using: pg_dump -h [myip] -U postgres -w [mydbname] [mylocaldumpfile] I'm presuming that I need to provide the '-w' switch in order to ignore password prompt, at which point it should look in the AppData directory on the server. It just comes back with "connection to database failed: fe_sendauth: no password supplied. Any insights are appreciated. As a hack workaround, if there was a way I could tell the windows batch file on my client machine to inject the password at the postgres prompt, that would work as well. Thanks.

    Read the article

  • How to increase the disk cache of Windows 7

    - by Mark Christiaens
    Under Windows 7 (64 bit), I'm reading through 9000 moderately sized files. In total, there is more than 200 MB of data. Using Java (JDK 1.6.21) I'm iterating over the files. The first 1400 or so go at full speed but then speed drops off to 4ms per file. It turns out that the main cost is incurred simply by opening the files. I'm opening the files using new FileInputStream (and of course closing them in time to avoid file leaks). After some investigating, I see that Windows' disk cache is using only 100 MB or so of RAM although I have 8 GiB available. I've tried increasing the cache size using the CacheSet tool but any values I provide are considered out of range. I've also tried enabling the LargeSystemCache registry key but (after rebooting) the CacheSet tool still indicates I'm using 100 MB of cache (and doesn't increase during the test run). Does anybody have any suggestions to "encourage" Windows 7 to cache my 9000 files?

    Read the article

  • Handling Configuration Changes in Windows Azure Applications

    - by Your DisplayName here!
    While finalizing StarterSTS 1.5, I had a closer look at lifetime and configuration management in Windows Azure. (this is no new information – just some bits and pieces compiled at one single place – plus a bit of reality check) When dealing with lifetime management (and especially configuration changes), there are two mechanisms in Windows Azure – a RoleEntryPoint derived class and a couple of events on the RoleEnvironment class. You can find good documentation about RoleEntryPoint here. The RoleEnvironment class features two events that deal with configuration changes – Changing and Changed. Whenever a configuration change gets pushed out by the fabric controller (either changes in the settings section or the instance count of a role) the Changing event gets fired. The event handler receives an instance of the RoleEnvironmentChangingEventArgs type. This contains a collection of type RoleEnvironmentChange. This in turn is a base class for two other classes that detail the two types of possible configuration changes I mentioned above: RoleEnvironmentConfigurationSettingsChange (configuration settings) and RoleEnvironmentTopologyChange (instance count). The two respective classes contain information about which configuration setting and which role has been changed. Furthermore the Changing event can trigger a role recycle (aka reboot) by setting EventArgs.Cancel to true. So your typical job in the Changing event handler is to figure if your application can handle these configuration changes at runtime, or if you rather want a clean restart. Prior to the SDK 1.3 VS Templates – the following code was generated to reboot if any configuration settings have changed: private void RoleEnvironmentChanging(object sender, RoleEnvironmentChangingEventArgs e) {     // If a configuration setting is changing     if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange))     {         // Set e.Cancel to true to restart this role instance         e.Cancel = true;     } } This is a little drastic as a default since most applications will work just fine with changed configuration – maybe that’s the reason this code has gone away in the 1.3 SDK templates (more). The Changed event gets fired after the configuration changes have been applied. Again the changes will get passed in just like in the Changing event. But from this point on RoleEnvironment.GetConfigurationSettingValue() will return the new values. You can still decide to recycle if some change was so drastic that you need a restart. You can use RoleEnvironment.RequestRecycle() for that (more). As a rule of thumb: When you always use GetConfigurationSettingValue to read from configuration (and there is no bigger state involved) – you typically don’t need to recycle. In the case of StarterSTS, I had to abstract away the physical configuration system and read the actual configuration (either from web.config or the Azure service configuration) at startup. I then cache the configuration settings in memory. This means I indeed need to take action when configuration changes – so in my case I simply clear the cache, and the new config values get read on the next access to my internal configuration object. No downtime – nice! Gotcha A very natural place to hook up the RoleEnvironment lifetime events is the RoleEntryPoint derived class. But with the move to the full IIS model in 1.3 – the RoleEntryPoint methods get executed in a different AppDomain (even in a different process) – see here.. You might no be able to call into your application code to e.g. clear a cache. Keep that in mind! In this case you need to handle these events from e.g. global.asax.

    Read the article

  • Android App: Proximity

    - by Eclipser
    Is there an API for Android that will find other people nearby running the same app? For instance, if you were to perform a "scan" it tries to find other people running the same app nearby. Would it be possible to perform the same task across multiple OS (Android, iPhone, Windows, etc.)? Or would the best way be to just have the app communicate to a server your location and have a server-side app that pushes a list of others nearby??? My goal is to find an easy way to eventually transmit data between two devices contigent on those that are nearby.

    Read the article

  • Django json serialization problem

    - by codingJoe
    I am having difficulty serializing a django object. The problem is that there are foreign keys. I want the serialization to have data from the referenced object, not just the index. For example, I would like the sponsor data field to say "sponsor.last_name, sponsor.first_name" rather than "13". How can I fix my serialization? json data: {"totalCount":"2","activities":[{"pk": 1, "model": "app.activity", "fields": {"activity_date": "2010-12-20", "description": "my activity", "sponsor": 13, "location": 1, .... model code: class Activity(models.Model): activity_date = models.DateField() description = models.CharField(max_length=200) sponsor = models.ForeignKey(Sponsor) location = models.ForeignKey(Location) class Sponsor(models.Model): last_name = models.CharField(max_length=20) first_name= models.CharField(max_length=20) specialty = models.CharField(max_length=100) class Location(models.Model): location_num = models.IntegerField(primary_key=True) location_name = models.CharField(max_length=100) def activityJSON(request): activities = Activity.objects.all() total = activities.count() activities_json = serializers.serialize("json", activities) data = "{\"totalCount\":\"%s\",\"activities\":%s}" % (total, activities_json) return HttpResponse(data, mimetype="application/json")

    Read the article

  • recommend a server side technology for gwt (beginner)

    - by user486503
    hi all ! I am developing a gwt project and am looking for an appropriate server side technology. it should support be open source and support user login (and not using openID...) with password recovery etc it seems that the de-facto standard would be spring + hibernate. however, I am unfamiliar with neither of them and understand that the learning curve (especially for spring) is very high. gwt was quite easy to learn using GOOG's excellent online tutorials but the spring equivalent seem to impose lots of configuration files and deeper understanding of its internals. so I am looking for a simpler server side technology to deploy my gwt app. I am definitely prepared to learn a new framework if necessary but not something that would take me 2 months just to understand the fundamentals... any ideas...?

    Read the article

  • How do tools like Hiphop for PHP deal with heterogenous arrays?

    - by Derek Thurn
    I think HipHop for PHP is an interesting tool. It essentially converts PHP code into C++ code. Cross compiling in this manner seems like a great idea, but I have to wonder, how do they overcome the fundamental differences between the two type systems? One specific example of my general question is heterogeneous data structures. Statically typed languages don't tend to let you put arbitrary types into an array or other container because they need to be able to figure out the types on the other end. If I have a PHP array like this: $mixedBag = array("cat", 42, 8.5, false); How can this be represented in C++ code? One option would be to use void pointers (or the superior version, boost::any), but then you need to cast when you take stuff back out of the array... and I'm not at all convinced that the type inferencer can always figure out what to cast to at the other end. A better option, perhaps, would be something more like a union (or boost::variant), but then you need to enumerate all possible types at compile time... maybe possible, but certainly messy since arrays can contain arbitrarily complex entities. Does anyone know how HipHop and similar tools which go from a dynamic typing discipline to a static discipline handle these types of problems?

    Read the article

  • Google Chrome Application Mode: Possible to isolate multiple instances?

    - by Jonathan Eunice
    I want to run multiple Google Chrome application windows logged into the same web site (Twitter.com, say), each with different credentials. Is this possible? If so, how? My initial testing shows that multiple Chrome app windows are not sufficiently isolated to do this. Logging into the second account logs me into the second account in both windows, suggesting that they are sharing information just as two Chrome tabs might.

    Read the article

  • What is the complexity of this c function

    - by Bunny Rabbit
    what is the complexity of the following c Function ? double foo (int n) { int i; double sum; if (n==0) return 1.0; else { sum = 0.0; for (i =0; i<n; i++) sum +=foo(i); return sum; } } Please don't just post the complexity can you help me in understanding how to go about it . EDIT: It was an objective question asked in an exam and the Options provided were 1.O(1) 2.O(n) 3.O(n!) 4.O(n^n)

    Read the article

  • SQL join produces one result only

    - by Rami
    Can anyone please tell me why this result is generation only one results? taking in mind that everything is set right and the three tables are populated correctly, i took out the group_concat and it worked but of course with a php undefined index error! SELECT `songs`.`song_name`, `songs`.`add_date`, `songs`.`song_id`, `songs`.`song_picture`, group_concat(DISTINCT artists.artist_name) as artist_name FROM (`songs`) JOIN `mtm_songs_artists` ON `songs`.`song_id` = `mtm_songs_artists`.`song_id` JOIN `artists` ON `artists`.`artist_id` = `mtm_songs_artists`.`artist_id` ORDER BY `songs`.`song_id` DESC LIMIT 10 so i'm guessing it's something related to group_concat. best regards, Rami

    Read the article

  • How can I make the WebBrowser control navigate to a specific webpage?

    - by tee
    How can I make the code when run the code it go to samsung.com private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) { webBrowser1.Navigate("www.samsung.com"); } Please correct it when run program it go to samsung.com using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using mshtml; namespace webhiglight { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) { webBrowser1.Navigate("www.samsung.com"); } private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if (webBrowser1.Document != null) { IHTMLDocument2 document = webBrowser1.Document.DomDocument as IHTMLDocument2; if (document != null) { IHTMLSelectionObject currentSelection = document.selection; IHTMLTxtRange range = currentSelection.createRange() as IHTMLTxtRange; if (range != null) { const String search = "ant"; if (range.findText(search, search.Length, 2)) { range.select(); } } } } } } }

    Read the article

  • remove xml declaration from the generated xml document using java

    - by flash
    String root = "RdbTunnels"; DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.newDocument(); Element rootElement = document.createElement(root); document.appendChild(rootElement); OutputFormat format = new OutputFormat(document); format.setIndenting(true); XMLSerializer serializer = new XMLSerializer(System.out, format); serializer.serialize(document); gives the result as following <?xml version="1.0" encoding="UTF-8"?> <RdbTunnels/> but I need to remove the xml declaration from the output how can I do that

    Read the article

  • How to implement automatic reflection of direct SQL Updates of the underlying database, in an ActiveRecord in Ruby on Rails ?

    - by Vadim Eisenberg
    Hello ! I am new to Ruby on Rails and I have a (maybe naive) question: I want to implement reflection of direct SQL Updates of the underlying database in an ActiveRecord (and finally in the generated html). By "direct updates" I mean updating the database bypassing the ActiveRecord methods, for example by MySQL console. I guess here MySQL triggers could be used that would call some stored procedure that would cause the appropriate ActiveRecord to be reloaded. Is there some automatic handling of this scenario in ActiveRecord/Ruby on Rails ? Did somebody implement this scenario ? Can somebody recommend using other MVC frameworks to reflect direct changes in mapped databases ?

    Read the article

  • can't able to integrate base64decode in my class

    - by MaheshBabu
    Hi folks, i am getting the image that is in base64 encoded format. I need to decode it. i am writing the code for decoding is + (NSData *) base64DataFromString: (NSString *)string { unsigned long ixtext, lentext; unsigned char ch, input[4], output[3]; short i, ixinput; Boolean flignore, flendtext = false; const char *temporary; NSMutableData *result; if (!string) return [NSData data]; ixtext = 0; temporary = [string UTF8String]; lentext = [string length]; result = [NSMutableData dataWithCapacity: lentext]; ixinput = 0; while (true) { if (ixtext >= lentext) break; ch = temporary[ixtext++]; flignore = false; if ((ch >= 'A') && (ch <= 'Z')) ch = ch - 'A'; else if ((ch >= 'a') && (ch <= 'z')) ch = ch - 'a' + 26; else if ((ch >= '0') && (ch <= '9')) ch = ch - '0' + 52; else if (ch == '+') ch = 62; else if (ch == '=') flendtext = true; else if (ch == '/') ch = 63; else flignore = true; if (!flignore) { short ctcharsinput = 3; Boolean flbreak = false; if (flendtext) { if (ixinput == 0) break; if ((ixinput == 1) || (ixinput == 2)) { ctcharsinput = 1; else ctcharsinput = 2; ixinput = 3; flbreak = true; } input[ixinput++] = ch; if (ixinput == 4) ixinput = 0; output[0] = (input[0] << 2) | ((input[1] & 0x30) >> 4); output[1] = ((input[1] & 0x0F) << 4) | ((input[2] & 0x3C) >> 2); output[2] = ((input[2] & 0x03) << 6) | (input[3] & 0x3F); for (i = 0; i < ctcharsinput; i++) [result appendBytes: &output[i] length: 1]; } if (flbreak) break; } return result; } i am calling this in my method like this NSData *data = [base64DataFromString:theXML]; theXML is encoded data. but it shows error decodeBase64 undeclared. How can i use this method. can any one pls help me. Thank u in advance.

    Read the article

  • returning opengl display callback in D

    - by Max
    I've written a simple hello world opengl program in D, using the converted gl headers here. My code so far: import std.string; import c.gl.glut; Display_callback display() { return Display_callback // line 7 { return; // just display a blank window }; } // line 10 void main(string[] args) { glutInit(args.length, args); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutInitWindowSize(800,600); glutCreateWindow("Hello World"); glutDisplayFunc(display); glutMainLoop(); } My problem is with the display() function. glutDisplayFunc() expects a function that returns a Display_callback, which is typedef'd as typedef GLvoid function() Display_callback;. When I try to compile, dmd says line 7: found '{' when expecting ';' following return statement line 10: unrecognized declaration How do I properly return the Display_callback here? Also, how do I change D strings and string literals into char*? My calls to glutInit and glutCreateWindow don't like the D strings they're getting. Thanks for your help.

    Read the article

  • Is it good practise to use meta refresh tags for redirects instead of header() function in php?

    - by Kent
    I have to use redirects a lot in my scripts, for example after a user logs in I need to redirect them to the admin area, etc. But I find it inconvenient to always have to have the header function at the very top. So if I use the meta refresh tags for my redirects, is that something that would be frowned upon according to best practices or is it acceptable? function redirect($location) { echo "<meta http-equiv='refresh' content='0; url=$location' />"; }

    Read the article

  • Connecting to a Ghost User in Flex RTMFP

    - by Dan
    I have a simple Flex RTMFP P2P video app in the same mold as the Adobe Cirrus VideoPhone Sample application. A problem I've been encountering in developing this app (the same problem occurs in the sample) is when you try to connect to a ghost Stratus instance i.e you try to call someone whose Stratus id is in the database but who is no longer on the page. So here's an example of what I mean: Let's say you go to the Adobe Stratus sample and connect as Dan. Then open up a new tab, go to the sample again and connect as Fred. If from this point, you (as Fred) call Dan everything will work fine. But, if you close the tab in which you connected as Dan, and then from the Fred tab try to connect to Dan the program will just hang. I would have thought there would be a NetStream event that would be triggered if you tried to connect to a Stratus instance that is not longer online but I can't seem to find anything besides NetStream.Connect.Rejected which doesn't seem to be called. Any help is much appreciated!

    Read the article

  • james - mail server DNS configuration

    - by Chaitanya
    hi, I am setting up james mail server. I installed James and added in the config.xml added the servername as mydomain.com. In the DNS for mydomain.com, I have created a A-record, say mx.mydomain.com, which corresponds to the ipaddress of the above mail server machine. Then added mx.mydomain.com as MX record for mydomain.com. In James, I have created a new user test. From the user I have sent a mail to my gmail account. I see that the mail is accepted and the mail is in outgoing folder of James. But it's not relay to the gmail server. In the config.xml of James, I have added 8.8.8.8 and 8.8.4.4 as the dns server addresses, which are public DNS servers hosted by Google. IPTables on the machine is stopped. Thanks for your help!

    Read the article

  • ASUS EeePC 1001PX, hard disk clicking in Ubuntu Maverick

    - by MeanEYE
    I just received my new Asus EeePC 1001px netbook. After installing Ubuntu 10.10 on it, I've noticed that my hard drive is making a clicking noise. Now this is not a loud clicking noise nor it's constant (only sounds occasionally and when hard disk is not writing or reading anything). Another strange thing is, this only happens when netbook is using battery power, the moment I plug in AC power clicking stops. Additionally I noticed that when I go into BIOS I can hear the click only once, same thing happens if I boot Ubuntu from USB. That led me to believe the problem is within operating system. I did all the surface scans and SMART tests and everything seems to be fine. Now noise sounds like heads are trying to "park" themselves so I tried disabling "spin down" option in Power Management but it didn't help. Any idea?

    Read the article

  • how to restore windows 7 to a know working state every time it boots

    - by Artanis
    A couple of days ago my mother asked me to set up a computer at his house, she wants to use it to basic web browsing, video chat and nothing more. The problem is, neither my mother nor my sister know anything about using or maintaining a computer. What I want is to have a working base install of windows 7 and just discard everything installed, downloaded, ... when it reboots. That way I can set up a partition just for saving files and whatever they do the computer will always return to a working state at start up. can that be done? PS: Sadly linux is not an option since my sister wants to be able to play some games with my steam account and not all of them run with wine.

    Read the article

  • How to set my Bamboo Fun to work only on ONE of my dual screens?

    - by Przemyslaw Piekarski
    I need dual screen for my web developer job but when I do illustrations I prefer to work on a single screen to avoid the stretching of the workspace which affects tablet's precision. Is there a way to make my tablet work only on my primary screen and, at the same time, use mouse for both screens? I've looked into my tablet's preferences and haven't found it. I use Windows XP, Bamboo Fun A5, ATI Radeon X 1050. Thanks in advance.

    Read the article

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