id
stringlengths
36
36
text
stringlengths
1
1.25M
e948c18a-e68f-4bfb-b599-c0d6287a7ece
public long getLastVisited() { return LastVisited; }
73e5dcf8-b840-4ea9-9b6c-9ec85dd44919
public void setLastVisited(long lastVisited) { LastVisited = lastVisited; }
dcaf6b40-1060-409c-9d7b-ba85e8ff764e
public int getRanking() { return Ranking; }
c34e4ae8-8355-40ae-8023-224f40bb0c63
public void setRanking(int ranking) { Ranking = ranking; }
c70ff7c5-8c14-4f88-b9cf-532a272a95c5
public int getStatus() { return Status; }
da76c9a2-5120-4b3c-8154-e91ae5984bcf
public void setStatus(int status) { Status = status; }
4db9e91d-4b74-4642-8296-21579141dee5
public void print(){ print(false); }
3c38bcd2-44ef-41dc-80f1-af26b42417e0
public void print(boolean dispContent){ print(dispContent,false); }
87b325e9-ca2e-4637-b35a-f95af02cffaa
public void print(boolean dispContent,boolean dispHtml){ System.out.print("#" + Domain); System.out.print("#" + Url); System.out.print("#" + Content.length()); System.out.print("#" + Html.length()); System.out.print("#" + LastVisited); System.out.print("#" + Ranking); System.out.println("#" + Status); if(dispCo...
8e1ff8ba-9d2b-415a-adf9-a96fd8b491f6
boolean tweet(String tweet);
ca2be4a4-062e-42b9-9819-d3710187202d
List<String> getMyTweets();
64d7aef8-1a4a-414f-9178-d62bd761da48
List<Feed> getFeeds(String source);
f718da5e-d354-4658-a132-772762e99438
public Feed(String date, String linkTitle, String linkURL) { super(); this.date = date; this.linkTitle = linkTitle; this.linkURL = linkURL; }
1b2aea57-19e2-44ea-b457-dee015238b24
public String getAuthor() { return author; }
645b150a-276d-4913-a548-0110de15963d
public void setAuthor(String author) { this.author = author; }
a9fe2711-7c3e-4290-b66c-83d17d1ffeed
public String getDate() { return date; }
bf6824a1-5af7-442e-8b4a-a5c1888a673e
public String getLinkTitle() { return linkTitle; }
ee9e18cf-b315-42ce-bf6f-a04ede802284
public String getLinkURL() { return linkURL; }
d0fac7c5-0497-4156-b21e-0045ce25cbc5
public List<Feed> getFeeds(String source) { //call integration layer if ( "CNN".equalsIgnoreCase(source)) return getFeeds(); else return null; }
4e24e988-f528-4813-bf0c-391f1977ec53
private static List<Feed> getFeeds() { List<Feed> feeds = new ArrayList<Feed>(); ApplicationContext ac = new ClassPathXmlApplicationContext("FeedInboundChannelAdapterSample-context.xml"); PollableChannel feedChannel = ac.getBean("feedChannel", PollableChannel.class); for (int i = 0; i < 10; i++) { Messa...
b76dd6ba-6e54-481c-b861-116dfc1e18a7
public boolean tweet(String tweet) { @SuppressWarnings("resource") ApplicationContext context = new ClassPathXmlApplicationContext("TwitterSendUpdates-context.xml"); MessageChannel twitterOutChannel = context.getBean("twitterOut", MessageChannel.class); Message<String> twitterUpdate = new GenericMessage<St...
5e48c76d-aec3-4557-bd20-0a7029cd5c15
public List<String> getMyTweets() { @SuppressWarnings("resource") ApplicationContext context = new ClassPathXmlApplicationContext("TwitterSearch-context.xml"); final List<String> myTweets = new ArrayList<String>(); DirectChannel twitterInputChannel = context.getBean("twitterOut", DirectChannel.class); tw...
f872b088-fd35-4dac-bf16-3f8ec3e9e358
@Override public void handleMessage(Message<?> message) throws MessagingException { myTweets.add(message.getPayload().toString()); }
23f07a5a-3be5-4fa5-8be5-3505cd292fb1
void post(String tweet);
74a32a71-7c04-4102-b161-9d9d86c260b4
List<String> getMyTweets();
33c22475-ff3e-4569-b5c5-609d6553e2bb
public List<FeedBean> getFeeds(String source);
29dcbc30-bf5e-4a7e-a942-c66874e2b438
public FeedBean(String date, String linkTitle, String linkURL) { this.date = date; this.linkTitle = linkTitle; this.linkURL = linkURL; }
cbac6560-c44b-4ae4-a3a6-ccfe269fc777
public String getAuthor() { return author; }
df1c3347-bcc1-4b42-b3f8-a4d9005b4813
public void setAuthor(String author) { this.author = author; }
8ca01b69-aec5-4b52-a403-c5ad86203c52
public String getDate() { return date; }
5c2f0e20-7cd1-4eca-ae4a-3ea85c0973af
public String getLinkTitle() { return linkTitle; }
1596331b-d2f1-4c5c-bf45-179865651d8c
public String getLinkURL() { return linkURL; }
bc6c1256-ebee-4cbb-826d-6a96c0da2b3e
@RequestMapping(method = RequestMethod.POST) public void post(@RequestBody String tweetMsg) { TwitterService twitterService = ServiceLocator.getService("twitterService", TwitterService.class); twitterService.tweet(tweetMsg); //return "success"; }
3bb2102a-a19c-4ee1-8825-fc94ca0aa1c8
@RequestMapping(method = RequestMethod.GET) public @ResponseBody List<String> getMyTweets() { TwitterService twitterService = ServiceLocator.getService("twitterService", TwitterService.class); List<String> tweets = twitterService.getMyTweets(); return tweets; }
5bde0967-19f9-4009-ab45-9ab7e3b47fb6
@RequestMapping(value="{source}", method = RequestMethod.GET) public @ResponseBody List<FeedBean> getFeeds(@PathVariable String source) { FeedService feedService = ServiceLocator.getService("feedService", FeedService.class); List<Feed> feeds = feedService.getFeeds(source); if(feeds == null || feeds.isEmpt...
431f0301-f2ad-4176-acb4-78cb43bfaea6
private static FeedBean convert(Feed feed) { return new FeedBean(feed.getDate(),feed.getLinkTitle(), feed.getLinkURL()); }
93d04403-77e0-4cc6-920b-b80dc74dd4ea
public static <T> T getService(final String beanName, final Class<T> klass) { return (T) beanFactory.getBean(beanName, klass); }
32c689eb-0fa7-45c4-a6d9-2aeb3bed4428
public static <T> T getService(final String beanName, final Class<T> klass) { BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(SERVICE_DEFINITION)); return (T) beanFactory.getBean(beanName, klass); }
bde8bb9f-2b8c-460e-9968-2d2e2218920f
public ConChEncodeStream(byte[] source, byte[] target, InputStream input) { this.source = source; this.codeabet = target; this.input = input; this.inBuffer = new ByteArrayOutputStream(); this.outBuffer = new ByteArrayInputStream(new byte[0]); }
cd1d4e85-6213-4ec6-9a3c-14aa8ae66c61
@Override public int read() throws IOException { int c; // If we have a block in here, start feeding that out. if ((c = outBuffer.read()) != -1) return c; // Otherwise, time to make a block. while (inBuffer.size() < ConCh.BLOCK_LIMIT ...
cd2245b4-57ef-472a-953a-ca2c8f013386
public static void copyTo(InputStream in, OutputStream out) throws IOException { int c; while ((c = in.read()) != -1) out.write(c); out.flush(); }
fca18047-f857-4b8f-bc3c-2a7d7355cb60
public static void main(String[] args) throws IOException { InputStream in = System.in; OutputStream out = System.out; ConChMode mode = ConChMode.UNSET; byte[] source = ConCh.Sigma94; byte[] codeabet = ConCh.C94; for (int index = 0; inde...
cdada53b-69fc-47e6-8c5d-54e9ef101dd9
public static int Delta(int a, int b, int d) { return (int) Math.ceil(d / Math.log(b) * Math.log(a)); }
6520e39c-78f0-4f76-9bac-976977beed0e
public static int Nabla(int a, int b, int d) { return ConCh.Delta(b, a, d - 1); }
9fbffe3e-fc48-4444-ad69-a507061cf7c8
public static int kappa(int b, BigInteger n, int d) { // Use a big integer because the arithmetic gets big. BigInteger bb = BigInteger.valueOf(b); return n.divide(bb.pow(d - 1)).mod(bb).intValue(); }
4eac6ee3-51e9-4153-93ed-dd0110bbbaca
public static int indexOf(byte[] s, byte w) { for (int i = 0; i < s.length; i++) if (s[i] == w) return i; return -1; }
ead4e28c-fead-4ba0-98c7-dabe84183097
public static BigInteger K(byte[] s, byte[] w) { BigInteger base = BigInteger.valueOf(s.length); BigInteger sum = BigInteger.ZERO; for (int i = 0; i < w.length; i++) { BigInteger value = BigInteger.valueOf(ConCh.indexOf(s, w[i])); sum = sum.add(value.multiply(bas...
e3f99e2e-5a59-48bd-8763-cfd44aaec812
public static byte[] Kinverse(byte[] t, BigInteger n, int L) { byte[] output = new byte[L]; for (int i = 0; i < L; i++) { output[i] = t[(int) kappa(t.length, n, i + 1)]; } return output; }
c063cf49-dc76-4733-8348-f07fba492166
public static byte[] encode(byte[] s, byte[] t, byte[] w) { return ConCh.Kinverse(t, ConCh.K(s, w), ConCh.Delta(s.length, t.length, w.length)); }
97c35f33-8dd9-484c-8977-2f7308b045d8
public static byte[] decode(byte[] s, byte[] t, byte[] w) { return ConCh.Kinverse(s, ConCh.K(t, w), ConCh.Nabla(s.length, t.length, w.length)); }
b00116c2-0605-4671-b51c-dccd2c1da256
public ConChDecodeStream(byte[] source, byte[] target, InputStream input) { this.source = source; this.codeabet = target; this.input = input; this.inBuffer = new ByteArrayOutputStream(); this.outBuffer = new ByteArrayInputStream(new byte[0]); }
467d7bd7-eb03-42b8-90d8-99cd0c72f406
@Override public int read() throws IOException { int c; // If we have a block in here, start feeding that out. if ((c = outBuffer.read()) != -1) return c; // Otherwise, time to make a block. while (inBuffer.size() < ConCh.Delta(source.length, cod...
0e9ccbb8-a2ef-4bc7-bbc9-04d3f5ceb21d
public GnuNeutron (String computer_algorithme) { autodisplay = true; display = 1; computerColour = NeutronBoard.BLACK; playerName = ""; ponder = true; nb = new NeutronBoard (); if (computer_algorithme.equals("random")) { cp = new ComputerPlayerRandom (); } else if (compute...
b96efc49-73c3-4f53-9aa1-c88505576640
private void userAnalyze () { analyzeMode = true; computerColour = NeutronBoard.NOPLAYER; }
86f9ff89-393a-40f8-a59d-7afc80f13a82
void userAnnotate () {; }
216d0db6-fb83-4640-bfa7-05446995e1c3
void userBack () {; }
9edbf388-7c55-44f4-9941-342ab06cd749
void userBench () {; }
230a3e28-532e-4302-a235-07124aaa27cd
private void userBlack () {; }
9b795596-240a-4f11-9d37-8be5caaa2eca
private void userSetDisplay (ArrayList<String> command) { ; }
796a842d-7d66-4e62-8870-8b8d19a1e478
private void userDisplay () { System.out.println (nb); }
0f8afbb8-62b4-4095-92b2-abb09581f486
private void userEdit () {; }
76c27e29-9862-4f40-9025-9474f8aff6eb
private void userEnd () {; }
315aa7de-8166-4b86-9293-6f54ac5ea833
private void userExit () { goodbye (); }
59c291c3-ffc4-4554-a1e7-f6485d2f4179
private void userGo () { computerColour = nb.whoToMove (); }
86814038-7d28-45c1-8236-f6ecc0ed1387
private void userHelp (ArrayList < String > command) { String topic; if (command.size () > 1) { topic = command.get (1); } else { topic = ""; } System.out.println (""); if (topic.equals ("")) { System.out. print ("alarm on|off..............turns audible alarm o...
2ad03d99-4b8f-4ca5-854c-8471c488bad3
private void userHistory () { if (moveHistory.size()==0) return; System.out.println("White\t\tBlack"); System.out.println("------------\t------------"); for (int i=0; i<moveHistory.size(); i++) { if (i<10) System.out.print(" "); System.out.print((i+1)+". "+moveHistory.get(i)); System.out.print("\t...
2e92729e-6020-4044-a74e-d3d99e9e3788
private void userImport (ArrayList < String > command) {; }
774858f8-231e-4fd6-ba32-574f8952daa1
private void userInfo () {; }
53b834b1-bed6-4c0f-ba1c-9ee51a67df3f
private void userInput (ArrayList < String > command) {; }
7d89f411-d42f-4f8d-853e-563e45dbef40
private void userLoad (ArrayList < String > command) {; }
561e7f62-f915-453b-adb3-d31f4ccf3b75
private void userLog (ArrayList < String > command) {; }
4f59c527-1d3a-4146-85da-b23c2c6a6a2b
private void userName (ArrayList < String > command) {; }
796506cc-90f5-448d-b613-bce1e0747010
private void userNew () { nb = new NeutronBoard (); computerColour = NeutronBoard.BLACK; userDisplay(); moveHistory=new ArrayList<String>(); }
ac6fb8e3-9f66-4512-ac41-1a88dbce9b88
private void userPerf (ArrayList < String > command) {; }
917ce53e-eb11-4882-b408-4864fd9d9fa9
private void userPerft () {; }
241e8b94-335e-4597-9877-01b232bdb5f2
private void userPonder (ArrayList < String > command) {; }
a542e275-71af-4f84-b0cc-e33c70de85e1
private void userRead (ArrayList < String > command) {; }
eda02dba-cd1d-43bf-8d01-1358b4b122c8
private void userReada (ArrayList < String > command) {; }
918d2e0f-f045-40af-a0bd-b751f0a175e7
private void userReset (ArrayList < String > command) {; }
9bad0867-a1a9-450a-b1c7-63d03e585e86
private void userSave (ArrayList < String > command) { String filename=null; if (command.size()>1) { filename=command.get(1); try { BufferedWriter bw=new BufferedWriter(new FileWriter(command.get(1))); for (int i=0; i<moveHistory.size(); i++) { bw.write(moveHistory.get(i)+" "); } bw...
d3525910-3558-4aef-a1fe-143744334235
private void userScore () {; }
85547b92-0651-4b61-a208-86c9af41f46f
private void userSd (ArrayList < String > command) {; }
0a6633f3-13a9-43c7-a86d-cede84b9ccf4
private void userSearch (ArrayList < String > command) {; }
71385f39-aae7-46d0-9efd-24b085a8d903
private void userSettc (ArrayList < String > command) {; }
a96d89a8-2001-4687-8e26-e4a06f73ebf1
private void userShow (ArrayList < String > command) { String topic; if (command.size () > 1) { topic = command.get (1); } else { topic = ""; } if (topic.equals ("warranty")) { System.out.print ("\n NO WARRANTY\n"); System.out. print ("BECAUSE THE PROGR...
7ef08530-261a-41ae-aeec-e09b24da438f
private void userSt (ArrayList < String > command) {; }
7acaaf9f-7204-40f3-b8d3-e9af918c2417
private void userTest (ArrayList < String > command) {; }
a54ca9a5-f36d-43a0-a08b-0ed2861103e3
private void userTime (ArrayList < String > command) {; }
6343441d-94da-4fb8-92c8-430236225c5e
private void userTrace (ArrayList < String > command) {; }
fee210b3-72a2-4798-aeba-dfbf68c06fdc
private void userWhite () {; }
6a96fa09-3a5f-438f-8b70-4ca63726ac1d
private static void welcome () { System.out. print ("GnuNeutron is copyright 2011 Martin M. S. Pedersen - email: traxplayer@gmail.com\n"); System.out. print ("GnuNeutron comes with ABSOLUTELY NO WARRANTY; for details type \"show warranty\".\n"); System.out. print ("This...
b1a6fc9a-0a82-45ac-bc4c-973ed2982c03
private void goodbye () {; }
a13e9298-8f54-474e-9bad-894bd393fbad
private void checkForWin () { int gameValue; gameValue = nb.isGameOver (); if (gameValue == NeutronBoard.NOPLAYER) return; System.out.println("Game over."); switch (gameValue) { case NeutronBoard.WHITE: System.out.println ("White won."); break; case NeutronBoard.BLACK: ...
05bd3dc6-7b08-49ee-938d-42e18f5656eb
private void gotAMove (String theMove) { try { nb.makeMove (theMove); } catch (IllegalMoveException e) { System.out.println (theMove + ": " + e); return; } theMove=theMove.toUpperCase().replaceAll("[^A-E1-5]",""); if (theMove.length()==4) { theMove=(new StringB...
eb7e87af-e202-4c83-8edc-f54e326e2c97
private static int pbem(GnuNeutron gn) { /* read moves from stdin until eof and then compute and print a move an d exit. */ NeutronBoard nb=new NeutronBoard(); ArrayList<String> moves=NeutronUtil.getInput(); gn.cp.setPBEM(true); try { for (String AMove : moves) { nb.makeMove(AMove); ...
658921a7-c306-4538-9012-a4f06de11a82
public static void main (String[]args) { GnuNeutron gnuNeutron = new GnuNeutron("alphabeta"); boolean pbem=false; if (args.length > 0) { for (int i = 0; i < args.length; i++) { if (args[i].equals ("--pbem")) { pbem=true; continue; } if (args[i].equals ("--random")) { gnuNeutr...
9048194f-f100-4391-8ac6-7ca87475d412
private void run () { ArrayList < String > command = new ArrayList < String > (5); String line = ""; System.out.println(nb); while (true) { if (nb.whoToMove () == NeutronBoard.WHITE) System.out.print ("White"); else System.out.print ("Black"); System.out.print ("("); System.out.print(...
5d2037f9-4ae7-4c64-b7b2-bb20d438b0da
public ComputerPlayerRandom() { ; }
2d640886-d553-433c-a503-25b933996090
public String computerMove(NeutronBoard nb) { return computerMove(nb,3,false); }
21d8d954-311e-4e5d-9367-2c8a7f9e05dd
public String computerMove(NeutronBoard nb,int level,boolean pbem) { String theMove; try { theMove=NeutronUtil.getRandomMove (nb); } catch (IllegalMoveException e) { e.printStackTrace(); throw new RuntimeException ("(020)"); } return theMove; }