codewars: caesar cipher in C Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Caesar Cipher program in CShorten this Caesar Cipher crackerCaesar Cipher that takes an arbitrary offsetMilliseconds to Time string & Time string to MillisecondsCaesar cipher crackerImplementing Caesar Cipher in CCaesar Cipher encryption/decryptionUsing C++ to check if string s is subsequence of string tCodewars “Consecutive strings” kataCaesar cipher in C
Can a non-EU citizen traveling with me come with me through the EU passport line?
Should I use Javascript Classes or Apex Classes in Lightning Web Components?
Marking the functions of a sentence: 'She may like it'
When -s is used with third person singular. What's its use in this context?
Did Kevin spill real chili?
I am not a queen, who am I?
Can Pao de Queijo, and similar foods, be kosher for Passover?
Sorting numerically
Do you forfeit tax refunds/credits if you aren't required to and don't file by April 15?
Are variable time comparisons always a security risk in cryptography code?
What makes black pepper strong or mild?
Does the Giant Rocktopus have a Swim Speed?
Is a manifold-with-boundary with given interior and non-empty boundary essentially unique?
What would be the ideal power source for a cybernetic eye?
Is there a documented rationale why the House Ways and Means chairman can demand tax info?
How to assign captions for two tables in LaTeX?
Antler Helmet: Can it work?
3 doors, three guards, one stone
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
Output the ŋarâþ crîþ alphabet song without using (m)any letters
How does cp -a work
Why was Tyrion worried & disapproved of Jon and Dany’s actions on the boat?
How discoverable are IPv6 addresses and AAAA names by potential attackers?
Check which numbers satisfy the condition [A*B*C = A! + B! + C!]
codewars: caesar cipher in C
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Caesar Cipher program in CShorten this Caesar Cipher crackerCaesar Cipher that takes an arbitrary offsetMilliseconds to Time string & Time string to MillisecondsCaesar cipher crackerImplementing Caesar Cipher in CCaesar Cipher encryption/decryptionUsing C++ to check if string s is subsequence of string tCodewars “Consecutive strings” kataCaesar cipher in C
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I'm posting this there and not on SO because i can't find any error despite having messed around with gdb and valgrind, but it's likely that there's a memory violation or undefined behavior somewhere .
This is my submission for this problem : I have to cipher a given string using Caesar's cipher, cut it into 5 substrings , put them into an array and return the array.
Then i have to implement the reversed process .
My program seems to generate non printable characters when run by the site.
It runs fine on my machine but the problem is certainly on my side.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/* computing the size of every string and putting these
* sizes in the array */
void five_parts (unsigned* array ,size_t number)
unsigned div5= number/5 ;
unsigned mod5= number%5 ;
unsigned i ;
if (mod5==0)
for (i=0;i<5;i++)
array[i]=div5 ;
else
unsigned remainder =number-4*div5 ;
for (i =0;i<4;i++)
array[i]=div5 + (remainder>0) ;
if (remainder>0)
remainder--;
array[4]= remainder ;
/* encrypting a string , without mutation
* returns a pointer to the encrypted string
* the shift is incremented at every character */
char * encrypt ( char * string,int shift )
char * encrypted =NULL ;
size_t i, length= strlen(string) ;
if (!(encrypted=malloc((length+1)*sizeof(char))))
exit(-1);
encrypted[length]='';
for (i=0;i<length;i++)
shift%=26 ;
if (string[i] >='a' && string[i] <='z')
encrypted[i] = (string[i] +shift>'z') ? string[i] +shift-26 : string[i] +shift;
else if (string[i] >='A' && string[i] <='Z')
encrypted[i] = (string[i] +shift>'Z') ? string[i] +shift-26 : string[i] +shift;
else
encrypted[i] = string[i] ;
shift ++ ;
return encrypted ;
/* decrypting a string , without mutation
* returns a pointer to the decrypted string */
char * decrypt ( char * string,int shift )
char * decrypted =NULL ;
size_t i, length= strlen(string) ;
if (!(decrypted=malloc((length+1)*sizeof(char))))
exit(-1);
decrypted[length]='';
for (i=0;i<length;i++)
shift%=26 ;
if (string[i] >='a' && string[i] <='z')
decrypted[i] = (string[i] -shift<'a') ? string[i] -shift+26 : string[i] -shift;
else if (string[i] >='A' && string[i] <='Z')
decrypted[i] = (string[i] -shift<'A') ? string[i] -shift+26 : string[i] -shift;
else
decrypted[i] = string[i] ;
shift ++ ;
return decrypted ;
/* creates a string array containing 5 strings ;
* ciphers the input string without mutation, cut it into 5
* parts , and returns a pointer to the string array */
char** movingShift (char* strng, int shift)
if (!strng)
return NULL;
unsigned i,j ;
size_t length=strlen(strng);
unsigned sizes[5];
five_parts(sizes,length);
char ** array ;
if (! (array=malloc(5*sizeof(char*) ) ) )
exit (-1) ; // allocation error
char * encrypted,* ptr ;
encrypted=encrypt(strng,shift);
ptr=encrypted;
for (i=0 ;i<5;i++)
if (!(array[i]=malloc(1+sizes[i]*sizeof(char))))
for (j=0;j<i;j++) //freeing the previous ones
free(array[i]);
exit (-1); // allocation error
array[i][sizes[i]]=''; //NULL terminating
strncpy(array[i], ptr, sizes[i]);
ptr+=sizes[i] ;
free(encrypted) ;
return array ;
/* deciphers the given strings array ,
* returns a pointer to the deciphered string */
char* demovingShift(char** s, int shift)
if (!s)
return NULL;
size_t length=0 ;
char * decrypted ;
char * part ;
size_t sizes[5] ;
for (int i = 0 ;i < 5 ; i++)
length+=strlen(s[i]) ;
sizes[i]=strlen(s[i]) ;
decrypted=malloc(1+length);
decrypted[length]='' ; // NULL terminating
for (int i = 0 ;i < 5 ; i++)
part=decrypt(s[i],shift);
strcat(decrypted,part);
shift+=sizes[i];
shift%=26;
free (part);
return decrypted ;
int main ()
//char * u= "I should have known that you would have a perfect answer for me!!!" ;
char* u = "-uoxIirmoveNreefckgieaoiEcooqo";
int shift=2;
char ** array= movingShift(u, shift);
char * v =demovingShift(array,shift);
printf("decrypted:
Any insight greatly appreciated :)
c strings array pointers
New contributor
$endgroup$
add a comment |
$begingroup$
I'm posting this there and not on SO because i can't find any error despite having messed around with gdb and valgrind, but it's likely that there's a memory violation or undefined behavior somewhere .
This is my submission for this problem : I have to cipher a given string using Caesar's cipher, cut it into 5 substrings , put them into an array and return the array.
Then i have to implement the reversed process .
My program seems to generate non printable characters when run by the site.
It runs fine on my machine but the problem is certainly on my side.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/* computing the size of every string and putting these
* sizes in the array */
void five_parts (unsigned* array ,size_t number)
unsigned div5= number/5 ;
unsigned mod5= number%5 ;
unsigned i ;
if (mod5==0)
for (i=0;i<5;i++)
array[i]=div5 ;
else
unsigned remainder =number-4*div5 ;
for (i =0;i<4;i++)
array[i]=div5 + (remainder>0) ;
if (remainder>0)
remainder--;
array[4]= remainder ;
/* encrypting a string , without mutation
* returns a pointer to the encrypted string
* the shift is incremented at every character */
char * encrypt ( char * string,int shift )
char * encrypted =NULL ;
size_t i, length= strlen(string) ;
if (!(encrypted=malloc((length+1)*sizeof(char))))
exit(-1);
encrypted[length]='';
for (i=0;i<length;i++)
shift%=26 ;
if (string[i] >='a' && string[i] <='z')
encrypted[i] = (string[i] +shift>'z') ? string[i] +shift-26 : string[i] +shift;
else if (string[i] >='A' && string[i] <='Z')
encrypted[i] = (string[i] +shift>'Z') ? string[i] +shift-26 : string[i] +shift;
else
encrypted[i] = string[i] ;
shift ++ ;
return encrypted ;
/* decrypting a string , without mutation
* returns a pointer to the decrypted string */
char * decrypt ( char * string,int shift )
char * decrypted =NULL ;
size_t i, length= strlen(string) ;
if (!(decrypted=malloc((length+1)*sizeof(char))))
exit(-1);
decrypted[length]='';
for (i=0;i<length;i++)
shift%=26 ;
if (string[i] >='a' && string[i] <='z')
decrypted[i] = (string[i] -shift<'a') ? string[i] -shift+26 : string[i] -shift;
else if (string[i] >='A' && string[i] <='Z')
decrypted[i] = (string[i] -shift<'A') ? string[i] -shift+26 : string[i] -shift;
else
decrypted[i] = string[i] ;
shift ++ ;
return decrypted ;
/* creates a string array containing 5 strings ;
* ciphers the input string without mutation, cut it into 5
* parts , and returns a pointer to the string array */
char** movingShift (char* strng, int shift)
if (!strng)
return NULL;
unsigned i,j ;
size_t length=strlen(strng);
unsigned sizes[5];
five_parts(sizes,length);
char ** array ;
if (! (array=malloc(5*sizeof(char*) ) ) )
exit (-1) ; // allocation error
char * encrypted,* ptr ;
encrypted=encrypt(strng,shift);
ptr=encrypted;
for (i=0 ;i<5;i++)
if (!(array[i]=malloc(1+sizes[i]*sizeof(char))))
for (j=0;j<i;j++) //freeing the previous ones
free(array[i]);
exit (-1); // allocation error
array[i][sizes[i]]=''; //NULL terminating
strncpy(array[i], ptr, sizes[i]);
ptr+=sizes[i] ;
free(encrypted) ;
return array ;
/* deciphers the given strings array ,
* returns a pointer to the deciphered string */
char* demovingShift(char** s, int shift)
if (!s)
return NULL;
size_t length=0 ;
char * decrypted ;
char * part ;
size_t sizes[5] ;
for (int i = 0 ;i < 5 ; i++)
length+=strlen(s[i]) ;
sizes[i]=strlen(s[i]) ;
decrypted=malloc(1+length);
decrypted[length]='' ; // NULL terminating
for (int i = 0 ;i < 5 ; i++)
part=decrypt(s[i],shift);
strcat(decrypted,part);
shift+=sizes[i];
shift%=26;
free (part);
return decrypted ;
int main ()
//char * u= "I should have known that you would have a perfect answer for me!!!" ;
char* u = "-uoxIirmoveNreefckgieaoiEcooqo";
int shift=2;
char ** array= movingShift(u, shift);
char * v =demovingShift(array,shift);
printf("decrypted:
Any insight greatly appreciated :)
c strings array pointers
New contributor
$endgroup$
add a comment |
$begingroup$
I'm posting this there and not on SO because i can't find any error despite having messed around with gdb and valgrind, but it's likely that there's a memory violation or undefined behavior somewhere .
This is my submission for this problem : I have to cipher a given string using Caesar's cipher, cut it into 5 substrings , put them into an array and return the array.
Then i have to implement the reversed process .
My program seems to generate non printable characters when run by the site.
It runs fine on my machine but the problem is certainly on my side.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/* computing the size of every string and putting these
* sizes in the array */
void five_parts (unsigned* array ,size_t number)
unsigned div5= number/5 ;
unsigned mod5= number%5 ;
unsigned i ;
if (mod5==0)
for (i=0;i<5;i++)
array[i]=div5 ;
else
unsigned remainder =number-4*div5 ;
for (i =0;i<4;i++)
array[i]=div5 + (remainder>0) ;
if (remainder>0)
remainder--;
array[4]= remainder ;
/* encrypting a string , without mutation
* returns a pointer to the encrypted string
* the shift is incremented at every character */
char * encrypt ( char * string,int shift )
char * encrypted =NULL ;
size_t i, length= strlen(string) ;
if (!(encrypted=malloc((length+1)*sizeof(char))))
exit(-1);
encrypted[length]='';
for (i=0;i<length;i++)
shift%=26 ;
if (string[i] >='a' && string[i] <='z')
encrypted[i] = (string[i] +shift>'z') ? string[i] +shift-26 : string[i] +shift;
else if (string[i] >='A' && string[i] <='Z')
encrypted[i] = (string[i] +shift>'Z') ? string[i] +shift-26 : string[i] +shift;
else
encrypted[i] = string[i] ;
shift ++ ;
return encrypted ;
/* decrypting a string , without mutation
* returns a pointer to the decrypted string */
char * decrypt ( char * string,int shift )
char * decrypted =NULL ;
size_t i, length= strlen(string) ;
if (!(decrypted=malloc((length+1)*sizeof(char))))
exit(-1);
decrypted[length]='';
for (i=0;i<length;i++)
shift%=26 ;
if (string[i] >='a' && string[i] <='z')
decrypted[i] = (string[i] -shift<'a') ? string[i] -shift+26 : string[i] -shift;
else if (string[i] >='A' && string[i] <='Z')
decrypted[i] = (string[i] -shift<'A') ? string[i] -shift+26 : string[i] -shift;
else
decrypted[i] = string[i] ;
shift ++ ;
return decrypted ;
/* creates a string array containing 5 strings ;
* ciphers the input string without mutation, cut it into 5
* parts , and returns a pointer to the string array */
char** movingShift (char* strng, int shift)
if (!strng)
return NULL;
unsigned i,j ;
size_t length=strlen(strng);
unsigned sizes[5];
five_parts(sizes,length);
char ** array ;
if (! (array=malloc(5*sizeof(char*) ) ) )
exit (-1) ; // allocation error
char * encrypted,* ptr ;
encrypted=encrypt(strng,shift);
ptr=encrypted;
for (i=0 ;i<5;i++)
if (!(array[i]=malloc(1+sizes[i]*sizeof(char))))
for (j=0;j<i;j++) //freeing the previous ones
free(array[i]);
exit (-1); // allocation error
array[i][sizes[i]]=''; //NULL terminating
strncpy(array[i], ptr, sizes[i]);
ptr+=sizes[i] ;
free(encrypted) ;
return array ;
/* deciphers the given strings array ,
* returns a pointer to the deciphered string */
char* demovingShift(char** s, int shift)
if (!s)
return NULL;
size_t length=0 ;
char * decrypted ;
char * part ;
size_t sizes[5] ;
for (int i = 0 ;i < 5 ; i++)
length+=strlen(s[i]) ;
sizes[i]=strlen(s[i]) ;
decrypted=malloc(1+length);
decrypted[length]='' ; // NULL terminating
for (int i = 0 ;i < 5 ; i++)
part=decrypt(s[i],shift);
strcat(decrypted,part);
shift+=sizes[i];
shift%=26;
free (part);
return decrypted ;
int main ()
//char * u= "I should have known that you would have a perfect answer for me!!!" ;
char* u = "-uoxIirmoveNreefckgieaoiEcooqo";
int shift=2;
char ** array= movingShift(u, shift);
char * v =demovingShift(array,shift);
printf("decrypted:
Any insight greatly appreciated :)
c strings array pointers
New contributor
$endgroup$
I'm posting this there and not on SO because i can't find any error despite having messed around with gdb and valgrind, but it's likely that there's a memory violation or undefined behavior somewhere .
This is my submission for this problem : I have to cipher a given string using Caesar's cipher, cut it into 5 substrings , put them into an array and return the array.
Then i have to implement the reversed process .
My program seems to generate non printable characters when run by the site.
It runs fine on my machine but the problem is certainly on my side.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/* computing the size of every string and putting these
* sizes in the array */
void five_parts (unsigned* array ,size_t number)
unsigned div5= number/5 ;
unsigned mod5= number%5 ;
unsigned i ;
if (mod5==0)
for (i=0;i<5;i++)
array[i]=div5 ;
else
unsigned remainder =number-4*div5 ;
for (i =0;i<4;i++)
array[i]=div5 + (remainder>0) ;
if (remainder>0)
remainder--;
array[4]= remainder ;
/* encrypting a string , without mutation
* returns a pointer to the encrypted string
* the shift is incremented at every character */
char * encrypt ( char * string,int shift )
char * encrypted =NULL ;
size_t i, length= strlen(string) ;
if (!(encrypted=malloc((length+1)*sizeof(char))))
exit(-1);
encrypted[length]='';
for (i=0;i<length;i++)
shift%=26 ;
if (string[i] >='a' && string[i] <='z')
encrypted[i] = (string[i] +shift>'z') ? string[i] +shift-26 : string[i] +shift;
else if (string[i] >='A' && string[i] <='Z')
encrypted[i] = (string[i] +shift>'Z') ? string[i] +shift-26 : string[i] +shift;
else
encrypted[i] = string[i] ;
shift ++ ;
return encrypted ;
/* decrypting a string , without mutation
* returns a pointer to the decrypted string */
char * decrypt ( char * string,int shift )
char * decrypted =NULL ;
size_t i, length= strlen(string) ;
if (!(decrypted=malloc((length+1)*sizeof(char))))
exit(-1);
decrypted[length]='';
for (i=0;i<length;i++)
shift%=26 ;
if (string[i] >='a' && string[i] <='z')
decrypted[i] = (string[i] -shift<'a') ? string[i] -shift+26 : string[i] -shift;
else if (string[i] >='A' && string[i] <='Z')
decrypted[i] = (string[i] -shift<'A') ? string[i] -shift+26 : string[i] -shift;
else
decrypted[i] = string[i] ;
shift ++ ;
return decrypted ;
/* creates a string array containing 5 strings ;
* ciphers the input string without mutation, cut it into 5
* parts , and returns a pointer to the string array */
char** movingShift (char* strng, int shift)
if (!strng)
return NULL;
unsigned i,j ;
size_t length=strlen(strng);
unsigned sizes[5];
five_parts(sizes,length);
char ** array ;
if (! (array=malloc(5*sizeof(char*) ) ) )
exit (-1) ; // allocation error
char * encrypted,* ptr ;
encrypted=encrypt(strng,shift);
ptr=encrypted;
for (i=0 ;i<5;i++)
if (!(array[i]=malloc(1+sizes[i]*sizeof(char))))
for (j=0;j<i;j++) //freeing the previous ones
free(array[i]);
exit (-1); // allocation error
array[i][sizes[i]]=''; //NULL terminating
strncpy(array[i], ptr, sizes[i]);
ptr+=sizes[i] ;
free(encrypted) ;
return array ;
/* deciphers the given strings array ,
* returns a pointer to the deciphered string */
char* demovingShift(char** s, int shift)
if (!s)
return NULL;
size_t length=0 ;
char * decrypted ;
char * part ;
size_t sizes[5] ;
for (int i = 0 ;i < 5 ; i++)
length+=strlen(s[i]) ;
sizes[i]=strlen(s[i]) ;
decrypted=malloc(1+length);
decrypted[length]='' ; // NULL terminating
for (int i = 0 ;i < 5 ; i++)
part=decrypt(s[i],shift);
strcat(decrypted,part);
shift+=sizes[i];
shift%=26;
free (part);
return decrypted ;
int main ()
//char * u= "I should have known that you would have a perfect answer for me!!!" ;
char* u = "-uoxIirmoveNreefckgieaoiEcooqo";
int shift=2;
char ** array= movingShift(u, shift);
char * v =demovingShift(array,shift);
printf("decrypted:
Any insight greatly appreciated :)
c strings array pointers
c strings array pointers
New contributor
New contributor
New contributor
asked 3 mins ago
abu hajarabu hajar
11
11
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
abu hajar is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f217520%2fcodewars-caesar-cipher-in-c%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
abu hajar is a new contributor. Be nice, and check out our Code of Conduct.
abu hajar is a new contributor. Be nice, and check out our Code of Conduct.
abu hajar is a new contributor. Be nice, and check out our Code of Conduct.
abu hajar is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f217520%2fcodewars-caesar-cipher-in-c%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown