w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
iOS Facebook get user's profile image randomly opens profile homepage instead of permission dialog
This is how I would collect the User Profile picture, although there are plenty of ways to do this: I would use a notification (or any other method) to notify once the user is signed in, then call a method to collect the Facebook Profile picture. Once they are logged in you can pass their facebook Id to a value. (kUserFacebookIDKey) NSLog(@"Downloading user's profile picture"); // Download user's profile picture NSURL *profilePictureURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?type=large", self.kUserFacebookIDKey]; NSURLRequest *profilePictureURLRequest = [NSURLRequest requestWithURL:profilePictureURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0f]; // Facebook profile picture cache policy: Expires in 2 weeks [NSURLCo

Categories : IOS

How to display profile friends' avatars of a specific profile user?
I suppose that fid in user_friends table is related to an user_accounts id select ua.avatars from user_friends uf inner join user_accounts ua on uf.fid = ua.id inner join pages p on p.uid = uf.uid where p.pid = <somepid> or probably clearer select ua.avatars from pages p inner join user_friends uf on uf.uid = p.uid inner join user_accounts ua on ua.id = uf.fid where p.pid = <somepid>

Categories : Mysql

Why does XCode switch the profile from automatically selected one to the iOS Team Profile
After much nashing of teeth and hair pulling finally tracked down the cause of this, dont you just love xcode error msgs. Although the correct mobile provision was automatically selected in Debug line of the code signing section, the sub selection line "Any iOS SDK" had the team profile selected somehow. Changing this to match the automatic selection solved the problem.

Categories : Iphone

XCode--When do I sign with developer provisioning profile vs distribution profile?
Failed to get task sounds like you're trying to run this build via Xcode on device. If that's the case, you want to use a development profile, not a distribution profile (AdHoc). If you're attempting to create an enterprise release build, you'll want to select your target and choose the iOS device option, then use Product > Archive to create a release build.

Categories : IOS

Decode a high profile H.264 stream to baseline profile
The Profile is an encoding setting, not a decoding setting. If you have a video in Main profile, and want it in Baseline, you must decode then re-encode (This is call transcode). The problem is that your device can not decode Main profile in hardware. You can decode in software, but that will likely be slow (possibly slower than real time) and kill the battery. You best bet is it transcode the video first on a PC, or a cloud transcoding service before sending to the device.

Categories : Android

How to edit profile ? (using devise and has a model Profile but edit method is giving error)
Not sure what your controller looks like, but you can explicitly tell rails where to find the profile_id. something like this: <li><%= link_to "Profile".html_safe, edit_profile_path(current_user, profile_id: @profile) %></li> Edit: #<Class:0xb459b8c> is the whole user class, not an instance which is why you can't call profiles on it. try this: @user = current_user @profile = @user.profiles.find(params[:profile_id]) Edit 2: According to your original question: the problem is, I have put an edit link in application.rb <li><%= link_to "Profile".html_safe, edit_profile_path(current_user) %></li> but it is giving error Couldn't find Profile with id=10 so instead of searching for id=2, it is looking at user_id, how to fix

Categories : Ruby On Rails

Rails public profile creation and determining whether profile is public or not
How about this: User Model after_update :update_public_status! def update_public_status! required_fields_present = [ name, state, city, high_school, recruit_year, birthday, stat(:height), stat(:weight) ].all? if required_fields_present make_public! else make_private! end end def make_public! update_attribute :public, true update_attribute :removed_from_listing, false end def make_private! update_attribute :public, false update_attribute :removed_from_listing, true end

Categories : Ruby On Rails

Display LinkedIn profile photo and user profile using LinkedIn API
I found the solution for my question, it should change the LinkedIn API call to be: - (void)profileApiCall { // NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~"]; NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~:(id,first-name,last-name,industry,picture-url,location:(name),positions:(company:(name),title),specialties,date-of-birth,interests,languages)"]; OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL:url consumer:oAuthLoginView.consumer token:oAuthLoginView.accessToken callback:nil signatureProvider:nil]; NSLog(@"the request is %@",request); [request setValue:@"json" forHTTPHeaderField:@"

Categories : Objective C

Default Profile Image after delete current profile image in PHP
Have another table with fields userid, isset - ( with default value of 1 for all users) If user clicks the remove profile pic( wishes to have the default pic) , change the value in isset to 0 for the respective user. Check this table everytime before fetching the latest image from the profile pics table. Alternatively you can have the isset field in the profile pics table itself. This would require you to change the isset value of every occurrence of the user's profile pic if he wishes to have the default pic.

Categories : PHP

Redirecting standard input in Bash implies that Bash executes a default action?
exec 6<&0 0</tmp/lines.txt; exec 0<&6 6<&- Turns out that bash still executes what remains in the command specified or script before it reads input for commands again that's why your file /tmp/lines.txt is not read since exec 0<&6 6<&- is run before it. Please refer back to the previous solution if you want to execute commands in /tmp/lines.txt before exec 0<&6- is executed. Also it might have not been obvious but you could use . or source to achieve same output: . /tmp/lines.txt source /tmp/lines.txt

Categories : Bash

Why does the child of an eval call from bash get orphaned once the parent bash script dies?
This is normal and expected. You sent a signal (presumably SIGTERM) to parent-script and it died, but no signal was sent to another-script. It keeps on running. This is different than what happens when the parent-script job is running interactively on a terminal and you type ^C (or ^Z). In that case, a SIGINT signal is automatically sent to the whole foreground process group. Since another-script is un the same process group as parent-script (by default), they both get the signal and they both die. If you want another-script to die automatically when its parent dies in any other context than when it's a job running in a terminal with job control, you have a few options. parent-script can trap the SIGTERM signal. In the signal handler, it kills its child, and then exits itself. This, o

Categories : Linux

execute user inputed Windows (or bash) commands from batch (or bash) file?
Do you need a full bash prompt? Or would something like this be enough? #!/bin/bash echo -n "Enter cmd: " read COMMAND echo ${COMMAND} | bash Also, in a script, you can just execute bash and get a full prompt in the current environment.

Categories : Bash

Pass a full bash script line to another bash function to execute
optout is a command like any other, and so must be preceded by any local modifications to the environment. The command that optout runs will inherit that environment. CC=${BUILD_TOOL_CC} optout ./configure ${ZLIB_CONFIGURE_OPT} --prefix=${CURR_DIR}/${INSTALL_DIR} By the way, this is just one of the problems you are likely to encounter with your optout function. You cannot run arbitrary command lines in that fashion, only a simple command followed by zero or more arguments (and I would expect there are some exceptions to even that restricted set, as well).

Categories : Linux

Capture output of a bash command, parse it and store into different bash variables
You can use awk and bash arrays: arr=( $(awk -F ':' '$1 == "inet addr"{sub(/ .*/, "", $2); print $2}' < <(ifconfig)) ) Then you can do: read IPETH0 IPLO <<< ${arr[@]}

Categories : Linux

BASH: how to define an array as environment variable before calling a bash script
Incredibility weird.... I have never seen that before. It looks like the array is not passed to the subshell. One way around this is to source the script instead of executing it: declare -a MYARR=( 1 2 ); . ./myscript.sh

Categories : Arrays

Redirecting standard input in Bash implies that Bash exits
That makes bash read commands from /tmp/lines.txt redirecting its input in the process. There would no longer be any input to process after all those commands in the file so the shell just exits after it, just like executing a shell script. If you want to not let bash exit after the commands in /tmp/lines.txt were processed, make sure that you could put back its input like: exec 6<&0 < <(cat /tmp/lines.txt; echo; echo "exec <&6";) Which send both inputs of /tmp/lines.txt as commands and also exec <&6 that would put back input from &6 encapsulated by process substition. And a cleaner approach: exec 6<&0 < <(cat /tmp/lines.txt; echo; echo "exec <&- <&6 6<&-";) Or simply: exec 6<&0 < <(cat /tmp/lines.txt; e

Categories : Bash

BASH | Adding elements in all files of a specific directory bash
This can make it: for file in /your/dir/* do echo "<end>" >> "$file" done In case you have some dirs inside, you may get the error bash: XX: Is a directory. To avoid seeing them, you can add 2>/dev/null to the end of the echo command: echo "<end>" >> "$file" 2>/dev/null Or even better (thanks Barmar), check if they are files: [ -f "$file" ] && echo "<end>" >> "$file" Which is a short way of doing an if-condition: if [ -f "$file" ]; then echo "<end>" >> "$file" fi

Categories : Bash

Cygwin Installation: Package: bash; bash.sh exit code 1
The /dev directory is missing and cygwin fakes it, which makes it read-only. The following code: cd /etc/postinstall/ ./000-cygwin-post-install.sh.done ./bash.sh ... solved that error for me.

Categories : Bash

escaping bash 'test' keywork in a bash script
test is a Bash builtin command, not a keyword or reserved word. This means Bash will only interpret it if it is the first token in a command, like test blah In python manage.py test Bash will just pass it as a parameter to python (that is, it will execute python with two parameters, manage.py and test); you don't need to escape it. In general, Bash doesn't have reserved words in the sense of C-like languages. The only things you need to escape are whitespace (which Bash uses to separate params), and certain symbols including $(&|; which Bash uses for its variables and command separators.

Categories : Bash

'Globalize' Bash functions inside of a bash script
You can use this command in your startup.bash: source lib.bash the source command runs the file in the current shell environment, unlike using bash lib.bash (or . lib.bash) which creates a new, separate environment for that script (and only that script) and is why the function is not carried over. (source)

Categories : Linux

Can One Bash Script Launch Multiple Other Bash Scripts?
Run them in the background, just like you would in an interactive shell. command1 & command2 & command3 & wait # Wait for all background commands to finish The commands can be just about anything, not just other bash scripts.

Categories : Linux

BASH | How to get the number of fields of one line in bash (using cut ?)
You can say: $ echo "field1;field2;field3;field4;" | grep -o ";" | wc -l 4 Alternatively, $ tr -dc ';' <<< "field1;field2;field3;field4;" | wc -c 4 EDIT: In order to loop over the fields, you can say: $ IFS=';' read -ra field <<< "field1;field2;field3;field4;" $ for i in "${field[@]}"; do echo $i; done field1 field2 field3 field4

Categories : Linux

Run a bash including a variable in the "bash XXX.sh" command
You can take advantage of shell parameter expansion to smoothly read variables from the environment of the parent process, if it's that what you want to achieve. Look at the following script named test.sh: #!/bin/bash VARIABLE=${VARIABLE:="default value"} echo $VARIABLE If you start it with the line $ ./test.sh it outputs default value But if you invoke test.sh with the line $ VARIABLE="custom Value" ./test.sh it outputs custom value But make sure that the variable assignment is at the beginning of the line. Otherwise it is passed to test.sh as command line argument. The used form of parameter expansion ${parameter:=word} is described in the bash reference manual as: If parameter is unset or null, the expansion of word is assigned to parameter. The value of param

Categories : Bash

execl("/bin/bash","bash","-l","-c","env",NULL), what's wrong?
Edit note: This is a full rewrite of the original example code, since the OP posted the code and I realized it causes bash to block on standard output instead of input as I originally thought. The reason is bash output is redirected to a pipe, with nothing reading from the pipe until the child exits. Before you execl(), reopen STDIN_FILENO from /dev/null, and STDERR_FILENO to /dev/null. When STDOUT_FILENO (standard output) is redirected to a pipe, you cannot just wait() for the child to exit: you must actively read from the pipe while the child process runs. Consider this example program. It takes one command-line parameter, the user name. (Without any parameters or just -h or --help it outputs short usage information.) It obtains the struct passwd corresponding to that user name, creat

Categories : C

Force K2 registration and profile views to be used instead of the default registration and profile views?
I found the problem, finally! The /plugins/system/k2/k2.php was catching the onAfterDispatch method for the navigation of com_users. If it was com_users and register or profile then it redirected and leveraged a different view. Well, the problem was that the old code said com_user instead of com_users. Silly!

Categories : PHP

I have two table profile and profil_calculation. the profile table look like
it will be like this: SELECT pt.profile_id, pt.profile_name , pt.Profile_description, pd.calc_id , pd.proile_calc, pd.profile_result FROM profile_table as pt LEFT JOIN profile_description as pd ON pt.profile_id = pd.calc_id; or SELECT profile_table.profile_id, profile_table.profile_name , profile_table.Profile_description, profile_description.calc_id , profile_description.proile_calc, profile_description.profile_result FROM profile_table LEFT JOIN profile_description ON profile_table.profile_id = profile_description.calc_id;

Categories : PHP

BASH - If $TIME between 8am and 1pm do.., esle do.. Specifying time variables and if statements in BASH
In this case, you just need to look at the hour. Also, bash has syntax to specify the radix of a number, so you don't have to worry about 08 and 09 being invalid octal numbers: H=$(date +%H) if (( 8 <= 10#$H && 10#$H < 13 )); then echo between 8 and 1 elif (( 13 <= 10#$H && 10#$H < 23 )); then echo between 1 and 11 else echo go to bed fi "10#$H" is the contents of the variable, in base 10.

Categories : Mysql

bash script to write content into file. File content requires bash variables. How to do that?
You're actually deliberately turning off parameter subsitution by enclosing 'ENDFILECONTENT' in quotes. See this excerpt from example 19-7 of the advanced Bash scripting guide on Heredocs, slightly reformatted: # No parameter substitution when the "limit string" is quoted or escaped. # Either of the following at the head of the here document would have # the same effect. # # cat <<"Endofmessage" # cat <<Endofmessage Remove the single quotes around 'ENDFILECONTENT' and BASH will replace the variables as expected.

Categories : Bash

How to get twitter profile pic using api 1.1 from iOS?
Here is a solution using STTwitter: STTwitterAPI *twitter = [STTwitterAPI twitterAPIApplicationOnlyWithConsumerKey:@"" consumerSecret:@""]; [twitter verifyCredentialsWithSuccessBlock:^(NSString *bearerToken) { [twitter getUsersShowForUserID:nil orScreenName:@"barackobama" includeEntities:nil successBlock:^(NSDictionary *user) { NSString *profileImageURLString = [user valueForKey:@"profile_image_url"]; NSURL *url = [NSURL URLWithString:profileImageURLString]; UIImage *profileImage = [UIImage imageWithContentsOfURL:url]; } errorBlock:^(NSError *error) { // }]; } errorBlock:^(NSError *error) { // }];

Categories : Iphone

Why do I need to run `ssh-add` in my Powershell profile?
It's because your rsa key is not the default name ( id_rsa ) so you either need to use ssh-add (which adds it to a running service that remembers the key decrypted with your passphrase) or just add an entry into your ~.shhconfig ~.sshconfig (create or edit): Host github.com HostName github.com User git IdentityFile ~/.ssh/github_rsa Or, if github is the only thing you use ssh keys for, just rename the key to id_rsa and then git (well ssh.exe) will find it for you automatically AND poshgit will ssh-add it for you (to handle passphrases).

Categories : Powershell

Profile dependent web.xml
Somewhere in your web.xml you may have the following setting: <transport-guarantee>CONFIDENTIAL</transport-guarantee> If so then, you could use a property place holder for the transport guarantee property, and resource filter it during the build. Replace that line in your web.xml with something like: <transport-guarantee>${transport.guarantee}</transport-guarantee> You can assign the default value which can be "CONFIDENTIAL" to the property ${transport.guarantee} in the pom file or external properties file, and override this in a dev environment by giving a command line argument: mvn clean package -Dtransport.guarantee="NONE" If you are using maven war plugin, resource filtering can be enabled from within the pom file by: <configuration>

Categories : Maven

How to profile a dart app?
It has already been pointed out in the comments that there are ways to get a CPU profile from the VM on Linux (https://code.google.com/p/dart/wiki/Profiling). As far as I understand what you are really looking for is to get a heap or memory profile. While it is possible to print an object histogram when the program terminates (see below), we do not have any convenient way to get the object histogram while your server is running. We do hope to be able to add this capability over the next months. To print the object histogram when the Dart script exits, you should pass the flag --print_object_histogram to the Dart VM. This will print the averages of the live objects at the end of each major GC over the life of the program. This can be fine to get a quick overview, but is not ideal to trac

Categories : Dart

Encrypting mdm profile
I answered in comments on your previous question: "I would recommend to take a look on OS X Server MDM implementation. Generally speaking to encrypt profile, as I remember you should use PKCS7 wrapping. So, you should look at this: http://www.cs.berkeley.edu/~jonah/bc/org/bouncycastle/jce/PKCS7SignedData.html BTW. I would recommend to read up a little bit on cryptography, if you want to get general understanding. Very-very high level overview of your problem: you are trying to use RSA key directly to encrypt the data. However, it should be used to encrypt a symmetric key which in its turn is used to encrypt the data." You can also take a look here: PKCS#7 Encryption Your code won't work, because it's - not PKCS7 - you are trying to use MD5(public certificate key) which doesn't make

Categories : C#

Creating an AVD profile via ADB
To see all connected devices, you can type adb devices To get the serial number, you can type adb serialno Also, adb status-window opens a window with constant monitoring of the device More crazy: adb shell pm list features shows a list of features the device has adb shell pm list users shows a list of users the device has (needs root) You can't really get things like screen resolution etc through ADB unfortunately.

Categories : Android

How to make a profile like url ?
You can try this generator.This generator can help you.Simple and easy :) RewriteRule ^([^/]*)/([^/]*)$ /?username=$1&link=$2 [L] Link is name of page.For example:about,options etc.. If you want to acces about page of profile. website.com/?username=Beraki&link=about --> website.com/Beraki/about

Categories : PHP

iOS MDM Profile cannot be locked down?
That's specifically designed like it. Apple has this idea thata user should always decide what he/she wants. So, the user may enroll into MDM and unenroll from MDM any time. However, in the case, if you remove MDM profile you loose both restrictions and access to your enterprise data (your exchange profile will be removed, if it was installed through MDM. The same is true for VPN access, WiFi access and so on). It's described pretty well in MDM documentation. Generally speaking, they weren't good in supporting devices which belongs to enterprise and which suppose to be restricted all the time. Now, they are gradually move into this direction. BTW. Some new changes are coming in iOS 7 for supervised devices. I believe you may get what you are looking for. If you have an access to WWDC

Categories : IOS

Allow User to edit profile
The problem is, there is no exclude option in UpdateView You can define a form that excludes the fields class UserForm(forms.ModelForm): class Meta: model = User fields = ('username','email', 'password1', 'password2') # or #exclude = ('is_superuser',) #and whatever else you wish to exclude. and then use this form in your view class ProfileUpdate(UpdateView): model = User form_class = UserForm template_name = 'editprofile.html' def get_object(self, queryset=None): return self.request.user And refer to this documentation for validations, if needed

Categories : Django

How to allow users to update their profile?
You could first construct an object with the fields in your req, and then pass that object to the mongoose method: var userFields = {}; if (req.body.firstName) userFields.firstName = req.body.firstName.toLowerCase(); if (req.body.lastName) userFields.lastName = req.body.lastName.toLowerCase(); ...etc... User.findByAndUpdate(req.signedCookies.userid, userFields, function(err, user) { ... }); This also allows you to do some sanitization of the fields in your request before passing them on to the database.

Categories : Node Js

SimpleMembershipProvider in WebSite with Profile
Your web.config is configured to use the default providers instead of the SimpleMembership providers. Your web.config should look like this to use SimpleMembership. <roleManager enabled="true" defaultProvider="SimpleRoleProvider"> <providers> <clear/> <add name="SimpleRoleProvider" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData"/> </providers> </roleManager> <membership defaultProvider="SimpleMembershipProvider"> <providers> <clear/> <add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" /> </providers> </membership> SimpleMembership providers will not try to call the stored procedures used by the default providers. Also,

Categories : Asp Net

Anyone else having Provisioning Profile Problems in iOS?
So this problem just "went away." Apple did say they were having some problems, but the problem went away before I touched the Apple developer portal again, so not so sure. TestFlight said they made no changes, but more research and we discovered as issue which I believe wad theirs: Old devices still allowed the install, because they still contained old provisioning profiles from the same company (us) that covered more than one build. So any of those profiles already on the device, and the install worked fine. New installs were not installing the provisioning profile correctly for some reason, so the installs failed because there were no old profiles. In some cases, they appeared to install an old profile that did not have the new keys, and that failed too. We discovered that by inst

Categories : IOS



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