Pages

Showing posts with label what. Show all posts
Showing posts with label what. Show all posts

Monday, March 9, 2015

What does storage quota unification mean for the Drive API


Earlier this month, we announced that storage quota is now shared between Google Drive, GMail, and Google+ photos. As part of this change, the Google Drive API and the Google Documents List API will be updated over the next few weeks to start returning the updated storage quota information.

In the Google Drive API, this appears in the about collection.

GET https://www.googleapis.com/drive/v2/about


{
 "kind": "drive#about",
 "quotaBytesTotal": 16106127360,
 "quotaBytesUsed": 17936436,
 …
}


In the Documents List API, this appears in the metadata feed.

GET https://docs.google.com/feeds/metadata/default


<entry>
 <gd:quotaBytesTotal>16106127360</gd:quotaBytesTotal>
 <gd:quotaBytesUsed>17936436</gd:quotaBytesUsed>
 …
</entry>

The new values in the quotaBytesTotal field reflect total storage quota across all the unified products. If you rely on this value, you may notice a change in your apps, but we expect it to behave as if a user has just purchased more storage.

The new values for quotaBytesUsed field will reflect the total amount of storage used across the unified products.  (This field used to reflect the total amount of storage used by Google Drive.)



Ali Afshar profile | twitter

Tech Lead, Google Drive Developer Relations. As an eternal open source advocate, he contributes to a number of open source applications, and is the author of the PIDA Python IDE. Once an intensive care physician, he has a special interest in all aspects of technology for healthcare
Read more »

Monday, March 2, 2015

What Did They Say Wednesday! A Linky Party!

Dont kids say the most hysterical things!  Im am looking forward to the cute things my kids say in 2013 and I cant wait to read your kids stories as well!


What Did They Say!?
<div align="center"><a href="http://aturntolearn.blogspot.com/2013/01/whatdidtheysay1-8.html" title="What Did They Say!?"><img src="http://4.bp.blogspot.com/-OIhmtxluCS0/ULwEfazkl1I/AAAAAAAADpM/MMMzxm23B0Y/s320/What+Did+They+Say+Wednesday.png" alt="What Did They Say!?" style="border:none;" /></a></div>



This weeks story comes from one of my most mature five year olds... hes definitely an old soul so this was especially surprising coming from him!

When we opened up Safari, there was a picture of an iPad on the screen.  

Student: I always wanted one of those but I forgot to ask my dad for one for my birthday.
Me: Oh yeah?  Well, maybe you can ask for one next year.  But iPads are very expensive.
Student: Do you know what else is really expensive?
Me: What?
Student: A lamborghini.
Me: Thats right. A lamborghini is very expensive.  Much more expensive than an iPad.
Student. I know.  But a lamborghini is the coolest car in car city!

The best part is... he pronounced lamborghini perfectly!!!


Now... its time to share your cute kids story from this week!

Rules for the Linky Party:
  1. Share a story that one of your kids said on your blog!  If you dont have a blog, leave a comment with your story!
  2. Use the HTML code at the top of this post to link back to the post!
  3. Comment on the two blog posts before yours!

);
Read more »

Sunday, March 1, 2015

What Did They Say! Wednesday!

My kids can always put a smile on my face!


What Did They Say!?

<div align="center"><a href="http://aturntolearn.blogspot.com/" title="What Did They Say!?"><img src="http://4.bp.blogspot.com/-OIhmtxluCS0/ULwEfazkl1I/AAAAAAAADpM/MMMzxm23B0Y/s320/What+Did+They+Say+Wednesday.png" alt="What Did They Say!?" style="border:none;" /></a></div>

This weeks story just goes to show that sometimes we take what we say for granted!

The other day, I made some comment about "dismissal." One of the brightest kids responded with "When are we going to meet this Miss Missal lady anyway?"

After 95 days of school, I assumed they knew dismissal meant packing up and going home!!!  I really need to check to see what else I think they understand!

Now... its time to share your cute kids story from this week!

Rules for the Linky Party:

  1. Share a story that one of your kids said on your blog!  If you dont have a blog, leave a comment with your story!
  2. Use the HTML code at the top of this post to link back to the post!
  3. Comment on the two blog posts before yours!



);


Read more »

Friday, February 27, 2015

What Did They Say Wednesday! Linky Party!

Dont kids say the most hysterical things!  I have been loving all of the link ups the past few weeks, and Im looking forward to hearing your funny kid story this week!

What Did They Say!?
<div align="center"><a href="http://aturntolearn.blogspot.com/2012/12/whatdidtheysay12-19.html" title="What Did They Say!?"><img src="http://4.bp.blogspot.com/-OIhmtxluCS0/ULwEfazkl1I/AAAAAAAADpM/MMMzxm23B0Y/s320/What+Did+They+Say+Wednesday.png" alt="What Did They Say!?" style="border:none;" /></a></div>


Ive been sick this week, so I thought Id post about a story that happened last time I was sick. 



Just before Hurricane Sandy, I had bronchitis and I missed a day of school.  Once we got word that school was closed, I made phone calls to parents about the closing. When I called one of my moms she said excitedly, "Im so glad you called! My son has been so worried about you for days because he knows youve been sick and he was scared you wouldnt be able to get to the doctor in the storm! I dont know what you did to him but its all hes been talking about this whole weekend!" 

These kids are just too precious!



Now... its time to share your cute kids story from this week!

Rules for the Linky Party:
  1. Share a story that one of your kids said on your blog!  If you dont have a blog, leave a comment with your story!
  2. Use the HTML code at the top of this post to link back to the post!
  3. Comment on the two blog posts before yours!



);




This linky party will be posted through 11:59pm on Tuesday.  On Wednesday, a new linky will be started.  I decided to host this as a weekly collection so that we can share numerous stories from our students! Im looking forward to reading everyone elses stories!

Read more »

Thursday, February 26, 2015

What Did They Say! Wednesday! A Linky Party!

The things that my kids say are just hysterical!  Id love to hear all the funny things your students say as well!

What Did They Say!?

<div align="center"><a href="http://aturntolearn.blogspot.com/" title="What Did They Say!?"><img src="http://4.bp.blogspot.com/-OIhmtxluCS0/ULwEfazkl1I/AAAAAAAADpM/MMMzxm23B0Y/s320/What+Did+They+Say+Wednesday.png" alt="What Did They Say!?" style="border:none;" /></a></div>

Isnt it the best when students admit guilt without even knowing it?!


Student: "Ms. Jessica, hes copying me!!"

Me (typical response): "Hes copying you sitting criss-cross with your hands folded?"

Student: "No. Hes spitting and making noises!"

Me: "Oh no, so youre telling me that youre spitting and making noises?"

Student: "No! He was doing it first!"

Me: "So you copied him spitting and making noises?"

Student: "No. I wasnt spitting! He was just copying me"

This went on for at least three minutes!


Now... its time to share your cute kids story from this week!

Rules for the Linky Party:
  1. Share a story that one of your kids said on your blog!  If you dont have a blog, leave a comment with your story!
  2. Use the HTML code at the top of this post to link back to the post!
  3. Comment on the two blog posts before yours!




);


Read more »

Student centred learning What does it mean

Link to article (By Geraldine O?Neill and Tim McMahon)
Full Title: Student-centred learning: What does it mean for students and lecturers?

"..Edwards (2001) emphasises the value of student-centred learning: ?Placing learners at the heart of the learning process and meeting their needs, is taken to a progressive step in which learner-centred approaches mean that persons are able to learn what is relevant for them in ways that are appropriate. Waste in human and educational resources is reduced as it suggested learners no longer have to learn what they already know or can do, nor what they are uninterested in?. (Edwards 2001:37)."

"In summary, it appears from the literature that some view student-centred learning as: the concept of the student?s choice in their education; others see it as the being about the student doing more than the lecturer (active versus passive learning); while others have a much broader definition which includes both of these concepts but, in addition, describes the shift in the power relationship between the student and the teacher."

"Learning is often presented in this dualism of either student-centred learning or teacher-centred learning. In the reality of practice the situation is less black and white. A more useful presentation of student-centred learning is to see these terms as either end of a continuum, using the three concepts (choice, doing, and power relationship) regularly used to describe student-centred learning "

These are just a few gems from this excellent article about student-centred learning, which also includes a lot of examples lecturers can utilize to facilitate a more student-centred learning environment. It also discusses the effectiveness and critiques of student-centred learning, which is very crucial to know, especially in learning environments where there are limited resources, different learning cultures, beliefs, and understandings of what it actually means. When we take everything into account and minimize the potential pitfalls, surely a student-centred learning environment is an approach worth pursuing and facilitating .

Read more »

Sunday, February 15, 2015

What is Tail Recursion Example to Explain Tail Recursion

Tail recursion refers to recursive call at last line. Tail recursion can be eliminated by changing the recursive call to a goto preceded by a set of assignments per function call. This simulates the recursive call because nothing needs to be saved after the recursive call finishes. We can just goto the top of the function with the values that would have been used in a recursive call.

What is Tail Recursion? Example to Explain Tail Recursion?

The recursive function for Tower of Honoi Problem is given below. It is an example of recursive function with tail recursion.

Also Read: C Program for Tower of Hanoi Problem
Also Read: How to Convert a Recursive Function or Algorithm to Non-Recursive?

Recursive function TOH with tail recursion

void TOH(int n,char x,char y,char z)
{
                if(n>0)
                {
                                TOH(n-1,x,z,y);
                                printf("
%c -> %c",x,y);
                                TOH(n-1,z,y,x);                 //tail recursion
                }
}

Without tail recursion

void TOH(int n,char x,char y,char z)
{
                char temp;
                label:

                if(n>0)
                {
                                TOH(n-1,x,z,y);
                                printf("
%c -> %c",x,y);
                                temp=x;
                                x=z;
                                z=temp;
                                n=n-1;
                                goto label;
                }


}

Watch below video to understand tail recursion easily.



Image source: http://learnyousomeerlang.com/recursion
Read more »

What Is Zip Bomb

Zip Bomb
Zip Bomb

A zip bomb, also known as a decompression bomb (or the Zip of Death for the overly dramatic ones), is a malicious archive file designed to crash or render useless the program or system reading it. It is often employed to disable antivirus software, in order to create an opening for more traditional viruses. Rather than hijacking the normal operation of the program, a zip bomb allows the program to work as intended, but the archive is carefully crafted so that unpacking it (e.g. by a virus scanner in order to scan for viruses) requires inordinate amounts of time, disk space or memory.

The classic zip bomb is a tiny zip file, most are measured in kilobytes. However, when this file is unzipped its contents are more than what the system can handle (usually up to Petabyte, i.e 1000 Terabyte. Some go up to exabytes too). Yes, were talking about stuffing exabytes of data into kilobytes. In my view, this ingenious little trick is the product of "pure hacker mentality". In essence, its nothing like phishing or session hijacking or anything else that has put a bad name to "hackers". Its a simple creative solution, an exploited loophole which truly shows: "Where theres a will, theres a way". To understand how it works, we have to take a little detour to see how data compression works (WinZip, WinRAR etc.)

Various compression software and tools make use of whats called "Lossless compression algorithms". As the name suggests, these algorithms strive to compress files without any loss of information. Clearly, when we compress a file wed definitely want to get it back in the same shape after decompressing. These algorithms usually exploit statistical redundancy in such a way as to represent the senders data more concisely without error. In English now: We know that the computer only understands 0s and 1s, So every single program or any data stored in your computer is actually just a series of 1s and 0s (Binary form). Lets take an example thats not entirely correct but will help you understand the principle. Say, weve got a file which after being converted to binary language looks like "1110000101". Remember statistical redundancy that was mentioned earlier? Try to spot it in this string (1110000101). Statistical redundancy basically means that the same thing is repeated over and over again. In this string we see that there are three 1s followed by four 0s. Now take a look at this string: "3140101". What just happened here is compression. We can simply write a program that codes and decodes files as above (Software like WinZip use a fancy form and overly complicated form of what we did above). If the program finds repeating patterns, like a lot of 1s together, it may simply replace all those 1s by another number. Another example, we find "111111111" somewhere in a program. Thats nine 1s in a row. What if we replace it by "91"? We can simply code our program to replace a "91" by writing "1" nine times, effectively reversing the process. Again, while decoding, if the program encounters any number other than 1 or 0, in our case 9, it can be instructed to write the successive number, in our case 1, 9 times. So "91" gets converted back to "111111111". Thats lossless compression.

What about the previous string (3140101)? On uncompressing this, we get back 1110000101, that is, the original string. Like I said, this example is not entirely accurate. Note that the computer only understands binary. Everything that youll ever do on a computer will have, at some point, been converted to binary form. Actually the computer is forced to convert to something other than binary (like English) only for us, dumb humans. We compressed "111111111" by writing "91". But the "9" in the "91" will also have to again be converted into 1s and 0s. So our program is quite buggy. Widely used programs like WinZip, WinRar, PowerISO etc. use various different algorithms for different cases.

Lossless compression is possible because most real-world data has statistical redundancy. Lossless compression schemes are reversible so that the original data can be reconstructed.
However, lossless data compression algorithms will always fail to compress some files. Indeed, any compression algorithm will necessarily fail to compress any data containing no discernible patterns. Attempts to compress data that has been compressed already may actually result in an expansion, as will attempts to compress all but the most trivially encrypted data. This is why if youve ever tried "ZIPing" or "RARing" a file, you would have noticed in some cases it works great while in other cases it may not even reduce the file size by 5%. (WinRAR and WinZIP can be considered the same for (almost) all practical purposes. Their names differ more than their compression abilities. Feel free to use either.)

Now, back to zip bombs. Before taking a deeper look, lets get the basic meaning cleared up. Take a new text file and write 0 a 1000 times. Save it, the file size should be just around 1 kilobyte. Open it up, CTRL+A, CTRL+C,CTRL+V - i.e, copy the whole thing then paste it. Do this ten times. Our file is now around 10kb, and completely made of 0s. Do this a few more times. Faster than your expectations, the file size will quickly climb into megabytes and then gigabytes. In most cases, the notepad (or any text editor) will actually begin to lag since it has a ridiculous amount of 0s open in the window. When that happens, thats your cue to slow down since different operating systems and softwares can have unexpected behaviors when dealing with such large files. Practically, just keep it under a few gigabytes and you should be fine.
(Even this may be too much for some systems, I recommend pausing at about a 100 Mb and then slowly increasing the size. If the lag lasts longer than around 15 seconds, youve reached the limit.) So, we have a 5Gb text file (on an awesome computer) containing nothing but 0s. A little perspective: Thats over five-freaking-billion zeros that the innocent little notepad obediently handled in a few seconds. So the next time youre getting annoyed at your browser lagging a little bit, try taking a notebook and write down 5Gb worth of text. Its only fair.

And were back. What do we do now with that ridiculously large text file? Compress it and watch your seriously underappreciated computer do magic. In the same directory, youll now see the pointlessly large text file, and alongside it, a zip file that should be under 1 Megabyte. Thats like stuffing 5000 balls into the volume of one.

Now, for a deeper look lets check out the most famous zip bomb, the 42.zip file. It is a zip file consisting of 42 kilobytes of compressed data, containing five layers of nested zip files in sets of 16, each bottom layer archive containing a 4.3 gigabyte (4 294 967 295 bytes; ~ 3.99 GiB) file for a total of 4.5 petabytes (4 503 599 626 321 920 bytes; ~ 3.99 PiB) of uncompressed data. This file is still available for download on various websites across the Internet. In many anti-virus scanners, only a few layers of recursion are performed on archives to help prevent attacks that would cause a buffer overflow, an out of memory condition, or exceed an acceptable amount of program execution time. Zip bombs often (if not always) rely on repetition of identical files to achieve their extreme compression ratios. Dynamic programming methods can be employed to limit traversal of such files, so that only one file is followed recursively at each level - effectively converting their exponential growth to linear.

(Heres a small website dedicated solely to the 42.zip, http://www.unforgettable.dk/ . You can ven download a ready-made zip bomb from here. Password for the zip file is 42. The file has a password to protect users who have ancient antivirus software that is set to automatically scan all downloads)

Now, to avoid giving the wrong impression a myth needs to be busted. "Zip Bomb" is not a very accurate name for this malicious file. If you extract a zip-bomb, it wont do anything to your computer though, itll just create 16 smaller zip-bombs. If you decompress one of those itll yield 16 more zip-bombs. As such, theyre not going to "explode" when someone opens them, theyre just used by malware authors to knock out anti-virus software so malware can work without needing to watch its back. What happens is, a malicious program may plant a zip bomb somewhere near it as bait for AV software. The program will wait until the anti-virus comes up for a routine scan, and itll wait, "hiding" behind the zip-bomb. When the anti-virus reaches the bomb, itll try to open it, all in its limited memory. 1 file becomes 16, which becomes 256, and it goes on until the memory is full. In reality though, the computer never runs out of memory because each process is only allowed to use so much memory, after it hits its limit it crashes itself to protect the rest of the computer from an OOM (Out-Of-Memory) event. When this happens to an anti-virus program as its trying to dig into the file for malware, the software simply crashes and exits, while leaving the rest of the computer unharmed. The malware will detect this, and will then use that opportunity to do whatever it wants, without having to worry about AV software that might be right around the corner. Additionally, the nested archives make it much harder for programs like virus scanners (the main target of these "bombs") to be smart and refuse to unpack archives that are "too large", because until the last level the total amount of data is not "that much", you dont "see" how large the files at the lowest level are until you have reached that level, by which time it is, of course, too late). However, most anti-virus software today recognizes a zip-bomb when it sees one, and will skip over it, alerting the user that the computer might be infected with malware. They usually go down to the second or third level before flagging the file.

Further, You wouldnt notice disk space being used because zip-bombs only decompress in an anti-virus programs memory, not to the disk. Most manual archive-opening programs dont even have a recursive opening mode for this very reason. Plus you also wouldnt notice much extra work by the CPU, because zip-bombs work so fast they can knock out an inadequately protected anti-virus program in seconds, while only using a fraction of the total computers memory.

The 42.zip is just one example, there are many more like this and you can create your own. A similar file is an XML-based decompression bomb called "billion laughs" (or XML Bomb). Basically it crashes a web browser by causing the XML parser to run out of memory (Again, most browsers today will detect such recursive expansion and simply not try to parse the booby-trapped XML).

Theres even a torrent for one of the largest (and smallest) zip bombs on the internet although it seems all the seeders have long gone. Its a 5.61 kilobyte zip file that expands to 4 Zettabytes. It seems to be at the absolute limit of zip bombs. Heres the KickAss Torrent link: http://kickass.to/zip-bomb-insanely-huge-zip-archive-4zb-t2105770.html (As a challenge, you can try replicating it. The file structure has been explained in the link: 8 layers, 32 archives in each layer, each archive containing a 4Gb file)

Lets walk through the process once again. Make a 4 Gb text file full of 0s. Zip it. Lets call it zip1. Create, say 10 copies of this zip file. We have 10 zip1s. Now, zip all ten zip1s again. Call it zip2. Were at the second level now and we can simply continue the process for as long as we like and the zip file will just keep getting bigger and bigger. A common doubt is, How can we create a zip file that opens up to a 4 Zettabyte size without having 4 Zettabyte memory on our computers? Actually, we dont even need 10 Gb for this. We just took a 4Gb text file and zipped it (into zip1). We can simply delete the original text file as it is no longer required. All we need is the first single tiny zip file and it is of this zip file that we create more copies, zip them up, create more copies and zip again and so on.

And that ends the story of the zip bomb. These actually come under the class of logic bombs, which also contains the fork bomb we made using batch files. Yet again, the name DDOS is going to pop up here. Zip bombs are basically DDOSers for antiviruses. Limited memory is a flaw that has remained in all computers since their inception and hackers always find a way to exploit it. When the old methods stop working, new ones soon pop up and take their place. DDOSing, Zip Bombs, Fork Bombs, XML bombs, PDF bombs, buffer overflows and what not. This shows what a crucial part of programming memory management really is. And so, we live another day, ready to combat the next problem.


Read more »

Wednesday, February 11, 2015

What is Virtual Base Class in C


What is Virtual Base Class in C++? 

Take a situation where all the three types of inheritance, multiple, multilevel and hierarchical inheritance are used together. This situation is illustrated in above image.


The child has two base classes parent1and parent2 and these two have a common base class grandparent. All the public and protected members of grandparentare inherited into child twice, first from parent1 and again from parent2. This means that child have duplicate sets of members inherited from grandparent. It causes ambiguity in the program.

Also Read: What is Recursive Permutation in C++? [Algorithm and Source Code]
Also Read: C++ Templates: Program to Swap Two Numbers Using Function Template



This kind of problem can be resolved by making the common base class as a virtual base class. It can be done in following way:

                                                                                                                                                                            

class grandparent

{

                            . . . . . .

                            . . . . . .

};



class parent1: virtual public grandparent

{

                            . . . . . .

                            . . . . . .

};



class parent2: public virtual grandparent

{

                            . . . . . .

                            . . . . . .

};



class child: public parent1, public parent2

{

                            . . . . . .

                            . . . . . .

};



If a class is made a virtual base class, only one copy of that class is inherited in derived class. Remember one thing that the keyword virtual and public may be used in either order.



Below I have written a program that implements the concept of virtual base class.

Also Read: Menu Driven C Program to Perform Insert, Display and Delete Operations on a Singly Linked List (SLL)



What is Virtual Base Class in C++?

#include<iostream>



using namespace std;



class student

{

    protected:

    int roll_no;



    public:

    void get_no(int x)

    {

        roll_no=x;

    }



    void put_no()

    {

        cout<<"Roll Number:"<<roll_no;

    }

};



class test: virtual public student

{

    protected:

    float sub_marks;



    public:

    void get_submarks(float y)

    {

        sub_marks=y;

    }



    void put_submarks()

    {

        cout<<"
Subject Marks:"<<sub_marks;

    }

};



class sports: public virtual student

{

    protected:

    float sp_marks;



    public:

    void get_spmarks(float z)

    {

        sp_marks=z;

    }



    void put_spmarks()

    {

        cout<<"
Sports Marks:"<<sp_marks;

    }

};



class result: public test, public sports

{

    float total_marks;



    public:

    void put_result()

    {

        total_marks=sub_marks+sp_marks;

        put_no();

        put_submarks();

        put_spmarks();

        cout<<"
Total Marks:"<<total_marks;

    }

};



int main()

{

    result R;

    R.get_no(20);

    R.get_submarks(75.6);

    R.get_spmarks(81.2);

    R.put_result();



    return 0;

}



In the above example student class is an abstract class, as it is not used to create any object. It is used only for deriving other classes.


If you liked this article then don’t forget to comment and share.
Read more »

What is Cracking Facebook Accounts

What is Cracking Facebook Accounts ?

What is Cracking Facebook Accounts ?
What is Cracking Facebook Accounts ?

Ans:Coming back to the main topic of this article. A few hours back while I was watching hacking related videos on securitytube.net, I came across to a video in which the hacker claimed that one can use "Hydra To Crack A Facebook Password". However here is why a bruteforce attack wont work against a facebeook account.Facebook and all other popular social networking websites lock an email account, after few unsuccessful login attempts. They either have introduced an "Account Lockout Feature" or they either have introduced an "Account Lockout" feature, which prevents an automated password cracking method to work. However, even if you get it working, A minimum facebook password length is about 6-characters. kindly refer to the chart and find out your success rate.http://www.youtube.com/watch?feature=player_embedded&v=w8TeD-GO8tc ( Cracking Facebook Accounts tutorial )

  
Read more »