The view of the profile page.
492921
def my_profile_view(request):
    '''  '''
    page_name = "Profile Page"
    if request.user.username == ANONYMOUS_USERNAME:
        return red_home(request, MESSAGES['SPINELESS'])
    userProfile = UserProfile.objects.get(user=request.user)
    change_password_form = PasswordChangeForm(
        request.user,
        request.POST if "submit_password_form" in request.POST else None,
        )
    update_email_form = UpdateEmailForm(
        request.POST if "submit_profile_form" in request.POST else None,
        instance=request.user,
        prefix="user",
        )
    update_profile_form = UpdateProfileForm(
        request.POST if "submit_profile_form" in request.POST else None,
        instance=userProfile,
        prefix="profile",
        )
    if change_password_form.is_valid():
        change_password_form.save()
        messages.add_message(request, messages.SUCCESS,
                             "Your password was successfully changed.")
        return HttpResponseRedirect(reverse('my_profile'))
    if update_email_form.is_valid() and update_profile_form.is_valid():
        update_email_form.save()
        update_profile_form.save()
        messages.add_message(request, messages.SUCCESS,
                             "Your profile has been successfully updated.")
        return HttpResponseRedirect(reverse('my_profile'))
    return render_to_response('my_profile.html', {
        'page_name': page_name,
        "update_email_form": update_email_form,
        'update_profile_form': update_profile_form,
        'change_password_form': change_password_form,
        }, context_instance=RequestContext(request))
1227490
def member_profile_view(request, targetUsername):
    '''  '''
    if targetUsername == request.user.username and targetUsername != ANONYMOUS_USERNAME:
        return HttpResponseRedirect(reverse('my_profile'))
    page_name = "{0}'s Profile".format(targetUsername)
    targetUser = get_object_or_404(User, username=targetUsername)
    targetProfile = get_object_or_404(UserProfile, user=targetUser)
    number_of_threads = Thread.objects.filter(owner=targetProfile).count()
    number_of_messages = Message.objects.filter(owner=targetProfile).count()
    number_of_requests = Request.objects.filter(owner=targetProfile).count()
    rooms = Room.objects.filter(current_residents=targetProfile)
    prev_rooms = PreviousResident.objects.filter(resident=targetProfile)
    return render_to_response('member_profile.html', {
        'page_name': page_name,
        'targetUser': targetUser,
        'targetProfile': targetProfile,
        'number_of_threads': number_of_threads,
        'number_of_messages': number_of_messages,
        'number_of_requests': number_of_requests,
        "rooms": rooms,
        "prev_rooms": prev_rooms,
        }, context_instance=RequestContext(request))
679927
public void _showProfile() {
		System.out.println("availableProcessors=" + Runtime.getRuntime().availableProcessors() + " free memory=" + getMegaBytes(Runtime.getRuntime().freeMemory()));
		System.out.println(
				"worker blockSize=" + getMegaBytes(blockSize) + " " +
						"worker buffer Size=" + getMegaBytes(bufferSizePerWorker) + ", " +
						"max num of thread=" + maxNumOfThreads + ", " +
						"sub buffer size=" + subBufferSize + "(B)" + ", " +
						"sub thread size=" + subThreadSize + ", "
				);

		System.out.println("possible max thread=" + maxNumOfThreads * subThreadSize + " " +
				"possible max memory=" + getMegaBytes(bufferSizePerWorker * maxNumOfThreads + (subBufferSize * subThreadSize))
				);
	}
1051527
def profile():
    """"""
    # Create forms
    verification_form = VerificationForm(formdata=None, prefix="verification")
    profile_form = profile_form_factory()

    # Process forms
    form = request.form.get('submit', None)
    if form == 'profile':
        handle_profile_form(profile_form)
    elif form == 'verification':
        handle_verification_form(verification_form)

    return render_template(
        current_app.config['USERPROFILES_PROFILE_TEMPLATE'],
        profile_form=profile_form,
        verification_form=verification_form,)
593011
public function uploadProfilePicture()
    {
        // If no file was uploaded, do nothing
        if (null === $this->getProfilePictureFile())
        {
            return;
        }

        $file = $this->getProfilePictureFile();

        $image = Image::createFromUploadedFile($file);
        $file->move($image->getUploadDir(), $image->getFilename());

        $this->setProfilePicture($image);

        // Clean up $profilePictureFile since we won't need it any more
        $this->profilePictureFile = null;
    }
474918
def profile(self):
        
        if self._profile is None:
            self._profile = self.build_profile()
        return self._profile
18295
public function profileShow()
    {
        if (!$this->isAuthenticated()) {
            return $this->redirect('/login');
        }

        $userModel = $this->session()->get('user');
        return $this->twig()->render('User\profile.twig', array('user' => $userModel));
    }
158791
public function profile()
    {
        $formsProfile = $this->_getUser()->getForm('profile');

        if ($formsProfile->execute()) {
            $redirect = $this->getRequest()->query->get(
                'redirect',
                $this->getModelManager()->getProfileURL()
            );
            $this->flashRedirect(
                $this->getModelManager()->getMessage('profile.success'),
                $redirect
            );
        }
        $this->forms['profile'] = $formsProfile;
        $this->setLoginMeta('profile');
    }
1356142
public function viewPage()
    {
        $page = isset($_GET['sub']) ? (string)$_GET['sub'] : self::DEFAULT_SUB_PAGE;
        View::page('admin/' . $page);
    }
867966
function redrawProfilerCanvas() {
			updateProfilerConfig();
			var width;
			var height;
			s.height = s.fontSize * 3 + s.padding * 2;
			if (s.align === "vertical") {
				width = s.width;
				height = (s.height + s.margin) * Object.keys(profilerData).length - s.margin;
			} else {
				width = (s.width + s.margin) * Object.keys(profilerData).length - s.margin;
				height = s.height;
			}
			profilerCanvas.width = width;
			profilerCanvas.height = height;
			if (s.expand) {
				profilerCanvas.style.width = width * 1.5 + "px";
				profilerCanvas.style.height = height * 1.5 + "px";
			} else {
				profilerCanvas.style.width = width + "px";
				profilerCanvas.style.height = height + "px";
			}
			profilerCanvasContext.font = s.fontSize + "px sans-serif";
		}
979319
def user_view_prj(self, ):
        
        i = self.user_prj_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            prj = item.internal_data()
            self.view_prj(prj)
172485
public function actionProfile()
    {
        $user = $this->findModel(Yii::$app->user->id);
        if (empty($user)) {
            return $this->goBack();
        }
        $configProfileForm = [
            'user' => $user,
        ];
        $model = $this->module->model('ProfileForm', [$configProfileForm]);

        $post = Yii::$app->request->post();
        $loaded = $model->load($post);
        if ($loaded) {
            $saved = $model->save($isNewRecord = false);
            if ($saved !== false) {
                $msg = ($saved === 0) ? Yii::t($this->tcModule, 'Profile not change.')
                                      : Yii::t($this->tcModule, 'Profile modified.');
                Yii::$app->session->setFlash('success', $msg);
                return $this->goHome();
            }
        }
        return $this->render('profile-form', [
            'model' => $model,
        ]);
    }
885876
public function getProfilePictureAction()
    {
        $melisCoreAuth = $this->serviceLocator->get('MelisCoreAuth');
        $moduleSvc = $this->getServiceLocator()->get('ModulesService');
        $user = $melisCoreAuth->getIdentity();
        $imageDefault = $moduleSvc->getModulePath('MelisCore') . '/public/images/profile/default_picture.jpg';

        if (!empty($user) && !empty($user->usr_image)) {
            $image = $user->usr_image;
        } else {
            $image = file_get_contents($imageDefault);
        }

        $response = $this->getResponse();

        $response->setContent($image);
        $response->getHeaders()
            ->addHeaderLine('Content-Transfer-Encoding', 'binary')
            ->addHeaderLine('Content-Type', 'image/jpg');

        return $response;
    }
1214174
public function view()
    {
        $this->set('title', $this->title);
        $this->set('buttonText', $this->buttonText);
        $this->set('baseSearchPath', $this->baseSearchPath);
        $this->set('postTo_cID', $this->postTo_cID);

        if ((string) $this->resultsURL !== '') {
            $resultsPage = null;
            $resultsURL = $this->resultsURL;
        } else {
            $resultsPage = $this->postTo_cID ? Page::getById($this->postTo_cID) : null;
            if (is_object($resultsPage) && !$resultsPage->isError()) {
                $resultsURL = $resultsPage->getCollectionPath();
            } else {
                $resultsPage = null;
                $c = Page::getCurrentPage();
                $resultsURL = $c->getCollectionPath();
            }
        }

        $resultsURL = $this->app->make('helper/text')->encodePath($resultsURL);

        $this->set('resultTargetURL', $resultsURL);
        if ($resultsPage !== null) {
            $this->set('resultTarget', $resultsPage);
        } else {
            $this->set('resultTarget', $resultsURL);
        }

        //run query if display results elsewhere not set, or the cID of this page is set
        if ($resultsPage === null && (string) $this->resultsURL === '') {
            if ((string) $this->request->request('query') !== '' || $this->request->request('akID') || $this->request->request('month')) {
                $this->do_search();
            }
        }
    }
175597
@RequestMapping(value = "/profiles", method = RequestMethod.GET)
    public String list(Model model) {
        Profile profiles = new Profile();
        model.addAttribute("addNewProfile", profiles);
        model.addAttribute("version", Constants.VERSION);
        logger.info("Loading initial page");

        return "profiles";
    }
79849
public function index()
    {
        $this->paginate = [
            'contain' => ['Users']
        ];
        $profiles = $this->paginate($this->Profiles);

        $this->set(compact('profiles'));
        $this->set('_serialize', ['profiles']);
    }
1112885
public function actionProfile()
    {
        /** @var User $user */
        $user = Yii::$app->getUser()->getIdentity();
        $model = new MultiModel([
            'models' => [
                'user' => $user,
                'profile' => $user->profile,
            ],
        ]);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->addFlash('success', Yii::t('maddoger/user', 'Changes have been saved.'));
            return $this->refresh();
        } else {
            return $this->render('profile', [
                'model' => $model,
            ]);
        }
    }