بررسی Bad code smell ها: کلاس بزرگ
کتاب رایگان Java Succinctly Part 1
Java is a high-level, cross-platform, object-oriented programming language that allows applications to be written once and run on a multitude of different devices. Java applications are ubiquitous, and the language is consistently ranked as one of the most popular and dominant in the world. Christopher Rose’s Java Succinctly Part 1 describes the foundations of Java–from printing a line of text to the console, to inheritance hierarchies in object-oriented programming. The e-book covers practical aspects of programming, such as debugging and using an IDE, as well as the core mechanics of the language.
- Introduction
- Getting Started
- Writing Output
- Reading Input
- Data Types and Variables
- Operators and Expressions
- Control Structures
- Object-Oriented Programming
- Example Programs and Conclusion
کمک به مرورگر، در جهت تمایز بین صفحات ورود و ثبت نام
مرورگرهای جدید قادرند برای صفحهی لاگین، پر کردن خودکار فیلدهای نام کاربری و کلمهی عبور و برای صفحهی ثبت نام، تولید خودکار کلمات عبور قوی، به همراه بهخاطر سپاری آنرا ارائه دهند. برای فعال سازی یک چنین قابلیتهای ویژهای، نیاز است تا یک سری ویژگی را به فیلدهای ورود کلمات عبور اضافه کرد:
الف) نیاز است autocomplete را به نحو صحیحی مقدار دهی کرد:
- اگر مقدار آن مساوی new-password درنظر گرفته شود، یعنی صفحهی جاری، صفحهی ثبت نام است و نیاز است تا تولید کنندهی خودکار کلمات عبور مرورگر و بخاطر سپاری آن فعال شوند.
- اگر مقدار آن مساوی current-password درنظر گرفته شود، یعنی صفحهی جاری، صفحهی لاگین است و کاربر نیاز دارد تا کلمهی عبوری را که پیشتر در حین ثبت نام و یا حتی لاگین موفق قبلی وارد کردهاست، بتواند به سادگی از طریق password manager مرورگر دریافت کند.
ب) بنابراین تا اینجا روش تمایز بین فیلدهای پسورد صفحات لاگین و ثبت نام مشخص شد. اما در مورد نام کاربری چطور؟
برای این حالت فقط کافی است مقدار autocomplete را به username تنظیم کرد تا مرورگر بداند که چگونه باید اطلاعات password manager خودش را به صورت خودکار تامین کند. البته "autocomplete="username در اصل برای معرفی ایمیلها طراحی شدهاست، اما در استفادههای برنامههای کاربردی ما، جهت معرفی مقدار نام کاربری که کاربر قرار است توسط آن به برنامه وارد شود، کفایت میکند.
سفارشی سازی تولید کنندهی خودکار کلمات عبور مرورگر
عنوان شد که اگر مقدار autocomplete در صفحات ثبت نام، به مقدار new-password تنظیم شود، یک چنین فیلد ورودی به صورت خودکار به همراه قابلیت ویژهی «تولید کنندهی خودکار کلمات عبور مرورگر» نیز خواهد بود. میتوان این ابزار توکار مرورگرها را نیز سفارشی سازی کرد و بر روی نحوهی تولید کلمات عبور آن تاثیر گذاشت:
<input type="password" autocomplete="new-password" passwordrules="required: upper; required: lower; required: digit; minlength: 25; allowed: [-().&@?'#,/"+]; max-consecutive: 2">
- کلمهی عبور تولیدی توسط مرورگر باید حداقل به همراه یک عدد، یک حرف بزرگ و یک حرف کوچک باشد.
- حداقل 25 حرف باشد.
- استفادهی از حروف ویژهی -().&@?'#,/"+ در آن مجاز است.
- حداکثر تعداد حروف مشابه متوالی آن باید 2 حرف باشد.
نیاز به خاموش کردن تصحیحهای هوشمند مرورگرها
مرورگرها میتوانند برای مثال حروف ابتدای عبارت وارد شده را به صورت خودکار تبدیل به کلمات بزرگ کنند و یا حتی با استفاده از واژه نامهها، اطلاعات ورودی را تصحیح کنند. یک چنین قابلیتی نباید برای فلیدهای کلمات عبور فعال باشد. به همین جهت ضروری است این فلیدها با ویژگیهای "autocapitalize="off و "autocorrect="off مزین شوند.
کمک به مرورگرها در جهت تعویض کلمات عبور ضعیف و فاش شده!
برای نمونه مرورگر کروم به همراه قسمتی است که بر اساس password manager توکار خودش و اطلاعات فاش شدهی بر روی اینترنت، عنوان میکند که کدامیک از کلمات عبور شما دیگر امن نیستند و بهتر است آنها را عوض کنید. این صفحه را میتوانید در آدرس ویژهی chrome://settings/passwords مرورگر کروم مشاهده کنید.
نکتهی مهم اینجا است که این مرورگر، دکمهی Change password و لینکی را نیز به سایت و برنامهی مدنظر، برای تعویض کلمهی عبور ارائه میدهد و این لینک، قالب ثابت و ویژهای دارد: https://example.com/.well-known/change-password
یعنی هموار کاربر را به آدرس ثابت well-known/change-password. در سایت شما هدایت میکند و در این حالت بهتر است یک route ویژهی خاص آنرا تعریف کرده و کاربر را به صورت خودکار به صفحهی اصلی تعویض کلمهی عبور، برای مثال به آدرس فرضی https://example.com/settings/change-password به صورت خودکار هدایت کنید.
یک نمونه مثال این هدایت خودکار در یک برنامهی ASP.NET Core به صورت زیر است:
app.UseEndpoints(endpoints => { // TODO: Add it to your app! // Improves chrome://settings/passwords page by managing `Change password` button next to a password. endpoints.MapGet("/.well-known/change-password", context => { // `/.well-known/change-password` address will be called by the `Change password` button of the Chrome. // Now our Web-API app redirects the user to the `/change-password` address of the App. context.Response.Redirect("/change-password", true); return Task.CompletedTask; }); endpoints.MapRazorPages(); // ... });
کتابخانه instafetch
If you use the Instagram API to make a call, you will only get 33 results back, no matter what you specify in the count paramter. Instafetch will help you fetch more media than the limit imposes, in exchange for more API calls, which can count against your hourly limit. Demo
Today we have several releases to talk about: there’s the release of Visual Studio 2017 version 15.3, the release of .NET Core 2.0, and a release of Visual Studio for Mac version 7.1. We’ll talk about them briefly in that order, but as always, there’s a lot more information in the release notes for each product. If you’d like to jump right in, download Visual Studio 2017 version 15.3, download .NET Core 2.0, and download Visual Studio for Mac.
<div id="s4-ribbonrow">
<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="AddDelPrivateWebParts">
و تگ پایانی آن :
نکته مهم در استفاده از این تگ ، ویژگی Permissions آن است که باید با دقت و بسته به نیاز شما تعریف شود :
برخی از این موارد عبارتند از :
EmptyMask – Has no permissions on the Web site. Not available through the user interface.
ViewListItems – View items in lists, documents in document libraries, and view Web discussion comments.
AddListItems – Add items to lists, add documents to document libraries, and add Web discussion comments.
EditListItems – Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.
DeleteListItems – Delete items from a list, documents from a document library, and Web discussion comments in documents.
ApproveItems – Approve a minor version of a list item or document.
OpenItems – View the source of documents with server-side file handlers.
ViewVersions – View past versions of a list item or document.
DeleteVersions – Delete past versions of a list item or document.
CancelCheckout – Discard or check in a document which is checked out to another user.
ManagePersonalViews – Create, change, and delete personal views of lists.
ManageLists – Create and delete lists, add or remove columns in a list, and add or remove public views of a list.
ViewFormPages – View forms, views, and application pages, and enumerate lists.
Open – Allow users to open a Web site, list, or folder to access items inside that container.
ViewPages – View pages in a Web site.
AddAndCustomizePages – Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a SharePoint Foundation–compatible editor.
ApplyThemeAndBorder – Apply a theme or borders to the entire Web site.
ApplyStyleSheets – Apply a style sheet (.css file) to the Web site.
ViewUsageData – View reports on Web site usage.
CreateSSCSite – Create a Web site using Self-Service Site Creation.
ManageSubwebs – Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.
CreateGroups – Create a group of users that can be used anywhere within the site collection.
ManagePermissions – Create and change permission levels on the Web site and assign permissions to users and groups.
BrowseDirectories – Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.
BrowseUserInfo – View information about users of the Web site.
AddDelPrivateWebParts – Add or remove personal Web Parts on a Web Part Page.
UpdatePersonalWebParts – Update Web Parts to display personalized information.
ManageWeb – Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the Site Collection Features page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator.
UseClientIntegration – Use features that launch client applications; otherwise, users must work on documents locally and upload changes.
UseRemoteAPIs – Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.
ManageAlerts – Manage alerts for all users of the Web site.
CreateAlerts – Create e-mail alerts.
EditMyUserInfo – Allows a user to change his or her user information, such as adding a picture.
EnumeratePermissions – Enumerate permissions on the Web site, list, folder, document, or list item.
FullMask – Has all permissions on the Web site. Not available through the user interface.
حال خارج از تگهای SPSecurityTrimmedControl در ابتدا یا انتها ، باید تگ login را مانند زیر به آن اضافه کرد .
و تمام :
نصب Mono Develop 4.x در Ubuntu
اگر یک برنامه جدید را در monodevelop شروع کردید و به خطای کامپایل ذیل برخوردید:
Error: A dependency of a referenced assembly may be missing, or you may be referencing an assembly created with a newer CLR version. See the compilation output for more details. (Test1)
export PATH=/opt/mono-3/bin:$PATH export PKG_CONFIG_PATH=/opt/mono-3/lib/pkgconfig:$PKG_CONFIG_PATH mono -V