text:
3,
author = {Ohashi, Yutaro and Ogawa, Hideaki and Arisawa, Makoto},
title = {Making New Learning Environment in Zoo by Adopting Mobile Devices},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409323},
doi = {10.1145/1409240.1409323},
abstract = {In this paper, we describe a whole-new, user participatory learning environment in zoo by adopting mobile network devices. It is likely that zoo will be an effective learning environment especially for children if we make good use of resources in zoo. We therefore proposed and operated user-participatory information technology so that even children can learn about animals and nature by using them. Navigation system, an audio and video guidance with ipod, lets children see something that one can't see in one's normal life. Voice Trackback System, a participatory voice message gathering system with mobile phone, helps children to record their messages easily, and to access the voice data on the web freely. By using information systems like these in zoo, visitors including small children learn more about animals and nature in interactive ways.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {489–490},
numpages = {2},
keywords = {environmental learning, mobile learning, zoo, user-participatory},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409324,
author = {Kiemer, Johannes and Ballendat, Till and Langer, Tim and Zhang, Wenqi and De Luca, Alexander},
title = {Spybuster - a Community-Based Privacy Tagging Platform},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409324},
doi = {10.1145/1409240.1409324},
abstract = {The goal of Spybuster is to provide a powerful and easy accessible community platform, which helps the members to cope with the increasing number of threats for everyone's privacy in everyday life. Spybuster uses a geotagging system to associate privacy threats with their locations. Users can add supplemental information such as a description of the threat and the exact address. The resultant tags can either be accessed over a mobile application with an interactive radar or a website using a Google Maps-mashup for displaying tags in a certain area. Due to a shared database users can organize their tags on both platforms.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {491–492},
numpages = {2},
keywords = {geotagging, community, privacy, mobile device, GPS},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409325,
author = {Church, Karen and Smyth, Barry},
title = {Understanding Mobile Information Needs},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409325},
doi = {10.1145/1409240.1409325},
abstract = {In this paper we describe the results of a four-week diary study of mobile information needs, focusing on the intent behind mobile needs and the importance on context on such needs. We identified three key intents among diary entries: informational, geographical and personal information management (PIM). Furthermore, we found many of these information needs have high temporal and location dependencies.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {493–494},
numpages = {2},
keywords = {information needs, diary study, mobile, intent},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409326,
author = {Jeon, Myoung Hoon and Na, Dae Yol and Ahn, Jung Hee and Hong, Ji Young},
title = {User Segmentation & UI Optimization through Mobile Phone Log Analysis},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409326},
doi = {10.1145/1409240.1409326},
abstract = {To improve and optimize user interfaces of the system, the accurate understanding of users' behavior is an essential prerequisite. In this paper, we described the work which examines users' behavior through log analysis in their own environment. 50 users were recruited by consumer segmentation and logging-software was downloaded in their mobile phone. After two weeks, logged data were gathered and analyzed. The complementary methods such as a user diary and an interview were conducted. The result of the analysis showed the frequency of menu and key access, used time, data storage and several usage patterns. Also, we found the possibility that users could be segmented into new groups by their usage patterns. The improvement of the mobile phone user interface was proposed based on the result of this study.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {495–496},
numpages = {2},
keywords = {log analysis, user segmentation, UI optimization, user behavior analysis},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409327,
author = {Chu, Kar-Hai and Joseph, Sam},
title = {Using Second Life to Demonstrate a Concept Automobile Heads up Display (A-HUD)},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409327},
doi = {10.1145/1409240.1409327},
abstract = {There are different options to establish and test new technology within automobiles. From simulators to real world driving, most have disadvantages of development time, expensive costs, or complex setups. We describe a method using Second Life's virtual world to conduct simulations for driving and testing a new conceptual Automobile Heads Up Display (A-HUD).},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {497–498},
numpages = {2},
keywords = {driving simulator, mobile broadband, augmented reality, heads up display, automobile technology},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409328,
author = {Cervantes, Ruy and Sambasivan, Nithya},
title = {VoiceList: User-Driven Telephone-Based Audio Content},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409328},
doi = {10.1145/1409240.1409328},
abstract = {We present VoiceList, a telephone-based user-generated audio classifieds service. The aim of the system is to provide an infrastructure for a user-driven community service where there is minimal connectivity to the Internet. Our approach takes advantage of prior knowledge and the ubiquitous presence of telephones in developing nations, overcoming literacy and connectivity barriers.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {499–500},
numpages = {2},
keywords = {audio-based user interfaces, mobile devices, user-generated content, ICT4D},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409330,
author = {Matena, Lukas and Jaimes, Alejandro and Popescu-Belis, Andrei},
title = {Graphical Representation of Meetings on Mobile Devices},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409330},
doi = {10.1145/1409240.1409330},
abstract = {The AMIDA Mobile Meeting Assistant is a system that allows remote participants to attend a meeting through a mobile device. The system improves the engagement in the meeting of the remote participants with respect to voice-only solutions thanks to the use of visual annotations and the capture of slides. The visual focus of attention of meeting participants and other annotations serve to reconstruct a 2D or a 3D representation of the meeting on a mobile device (smart phone). A first version of the system has been implemented, and feedback from a user study and from industrial partners shows that the Mobile Meeting Assistant's functionalities are positively appreciated, and sets priorities for future developments.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {503–506},
numpages = {4},
keywords = {meeting annotation, mobile device, remote access, user interface, 3D representation},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409331,
author = {Suzuki, Genta and Yamaguchi, Nobuyasu and Nakamura, Shigeyoshi and Chiba, Hirotaka},
title = {Mobile Interaction Using Steganographic Image on Mobile Display},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409331},
doi = {10.1145/1409240.1409331},
abstract = {This demonstration shows novel interaction between mobile devices and their nearby devices using digital images on a mobile display. The interaction needs neither special hardware for communication, nor additional software for existing mobile devices. In the interaction, users of mobile devices can easily interact with nearby devices by three procedures: 1) selecting an image, 2) displaying an image in full-screen mode, or 3) holding the display over a camera connected to the device. The key technology of the interaction is FPcode (Fine Picture code) which is a kind of steganography and can be invisibly embedded in printed images. To enable FPcode to be applied to images on mobile displays, we have developed a camera control method for reducing the influence of moire stripes on the display and variations in display brightness. In the demonstration, we show an application using FPcode on a mobile display.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {507–510},
numpages = {4},
keywords = {mobile phones, mobile gaming, user interface, image processing, mobile ticket, mobile display, steganography},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409332,
author = {Pohjola, Teemu and Tolppanen, Petri and Kaksonen, Veli},
title = {Movial IXS Mobile Internet Device},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409332},
doi = {10.1145/1409240.1409332},
abstract = {In recent years device manufacturers have been introducing so called Mobile Internet Devices (MIDs) at an increasing rate. The aim of these commonly touch screen based devices is not to be mobile devices' "jacks-of-all-trades", but to offer the best possible mobile internet user experience. In Mobile HCI 2008 Movial is presenting its new Movial IXS application suite for Mobile Internet Devices and aims to demonstrate how internet is not just something that you access, but a natural part of the user experience.Unlike in any other Mobile Internet Device, Movial IXS' user interface is built entirely with standard XHTML/CSS/JavaScript techniques and it uses Mozilla browser engine as its renderer and backbone. Using native web technologies for creating the user interface positions Movial IXS out of its seemingly natural mobile internet device genre and places it firmly to the close proximity of online internet and web applications. The aim of the Mobile HCI 2008 demonstration is to showcase how this close proximity of internet can be used to provide richer user experiences and flexible user interface development, and to provoke conversation about the role of the internet in the mobile devices that we use on daily basis.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {511–513},
numpages = {3},
keywords = {user experience, mashups, web2.0, mobile internet device, web applications, HTML, MID, mobile internet},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409333,
author = {Kazakos, Konstantinos and Bourlai, Thirimachos and Fujiki, Yuichi and Levine, James and Pavlidis, Ioannis},
title = {NEAT-o-Games: Novel Mobile Gaming versus Modern Sedentary Lifestyle},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409333},
doi = {10.1145/1409240.1409333},
abstract = {The proposed demonstration is based on the work performed as part of the NEAT-o-Games project. NEAT-o-Games is a suite of games that runs on mobile terminals such as cell phones. Unlike other games, NEAT-o-Games' primary goal is to become part of people's everyday routines and attack the behavioral aspect of the sedentary lifestyle. Their main characteristic is that they are not carried out in short bouts, but are being played continuously and are interwoven in the daily routine of the players. Data from wearable accelerometers are logged wirelessly to a cell phone and control the animation of the player in a virtual race game (avatar) with other players over the cellular network. Players can use their excess of activity points earned from the race game to get hints in mental games of the suite, like Sudoku. Initial studies indicate that NEAT-o-Games may bring a positive physical, psychological, and social impact on players.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {515–518},
numpages = {4},
keywords = {obesity intervention, obesity prevention, physical activity, serious gaming, ubiquitous computing, NEAT, wearable sensors, behavior modification, human computer interaction, pervasive gaming},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409334,
author = {Khan, Vassilis-Javed and Metaxas, Georgios and Markopoulos, Panos},
title = {Pervasive Awareness},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409334},
doi = {10.1145/1409240.1409334},
abstract = {We are interested in systems that support awareness between individuals, by exchanging information that is automatically captured and presenting it to members of their social network. Here we demonstrate a principle for the operation of these systems which we describe as pervasive awareness: awareness information is aggregated opportunistically as mobile devices carrying some information migrate across space and cluster dynamically. We present a minimal demonstration of the principle where qualitative location information is used to select information offered by context capture devices (for the demonstration these are cameras).},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {519–521},
numpages = {3},
keywords = {awareness systems, computer mediated communication},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409335,
author = {Henze, Niels and Rukzio, Enrico and Lorenz, Andreas and Righetti, Xavier and Boll, Susanne},
title = {Physical-Virtual Linkage with Contextual Bookmarks},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409335},
doi = {10.1145/1409240.1409335},
abstract = {In our everyday life we often see objects or persons and are aware that there are related digital services such as an online ticket service when seeing a poster advertising a concert. Currently it is a rather time consuming activity to find the related information. Using our Contextual Bookmark system a user can define a snapshot with her mobile phone consisting of a picture, time stamp and location. Such a bookmark can then be stored on the mobile phone, exchanged with friends and in particular be used to access related videos, web pages, and other services. This helps the user to bridge the gap between the virtual and the real world in order to use related services. Combining content and context analysis objects are recognized without any visual markers or electronic tags. We would like to demonstrate our system based on a nomadic usage scenario in which a person defines a Contextual Bookmark of a movie trailer, buys the corresponding movie, plays the movie on a TV, and exchanges the bookmark with a friend.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {523–526},
numpages = {4},
keywords = {contextual bookmark, physical interaction, content analysis, mobile interaction, physical-virtual linkage},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409336,
author = {Greaves, Andrew and Hang, Alina and Rukzio, Enrico},
title = {Picture Browsing and Map Interaction Using a Projector Phone},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409336},
doi = {10.1145/1409240.1409336},
abstract = {It is expected that projector phones (mobile phones with built-in pico projectors) will hit the market by 2010. Such phones provide a completely new way to display information and interaction techniques. The system presented in this paper allows the simulation of these projector phones as the real devices are not yet available. Through this, we demonstrate that it is currently possible to design, develop and evaluate applications for projector phones. The system supports three different modalities in order to compare when which display (phone display, projection) should be used. This prototype system was used for the implementation of two applications in order to test the advantages and disadvantages of projector phones for two common scenarios, picture browsing and map interaction. This demonstration paper describes the hardware used for the simulation of projector phones and the two developed prototypes. These prototypes were used for two different studies discussed in [1] and [2].},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {527–530},
numpages = {4},
keywords = {projector phone, map interaction, photo browsing},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409337,
author = {Hardy, Robert and Rukzio, Enrico},
title = {Touch & Interact: Touch-Based Interaction with a Tourist Application},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409337},
doi = {10.1145/1409240.1409337},
abstract = {Touch & Interact is an interaction technique which combines mobile phones and public displays. The motivation for the project is to overcome the intrinsic output limitations of mobile phones. Touch & Interact extends the phone output to a public display allowing both screens to share the display space. This concept is especially useful for separating public and private data -- only showing private data on the phone display. During interaction, the phone is used as a stylus for the public display and can touch the display at any location. The phone also lends additional capabilities to interactions by providing storage capabilities, additional feedback (e.g. audio and haptic) and input modalities (e.g. keypad and joystick). The underlying technology supporting Touch & Interact is Near Field Communication (NFC); the dynamic display includes a mesh of NFC tags which can be interacted with using an NFC phone. A tourist map application was used to explore and test Touch & Interact in an environment with rich functionality.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {531–534},
numpages = {4},
keywords = {touch & interact, mobile interaction, dynamic display},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409338,
author = {Werner, Julia and Wettach, Reto and Hornecker, Eva},
title = {United-Pulse: Feeling Your Partner's Pulse},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409338},
doi = {10.1145/1409240.1409338},
abstract = {This paper introduces a device that creates remote intimacy by the use of two rings named "united-pulse". Each ring can measure the wearer's heartbeat and send it to the partner's ring. Hereby, artificial corporeality is created between the couple. By means of a working prototype, united-pulse has been successfully tested. Among the 28 participants the prototype has attracted large interest. Through the heartbeat -- the essential vital sign -- a feeling of being very close to the partner is provided. Touching the ring allows a small moment of intimacy in situations where emotional support is needed.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {535–538},
numpages = {4},
keywords = {wearable, remote intimacy, user experience, body-data, design, human-machine-interaction, tangible, digital jewelry},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409340,
author = {Iben, Hendrik},
title = {A Methodical Approach to Evaluating the Use of Audio-Interfaces for Mobile and Wearable Computing},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409340},
doi = {10.1145/1409240.1409340},
abstract = {Audio interfaces for mobile and wearable computing are in an early state of development. User studies concentrate on the usability of audio interfaces as means of interacting with a device but leave out the question of how an audio interface can aid at performing a main task. Studying the impact of audio interfaces in computer aided tasks for wearable and mobile computing will provide guidelines for hands-free interface design and information presentation. To be able to measure the performance a simulated main task is used where varying mental loads can be setup. Providing an index of difficulty for the simulated task, users studies will reveal how effective an audio interface can be used to convey information to aid at a task.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {541–542},
numpages = {2},
keywords = {HotWire, user centered design, wearable computing, audio displays, steering law},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409341,
author = {Buttussi, Fabio},
title = {A User-Adaptive and Context-Aware Architecture for Mobile and Desktop Training Applications},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409341},
doi = {10.1145/1409240.1409341},
abstract = {Our research aims at proposing a user-adaptive and context-aware architecture for mobile and desktop training applications. Our main result to date in the Mobile HCI field is an adaptive wearable system for fitness training.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {543},
numpages = {1},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409342,
author = {Teo, Hong-Siang},
title = {An Activity-Driven Model for Context-Awareness in Mobile Computing},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409342},
doi = {10.1145/1409240.1409342},
abstract = {To fully exploit the strengths and potential of the today's mobile devices, context-awareness needs to be incorporated into the very essence of mobile computing. But today's mobile computing approaches either fail to do so, or do it in a very limited way. At the same time, current research efforts in context-awareness fail to consider context as a dynamic construct, and is unable to offer a holistic treatment of context-awareness that includes an active role for the user. Our hypothesis is that to make context-awareness more intuitive and productive to the mobile user, the notion of context needs to be user-centric. In this research, we explore a novel, general form of context-aware mobile computing that is activity-driven, and where context dynamically arises from the user's activity.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {545–546},
numpages = {2},
keywords = {mobile computing, context-awareness},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409343,
author = {Ghiani, Giuseppe},
title = {Enabling Orientation for the Blind by Means of Mobile Guides},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409343},
doi = {10.1145/1409240.1409343},
abstract = {I propose an investigation on location sensing and multimodal output for aiding blinds in mobility and orientation. The aim of my thesis is the design and evaluation of a compact and cost-effective configuration based on a consumer PDA with little custom hardware. The results of the performed tests will allow to define a set of guidelines to enhance the future generation of mobile devices with sensors and actuators.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {547–548},
numpages = {2},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409344,
author = {Masters, Michelle Montgomery},
title = {Exploring Usability in Mobile Autonomic Networks},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409344},
doi = {10.1145/1409240.1409344},
abstract = {This paper describes the motivation and background to conducting research in Mobile Autonomic Networks and poses research questions for the MobileHCI community to address.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {549–550},
numpages = {2},
keywords = {usability, smartphones, autonomic networks, design, mobile phones, evaluation},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409345,
author = {V\"{a}\"{a}t\"{a}j\"{a}, Heli},
title = {Factors Affecting User Experience in Mobile Systems and Services},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409345},
doi = {10.1145/1409240.1409345},
abstract = {Understanding the factors affecting user experience of mobile systems and services is becoming increasingly important as the mobile ecosystem is becoming a reality. The aim of my work is to contribute to the theory building of frameworks on factors affecting user experience in the mobile context and to the methodology for studying and evaluating user experience of mobile systems and services.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {551},
numpages = {1},
keywords = {mobile service, mobile systems, user experience},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409346,
author = {Garnham, Darius},
title = {Implicit Participation from a Glance},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409346},
doi = {10.1145/1409240.1409346},
abstract = {In this paper, we describe studies which have looked at the value and comparison of group participation methods considering mobile interaction with Large Public Displays},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {553–554},
numpages = {2},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409347,
author = {Walker, Kevin},
title = {Mobile Audio Capture in a Learning Ecology},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409347},
doi = {10.1145/1409240.1409347},
abstract = {This research provides support for the importance of audio capture in mobile learning contexts. Audio is considered in an ecology of resources as a tool to support narrative creation. Audio trails are presented in three different contexts, each targeting a particular community.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {555},
numpages = {1},
keywords = {mobile, museum, trails, audio},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409348,
author = {Kn\"{o}del, Sebastian},
title = {Visualization and Interaction with Mobile Technology},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409348},
doi = {10.1145/1409240.1409348},
abstract = {Our research in Mobile HCI concerns the exploration of new interaction and visualization techniques for 3D data on mobile devices. Furthermore, we want to examine new forms of collaboration supporting groups of people, who interact together with diverse data using heterogeneous hardware, from small mobile devices to large projection screens. Hence, in our investigations we propose adapted visual representations and efficient interaction techniques that take in account the human factor, as well as technical terms of mobile technology.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {557–558},
numpages = {2},
keywords = {rendering techniques, interaction techniques, sketching, mobile dervices, virtual and mixed reality, navigation, pen-input},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409350,
author = {Steen, Marc and de Boer, Jenny and Kuiper-Hoyng, Lilliane and Visser, Froukje Sleeswijk},
title = {Co-Design: Practices, Challenges and Lessons Learned},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409350},
doi = {10.1145/1409240.1409350},
abstract = {This paper is a proposal to organize a workshop about co-design during the during MobileHCI 2008 Conference. Main goals of the workshop are to discuss co-design practices and to articulate challenges and lessons learned.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {561–562},
numpages = {2},
keywords = {in-context research, co-design, user involvement, mobile applications, human-centered design, reflection},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409351,
author = {Henze, Niels and Broll, Gregor and Rukzio, Enrico and Rohs, Michael and Zimmermann, Andreas},
title = {Mobile Interaction with the Real World},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409351},
doi = {10.1145/1409240.1409351},
abstract = {The Mobile HCI community is moving beyond the interaction between a single user and her mobile device taking the users environment into account. Mobile interaction with the real world concentrates on using mobile devices as tools to interact with real world objects. This workshop continues the successful mobile interaction with the real world workshops 2006 and 2007. Relevant topics include (but are not limited to) mobile interaction with the real world; mobile devices as user interfaces for terminals; and Frameworks, middleware and APIs for the development of applications that take mobile interactions with the real world into account. The workshop combines technical presentations with the presentation of prototypes and focused discussions to drive interaction between participants.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {563–565},
numpages = {3},
keywords = {smart objects, user interface generation, real world, mobile interaction, mobile device},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409352,
author = {H\"{a}kkil\"{a}, Jonna and Isomursu, Minna and Spasojevic, Mirjana and Beekhuyzen, Jenine},
title = {Mobile Multimedia: Content Creation and Use},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409352},
doi = {10.1145/1409240.1409352},
abstract = {During recent years, mobile devices have become tools for versatile activities related to multimedia content. Especially mobile phones have emerged in this field, integrating the features of music players and digital and video cameras into mobile communication technologies. Multimedia messaging has followed text messaging, and Mobile TV is taking its steps towards large audiences. This workshop aims to gather researchers and practitioners who look at existing and anticipated end-user trends and usage culture in using and creating mobile multimedia content, as well as novel applications and ideas related to human computer interaction with mobile multimedia devices.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {567–568},
numpages = {2},
keywords = {cultural studies, human-computer interaction, usage culture, end-user needs, mobile phones, mobile multimedia},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409353,
author = {Nanavati, A. A. and Rajput, N. and Rudnicky, A. I. and Turunen, M.},
title = {SiMPE: Third Workshop on Speech in Mobile and Pervasive Environments},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409353},
doi = {10.1145/1409240.1409353},
abstract = {In the past, voice-based applications have been accessed using unintelligent telephone devices through Voice Browsers that reside on the server. The proliferation of pervasive devices and the increase in their processing capabilities, clientside speech processing has been emerging as a viable alternative. In SiMPE 2008, the third in the series, we will continue to explore the various possibilities and issues that arise while enabling speech processing on resource-constrained, possibly mobile devices.In SiMPE 2007 [2], the focus was on developing regions. Given the importance of speech in developing regions, SiMPE 2008 will include "SiMPE for developing regions" as a topic of interest. As a result of discussions in SiMPE 2007, we plan to invite and encourage Speech UI designers to participate in SiMPE 2008. We will also review the progress made over the last two years, in the areas and key problems identified in SiMPE 2006 [3].},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {569–570},
numpages = {2},
keywords = {pervasive computing, mobile computing, speech processing},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409354,
author = {Roto, Virpi and Kaasinen, Eija},
title = {The Second International Workshop on Mobile Internet User Experience},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409354},
doi = {10.1145/1409240.1409354},
abstract = {Mobile access to the Internet is increasing but still dominated by early adopters. To attract more users, user experience of mobile Internet needs to be improved. This requires understanding better mobile users and usage contexts to identify the kinds of services that users will be ready to use. In addition to increasing the attractiveness of services, successful user experience also requires improvements in devices and infrastructures such as networks, browsers and proxies and means to find situationally relevant services. This workshop calls developers and researchers of mobile Internet to exchange experiences and ideas how user experience of mobile Internet could be improved.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {571–573},
numpages = {3},
keywords = {user experience, user acceptance, mobile internet},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

@inproceedings{10.1145/1409240.1409355,
author = {Kramer, Mark A. M. and Reponen, Erika and Obrist, Marianna},
title = {MobiMundi: Exploring the Impact of User-Generated Mobile Content -- the Participatory Panopticon},
year = {2008},
isbn = {9781595939524},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/1409240.1409355},
doi = {10.1145/1409240.1409355},
abstract = {The MobiMundi Workshop aims to provide a forum for researchers and developers from different backgrounds to gather together to explore and discuss the impact of existing and emerging mobile information and communications technologies and services on society. The theme for this workshop will examine the real and potential impacts of user-generated mobile content on individuals and society as a whole. The individual and societal impacts discussed will primarily focus on user centered and social perspectives, but will also explore how user behavior is changing and which problems are emerging, bearing in mind that individual actions are creating privacy and security issues which could lead towards a new quality of a hyper-surveillance society by providing the framework for the participatory panopticon. Moreover, mobile human-computer interaction and design related issues will be explored and considered in order to support users requirement to share and co-create mobile user-generated audiovisual content.},
booktitle = {Proceedings of the 10th International Conference on Human Computer Interaction with Mobile Devices and Services},
pages = {575–577},
numpages = {3},
keywords = {privacy, citizen-media, participatory-journalism, mobile-technologies, social impact, surveillance, smart-mobs, blogs, sousveillance, user-generated content, technology-assessment, social-factors, computers and society, social issues, mobile-services, panopticom},
location = {Amsterdam, The Netherlands},
series = {MobileHCI '08}
}

license_type: permissive

branch_name: refs/heads/main

extension: bib


text:
package helpers_test

import (
	. "github.com/onsi/ginkgo/v2"
	. "github.com/onsi/gomega"
	"github.com/solo-io/gloo/test/helpers"
)

var _ = Describe("UpstreamBuilder", func() {
	When("using the base builder", func() {
		It("generates an upstream without SslConfig", func() {
			up := helpers.NewUpstreamBuilder().Build(1)
			Expect(up.SslConfig).To(BeNil())
		})
	})

	When("with consistent SNI", func() {
		It("generates an upstream with the same SNI for any i", func() {
			up1 := helpers.NewUpstreamBuilder().WithConsistentSni().Build(1)
			Expect(up1.SslConfig).NotTo(BeNil())
			up2 := helpers.NewUpstreamBuilder().WithConsistentSni().Build(2)
			Expect(up2.SslConfig).NotTo(BeNil())

			Expect(up1.SslConfig.Sni).To(Equal(up2.SslConfig.Sni))
		})
	})

	When("with unique SNI", func() {
		It("generates an upstream with unique SNI for a given i", func() {
			up1 := helpers.NewUpstreamBuilder().WithUniqueSni().Build(1)
			Expect(up1.SslConfig).NotTo(BeNil())
			up2 := helpers.NewUpstreamBuilder().WithUniqueSni().Build(2)
			Expect(up2.SslConfig).NotTo(BeNil())

			Expect(up1.SslConfig.Sni).NotTo(Equal(up2.SslConfig.Sni))
		})
	})

})

repository: solo-io/gloo

repo_name: solo-io/gloo

gha_language: Go

extension: go


text:
SUMMARY = "OPTEE fTPM Microsoft TA"
DESCRIPTION = "TCG reference implementation of the TPM 2.0 Specification."
HOMEPAGE = "https://github.com/microsoft/ms-tpm-20-ref/"

COMPATIBLE_MACHINE ?= "invalid"
COMPATIBLE_MACHINE:qemuarm64 = "qemuarm64"
COMPATIBLE_MACHINE:qemuarm64-secureboot = "qemuarm64"
COMPATIBLE_MACHINE:qemu-generic-arm64 = "qemu-generic-arm64"
COMPATIBLE_MACHINE:qemuarm-secureboot = "qemuarm"

#FIXME - doesn't currently work with clang
TOOLCHAIN = "gcc"

inherit deploy python3native

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5a3925ece0806073ae9ebbb08ff6f11e"

DEPENDS = "python3-pyelftools-native optee-os-tadevkit python3-cryptography-native "

FTPM_UUID="bc50d971-d4c9-42c4-82cb-343fb7f37896"

SRC_URI = "gitsm://github.com/Microsoft/ms-tpm-20-ref;branch=main;protocol=https \
           file://0001-add-enum-to-ta-flags.patch"

SRCREV = "d638536d0fe01acd5e39ffa1bd100b3da82d92c7"

S = "${WORKDIR}/git"

OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"

EXTRA_OEMAKE += '\
    CFG_FTPM_USE_WOLF=y \
    TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
    TA_CROSS_COMPILE=${TARGET_PREFIX} \
    CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST} -I${WORKDIR}/optee-os" \
'

EXTRA_OEMAKE:append:aarch64:qemuall = "\
    CFG_ARM64_ta_arm64=y \
"

# python3-cryptography needs the legacy provider, so set OPENSSL_MODULES to the
# right path until this is relocated automatically.
export OPENSSL_MODULES="${STAGING_LIBDIR_NATIVE}/ossl-modules"

PARALLEL_MAKE = ""

do_compile() {
    # The internal ${CC} includes the correct -mcpu option
    sed -i 's/-mcpu=$(TA_CPU)//' Samples/ARM32-FirmwareTPM/optee_ta/fTPM/sub.mk
    # there's also a secure variable storage TA called authvars
    cd ${S}/Samples/ARM32-FirmwareTPM/optee_ta
    oe_runmake
}

do_install () {
    mkdir -p ${D}/${nonarch_base_libdir}/optee_armtz
    install -D -p -m 0644 ${S}/Samples/ARM32-FirmwareTPM/optee_ta/out/fTPM/${FTPM_UUID}.ta ${D}/${nonarch_base_libdir}/optee_armtz/
    install -D -p -m 0644 ${S}/Samples/ARM32-FirmwareTPM/optee_ta/out/fTPM/${FTPM_UUID}.stripped.elf ${D}/${nonarch_base_libdir}/optee_armtz/
}

do_deploy () {
    install -d ${DEPLOYDIR}/optee
    install -D -p -m 0644 ${S}/Samples/ARM32-FirmwareTPM/optee_ta/out/fTPM/${FTPM_UUID}.stripped.elf ${DEPLOYDIR}/optee/
}

addtask deploy before do_build after do_install

FILES:${PN} += " \
               ${nonarch_base_libdir}/optee_armtz/${FTPM_UUID}.ta \
               ${nonarch_base_libdir}/optee_armtz/${FTPM_UUID}.stripped.elf \
               "

# Imports machine specific configs from staging to build
PACKAGE_ARCH = "${MACHINE_ARCH}"
INSANE_SKIP:${PN} += "ldflags"

license: MIT

repository: openbmc/openbmc

repo_name: openbmc/openbmc

branch_name: refs/heads/master

gha_license_id: NOASSERTION

gha_language: Python

extension: bb


text:
DEFAULT_PREFERENCE = "-1"
# This is the Intel GPL IXP4XX ethernet driver (Linux) plus patches
# to make it work on 2.6 kernels.
#
HOMEPAGE = "http://www.intel.com/design/network/products/npfamily/ixp420.htm"
LICENSE = "GPL"
PR = "r0"

DEPENDS = "ixp-osal"
DEPENDS = "ixp4xx-csr"
RDEPENDS = "ixp4xx-csr"

SRC_URI = "http://downloadmirror.intel.com/df-support/10159/eng/GPL_ixp400LinuxEthernetDriverPatch-1_5_1.zip"
SRC_URI += "file://2.6.14.patch;patch=1"
SRC_URI += "file://2.6.15.patch;patch=1"
SRC_URI += "file://device-name.patch;patch=1"
SRC_URI += "file://poll-controller.patch;patch=1"
SRC_URI += "file://le.patch;patch=1"
SRC_URI += "file://int-random.patch;patch=1"
SRC_URI += "file://stop-on-rmmod.patch;patch=1"
SRC_URI += "file://continue-if-qmgr-init-fails.patch;patch=1"
SRC_URI += "file://netdev_max_backlog.patch;patch=1"
SRC_URI += "file://debug.patch;patch=1"
SRC_URI += "file://Makefile.patch;patch=1"
SRC_URI += "file://params.patch;patch=1"
SRC_URI += "file://module-param.patch;patch=1"
SRC_URI += "file://modprobe.conf"

S = "${WORKDIR}"

COMPATIBLE_HOST = "^arm.*-linux.*"
COMPATIBLE_MACHINE = "(nslu2|ixp4xx)"

PROVIDES = "virtual/ixp-eth"
RPROVIDES = "ixp-eth"

inherit module

# This is a somewhat arbitrary choice:
OSAL_DIR = "${STAGING_KERNEL_DIR}/ixp_osal"

IX_TARGET = "linux${SITEINFO_ENDIANESS}"
IX_ENSURE = ""
#IX_ENSURE = "-DIX_OSAL_ENSURE_ON=1"
# The following controls the name of the ethernet devices which get
# registered, the default (if this is empty) is ixp0, ixp1, otherwise
# it is eth0, eth1
DEVICE_NAME = "-DIX_DEVICE_NAME_ETH=1"

IXP4XX_CSR_SYMVERS = "${STAGING_KERNEL_DIR}/ixp400-csr.symvers"

EXTRA_OEMAKE = "'PWD=${S}' \
		'IX_TARGET=${IX_TARGET}' \
		'IXP4XX_CSR_DIR=${STAGING_INCDIR}/linux/ixp4xx-csr' \
		'IXP4XX_CSR_SYMVERS=${IXP4XX_CSR_SYMVERS}' \
		'OSAL_DIR=${OSAL_DIR}' \
		'IX_CFLAGS=-DIX_UTOPIAMODE=0 -DIX_MPHYSINGLEPORT=1 ${IX_ENSURE} ${DEVICE_NAME} -DIX_COMPONENT_NAME=-1' \
		'LINUX_SRC=${STAGING_KERNEL_DIR}' \
		'LINUX_CROSS_COMPILE=${HOST_PREFIX}' \
		"

# This is to check for unresolved symbol errors and ensure the build
# fails, an error here probably means too much as been deconfigured
# out of ixp4xx-csr.
KCONFIG_FILE = "${STAGING_KERNEL_DIR}/kernel-config"
do_compile_append () {
	. '${KCONFIG_FILE}'
	echo "MODPOST: checking that all symbols are resolved"
	if '${STAGING_KERNEL_DIR}/scripts/mod/modpost' \
		${CONFIG_MODVERSIONS:+-m} \
		${CONFIG_MODULE_SRCVERSION_ALL:+-a} \
		-i '${STAGING_KERNEL_DIR}/ixp400-csr.symvers' \
		ixp400_eth.o 2>&1 | egrep .
	then
		echo "MODPOST errors - see above"
		return 1
	else
		return 0
	fi
}

do_install () {
	install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net
	install -m 0644 ixp400_eth.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net/
	install -d ${D}${sysconfdir}/modprobe.d
	install -m 0644 modprobe.conf ${D}${sysconfdir}/modprobe.d/eth0
}


text:
// baukasten - Toolkit for OpenGL
//
// Copyright (c) 2012, Marcel Hauf <marcel.hauf@googlemail.com>
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package gl

import (
	glimage "github.com/Agon/baukasten/image"
	"github.com/Agon/baukasten/math/geometry"
	"github.com/Agon/baukasten/math/matrix"
	"image"
)

const (
	surfaceVertexShaderData   = "#version 120\nattribute vec2 coord2d;\nattribute vec2 texcoord;\nvarying vec2 f_texcoord;\nvarying vec4 f_color;\nuniform mat4 mvp;\nuniform vec4 v_color;\nvoid main(void) {\ngl_Position = mvp * vec4(coord2d, 0.0, 1.0);\nf_texcoord = texcoord;\nf_color = v_color;\n}"
	surfaceFragmentShaderData = "#version 120\nvarying vec2 f_texcoord;\nvarying vec4 f_color;\nuniform sampler2D texture;\nvoid main(void) {\n" +
		"gl_FragColor = f_color * texture2D(texture, f_texcoord);\n}"
)

var (
	DefaultSurfaceShaderProgram *Program
	surfaceCoordAttrib          *AttributeLocation
	surfaceTexAttrib            *AttributeLocation
	surfaceColorUni             *UniformLocation
	surfaceMvpUni               *UniformLocation
	surfaceTexUni               *UniformLocation
)

type Surface struct {
	// Scale
	scaleX float32
	scaleY float32
	// Rotate
	angle float32
	// Size
	width, height float32
	// Color
	r, g, b, a float32
	// OpenGL
	texture *Texture
	vbo     *VertexBufferObject
}

func OpenSurface(name string) (*Surface, error) {
	img, err := glimage.OpenImage(name)
	if err != nil {
		return nil, err
	}
	return LoadSurface(img)
}

func LoadSurface(img image.Image) (*Surface, error) {
	texture, err := LoadTexture(img)
	if err != nil {
		return nil, err
	}
	// Generate triangles
	width := float32(img.Bounds().Dx())
	height := float32(img.Bounds().Dy())

	x := width / 2
	y := height / 2
	triangles := []float32{
		-x, -y, 0, 0,
		x, -y, 1, 0,
		x, y, 1, 1,
		x, y, 1, 1,
		-x, y, 0, 1,
		-x, -y, 0, 0,
	}

	vbo := NewVBO()
	vbo.BufferData(triangles)

	surface := &Surface{
		texture: texture,
		vbo:     vbo,
		width:   width,
		height:  height,
	}
	return surface, nil
}

func (s *Surface) Delete() {
	s.texture.Delete()
	s.vbo.Delete()
}

func (s *Surface) Draw(x, y float32) {
	DefaultSurfaceShaderProgram.Use()
	model := matrix.TranslationMatrix(x, y, 0)
	model = model.Mul(matrix.ScaleMatrix(s.scaleX, s.scaleY, 1))
	if s.angle != 0 {
		model = model.Mul(matrix.RotationMatrix(s.angle, geometry.Vector3{0, 0, 1}))
	}
	matrix := DefaultCamera.Mul(model)
	surfaceMvpUni.UniformMatrix4fv(1, false, matrix.Transposed())

	surfaceTexUni.Uniform1i(0)
	surfaceColorUni.Uniform4f(s.r, s.g, s.b, s.a)

	surfaceCoordAttrib.Enable()
	defer surfaceCoordAttrib.Disable()

	s.vbo.Bind()
	defer s.vbo.Unbind()
	surfaceCoordAttrib.AttribPointer(2, FloatType, false, 16, Offset(nil, 0))

	s.texture.Bind()
	defer s.texture.Unbind()

	surfaceTexAttrib.Enable()
	defer surfaceTexAttrib.Disable()
	surfaceTexAttrib.AttribPointer(2, FloatType, false, 16, Offset(nil, 8))

	s.vbo.DrawArrays(0, 6)
}

repository: extemporalgenome/baukasten

repo_name: extemporalgenome/baukasten


text:
@article{RN1049,
 author = {Britton, P. N. and Blyth, C. C. and Macartney, K. and Dale, R. C. and Li-Kim-Moy, J. and Khandaker, G. and Crawford, N. and Marshall, H. and Clark, J. and Elliott, E. and Booy, R. and Cheng, A. C. and Jones, C. A. and Ace study investigators, FluCAN investigators and network, Paeds},
 doi = {10.1093/cid/cix412
10.1093/clinid/cix412},
 issn = {1537-6591 (Electronic)
1058-4838 (Linking)},
 journal = {Clin Infect Dis},
 title = {The Spectrum and Burden of Influenza-Associated Neurological Disease in Children: Combined Encephalitis and Influenza Sentinel Site Surveillance from Australia 2013-2015},
 type = {Journal Article},
 url = {https://www.ncbi.nlm.nih.gov/pubmed/28460008},
 year = {2017}
}


text:
/*
 * 4-D loop code.
 * Generated automatically from the following pseudo-code:
 *
 * serpentine omp
 * loop (rv, rz, ry, rx)
 * {
 *   calc (block);
 * }
 *
 */

 // Number of iterations to get from begin_rv to (but not including) end_rv,
 // stepping by step_rv.
const int num_rv = ((end_rv - begin_rv) + (step_rv - 1)) / step_rv;

 // Number of iterations to get from begin_rz to (but not including) end_rz,
 // stepping by step_rz.
const int num_rz = ((end_rz - begin_rz) + (step_rz - 1)) / step_rz;

 // Number of iterations to get from begin_ry to (but not including) end_ry,
 // stepping by step_ry.
const int num_ry = ((end_ry - begin_ry) + (step_ry - 1)) / step_ry;

 // Number of iterations to get from begin_rx to (but not including) end_rx,
 // stepping by step_rx.
const int num_rx = ((end_rx - begin_rx) + (step_rx - 1)) / step_rx;

 // Number of iterations in loop collapsed across rv, rz, ry, rx dimensions.
const long int num_rv_rz_ry_rx =
  (long int) num_rv * (long int) num_rz * (long int) num_ry *
  (long int) num_rx;

 // Loop index var.
long int loop_index_rv_rz_ry_rx = 0;

 // Computation loop.

 // Distribute iterations among OpenMP threads.
_Pragma ("omp for schedule(dynamic)")
  for (; loop_index_rv_rz_ry_rx < num_rv_rz_ry_rx; loop_index_rv_rz_ry_rx++)
  {

    // Zero-based, unit-stride index var for rv.
    int index_rv = loop_index_rv_rz_ry_rx / (num_rz * num_ry * num_rx);

    // Zero-based, unit-stride index var for rz.
    int index_rz = (loop_index_rv_rz_ry_rx / (num_ry * num_rx)) % num_rz;

    // Reverse direction of index_rz after every iteration of index_rv for
    // 'serpentine' path.
    if ((index_rv & 1) == 1)
      index_rz = num_rz - index_rz - 1;

    // Zero-based, unit-stride index var for ry.
    int index_ry = (loop_index_rv_rz_ry_rx / (num_rx)) % num_ry;

    // Reverse direction of index_ry after every iteration of index_rz for
    // 'serpentine' path.
    if ((index_rz & 1) == 1)
      index_ry = num_ry - index_ry - 1;

    // Zero-based, unit-stride index var for rx.
    int index_rx = (loop_index_rv_rz_ry_rx) % num_rx;

    // Reverse direction of index_rx after every iteration of index_ry for
    // 'serpentine' path.
    if ((index_ry & 1) == 1)
      index_rx = num_rx - index_rx - 1;

    // This value of index_rv covers rv from start_rv to stop_rv-1.
    const int start_rv = begin_rv + (index_rv * step_rv);
    const int stop_rv = min (start_rv + step_rv, end_rv);

    // This value of index_rz covers rz from start_rz to stop_rz-1.
    const int start_rz = begin_rz + (index_rz * step_rz);
    const int stop_rz = min (start_rz + step_rz, end_rz);

    // This value of index_ry covers ry from start_ry to stop_ry-1.
    const int start_ry = begin_ry + (index_ry * step_ry);
    const int stop_ry = min (start_ry + step_ry, end_ry);

    // This value of index_rx covers rx from start_rx to stop_rx-1.
    const int start_rx = begin_rx + (index_rx * step_rx);
    const int stop_rx = min (start_rx + step_rx, end_rx);

    // Computation.
    calc_block (context, t0, start_rv, start_rx, start_ry, start_rz, stop_rv,
		stop_rx, stop_ry, stop_rz);
  }

// End of generated code.

repository: gwilkins/yask

repo_name: gwilkins/yask

extension: hpp


text:
@article{lakshina2014breakcurse_eng,
	author={Lakshina, Valeriya},
	title={{Is it possible to break the ``curse of dimensionality''? Spatial specifications of multivariate volatility models}},
	journal={Applied Econometrics},
	year={2014},
	volume={36},
	number={4},
	pages={61-78},
	keywords={multivariate volatility models; curse of dimensionality; weight matrix; spatial autoregression},
	abstract={The article is devoted to the estimation of multivariate volatility of a portfolio consisted from twenty American stocks. The six specifications of multivariate volatility models are formulated and estimated. It’s demonstrated that spatial specifications of multivariate volatility models allow not only reduce the dimension of the problem, but in some cases outdo original specifications at in-sample and out-of-sample comparison.},
	url={http://ideas.repec.org/a/ris/apltrx/0249.html},
    note={in Russian}
}
@article{lakshina2016hedge_eng,
	author={Lakshina, Valeriya},
	title={{Dynamic hedging considering the degree of risk aversion}},
	journal={HSE Economic Journal},
	year=2016,
	volume={20},
	number={1},
	pages={156-174},
	url={https://ej.hse.ru/data/2016/03/25/1127994289/%D0%9B%D0%B0%D0%BA%D1%88%D0%B8%D0%BD%D0%B0.pdf},
    note={in Russian}
}
@article{lakshina2016comparative_eng,
	author={Lakshina, Valeriya and Lapshina, Ksenia},
	title={{Comparative analysis of strategies for hedging a securities portfolio with futures}},
	journal={Finance: Theory and Practice},
	year=2016,
	volume={95},
	number={5},
	pages={105-114},
	url={https://financetp.fa.ru/jour/article/view/292/219},
    note={in Russian}
}

@article{lakshina2016fluke,
	title={Fluke of stochastic volatility versus GARCH inevitability or which model creates better forecasts?},
	author={Lakshina, Valeriya and Silaev, Andrey},
	journal={Economics Bulletin},
	volume={36},
	number={4},
	pages={2368--2380},
	year={2016},
    url={http://www.accessecon.com/Pubs/EB/2016/Volume36/EB-16-V36-I4-P229.pdf},
    abstract={The paper proposes the thorough investigation of in-sample and out-of-sample performance of five GARCH and two stochastic volatility models, estimated on the Russian financial data. The data includes prices of Aeroflot and Gazprom stocks and Ruble against US dollar exchange rates. In our analysis we use probability integral transform for in-sample comparison and Mincer-Zarnowitz regression along with classical forecast performance measures for out-of-sample comparison. Studying both the explanatory and the forecasting power of the considered models we came to the conclusion that stochastic volatility models perform equally or in some cases better than GARCH models.}
}

@proceedings{CMDM2017,
	booktitle = {The Second Workshop on Computer Modelling in Decision Making (CMDM)},
	title = {Proceedings of the The Second Workshop on Computer Modelling in Decision Making (CMDM)},
	year = 2017,
	editor = {Abraham Althonayan and Tatiana A. Belkina and Vladimir S. Mkhitaryan and Dmitry Pavluk and Sergei P. Sidorov},
	number = 2018,
	series = {CEUR Workshop Proceedings},
	address = {Aachen},
	issn = {1613-0073},
	url = {http://ceur-ws.org/Vol-2018/},
	venue = {Saratov, Russia},
	eventdate = {2017-11-09/2017-11-10},
}

@inproceedings{lakshina:CMDM2017,
	title = {Hedging and Risk Aversion on Russian Stock Market: Strategies Based on MGARCH and MSV Models},
	author = {Valeriya Lakshina},
	pages = {83--92},
	url = {http://ceur-ws.org/Vol-2018/paper-10.pdf},
	crossref = {CMDM2017},
    abstract={The paper studies the problem of dynamic hedge ratio calculation for the portfolio consisted of two assets – futures and the underlying stock. We apply the utility based approach to account for the degree of risk aversion in the hedging strategy. Seventeen portfolios, consisted of Russian blue-chip stocks and futures, are estimated in the paper. In order to estimate the conditional covariances of hedged portfolio returns, such multivariate volatility models as GO-GARCH, copula-GARCH, asymmetric DCC and parsimonious stochastic volatility model are applied. The hedging efficiency is estimated on the out-of-sample period using the maximum attainable risk reduction, the financial result and the investor’s utility. It’s shown that for 60% of portfolios ADCC surpasses the other models in hedging. Including the degree of risk aversion in the investor’s utility function together with above-mentioned volatility models allows to reach hedging efficiency of 88%.}
}

@techreport{lakshina2018spillover,
	author={Lakshina, Valeria and Karatetskaya, Efrosiniya},
	title={{Volatility spillovers with spatial effects on the oil and gas market}},
	year=2018,
	institution={National Research University Higher School of Economics},
	type={HSE Working papers},
	url={https://wp.hse.ru/data/2018/12/25/1143086658/72FE2018.pdf},
	number={WP BRP 72/FE/2018},
	abstract={The article is devoted to the estimation of volatility spillovers occurred on the oil and gas market taking into account cross-sectional dependence. The latter is implemented via spatial specifications of the BEKK multivariate volatility model. We also use DCC, GO-GARCH and ADCC models as a benchmark.},
	keywords={multivariate volatility models, spillover effects, spatial specifications, oil and gas market},
	doi={},
}

repository: lakshinav/academic-website

repo_name: lakshinav/academic-website


text:
file(REMOVE_RECURSE
  "CMakeFiles/wrlinux1019-profile-playbooks"
)

# Per-language clean rules from dependency scanning.
foreach(lang )
  include(CMakeFiles/wrlinux1019-profile-playbooks.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

extension: cmake


text:
#include "cute.h"
#include "ide_listener.h"
#include "xml_listener.h"
#include "cute_runner.h"

#include "Graph.h"
#include <iostream>
#include <string>
#include <random>
#include <time.h>
#include <chrono>

using namespace std;

Graph<int> createTestFlowGraph() {
	Graph<int> myGraph;

	for(int i = 1; i < 7; i++)
		myGraph.addVertex(i);

	myGraph.addEdge(1, 2, 3);
	myGraph.addEdge(1, 3, 2);
	myGraph.addEdge(2, 5, 4);
	myGraph.addEdge(2, 4, 3);
	myGraph.addEdge(2, 3, 1);
	myGraph.addEdge(3, 5, 2);
	myGraph.addEdge(4, 6, 2);
	myGraph.addEdge(5, 6, 3);

	return myGraph;
}

void testFordFulkerson() {
	Graph<int> graph = createTestFlowGraph();
	graph.fordFulkerson(1, 6);

	stringstream ss;
	for(auto v : graph.getVertexSet()) {
		ss << v->getInfo() << "-> (";
		for (auto e : v->getAdj())
			ss << (e->getDest())->getInfo() << "[Flow: " << e->getFlow() << "] ";
		ss << ") || ";
	}

	cout << ss.str() << endl << endl;

	ASSERT_EQUAL("1-> (2[Flow: 3] 3[Flow: 2] ) || 2-> (5[Flow: 1] 4[Flow: 2] 3[Flow: 0] ) || 3-> (5[Flow: 2] ) || 4-> (6[Flow: 2] ) || 5-> (6[Flow: 3] ) || 6-> () || ", ss.str());

}

bool runAllTests(int argc, char const *argv[]) {
	cute::suite s { };
	s.push_back(CUTE(testFordFulkerson));
	cute::xml_file_opener xmlfile(argc, argv);
	cute::xml_listener<cute::ide_listener<>> lis(xmlfile.out);
	auto runner = cute::makeRunner(lis, argc, argv);
	bool success = runner(s, "AllTests");
	return success;
}

int main(int argc, char const *argv[]) {
    return runAllTests(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE;
}

extension: cpp


text:
@article{ethayarajh-2020-utility,
  title={Utility is in the Eye of the User: A Critique of NLP Leaderboards},
  author={Ethayarajh, Kawin and Jurafsky, Dan},
  journal={arXiv preprint arXiv:2009.13888},
  year={2020}
}

repository: rycolab/website

repo_name: rycolab/website


text:
package main

import (
  "errors"
  "net"
  "strings"
  "encoding/json"
  "github.com/containernetworking/cni/pkg/skel"
  types "github.com/containernetworking/cni/pkg/types/020"
  gentypes "github.com/containernetworking/cni/pkg/types"
  "github.com/containernetworking/cni/pkg/version"
  danmtypes "github.com/nokia/danm/pkg/crd/apis/danm/v1"
)

//Fakeipam plugin is a very simple CNI-style IPAM plugin, which prints the received IP allocation information to its output.
//It is used by DANM to integrate to 3rd-party CNI plugins until its own IPAM plugin is separated into a srandalone binary.
//First, DANM internally handles IPAM duties, then invokes the 3rd-party CNI (e.g. SRIOV) with the full CNI config.
//3rd-party CNIs would invoke the configured fakeipam plugin according to the CNI interface specification.
//At the end, fakeipam will simply regurgitate the IP allocation information originally coming from DANM.

type cniConfig struct {
  Ipam   danmtypes.IpamConfig `json:"ipam"`
}

func reserveIp(args *skel.CmdArgs) error {
  ipamConf, err := loadIpamConfig(args.StdinData)
  if err != nil {
    return err
  }
  cniRes,err := createCniResult(ipamConf)
  if err != nil {
    return err
  }
  return cniRes.Print()
}

func loadIpamConfig(rawConfig []byte) (danmtypes.IpamConfig,error) {
  cniConf := cniConfig{}
  err := json.Unmarshal(rawConfig, &cniConf)
  if  err != nil {
    return danmtypes.IpamConfig{}, err
  }
  if cniConf.Ipam.Ip == "" {
    return danmtypes.IpamConfig{}, errors.New("No IP was passed to fake IPAM")
  }
  return cniConf.Ipam, nil
}

//TODO: CNI 0.2.0 style of result is used because SRIOV plugin can't handle newer format
//This should be generalized though, and return result should be current.Result in most cases
func createCniResult(ipamConf danmtypes.IpamConfig) (*types.Result,error) {
  _, ip, err := net.ParseCIDR(ipamConf.Ip + "/" + strings.Split(ipamConf.Subnet, "/")[1])
  if err != nil {
    return nil, errors.New("Can't parse IP from IPAM config because:"+err.Error())
  }
  ip.IP = net.ParseIP(ipamConf.Ip)
  var routes []gentypes.Route
  for _, route := range ipamConf.Routes {
    _, destNet, err := net.ParseCIDR(route.Dst)
    if err == nil {
      routes = append(routes, gentypes.Route {
        Dst: *destNet,
        GW: net.ParseIP(route.Gw),
      })
    }
  }
  ipConf := &types.IPConfig{
    IP: *ip,
    Gateway: net.ParseIP(ipamConf.DefaultGw),
    Routes: routes,
  }
  cniRes := &types.Result{IP4: ipConf}
  return cniRes, nil
}

func freeIp(args *skel.CmdArgs) error {
  return nil
}

func main() {
  skel.PluginMain(reserveIp, freeIp, version.All)
}

repository: libesz/danm

repo_name: libesz/danm


text:
DESCRIPTION = "Settings-daemon provides a bridge between gconf and xsettings"
LICENSE = "GPL"
DEPENDS = "gconf glib-2.0 gtk+"
RDEPENDS_${PN} = "xrdb"
SECTION = "x11"
SRCREV = "2006"
PV = "0.0+svnr${SRCPV}"

PR = "r3"

SRC_URI = "svn://svn.o-hand.com/repos/matchbox/trunk;module=${PN};proto=http \
	   file://70settings-daemon"

S = "${WORKDIR}/${PN}"

inherit autotools pkgconfig gettext gconf

FILES_${PN} = 	"${bindir}/* ${sysconfdir}"

do_install_append () {
	install -d ${D}/${sysconfdir}/X11/Xsession.d
	install -m 755 ${WORKDIR}/70settings-daemon ${D}/${sysconfdir}/X11/Xsession.d/
}

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
#  ================================================================
#  Created by Gregory Kramida on 04/26/19.
#  Copyright (c) 2019 Gregory Kramida
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#  ================================================================

#==================== FIND PACKAGES ==============================
include_directories(include)

# *** Boost (Boost python version based on python option / availability)
if(NOT HUNTER_ENABLED)
	if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
	    # Provisions for typical Boost compiled on Windows
	    # Most commonly, Boost libraries are compiled statically on windows (change as necesssary)
	    set(Boost_USE_STATIC_LIBS TRUE)
	    set(Boost_USE_STATIC_RUNTIME OFF)
	    set(Boost_USE_MULTITHREADED ON)
	    set(Boost_USE_DEBUG_RUNTIME ON)
	    set(Boost_USE_DEBUG_PYTHON OFF)
	endif()
endif()

set(BOOST_COMPONENTS unit_test_framework)
set(BOOST_ALTERNATIVE_COMPONENTS unit_test_framework)

list(APPEND BOOST_COMPONENTS python${PYTHON3_VERSION_MAJOR}${PYTHON3_VERSION_MINOR})
list(APPEND BOOST_ALTERNATIVE_COMPONENTS python-py${PYTHON3_VERSION_MAJOR}${PYTHON3_VERSION_MINOR})
set(PYTHON3_EXECUTABLE ${Python3_EXECUTABLE})

find_package(Boost COMPONENTS ${BOOST_COMPONENTS} QUIET)
if(NOT Boost_FOUND)
	message(STATUS "Trying alternative Boost.Python component name, python-py<version>...")
	find_package(Boost COMPONENTS ${BOOST_ALTERNATIVE_COMPONENTS} REQUIRED)
endif()

# *** Everything else
find_package(Eigen3 3.3.4 REQUIRED)
find_package(OpenMP REQUIRED)
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
	find_package(GCCAtomic REQUIRED)
endif()

repository: Algomorph/LevelSetFusion-CPP

repo_name: Algomorph/LevelSetFusion-CPP


text:
package domain_test

import (
	"cf"
	. "cf/commands/domain"
	"cf/configuration"
	"github.com/stretchr/testify/assert"
	testapi "testhelpers/api"
	testcmd "testhelpers/commands"
	testconfig "testhelpers/configuration"
	testreq "testhelpers/requirements"
	testterm "testhelpers/terminal"
	"testing"
)

func TestListDomainsRequirements(t *testing.T) {
	reqFactory := &testreq.FakeReqFactory{LoginSuccess: true, TargetedOrgSuccess: true}
	domainRepo := &testapi.FakeDomainRepository{}

	callListDomains(t, []string{}, reqFactory, domainRepo)
	assert.True(t, testcmd.CommandDidPassRequirements)

	reqFactory = &testreq.FakeReqFactory{LoginSuccess: false, TargetedOrgSuccess: true}
	callListDomains(t, []string{}, reqFactory, domainRepo)
	assert.False(t, testcmd.CommandDidPassRequirements)

	reqFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedOrgSuccess: false}
	callListDomains(t, []string{}, reqFactory, domainRepo)
	assert.False(t, testcmd.CommandDidPassRequirements)
}

func TestListDomainsFailsWithUsage(t *testing.T) {
	reqFactory := &testreq.FakeReqFactory{LoginSuccess: true, TargetedOrgSuccess: true}
	domainRepo := &testapi.FakeDomainRepository{}

	ui := callListDomains(t, []string{"foo"}, reqFactory, domainRepo)
	assert.True(t, ui.FailedWithUsage)
}

func TestListDomains(t *testing.T) {
	reqFactory := &testreq.FakeReqFactory{LoginSuccess: true, TargetedOrgSuccess: true, Organization: cf.Organization{Name: "my-org", Guid: "my-org-guid"}}
	domainRepo := &testapi.FakeDomainRepository{
		FindAllByOrgDomains: []cf.Domain{
			{Name: "Domain1", Shared: true, Spaces: []cf.Space{}},
			{Name: "Domain2", Shared: false, Spaces: []cf.Space{
				{Name: "my-space"},
				{Name: "my-other-space"},
			}},
			{Name: "Domain3", Shared: false, Spaces: []cf.Space{}},
		},
	}
	fakeUI := callListDomains(t, []string{}, reqFactory, domainRepo)

	assert.Contains(t, fakeUI.Outputs[0], "Getting domains in org")
	assert.Contains(t, fakeUI.Outputs[0], "my-org")
	assert.Contains(t, fakeUI.Outputs[0], "my-user")
	assert.Contains(t, fakeUI.Outputs[1], "OK")

	assert.Contains(t, fakeUI.Outputs[4], "Domain1")
	assert.Contains(t, fakeUI.Outputs[4], "shared")

	assert.Contains(t, fakeUI.Outputs[5], "Domain2")
	assert.Contains(t, fakeUI.Outputs[5], "owned")
	assert.Contains(t, fakeUI.Outputs[5], "my-space, my-other-space")

	assert.Contains(t, fakeUI.Outputs[6], "Domain3")
	assert.Contains(t, fakeUI.Outputs[6], "reserved")
}

func callListDomains(t *testing.T, args []string, reqFactory *testreq.FakeReqFactory, domainRepo *testapi.FakeDomainRepository) (fakeUI *testterm.FakeUI) {
	fakeUI = new(testterm.FakeUI)
	ctxt := testcmd.NewContext("domains", args)

	token, err := testconfig.CreateAccessTokenWithTokenInfo(configuration.TokenInfo{
		Username: "my-user",
	})
	assert.NoError(t, err)

	config := &configuration.Configuration{
		Space:        cf.Space{Name: "my-space"},
		Organization: cf.Organization{Name: "my-org"},
		AccessToken:  token,
	}

	cmd := NewListDomains(fakeUI, config, domainRepo)
	testcmd.RunCommand(cmd, ctxt, reqFactory)
	return
}

repository: bruceSz/cli

repo_name: bruceSz/cli


text:
// Copyright 2020 Condensat Tech. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.

package sessions

import (
	"context"
	"reflect"
	"testing"
	"time"

	"github.com/condensat/bank-core/cache"

	"github.com/go-redis/redis/v8"
)

const cstTestRemoteAddrSample = "redis"

func TestNewSession(t *testing.T) {
	t.Parallel()

	ctx := context.TODO()
	ctx = cache.WithCache(ctx, createCache(ctx))
	rdb := cache.ToRedis(cache.FromContext(ctx))

	type args struct {
		ctx context.Context
	}
	tests := []struct {
		name string
		args args
		want *redis.Client
	}{
		{"new", args{ctx}, rdb},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			if got := NewSession(tt.args.ctx); !reflect.DeepEqual(got.rdb, tt.want) {
				t.Errorf("NewSession() = %v, want %v", got.rdb, tt.want)
			}
		})
	}
}

func TestSession_CreateSession(t *testing.T) {
	t.Parallel()

	ctx := context.TODO()
	ctx = cache.WithCache(ctx, createCache(ctx))
	rdb := cache.ToRedis(cache.FromContext(ctx))

	type fields struct {
		rdb *redis.Client
	}
	type args struct {
		ctx                     context.Context
		userID                  uint64
		cstTestRemoteAddrSample string
		duration                time.Duration
	}
	tests := []struct {
		name      string
		fields    fields
		args      args
		want      SessionID
		wantValid bool
		wantErr   bool
	}{
		{"default", fields{rdb}, args{ctx, 0, cstInvalidRemoteAddr, 0}, cstInvalidSessionID, false, true},

		// invalid UserID
		{"negative", fields{rdb}, args{ctx, 0, cstInvalidRemoteAddr, -time.Second}, cstInvalidSessionID, false, true},
		{"negative2", fields{rdb}, args{ctx, 0, cstInvalidRemoteAddr, -2 * time.Second}, cstInvalidSessionID, false, true},
		{"second", fields{rdb}, args{ctx, 0, cstInvalidRemoteAddr, time.Second}, cstInvalidSessionID, false, true},
		{"valid", fields{rdb}, args{ctx, 0, cstInvalidRemoteAddr, 2 * time.Second}, "non-empty-session", false, true},

		// with UserID
		{"negative", fields{rdb}, args{ctx, 42, cstTestRemoteAddrSample, -time.Second}, cstInvalidSessionID, false, true},
		{"negative2", fields{rdb}, args{ctx, 42, cstTestRemoteAddrSample, -2 * time.Second}, cstInvalidSessionID, false, true},
		{"second", fields{rdb}, args{ctx, 42, cstTestRemoteAddrSample, time.Second}, cstInvalidSessionID, true, false},
		{"valid", fields{rdb}, args{ctx, 42, cstTestRemoteAddrSample, 2 * time.Second}, "non-empty-session", true, false},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			s := &Session{
				rdb: tt.fields.rdb,
			}
			got, err := s.CreateSession(tt.args.ctx, tt.args.userID, tt.args.cstTestRemoteAddrSample, tt.args.duration)
			if (err != nil) != tt.wantErr {
				t.Errorf("Session.CreateSession() error = %v, wantErr %v", err, tt.wantErr)
				return
			}

			if tt.wantValid != (got != cstInvalidSessionID) {
				t.Errorf("Session.CreateSession() = wrong SessionID %v, want %v", got != cstInvalidSessionID, tt.wantValid)
			}

			if s.IsSessionValid(ctx, got) != tt.wantValid {
				t.Errorf("Session.IsSessionValid() = %v, want %v", got, tt.wantValid)
			}
		})
	}
}

func TestSession_IsSessionValid(t *testing.T) {
	t.Parallel()

	ctx := context.TODO()
	ctx = cache.WithCache(ctx, createCache(ctx))
	rdb := cache.ToRedis(cache.FromContext(ctx))

	s := NewSession(ctx)

	type fields struct {
		rdb *redis.Client
	}
	type args struct {
		ctx       context.Context
		sessionID SessionID
	}
	tests := []struct {
		name               string
		fields             fields
		args               args
		want               bool
		waitForExpire      time.Duration
		wantValidAfterWait bool
	}{
		{"default", fields{}, args{ctx, ""}, false, 0, false},
		{"invalid", fields{rdb}, args{ctx, cstInvalidSessionID}, false, 0, false},

		{"valid", fields{rdb}, args{ctx, createSession(ctx, s, time.Second)}, true, 0, true},

		{"not_expired", fields{rdb}, args{ctx, createSession(ctx, s, time.Second)}, true, 500 * time.Millisecond, true},
		{"expired", fields{rdb}, args{ctx, createSession(ctx, s, time.Second)}, true, time.Second, false},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			s := &Session{
				rdb: tt.fields.rdb,
			}
			if got := s.IsSessionValid(tt.args.ctx, tt.args.sessionID); got != tt.want {
				t.Errorf("Session.IsSessionValid() = %v, want %v", got, tt.want)
			}
			if tt.waitForExpire <= 0 {
				return
			}

			time.Sleep(tt.waitForExpire)

			if got := s.IsSessionValid(tt.args.ctx, tt.args.sessionID); got != tt.wantValidAfterWait {
				t.Errorf("Session.IsSessionValid() = %v, want %v", got, tt.wantValidAfterWait)
			}
		})
	}
}

func TestSession_UserSession(t *testing.T) {
	t.Parallel()

	ctx := context.TODO()
	ctx = cache.WithCache(ctx, createCache(ctx))
	rdb := cache.ToRedis(cache.FromContext(ctx))

	s := NewSession(ctx)

	type fields struct {
		rdb *redis.Client
	}
	type args struct {
		ctx       context.Context
		sessionID SessionID
	}
	tests := []struct {
		name   string
		fields fields
		args   args
		want   uint64
	}{
		{"default", fields{}, args{ctx, ""}, 0},
		{"invalid", fields{rdb}, args{ctx, cstInvalidSessionID}, 0},

		{"valid", fields{rdb}, args{ctx, createSession(ctx, s, time.Second)}, 42},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			s := &Session{
				rdb: tt.fields.rdb,
			}
			if got := s.UserSession(tt.args.ctx, tt.args.sessionID); got != tt.want {
				t.Errorf("Session.UserSession() = %v, want %v", got, tt.want)
			}
		})
	}
}

func TestSession_ExtendSession(t *testing.T) {
	t.Parallel()

	ctx := context.TODO()
	ctx = cache.WithCache(ctx, createCache(ctx))
	rdb := cache.ToRedis(cache.FromContext(ctx))

	type fields struct {
		rdb *redis.Client
	}
	type args struct {
		ctx                     context.Context
		cstTestRemoteAddrSample string
		duration                time.Duration
		extend                  time.Duration
	}
	tests := []struct {
		name          string
		fields        fields
		args          args
		wantErr       bool
		wantUserID    uint64
		waitForExpire time.Duration
	}{
		{"default", fields{}, args{ctx, cstInvalidRemoteAddr, 0, 0}, true, 0, 0},

		{"ip_changed", fields{rdb}, args{ctx, "10.0.0.1", time.Second, time.Second}, true, 42, 0},
		{"valid", fields{rdb}, args{ctx, cstTestRemoteAddrSample, time.Second, time.Second}, false, 42, 0},

		{"negative", fields{rdb}, args{ctx, cstTestRemoteAddrSample, time.Second, -time.Second}, true, 0, 0},

		{"not_expired", fields{rdb}, args{ctx, cstTestRemoteAddrSample, time.Second, time.Second}, false, 42, 500 * time.Millisecond},
		{"not_expired2", fields{rdb}, args{ctx, cstTestRemoteAddrSample, time.Second, time.Second}, false, 42, 900 * time.Millisecond},
		{"expired", fields{rdb}, args{ctx, cstTestRemoteAddrSample, time.Second, time.Second}, true, 0, 1100 * time.Millisecond},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			s := &Session{
				rdb: tt.fields.rdb,
			}

			sessionID := createSession(ctx, s, tt.args.duration)

			if tt.waitForExpire > 0 {
				time.Sleep(tt.waitForExpire)
			}

			userID, err := s.ExtendSession(tt.args.ctx, tt.args.cstTestRemoteAddrSample, sessionID, tt.args.extend)
			if (err != nil) != tt.wantErr {
				t.Errorf("Session.ExtendSession() error = %v, wantErr %v", err, tt.wantErr)
			}
			if userID != tt.wantUserID {
				t.Errorf("Session.ExtendSession() userID = %v, wantUserID %v", userID, tt.wantUserID)
			}
		})
	}
}

func TestSession_InvalidateSession(t *testing.T) {
	t.Parallel()

	ctx := context.TODO()
	ctx = cache.WithCache(ctx, createCache(ctx))
	rdb := cache.ToRedis(cache.FromContext(ctx))

	type fields struct {
		rdb *redis.Client
	}
	type args struct {
		ctx      context.Context
		duration time.Duration
	}
	tests := []struct {
		name          string
		fields        fields
		args          args
		wantErr       bool
		waitForExpire time.Duration
	}{
		{"default", fields{rdb}, args{ctx, 0}, true, 0},
		{"negative", fields{rdb}, args{ctx, -time.Second}, true, 0},

		{"valid", fields{rdb}, args{ctx, time.Second}, false, 0},

		{"not_expired", fields{rdb}, args{ctx, time.Second}, false, 500 * time.Millisecond},
		{"not_expired2", fields{rdb}, args{ctx, time.Second}, false, 900 * time.Millisecond},

		// invalidate expired session must not return an error
		{"expired", fields{rdb}, args{ctx, time.Second}, false, 1100 * time.Millisecond},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			s := &Session{
				rdb: tt.fields.rdb,
			}

			sessionID := createSession(ctx, s, tt.args.duration)

			if sessionID != cstInvalidSessionID {
				if !s.IsSessionValid(ctx, sessionID) {
					t.Errorf("Session must be valid")
				}
			}

			if tt.waitForExpire > 0 {
				time.Sleep(tt.waitForExpire)
			}

			if err := s.InvalidateSession(tt.args.ctx, sessionID); (err != nil) != tt.wantErr {
				t.Errorf("Session.InvalidateSession() error = %v, wantErr %v", err, tt.wantErr)
			}

			if s.IsSessionValid(ctx, sessionID) {
				t.Errorf("Session.IsSessionValid() Invalidated session must not be valid")
			}
		})
	}
}

func Test_sessionKey(t *testing.T) {
	t.Parallel()

	type args struct {
		prefix    string
		key       string
		sessionID SessionID
	}
	tests := []struct {
		name string
		args args
		want string
	}{
		{"default", args{}, ""},
		{"empty", args{"", "", ""}, ""},

		{"emptyPrefix", args{"", "key", "sessionID"}, ""},
		{"emptyKey", args{"prefix", "", "sessionID"}, ""},
		{"emptySession", args{"prefix", "key", ""}, ""},

		{"emptyPrefixKey", args{"", "", "sessionID"}, ""},
		{"emptyPrefixSession", args{"", "key", ""}, ""},
		{"KeySession", args{"prefix", "key", ""}, ""},

		{"valid", args{"prefix", "key", "sessionID"}, "prefix.key.sessionID"},

		{"pointBegin", args{".prefix", "key", "sessionID"}, "prefix.key.sessionID"},
		{"pointEnd", args{"prefix", "key", "sessionID."}, "prefix.key.sessionID"},

		{"slashBegin", args{"/prefix", "key", "sessionID"}, "prefix.key.sessionID"},
		{"slashEnd", args{"prefix", "key", "sessionID/"}, "prefix.key.sessionID"},

		{"spaces", args{"prefix ", "key ", "sessionID "}, "prefix.key.sessionID"},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			if got := sessionKey(tt.args.prefix, tt.args.key, tt.args.sessionID); got != tt.want {
				t.Errorf("sessionKey() = %v, want %v", got, tt.want)
			}
		})
	}
}

func Test_pushSession(t *testing.T) {
	t.Parallel()

	ctx := context.TODO()
	ctx = cache.WithCache(ctx, createCache(ctx))
	rdb := cache.ToRedis(cache.FromContext(ctx))

	s1 := NewSessionID()
	s2 := NewSessionID()

	type args struct {
		rdb                     *redis.Client
		userID                  uint64
		cstTestRemoteAddrSample string
		sessionID               SessionID
		duration                time.Duration
	}
	tests := []struct {
		name        string
		args        args
		want        SessionID
		wantExpired bool
		wantErr     bool
	}{
		{"default", args{rdb, cstInvalidUserID, cstInvalidRemoteAddr, cstInvalidSessionID, 0}, cstInvalidSessionID, true, true},

		// Invalid UserID
		{"expired_user", args{rdb, cstInvalidUserID, cstInvalidRemoteAddr, s1, 0}, s1, true, false},
		{"sessionID_user", args{rdb, cstInvalidUserID, cstInvalidRemoteAddr, s2, time.Second}, s2, true, false},

		// Invalid RemoteAddr
		{"expired_addr", args{rdb, 42, cstInvalidRemoteAddr, s1, 0}, s1, true, false},
		{"sessionID_addr", args{rdb, 42, cstInvalidRemoteAddr, s2, time.Second}, s2, true, false},

		// Invalid UserID & RemoteAddr
		{"expired_user", args{rdb, cstInvalidUserID, cstTestRemoteAddrSample, s1, 0}, s1, true, false},
		{"sessionID_user", args{rdb, cstInvalidUserID, cstTestRemoteAddrSample, s2, time.Second}, s2, true, false},

		{"expired", args{rdb, 42, cstTestRemoteAddrSample, s1, 0}, s1, true, false},
		{"valid", args{rdb, 42, cstTestRemoteAddrSample, s2, time.Second}, s2, false, false},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			got, err := pushSession(ctx, tt.args.rdb, tt.args.userID, tt.args.cstTestRemoteAddrSample, tt.args.sessionID, tt.args.duration)
			if (err != nil) != tt.wantErr {
				t.Errorf("pushSession() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if got.Expired() != tt.wantExpired {
				t.Errorf("pushSession() expired = %v, wantExpired %v", got.Expired(), tt.wantExpired)
				return
			}
			if !reflect.DeepEqual(got.SessionID, tt.want) {
				t.Errorf("pushSession() = %v, want %v", got, tt.want)
			}
			if tt.args.duration <= 0 {
				return
			}
		})
	}
}

func Test_fetchSession(t *testing.T) {
	t.Parallel()

	ctx := context.TODO()
	ctx = cache.WithCache(ctx, createCache(ctx))
	rdb := cache.ToRedis(cache.FromContext(ctx))

	s := NewSession(ctx)

	s0 := createSession(ctx, s, 0)
	s1 := createSession(ctx, s, time.Second)

	type args struct {
		rdb       *redis.Client
		sessionID SessionID
	}
	tests := []struct {
		name    string
		args    args
		want    SessionID
		wantErr bool
	}{
		{"default", args{rdb, cstInvalidSessionID}, cstInvalidSessionID, true},
		{"expired", args{rdb, s0}, cstInvalidSessionID, true},
		{"valid", args{rdb, s1}, s1, false},
	}
	for _, tt := range tests {
		tt := tt // capture range variable
		t.Run(tt.name, func(t *testing.T) {
			got, err := fetchSession(ctx, tt.args.rdb, tt.args.sessionID)
			if (err != nil) != tt.wantErr {
				t.Errorf("fetchSession() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if !reflect.DeepEqual(got.SessionID, tt.want) {
				t.Errorf("fetchSession() = %v, want %v", got.SessionID, tt.want)
			}
		})
	}
}

func createCache(ctx context.Context) cache.Cache {
	return cache.NewRedis(ctx, cache.RedisOptions{
		HostName: "redis",
		Port:     6379,
	})
}

func createSession(ctx context.Context, s *Session, d time.Duration) SessionID {
	sID, _ := s.CreateSession(ctx, 42, cstTestRemoteAddrSample, d)
	return sID
}

repository: condensat/bank-core

repo_name: condensat/bank-core