This file contains 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
String inputFile = "~/github/iText/myhtml.xhtml"; | |
String url = new File(inputFile).toURI().toURL().toString(); | |
String outputFile = "~/github/iText/generated.pdf"; | |
OutputStream os = new FileOutputStream(outputFile); | |
ITextRenderer renderer = new ITextRenderer(); | |
renderer.setDocument(url); | |
renderer.layout(); | |
renderer.createPDF(os); |
This file contains 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
function calc(x){ | |
thix.x=1; | |
this.x+=y | |
} | |
funciton Foo(){ | |
} | |
Foo.prototype.result= new function{ |
This file contains 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
public class Marketing{ | |
private static int N,M,i,j,totalValue=0,total=1;; | |
private static boolean [][]adj; | |
private static String inner; | |
private static String innerString[]; | |
private static int color[]; | |
private static boolean oddCycle=false; | |
This file contains 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
public class Circuits{ | |
/* initalize variable */ | |
private static int N,M,j,i; | |
private static String inner,innerCost; | |
private static String innerCircuit[],innerCircuitCost[]; | |
private static boolean adj[][]; | |
private static int innerCircuitAdj[][]; | |
public static void main(String abd[]){ |
This file contains 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
private static int nInversions=0; | |
/** call helper function here */ | |
public static void sort(Comparable[]a){ | |
int lo=0,hi=a.length-1; | |
Comparable [] aux = new Comparable[a.length]; | |
nInversions = sort(a,aux,lo,hi); | |
} | |
This file contains 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
public static int coins(int []deno, int amount){ | |
int dp[] = new int[amount+1]; | |
dp[0]=0; | |
for(int j=1;j<=amount;j++){ | |
dp[j]=Integer.MAX_VALUE; | |
for(int i=0;i<deno.length;i++){ | |
if(deno[i]<=j && (1+dp[j-deno[i]] < dp[j]) ) | |
dp[j]=1+dp[j-deno[i]]; | |
} | |
} |
This file contains 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
public class Solution { | |
public boolean wordBreak(String s, Set<String> dict) { | |
if( (dict.size()==0)||(s.length()==0)) | |
return false; | |
if(s.length()==1 && !dict.contains(s)) | |
return false; | |
else if(s.length()==1 && dict.contains(s)) |
This file contains 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
/** | |
* Definition for singly-linked list. | |
* class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode(int x) { | |
* val = x; | |
* next = null; | |
* } | |
* } |
This file contains 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
/** | |
* Definition for singly-linked list. | |
* class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode(int x) { | |
* val = x; | |
* next = null; | |
* } | |
* } |
This file contains 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
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode(int x) { | |
* val = x; | |
* next = null; | |
* } | |
* } |
OlderNewer