#Interface method implementation C 8.0
Explore tagged Tumblr posts
dotnetcrunch-blog · 8 years ago
Text
Interface Method Implementation C# 8.0
Interface Method Implementation C# 8.0
In our previous post, we have tried to provide an overview of first four features of C# 8.0 which has been announced by Microsoft recently.
In this post, we will explain one of those four features in detail which is Default Interface.
This feature will allow interfaces to fully define methods just like abstract classes. However, interfaces will still not be able to declare constructors or fields.
View On WordPress
0 notes
globalmediacampaign · 5 years ago
Text
Interesting MySQL bugs
I like bugs.  Probably not as much as Valerii Kravchuk (http://mysqlentomologist.blogspot.com/) a former colleague of mine who posted about MySQL bugs for a long time, but I still like bugs.  I like finding bugs, I like fixing bugs, and I like analyzing bugs.   While I work on the WARP storage engine, I am filing bugs and feature requests for issues I find with MySQL.  I also like to comment on MySQL bugs in the bug database to help the MySQL engineers find root causes, and to help end users with workarounds, or explaining misconceptions as to why something may not be a bug.  So here are a few interesting bugs I have encountered recently. Optimizer gives bad estimates for ICP query plans resulting in FTS:https://bugs.mysql.com/bug.php?id=100471 MySQL appears to provide estimates for ICP access that stop at the first range scan in an index, and does not consider that ICP will (likely) return less rows to the storage engine for evaluation due to ICP.  ICP prevents the database from having to fetch the entire row by primary key and evaluate the condition at the SQL layer.  So if ICP can reduce the number of rows evaluated (or pushed up as it were) to the SQL layer, it will speed up the query quite a bit.  MySQL will switch to a full table scan (FTS) if a certain threshold of rows are expected to be seen by the SQL layer, because scanning the table is generally faster than too many O(log(n)) operations to fetch the data by primary key.  In the query/data for the bug, MySQL optimizer thinks that 30% or more of the table will be evaluated at the SQL layer, so it decides to do FTS, when in reality, with ICP, only 2% of the values will be evaluated and it is definitely faster (by 6x) to choose to use the index with ICP.  FORCE INDEX can be used to ensure the database uses ICP. ECP does not provide a way to feed into SQL join cost evaluationshttps://bugs.mysql.com/bug.php?id=100485This bug is similar to the above bug, but instead of not getting proper estimates for ICP, this bug involves not getting proper estimates for ECP, actually not getting estimates AT ALL.  If ECP filters a table to a small number of rows, MySQL will not join the tables in the order for best performance, because table scan cost (and ECP filters table scans) is set BEFORE ECP evaluates conditions, and there is no mechanism to feed the cost back into the plan and reorder tables appropriately.  WARP is highly dependent on ECP and thus query plans may end up being bad on WARP unless the STRAIGHT_JOIN hint is used to force table join order.  This is of course inconvenient.  I will be implementing a fix for this in WarpSQL and will submit the fix to Oracle who may or may not decide to use my fix.  If they don't I will have to update WarpSQL to use their method once they release it, but who knows when that will be.  Many "performance" bugs stay open for a very long time and are never fixed. Row comparators on string columns are much slower with IN than constructing complex WHERE clauseshttps://bugs.mysql.com/bug.php?id=100479This is an interesting one.  MySQL supports using "row comparisons" for IN expressions.  This is where you say "select * from table where (a,b) in (1,1)" instead of "select * from table where a=1 and b=1.  Unfortunately, internally MySQL does not handle these two evaluations in the same way.  It seems that a Field_Item is constructed for the second version, and that compares strings efficiently, but for the row comparator, a different function called Field::cmp is called on each field of the table, and this appears to copy the data from the row constructor (and maybe the field?  I haven't looked at the source) to do the comparison.  The row comparator is MUCH slower because of this.  The temporary workaround is to use latin1 instead of utf8mb4 for the fields, so long as of course the fields do not actually contain utf8 data.  I used the 'perf' tool on Linux to determine what the problem is.  Perf is one of my favorite tools, and I use it a lot when I am trying to figure out why something that is CPU bound is slow. MySQL does not report a table has a discarded tablespace for all querieshttps://bugs.mysql.com/bug.php?id=100453It's not a bug, it is a feature!  In this case this is true.  The MySQL storage engine interface scans whatever data the database asks it to scan, and the SQL layer filters out rows that do not match the scan (the exceptions are ICP and ECP of course).  When an "impossible WHERE clause" is detected like 1=0 or WHERE NULL or WHERE 0, then MySQL doesn't try to scan any rows, because if it did, the storage engine would have to return all the rows and MySQL would filter them out.  This means that InnoDB (or any other storage engine) never tries to scan a table upon which an impossible WHERE clause has been placed.  Since InnoDB detects the tablespace is missing when it tries to scan the table, no error is returned if a query uses an impossible WHERE clause on an empty table.  Note that LIMIT 0 is essentially the same.  If LIMIT 0 is specified in a query MySQL will read no rows, but it is an easy way to copy table structure to an empty table without using CREATE TABLE LIKE if the copy of the table doesn't need the indexes, constraints, etc, of the original table. SQL_MODE=ONLY_FULL_GROUP_BY doesn't return error when column is not in GROUP BYhttps://bugs.mysql.com/bug.php?id=100395Interestingly this bug is reported because ClickHouse reports an exception with GROUP BY attributes but MySQL doesn't, and the user thinks ClickHouse is right.  But in reality, MySQL is smarter than ClickHouse and detects a functional dependency in the query https://dev.mysql.com/doc/refman/5.7/en/group-by-functional-dependence.html and returns correct results, and ClickHouse actually wrongly reports an error, so it is a bug in ClickHouse (or a limitation) and not a problem with MySQL at all.  So again, this bug is not a bug. Wrong results with COUNT(DISTINCT ...) over multiple expressionshttps://bugs.mysql.com/bug.php?id=100504I haven't analyzed this bug deeply, but it appears to be a problem with BIT columns, which are not used much in MySQL when used with COUNT(DISTINCT ...) over more than one expression (or column) something else that I don't see much utilization of, in fact, I kind of forgot that you can use COUNT(DISTINCT) in that way, and I thought I was good at SQL :) Skip scan can return wrong results (empty set)https://bugs.mysql.com/bug.php?id=100253MySQL 8.0 can now do skip scans for some queries.  Skip scans allow MySQL to utilize a multi-column index even when the prefix on the index is not specified in a query.  That is, if index (a,b,c) exists on a table and there WHERE clause uses that index as a covering index, and the WHERE clause specifies b=X, then MySQL will still be able to use the index to get results faster than scanning the table.  But there appears to be a row visibility problem with skip scan after DELETE is executed against the table, and the query returns empty results.  That is all for now about MySQL bugs.  I will post now and then about bugs I find interesting and bugs I find while working on WARP.  I hope you enjoyed.  If you would like to support WarpSQL and WARP engine development, need consulting help, or just want to support me in my quest to make MySQL 8 an even better database than it already is, please consider becoming a patron.   http://patreon.com/warpsql https://swanhart.livejournal.com/143619.html
0 notes
infotainmentplus-blog · 7 years ago
Photo
Tumblr media
Honor View 10 vs OnePlus 5T: Flagship Killer Dethroned? Ever since the original OnePlus One, OnePlus has dominated the affordable flagship space. But Huawei’s sub-brand Honor has gained a lot of traction over the last few years with a series of successful devices covering a wide array of price points. Honor’s latest View 10 smartphone leaps into the affordable flagship space and looks to go head-to-head with the OnePlus 5T. Let’s find out how well it can stack up to the long time champion. Design Taking a look at these two devices from the outside, the Honor View 10 and OnePlus 5T have very similar approaches with their designs. It isn’t hard to tell where they both got their inspiration from but they’re very attractive and solidly constructed smartphones regardless. The Honor View 10 and OnePlus 5T feature all metal bodies, smooth finishes, rounded corners and identically placed plastic antenna lines. It isn't hard to tell where they got their design inspiration from but they're still attractive and solidly constructed The only major difference to their designs is the Honor View 10 features a completely flat back while OnePlus opted for a more pebble like shape with a curved backside for the 5T. The Honor View 10 and OnePlus 5T feel very premium in the hand but the 5T’s heavier use of curves does allow it to feel slightly more comfortable and ergonomic and the way the back tapers down on the edges makes the phone feel thinner than it actually is. Button and port placement between the two are also fairly similar. Power and volume keys can be found on either the left or right sides with the majority of the I/O such as the 3.5 mm headphone jack, USB Type-C port, and single speaker all sitting on the bottom. While the design of the View 10 and 5T aren’t necessarily the most exciting or unique, it doesn’t take away the fact that they’re functional and aesthetically pleasing. Display On the front side, the View 10 and 5T are fitted with large 18:9 displays and an almost bezel-less appearance. The View 10’s display measures in at 5.99 inches with a resolution of 2,160 x 1,080 or Full HD+. The 5T’s display is only a hair larger at 6.01 inches with the same 2,160 x 1,080 resolution. Both devices maintain a symmetrical appearance with very thin side bezels and minimal top and bottom bezels surrounding the displays. The main differentiator is the display technologies used between the two. The View 10 is using an IPS LCD panel while the 5T is an AMOLED display. But if no one told you, you might be hard pressed to tell that the View 10’s display wasn’t AMOLED as it’s incredibly vibrant with fantastic viewing angles. Editor's Pick Honor 9 Lite review: four lenses on a budget Honor launched the Honor 7X and Honor View 10 in December, and just when the two devices started to trickle into stores in various markets across the globe, we saw the company launch another mid-range … The 5T obviously wins when it comes to black levels and contrast but the View 10 is surprisingly not far behind despite its LCD technology. In every day use both of these panels offer an incredible viewing experience and for 1080p panels they are easily some of the best on the market. Performance Under the hood the Honor View 10 is utilizing Huawei’s powerful in-house chipset, the Kirin 970 with 6 GB of RAM and 128 GB of internal storage. The OnePlus 5T has the more typical flagship processor with the Qualcomm Snapdragon 835 and comes in either 6 or 8 GB of RAM variants depending on storage. With powerful processors inside and memory aplenty, everyday performance is a non-issue With powerful processors inside both smartphones and memory aplenty, everyday performance is a non-issue as the View 10 and 5T offer very fluid experiences. Whether you’re just swiping through the interface, opening up apps, web browsing, multitasking, or playing games, the View 10 and 5T never struggle to keep up with demand. What makes the View 10’s performance package a little more special is its NPU or neural processing unit. This provides for faster image processing and recognition, better performance with AI related apps, better battery life, and will supposedly help with degradation of performance over time. Naturally, we’ll have to wait and see how well the View 10 holds up in the long run. Hardware Hardware on the Honor View 10 and OnePlus 5T is a fairly standard affair but the extra bells and whistles found on more expensive flagships such as wireless charging or water and dust resistance is not available on either device. Both devices are dual SIM capable with the Honor View 10’s secondary slim slot also doubling as a microSD card slot for expandable storage. The OnePlus 5T does not offer expandable storage but the 64 and 128 GB storage options should be enough to satisfy most users. Another feature that the Honor View 10 offers that the 5T doesn’t is the inclusion of an IR blaster. While this feature has waned in popularity on smartphones over the years, it is nice to have if you enjoy using your smartphone as a universal remote. Editor's Pick OnePlus 5T Lava Red Edition comes to North America and Europe (Update: video) After the launch of the OnePlus 5T Star Wars Limited Edition last month to commemorate the release of the next chapter in the epic Star Wars space opera – Star Wars: The Last Jedi - … Unique to the OnePlus 5T is the notification alert slider which makes it very easy to switch between Android’s different notification profiles. It’s a hardware feature that’s been available ever since the OnePlus 2 and it’s still just as useful and convenient on the 5T. As with every modern day smartphone, fingerprint sensors on the View 10 and 5T are a standard feature. The Honor View 10’s is implemented via a solid state home button on the front while OnePlus made the move to a rear mounted fingerprint sensor for the 5T to make way for the larger 18:9 screen and smaller bezels. Both fingerprint sensors have been very fast and accurate in my experience but I much prefer OnePlus’ rear implementation as it feels more comfortable and ergonomic. Of course, if you prefer front-facing scanners then the View 10 will naturally suit you better. When it comes to longevity, the Honor View 10 and OnePlus 5T offer impressive battery life. Both devices come equipped with very respectable battery capacities with 3,750 mAh on the Honor View 10 and 3,300 on the OnePlus 5T. Not only are the Honor View 10 and OnePlus 5T capable of lasting a full day, they are able to do it with ease. Screen on time of five to six hours is achievable on both devices. It’s incredible how consistent battery life is on the View 10 and 5T regardless of how light or how heavy you use the device. Screen on time of five to six hours is achievable on both devices Charging also poses no problem for the View 10 or 5T as they’re both very quick to top off or fill up with Huawei’s SuperCharge technology on the View 10 and OnePlus’ tried and true Dash charging for the 5T. Dash Charge is not only one of the most rapid charging methods available but is also more energy efficient. Camera On the back side, the Honor View 10 and OnePlus 5T are both utilizing dual camera setups. On paper, the View 10 and 5T’s cameras are very similarly spec’d, but they offer two different approaches to the dual camera experience. The Honor View 10 has a 16 MP RGB primary shooter backed by a secondary monochrome 20 MP sensor to help pull in more detail for a sharper, clearer image. Both lenses have a bright f/1.8 aperture but unfortunately no OIS on either lens. On paper, the View 10 and 5T's cameras are very similarly spec'd, but they offer two different approaches to the dual camera experience The OnePlus 5T also has a 16 MP primary shooter and a 20 MP secondary sensor. Both, however, are RGB and have a slightly wider f/1.7 aperture. Unlike the previous OnePlus 5, the secondary sensor does not offer optical zoom and instead is designed to help improve low light. No optical image stabilization here either but the main sensor does utilize electronic stabilization to help with shakiness. In terms of features, the View 10 has the leg up with a plethora of shooting modes, some of which you may never use on a daily basis but they can be fun to explore and experiment with. Honor’s signature wide aperture mode is certainly one of the most useful features as it allows for adjustment of the bokeh effect after the fact so you’re never stuck with the initial results. A portrait mode is also available for added depth of field when taking selfies on the front and rear cameras. The OnePlus 5T keeps the camera experience much more simple and streamlined and doesn’t go overboard with too many shooting modes. A portrait mode is available on the 5T though to give you that fancy background blur effect but it’s only available on the rear facing camera. Honor View 10 camera samples The Honor View 10 and OnePlus 5T are very capable shooters and can produce some excellent results. Surprisingly, the photos from the Honor View 10 and OnePlus 5T are very similar when it comes to detail, sharpness, and overall dynamic range. The only exception is color reproduction. The Honor View 10 tends to favor a warmer look with more natural colors while the OnePlus 5T’s photos are cooler in appearance and are also more saturated. OnePlus 5T camera samples Neither camera is great in low light but the Honor View 10 does consistently produce brighter photos showing more details in the shadows and the images are generally much sharper than the 5T. It’s not something you’ll notice when sharing photos on social media but it can easily be spotted if you’re pixel peeping. Software As we all know, software can vary wildly from one Android phone to the next and the software experiences between the View 10 and 5T couldn’t be further apart. The Honor View 10 ships with Android 8.0 Oreo with EMUI 8.0 on top which is the most current version of Huawei’s skin. If you’ve used previous Huawei or Honor devices it won’t take you long to find your way around but if you’re more accustomed to a more stock-like experience, the View 10 will feel very different. Editor's Pick 10 reasons why Android is still better than iOS Back in 2013 we wrote "10 reasons why Android is still better than iOS." Three years later, almost all these points remain the same, but we've updated a few to keep them relevant. You might like: … EMUI draws many cues from Apple’s iOS in terms of aesthetics and features. The overall UI is very colorful, the app icons are rounded squares, there’s a swipe down gesture to trigger a spotlight-esque feature, and by default there is no app drawer but one can be enabled through the settings menu if you so desire. While EMUI isn’t necessarily my cup of tea it does offer some nice features such as quick access shortcuts on the lock screen, a theme engine, and the ability to use the fingerprint sensor to navigate via swipe gestures in place of the on-screen navigation keys. Since it’s running Oreo you get many of its benefits which include notification dots and picture-in-picture with supported apps. The only real downside to the Honor View 10’s software is that it comes preinstalled with a ton of bloatware applications but fortunately many of the third party ones can be uninstalled. The OnePlus 5T on the other hand has a much closer to stock Android experience with OxygenOS. This is currently based on Android Nougat but you can currently get Oreo on your OnePlus 5T if you’ve taken advantage of OnePlus’ beta program. What I love about OxygenOS is not only how clean the experience is but also the high level of customization and features that OxygenOS brings to the table. If software matters to you, this will ultimately be what sways your purchasing decision OxygenOS is able to pull all of this off without feeling intrusive and many of the features are so seamlessly integrated that it feels like a natural part of Android. The entire UI can be customized to your liking with different accent colors, fonts, and gestures. You even have the option to pick between a light or dark theme. If you’re on the latest Android Oreo beta you can also use iPhone X-style swipe gestures to navigate the UI in lieu of the standard on-screen navigation buttons. Conclusion The Honor View 10 and OnePlus 5T are very competitively and similarly priced, so price isn’t necessarily going to play a huge role when deciding between these two phones. There’s very little separating the View 10 and 5T in terms of their overall hardware as much of what they offer is the same. They both have beautiful 18:9 displays, dual cameras, and fantastic battery life. Where these two devices differ the most is in the software department. If software matters to you, this will ultimately be what sways your purchasing decision. Software is indeed the main reason why the OnePlus 5T is my pick as the winner in this versus. While EMUI is much improved over previous versions, I still much prefer a stock-like Android experience and that’s exactly what the OnePlus 5T provides, all while still giving you a plethora of customization options. , via Android Authority http://bit.ly/2Ch5Xjo
0 notes