w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android twitter user/show (user information) migration version 1 to 1.1
I have solved my problem by sending authentication with api. In api version 1.1 we need to send authentication with request otherwise we get 400 bad request(invalid request). This is the coding example for sending authentication. private OAuthConsumer consumer; consumer = new CommonsHttpOAuthConsumer( Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET); consumer.setTokenWithSecret(token,secret_token); .......... HttpGet httpGet = new HttpGet(params[0]); consumer.sign(hpost); we need sign-core and sign common post jars.

Categories : Android

Python: how to create a file .txt and record information in it
You can use the open built-in to get a file object with writing permissions, and then fill the content using the write function: file = open('<FILENAME>.txt', 'w') file.write('first line ') file.write('second line ') file.close() Check out the linked docs for more info about the open arguments and other useful functions like writelines.

Categories : Python

How to record the running information of functions in your program?
This is the best I could come up with using C++ macros. I don't know whether it conforms to the requirements. A very basic version just recording the count. The macro replaces all existing calls to the function with the contents of the macro, which records the stats and calls the function. Can easily be extended to record more details. Assumes there's only one function with that name or you want one count for all of them. Requires a macro for each function. // here's our function void func() { /* some stuff */ } // this was added int funcCount = 0; #define func(...) do { funcCount++; func(__VA_ARGS__); } while(0) int main() { // call the function func(); // print stats cout << funcCount << endl; return 0; } Prints 1. A more generic version. Requir

Categories : Debugging

Reading URL's and parse information
It looks like you're looping through the wrong thing. Try changing this: for ($i=0;$i<3;$i++) { To this: for ($i = 0; $i <= count($pathComponents); $i++)

Categories : PHP

Parse Information from an Address
Ok, this is a difficult one. I would star creating a table with the different strings that will represent an apartment, something like this: INSERT INTO ApartmentsStrings VALUES (N'apt'),(N'apartment'); Then I would do the following: SELECT A.[Address] OriginalAddress, CASE WHEN B.Position IS NOT NULL THEN LEFT(A.[Address],B.Position-1) ELSE A.[Address] END Address_1, CASE WHEN B.Position IS NOT NULL THEN SUBSTRING(A.[Address],B.Position,LEN(A.[Address])-B.Position+1) END Address_2 FROM Address A OUTER APPLY(SELECT PATINDEX('%'+String+'%',A.[Address]) Position FROM ApartmentsStrings WHERE PATINDEX('%'+String+'%',A.[Address]) > 0) B The results: ╔══════════════════════

Categories : Sql Server

DRY approach to add user information without using Auth.user in Django
I would recommend using a dummy value in either the date_joined or last_login fields for the User model, if you wanted to implement a solution without adding a new field just to serve as an indicator flag. The potential problem with using the is_active flag is that you may end up wanting to use this flag to "blacklist" or effectively delete an account without actually removing their record from your database (to prevent re-creation of the account with same credentials, etc.) If you start relying on the fact that the password is not set, then if the day ever comes where you want to implement alternative login methods (OAuth) then your password field will not be set in these cases as well (huge conflict).

Categories : Django

Rails Solution to give a user a warning that another user is currently editing the same record
You can generate an md5 hash of your loaded object(based on all your editable attributes) and the object from database and compare both. If they are not same, then someone changed the object after you loaded the object into memory. Digest::SHA2.hexdigest(<string made of all your editable attributes>)

Categories : Ruby On Rails

Parse Who-is Information for Expiration Date
The approach you are following is not accurate. There is no standard, every registry can returns a completely different string for the expiration date. In some cases, it doesn't even match Expir (for example some whois responses contains Until). If you want to be as accurate as possible, you need to create one rule for every single TLD. This is the approach I followed for the Ruby WHOIS library. In this case I went one step further by writing one full parser for every TLD.

Categories : PHP

Is there a way to get information on deleted record when calling IndexedDB's objectStore.delete?
Pardon my language, but WTF? Apparently, there is no (at least standard) way to get any information about the deletion operation. In fact, you cannot even know if it was successful! From Mozilla: As per spec the result of the Object Store Deletion Operation algorithm is undefined, so it's not possible to know if some records were actually deleted by looking at the request result. From the spec: http://www.w3.org/TR/IndexedDB/#object-store-deletion-operation The result of this algorithm is undefined. This seems to be a major fail. How can a database not even acknowledge success or failure of an operation?!

Categories : HTML

Facebook information not populating Parse database
Use more whitespace, and declare more instance variables. Open your code out so you can find your problem easier. For instance, pull out the value for result[@"data"][0][@"name"] and assign it to a local variable of it's own. Subclass your entity in CoreData, so it's easier to manage attribute assignment with setters and getters. Then set breakpoints and examine each step of the code.

Categories : IOS

information from Junction table combined into one field related to 1 record with a query
The only solution I can think of is probably not what you're looking for -- using a GROUP BY statement. SELECT Work.ID, Work.[Employee ID], Work.[Type of work], Work.description, Sum(Work.hours) as SumOfHours, [Work Code].[Program Code] FROM [Work Code] INNER JOIN [Work] ON [Work Code].[Work ID] = Work.ID GROUP BY Work.ID, Work.[Employee ID], Work.[Type of work], Work.description, [Work Code].[Program Code]; I'm not aware that there's any way in SQL to force multiple joined rows into a single field in a single row. When I need this kind of functionality I generally go with the really dirty hack of storing, in this case, the Program Codes in a comma delimmitted format inside the Work Table. I use code to get them there, usually at the time the Program Codes are being entered. As a sid

Categories : SQL

How to parse and store team information from files into classes?
This is a really really common (and luckily for you, simple) case of parsing using tokenizing. Here, the different fields you need are separated by the same character: , Please see this stackoverflow question about tokenizing in C++ for more information. Also, don't forget to remove unnecessary spaces on your tokenized elements (except the first one)

Categories : C++

How to collect (get and parse) the required information/data from a HTTP website?
What you're looking for is something called web scraping or html scraping. Have a look at this SO question to get you started: Options for HTML scraping?

Categories : Android

Rails Parse Active record validation error
Its just a hash. Access the message with errors[:name].first This gets the value of the :name key from the hash, which is an array with one element, and then returns the value of the first element of the array, which is the error message. With more errors, use Array functions to access all of them and display them appropriately.

Categories : Ruby On Rails

What should be the PFQuery to fetch record for column type "array" at parse?
In the docs there is a section for query on array values: // Find objects where the array in arrayKey contains 2. [query whereKey:@"arrayKey" equalTo:[NSNumber numberWithInt:2]];

Categories : IOS

How to get all user information from twitter with api v1.1?
You can use this link FHSTwitterEngine and check the code given in answer.. FHSTwitterEngine is latest library with compatible with v1.1.. its should solve your problem

Categories : Iphone

Get user information in Windows 8?
@seshuk had given you the correct answer, from the MSDN documentation Only domain users have a principal name. Access to the principal name can be blocked by privacy settings (for example, if the UserInformation::NameAccessAllowed property is false). If access is blocked, this method returns an empty string. This method requires the enterpriseAuthentication capability. A Hotmail id, by definition, would not be a domain user. Additionally, you'd need a company account to publish such an app, since it requires the enterprise authentication capability.

Categories : C#

Retrieving information of validated user in WCF
If you are using the WCF in web application you can store the user details in cookie as the CodeProject article does or you can follow WCF Authentication as here: msdn.microsoft.com/en-us/library/ff405740.aspx Use below code to get user: var currentUser = new WindowsPrincipal((WindowsIdentity) System.Threading.Thread.CurrentPrincipal.Identity);

Categories : C#

Get User Location Information using EKTRON API
I don't have v8.7 running right now, but I do have v9, and here's what I found: I ran the following code: var location = Ektron.Cms.UserContext.GetLocationInfo("74.125.225.113"); Response.Write("<pre>" + Ektron.Cms.UserContext.IP + "</pre>"); Response.Write("<pre>" + string.Format("{0}, {1} ({2} / {3})", location.City, location.Region, location.Longitude, location.Latitude) + "</pre>"); Here's what was displayed on the screen: ::1 Mountain View, CA (-122.057403564453 / 37.4192047119141) I'm running the site locally on my dev machine, so I'm browsing to http://localhost/test.aspx - no real surprise that Ektron.Cms.UserContext.IP is returning "::1" for me. I didn't have access to a server, so I pinged www.google.com and got an IP address of 74.125.225.113. U

Categories : Api

How can all of my ViewControllers for iOS have user login information available to them?
There is concept called NSUserDefaults in iOS to which is used to store light weight information in iPhone memory. Look at this examples to learn storing and retrieving data in NSUserDefaults : example1 and example2. EDIT : As you want to store login and password, use keychain. Here is an keychain example.

Categories : IOS

How to get user information after successful authentication?
The accepted answer (from the discussion with the OP) is : the most straightforward way of retrieving the user name set by the forms authentication module is to use HttpContext.Current.User.Identity.Name or just this.User.Identity.Name in a controller.

Categories : C#

Get currently logged in user information in ektron
Use the Framework API. Take a look at: Ektron.Cms.Framework.Context.UserContextService.Current This will give you everything you're asking for. Here's a screenshot of the properties I have available to me in a v8.7 installation. Should be available all versions v8.5 and up. http://screencast.com/t/TcSdTySH9R

Categories : Api

Trying to display user information after they login
Citation from the php manual: Note that all columns must be bound after mysqli_stmt_execute() and prior to calling mysqli_stmt_fetch(). Depending on column types bound variables can silently change to the corresponding PHP type. see http://php.net/manual/en/mysqli-stmt.bind-result.php So just put it that way: $stmt->execute(); $stmt->bind_result($_SESSION['firstname'], $_SESSION['lastname']); $stmt->fetch();

Categories : PHP

how to get user information in google wallet
I thought the answer would lie in the postback facility. That gives google's user ID and order number. However, I didn't see how to convert either of those to an email address for sending the digital good just purchased. BTW. I rejected doing the fulfilment client side as that seemed insecure. If I'm wrong about that then why would they offer the postback facility? ... then I realised, we could do part of it client and part server side. I guessed that something comes back from the client-side success callback. success: function(result) { console.log('success',result.response.orderId); complete(result.response.orderId); }, So, I now have the google's orderId on the client side and there I know the user's ID. So my complete() function can send the orderId and o

Categories : Android

Trying to use MySQL to return user information
You forgot to use single quote around value in query mysql_query("SELECT * FROM users WHERE username='{$_SESSION[username]}'"); ^^ ^^ Also stop using mysql_* functions they are deprecated, Use MySQLi OR PDO.

Categories : PHP

How can I load Skype user information into a ListBox?
You can do like this .. but Do not sort ListBox2 !! Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim lstHandle as New List(Of String) Dim lstSex as New List(Of String) Dim lstPhone as New List(Of String) Dim lstAlias as New List(Of String) Dim lstBDay as New List(Of String) '--> you can change to date Dim lstCity as New List(Of String) Dim lstCountry as New List(Of String) Dim lstLang as New List(Of String) Dim lstFriend as New List(Of String) '--> you can to integer For Each hmm As SKYPE4COMLib.User In Skype.Friends 'ListBox2.Items.Add("<>-----------------------------------------<>") ListBox2.Items.Add(hmm.FullName) lstHandle.Add(hmm.Handle) lstSex.Add(hmm.Sex) lstPhone.Add(hmm.PhoneHome + hmm.PhoneMobi

Categories : Vb.Net

Get User information after successful authentication with Oauth2
By default, the GTMOAuth2ViewControllerTouch viewController will fetch the user's email, but not the rest of the user's profile. The full profile can be requested from Google's server by setting this property before sign-in: GTMOAuth2ViewControllerTouch *viewController; viewController.signIn.shouldFetchGoogleUserProfile = YES; The profile will be available after sign-in as NSDictionary *profile = viewController.signIn.userProfile; and to get other information you have to change the scope string and begin fetch again. here are some scope urls @"https://www.googleapis.com/auth/plus.me" @"https://www.googleapis.com/auth/userinfo.email" @"https://www.googleapis.com/auth/tasks"

Categories : Iphone

Get user address information using a phone number
I'm not quite sure whether it's possible through the phone number. However there's an API that might help you to achieve something similar. A CellID is the unique number of a GSM cell for a given operator. Your phone is always connected to a Cell, and by nowing this number, you know the Cell, and by knowing the position of the cell, you know where you are. There is some accuracy issue, as the cell can cover from several hundreds of meters to several kilometers, but this could be a very good starting point to locate yourself. Links: OpenCellID and OpenCellID API Hope it helps!

Categories : PHP

Asking the user to enter information to then output info using OOP
Just replace c.set_radius 5 with c.set_radius gets.to_i. Here are a few other changes I'd make, just to clean it up a bit: class Circle def initialize(params = {}) @radius = params[:radius] end def area @radius**2 * Math::PI end end puts "Please enter circle radius:" puts Circle.new(radius: gets.to_i).area

Categories : Ruby

Error when trying to retrieve basic user information
You haven't obtained the user's permission to perform the action you're attempting to perform. First call openActiveSessionWithReadPermissions:allowLoginUI:completionHandler: on FBSession. Here's some more information about how to log in to Facebook from iOS

Categories : IOS

Is there a way to go back and edit the information the user entered?
You can put all of your input into a while block: while (1): Correct = True while Correct: Correct = False Employee=raw_input("Enter Your Name:") ... needToCorrect=raw_input("Is the last Entry Correct?(y/n):") if needToCorrect == "n": Correct = True w.writerow([Employee,WorkOrder,PartNumber,Process,Qty,Date,Time,Correct]) Then if a user notices something is incorrect, an "n" will prompt the user to return and retype the fields. If you want only to correct certain fields, a similar, more complicated, method would work fine.

Categories : Python

Getting user information from Contact List Android
Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,null, null, null, null); while (cursor.moveToNext()) { String contactId = cursor.getString(cursor.getColumnIndex( ContactsContract.Contacts._ID)); //May want to get basic info here like name, phone //Example: //Cursor phones = getContentResolver().query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = "+ contactId, null, null); //while (phones.moveToNext()) { // String phoneNumber = phones.getString(phones.getColumnIndex( ContactsContract.CommonDataKinds.Phone.NUMBER)); // Log.i("phone", phoneNumber); //} //phones.close(); Cursor emails

Categories : Java

Django update already existing user information
There is nothing special about the default django user. In fact, the django auth application is a normal django application that has its own models, views, urls and templates just like any other app you would write. To update any model instance - you can use the generic UpdateView, which works like this: You create a template which will show the form that will be used to update the model. You can (optionally) create your own form class to be used - this is not required. You pass the model to be updated along with an instance to this view. The view takes care of the rest of the logic. Here is how you implement it in practice. In your views.py: from django.views.generic.edit import UpdateView from django.core.urlresolvers import reverse_lazy from django.contrib.auth.models import User

Categories : Django

ExtJS: How to store a user's login information only once?
Ext.util.Cookies.set('myObj',Ext.encode(obj)) Use something like this and when you want to use it id = (Ext.decode(Ext.util.Cookies.get('myObj'))).id

Categories : PHP

Spring Login user information retreival
if you create new User object, the username will be null definitely (if you have empty default constructor only). You can get username in jsp like this: <sec:authentication property="principal.username" /> and don't forget to add declaration on top: <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> Read more about it here

Categories : Java

Collecting user information for debugging and support
I do not know your country and any local regulations, but it is always better accepted to have a privacy policy if you collect sensitive data. You might inform the user upon the first start, for example. You can also explicitly ask the user for a consent and collect only if the user agrees to do it. Informed consent is a nice policy which both informs the user and also asks for a permission. You can then stack the results and release them (if you which and e.g. include it in the policy) stating users provided their consent.

Categories : Security

Options for storing user information while logged in
You'll want to leverage Session for that. Consider the following code: Session["Profile"] = profileObj; or maybe you just want to store a string: Session["SomeSetting"] = value; What you need to store in Session is unclear, and effectively irrelevant, you can store anything. You can access the Session from any Controller. Then later on you can get the value out like this: var profile = Session["Profile"]; // if the profile variable is null then it doesn't exist in Session yet In response to @AaronLS, Session lasts the duration of the IIS session that's created when the user first accesses the site. Do keep in mind that these sessions are reset if inactive for a period of time (I believe the default IIS timeout is 20 minutes) so you'd want to leverage the null return value to kno

Categories : C#

How do I display real-time information to the user?
It looks like you're wanting to 'push' data to the user in real-time. Previously this might have been done with a bit of a 'hack' solution known as long-polling With long polling, the client requests information from the server in a way similar to a normal polling; however, if the server does not have any information available for the client, then instead of sending an empty response, the server holds the request and waits for information to become available (or for a suitable timeout event), after which a complete response is finally sent to the client. However you might want to look into the HTML5 world of WebSockets. To do this I'd recommend reading up on SignalR and following some tutorials (watch the pluralsight videos). ASP.NET SignalR is a new library for ASP.NET develope

Categories : Ajax

How to record user webcam?
In your stop function, there is no variable stream in scope. The object that you called stream.record() on above was a parameter to the anonymous function back there, and is now inaccessible. Happily you can easily resolve this problem - simply "save" the reference to a top level variable, something like this: var currentStream = null; var record = function(button) { ... stream.record(); currentStream = stream; .. } var stop = function(button) { currentStream.stop(); // TODO disable stop button if this is null, etc. ... } By the way, when you're working with Javascript you should definitely pay attention to the error console in whatever browser you're using. You almost certainly would have seen an error like "stream is null or not an object [line 28]", which

Categories : Javascript

X.509 : Server not able to extract user information from client certificate
The subject-principal-regex you use is wrong. If you want the extracted principal to be rod for the DN in the log message, set the pattern to CN=(.*?), (note the comma at the end). Btw, I think it is the default pattern, so you might as well just skip this setting.

Categories : Authentication



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.