This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int is_palindrome(long long n) { | |
int digits = floor(log10(n))+1; | |
int i; | |
for(i = 0; i < digits/2; i++) { | |
long lowdigit = ((long long)(n/pow(10,i))) % 10; | |
long highdigit = ((long long)(n/pow(10, (digits - 1)-i))) % 10; | |
if (lowdigit != highdigit) return 0; | |
} | |
return 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10000 | |
2621163 520001400002 | |
1234321 1117186317161 | |
1001901 4000008000004 | |
21 14641 | |
112651261 1212225222121 | |
44944 4008004 | |
125686521 125686522 | |
2621163 1024348434201 | |
44943 123454421 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^(?:((abc)|(?:...))*(abc))* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = document.getElementById("canvas") | |
ctx = c.getContext("2d") | |
ctx.fillStyle="#420082"; | |
function centerSquare(x, y, size) { | |
ctx.fillRect(x-size/2,y-size/2,size,size); | |
} | |
function surround(x,y, size) { | |
var result = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unable to find instantiation of declaration! | |
UNREACHABLE executed at SemaTemplateInstantiateDecl.cpp:4384! | |
0 clang 0x000000000327344e llvm::sys::PrintStackTrace(_IO_FILE*) + 38 | |
1 clang 0x00000000032736d5 | |
2 clang 0x0000000003273110 | |
3 libpthread.so.0 0x00007f49edae88f0 | |
4 libc.so.6 0x00007f49ecb15407 gsignal + 55 | |
5 libc.so.6 0x00007f49ecb167e8 abort + 328 | |
6 clang 0x000000000325c10f | |
7 clang 0x00000000015cd995 clang::Sema::FindInstantiatedDecl(clang::SourceLocation, clang::NamedDecl*, clang::MultiLevelTemplateArgumentList const&) + 3137 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
randomPoly[n_, x_, {a_, b_}] := | |
x^Range[0, n].RandomVariate[CauchyDistribution[2, 1], n + 1]; | |
Show[Graphics[ | |
Point[{Re[x], Im[x]}] /. NSolve[randomPoly[300, x, {27, 42}], x], | |
Axes -> True]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.io.FileNotFoundException: JSPG0036E: Failed to find resource [...] | |
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.findWrapper(AbstractJSPExtensionProcessor.java:395) | |
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:349) | |
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:732) | |
at com.ibm.ws.portletcontainer.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:100) | |
at com.ibm.kosa.portal.framework.portlet.jsr286.AbstractKosaActionPortlet286.include(AbstractKosaActionPortlet286.java:289) | |
at com.ibm.kosa.portal.framework.portlet.AbstractKosaActionPortlet.processActionForward(AbstractKosaActionPortlet.java:1273) | |
at com.ibm.kosa.portal.framework.portlet.AbstractKosaActionPortlet.doView(AbstractKosaActionPortlet.java:217) | |
at com.ibm.kosa.portal.framework.base.AbstractKosaApplicationPortlet.doRendering(AbstractKosaApplicationPortlet.java:247) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is a small polyfill to get event listeners to be | |
* the same for all browsers. | |
*/ | |
if(!Element.prototype.addEventListener){var oListeners={};function runListeners(oEvent){if(!oEvent){oEvent=window.event}for(var lstId=0,elId=0,oEvtListeners=oListeners[oEvent.type];elId<oEvtListeners.aEls.length;elId++){if(oEvtListeners.aEls[elId]===this){for(lstId;lstId<oEvtListeners.aEvts[elId].length;lstId++){oEvtListeners.aEvts[elId][lstId].call(this,oEvent)}break}}}Element.prototype.addEventListener=function(sEventType,fListener){if(oListeners.hasOwnProperty(sEventType)){var oEvtListeners=oListeners[sEventType];for(var nElIdx=-1,elId=0;elId<oEvtListeners.aEls.length;elId++){if(oEvtListeners.aEls[elId]===this){nElIdx=elId;break}}if(nElIdx===-1){oEvtListeners.aEls.push(this);oEvtListeners.aEvts.push([fListener]);this["on"+sEventType]=runListeners}else{var aElListeners=oEvtListeners.aEvts[nElIdx];if(this["on"+sEventType]!==runListeners){aElListeners.splice(0);this["on"+sEventType]=runListener |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chris@clockworkrocket [master] ~/projects/rosalind $ ./run_problem.py --test-all | |
Skipping: lcsm | |
prtm : Test pass! (0.18 ms) | |
splc : Test pass! (0.14 ms) | |
seto : Test pass! (9.66 ms) | |
revp : Test pass! (6.12 ms) | |
prob : Test pass! (0.17 ms) | |
mrna : Test pass! (0.17 ms) | |
prot : Test pass! (0.48 ms) | |
fib : Test pass! (0.17 ms) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
array = [] | |
class Token(): | |
def __init__(self, input): | |
if input[0].isdigit: | |
self.type = "INT" | |
self.value = int(input) | |
else: | |
self.type = "STRING" |
OlderNewer