--- title: Sponsorship ---
<EMAIL_ADDRESS>If you are interested in sponsoring us, please get in touch.


var myself = { name: 'Tom' };
var someoneElse = myself;
myself.name = 'Thomas';
// both myself & someoneElse are now equal to { name: 'Thomas' }
// change arrays in place.
var numbers = [3, 2, 1];
var sorted = numbers.sort();
// both numbers & sorted are equal to [1, 2, 3]
// because calling .sort() sorts the array in-place


Today
Places
Library search
Contacts search
Graduate courses
News
Events
Safety and Security
Student Advice Service
Learning Resources
Favourites
Send Feedback
Mobile Oxford


Toggle navigation
Menu
Social Graphs and Interactions DTU
Home
Notebook
About + Contact
Pyhton Notebook
Find here all the code we needed for this analysis


kremvax
`Prev `__
K
`Next `__
--------------
**kremvax**: /krem·vaks/, n.
[from the then-large number of `*Usenet* <../U/Usenet.html>`__
`*VAXen* <../V/VAXen.html>`__ with names of the form ``foovax``]
Originally, a fictitious Usenet site at the Kremlin, announced on April
1, 1984 in a posting ostensibly originated there by Soviet leader
Konstantin Chernenko. The
`posting <%20%20%20%20http://groups.google.com/groups?selm=0001%40kremvax.UUCP>`__
was actually forged by Piet Beertema as an April Fool's joke. Other
fictitious sites mentioned in the hoax were ``moskvax`` and
`*kgbvax* `__. This was probably the funniest of the many
April Fool's forgeries perpetrated on Usenet (which has negligible
security against them), because the notion that Usenet might ever
penetrate the Iron Curtain seemed so totally absurd at the time.
In fact, it was only six years later that the first genuine site in
Moscow, ``demos.su``, joined Usenet. Some readers needed convincing that
the postings from it weren't just another prank. Vadim Antonov, senior
programmer at Demos and the major poster from there up to mid-1991, was
quite aware of all this, referred to it frequently in his own postings,
and at one point twitted some credulous readers by blandly asserting
that he *was* a hoax!
Eventually he even arranged to have the domain's gateway site named
``kremvax``, thus neatly turning fiction into fact and demonstrating
that the hackish sense of humor transcends cultural barriers. [Mr.
Antonov also contributed the Russian-language material for this lexicon.
—ESR]
In an even more ironic historical footnote, ``kremvax`` became an
electronic center of the anti-communist resistance during the bungled
hard-line coup of August 1991. During those three days the Soviet UUCP
network centered on ``kremvax`` became the only trustworthy news source
for many places within the USSR. Though the sysops were concentrating on
internal communications, cross-border postings included immediate
transliterations of Boris Yeltsin's decrees condemning the coup and
eyewitness reports of the demonstrations in Moscow's streets. In those
hours, years of speculation that totalitarianism would prove unable to
maintain its grip on politically-loaded information in the age of
computer networking were proved devastatingly accurate — and the
original ``kremvax`` joke became a reality as Yeltsin and the new
Russian revolutionaries of glasnost and perestroika made ``kremvax`` one
of the timeliest means of their outreach to the West.
--------------
+-----------------------------+----------------------------+--------------------------+
| `Prev `__ | `Up <../K.html>`__ | `Next `__ |
+-----------------------------+----------------------------+--------------------------+
| Kool-Aid | `Home <../index.html>`__ | kyrka |
+-----------------------------+----------------------------+--------------------------+


{!extends base.html !} {!block title!}{%set page 'quickstart'%}Jangod, join in simply{!endblock!} {!block content!}
Let's go to see how difficult it's :)
To use the Jangod in your project is very easy, the following will introduce you to regular practice. Download jangod-template.jar and place it to your project classpath. As a portal to receive all the template render requests, you may need a class created to handle.
import java.io.IOException; import java.util.Map; import net.asfun.jangod.template.TemplateEngine; public class ViewHandler { final static TemplateEngine engine; //(2) static { engine = new TemplateEngine(); //(3) engine.getConfiguration().setWorkspace("D:/templates/"); //(1) } public static String render(String templateFile, Map<String,Object> data) throws IOException { return engine.process(templateFile, data); } }
Make template files with correct Jangod syntax, the file looks like this.
  <meta http-equiv=Content-Type content="text/html;charset=utf-8" /> <meta name="Keywords" content="{\{site.keywords}}" /> <meta name="Description" content="{\{page.excerpt}}" /> <title>{\{page.title}} - {\{site.title}}</title>

{\{ page.content }}

Now, just take the convenience Jangod brought us, construct some of the data, pass them to the portal class, then get final result of a template.
Map<String,Object> data = new HashMap<String, Object>(); data.put("page",pageObject); String result = ViewHandler.render("page.html", data);
(1) Workspace is the root directory where template files placed. It intents to tell the
engine where to load templates. It can be setup by coding or by configuration file. For
more information see document about how to
configurate.
(2) TemplateEngine used to save common data and configuration among templates, will engross
a single proccessor each API call. Therefore it can run in multi-threaded environment.
More methods of TemplateEngine look into API Javadoc.
(3) Your project may has many engine instances of co-existence with diversity, and they work well
separably without interference.


| # | Representative Works |
|---|---|
| 1 | Eric Hsiao-kuang Wu, Meizhen Chen, “JTCP, Jitter-based for Wireless Networks”, IEEE Journal of Selected Area Communications (JSAC) Vol. 22, No. 4, May 2004, pp. 757-766. (SCI) (Impact Factor: 2.64) |
| # | Important Publications |
|---|---|
| 1 | Eric Hsiao-kuang Wu, Pei-hung Chuang, "Dynamic QoS allocation for Multimedia Ad hoc Wireless Networks", ACM Mobile Networks and Applications (MONET) 6, Aug 2001, pp. 377-384. (SCI) |
| 2 | Chun-Yuah Chiu, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Stability Aware Cluster Routing Protocol for mobile Ad-Hoc Network”, Journal on Wireless Communication and Mobile Computing (WCMC) , vol. 3, no. 4, 2003, pp. 503-515. (SCI) |
| 3 | Ming-Hui Jin, Eric Hsiao-kuang Wu, Jorng-Tzong Horng,” A Decomposition Approach for Fixed Channel Assignment Problems in large scale cellular networks”, Journal of communications and networks, Vol. 5, No. 1, pp. 43-54, March 2003 (SCI)(ISSN 1229-2370). |
| 4 | C.-H. Chang and Eric Hsiao-kuang Wu, “AMRST: Adaptive Multicast Routing for Satellite-Terrestrial Network”, Elsevier Journal of Computer Networks, 43 (2003), pp. 713-734. (SCI) |
| 5 | Eric Hsiao-kuang Wu and Chao-Hsu Chang, “An Intelligent Routing Protocol for the Global Broadband Satellite-Terristrial Network”, Journal of Computers, Vol.15, No 1, March 2003. (EI) |
| 6 | Ming-Hui Jin, Eric Hsiao-kuang Wu, Yu-Ting Wang, Chin-Hua Hsu, “Location Query Based on Moving Behaviors”, Lecture Notes in Computer Science (LNCS) 2736, Sep. 2003, pp. 297-307. (SCI) |
| 7 | Eric Hsiao-kuang Wu, Yi-Zhan Huang, “Dynamic Adaptive Routing for a Heterogeneous Wireless Network”, ACM Mobile Networks and Applications (MONET) Vol. 9, June 2004, pp. 219-233. (SCI) |
| 8 | Ming-Hui Jin, Eric Hsiao-kuang Wu, Chaohsu Chang,” An intelligent Handover Scheme for the next generation Personal Communication System”, Journal of Communications and Networks, Vol. 6, No. 3, September 2004, pp. 245-257. (SCI) (ISSN 1229-2370) |
| 9 | Yi-Hsien Tseng, Eric Hsiao-kuang Wu, Kuen-Long Shieh, and Gen-Huey Chen, “Efficient Resource Allocation for IEEE 802.15.3(a) Ad Hoc Networks”, Lecture Notes in Computer Science (LNCS) 3283, Springer, Nov. 2004, pp. 128-142. (SCI) |
| 10 | Eric Hsiao-kuang Wu, Wei-Ren Yang “Pragmatic General Multicast Congestion Control Protocol for Wireless Networks”, Journal on Wireless Communication and Mobile Computing (WCMC), 2005. (SCI), June 2005, Vol 5, No. 4, pp. 487-499. |
| 11 | Eric Hsiao-kuang Wu, Chiang Jui-Hao and Hsin-Pu Chung,” An Adaptive Scheduled Transmission Strategy for Multimedia Services in WCDMA Systems” Lecture Notes in Computer Science (LNCS) Volume 3619, Springer, July. 2005, pp. 128-142. (SCI )(ISSN: 0302-9743) |
| 12 | Chia-Cheng Hu, Eric Hsiao-kuang Wu, Gen-Huey Chen, Chiang Jui-Hao” Mobility-Aware On-demand Global Hosts for Ad-Hoc Multicast” Lecture Notes in Computer Science (LNCS) Volume 3619, Springer, July. 2005, pp. 128-142. (SCI)( ISSN: 0302-9743) |
| 13 | Chun-Yuan Chiu, Yu-Liang Juo, Eric Hsiao-kuang Wu, Gen-Huey Chen, “An Intelligent Mechanism for Increasing the Bandwidth Utilization of QoS Applications in Ad Hoc Wireless Networks”, WSEAS Transactions on Communications, Issue 11, Vol 4, November 2005, pp. 1237-1243. (SCI, EI) |
| 14 | Eric Hsiao-kuang Wu, Ming-I-Hsieh, Hsu-Te Lai “A Novel Low Latency Packet Scheduling Scheme for Broadband Networks”, to appear in Lecture Notes in Computer Science (LNCS), Springer, Nov. 2005. (SCI) |
| 15 | Eric Hsiao-kuang Wu, Ming-I Hsieh, Chung-Yuan Knight Chang“SARS: A linear Source Model Based Adaptive Rate Control Schme for TCP-Friendly Real Time MPEG-4 Video Streaming”, in Lecture Notes in Computer Science (LNCS), Springer, Nov. 2005. (SCI) |
| 16 | Shyh-Fang Huang, Eric Hsiao-kuang Wu, “Adaptive VoIP smoothing of Pareto Traffic based on Optimal E-model Quality”, to appear in Lecture Notes in Computer Science (LNCS), Springer, Nov. 2005. (SCI) |
| 17 | Chiang-chen Hu, Eric Hsiao-kuang Wu, and Gen-Huey Chen “OGHAM: On-Demand Global Hosts for Mobile Ad-Hoc Multicast Services”, Elsevier Journal of Ad hoc Networks. Vol 6, 2006 (SCI) |
| 18 | Eric Hsiao-kuang Wu, Yu-Hsun Chen and Hsin-Pu Chung,” TASS: An Adaptive Scheduled Transmission Strategy for Multimedia Services in WCDMA Systems” will appear in Lecture Notes in Computer Science (LNCS), Springer, January. 2006. (SCI) |
| 19 | Ming-I Hsieh and Eric Hsiao-kuang Wu, “Postgate: QoS-aware Bandwidth Management for Last-mile ADSL Broadband Services”, WSEAS Transactions on Communications, Issue 5, Vol 5, May 2006. (SCI, EI) |
| 20 | Shyh-Fang Huang, Eric Hsiao-kuang Wu, and Pao-Chi Chang, “A New Optimal Adaptive Voice Smoother Based on Lagranigian Multipler Method for VoIP Service”, WSEAS Transactions on Communications, Issue 5, Vol 5, May 2006. (SCI, EI) |
| 21 | Eric Hsiao-kuang Wu, Ming-I Hsieh, Hsu-Te Lai, “Low latency and efficient packet scheduling for streaming applications”, to in Elsevier Journal of Computer Communications, Volume 29, Issue 9, May 2006, pp. 1413-1421. (SCI) |
| 22 | Shyh-fang Huang, Eric Hsiao-kuang Wu, Pao-Chi Chang, ”Adaptive Voice Smoothing Scheme with Optimal E-Model Method for VoIP services”, in IEICE Transactions on Communications, Vol. E89-B, No. 6, pp. 1862-1868, July 2006. (SCI) |
| 23 | Ming-I Hsieh, Eric Hsiao-kuang Wu, Meng-Feng Tsai, “FasterDSP: A Faster Approximation Algorithm for Directed Steiner Tree Problem” in Journal of Information Science and Engineering (JISE). Nov, 2006 (SCI) |
| 24 | Shyh-Fang Huang, Eric Hsiao-kuang Wu, “Adaptive VoIP smoothing with Optimal Playback Delay Based on the ITU-T E-Model”, in Lecture Notes in Computer Science (LNCS). (SCI) 2006 |
| 25 | Yu-Liang Kuo, Eric Hsiao-kuang Wu, Gen-Huey Chen, “HQR: Hidden Route Aware QoS Routing Protocol for Mobile Ad Hoc Networks”, in WSEAS Transactions on Communications 2006. (SCI) |
| 26 | Eric Hsiao-kuang Wu, Yu-Chen Huang and Gui-Kui Chang, “EJTCP: Enhanced Jitter-based TCP for Wireless Broadband Network”, in Journal of Information Science and Engineering (JISE). Nov 2006 (SCI) |
| 27 | Yi-Hsien Tseng, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Scene-Change Aware Dynamic Bandwidth Allocation for Real-time VBR Video Transmission over IEEE 802.15.3 Wireless Home Networks, in IEEE Transactions on Multimedia, Volume 9, Issue 3, April 2007, pp. 642-654. (SCI) |
| 28 | Ming-Hui Jin, Jorng-Tzong Horng, and Eric Hsiao-kuang Wu, “Location Query Based on Moving Behaviors”, in Elsevier Journal of Information Systems. Volume 32, No. 3, May 2007, pp. 385-401. (SCI) |
| 29 | Yi-Hsien Tseng, Eric Hsiao-kuang Wu, Gen-Huey Chen, “An On-line Measurement-based Admission control for VBR Video Traffic in Wireless Multimedia Home Networks”, in Lecture Notes in Computer Science (LNCS), Springer, June 2007. |
| 30 | Eric Hsiao-kuang Wu, Wei-Li Chang, Hsuan-Hao Chan, “Rate-Adapted Channel Assignment and Routing Algorithm for Multi-Channel WirelessMAN Mesh Networks, in Lecture Notes in Computer Science (LNCS), Springer, June 2007. |
| 31 | Eric Hsiao-kuang Wu, Wei-Li Chang, Chun-Wei Chen, “Gateway Zone Mulit-path Routing in Wireless Mesh Network”, in Lecture Notes in Computer Science (LNCS), Springer, June 2007. |
| 32 | Yu-Chen Huang, Chun-Shien Lu, and Eric Hsiao-kuang Wu, “JitterPath: One-Way Delay Jitter-based Available Bandwidth Estimation for Multimedia QoS”, in IEEE Transactions on Multimedia, Volume 9, Issue 4, June 2007, pp. 798-812 (SCI) |
| 33 | Chun-Yuah Chiu, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “A Reliable and Efficient MAC Layer Broadcast (Multicast) Protocol for Mobile Ad Hoc Networks”, in IEEE Transactions on Vehicular Technology, July 2007, Volume 56, Issue 4, pp. 2296-2305 (SCI) |
| 34 | Eric Hsiao-kuang Wu, Yu-Chen Huang and Gui-Kui Chang, “EJTCP: Enhanced Jitter-based TCP for Wireless Broadband Network”, in Journal of Information Science and Engineering (JISE). Nov 2007 (SCI) |
| 35 | Yu-Hsun Chen, Eric Hsiao-kuang Wu, “Group-based Relay Protocol for Reliable Mutlicast Service for Future Wireless Networks”, in International Journal of Electrical Engineering. 2008 |
| 36 | Chun-Yuah Chiu, Yuliang Kuo, Eric Hsiao-kuang Wu, and Gen-Huey Chen “Bandwidth-Constrained Routing Problem in Wireless Ad-Hoc Networks”, in IEEE Transactions on Parallel and Distributed Systems. Vol 19, No. 1, January 2008, p.p. 4-14. (SCI) |
| 37 | Chiang-chen Hu, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Bandwidth Satisfied Multicast tree in MANETs”, in IEEE Transaction on Mobile Computing, vol. 7, no. 6, pp. 712-723, Feb., 2008 . (SCI) |
| 38 | Yi-Hsien Tseng, Eric Hsiao-kuang Wu, Gen-Huey Chen, “An Admission Control Scheme Based on On-Line Measurement for VBR Video Streams over Wireless Home Networks”, IEEE Transactions on Multimedia. (SCI) 2008, vol. 10, no. 3, pp. 470-479, April, 2008 . (SCI) |
| 39 | Yu-Liang Kuo, Kun-Wei Lai, Frank Yeong-Sung Lin, Yean-Fu Wen, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Multirate Throughput Optimization With Fairness Constraints in Wireless Local Area Networks”, IEEE Transactions on Vehicular Technology. Vol. 58, No. 5, pp. 2417-2425, June 2009. (SCI). |
| 40 | Chiang-Chen Hu, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Stable Backbone Hosts and Stable Multicast Routes in Two-Tier Mobile Ad-Hoc Networks”, in IEEE Transactions on Vehicular Technology. Vol 58, No. 9, pp. 5020-5036 Nov 2009 (SCI). |
| 41 | Pratap Kumar Sahu, Eric Hsiao-kuang Wu, Jagruti Sahoo, Mario Gerla (2010, Dec). DDOR: Destination Discovery Oriented Routing in Highway/Freeway VANETs. Springer Telecommunication Systems, 50, 267-284. (SCI). 本人為通訊作者. |
| 42 | Jyh-Ming Chen, Ching-Hsiang Chu, Eric Hsiao-kuang Wu, Meng-Feng Tsai, and Jian-Ren Wang (2011, Jan). Improving SCTP Performance by Jitter-based Congestion Control over Wired-Wireless Networks. EURASIP Journal on Wireless Communications and Networking, 2011. (SCI). 本人為通訊作者. |
| 43 | Jagruti Sahoo, Eric Hsiao-kuang Wu,Pratap Kumar Sahu, and Mario Gerla (2011, Sep). Binary-Partition-Assisted MAC-Layer Broadcast for Emergency Message Dissemination in VANETs. IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 12, NO. 3, P. 757-P. 770. (SCI). |
| 44 | Hsien-Cheng Weng, Yu-Hsun Chen, Eric Hsiaokuang Wu, and Gen-Huey Chen (2012, May). Correlated Data Gathering with Double Tress in Wireless Sensor Networks. IEEE Sensors Journal., Vol. 62, No.5, pp. 1147-1156. (SCI). 本人為 通訊作者. |
| 45 | Han-Chiuan Luo, Eric Hsiao-Kuang Wu, Gen-Huey Chen (2013, Jan). A Transmission Power/Rate Control Scheme in CSMA/CA-Based Wireless Ad Hoc Networks.. IEEE Transactions on Vehicular Technology., Vol. 62, No. 1, pp.427- 431. (SCI). |
| 46 | Pratap Kumar Sahu, Eric HsiaoKuang Wu, Jagruti Sahoo, Mario Gerla (2013, Mar). BAHG: Back-Bone-Assisted Hop Greedy Routing for VANET's City Environments. IEEE Transactions on Intelligent Transportation Systems. , vol. 14, no. 1, pp. 199-213. (SCI). 本人為通訊作者. |
| 47 | Jyh-Ming Chen, Eric Hsiao-Kuang Wu, Hsiang-Wei Lu, Ching-Hsiang Chu and Meng-Feng Tsai (2013, May). Channel condition self-clocked packet scheduling scheme for wireless networks. EURASIP Journal on Wireless Communications and Networking, 2013:131, pp 1-pp 18. |
| 48 | Pratap Kumar Sahu, Eric HsiaoKuang Wu, Jagruti Sahoo (2013, Aug). DuRT: Dual RSSI Trend Based Localization for Wireless Sensor Networks. IEEE sensor journal, Vol. 13. No. 8. pp. 3115-3123. (SCI). 本人為通訊作者. |
| 49 | Jagruti Sahoo, Eric Hsiaokuang Wu, Pratap Kumar Sahu, Mario Gerla (2013, Sep). Congestion Controlled Coordinator based MAC for Safety-Critical Message Transmission in VANETs. IEEE Transactions on Intelligent Transportation Systems., Vol. 14, No. 3, pp 1423-1437. (SCI). 本人為通訊作者. |
| 50 | Eric Hsiao-kuang Wu,*, Jagruti Sahoo, Chi-Yun Liu, Ming-Hui Jin, Shu Hui Lin (2014, Jan). “Agile Urban Parking Recommendation Service for Intelligent Vehicular Guiding System.” IEEE Intelligent Transportation Systems Magazine, 6(1):35-49. (SCI). |
| 51 | Lyu-Han Chen, Eric Hsiao-kuang Wu, Ming-Hui Jin, and Gen-Huey Chen (2014, Apr). “Homogeneous Features Utilization to Address the Device Heterogeneity Problem in Fingerprint Localization.” IEEE Sensors Journal, 14(4):998-1005. (SCI). |
| 52 | Lyu-Han Chen, Eric Hsiao-kuang Wu, Ming-Hui Jin, and Gen-Huey Chen (2014, Nov). “Intelligent Fusion of Wi-Fi and Inertial Sensor-Based Positioning Systems for Indoor Pedestrian Navigation.” IEEE Sensor Journal, Vol. 14 No. 11, pp. 4034-4042. (SCI). |
| 53 | Cheng Yu-Chun, Cheng-Fu Chou, Eric Hsiaokuang Wu, Gen-Huey Chen (2015, Oct). A Cognitive TCP Design for a Cognitive Radio Network with an Unstable- Bandwidth Link. IEEE Transactions on Computer, Vol. 64 No. 10 , pp.2730- 2740. (SCI). 本人為通訊作者. |
| 54 | Shu-Hui Lin, Chung-Yu Chen, Eric Hsiao-Kuang Wu, Ching-Yao Chan, Emery Jou (2016, Jan). A New e-Bus System Using Two-Way Government Radio Networks. IEEE Intelligent transportation systems magazine, Vol. 8 No. 1, pp.51-60. 本人為通訊作者. |
| 55 | Yu-Chun Cheng, Eric Hsiao-kuang Wu, Gen-Huey Chen. “A Decentralized MAC Protocol for Unfairness Problems in Coexistent Heterogeneous Cognitive-Radio-Networks Scenarios with Collision-Based Primary Users.” IEEE Systems Journal, Vol. 10, No. 1, pp. 346-357, March 2016. (SCI). |
| 56 | Binayak Kar, Eric Hsiao-kuang Wu, and Ying-Dar Lin "The Budgeted Maximum Coverage Problem in Partially Deployed Software Defined Networks"IEEE TRANSACTIONS ON NETWORK AND SERVICE MANAGEMENT, VOL. 13, NO. 3, SEPTEMBER 2016, pp 394- 406. |
| 57 | Min-Te Sun, Ching-Hsiang Chu,Eric Hsiao-Kuang Wu, Member, and Chi-Sen Hsiao (2016, Dec). Efficient Articulation Point Collaborative Exploration for Reliable Communications in Wireless Sensor Networks. IEEE SENSORS JOURNAL , VOL. 16, NO. 23, PP. 8578-8588. 本人為通訊作者. |
| 58 | Yu-Hsun Chen, Chia-Cheng Hu, Eric Hsiao-Kuang Wu, Shu-Min Chuang, and Gen-Huey Chen (2017, Jan). A Delay-Sensitive Multicast Protocol for Network Capacity Enhancement in Multirate MANETs. IEEE Systems Journal. (Accepted). 本人為通訊作者. |
| 59 | Min-Te Sun, Ching-Hsiang Chu, Eric Hsiao-Kuang Wu, Chi-Sen Hsiao, and Andy An-Kai Jeng (2017, Mar).Distributed Topology Control for Energy-Efficient and Reliable Wireless Communications. IEEE Systems Journal, (accepted). 本人為通訊作者 |
| 60 | Yu-Hsun Chen, Eric Hsiao-Kuang Wu and Gen-Huey Chen (2017, Jun). Bandwidth-Satisfied Multicast by Multiple Trees and Network Coding in Lossy MANETs. IEEE Systems Journal, Volume: 11, Issue:2, pp. 1116-1127. 本人為通 訊作者. |
| 61 | Yu-Hsun Chen, Eric Hsiaokuang Wu, Jiun-Han Lin, and Gen-Huey Chen, "Bandwidth-Satisfied and Coding-Aware Multicast Protocol in MANETs, (2017 accepted) IEEE Transactions on Mobile Computing, to appear. |
| 62 | Binayak Kar, Eric Hsiao-Kuang Wu, and Ying-Dar Lin,"Energy Cost Optimization with Dynamic Virtualized Network Function Chain Placement," (2018, Mar) IEEE Transactions on Network and Service Management, Volume: 15, Issue: 1, pp.372-386 |
| # | International Conference Proceedings |
|---|---|
| 1 | Eric Hsiao-kuang Wu, Ming-Hui Jin, Jorng-Tzong Horng, “Personal Paging Area Design Based On Mobiles Moving Behaviors”, Proceedings of IEEE Infocom 2001, April 2001. |
| 2 | Eric Hsiao-kuang Wu, Ming-Hui Jin, Jorng-Tzong Horng,” An Evolutionary Approach to Fixed Channel Assignment Problems with Limited Bandwidth Constraint”, Proceedings of IEEE ICC 2001, June 2001. |
| 3 | Eric Hsiao-kuang Wu, Chao-hsu Chang, “Adaptive Multicast Routing for Satellite-Terrestrial Network”, Proceedings of IEEE Globecom 2001, Nov 2001. |
| 4 | Eric Hsiao-kuang Wu, Yi-Zhan Huang, Jui-Hao Chiang, “Dynamic Adaptive Routing for Heterogeneous Wireless Network”, Proceedings of IEEE Globecom 2001, Nov 2001. |
| 5 | Eric Hsiao-kuang Wu, Yao-Hsin Chou, “Prompt Connecting Mechanism and Multiple-code Support for Bluetooth Personal Area Network”, Proceedings of European Wireless 2002. |
| 6 | Ming-Hui Jin, Eric Hsiao-kuang Wu, and Jorng-Tzong Horng, “An Intelligent Handoff Scheme Based on Location Prediction Technologies”, Proceedings of European Wireless 2002. |
| 7 | Hand-Chiuan Luo, Eric Hsiao-kuang Wu, Gen-Huey Chen, and Jui-Hao Chiang, “A Fast Bluetooth Symmetric Link Protocol-SF/CAI (Scan First/Collision Avoidance Inquire), Proceedings of European Wireless 2002 |
| 8 | Laner Yu-Liang Kuo, Eric Hsiao-kuang Wu, G.H. Chen, “Intra-Cell Predictive Reservation Schme for Wireless Multimedia Networks”, Proceedings of ICWN’2002. |
| 9 | Eric Hsiao-kuang Wu, Hao-Wei Chang, Shi-Yang Chen, Chunhung Lin” Performance Evaluation of HMA Transmission Strategy in WCDMA downlink”, Proceedings of IEEE ICWN’2002 |
| 10 | Ming-Hui Jin, Eric Hsiao-kuang Wu, Jorng-Tzong Horng, “Location Query Based on Moving Behavior”, Proceedings of IEEE ICCCN’2002. |
| 11 | Cha-hsu Chang, Eric Hsiao-kuang Wu,”An Intelligent Multicast Protocol for Satellite Terrestrial Broadband Network”, Proceedings of IEEE ICCCN’ 2002. |
| 12 | Ming-Hui Jin, Eric Hsiao-kuang Wu, Jorng-Tzong Horng,” A Channel Allocation Algorithm for large scale cellular networks” Proceedings of IEEE ICPADS’2002 |
| 13 | Chun-Yuah Chiu, Eric Hsiao-kuang Wu, Gen-Huey Chen, “Stability Aware Cluster Routing Protocol for Mobile Ad Hoc Network”, Proceedings of IEEE ICPADS’2002. |
| 14 | Eric Hsiao-kuang Wu, Hao-Wei Chang, Kevin Chihcheng Hsu” A QoS-based Hybrid Multiple Access Transmission Strategy in WCDMA downlink”, Proceedings of IEEE WCNC 2003 |
| 15 | Shi-Yang Chen, Eric Hsiao-kuang Wu, Yi-Shuang Chen, “A New Approach Using Time-Based Model for TCP-Friendly Rate Estimation”, Proceedings of IEEE ICC2003 |
| 16 | Chiang-chen Hu, Eric Hsiao-kuang Wu, and Gen-Huey Chen OGHAM：On-demand Global Hosts for Ad-hoc Multicast using Minimum Distance Facility Location”, Proceedings of IEEE ICC2003 |
| 17 | Ming-Hui Jin, Eric Hsiao-kuang Wu, Jorng-Tzong Horng, Chen-Yan Kao, “Location Query Based on Moving Behaviors”, Proceedings of ACM Dexa 2003 |
| 18 | Yi-Hsien Tseng, Eric Hsiao-kuang Wu, Gen-Huey Chen, “Maximum Traffic Scheduling and Capacility for IEEE 802.15.3 High Data Rate MAC Protocol”, Proceedings of IEEE VTC 2003. |
| 19 | Yu-Liang Kuo, Eric Hsiao-kuang Wu, Gen-Huey Chen, “Throughput Analysis of the Enhanced Distributed Coordination Function in the IEEE 802.11 e”, Proceedings of IEEE VTC 2003. |
| 20 | Ming-Hui Jin, Eric Hsiao-kuang Wu, Yun-Bin Liao, Hui-Chun Liao, “802.11-based positioning system for Context Aware Applications”, Proceedings of IEEE Globecom 2003. |
| 21 | Yu-Liang Juo, Chi-Hung Lu, Eric Hsiao-kuang Wu, Gen-Huey Chen, “An Admission Control Stragegy for Differentiated Service in IEEE 802.11”, Proceedings of IEEE Globecom 2003. |
| 22 | Eric Hsiao-kuang Wu, Hsu-Te Lai, Meng-feng Tsai,” Low Latency and Efficient Packet Scheduling for Streaming Applications”, Proceedings of IEEE ICC 2004. |
| 23 | Eric Hsiao-kuang Wu, Chien-Shao Tseng, ChungYuan Chang, Meng-feng Tsai,”TMRC: A Load-Adaptive TCP-Friendly Rate Control Protocol for Real Time Multimedia Applications” Proceedings of IEEE ICC2004. |
| 24 | Chia-Hao Hsu, Yu-Liang Kuo, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “QoS Routing in Mobile Ad hoc Networks based on Enhanced Distributed Coordination Function”, Proceedings of IEEE VTC 2004. |
| 25 | Hung-Wei Tseng, Shih-Hsien Yang, Po-Yu Chuang, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “An Energy Consumption Analytic Model for A Wireless Sensor MAC Protocol”, Proceedings of IEEE PIMRC 2004, Spain. |
| 26 | Eric Hsiao-kuang Wu, Ming-I Hsieh, Zhi-Hao, and Jen-Yuang Chiang, “Application Layer Multipoint Conference Using SIP”, Proceedings of IEEE PIMRC 2004, Volume 3, p2129-2133, Sep 2004, Spain. |
| 27 | Eric Hsiao-kuang Wu, Ming-I Hsieh, Mei-Zhen Chen, and Shao-Yi Huang, “JTCP: Congestion Distinction by the Jitter-based Scheme over Wireless Networks”, Proceedings of IEEE PIMRC 2004. Volume 4, p2473-2477, Sep 2004. |
| 28 | Jui-Hao Chiang, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Location-aware Routing for Ultra-wideband Wireless Ad hoc Networks”, Proceedings of Intelcomm 2004. |
| 29 | Yi-Hsien Tseng, Eric Hsiao-kuang Wu, Kuen-Long Shieh, and Gen-Huey Chen, “Efficeint Resource Allocation for IEEE 802.15.3(a) Ad Hoc Networks”, Proceedings of Intelcomm 2004, pp. 297-307. |
| 30 | Chun-Yuah Chiu, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “A Reliable and Efficient MAC Layer Broadcast (Multicast) Protocol for Mobile Ad Hoc Networks”, Proceedings of Globecom 2004, Dallas, Texas. |
| 31 | Yu-Chen Huang, Chun-Shien Lu, and Eric Hsiao-kuang Wu, “Reliable Available Bandwidth Estimation based on Distinguishing Queueing Regions and Resolving False Estimation” Proceedings of IEEE Globecom 2004, Dallas, Texas. |
| 32 | Yu-Liang Kuo, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Noncooperative Admission Control for Differentiated Services in IEEE 802.11 WLANs: Game Theoretic Framework”, Proceedings of IEEE Globecom 2004, Dallas, Texas. |
| 33 | Yi-Hsien Tseng, Eric Hsiao-kuang Wu, Kuen-Long Shieh, and Gen-Huey Chen, “Adaptive Real Time Video Traffic Preditor for IEEE 802.15.3 Wireless Ad Hoc Networks”, 4th Mediterranean Workshop on Ad-Hoc Networks (MED-HOC-NET) 2005, Ile de Porquerolles, June 21-24, 2005 |
| 34 | Yu-Liang Kuo, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Admission Control for Differentiated Service in Wireless Mesh Networks” Meshnets workshop, July 2005 |
| 35 | Chiang-chen Hu, Eric Hsiao-kuang Wu, and Gen-Huey Chen OGHAM：”Bandwidth-Satisfied Multicast Trees in MANETs”, Proceedings of IEEE International Conference on Wireless and Mobile Computing, Networking and Communications (IEEE WiMob’ 2005), Canada, August 2005. |
| 36 | Chun-Yuan Chiu, Yu-Liang Juo, Eric Hsiao-kuang Wu, Gen-Huey Chen, “An Intelligent Mechanism for Increasing the Bandwidth Utilization of QoS Applications in Ad Hoc Wireless Networks”, Proceedings of 2005 WSEAS International Conference on Applied Electrognetics, Wireless and Optical Communications, Corfu, Greece, August 2005. |
| 37 | Chiang-chen Hu, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Two Bandwidth Violation Problem and Bandwidth-Satisfied Multicast Trees in MANETs”, 10th IFIP International Conference on Personal Wireless Communications PWC 2005, Paris, August, 2005. |
| 38 | Eric Hsiao-kuang Wu, Ming-I-Hsieh, Hsu-Te Lai “A Novel Low Latency Packet Scheduling Scheme for Broadband Networks”, in Proceedings of PCM 2005, Nov. 2005. |
| 39 | Eric Hsiao-kuang Wu, Ming-I Hsieh, Chung-Yuan Knight Chang“SARS: A linear Source Model Based Adaptive Rate Control Schme for TCP-Friendly Real Time MPEG-4 Video Streaming”, in Proceedings of PCM 2005, Nov. 2005. |
| 40 | Shyh-Fang Huang, Eric Hsiao-kuang Wu, “Adaptive VoIP smoothing of Pareto Traffic based on Optimal E-model Quality”, in Proceedings of PCM 2005, Nov. 2005. |
| 41 | Yu-Liang Kuo, Kun-Wei Lai, Frank Yeong-Sung Lin, Yean-Fu Wen, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Multirate Throughput Optimization for Wireless Local Wireless Network Abnomaly Problem”, in Proceedings of IEEE Broadnet’ 2005, Boston, 2005. |
| 42 | Shih-Hsien Yang_, Hung-Wei Tseng_, Eric Hsiao-kuang Wuy, and Gen-Huey Chen, “Utilization Based Duty Cycle Tuning MAC Protocol for Wireless Sensor Networks”, in Proceedings of IEEE Globecom 2005, Dec 2005. |
| 43 | Yu-Chen Huang, Chun-Shien Lu, and Eric Hsiao-kuang Wu, “Available Bandwidth Estimation via One-Way Delay Jitter and Queueing Delay Propagation Model”, in Proceedings of IEEE WCNC 2006, Las Vegas, U.S.A. |
| 44 | Yu-Liang Kuo, Eric Hsiao-kuang Wu, Gen-Huey Chen, “Hidden Route Aware QoS Routing Protocol for Mobile Multimedia Ad Hoc Networks”, in Proceedings of Applications of Electrical Engineering (AEE ‘ 06) , Prague, Czech Republic, March 12-14, 2006. |
| 45 | Ming-I Hsieh and Eric Hsiao-kuang Wu, “Postgate: QoS-aware Bandwidth Management for Last-mile ADSL Broadband Services”, WSEAS 5th WSEAS Int. Conf. on APPLIED COMPUTER SCIENCE (ACOS '06) May, 2006. |
| 46 | Shyh-Fang Huang, Eric Hsiao-kuang Wu, and Pao-Chi Chang, “A New Optimal Adaptive Voice Smoother Based on Lagranigian Multipler Method for VoIP Service”, 6th WSEAS Int. Conf. on MULTIMEDIA SYSTEMS & SIGNAL PROCESSING (MUSP '06), May 2006. |
| 47 | Shao-Yi Hung, Po-Yu Chuang, Yi-Hsieng Tseng, Eric Hsiao-kuang Wu, and Gen-Huey Chen, “Energy Efficient TCP Transmission for IEEE 802.15.3 WPAN, in Proceedings of IEEE PIMRC 2006, Helsinki, Finland, September, 2006. |
| 48 | Shang-Chin Hung, Shao-Yi Hung, Eric Hsiao-kuang Wu, and Gen-Huey Chen, ”A Decentralized CR System Algorithm for Cognitive Borrowing Scheme from Primary Users”, in Proceedings of IEEE PIMRC 2006, Helsinki, Finland, September, 2006. |
| 49 | Yi-Hsien Tseng, Eric Hsiao-kuang Wu, Gen-Huey Chen, “An On-line Measurement-based Admission control for VBR Video Traffic in Wireless Multimedia Home Networks”, in Proceedings of IFIP Networking 2007, May 2007. |
| 50 | Eric Hsiao-kuang Wu, Wei-Li Chang, Hsuan-Hao Chan, “Rate-Adapted Channel Assignment and Routing Algorithm for Multi-Channel WirelessMAN Mesh Networks, in Proceedings of UIC 2007, June 2007. |
| 51 | Eric Hsiao-kuang Wu, Wei-Li Chang, Chun-Wei Chen, “Gateway Zone Mulit-path Routing in Wireless Mesh Network”, in Proceedings of UIC 2007, June 2007. |
| 52 | Hsien-Cheng Weng¤, Eric Hsiao-kuang Wuy, and Gen-Huey Chen, “A 2-Approximation Double-Tree Algorithm for Correlated Data Gathering in Wireless Sensor Networks”, in Proceedings of IEEE Globecom 2007, December 2007. USA. |
| 53 | Chia-Chen Hung, Eric Hsiao-kuang Wu, “Mobility Pattern Aware Routing for Heterogeneous Vehicular Networks”, in IEEE WCNC 2008, April 2008, U.S.A. |
| 54 | Shao-Yi Hung, Yu-Chen Cheng, Eric Hsiao-kuang Wu, Gen-Huey Chen, “An Opportunistic Cognitive MAC Protocol for Coexistence with WLAN”, in IEEE ICC 2008, May 2008, China. |
| 55 | Eric Hsiao-kuang Wu, Pratap Kumar Sahu, Jagruti Sahoo, “Destination Discovery Oriented Position Based Routing in VANET”, in Proceedings of IEEE VON 2008, Nov 2008, Taiwan. |
| 56 | Eric Hsiao-kuang Wu, Hubert Chi-Yu Wu, Yi-Kai Chiang, Yu-Che Hsieh, Jih-Cheng Chiu, Kuan-Ru Peng, “A Context Aware Interactive Robot Educational Platform”, in Proceedings of IEEE Digital Games and Intelligent Toys Based Education, Nov 2008, Canada. |
| 57 | Eric Hsiao-kuang Wu*, Yong-Lung Ding, Ji-Yuang Liu, Yi-Kai Chiang, "A Context Aware Interactive Robot for Broadband Wireless Learning", in 10th International Conference on Mobile Data Management 2009, May, Taiwan |
| 58 | Jagruti Sahoo, Eric Hsiao-kuang Wu, Mario Gerla, “BPAP: Binary Partition Assisted Emergency Broadcast Protocol for Vehicular Ad Hoc Networks”, in Proceedings of IEEE ICCCN 2009, August, U.S.A. |
| 59 | Yu-Hsun Chen, Chia-Cheng Hu, Eric Hsiao-kuang Wu, Gen-Huey Chen, “Delay-Guaranteed Multicast Routing in Multi-Rate MANETs”, in Proceedings of IEEE Globecom 2009, Nov 2009, Honolulu. |
| 60 | Yu-Hsun Chen, Gen-Huey Chen, and Eric Hsiaokuang Wu (2010, Sep). Multiple trees with network coding for efficient and reliable multicast in MANETs. IEEE 2010 International Conference on Parallel Processing Workshops (ICPPW) , U.S.A.. |
| 61 | Lyu-Han Chen, Gen-Huey Chen, Ming-Hui Jin, and Eric Hsiaokuang Wu (2010, Sep). A Novel RSS-based Indoor Positioning Algorithm Using Mobility Prediction. IEEE 2010 International Conference on Parallel Processing Workshops (ICPPW), U.S.A.. |
| 62 | Yu-Chun Cheng, Eric Hsiaokuang Wu, and Gen-Huey Chen (2010, Nov). A New Wireless TCP Issue in Cognitive Radio Networks. The First International Conference on Networking and Computing. |
| 63 | Han-Chiuan Luo, Eric Hsiaokuang Wu and Gen-Huey Chen (2011, Sep). From Spatial Reuse to Transmission Power Control for CSMA/CA Based Wireless Ad Hoc Networks. IEEE ICPP 2011, Taiwan. |
| 64 | Han-Chiuan Luo, Eric Hsiaokuang Wu and Gen-Huey Chen (2011, Nov). Minimizing Ceased Areas with Power Control for Spatial Reuse in IEEE 802.11 Ad Hoc Networks. IEEE ICPADS 2011, Taiwan. |
| 65 | Lyu-Han Chen, Eric Hsiao-Kuang Wu, Ming-I, Jorng-Tzong Horng, Gen-Huey Chen (2012, Jul). Credit-based Low Latency Packet Scheduling Algorithm for Real Time Applications. 2012 IEEE International Conference on Communication, Networks and Satellite (IEEE COMNETSAT 2012), Indonesia. 本人為通訊作者. |
| 66 | Eric Hsiao-kuang Wu, S.S. Yen, W.T. Hsiao, C.H, Tsai, Y.J. Chen, W.C. Lee,Yu- Wei Chen (2013, Aug). Cross-platform Mobile Personal Health Assistant APP Development for Health Check . IWNA 2013 - 2013 International Workshop on Networking and Applications (IWNA 2013) , Taipei. 本人為第一作者、通訊作 者. |
| 67 | Eric Hsiao-Kuang Wu, Chung-Yu Chen, Ming-Hui Jin and Shu-Hui Lin (2013, Aug). Innovative Wireless Dedicated Network for e-Bus. IWNA 2013 - 2013 International Workshop on Networking and Applications (IWNA 2013) , Taipei. 本人為第一作者、通訊作者. |
| 68 | Eric Hsiao-kuang Wu, C.C. Tseng, Y.Y. Yang, P.Y. Cai, S.S. Yen,Yu-Wei Chen (2013, Aug). Cross-platform And Light-weight Stroke Rehabilitation System for New Generation Pervasive Healthcare . IWNA 2013 - 2013 International Workshop on Networking and Applications (IWNA 2013) . 本人為第一作者、通 訊作者. |
| 69 | Binayak Kar and Eric Hsiao-kuang Wu (2013, Aug). Authentication of Real-time Communication System using KIS Scheme. IWNA 2013 - 2013 International Workshop on Networking and Applications (IWNA 2013) , Taipei. 本人為通訊 作者. |
| 70 | Ching-Hsiang Chu, Jyh-Ming Chen, and Eric Hsiao-Kuang Wu (2013, Nov). A New Transport Protocol for Cloud Servers. The 6th IEEE International Conference on Ubi-Media Computing , Japan. 本人為通訊作者. |
| 71 | Eric Hsiao-Kuang Wu,Chi-WeiLiao (2015, Jul). Design of a Customized Video Player Framework for Android Learning TV . The International Conference on Engineering and Natural Science, Tokyo, Japan. 本人為第一作者、通訊作者. |
| 72 | Eric Hsiaokuang Wu, Yen-Hui Kuo, Chen-Yen Shih, Hsiao-Ping Huang (2016).A DRM System for Multimedia Content in Mobile Applications . The International Conference on Engineering and Natural Science (ICENS-Summer 2016), Kyoto, Japan. 本人為第一作者、通訊作者. |
| 73 | Shumin Chuan, Eric Hsiaokuang Wu, Ding-Jie Huang (2017, Aug). Clock Skew based Security Enhancement for Machine Type Communication Devices. The International Conference on Engineering and Natural Science, Sapporo, Japan. |
| 74 | Shumin Chuang, Wen-Dian Xia, Feng-Chun Hs, Jorng-Tzong Horng, Eric Hsiao-Kuang Wu (2017, Aug). Messager System for K-12. The Internal Conference on Engineering and Natural Science, Sapporo, Japan. 本人為通訊作者. |
| # | Project Name | Work As | Period | Project ID | Commissioned Agency |
|---|---|---|---|---|---|
| 1 | EWAMIS (Wireless Adaptive Mobile Information System) | Project Research Assistance | 1993/9/1 ~ 1997/8/31 | J-FBI-93-112 | 美國國防部 ARPA/CSTO |
| 2 | 無基地台無線行動網路的語音支援 | Principal Investigator | 1998/1/1 ~ 1998/7/1 | JNSC 87-2218-E-008-029 | 行政院國科會 |
| 3 | 具服務品質保證的行動多媒體資訊系統法 "Mobile Multimedia information System With Quality of Service" 子計畫四︰提供服務品質保證的無線子網路系統 | Principal Investigator | 1998/8/1 ~ 1999/7/31 | JNSC 88-2213-E-008-016 | 行政院國科會 |
| 4 | 可從新商議服務品質保證的無線ATM網路 | Principal Investigator | 1998/8/1 ~ 1999/7/31 | NSC 88-2213-E-008-028 | 美行政院國科會 |
| 5 | 衛星直撥網際網路與遠距教學計畫 | Principal Investigator | 1998/9/1 ~ 1999/6/31 | 行政院教育部 | |
| 6 | 國內個人通信產業環境建構規劃研究 | Technical Standard Team Co-Principal Investigator | 1998/6/1 ~ 1999/4/31 | NII產業發展協進會 | |
| 7 | 具服務品質保證的行動多媒體資訊系統法"Mobile Multimedia information System With Quality of Service"子計畫四︰提供服務品質保證的無線子網路系統 (II) | Principal Investigator | 1999/8/1 ~ 2000/7/31 | NSC 88-2213-E-008-016 | 行政院國科會 |
| 8 | LMDS 無線寬頻網路實驗 | Principal Investigator | 1999/9/1 ~ 2000/6/31 | J-FBI-93-112 | 美國休斯網路公司 |
| 9 | 大學追求卓越計畫第一分項子計畫二：隨身學習資訊系統 | Principal Investigator | 1999/1/1 ~ 2000/12/31 | 美行政院教育部 | |
| 10 | WAP Developments 研究 | Principal Investigator | 2000/5/1 ~ 2001/2/31 | 台灣大哥大股份有限公司 | |
| 11 | GRPS 研究 | Principal Investigator | 2000/5/1 ~ 2001/4/31 | 台灣大哥大股份有限公司 | |
| 12 | 多媒體與多重服務之數位用戶迴路通訊系統-子計劃五:xDSL網路上支援可調式服務 | Principal Investigator | 2000/8/1 ~ 2001/7/31 | NSC 89-2218-E-008-022 | 美行政院國科會 |
| 13 | Cellular IP for 3GPP | Principal Investigator | 2001/6/1 ~ 2001/12/31 | 資策會(III) | |
| 14 | 多媒體與多重服務之數位用戶迴路通訊系統-子計劃五 (II): xDSL網路上支援可調式服務 | Principal Investigator | 2001/8/1 ~ 2002/7/31 | NSC 89-2218-E-008-022 | 美行政院國科會 |
| 15 | 由3G UMTS演化到ALL IP 核心網路架構及功能之研究 | Principal Investigator | 2002/1/1 ~ 2002/12/31 | 911262 | 資策會 |
| 16 | 具適性及高互動性之隨身學習系統 | Principal Investigator | 2002/4/1 ~ 2003/3/311 | 911823 | 教育部 |
| 17 | 802.11為基礎的新一代無線個人通訊系統 | Principal Investigator | 2002/8/1 ~ 2003/7/31 | NSC91-2213-E-008-046 | 行政院國科會 |
| 18 | Triangle Boy 網路安全 – 三角小子研究 | Principal Investigator | 2002/7/1 ~ 2003/6/30 | J-FBI-93-112 | 通訊中心 |
| 19 | SNMPv3 實作 | Principal Investigator | 2002/7/1 ~ 2002/12/31 | 台達電子公司 | |
| 20 | IP協定中語音、傳真、影像封包鑑識與還原技術研究 | Principal Investigator | 2003.03.01 ~ 2003.12.31 | 通訊中心 | |
| 21 | IP協定中檔案傳輸(FTP)封包鑑識與還原技術研究 | Principal Investigator | 2003.08.01 ~ 2003.12.31 | 921332 | 通訊中心 |
| 22 | 3GPP最新技術規範演進之研究 | Principal Investigator | 2003.01.01 ~ 2003.12.31 | 921673 | 資訊工業策進會 |
| 23 | 隨身學習資訊系統--具適性及高互性之隨身學習系統 | Principal Investigator | 2003.04.01 ~ 2004.4.30 | 921326 | 教育部 |
| 24 | IEEE 802.11競爭模式下品質保證實現以支援新世代時效性服務 | Principal Investigator | 2003.08.01 ~ 2004.7.31 | 922157 (編號:NSC92-2213-E-008-038) | 行政院國家科學委員會 |


Basically Speaking
问题描述 :
The Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company that it would be neato if this new calculator could convert among number bases. The company thought this was a stupendous idea and has asked your team to come up with the prototype program for doing base conversion. The project manager of the Super Neato Model I calculator has informed you that the calculator will have the following neato features:
It will have a 7-digit display.
It will have a 7-digit display.
Its buttons will include the capital letters A through F in addition to the digits 0 through 9.
It will support bases 2 through 16.
输入:
The input for your prototype program will consist of one base conversion per line. There will be three numbers per line. The first number will be the number in the base you are converting from. The second number is the base you are converting from. The third number is the base you are converting to. There will be one or more blanks surrounding (on either side of) the numbers. There are several lines of input and your program should continue to read until the end of file is reached.
输出:
The output will only be the converted number as it would appear on the display of the calculator. The number should be right justified in the 7-digit display. If the number is to large to appear on the display, then print "ERROR” (without the quotes) right justified in the display.
样例输入:
1111000 2 10 1111000 2 16 2102101 3 10 2102101 3 15 12312 4 2 1A 15 2 1234567 10 16 ABCD 16 15
样例输出:
120 78 1765 7CA ERROR 11001 12D687 D071
地址：http://acm.hdu.edu.cn/showproblem.php?pid=1335
题意：前面是一个7位a进制数，表示成后面的进制。如果超过7位则输出ERROR。直接模拟。
代码：
# include <stdio.h> char str[40] ; int chartonum(char ch) { if (ch >= '0' && ch <= '9') return ch-'0' ; return ch-'A'+10 ; } int gao(char str[], int b) { int i, rtn = 0 ; for (i = 0 ; str[i] ; i++) { if (chartonum(str[i])>=b) return -1 ; rtn = rtn*b + chartonum(str[i]) ; } return rtn ; } void gao2(int num, int b) { int i, cnt = 0 ; char s[40], tab[] = "0123456789ABCDEF" ; while (num) { s[cnt++] = tab[num%b] ; num /= b ; } if (cnt > 7){ printf ("%7s\n", "ERROR") ; return ; } for (i = 0 ; i < cnt ; i++) str[cnt-i-1] = s[i] ; str[cnt] = '\0' ; printf ("%7s\n", str) ; } int main () { int num, b1, b2 ; while (~scanf ("%s %d %d", &str, &b1, &b2)) { num = gao(str, b1) ; if (num == -1) printf ("%7s\n", "ERROR") ; gao2(num, b2) ; } return 0 ; }
解题报告转自：http://www.cnblogs.com/lzsz1212/archive/2012/02/16/2353534.html
(adsbygoogle = window.adsbygoogle || []).push({});
信息不全
。。。
97行缺一个分号
第二种想法，我想来好久，为啥需要一个newhead，发现是把最后一个节点一直返回到嘴上面这层函数。厉害，这道题之前没样子想过。
#include <cstdio>
int main() {
//answer must be odd
int n, u, d;
while(scanf("%d%d%d",&n,&u,&d)==3 && n>0) {
if(n<=u) { puts("1"); continue; }
n-=u; u-=d; n+=u-1; n/=u;
n<<=1, ++n;
printf("%dn",n);
}
return 0;
}
失误失误，转载错了。已经改正，抱歉。
#!/usr/bin/env python def cou(n): arr = [1]
以了解 想問為甚麼 Tbl[6001] = {1} 初始化都是1
為何不是Tbl[0]=1 其他為0
通不过。
其实就是DFS搜索，数据量较小，穷举了所有情况
居然看懂了
好吧~
哇，算法有这么多呢！
int L[m+1][n+1];这样定义出错，这个在gcc上可以编译通过 在VS上不行 应该改为new 或者vector


Toggle navigation
Edit Profile
Change Password
Logout
Search Job
Overview
My Profile
Edit Profile
Job Preference
Basic Information
Education
Training
Work Experience
Document
Social Account
My Status
Setting
Privacy Setting
Change Email
Change Password
Social Account
Work Experience
Deactive Accounts
Advanced Search
Job Categories:
Technician
Programming / Graphics / Designing
Search Engine Optimization (SEO)
Cloud Computing
Accounting / Finance
Pharma / Biotech
Architecture / Interior Designing
Banking / Financial Services
Logistics / Supply Chain / Procurement
Project Management
Construction / Engineering
Fashion / Textile Designing
Management / Operations
Hospitality
Human Resource
Telecommunication
Journalism / Editor / Media
Legal Services
Marketing / Advertising
NGO / INGO / Social work
Maintenance / Quality
Security Services
Research and Development
Sales / Distribution
Secretary
Teaching / Education
Others
Purchasing / Procurement
Manufacturing / Production
Training / Trainer
Public Relation
Professional Services
Internship
Finance / Administration
IT / Software
Business Development
Development Work/Consulting Service
Customer Service / Data Entry
Executive
Government
Healthcare / Medical
Agriculture / Livestock
Customer Service
Clerk
Various
IT / Database Management
Insurance
Aviation
Scholarship/Grant
EOI/Tender/Bids
Repair & Maintenance
Computer Operator
Engineering/Civil /Architecture
Engineering - Computer/ Electrical
Promotion/Branding
Event Management
Development/ Program Managment
International Relation
Monitoring & Evaluation
Driver
Documentation/Writing
Engineering
Cook / Catering
Engineering - Mechanical/Automobile
Front Desk
Travel / Tour / Ticketing
Industries :
Airlines / GSA
Audit Firms / Tax Consultant
Architecture / Interior Design Firm
Advertising Agency
Information / Computer / Technology
Insurance Companies
Software Companies
Others
Level:
Top Level
Senior Lavel
Mid Level
Entry Level
Employment Type :
Full Time
Part Time
Contract
Showing 1 - 6 of 8
Web Designer
Facebook
Tripureswor, Kathmandu
Experience : Not Required
Web Designer
Facebook
Tripureswor, Kathmandu
Views: 567
|
Deadline: 2 days
Web Designer
Facebook
Tripureswor, Kathmandu
Experience : Not Required
Web Designer
Facebook
Tripureswor, Kathmandu
Experience : Not Required
Web Designer
Facebook
Tripureswor, Kathmandu
Experience : Not Required
Web Designer
Facebook
Tripureswor, Kathmandu
Experience : Not Required
Prev
1
2
3
4
5
Next


Ayodhya verdict: Jamiat Ulama-i-Hind to file review petition
The organisation observed that the judgment was against the Muslim parties and it was not a final judgment as the option of reviewing it is available under the Constitution of India
by PTIThe Jamiat Ulama-i-Hind will file a review petition challenging the Supreme Court’s Ayodhya verdict, the prominent Muslim organisation’s chief Maulana Arshad Madani said on Sunday.
The decision was taken after the Jamiat’s highest decision-making body, the working committee, gave its nod for filing the review petition following extensive deliberations involving lawyers and experts.
The panel under the chairmanship of Mr. Madani delved into the prospects of a review petition challenging the apex court verdict, a statement by Jamiat said.
The expert panel observed that the judgment was against the Muslim parties and it was not a final judgment as the option of reviewing it is available under the Constitution of India, it said.
Settling a fractious issue that goes back more than a century, the Supreme Court, in its verdict in the Babri Masjid-Ram Janmabhoomi title case on November 9, said the entire 2.77 acres of disputed land should be handed over to the deity Ram Lalla, who was one of the three litigants in the case.
The five-judge Constitution bench also directed the Centre to allot a five-acre plot to the Sunni Waqf Board in Ayodhya to build a mosque.
Watch | Ayodhya verdict: Land allotted for the construction of a Ram temple


GBP/JPY: Buyers and sellers jostle amid trade/political pessimism
by Anil Panchal- GBP/JPY struggles for catalysts while staying under pressure for the fourth day in a row.
- Tories are alleged to have set up a fake Labour manifesto website, their tax plans and comments from a key diplomat were also criticized.
- Japan CPI and preliminary activity numbers from the UK/Japan will be in the spotlight.
GBP/JPY carries the previous three-day trend forward while staying negative during the Asian session on Friday. However, the moves are compressed with mixed signals, also ahead of key data, while the quote seesaws near 140.20.
Looking at the political framework in the United Kingdom (UK), one can say the Tories have been under pressure off-late. While allegations over their factcheck handle still being alive, the latest row, as signaled by The Independent, claims that the Conservatives have set up a website that purports to contain the opposition Labour Party’s manifesto, in a bid to trick voters looking for the document. Additionally, the Tory tax plan is criticized on the grounds of favoring the rich while comments from the home secretary Priti Patel, saying that the government was "not to blame" for poverty, were cited by the Labours as another example of the "cruelty" of the Tory government.
Even so, the polls keep favoring the Conservatives as the clear winner of the December election. The latest among them from Ipsos MORI shows nearly a 16 point lead of the Prime Minister (PM) Boris Johnson’s party over the Labours.
Elsewhere, the market sentiment is compressed by the trade tussle between the United States (US) and China. Although the latest signs are that the US may delay December 15 tariff hike, Beijing awaits US President Donald Trump’s action on the Hong Kong Bill for the “fight and talk”.
As a result, the S&P 500 Futures stay around 3,100 while the US 10-year Treasury yields take rounds to 1.78%.
Traders will now keep an eye over Japan’s October month Consumer Price Index (CPI) numbers and Jibun Bank Manufacturing PMI before looking towards the UK’s Manufacturing and Services PMI numbers.
Technical Analysis
While the 21-day Exponential Moving Average (EMA) level of 139.70 acts as immediate support, pair’s upside is restricted by the recent high near 141.60.
additional important levels
| Overview | |
|---|---|
| Today last price | 140.23 |
| Today Daily Change | -7 pips |
| Today Daily Change % | -0.05% |
| Today daily open | 140.3 |
| Trends | |
|---|---|
| Daily SMA20 | 140.06 |
| Daily SMA50 | 137.05 |
| Daily SMA100 | 134.35 |
| Daily SMA200 | 138.49 |
| Levels | |
|---|---|
| Previous Daily High | 140.5 |
| Previous Daily Low | 139.68 |
| Previous Weekly High | 140.59 |
| Previous Weekly Low | 139.36 |
| Previous Monthly High | 141.51 |
| Previous Monthly Low | 130.42 |
| Daily Fibonacci 38.2% | 139.99 |
| Daily Fibonacci 61.8% | 140.19 |
| Daily Pivot Point S1 | 139.82 |
| Daily Pivot Point S2 | 139.34 |
| Daily Pivot Point S3 | 139.01 |
| Daily Pivot Point R1 | 140.64 |
| Daily Pivot Point R2 | 140.98 |
| Daily Pivot Point R3 | 141.45 |


{% extends 'errors/errors.html' %} {% block errorbody %}
Hmmmm... We cannot find it. Try again with something else


President
Industrial Engineering, Senior
"I have been a member of SWE since I was a freshman and an officer for the past three years. I received my last internship at the National SWE conference, and I want to share the opportunities I’ve had and the friends I’ve made through SWE with other women."
Contact me:
<EMAIL_ADDRESS>Vice President
Mechanical Engineering, Junior
"I have been interning at the Naval Surface Warfare Center in Philadelphia, PA for the last four summers. My goal is to get more women involved in SWE and within the STEM fields. I'm excited to work with our members to help them in their professional careers."
Contact me:
<EMAIL_ADDRESS>Secretary
Computer Engineering, Junior
"I have made SWE a priority in my collegiate career since my freshman year. I'm looking forward being a part of the executive board. My goal this year is to recruit and retain more members to SWE and as always, encourage more women to pursue engineering disciplines."
Contact me:
<EMAIL_ADDRESS>Treasurer
Industrial Engineering, Junior
"I’ve been in SWE since my freshman year. I love the community and professional development opportunities that SWE provides and would recommend it to anyone! After UCF, I would love to use my degree to improve processes and implement quality engineering."
Contact me:
<EMAIL_ADDRESS>Conference Director #1
Industrial Engineering, Junior
"I am currently working at the Center for Microgravity Research here at UCF. I do not have an exact career path chosen yet, but I would like to keep my options open! This year in SWE, I plan to bring many opportunities to our members and help in any way."
Contact me:
<EMAIL_ADDRESS>Conference Director #2
Mechanical Engineering, Junior
"I am currently an intern for Northrop Grumman Corp. in Redondo Beach CA and I had the opportunity to work on the James Webb Space Telescope while I was there. This year in SWE, I hope to be able to help every member have a memorable experience at WE17!"
Contact me:
<EMAIL_ADDRESS>Fundraising
Aerospace Engineering, Junior
"I plan to go to MIT and get my masters in either engineering or math and I have just recently become a member of SWE here but was the treasurer for SWE at Valencia college since about February to May of this year. I am very excited to be part of this organization!"
Contact me:
<EMAIL_ADDRESS>Outreach
Mechanical Engineering, Senior
"In the future I would like to design self sustainable tiny houses, and make the world more environmentally friendly. I've been involved with SWE since my freshman year, and I can't wait to start working with all of the amazing members that are a part of this organization."
Contact me:
<EMAIL_ADDRESS>Outreach
Mechanical Engineering, Senior
"I joined SWE my junior year and it has opened the door for many opportunities! My career goal is to become a professional engineer in design by day and maintain my own animal rescue by night. I’m looking forward to encouraging girls to pursue an engineering career."
Contact me:
<EMAIL_ADDRESS>Professional Development
Industrial Engineering, Junior
"I would like to have a successful career in Industrial Engineering focusing on either Project Management or Supply Chain. I am also planning on achieving my PE and returning to school for either my MBA or MSIE. Lastly, I have a minor in Mathematics."
Contact me:
<EMAIL_ADDRESS>Sponsorship
Electrical Engineering, Junior
"After finishing my undergraduate degree, I would like to work with nanotechnology and earn a master’s degree in engineering. I’ve been involved with SWE since my first semester at UCF and I am looking forward to contributing to this fantastic group!"
Contact me:
<EMAIL_ADDRESS>Campus Ambassador
Industrial Engineering, Sophomore
"I intend to graduate with my green belt certification and hopefully I will get a full-time job position in the future. I have been part of SWE for a year and a half. I am excited to work with SWE this year and I hope I can make an impact in this awesome organization!
Contact me:
<EMAIL_ADDRESS>Webmaster
Computer Engineering, Junior
"After UCF, I would like to earn my Master's Degree in Computer Engineering with a research interest in Artificial Intelligence. I have been involved in SWE since Spring 2017 and I would love to keep contributing more to this organization!"
Contact me:
<EMAIL_ADDRESS>Socials
Business Management, Sophomore
"I have been involved in SWE since my first semester at UCF and look forward to stepping up into an officer position to help cultivate a positive and friendly environment for this fantastic group! After UCF, I would like to earn a Master's in the Science of Economics."
Contact me:
<EMAIL_ADDRESS>Socials
Mechanical Engineering, Junior
"I'm pursuing a career in MAE so that I can work in green energy and contribute to making the society better for the environment. I joined SWE so that I could meet other women in such a male dominated industry and I plan to provide fun social events for all of our members!"
Contact me:
<EMAIL_ADDRESS>President
Industrial Engineering, Senior
"I have been a member of SWE since I was a freshman and an officer for the past three years. I received my last internship at the National SWE conference, and I want to share the opportunities I’ve had and the friends I’ve made through SWE with other women."
Contact me:
<EMAIL_ADDRESS>Vice President
Mechanical Engineering, Junior
"I have been interning at the Naval Surface Warfare Center in Philadelphia, PA for the last four summers. My goal is to get more women involved in SWE and within the STEM fields. I'm excited to work with our members to help them in their professional careers."
Contact me:
<EMAIL_ADDRESS>Secretary
Computer Engineering, Junior
"I have made SWE a priority in my collegiate career since my freshman year. I'm looking forward being a part of the executive board. My goal this year is to recruit and retain more members to SWE and as always, encourage more women to pursue engineering disciplines."
Contact me:
<EMAIL_ADDRESS>Treasurer
Industrial Engineering, Junior
"I’ve been in SWE since my freshman year. I love the community and professional development opportunities that SWE provides and would recommend it to anyone! After UCF, I would love to use my degree to improve processes and implement quality engineering."
Contact me:
<EMAIL_ADDRESS>Conference Director #1
Industrial Engineering, Junior
"I am currently working at the Center for Microgravity Research here at UCF. I do not have an exact career path chosen yet, but I would like to keep my options open! This year in SWE, I plan to bring many opportunities to our members and help in any way."
Contact me:
<EMAIL_ADDRESS>Conference Director #2
Mechanical Engineering, Junior
"I am currently an intern for Northrop Grumman Corp. in Redondo Beach CA and I had the opportunity to work on the James Webb Space Telescope while I was there. This year in SWE, I hope to be able to help every member have a memorable experience at WE17!"
Contact me:
<EMAIL_ADDRESS>Fundraising
Aerospace Engineering, Junior
"I plan to go to MIT and get my masters in either engineering or math and I have just recently become a member of SWE here but was the treasurer for SWE at Valencia college since about February to May of this year. I am very excited to be part of this organization!"
Contact me:
<EMAIL_ADDRESS>Outreach
Mechanical Engineering, Senior
"In the future I would like to design self sustainable tiny houses, and make the world more environmentally friendly. I've been involved with SWE since my freshman year, and I can't wait to start working with all of the amazing members that are a part of this organization."
Contact me:
<EMAIL_ADDRESS>Outreach
Mechanical Engineering, Senior
"I joined SWE my junior year and it has opened the door for many opportunities! My career goal is to become a professional engineer in design by day and maintain my own animal rescue by night. I’m looking forward to encouraging girls to pursue an engineering career."
Contact me:
<EMAIL_ADDRESS>Professional Development
Industrial Engineering, Junior
"I would like to have a successful career in Industrial Engineering focusing on either Project Management or Supply Chain. I am also planning on achieving my PE and returning to school for either my MBA or MSIE. Lastly, I have a minor in Mathematics."
Contact me:
<EMAIL_ADDRESS>Sponsorship
Electrical Engineering, Junior
"After finishing my undergraduate degree, I would like to work with nanotechnology and earn a master’s degree in engineering. I’ve been involved with SWE since my first semester at UCF and I am looking forward to contributing to this fantastic group!"
Contact me:
<EMAIL_ADDRESS>Campus Ambassador
Industrial Engineering, Sophomore
"I intend to graduate with my green belt certification and hopefully I will get a full-time job position in the future. I have been part of SWE for a year and a half. I am excited to work with SWE this year and I hope I can make an impact in this awesome organization!
Contact me:
<EMAIL_ADDRESS>Webmaster
Computer Engineering, Junior
"After UCF, I would like to earn my Master's Degree in Computer Engineering with a research interest in Artificial Intelligence. I have been involved in SWE since Spring 2017 and I would love to keep contributing more to this organization!"
Contact me:
<EMAIL_ADDRESS>Socials
Business Management, Sophomore
"I have been involved in SWE since my first semester at UCF and look forward to stepping up into an officer position to help cultivate a positive and friendly environment for this fantastic group! After UCF, I would like to earn a Master's in the Science of Economics."
Contact me:
<EMAIL_ADDRESS>Socials
Mechanical Engineering, Junior
"I'm pursuing a career in MAE so that I can work in green energy and contribute to making the society better for the environment. I joined SWE so that I could meet other women in such a male dominated industry and I plan to provide fun social events for all of our members!"
Contact me:
swe.ucf.socials@gmail.com


CollegeSearch
Home
About
Search
Home
Find the perfect college for you!
Enter your SAT score
Enter your ACT score
What do you want to study in college?
Agriculture, Agriculture Operations, And Related Sciences
Natural Resources And Conservation
Architecture And Related Services
Area, Ethnic, Cultural, Gender, And Group Studies
What state do you want to go to college in?
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
Make my college list!


Is It Just Me, or Do the Cats Look More Human Now?
by Jill PantozziMe-ow!
The latest trailer for Cats has dropped on our laps to be cuddled...and it feels...different? I can’t decide if this is for better or worse. See for yourself.
Or maybe I’m just imagining things?
Tom Hooper’s adaptation of the Andrew Lloyd Webber Broadway hit shocked fans when we got a look at the first trailer, and not in a good way. In this latest look at the musical, we get to see Taylor Swift mouth “cats,” Idris Elba kind of look like he’s naked, and Jason Derulo...well, be Jason Derulo-y.
Cats hits cinemas the same day as Star Wars: The Rise of Skywalker, 20 December. Don’t forget your catnip.
Featured image: Universal


Method List
Search:
- #== HTTY::OrderedHash
- #== HTTY::Payload
- #== HTTY::Request
- #[] HTTY::OrderedHash
- #[]= HTTY::OrderedHash
- #add_request_if_new HTTY::CLI::Command
- #address HTTY::Request
- alias_for HTTY::CLI::Commands::CookieAdd
- alias_for HTTY::CLI::Commands::BodyClear
- alias_for HTTY::CLI::Commands::Delete
- alias_for HTTY::CLI::Commands::Post
- alias_for HTTY::CLI::Commands::Get
- alias_for HTTY::CLI::Commands::CookiesClear
- alias_for HTTY::CLI::Commands::CookieRemove
- alias_for HTTY::CLI::Commands::QueryClear
- alias_for HTTY::CLI::Commands::FragmentClear
- alias_for HTTY::CLI::Commands::FormClear
- alias_for HTTY::CLI::Commands::HeadersClear
- alias_for HTTY::CLI::Commands::UserinfoClear
- alias_for HTTY::CLI::Commands::HeaderSet
- alias_for HTTY::CLI::Command
- alias_for HTTY::CLI::Commands::Cd
- alias_for HTTY::CLI::Commands::Put
- alias_for HTTY::CLI::Commands::Exit
- alias_for HTTY::CLI::Commands::HeaderUnset
- aliases HTTY::CLI::Command
- #arguments HTTY::CLI::Command
- #body HTTY::Payload
- #body_set HTTY::Request
- #body_unset HTTY::Request
- build_authority HTTY::Request
- build_for HTTY::CLI::Command
- build_for HTTY::CLI::Commands
- build_path_query_and_fragment HTTY::Request
- build_uri HTTY::Request
- category HTTY::CLI::Commands::HeadersUnset
- category HTTY::CLI::Commands::PortSet
- category HTTY::CLI::Commands::PathSet
- category HTTY::CLI::Command
- category HTTY::CLI::Commands::Cookies
- category HTTY::CLI::Commands::Form
- category HTTY::CLI::Commands::BodyResponse
- category HTTY::CLI::Commands::FragmentSet
- category HTTY::CLI::Commands::FormRemove
- category HTTY::CLI::Commands::SchemeSet
- category HTTY::CLI::Commands::SslVerification
- category HTTY::CLI::Commands::Follow
- category HTTY::CLI::Commands::BodyRequestOpen
- category HTTY::CLI::Commands::BodySet
- category HTTY::CLI::Commands::HistoryVerbose
- category HTTY::CLI::Commands::SslVerificationOff
- category HTTY::CLI::Commands::BodyUnset
- category HTTY::CLI::Commands::QueryAdd
- category HTTY::CLI::Commands::CookiesUse
- category HTTY::CLI::Commands::QueryUnsetAll
- category HTTY::CLI::Commands::BodyRequest
- category HTTY::CLI::Commands::QuerySet
- category HTTY::CLI::Commands::HeadersRequest
- category HTTY::CLI::Commands::BodyResponseOpen
- category HTTY::CLI::Commands::UserinfoUnset
- category HTTY::CLI::Commands::Status
- category HTTY::CLI::Commands::HeadersSet
- category HTTY::CLI::Commands::UserinfoSet
- category HTTY::CLI::Commands::FragmentUnset
- category HTTY::CLI::Commands::FormAdd
- category HTTY::CLI::Commands::QueryUnset
- category HTTY::CLI::Commands::HeadersUnsetAll
- category HTTY::CLI::Commands::CookiesRemove
- category HTTY::CLI::Commands::QueryRemove
- category HTTY::CLI::Commands::Reuse
- #category HTTY::CLI::HTTPMethodCommand::ClassMethods
- category HTTY::CLI::Commands::FormRemoveAll
- category HTTY::CLI::Commands::History
- category HTTY::CLI::Commands::HeadersResponse
- category HTTY::CLI::Commands::HostSet
- category HTTY::CLI::Commands::CookiesAdd
- category HTTY::CLI::Commands::Address
- category HTTY::CLI::Commands::FormClear
- category HTTY::CLI::Commands::CookiesRemoveAll
- category HTTY::CLI::Commands::SslVerificationOn
- #clear HTTY::OrderedHash
- command_line HTTY::CLI::Command
- command_line HTTY::CLI::Commands::BodyResponseOpen
- command_line HTTY::CLI::Commands::BodyResponse
- command_line HTTY::CLI::Commands::HeadersResponse
- command_line_arguments HTTY::CLI::Commands::QueryAdd
- command_line_arguments HTTY::CLI::Command
- command_line_arguments HTTY::CLI::Commands::Reuse
- command_line_arguments HTTY::CLI::Commands::Address
- command_line_arguments HTTY::CLI::Commands::QueryRemove
- command_line_arguments HTTY::CLI::Commands::HeadersSet
- #command_line_arguments HTTY::CLI::BodyOpenCommand::ClassMethods
- command_line_arguments HTTY::CLI::Commands::HeadersUnset
- command_line_arguments HTTY::CLI::Commands::HostSet
- command_line_arguments HTTY::CLI::Commands::PathSet
- command_line_arguments HTTY::CLI::Commands::PortSet
- command_line_arguments HTTY::CLI::Commands::QueryUnset
- command_line_arguments HTTY::CLI::Commands::UserinfoSet
- command_line_arguments HTTY::CLI::Commands::SchemeSet
- command_line_arguments HTTY::CLI::Commands::Help
- command_line_arguments HTTY::CLI::Commands::FragmentSet
- command_line_arguments HTTY::CLI::Commands::CookiesRemove
- command_line_arguments HTTY::CLI::Commands::CookiesAdd
- command_line_arguments HTTY::CLI::Commands::QuerySet
- complete_for? HTTY::CLI::Command
- #connect! HTTY::Request
- #cookie_add HTTY::Request
- #cookie_remove HTTY::Request
- #cookies HTTY::Request
- #cookies HTTY::Response
- cookies_from_string HTTY::CookiesUtil
- #cookies_remove_all HTTY::Request
- cookies_to_string HTTY::CookiesUtil
- #cookies_use HTTY::Request
- current HTTY::Preferences
- #delete HTTY::OrderedHash
- delete HTTY::RequestsUtil
- #delete! HTTY::Request
- #dup_without_response HTTY::Request
- each HTTY::CLI::Commands
- #empty? HTTY::OrderedHash
- #escape_or_warn_of_escape_sequences HTTY::CLI::UrlEscaping
- #establish_basic_authentication HTTY::Request
- #follow HTTY::Request
- #format HTTY::CLI::Display
- #fragment_set HTTY::Request
- #fragment_unset HTTY::Request
- get HTTY::RequestsUtil
- #get! HTTY::Request
- head HTTY::RequestsUtil
- #head! HTTY::Request
- #header_set HTTY::Request
- #header_unset HTTY::Request
- #headers HTTY::Request
- #headers HTTY::Payload
- #headers_unset_all HTTY::Request
- help HTTY::CLI::Commands::BodyRequest
- help HTTY::CLI::Commands::SslVerification
- help HTTY::CLI::Commands::HttpHead
- help HTTY::CLI::Commands::Help
- help HTTY::CLI::Commands::HeadersUnsetAll
- help HTTY::CLI::Commands::HeadersRequest
- help HTTY::CLI::Commands::HttpGet
- help HTTY::CLI::Commands::HttpDelete
- help HTTY::CLI::Commands::SchemeSet
- help HTTY::CLI::Commands::HttpOptions
- help HTTY::CLI::Commands::CookiesRemoveAll
- help HTTY::CLI::Commands::SslVerificationOn
- help HTTY::CLI::Commands::BodyUnset
- help HTTY::CLI::Commands::HttpPut
- help HTTY::CLI::Commands::PortSet
- help HTTY::CLI::Command
- help HTTY::CLI::Commands::BodySet
- help HTTY::CLI::Commands::HeadersSet
- help HTTY::CLI::Commands::HttpPost
- help HTTY::CLI::Commands::QueryUnsetAll
- help HTTY::CLI::Commands::BodyRequestOpen
- help HTTY::CLI::Commands::History
- help HTTY::CLI::Commands::Reuse
- help HTTY::CLI::Commands::SslVerificationOff
- help HTTY::CLI::Commands::HeadersUnset
- help HTTY::CLI::Commands::BodyResponseOpen
- help HTTY::CLI::Commands::Cookies
- help HTTY::CLI::Commands::QueryRemove
- help HTTY::CLI::Commands::Follow
- help HTTY::CLI::Commands::UserinfoUnset
- help HTTY::CLI::Commands::HistoryVerbose
- help HTTY::CLI::Commands::CookiesRemove
- help HTTY::CLI::Commands::HostSet
- help HTTY::CLI::Commands::CookiesAdd
- help HTTY::CLI::Commands::QueryAdd
- help HTTY::CLI::Commands::CookiesUse
- help HTTY::CLI::Commands::UserinfoSet
- help HTTY::CLI::Commands::FragmentSet
- help HTTY::CLI::Commands::FragmentUnset
- help HTTY::CLI::Commands::Quit
- help HTTY::CLI::Commands::QueryUnset
- help HTTY::CLI::Commands::HeadersResponse
- help HTTY::CLI::Commands::QuerySet
- help HTTY::CLI::Commands::Status
- help HTTY::CLI::Commands::Address
- help HTTY::CLI::Commands::HttpTrace
- help HTTY::CLI::Commands::PathSet
- help HTTY::CLI::Commands::BodyResponse
- help_extended HTTY::CLI::Commands::BodyUnset
- help_extended HTTY::CLI::Commands::SslVerificationOn
- help_extended HTTY::CLI::Commands::HttpHead
- help_extended HTTY::CLI::Commands::History
- help_extended HTTY::CLI::Commands::Help
- help_extended HTTY::CLI::Commands::HttpDelete
- help_extended HTTY::CLI::Commands::SslVerification
- help_extended HTTY::CLI::Commands::BodyResponse
- help_extended HTTY::CLI::Commands::BodyRequest
- help_extended HTTY::CLI::Commands::HeadersUnset
- help_extended HTTY::CLI::Commands::HttpOptions
- help_extended HTTY::CLI::Commands::SslVerificationOff
- help_extended HTTY::CLI::Commands::HttpGet
- help_extended HTTY::CLI::Commands::HistoryVerbose
- help_extended HTTY::CLI::Commands::HeadersUnsetAll
- help_extended HTTY::CLI::Commands::UserinfoUnset
- help_extended HTTY::CLI::Commands::UserinfoSet
- help_extended HTTY::CLI::Commands::QueryUnset
- help_extended HTTY::CLI::Commands::QueryRemove
- help_extended HTTY::CLI::Commands::Reuse
- help_extended HTTY::CLI::Commands::PathSet
- help_extended HTTY::CLI::Commands::PortSet
- help_extended HTTY::CLI::Commands::CookiesAdd
- help_extended HTTY::CLI::Commands::SchemeSet
- help_extended HTTY::CLI::Commands::CookiesRemove
- help_extended HTTY::CLI::Commands::HostSet
- help_extended HTTY::CLI::Commands::CookiesRemoveAll
- help_extended HTTY::CLI::Commands::HeadersRequest
- help_extended HTTY::CLI::Command
- help_extended HTTY::CLI::Commands::FragmentSet
- help_extended HTTY::CLI::Commands::CookiesUse
- help_extended HTTY::CLI::Commands::FragmentUnset
- help_extended HTTY::CLI::Commands::QuerySet
- help_extended HTTY::CLI::Commands::QueryAdd
- help_extended HTTY::CLI::Commands::Status
- help_extended HTTY::CLI::Commands::Follow
- help_extended HTTY::CLI::Commands::HttpTrace
- help_extended HTTY::CLI::Commands::HeadersSet
- help_extended HTTY::CLI::Commands::BodySet
- help_extended HTTY::CLI::Commands::QueryUnsetAll
- help_extended HTTY::CLI::Commands::HeadersResponse
- help_extended HTTY::CLI::Commands::Address
- #help_extended HTTY::CLI::BodyOpenCommand::ClassMethods
- help_extended HTTY::CLI::Commands::Cookies
- help_extended_preamble HTTY::CLI::Commands::BodyResponseOpen
- help_extended_preamble HTTY::CLI::Commands::BodyRequestOpen
- #host_set HTTY::Request
- http_response_to_status HTTY::RequestsUtil
- included HTTY::CLI::HTTPMethodCommand
- #indent HTTY::CLI::Display
- #initialize HTTY::Payload
- #initialize HTTY::NoLocationHeaderError
- #initialize HTTY::CLI
- #initialize HTTY::CLI::Commands::SchemeSet
- #initialize HTTY::Session
- #initialize HTTY::NoSetCookieHeaderError
- #initialize HTTY::NoResponseError
- #initialize HTTY::Preferences
- #initialize HTTY::CLI::Command
- #initialize HTTY::Response
- #initialize HTTY::OrderedHash
- #initialize HTTY::Request
- #last_response HTTY::Session
- #logotype HTTY::CLI::Display
- #normal HTTY::CLI::Display
- #notice HTTY::CLI::Display
- notify_if_cookies_cleared HTTY::CLI::Command
- options HTTY::RequestsUtil
- #options! HTTY::Request
- parse_uri HTTY::Request
- #patch! HTTY::Request
- #path_query_and_fragment HTTY::Request
- #path_set HTTY::Request
- #perform HTTY::CLI::Commands::UserinfoUnset
- #perform HTTY::CLI::Commands::Cookies
- #perform HTTY::CLI::Commands::QueryAdd
- #perform HTTY::CLI::Commands::PathSet
- #perform HTTY::CLI::Commands::CookiesRemoveAll
- #perform HTTY::CLI::Commands::CookiesRemove
- #perform HTTY::CLI::Commands::Help
- #perform HTTY::CLI::Commands::SchemeSet
- #perform HTTY::CLI::Commands::HeadersRequest
- #perform HTTY::CLI::Commands::PortSet
- #perform HTTY::CLI::Commands::SslVerification
- #perform HTTY::CLI::Commands::BodyRequestOpen
- #perform HTTY::CLI::HTTPMethodCommand
- #perform HTTY::CLI::Command
- #perform HTTY::CLI::Commands::QueryUnsetAll
- #perform HTTY::CLI::Commands::BodySet
- #perform HTTY::CLI::Commands::HistoryVerbose
- #perform HTTY::CLI::Commands::QuerySet
- #perform HTTY::CLI::Commands::History
- #perform HTTY::CLI::Commands::CookiesUse
- #perform HTTY::CLI::Commands::BodyResponseOpen
- #perform HTTY::CLI::Commands::Status
- #perform HTTY::CLI::Commands::HeadersSet
- #perform HTTY::CLI::Commands::FragmentUnset
- #perform HTTY::CLI::Commands::Quit
- #perform HTTY::CLI::Commands::SslVerificationOff
- #perform HTTY::CLI::Commands::HeadersUnsetAll
- #perform HTTY::CLI::Commands::QueryUnset
- #perform HTTY::CLI::Commands::Follow
- #perform HTTY::CLI::Commands::HeadersResponse
- #perform HTTY::CLI::Commands::BodyResponse
- #perform HTTY::CLI::Commands::QueryRemove
- #perform HTTY::CLI::Commands::BodyUnset
- #perform HTTY::CLI::Commands::SslVerificationOn
- #perform HTTY::CLI::Commands::Reuse
- #perform HTTY::CLI::Commands::HostSet
- #perform HTTY::CLI::Commands::CookiesAdd
- #perform HTTY::CLI::Commands::UserinfoSet
- #perform HTTY::CLI::Commands::HeadersUnset
- #perform HTTY::CLI::Commands::FragmentSet
- #perform HTTY::CLI::Commands::Address
- #perform HTTY::CLI::Commands::BodyRequest
- #pluralize HTTY::CLI::Display
- #port_set HTTY::Request
- post HTTY::RequestsUtil
- #post! HTTY::Request
- #prompt HTTY::CLI::Display
- put HTTY::RequestsUtil
- #put! HTTY::Request
- #query_add HTTY::Request
- #query_remove HTTY::Request
- #query_set HTTY::Request
- #query_unset HTTY::Request
- #query_unset_all HTTY::Request
- raw_name HTTY::CLI::Command
- #rebuild_uri HTTY::Request
- #register_completion_proc HTTY::CLI
- #repeat? HTTY::CLI
- #request_method HTTY::Request
- #requests HTTY::Session
- #rescuing_from HTTY::CLI::Display
- #response HTTY::Request
- #run! HTTY::CLI
- #say HTTY::CLI::Display
- #say_goodbye HTTY::CLI::Display
- #say_header HTTY::CLI::Display
- #say_hello HTTY::CLI::Display
- #scheme_set HTTY::Request
- see_also_commands HTTY::CLI::Commands::HttpTrace
- see_also_commands HTTY::CLI::Commands::HttpOptions
- see_also_commands HTTY::CLI::Commands::HeadersUnset
- see_also_commands HTTY::CLI::Commands::HttpDelete
- see_also_commands HTTY::CLI::Commands::SslVerificationOff
- see_also_commands HTTY::CLI::Commands::HttpHead
- see_also_commands HTTY::CLI::Commands::BodyUnset
- see_also_commands HTTY::CLI::Commands::HeadersUnsetAll
- see_also_commands HTTY::CLI::Commands::UserinfoSet
- see_also_commands HTTY::CLI::Commands::BodyResponse
- see_also_commands HTTY::CLI::Commands::QueryUnset
- see_also_commands HTTY::CLI::Commands::HistoryVerbose
- see_also_commands HTTY::CLI::Commands::CookiesRemoveAll
- see_also_commands HTTY::CLI::Commands::BodyRequest
- see_also_commands HTTY::CLI::Commands::History
- see_also_commands HTTY::CLI::Commands::SslVerificationOn
- see_also_commands HTTY::CLI::Commands::Reuse
- see_also_commands HTTY::CLI::Commands::QueryRemove
- see_also_commands HTTY::CLI::Commands::HttpGet
- see_also_commands HTTY::CLI::Commands::HostSet
- see_also_commands HTTY::CLI::Commands::CookiesAdd
- see_also_commands HTTY::CLI::Commands::CookiesUse
- see_also_commands HTTY::CLI::Commands::SchemeSet
- see_also_commands HTTY::CLI::Commands::SslVerification
- see_also_commands HTTY::CLI::Commands::HeadersResponse
- see_also_commands HTTY::CLI::Commands::Cookies
- see_also_commands HTTY::CLI::Commands::BodyRequestOpen
- see_also_commands HTTY::CLI::Command
- see_also_commands HTTY::CLI::Commands::Status
- see_also_commands HTTY::CLI::Commands::QuerySet
- see_also_commands HTTY::CLI::Commands::FragmentSet
- see_also_commands HTTY::CLI::Commands::PortSet
- see_also_commands HTTY::CLI::Commands::QueryAdd
- see_also_commands HTTY::CLI::Commands::HeadersRequest
- see_also_commands HTTY::CLI::Commands::UserinfoUnset
- see_also_commands HTTY::CLI::Commands::FragmentUnset
- see_also_commands HTTY::CLI::Commands::CookiesRemove
- see_also_commands HTTY::CLI::Commands::Address
- see_also_commands HTTY::CLI::Commands::HttpPost
- see_also_commands HTTY::CLI::Commands::QueryUnsetAll
- see_also_commands HTTY::CLI::Commands::HeadersSet
- see_also_commands HTTY::CLI::Commands::PathSet
- see_also_commands HTTY::CLI::Commands::Follow
- see_also_commands HTTY::CLI::Commands::BodySet
- see_also_commands HTTY::CLI::Commands::BodyResponseOpen
- see_also_commands HTTY::CLI::Commands::HttpPut
- #session HTTY::CLI::Command
- #session HTTY::CLI
- set_up_cookies_and_authentication HTTY::Request
- #show_headers HTTY::CLI::Display
- #show_request HTTY::CLI::Display
- #show_response HTTY::CLI::Display
- #status HTTY::Response
- #strong HTTY::CLI::Display
- #to_a HTTY::OrderedHash
- trace HTTY::RequestsUtil
- #trace! HTTY::Request
- #uri HTTY::Request
- #userinfo_set HTTY::Request
- #userinfo_unset HTTY::Request
- #verify_certificates? HTTY::Preferences
- #whitespace? HTTY::CLI
- windows? HTTY::Platform
- #word_wrap HTTY::CLI::Display
- #word_wrap_indented HTTY::CLI::Display


process.env
? This is where the node environment
variables live.
package.json
:
cross-env
makes environment variable configuration
cross-platform, as the environment variable syntax differs on
different platforms such as windows.
We use this environment variable to select a configuration of which database the tests connect to in Knex:
We use a different “testing” database because we don’t want our tests to execute reads and writes on our development or production databases.
In our Knex config we can setup a testing configuration:
testing: {
client: 'sqlite3',
connection: {
filename: './data/test.db3',
},
useNullAsDefault: true,
migrations: {
directory: './data/migrations',
},
seeds: {
directory: './data/seeds',
},
}
Writing Our Tests
supertest
supertest
is a HTTP testing framework derived from
superagent
which is a client-side HTTP request library.
It can be installed and used on a node server or in the browser.
Step 1: Create a file called
<filename>.test.js
or
<filename>.spec.js
Step 2: Import supertest
and the file we
want to test
describe("Server Test", () => {
describe("GET / Endpoint", () => {
// Add tests for endpoint
});
});
// Inside the describe...
it("responds with the proper status code", () => {
return request(server).get("/").expect(200);
});
request()
framework comes from
supertest
.
// Inside the describe...
it("responds with <header name> header", () => {
return request(server).get("/").expect("<header name>", "<header value>");
});
Database Cleanup
// At the top of our test file...
beforeEach(async () => {
// deletes everything on the table
return await db("table").truncate();
// CAUTION: MAKE SURE YOU ARE NOT RUNNING THIS ON PRODUCTION OR DEV DATABASES
});
afterEach(async () => {
// deletes everything on the table
return await db("table").truncate();
// CAUTION: MAKE SURE YOU ARE NOT RUNNING THIS ON PRODUCTION OR DEV DATABASES
});


Past two Weeks
How to implement a language?
- Interpreter
- Parser
Next two Weeks
Modern language features for structuring programs
- Type classes
- Monads
Will help us add cool features to the Nano interpreter!
Type Classes: Outline
- Why type classes?
- Standard type classes
- Creating new instances
- Using type classes
- Creating new type classes
Overloading Operators: Arithmetic
The +
operator works for a bunch of different types.
For Integer
:
> 2 + 3
λ5
for Double
precision floats:
> 2.9 + 3.5
λ6.4
Overloading Comparisons
Similarly we can compare different types of values
> 2 == 3
λFalse
> [2.9, 3.5] == [2.9, 3.5]
λTrue
> ("cat", 10) < ("cat", 2)
λFalse
> ("cat", 10) < ("cat", 20)
λTrue
Operator Overloading
Seems unremarkable?
Languages have supported “operator overloading” since the dawn of time
Haskell has no caste system
No distinction between operators and functions
- All are first class citizens!
You can implement functions like (+)
and (==)
yourself from scratch!
- But then, what type do we give them?
QUIZ
Which of the following type annotations would work for (+)
?
(A) (+) :: Int -> Int -> Int
(B) (+) :: Double -> Double -> Double
(C) (+) :: a -> a -> a
(D) Any of the above
(E) None of the above
Answer: E
Int -> Int -> Int
is bad because?
- Then we cannot add
Double
s!
Double -> Double -> Double
is bad because?
- Then we cannot add
Int
s!
a -> a -> a
is bad because?
I don’t know how to implement this
For some
a
s it doesn’t make sense: how do I add twoBool
s? Or twoChar
s?
Ad-hoc Polymorphism
We have seen parametric polymorphism:
-- Append two lists:
(++) :: [a] -> [a] -> [a]
++) [] ys = ys
(++) (x:xs) ys = x:(xs ++ ys) (
(++)
works for all list types
Doesn’t care what the list elements are
The same implementation works for
a = Int
,a = Bool
, etc.
Now we need ad-hoc polymorphism:
(+) :: a -> a -> a -- Almost, but not really
+) x y = ??? (
(+)
should work for many (but not all) types
- Different implementation for
a = Int
,a = Double
, etc.
Ad-hoc means “created or done for a particular purpose as necessary.”
Type Classes for Ad Hoc Polymorphism
Haskell solves this problem with a mechanism called type classes
- Introduced by Wadler and Blott
This is a very cool and well-written paper! Read it!
Constrained Types
Let’s ask GHCi:
> :type (+)
λ(+) :: (Num a) => a -> a -> a
We call this a constrained (or qualified) type
Read it as:
(+)
takes in twoa
values and returns ana
value
for any type
a
thatis an instance of the
Num
type classor, in Java terms: implements the
Num
interface
The “(Num a) =>
” part is called the constraint
Some types are Num
s:
- For example,
Int
,Integer
,Double
- Values of those types can be passed to
(+)
:
> 2 + 3
λ5
Other types are not Num
s:
- For example,
Bool
,Char
,String
, function types, … - Values of those types cannot be passed to
(+)
:
> True + False
λ
<interactive>:15:6:
No instance for (Num Bool) arising from a use of ‘+’
In the expression: True + False
In an equation for ‘it’: it = True + False
Aha! Now those no instance for
error messages should make sense!
- Haskell is complaining that
True
andFalse
are of typeBool
- and that
Bool
is not an instance ofNum
QUIZ
What would be a reasonable type for the equality operator?
(A) (==) :: a -> a -> a
(B) (==) :: a -> a -> Bool
(C) (==) :: (Eq a) => a -> a -> a
(D) (==) :: (Eq a) => a -> a -> Bool
(E) None of the above
Answer: D. Not B because we can’t compare functions!
Type Classes: Outline
- Why type classes? [done]
- Standard type classes
- Creating new instances
- Using type classes
- Creating new type classes
What is a type class?
A type class is a collection of methods (functions, operations) that must exist for every instance
What are some useful type classes in the Haskell standard library?
The Eq
Type Class
The simplest typeclass is Eq
:
class Eq a where
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
A type T
is an instance of Eq
if there are two functions
(==) :: T -> T -> Bool
that determines if twoT
values are equal(/=) :: T -> T -> Bool
that determines if twoT
values are disequal
Lifehack: You can ask GHCi about a type class and it will tell you
- its methods
- all the instances it knows
> :info Eq
λclass Eq a where
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
...
instance Eq Int
instance Eq Double
...
The Num
Type Class
The type class Num
requires that instances define a bunch of arithmetic operations
class Num a where
(+) :: a -> a -> a
(-) :: a -> a -> a
(*) :: a -> a -> a
negate :: a -> a
abs :: a -> a
signum :: a -> a
fromInteger :: Integer -> a
The Show
Type Class
The type class Show
requires that instances be convertible to String
class Show a where
show :: a -> String
Indeed, we can test this on different (built-in) types
> show 2
λ"2"
> show 3.14
λ"3.14"
> show (1, "two", ([],[],[]))
λ"(1,\"two\",([],[],[]))"
The Ord
Typeclass
The type class Ord
is for totally ordered values:
class Eq a => Ord a where
(<) :: a -> a -> Bool
(<=) :: a -> a -> Bool
(>) :: a -> a -> Bool
(>=) :: a -> a -> Bool
For example:
> 2 < 3
λTrue
> "cat" < "dog"
λTrue
Note Eq a =>
in the class definition!
A type T
is an instance of Ord
if
T
is also an instance ofEq
, and- It defines functions for comparing values for inequality
Standard Typeclass Hierarchy
Haskell comes equipped with a rich set of built-in classes.
In the above picture, there is an edge from Eq
to Ord
because for something to be an Ord
it must also be an Eq
.
Type Classes: Outline
- Why type classes? [done]
- Standard type classes [done]
- Creating new instances
- Using type classes
- Creating new type classes
Showing Your Colors
Let’s create a new datatype:
data Color = Red | Green
and play with it in GHCi:
> let col = Red
λ> :type col
λx :: Color
So far, so good… but we cannot view them!
> col
λ
<interactive>:1:0:
No instance for (Show Color)
of `print' at <interactive>:1:0
arising from a use Possible fix: add an instance declaration for (Show Color)
In a stmt of a 'do' expression: print it
Why is this happening?
When we type an expression into GHCi it:
- evaluates it to a value, then
- calls
show
on that value to convert it to a string
But our new type is not an instance of Show
!
We also cannot compare colors!
> col == Green
λ
<interactive>:1:0:
No instance for (Eq Color)
of `==' at <interactive>:1:0-5
arising from a use Possible fix: add an instance declaration for (Eq Color)
In the expression: col == Green
In the definition of `it': it = col == Green
How do we add an instance declaration for Show Color
and Eq Color
?
Creating Instances
To tell Haskell how to show or compare values of type Color
- create instances of
Eq
andShow
for that type:
instance Show Color where
show Red = "Red"
show Green = "Green"
instance Eq Color where
???
EXERCISE: Creating Instances
Create an instance of Eq
for Color
:
data Color = Red | Green
instance Eq Color where
???
-- Reminder:
class Eq a where
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
QUIZ
Which of the following Eq
instances for Color
are valid?
-- (A)
instance Eq Color where
==) Red Red = True
(==) Green Green = True
(==) _ _ = False
(
-- (B)
instance Eq Color where
/=) Red Red = False
(/=) Green Green = False
(/=) _ _ = True
(
-- (C) Neither of the above
-- (D) Either of the above
Answer: D
Default Method Implementations
The Eq
class is actually defined like this:
class Eq a where
(==) :: a -> a -> Bool
==) x y = not (x /= y) -- Default implementation!
(
(/=) :: a -> a -> Bool
/=) x y = not (x == y) -- Default implementation! (
The class provides default implementations for its methods
An instance can define any of the two methods and get the other one for free
Use
:info
to find out which methods you have to define:
> :info Eq
λclass Eq a where
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
{-# MINIMAL (==) | (/=) #-} -- HERE HERE!!!
QUIZ
If you define:
instance Eq Color where
-- Nothing here!
what will the following evaluate to?
> Red == Green λ
(A) Type error
(B) Stack overflow
(C) Other runtime error
(D) False
(E) True
Answer: B
Automatic Derivation
This is silly: we should be able to compare and view Color
s “automatically”!
Haskell lets us automatically derive functions for some classes in the standard library.
To do so, we simply dress up the data type definition with
data Color = Red | Green
deriving (Eq, Show) -- please generate instances automatically!
Now we have
> let col = Red
λ
> col
λRed
> col == Red
λTrue
Type Classes: Outline
- Why type classes? [done]
- Standard type classes [done]
- Creating new instances [done]
- Using type classes
- Creating new type classes
Using Typeclasses
Now let’s see how to write code that uses type classes!
Let’s build a small library for dictionaries mapping keys k
to values v
data Dict k v
= Empty -- empty dictionary
| Bind k v (Dict k v) -- bind key `k` to the value `v`
deriving (Show)
The API
We want to be able to do the following with Dict
:
-- >>> let dict0 = add "cat" 10.0 (add "dog" 20.0 empty)
-- >>> get "cat" dict0
-- 10
-- >>> get "dog" dict0
-- 20
-- >>> get "horse" dict0
-- error: key not found
Okay, lets implement!
-- | 'add key val dict' returns a new dictionary
-- | that additionally maps `key` to `val`
add :: k -> v -> Dict k v -> Dict k v
= ???
add key val dict
-- | 'get key dict' returns the value of `key`
get :: k -> Dict k v -> v
= ??? get key dict
But we get a type error!
Constraint Propagation
Lets delete the types of add
and get
and see what Haskell says their types are!
> :type get
λget :: (Eq k) => k -> v -> Dict k v -> Dict k v
Haskell tells us that we can use any k
type as a key
as long as this type is an instance of the Eq
typeclass.
How, did GHC figure this out?
- If you look at the code for
get
you’ll see that we check if two keys are equal!
TRY AT HOME: A Faster Dictionary
Write an optimized version of
add
that ensures the keys are in increasing orderget
that gives up the moment we see a key that’s larger than the one we’re looking for
(How) do you need to change the types of get
and add
?
Explicit Type Annotations
Consider the standard typeclass Read
:
-- Not the actual definition, but almost:
class Read a where
read :: String -> a
Read
is the opposite of Show
It requires that every instance
T
can parse a string and turn it intoT
Just like with
Show
, most standard type are instances ofRead
:Int
,Integer
,Double
,Char
,Bool
, etc
QUIZ
What does the expression read "2"
evaluate to?
(A) Type error
(B) "2"
(C) 2
(D) 2.0
(E) Run-time error
Haskell is foxed!
- Doesn’t know what type to convert the string to!
- Doesn’t know which of the
read
functions to run!
Did we want an Int
or a Double
or maybe something else altogether?
Thus, here an explicit type annotation is needed to tell Haskell what to convert the string to:
> (read "2") :: Int
λ2
> (read "2") :: Float
λ2.0
> (read "2") :: String
λ???
Note the different results due to the different types.
Type Classes: Outline
- Why type classes? [done]
- Standard type classes [done]
- Creating new instances [done]
- Using type classes [done]
- Creating new type classes
Creating Typeclasses
Typeclasses are useful for many different things
- Improve readability
- Promote code reuse
We will see some very interesting use cases over the next few lectures.
Lets conclude today’s class with a quick example that provides a taste.
JSON
JavaScript Object Notation or JSON is a simple format for transferring data around. Here is an example:
{ "name" : "Nadia"
, "age" : 38.0
, "likes" : [ "poke", "coffee", "pasta" ]
, "hates" : [ "beets" , "milk" ]
, "lunches" : [ {"day" : "mon", "loc" : "rubios"}
, {"day" : "tue", "loc" : "home"}
, {"day" : "wed", "loc" : "curry up now"}
, {"day" : "thu", "loc" : "home"}
, {"day" : "fri", "loc" : "santorini"} ]
}
Each JSON value is either
a base value like a string, a number or a boolean,
an (ordered) array of values, or
an object, i.e. a set of string-value pairs.
A JSON Datatype
We can represent (a subset of) JSON values with the Haskell datatype
data JVal
= JStr String
| JNum Double
| JBool Bool
| JObj [(String, JVal)]
| JArr [JVal]
deriving (Eq, Ord, Show)
The above JSON value would be represented by the JVal
=
js1 JObj [("name", JStr "Nadia")
"age", JNum 38.0)
,("likes", JArr [ JStr "poke", JStr "coffee", JStr "pasta"])
,("hates", JArr [ JStr "beets", JStr "milk"])
,("lunches", JArr [ JObj [("day", JStr "mon")
,("loc", JStr "rubios")]
,(JObj [("day", JStr "tue")
, "loc", JStr "home")]
,(JObj [("day", JStr "wed")
, "loc", JStr "curry up now")]
,(JObj [("day", JStr "thu")
, "loc", JStr "home")]
,(JObj [("day", JStr "fri")
, "loc", JStr "santorini")]
,(
]) ]
Serializing Haskell Values to JSON
Lets write a small library to serialize Haskell values as JSON
- Base types
String
,Double
,Bool
are serialized as base JSON values - Lists are serialized into JSON arrays
- Lists of key-value pairs are serialized into JSON objects
We could write a bunch of functions like
doubleToJSON :: Double -> JVal
= JNum
doubleToJSON
stringToJSON :: String -> JVal
= JStr
stringToJSON
boolToJSON :: Bool -> JVal
= JBool boolToJSON
Serializing Lists
But what about collections, namely lists of things?
doublesToJSON :: [Double] -> JVal
= JArr (map doubleToJSON xs)
doublesToJSON xs
boolsToJSON :: [Bool] -> JVal
= JArr (map boolToJSON xs)
boolsToJSON xs
stringsToJSON :: [String] -> JVal
= JArr (map stringToJSON xs) stringsToJSON xs
This is getting rather tedious
- Lots of repetition :(
Serializing Collections (refactored with HOFs)
You could abstract by making the element-converter a parameter
listToJSON :: (a -> JVal) -> [a] -> JVal
= JArr (map f xs)
listToJSON f xs
mapToJSON :: (a -> JVal) -> [(String, a)] -> JVal
= JObj [ (k, f v) | (k, v) <- kvs ] mapToJSON f kvs
But this is still rather tedious as you have to pass in the individual data converter (yuck)
> doubleToJSON 4
λJNum 4.0
> listToJSON stringToJSON ["poke", "coffee", "pasta"]
λJArr [JStr "poke",JStr "coffee",JStr "pasta"]
> mapToJSON stringToJSON [("day", "mon"), ("loc", "rubios")]
λJObj [("day",JStr "mon"),("loc",JStr "rubios")]
This gets more hideous when you have richer objects like
= [ [("day", "mon"), ("loc", "rubios")]
lunches "day", "tue"), ("loc", "home")]
, [( ]
because we have to go through gymnastics like
> listToJSON (mapToJSON stringToJSON) lunches
λJArr [ JObj [("day",JStr "monday") ,("loc",JStr "rubios")]
JObj [("day",JStr "tuesday") ,("loc",JStr "home")]
, ]
Yikes. So much for readability
Is it too much to ask for a magical toJSON
that just works?
Typeclasses To The Rescue
Lets define a typeclass that describes types a
that can be converted to JSON.
class JSON a where
toJSON :: a -> JVal
Now, just make all the above instances of JSON
like so
instance JSON Double where
= JNum
toJSON
instance JSON Bool where
= JBool
toJSON
instance JSON String where
= JStr toJSON
This lets us uniformly write
> toJSON 4
λJNum 4.0
> toJSON True
λJBool True
> toJSON "guacamole"
λJStr "guacamole"
Bootstrapping Instances
The real fun begins when we get Haskell to automatically bootstrap the above functions to work for lists and key-value lists!
instance JSON a => JSON [a] where
= JArr [toJSON x | x <- xs] toJSON xs
The above says, if a
is an instance of JSON
, that is,
if you can convert a
to JVal
then here’s a generic
recipe to convert lists of a
values!
> toJSON [True, False, True]
λJArr [JBln True, JBln False, JBln True]
> toJSON ["cat", "dog", "Mouse"]
λJArr [JStr "cat", JStr "dog", JStr "Mouse"]
or even lists-of-lists!
> toJSON [["cat", "dog"], ["mouse", "rabbit"]]
λJArr [JArr [JStr "cat",JStr "dog"],JArr [JStr "mouse",JStr "rabbit"]]
We can pull the same trick with key-value lists
instance (JSON a) => JSON [(String, a)] where
= JObj [ (k, toJSON v) | (k, v) <- kvs ] toJSON kvs
after which, we are all set!
> toJSON lunches
λJArr [ JObj [ ("day",JStr "monday"), ("loc",JStr "zanzibar")]
JObj [("day",JStr "tuesday"), ("loc",JStr "farmers market")]
, ]
It is also useful to bootstrap the serialization for tuples (upto some fixed size) so we can easily write “non-uniform” JSON objects where keys are bound to values with different shapes.
instance (JSON a, JSON b) => JSON ((String, a), (String, b)) where
=
toJSON ((k1, v1), (k2, v2)) JObj [(k1, toJSON v1), (k2, toJSON v2)]
instance (JSON a, JSON b, JSON c) => JSON ((String, a), (String, b), (String, c)) where
=
toJSON ((k1, v1), (k2, v2), (k3, v3)) JObj [(k1, toJSON v1), (k2, toJSON v2), (k3, toJSON v3)]
instance (JSON a, JSON b, JSON c, JSON d) => JSON ((String, a), (String, b), (String, c), (String,d)) where
=
toJSON ((k1, v1), (k2, v2), (k3, v3), (k4, v4)) JObj [(k1, toJSON v1), (k2, toJSON v2), (k3, toJSON v3), (k4, toJSON v4)]
instance (JSON a, JSON b, JSON c, JSON d, JSON e) => JSON ((String, a), (String, b), (String, c), (String,d), (String, e)) where
=
toJSON ((k1, v1), (k2, v2), (k3, v3), (k4, v4), (k5, v5)) JObj [(k1, toJSON v1), (k2, toJSON v2), (k3, toJSON v3), (k4, toJSON v4), (k5, toJSON v5)]
Now, we can simply write
= (("name" , "Nadia")
hs "age" , 38.0)
,("likes" , ["poke", "coffee", "pasta"])
,("hates" , ["beets", "milk"])
,("lunches", lunches)
,( )
which is a Haskell value that describes our running JSON example, and can convert it directly like so
= toJSON hs js2
EXERCISE: Dictionary with Default Values
Modify our implementation of fast dictionaries
so that get
returns a default value if the key is not found.
You should get the following behavior:
-- Note: the default value is NOT passed into `get`
> get 2 (add 5 "five" (add 10 "ten" (add 3 "three" empty)))
λ""
> get "horse" (add "cat" 10.0 (add "dog" 20.1 empty))
λ0.0
That’s all folks!


{% extends "main.html" %} {% block content %} {% include "header.html" %}
Schema.org is a collaborative, community activity with a mission to create, maintain, and promote schemas for structured data on the Internet. In addition to people from the founding companies (Google, Microsoft, Yahoo and Yandex), there is substantial participation by the larger Web community, through public mailing lists such as<EMAIL_ADDRESS>and through GitHub. Learn More.
The NIAID Data Ecosystem is a secure environment to find, access and analyze immune-mediated and infectious disease data and computational tools to speed the development of diagnostics, therapeutics, and vaccines. The NIAID Data Ecosystem Discovery Portal harvests metadata from dataset repositories and harmonizes them to this schema to enable easy cross-platform dataset searching and filtering. Learn more about NDE.
A high level datamodel of biological entities (genes, diseases, phenotypes, pathways, individuals, substances, etc) and their associations. Maintained by biolink.


Fill me in.
Skils: leetFill me in.
Skils: leetFill me in.
Skils: leetOps and platform guy, debugger, trail / ultra runner. I make things. And many mistakes. I believe in balance, yet am hopelessly addicted to muesli. I contribute to the ZeroMQ project, am the author of several Ruby extensions / bindings and have extensive knowledge of Ruby MRI internals, event driven architecture, some financial protocols and like working on complex systems, mostly to make them simple. Presented at several European and some USA technology conferences. Born in South Africa, but living in Madeira - long story, email me or let's have a beer at a conference and I'll tell you all about it.
Skills: Ruby, C, C++, ZeroMQ, Ruby extensions, debugging, FIX, events, EDA