Check | Code | Description |
Is Null | if(variable is null) return true; |
|
Is Not Null | if(variable is { }) return false |
|
Is Not Null | if(variable is object) return false |
|
Is Null | if(variable == null) return true |
|
Is Not Null | if(variable != null) return false |
|
مرجع تمام نمودارهای UML
چگونه کوئری های SQL بهتری بنویسیم؟
SQL is far from dead: it’s one of the most in-demand skills that you find in job descriptions from the data science industry, whether you’re applying for a data analyst, a data engineer, a data scientist or any other roles. This is confirmed by 70% of the respondents of the 2016 O’Reilly Data Science Salary Survey, who indicate that they use SQL in their professional context.
Observable collection در WPF را میتوان نوعی لیست جنریک ویژه تعریف کرد که زمانیکه به کنترلی بایند شد، کنترل را از تغییرات خودش آگاه میکند. برای مثال اگر آیتمی به این لیست اضافه شد بلافاصله آن آیتم را در کنترل مقید به آن نیز خواهید دید، به همین ترتیب در مورد ویرایش و یا حذف یک آیتم، بدون نیاز به کوچکترین تماسی با کنترل مورد نظر. برای مثال اگر مقدار یک خاصیت را تغییر دادید، بلافاصله بدون اینکه به کنترل مقید به آن اعلام کنیم که لطفا این مورد ویژه را برای من تغییر بده، شاهد نتیجهی نهایی خواهیم بود.
اما استفادهی پیشرفته از این لیست جنریک ویژه به همینجا ختم نشده و حین اضافه کردن کمی پیچیدگی به برنامه مشکلات عدیدهای بروز میکنند که آنها را جهت دسترسی سادهی بعدی در زیر لیست میکنم:
الف) اصلا Observable collection چیست؟ چکار میکند؟
List vs ObservableCollection vs INotifyPropertyChanged in Silverlight
ب) نمیتوانم از این مجموعهی اشیای خودآگاه سازنده در یک ترد استفاده کنم. مشکل کجاست؟
این روزها نمیتوان یک برنامهی دسکتاپ خوب را بدون استفاده از تردها متصور شد. اما به محض سعی در به روز رسانی این لیست جنریک در یک ترد دیگر (ترد دیگر منظور هر تردی بجز ترد اصلی برنامه است که کار مدیریت رابط کاربر را به عهده دارد) خطای زیر ظاهر میشود:
راه حل:
Adding to an ObservableCollection from a background thread
ج) یکی از خاصیتهای یک شیء این لیست جنریک ویژه را تغییر دادهام. اما هیچ تغییری در کنترل بایند شده به آن مشاهده نمیکنم. مشکل در کجاست؟
راه حل: پیاده سازی اینترفیس INotifyPropertyChanged را فراموش کردهاید:
Data Binding in WPF with the Monostate Pattern
د) خوب، این که خیلی دردسر دارد! راه سادهتری برای تعریف این موارد نیست؟!
هوشمندانهترین روشی که برای حل این مساله تابحال دیدهام:
An easier way to manage INotifyPropertyChanged
ه) زمانیکه این یک لیست جنریک خودآگاه سازنده را به یک مثلا listview بایند میکنم، دیگر نمیتوانم با استفاده از متد clear items آن کنترل، نسبت به خالی کردن نمای ظاهری آن اقدام کنم. چکار باید کرد؟
خطای مشاهده شده:
راه حل:
همان Observable collection اصلی را تخلیه کنید، UI به صورت خودکار به روز خواهد شد.
و) اضافه کردن رنجی از اطلاعات به آن به صورتی یکباره ممکن است کند باشد. چه باید کرد؟
راه حل:
AddRange for ObservableCollection in Silverlight 3
پایتون و بانکهای اطلاعاتی غیرهمزمان
انواع بانکهای اطلاعاتی NoSQL
کتابخانه loadCSS
A function for loading CSS asynchronously
Why loadCSS?
Referencing CSS stylesheets with link[rel=stylesheet]
or @import
causes browsers to delay page rendering while a stylesheet loads. When loading stylesheets that are not critical to the initial rendering of a page, this blocking behavior is undesirable. The new <link rel="preload">
standard enables us to load stylesheets asynchronously, without blocking rendering, and loadCSS provides a JavaScript polyfill for that feature to allow it to work across browsers. Additionally, loadCSS offers a separate (and optional) JavaScript function for loading stylesheets dynamically.
npm install fg-loadcss --save
Protocol Buffers are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more, originally designed at Google (see).
protobuf.js is a pure JavaScript implementation with TypeScript support for node.js and the browser. It's easy to use, blazingly fast and works out of the box with .proto files!