Deprecated: Function create_function() is deprecated in /home/mdmsolut/public_html/wp-content/plugins/wp-automatic/wp-automatic.php on line 72

Warning: Cannot modify header information - headers already sent by (output started at /home/mdmsolut/public_html/wp-content/plugins/wp-automatic/wp-automatic.php:72) in /home/mdmsolut/public_html/wp-includes/feed-rss2.php on line 8
M D M Solutions http://mdmsolutions.in Offering programming services,coding,wordpress services,ios apps,android apps,react native,ionic framework,node.js and many other programming skills.Hire us to solve your problem or to build you a new website or application. Wed, 27 May 2020 17:54:22 +0000 en-US hourly 1 https://wordpress.org/?v=5.4.2 testing listing data http://mdmsolutions.in/testing-listing-data/ http://mdmsolutions.in/testing-listing-data/#respond Wed, 27 May 2020 17:52:29 +0000 http://mdmsolutions.in/?p=124 http://mdmsolutions.in/testing-listing-data/feed/ 0 React Native Programmer http://mdmsolutions.in/react-native-programmer/ http://mdmsolutions.in/react-native-programmer/#respond Fri, 27 Jul 2018 09:18:26 +0000 http://mdmsolutions.in/?p=104 Continue reading React Native Programmer]]> We are happy to say that we are offering React Native Programming for our customers to build android and iOS apps.As everyone knows that most of the apps in the mobile phones are native. As we know apple has its different programming language to develop apps and tools like swift and Xcode and also Google also has their own coding language and tools like android studio to develop apps.

]]>
http://mdmsolutions.in/react-native-programmer/feed/ 0
HANDS ON WITH PYTHON 3.7: WHAT’S NEW IN THE LATEST RELEASE http://mdmsolutions.in/hands-on-with-python-3-7-whats-new-in-the-latest-release/ http://mdmsolutions.in/hands-on-with-python-3-7-whats-new-in-the-latest-release/#respond Fri, 27 Jul 2018 08:58:35 +0000 http://mdmsolutions.in/?p=103 Continue reading HANDS ON WITH PYTHON 3.7: WHAT’S NEW IN THE LATEST RELEASE]]> Used for general purpose programming, data science, website backends, GUIs, and pretty much everything else; the first programming language for many, and claimed to be the fastest growing in the world, is of course Python. The newest version 3.7.0 has just recently been released.
Naturally any release of Python, no matter how small, undergoes meticulous planning and design before any development is started at all. In fact, you can read the PEP (Python Enhancement Proposal) for Python 3.7, which was created back in 2016.

What’s new in 3.7? Why should you upgrade? Is there anything new that’s actually useful? I’ll answer these questions for you by walking through some examples of the new features. Whilst there’s not much in this release that will make a difference to the Python beginner, there’s plenty of small changes for seasoned coders and a few headline features you’ll want to know about.

BREAKPOINTS ARE NOW BUILTINS
Anyone who has used the pdb (Python debugger) knows how powerful it is. It gives you the ability to pause the execution of your script, allowing you to manually roam around the internals of the program and step over individual lines.

But, up until now, it required some setup when writing a program. Sure, it takes practically no time at all for you to import pdb and set_trace(), but it’s not on the same level of convenience as chucking in a quick debug print() or log. As of Python 3.7, breakpoint() is a built-in, making it super easy to drop into a debugger anytime you like. It’s also worth noting that the pdb is just one of many debuggers available, and you can configure which one you’d like to use by setting the new PYTHONBREAKPOINT environment variable.

Here’s a quick example of a program that we’re having trouble with. The user is asked for a string, and we compare it to see if it matches a value.

“””Test user’s favourite Integrated Circuit.”””

def test_ic(favourite_ic):
user_guess = input(“Try to guess our favourite IC >>> “)

if user_guess == favourite_ic:
return “Yup, that’s our favourite!”
else:
return “Sorry, that’s not our favourite IC”

if __name__ == ‘__main__’:
favourite_ic = 555
print(test_ic(favourite_ic))
Unfortunately, no matter what is typed in, we can never seem to match the string.
$ python breakpoint_test.py
Try to guess our favourite IC >>> 555
Sorry, that’s not our favourite IC
To figure out what’s going in, let’s chuck in a breakpoint — it’s as simple as calling breakpoint().
“””Test user’s favourite Integrated Circuit.”””

def test_ic(favourite_ic):
user_guess = input(“Try to guess our favourite IC >>> “)
breakpoint()

if user_guess == favourite_ic:
return “Yup, that’s our favourite!”
else:
return “Sorry, that’s not our favourite IC”

if __name__ == ‘__main__’:
favourite_ic = 555
print(test_ic(favourite_ic))
At the pdb prompt, we’ll call locals() to dump the current local scope. The pdb has a shedload of useful commands, but you can also run normal Python in it as well.
$ python breakpoint_test.py
Try to guess our favourite IC >>> 555
> /home/ben/Hackaday/python37/breakpoint_test.py(8)test_ic()
-> if user_guess == favourite_ic:
(Pdb) locals()
{‘favourite_ic’: 555, ‘user_guess’: ‘555’}
(Pdb)
Aha! It looks like favourite_ic is an integer, whilst user_guess is a string. Since in Python comparing a string to an int is a perfectly valid comparison, no exception was thrown (but the comparison doesn’t do what we want). favourite_ic should have been declared as a string. This is arguably one of the dangers of Python’s dynamic typing — there’s no way of catching this error until runtime. Unless, of course, you use type annotations…
ANNOTATIONS AND TYPING
Since Python 3.5, type annotations have been gaining traction. For those unfamiliar with type hinting, it’s a completely optional way of annotating your code to specify the types of variables.
Type hints are just one application of annotations (albeit the main one). What are annotations? They’re syntactic support for associating metadata with variables. They can be considered to be arbitrary expressions which are evaluated but ignored by Python at runtime. An annotation can be any valid Python expression. Here’s an example of an annotated function where we’ve gone bananas with useless information.

# Without annotation
def foo(bar, baz):
# Annotated
def foo(bar: ‘Describe the bar’, baz: print(‘random’)) -> ‘return thingy’:

This is all very cool, but a bit meaningless unless annotations are used in standard ways. The syntax for using annotations for typing became standardised in Python 3.5 (PEP 484), and since then type hints have become widely used by the Python community. They’re purely a development aid, which can be checked using an IDE like PyCharm or a third party tool such as Mypy.

If our string comparison program had been written with type annotations, it would have looked like this:
“””Test user’s favourite Integrated Circuit.”””

def test_ic(favourite_ic: str) -> str:
user_guess: str = input(“Try to guess our favourite IC >>> “)
breakpoint()

if user_guess == favourite_ic:
return “Yup, that’s our favourite!”
else:
return “Sorry, that’s not our favourite IC”

if __name__ == ‘__main__’:
favourite_ic: int = 555
print(test_ic(favourite_ic))
You can see that PyCharm has alerted me to the error here, which would have prevented it going un-noticed until runtime. If your project is using CI (Continuous Integration), you could even configure your pipeline to run Mypy or a similar third party tool on your code.

So that’s the basics of annotations and type hinting. What’s changing in Python 3.7? As the official Python docs point out, two main issues arose when people began to start using annotations for type hints: startup performance and forward references.

Unsurprisingly, evaluating tons of arbitrary expressions at definition time was quite costly for startup performance, as well as the fact that the typing module was extremely slow
You couldn’t annotate with types that weren’t declared yet
This lack of forward reference seems reasonable, but becomes quite a nuisance in practice.
class User:
def __init__(self, name: str, prev_user: User) -> None:
pass
This fails, as prev_user cannot be defined as type User, given that User is not defined yet.
To fix both of these issues, evaluation of annotations gets postponed. Annotations simply get stored as a string, and optionally evaluated if you really need them to be.

To implement this behaviour, a __future__ import must be used, since this change can’t be made whilst remaining compatible with previous versions.
from __future__ import annotations

class User:
def __init__(self, name: str, prev_user: User) -> None:
pass
This now executes without a problem, since the User type is simply not evaluated.

Part of the reason the typing module was so slow was that there was an initial design goal to implement the typing module without modifying the core CPython interpreter. However, now that the use of type hints is becoming more popular, this restriction has been removed, meaning that there is now core support for typing, which enables several optimisations.
TIMING
The time module has some new kids on the block: existing timer functions are getting a corresponding nanosecond flavour, meaning greater precision is on tap if required. Some benchmarks show that the resolution of time.time() is more than three times exceeded by that of time.time_ns().

Talking of timing, Python itself is getting a minor speed boost in 3.7. This is low level stuff so we won’t go into it right now, but here’s the full list of optimisations. All you need to know is that the startup time is 10% faster on Linux, 30% faster on MacOS, and a large number of method calls are getting zippier by up to 20%.

DATACLASSES
We’re willing to bet that if you’ve ever written object-oriented Python, you’ll have made a class that ended up looking something like this:
class User:

def __init__(self, name: str, age: int, favourite_ic: str) -> None:
self.name = name
self.age = age
self.favourite_ic = favourite_ic

def is_adult(self) -> bool:
“””Return True if user is an adult, else False.”””
return self.age >= 18

if __name__ == ‘__main__’:
john = User(‘John’, 29, ‘555’)
print(john)
# prints “<__main__.User object at 0x0076E610>”
A ton of different arguments are received in __init__ when the class gets initialised. These are simply set as attributes of the class instance straight away, ready for later use. This is a pretty common pattern when writing these kind of classes — but this is Python, and if tedium can be avoided, it should be.

As of 3.7, we have dataclasses, which will make this type of class easier to declare, and more readable.

Simply decorate a class with @dataclass, and the assignment to self will be taken care of automatically. Variables are declared as shown below, and type annotations are compulsory (though you can still use the Any type if you want to be flexible).
from dataclasses import dataclass

@dataclass
class User:
name: str
age: int
favourite_ic: str

def is_adult(self) -> bool:
“””Return True if user is an adult, else False.”””
return self.age >= 18

if __name__ == ‘__main__’:
john = User(‘John’, 29, ‘555’)
print(john)
# prints “User(name=’John’, age=29, favourite_ic=’555′)”
Not only was the class much easier to setup, but it also produced a lovely string when we created an instance and printed it out. It would also behave properly when being compared to other class instances. This is because, as well as auto-generating the __init__ method, other special methods were generated too, such as __repr__, __eq__ and __hash__. These vastly reduce the amount of overhead needed when properly defining a class like this.

Dataclasses use fields to do what they do, and manually constructing a field() gives access to additional options which aren’t the defaults. For example, here the default_factory of the field has been set to a lambda function which prompts the user to enter their name.
from dataclasses import dataclass, field

class User:
name: str = field(default_factory=lambda: input(“enter name”))
(We wouldn’t recommend piping input into an attribute directly like this – it’s just a demo of what fields are capable of.)
OTHER
There are other miscellaneous changes aplenty in this release; we’ll just list a few of the most significant here:

Dictionaries are now guaranteed to preserve insertion order. This was informally implemented in 3.6, but is now an official language specification. The normal dict should now be able to replace collections.OrderedDict in most cases.
New documentation translations into French, Japanese and Korean.
Controlling access to module attributes is now much easier, as __getattr__ can now be defined at a module level. This makes it far easier to customise import behaviour, and implement features such as deprecation warnings.
A new developer mode for CPython.
.pyc files have the option to be deterministic, enabling reproducible builds — that is, the same byte-for-byte output is always produced for the same input file.
CONCLUSION
There are some really neat syntactic shortcuts and performance improvements to be had, but it might not be enough to encourage everyone to upgrade. Overall, Python 3.7 implements features that will genuinely lead to less hacky solutions, and produce cleaner code. We certainly look forward to using it, and can’t wait for 3.8!
Source:https://hackaday.com/2018/07/23/hands-on-with-python-3-7-whats-new-in-the-latest-release/

]]>
http://mdmsolutions.in/hands-on-with-python-3-7-whats-new-in-the-latest-release/feed/ 0
Microsoft provides free lessons for quantum computing basics http://mdmsolutions.in/microsoft-provides-free-lessons-for-quantum-computing-basics/ http://mdmsolutions.in/microsoft-provides-free-lessons-for-quantum-computing-basics/#respond Fri, 27 Jul 2018 08:32:03 +0000 http://mdmsolutions.in/?p=100 Continue reading Microsoft provides free lessons for quantum computing basics]]> Want to learn more about quantum computing and how to program in the Q# language? Microsoft just launched Quantum Katas, an open source project that does just that by providing you with tutorials for learning at your own pace. According to Microsoft, these exercises are based on three learning principles: Active learning, incremental complexity growth, and feedback.

“Each kata offers a sequence of tasks on a certain quantum computing topic, progressing from simple to challenging,” Microsoft Quantum Team states. “Each task requires you to fill in some code; the first task might require just one line, and the last one might require a sizable fragment of code. A testing framework validates your solutions, providing real-time feedback.”

Currently, there are only four katas covering basic quantum computing gates, superposition, measurements, and the Deutsch-Jozsa algorithm. Each kata is a stand-alone project containing a sequence of tasks progressing from trivial to challenging, requiring you to manually insert chunks of code. They also provide a testing framework that sets up, runs and validates your final code.

For instance, the first kata covers computing gates, another term for basic operations, used in quantum computing along with the concept of adjoint and controlled gate versions. Those provided in the kata belong to the Microsoft.Quantum.Primitive namespace, the notes reveal.

To use these katas, you need to install the Quantum Development Kit for Windows 10, MacOS and Linux. This kit is typically used to build your own quantum computing programs and experiments. It includes the Q# language and compiler, the Q# standard library, a local quantum machine simulator, a quantum computer trace simulator, and two other components. After installing the kit, you can grab the katas through Git or by downloading stand-alone copies in a ZIP file.

Microsoft says you shouldn’t panic when all tests initially fail after opening a kata. You need to jump into the Tasks.qs file and manually enter code to complete all tasks. These tasks are covered by a unit test that requires you to insert the correct code, rebuild the project, and then re-run the related tests. If you did everything correctly, the corresponding unit task will pass and you can move on to the next stage.

Microsoft’s katas arrive after the company hosted its first Q# coding contest in early July, challenging more than 650 developers and new programmers alike. According to Microsoft, more than 350 participants solved at least one Q# problem while 100 participants solved all 15. The problems ranged from generating a superposition of all basis states to creating a second array reconstruction algorithm. The contest winnercompleted all tasks under 2.5 hours, Microsoft says.

Given Microsoft’s Quantum Katas is an open-source project, the company welcomes all contributions and suggestions. “Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution,” Microsoft adds.

Source:https://www.digitaltrends.com/computing/microsoft-provides-free-quantum-computing-lessons/

]]>
http://mdmsolutions.in/microsoft-provides-free-lessons-for-quantum-computing-basics/feed/ 0
THIS HARRY POTTER WAND CAN TEACH KIDS THE MAGIC OF CODING http://mdmsolutions.in/this-harry-potter-wand-can-teach-kids-the-magic-of-coding/ http://mdmsolutions.in/this-harry-potter-wand-can-teach-kids-the-magic-of-coding/#respond Fri, 27 Jul 2018 08:21:15 +0000 http://mdmsolutions.in/?p=96 Continue reading THIS HARRY POTTER WAND CAN TEACH KIDS THE MAGIC OF CODING]]>

The folks at Kano have a passion for making computers more accessible to children. They previously introduced a modular computer that kids could easily build themselves and learn more about how these machines work. And now, they give us none other than a Harry Potter-inspired wand that combines “magic” and technology to teach kids about coding (via Gizmodo).

This device is a bit more straightforward than their last gadget. You insert a small computer (which has an accelerometer, gyroscope, and magnetometer) into the base of a plastic wand, and when you move the wand, that data is fed into an accompanying mobile app.

The goal is to make programming not so scary for kids via a graphical coding interface, which kids will use, in tandem with the wand, to do everything from make a virtual feather float to activate sound effects based on the movement and positioning of the wand. Ultimately, it seems like a solid and fun way to get the young person in your life interested in the frameworks that make their favorite devices go.

As far as I can tell, magic isn’t real, but that doesn’t mean there aren’t plenty of magical things out there in the world. The mysteries of our planet can leave us believing in magic, or at least forces we don’t understand. And the younger you are, the more there is to learn and to observe for the first time with starry eyes. Computers and related technologies are an increasingly big part of children’s lives, so this Harry Potter wand that helps bridge the gap to this school of thought is a wonderful thing.

What do you think of this accessible-tech wand? Will you get one for your kids (or maybe just yourself)? Let us know what you think in the comments!

Source:https://nerdist.com/harry-potter-wand-teach-kids-coding-programming/

]]>
http://mdmsolutions.in/this-harry-potter-wand-can-teach-kids-the-magic-of-coding/feed/ 0