Skip to content

Commit

Permalink
iPhone stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony committed Jan 7, 2011
1 parent b01db4f commit a3b97a2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
Binary file added apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apple-touch-startup-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" /><meta name="description" content="Online graph sketching app that can graph functions and numerically solve differential equations. Requires Javascript HTML 5." /><title>graph.tk</title><link rel="stylesheet" type="text/css" href="mathquill.css" /><link rel="stylesheet" type="text/css" href="main.css" /></head><body><h3><noscript>Please enable javascript!<br /><a href="http://graph.tk/about">More info</a></noscript></h3><script type="text/javascript">document.body.firstChild.appendChild(document.createTextNode("Loading..."));</script>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="apple-touch-icon" href="apple-touch-icon.png" /><meta name="viewport" content="width=device-width; height=device-height; initial-scale=1.0; maximum-scale=1.0; user-scalable=false;"/><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /><link rel="apple-touch-startup-image" href="apple-touch-startup-image.png" /><link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" /><meta name="description" content="Online graph sketching app that can graph functions and numerically solve differential equations. Requires Javascript HTML 5." /><title>graph.tk</title><link rel="stylesheet" type="text/css" href="mathquill.css" /><link rel="stylesheet" type="text/css" href="main.css" /></head><body><h3><noscript>Please enable javascript!<br /><a href="http://graph.tk/about">More info</a></noscript></h3><script type="text/javascript">document.body.firstChild.appendChild(document.createTextNode("Loading..."));</script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="mathquill_modified.js"></script>
<script type="text/javascript" src="math.js"></script>
Expand Down
23 changes: 12 additions & 11 deletions math.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ Number.prototype.format=function(digits) {
function random_hash(){
var s="";
for(var i=0;i<20;i++){
s+=(~~(Math.random()*16)).toString(16);
s+=(10+~~(Math.random()*26)).toString(36)
//s+=(~~(Math.random()*16)).toString(16);
}
return s;
}
Expand Down Expand Up @@ -399,8 +400,8 @@ function p(inp){
//TODO: known functions only, otherwise make it a product
//TODO: allow things like 2x
e=e.replace(//g,"Infinity");
e=e.replace(/\.([^\d])/g,"*$1");
e=e.replace(/([\d]+(\.[\d]+)?)([xpi])/g,"$1*$3");
e=e.replace(/\.([^\d]|$)/g,"*$1");
e=e.replace(/([\d]+(\.[\d]+)?)([^\+\-\*\/\^\:\(\)\d\=\.])/g,"$1*$3");

e=e.replace(/\^([\d]+)\(/g,"^$1:(");
e=e.replace(/([xe\d∫])\(/g,"$1*(");
Expand All @@ -427,7 +428,7 @@ function p(inp){
fail=false;
var h=random_hash();
obj[h]=p(n.substring(1,n.length-1));
return "hash"+h+"hash";
return "aaaa"+h+"aaaa";
});
if(fail){
throw ("Could not parse parentheses");
Expand Down Expand Up @@ -546,7 +547,7 @@ function p(inp){
}else{
var fname=p(be[0]);
if(fname.eqtype==eqtype.power){
console.log("ok");
//console.log("ok");
}else if(typeof fname!="string"){
terms.type=eqtype.product;
terms.push(fname);
Expand Down Expand Up @@ -579,7 +580,7 @@ function p(inp){
var parsednumber=NaN;
if(!isNaN(parsednumber=Number(e))){
return parsednumber;
}else if(!/^hash[a-z\d]{20}hash$/.test(e)){
}else if(!/^aaaa[a-z\d]{20}aaaa$/.test(e)){
var match=/^([\d]+(\.[\d])?)([^\d]+)$/(e);
if(match){
alert("old code: "+e);
Expand All @@ -605,14 +606,14 @@ function p(inp){

}

terms=terms.dreplace(/^hash[a-z\d]{20}hash$/,function(e){
terms=terms.dreplace(/^aaaa[a-z\d]{20}aaaa$/,function(e){
var to_ret=obj[e.substring(4,24)];
delete obj[e.substring(4,24)];
return to_ret;
});
/*
for(var i=0;i<terms.length;i++){
if(/^hash[a-z\d]{20}hash$/.test(terms[i])){
if(/^aaaa[a-z\d]{20}aaaa$/.test(terms[i])){
terms[i]=obj[terms[i].substring(4,24)];
//terms[i]="e";
}
Expand All @@ -627,7 +628,7 @@ function p(inp){
return ["diff"].setType(eqtype.operatorfactor);
}
}
console.log(terms.type+": "+terms.getString());
//console.log(terms.type+": "+terms.getString());
if(terms.type==eqtype.product){
var found=[];
for(var i=0;i<terms.length;i++){
Expand Down Expand Up @@ -1154,7 +1155,7 @@ Array.prototype.integrate=function(times){
}else if(this.type==eqtype.product){
var _non_constant=0;
var self=this.simplify();
console.log(self);
//console.log(self);
if(_dx=self.indexOf("dx")){
self.splice(_dx,1);
}
Expand Down Expand Up @@ -1865,7 +1866,7 @@ var known_derivatives={
"exp":p("exp(x)"),
"floor":p("shaw(x)"),
"u":p("delta(x)"),
"sqrt":p("(x^(-1/2))*0.5"),
"sqrt":p("1/(2*sqrt(x))"),
"asin":p("1/sqrt(1-x^2)"),
"acos":p("-1/sqrt(1-x^2)"),
"fact":p("Γ(x+1)*ψ(x+1)"),
Expand Down
2 changes: 1 addition & 1 deletion release.template.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" manifest="manifest.manifest"><head><link rel="apple-touch-icon" href="img/apple-touch-icon.png" /><meta name="viewport" content="width=device-width; height=device-height; initial-scale=1.0; maximum-scale=1.0; user-scalable=false;"/><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /><link rel="apple-touch-startup-image" href="img/apple-touch-startup-image.png" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" /><meta name="description" content="Online graph sketching app that can graph functions and numerically solve differential equations. Requires Javascript HTML 5." /><title>graph.tk</title><link rel="stylesheet" type="text/css" href="CSS_FILE" /></head><body><h3><noscript>Please enable javascript!<br /><a href="http://graph.tk/about/">More info</a></noscript></h3><script type="text/javascript">document.body.firstChild.appendChild(document.createTextNode("Loading..."));</script><script type="text/javascript" src="JS_FILE"></script><script type="text/javascript">var gaJsHost=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");document.write(unescape("%3Cscript src='"+gaJsHost+"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script><script type="text/javascript">try{var pageTracker=_gat._getTracker("UA-15603369-1");pageTracker._trackPageview();}catch(err){}</script></body></html>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" manifest="manifest.manifest"><head><link rel="apple-touch-icon" href="apple-touch-icon.png" /><meta name="viewport" content="width=device-width; height=device-height; initial-scale=1.0; maximum-scale=1.0; user-scalable=false;"/><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /><link rel="apple-touch-startup-image" href="apple-touch-startup-image.png" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" /><meta name="description" content="Online graph sketching app that can graph functions and numerically solve differential equations. Requires Javascript HTML 5." /><title>graph.tk</title><link rel="stylesheet" type="text/css" href="CSS_FILE" /></head><body><h3><noscript>Please enable javascript!<br /><a href="http://graph.tk/about/">More info</a></noscript></h3><script type="text/javascript">document.body.firstChild.appendChild(document.createTextNode("Loading..."));</script><script type="text/javascript" src="JS_FILE"></script><script type="text/javascript">var gaJsHost=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");document.write(unescape("%3Cscript src='"+gaJsHost+"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script><script type="text/javascript">try{var pageTracker=_gat._getTracker("UA-15603369-1");pageTracker._trackPageview();}catch(err){}</script></body></html>

0 comments on commit a3b97a2

Please sign in to comment.