Search Results

Search found 8247 results on 330 pages for 'smart phone'.

Page 162/330 | < Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >

  • Django unit testing: South-migrated DB works in MySQL, throws duplicate PK error in PostGreSQL. Am I

    - by unclaimedbaggage
    Hi folks, (Worth starting off with a disclaimer: I'm very new to PostGreSQL) I have a django site which involves a standard app/tests.py testing file. If I migrate the DB to MySQL (through South),, the tests all pass. However in PostGresQL, I'm getting the following error: IntegrityError: duplicate key value violates unique constraint "business_contact_pkey" Note this happens while unit testing only - the actual page runs fine in both MySQL & PostGresql. Really having a heckuva time figuring this one out. Anyone have ideas? Below are the Postgresql "\d business_contact" & offending tests.py method if they help. No changes made to either DB except the (same) South migrations Thanks first_name | character varying(200) | not null mobile_phone | character varying(100) | surname | character varying(200) | not null business_id | integer | not null created | timestamp with time zone | not null deleted | boolean | not null default false updated | timestamp with time zone | not null slug | character varying(150) | not null phone | character varying(100) | email | character varying(75) | id | integer | not null default nextval('business_contact_id_seq'::regclass) Indexes: "business_contact_pkey" PRIMARY KEY, btree (id) "business_contact_slug_key" UNIQUE, btree (slug) "business_contact_business_id" btree (business_id) Foreign-key constraints: "business_id_refs_id_772cc1b7b40f4b36" FOREIGN KEY (business_id) REFERENCES business(id) DEFERRABLE INITIALLY DEFERRED Referenced by: TABLE "business" CONSTRAINT "primary_contact_id_refs_id_dfaf59c4041c850" FOREIGN KEY (primary_contact_id) REFERENCES business_contact(id) DEFERRABLE INITIALLY DEFERRED TEST DEF: def test_add_business_contact(self): """ Add a business contact """ contact_slug = 'test-new-contact-added-new-adf' business_id = 1 business = Business.objects.get(id=business_id) postdata = { 'first_name': 'Test', 'surname': 'User', 'business': '1', 'slug': contact_slug, 'email': '[email protected]', 'phone': '12345678', 'mobile_phone': '9823452', 'business': 1, 'business_id': 1, } #Test to ensure contacts that should not exist are not returned contact_not_exists = Contact.objects.filter(slug=contact_slug) self.assertFalse(contact_not_exists) #Add the contact and ensure it is present in the DB afterwards """ contact_add_url = '%s%s/contact/add/' % (settings.BUSINESS_URL, business.slug) self.client.post(contact_add_url, postdata) added_contact = Contact.objects.filter(slug=contact_slug) print added_contact try: self.assertTrue(added_contact) except: formset = ContactForm(postdata) print formset.errors self.assertFalse(True, "Contact not found in the database - most likely, the post values in the test didn't validate against the form")

    Read the article

  • need help with Java solution /newbie

    - by Racket
    Hi, I'm new to programming in general so i'm trying to be as specific as possible in this question. There's this book that i'm doing some exercises on. I managed to do more than half of what they say, but it's just one input that I have been struggling to find out. I'll write the question and thereafter my code, "Write an application that creates and prints a random phone number of the form XXX-XXX-XXXX. Include the dashes in the output. Do not let the first three digits contain an 8 or 9 (but don't be more restrictive than that), and make sure that the second set of three digits is not greater than 742. Hint: Think through the easiest way to construct the phone number. Each diigit does not have to be determined separately." OK, the highlighted sentence is what i'm looking at. Here's my code: import java.util.Random; public class PP33 { public static void main (String[] args) { Random rand = new Random(); int num1, num2, num3; num1 = rand.nextInt(900) + 100; num2 = rand.nextInt(643) + 100; num3 = rand.nextInt(9000) + 1000; System.out.println(num1+"-"+num2+"-"+num3); } } How am I suppose to do this? I'm on chapter 3 so we have not yet discussed if statements etcetera, but Aliases, String class, Packages, Import declaration, Random Class, Math Class, Formatting output (decimal- & numberFormat), Printf, Enumeration & Wrapper classes + autoboxing. So consider answer the question based only on these assumptions, please. The code doesn't have any errors. Thank you!

    Read the article

  • Android Bluetooth Cross Platform Interoperability

    - by Philipp
    Hi, I have a Bluetooth service that I programmed for .Net on a Windows machine and I would like my Android 2.1 phone to connect to it. The server is listening for the same UUID which the Android is using to connect. But the connection is failing. When I try to connect to devices that are not listening for that UUID, I get an exception with the message "Service discovery failed", but when I try to connect to the server that is listening for the right UUID a message box pops up saying: "There was a problem pairing with bluetooth device." And I get an exception with the message "Connection timed out." So it looks like the server and the Android are communicating, but there is some sort of failure during handshaking. I know that the Android requires that the server is paired with the phone and also encrypts the communication channel. Does anyone know which specifications are used to do this? I would love to get my server to respond properly to the connection attempt. Thanks!

    Read the article

  • Why doesn't setting clearTaskOnLaunch="true" cause OnCreate to be called?

    - by cbrauer
    My application works fine, once it is initialized in the OnCreate method of my View class. However, when I open my app after the Droid phone has been sitting idle all night, the OnCreate method is not being called. I use the OnCreate to initialize data, and that in turn initializes the GUI. The GUI clearly shows that OnCreate was not called. I tried setting clearTaskOnLaunch="true" in my Manifest. My Manifest is: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hedgetools.trin" android:versionCode="2" android:versionName="1.02"> <application android:icon="@drawable/icon" android:label="@string/app_name" android:clearTaskOnLaunch="true"> <activity android:name=".Trin" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="6" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> </manifest> This did not help. My OnCreate method is not being call after the Droid phone sits idle all night. Why doesn’t clearTaskOnLaunch cause OnCreate to be called? Any help or suggestions will be greatly appreciated. Charles

    Read the article

  • first data global gateway API - invalid XML problem

    - by B.Georg
    Hello, i am implementing the First Data Global Gateway API into a Java E-Commerce Web application. The problem that i have is that I get an error message SGS-020003: Invalid XML returned from the staging.linkpt.net server. By switching the optional entities off, I managed to locate the problematic entity. It is the Shipping entity. I have the following data inside it: <shipping> <zip>10105</zip> <phone>123456789</phone> <email>[email protected]</email> <name>DJBla</name> <state>NY</state> <address1>some city</address1> <address2>suite 6</address2> <city>New York</city> <country>US</country> </shipping> According to the First Data Global Gateway User Manual Version 1.1 everything is correct with my XML. Would anyone have an idea where the error could be? Kind Regards, B.Georg

    Read the article

  • LDAP query using Python: always no result

    - by Grey
    I am trying to use python to query LDAP server, and it always returns me no result. and anyone help me find what wrong with my python code? it runs fine without excpetions, and it always has no result. i played around with the filter like "cn=partofmyname" but just no luck. thanks for help import ldap try: l = ldap.open("server") l.protocol_version = ldap.VERSION3 l.set_option(ldap.OPT_REFERRALS, 0) output =l.simple_bind("cn=username,cn=Users,dc=domian, dc=net",'password$R') print output except ldap.LDAPError, e: print e baseDN = "DC=rim,DC=net" searchScope = ldap.SCOPE_SUBTREE ## retrieve all attributes - again adjust to your needs - see documentation for more options retrieveAttributes = None Filter = "(&(objectClass=user)(sAMAccountName=myaccount))" try: ldap_result_id = l.search(baseDN, searchScope, Filter, retrieveAttributes) print ldap_result_id result_set = [] while 1: result_type, result_data = l.result(ldap_result_id, 0) if len(result_data) == 0: print 'no reslut' break else: for i in range(len(result_set)): for entry in result_set[i]: try: name = entry[1]['cn'][0] email = entry[1]['mail'][0] phone = entry[1]['telephonenumber'][0] desc = entry[1]['description'][0] count = count + 1 print "%d.\nName: %s\nDescription: %s\nE-mail: %s\nPhone: %s\n" %\ (count, name, desc, email, phone) except: pass ## here you don't have to append to a list ## you could do whatever you want with the individual entry #if result_type == ldap.RES_SEARCH_ENTRY: # result_set.append(result_data) # print result_set except ldap.LDAPError, e: print e l.unbind()

    Read the article

  • Timer appears to be pausing when screen becomes inactive

    - by elchuppa
    So I have a very simple android activity that starts a timer when you hit a button. Timer timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { doStuff(); } }, 15 * 60 * 1000); So this worked reasonably well for me when I was testing but as it turns out when the screen becomes inactive so does the timer. I was a bit surprised by this. I understand you need to create a service to have anything running in the background but I hadn't realized this is required for an activity in the foreground when the phone has inactivated the screen due to lack of activity. What confuses me is I think this worked as I expected originally and just in the last few weeks or so has the timer been affected by the phone saving power. I could be wrong though.. So basically my questions are: am I seeing expected behavior? Do I need to create all timers as services or somehow disallow powersaving? thanks for any advice, Patrick

    Read the article

  • Is it possible to create an Android Service that listens for hardware key presses?

    - by VoteBrian
    I'd like to run an Android background service that will act as a keylistener from the home screen or when the phone is asleep. Is this possible? From semi-related examples online, I put together the following service, but get the error, "onKeyDown is undefined for the type Service". Does this mean it can't be done without rewriting Launcher, or is there something obvious I'm missing? public class ServiceName extends Service { @Override public void onCreate() { //Stuff } public IBinder onBind(Intent intent) { //Stuff return null; } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN) { switch(keyCode) { case KeyEvent.KEYCODE_A: //Stuff return true; case KeyEvent.KEYCODE_B: //Stuff return true; //etc. } } return super.onKeyDown(keyCode, event); } } I realize Android defaults to the search bar when you type from the home screen, but this really is just for a very particular use. I don't really expect anyone but me to want this. I just think it'd be nice, for example, to use the camera button to wake the phone.

    Read the article

  • stop android emulator call

    - by Shahzad Younis
    I am working on an Android application, having functionality like voicemail. I am using BroadcastReceiver to get dialing events. I have to get the event "WHEN CALL IS UNANSWERED (not picked after few rings) FROM RECEIVER". I will do some actions on caller end against this event. I am using AVD emulator, and I do call from one instance to another instance and it calls perfectly, but the problem is: It continuously calls until I reject or accept the call. This way I cannot detect that "CALL IS UNANSWERED AFTER A NUMBER OF RINGS". So I want the Caller emulator to drop the call after a number of rings (if unanswered) like a normal phone. I can do it (drop the call after some time) by writing some code, but I need the natural functionality of phone in the emulator. Can anyone please guide me? Is there any settings in the emulator? Or something else? The code is shown below in case it helps: public class MyPhoneReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Bundle extras = intent.getExtras(); if (extras != null) { String state = "my call state = " + extras.getString(TelephonyManager.EXTRA_STATE); Log.w("DEBUG", state); } }

    Read the article

  • Stored Procedure Parameters Not Available After Declared

    - by SidC
    Hi All, Pasted below is a stored procedure written in SQL Server 2005. My intent is to call this sproc from my ASP.NEt web application through the use of a wizard control. I am new to SQL Server and especially to stored procedures. I'm unsure why my parameters are not available to the web application and not visible in SSMS treeview as a parameter under my sproc name. Can you help me correct the sproc below so that the parameters are correctly instantiated and available for use in my web application? Thanks, Sid Stored Procedure syntax: USE [Diel_inventory] GO /****** Object: StoredProcedure [dbo].[AddQuote] Script Date: 05/09/2010 00:31:10 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[AddQuote] as Declare @CustID int, @CompanyName nvarchar(50), @Address nvarchar(50), @City nvarchar(50), @State nvarchar(2), @ZipCode nvarchar(5), @Phone nvarchar(12), @FAX nvarchar(12), @Email nvarchar(50), @ContactName nvarchar(50), @QuoteID int, @QuoteDate datetime, @NeedbyDate datetime, @QuoteAmt decimal, @ID int, @QuoteDetailPartID int, @PartNumber float, @Quantity int begin Insert into dbo.Customers (CompanyName, Address, City, State, ZipCode, OfficePhone, OfficeFAX, Email, PrimaryContactName) Values (@CompanyName, @Address, @City, @State, @ZipCode, @Phone, @FAX, @Email, @ContactName) set @CustID = scope_identity() Insert into dbo.Quotes (fkCustomerID,NeedbyDate,QuoteAmt) Values(@CustID,@NeedbyDate,@QuoteAmt) set @QuoteID = scope_identity() Insert into dbo.QuoteDetail (ID) values(@ID) set @ID=scope_identity() Insert into dbo.QuoteDetailParts (QuoteDetailPartID, QuoteDetailID, PartNumber, Quantity) values (@ID, @QuoteDetailPartID, @PartNumber, @Quantity) END

    Read the article

  • Concept: Is mongo right for applying schemas?

    - by Jan
    I am currently in charge of checking wether it is valuable for one of our upcoming products to be developed on mongo. Without going too much into detail, I'll try to explain, what the app does. The app simply has "entities". These entities are technical stuff, like cell phones, TVs, Laptops, tablet pcs, and so forth. Of course, a cell phone has other attributes than a Tablet PCs and a Laptop has even other attributes, like RAM, CPU, display size and so on. Now I want to have something that we wanna call a scheme: We define that we need to have saved the display size, amount of ram size of flash devices, processor type, processor speed and so on for tablet pcs. For cell phone we might save display size, GSM, Edge, 3g, 4g, processor, ram, touch screen technology, bla bla bla. I think you got it :) What I want to realize is, that each "category" has a schema and when one of the system's users enters a new product (let's say the new iphone 4), the app constructs the form to be filled out with the appropriate attributes. So far it sounds nice and should not be a problem with mongo. But now the tough for which I could not find a clean solution.... An attribute modeled in mongo looks like: { _id: 1234456, name: "Attribute name", type: 0, "description" } But what to do, if i need this attribute in several languages, like: { en: {name: "Attribute name", type: 0, "description"}, de: {name: "Name des Attributs, type: 0, "Beschreibung"} } I also need to ensure that the german attribute gets updated as soon as the english gets updated, for instance when type changes from 0 to 1. Any ideas on that?

    Read the article

  • creating arrays in for loops.... without creating an endless loop that ruins my day!

    - by Peter
    Hey Guys, Im starting with a csv varible of column names. This is then exploded into an array, then counted and tossed into a for loop that is supposed to create another array. Every time I run it, it goes into this endless loop that just hammers away at my browser...until it dies. :( Here is the code.. $columns = 'id, name, phone, blood_type'; <code> $column_array = explode(',',$columns); $column_length = count($column_array); //loop through the column length, create post vars and set default for($i = 0; $i <= $column_length; $i++) { //create the array iSortCol_1 => $column_array[1]... $array[] = 'iSortCol_'.$i = $column_array[0]; } </code> What I would like to get out of all this is a new array that looks like so.. <code> $goal = array( "iSortCol_1" => "id", "iSortCol_2" => "name", "iSortCol_3" => "phone", "iSortCol_4" => "blood_type" ); </code>

    Read the article

  • java.awt.Robot.keyPress for continuous keystrokes

    - by Deb
    So, here's my problem. I have a java program which will send keystroke messages to a game (built in Unity), based on how the user interacts with an android phone. (My java program is a listener for the android interaction over wi-fi) Now, in order to do this, I am using java.awt.Robot to send keyPresses to the game window. I have the following code block written in my listener program: if(interacting) { Robot robot = new Robot(); robot.keyPress(VK_A); robot.delay(20); //to simulate the normal keyboard rate } Now the variable interacting will be true as long as the user presses down on the touch screen of the phone, and what I intend to achieve is a continuous chain of keystroke messages being delivered to the game (through the listener). However, this is severely affecting performance, for some reason. I am noticing that the game becomes slow (rapidly dropping frame rates), and even the computer becomes slow, in general. What's going wrong? Should I use a robot.keyRelease(VK_A) after each keyPress? But my game has a different action mapped to the release of a key, and I do not want rapid key presses and releases; what I really want is to simulate continuous keystrokes, in exactly the way it would behave if the user were pressing down the A key on their keyboard manually. Please help.

    Read the article

  • LINQ to Entites - Left Outer Join - SQL 2000

    - by user255234
    Hi! I'm using Linq to Entities. I have the following query in my code, it includes left outer Join: var surgeonList = (from item in context.T1_STM_Surgeon.Include("T1_STM_SurgeonTitle") .Include("OTER").Include("OSLP") join reptable in context.OSLP on item.Rep equals reptable.SlpCode into surgRepresentative where item.ID == surgeonId select new { ID = item.ID, First = item.First, Last = item.Last, Rep = (surgRepresentative.FirstOrDefault() != null) ? surgRepresentative.FirstOrDefault().SlpName : "N/A", Reg = item.OTER.descript, PrimClinic = item.T1_STM_ClinicalCenter.Name, Titles = item.T1_STM_SurgeonTitle, Phone = item.Phone, Email = item.Email, Address1 = item.Address1, Address2 = item.Address2, City = item.City, State = item.State, Zip = item.Zip, Comments = item.Comments, Active = item.Active, DateEntered = item.DateEntered }) .ToList(); My DEV server has SQL 2008, so the code works just fine. When I moved this code to client's production server - they use SQL 2000, I started getting "Incorrect syntax near '(' ". I've tried changing the ProviderManifestToken to 2000 in my .edmx file, then I started getting "The execution of this query requires the APPLY operator, which is not supported in versions of SQL Server earlier than SQL Server 2005." I tied changing the token to 2005, the "Incorrect syntax near '(' " is back. Can anybody help me to find a workaround for this? Thank you very much in advance!

    Read the article

  • Bluetooth to arduino

    - by user1833709
    My current project includes an Arduino Uno attached via USB to a laptop. The laptop is there is receive messages via bluetooth (I realize I could connect a bluetooth modem directly to the arduino but this project has to come in under budget). What I'd ideally like to do is write a program that continually checks whether the laptop has been paired to a bluetooth transmitter (my phone) and sends this to the arduino. Do you think should write a program that checks the bluetooth state and writes a 0 or 1 to a text document, and then use something like Gobetwino to read from the text document? I could probably figure out how to continually read from the file, but I don't know enough about bluetooth to know how to check whether it's paired or not, computer-side. Something that writes directly to the arduino instead of a text document would be my preference, but I don't know where to start. I'm using an Android phone and Windows 7. If you need more info about the setup, just ask. Does anyone have any experience with this?

    Read the article

  • Having a problem inserting into database

    - by neo skosana
    I have a stored procedure: CREATE PROCEDURE busi_reg(IN instruc VARCHAR(10), IN tble VARCHAR(20), IN busName VARCHAR(50), IN busCateg VARCHAR(100), IN busType VARCHAR(50), IN phne VARCHAR(20), IN addrs VARCHAR(200), IN cty VARCHAR(50), IN prvnce VARCHAR(50), IN pstCde VARCHAR(10), IN nm VARCHAR(20), IN surname VARCHAR(20), IN eml VARCHAR(50), IN pswd VARCHAR(20), IN srce VARCHAR(50), IN refr VARCHAR(50), IN sess VARCHAR(50)) BEGIN INSERT INTO b_register SET business_name = busName, business_category = busCateg, business_type = busType, phone = phne, address = addrs, city = cty, province = prvnce, postal_code = pstCde, firstname = nm, lastname = surname, email = eml, password = pswd, source = srce, ref_no = refr; END; This is my php script: $busName = $_POST['bus_name']; $busCateg = $_POST['bus_cat']; $busType = $_POST['bus_type']; $phne = $_POST['phone']; $addrs = $_POST['address']; $cty = $_POST['city']; $prvnce = $_POST['province']; $pstCde = $_POST['postCode']; $nm = $_POST['name']; $surname = $_POST['lname']; $eml = $_POST['email']; $srce = $_POST['source']; $ref = $_POST['ref_no']; $result2 = $db->query("CALL busi_reg('$instruc', '$tble', '$busName', '$busCateg', '$busType', '$phne', '$addrs', '$cty', '$prvnce', '$pstCde', '$nm', '$surname', '$eml', '$pswd', '$srce', '$refr', '')"); if($result) { echo "Data has been saved"; } else { printf("Error: %s\n",$db->error); } Now the error that I get: Commands out of sync; you can't run this command now

    Read the article

  • LINQ-to-SQL - Join, Count

    - by ile
    I have following query: var result = ( from role in db.Roles join user in db.Users on role.RoleID equals user.RoleID where user.CreatedByUserID == userID orderby user.FirstName ascending select new UserViewModel { UserID = user.UserID, PhotoID = user.PhotoID.ToString(), FirstName = user.FirstName, LastName = user.LastName, FullName = user.FirstName + " " + user.LastName, Email = user.Email, PhoneNumber = user.Phone, AccessLevel = role.Name }); Now, I need to modify this query... Other table I have is table Deals. I would like to count how many deals user created last month and last year. I tried something like this: var result = ( from role in db.Roles join user in db.Users on role.RoleID equals user.RoleID //join dealsYear in db.Deals on date.Year equals dealsYear.DateCreated.Year join dealsYear in ( from deal in db.Deals group deal by deal.DateCreated into d select new { DateCreated = d.Key, dealsCount = d.Count() } ) on date.Year equals dealsYear.DateCreated.Year into dYear join dealsMonth in ( from deal in db.Deals group deal by deal.DateCreated into d select new { DateCreated = d.Key, dealsCount = d.Count() } ) on date.Month equals dealsMonth.DateCreated.Month into dMonth where user.CreatedByUserID == userID orderby user.FirstName ascending select new UserViewModel { UserID = user.UserID, PhotoID = user.PhotoID.ToString(), FirstName = user.FirstName, LastName = user.LastName, FullName = user.FirstName + " " + user.LastName, Email = user.Email, PhoneNumber = user.Phone, AccessLevel = role.Name, DealsThisYear = dYear, DealsThisMonth = dMonth }); but here is even syntax not correct. Any idea? Btw, is there any good book of LINQ to SQL with examples?

    Read the article

  • Php JSON Response Array

    - by Nick Kl
    I have this php code. As you can see i query a mysql database through a function showallevents. I return a the $result to the $event variable. I try to return all rows of the data that i take with the msql_fetch_assoc. I don't get response even when i encode the $response variable. It returns null to all fields. Can anyone help me on what i am doing wrong. I had a valid code but it was returning only 1 row of data so i tried to make an associative array but seems i am failing. if ($tag == 'showallevents') { // Request type is show all events // show all events $event = $db->showallevents(); if ($event != false) { $data = array(); while($row = mysql_fetch_assoc($event)) { $data[] = array( $response["success"] = 1, $response["uid"] = $event["uid"], $response["event"]["date"] = $event["date"], $response["event"]["hours"] = $event["hours"], $response["event"]["store_name"] = $event["store_name"], $response["event"]["event_information"] = $event["event_information"], $response["event"]["event_type"] = $event["event_type"], $response["event"]["Phone"] = $event["Phone"], $response["event"]["address"] = $event["address"], $response["event"]["created_at"] = $event["created_at"], $response["event"]["updated_at"] = $event["updated_at"]); } echo json_encode($data); } else { // event not found // echo json with error = 1 $response["error"] = 1; $response["error_msg"] = "Events not found"; echo json_encode($response); } } else { echo "Access Denied"; } } ?>

    Read the article

  • Django | passing form values

    - by MMRUser
    I want to create a user sign up process that requires two different forms with the same data one (1st form) is for filling out the data and other one (2nd form) is for displaying the filled data as a summery (before actually saving the data) so then user can view what he/she has filled up... my problem is that how do I pass 1st form's data in to the 2nd one .. I have used the basic Django form manipulation mechanism and passed the form field values to the next form using Django template tags.. if request.method == 'POST': form = Users(request.POST) if form.is_valid(): cd = form.cleaned_data try: name = cd['fullName'] email = cd['emailAdd'] password1 = cd['password'] password2 = cd['password2'] phoneNumber = cd['phoneNumber'] return render_to_response('signup2.html', {'name': name, 'email': email, 'password1': password1, 'password2': password2, 'phone': phone, 'pt': phoneType}) except Exception, ex: return HttpResponse("Error %s" % str(ex)) and from the second from I just displayed those field values using tags and also used hidden fields in order to submit the form with values, like this: <label for="">Email:</label> {{ email }} <input type="hidden" id="" name="email" class="width250" value="{{ email }}" readonly /> It works nicely from the out look, but the real problem is that if someone view the source of the html he can simply get the password even hackers can get through this easily. So how do I avoid this issue.. and I don't want to use Django session since this is just a simple sign up process and no other interactions involved. Thanks.

    Read the article

  • Turning a series of raw images into movie frames in Android

    - by Nicholas Killewald
    I've got an Android project I'm working on that, ultimately, will require me to create a movie file out of a series of still images taken with a phone's camera. That is to say, I want to be able to take raw image frames and string them together, one by one, into a movie. Audio is not a concern at this stage. Looking over the Android API, it looks like there are calls in it to create movie files, but it seems those are entirely geared around making a live recording from the camera on an immediate basis. While nice, I can't use that for my purposes, as I need to put annotations and other post-production things on the images as they come in before they get fed into a movie (plus, the images come way too slowly to do a live recording). Worse, looking over the Android source, it looks like a non-trivial task to rewire that to do what I want it to do (at least without touching the NDK). Is there any way I can use the API to do something like this? Or alternatively, what would be the best way to go about this, if it's even feasible on cell phone hardware (which seems to keep getting more and more powerful, strangely...)?

    Read the article

  • Phonegap Android application exiting - but not really - when home button is pressed

    - by Lucas T
    I have created an Phonegap 1.5/Android application. My client reports that, when he leaves the app using the Home button, and then relaunches it using the app icon, the app relaunches from the start instead of resuming. However, when he holds the home button, the app appears in the running apps, and when he accesses the app through this menu, the app resumes in the expected way. I thought this could be linked to the app being automatically closed by the OS due to a lack of memory, but if that was the case the app shouldn't appear in the running apps. I could not reproduce the bug on my Sony Ericsson XPERIA with Android 2.3.4, the client has experienced this behaviour on a Motorola Defy and on another phone (i'll add the reference of the other phone and the OS versions as soon as I get them). The initialization process of the app is declared this way : window.addEventListener('load', function(){ document.addEventListener('deviceready', _onDeviceReady, false); }, false); Could this be fixed by attaching the processes to other events (although I doubt it, the app really seems to be relaunched from the start) ? Is there a declaration to make in the Android Manifest to prevent this behavior ? Is that a known bug in some Android phones/versions ?

    Read the article

  • Rails: How do I validate against this code that I put into the lib/ directory?

    - by randombits
    Having a bit of difficulty finding out the proper way to mix in code that I put into the lib/ directory for Rails 2.3.5. I have several models that require phone validation. I had at least three models that used the same code, so I wanted to keep things DRY and moved it out to the lib/ directory. I used to have code like this in each model: validate :phone_is_valid Then I'd have a phone_is_valid method in the model: protected def phone_is_valid # process a bunch of logic errors.add_to_base("invalid phone") if validation failed end I moved this code out into lib/phones/ and in lib/phones I have lib/phones/phone_validation.rb, and in there I copy pasted the phone_is_valid method. My question is, how do I mix this into all of my models now? And does my validate :phone_is_valid method remain the same or does that change? I want to make sure that the errors.add_to_base method continues to function as it did before while keeping everything DRY. I also created another file in lib/phones/ called lib/phones/phone_normalize.rb. Again, many models need the value input by the user to be normalized. Meaning turn (555) 222-1212 to 5552221212 or something similar. Can I invoke that simply by invoking Phones::Phone_Normalize::normalize_method(number)? I suppose I'm confused on the following: How to use the lib directory for validation How to use the lib directory for commonly shared methods that return values

    Read the article

  • iOS6: do we have to set rootViewController in App delegate in order to support different orientations?

    - by Centurion
    The app was perfectly fine working in iOS5 in landscape orientation. However in iOS6, it started to use portrait orientation in all view controllers. The methods shouldAutorotateToInterfaceOrientation are not called anymore. I read the new stuff about changed rotation mechanism in iOS6 and I was able to fix that by adding a line in my AppDelegate: self.window.rootViewController = _viewController _viewControler is the starting screen (Home-menu). All other view controllers implement shouldAutorotateToInterfaceOrientation method and returns YES for landscape orientations only. So, it's perfectly working solution for the app that needs to support only one orientation. However, the problem is I need one view controller (lets call it phone-VC) to be presented in portrait orientation. Now, if I want this view controller would be rotated then I need to return YES in Home-menu controller that is assigned to rootViewControler in appDelegate. However, I can't do that because this rootViewController is starting window that need to presented in landscape only, otherwise the layout with graphics in this window will break. But if I don't return YES from its shouldAutorotateToInterfaceOrientation (Home-menu) then the same method is not called in my view phone-VC that needs to be presented in portrait. Any ideas? Does the assignation of rootViewController is mandatory in AppDelegate? UPDATE: the problem exists on device (at least on iPhone4).

    Read the article

  • Android debug mode not working waiting for device

    - by Blue42
    I'm trying to get my android phone working to run apps from inside an IDE. Got it working on windows no problem, currently working in fedora (18) a lot though so wanted to get it working with that. Got IntelliJ and android sdk installed, problem is when I try to run the default hello world app it wont work it just says waiting for device.. Ran adb devices got List of devices attached ???????????? no permissions Leads me to believe the driver isn't installed? Phone I'm using is a HTC Sensation. Does anyone know what I can do to try and resolve it? The HTC web page doesn't offer me drivers to install. Also noticed in /etc/udev/rules.d/..android.rules there is nothing about Sensation. Seems it recognises my nexus 7 though.. Edit: Tried my nexus.. got List of devices attached 901839238298923 offline So it doesn't even work with that.. confusing.. Any help would be appreciated. Thanks, B

    Read the article

  • Processing forms that generate many rows in DB

    - by Zack
    I'm wondering what the best approach to take here is. I've got a form that people use to register for a class and a lot of times the manager of a company will register multiple people for the class at the same time. Presently, they'd have to go through the registration process multiple times and resubmit the form once for every person they want to register. What I want to do is give the user a form that has a single <input/> for one person to register with, along with all the other fields they'll need to fill out (Email, phone number, etc); if they want to add more people, they'll be able to press a button and a new <input/> will be generated. This part I know how to do, but I'm including it to best describe what I'm aiming to do. The part I don't know how to approach is processing that data the form submits, I need some way of making a new row in the Registrant table for every <input/> that's added and include the same contact information (phone, email, etc) as the first row with that row. For the record, I'm using the Django framework for my back-end code. What's the best approach here? Should it just POST the form x times for x people, or is there a less "brute force" way of handling this?

    Read the article

< Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >