quinta-feira, 24 de janeiro de 2013

GIT Merge conflict solving with kdiff3


First we will create a test repository and a test file on which we will create a merge conflict later on.
(in this example, the commands are executed with PowerShell in Windows, but the GIT commands are exactly the same on any other shell or OS)
  • Creation of test repository
    > cd \tempmd mergetestcd mergetest
    > git init
  • Creation of test file
    > 'Original line' | Out-File file.txt
  • Commit into repository
    > git add file.txt
    > git commit -m "Original checkin"
  • Current repository state: (using the tool GIT Extensions)
Now we will create a new branch A, and update the file.
  • Create new branch
    > git branch branch-A
    > git checkout branch-A
  • Update file
    > 'Branch A line' | Out-File file.txt
  • Commit into repository
    > git add file.txt
    > git commit -m "Branch A change"
  • Current repository state:
Now we will create a new branch B, and update the file with a conflicting change.
  • Create new branch, starting from the original master branch
    > git checkout master
    > git branch branch-B
    > git checkout branch-B
  • Update file
    > 'Branch B line' | Out-File file.txt
  • Commit into repository
    > git add file.txt
    > git commit -m "Branch B change"
  • Current repository state:
All this was a preparation for what we will do now: merge the conflicting change of branch-B into branch-A.
  • Select the target branch (in this case branch A)
    > git checkout branch-A
  • Merge the source branch (in this case branch B)
    > git merge branch-B
  • This results in a merge conflict:
    Auto-merging file.txt
    CONFLICT (content): Merge conflict in file.txt
    Automatic merge failed; fix conflicts and then commit the result.
  • This conflict can be resolved by starting your mergetool
    > git mergetool
  • It gives you a message before it launches your mergetool (in my case kdiff3):
    Merging:
    file.txt

    Normal merge conflict for 'file.txt':
      {local}: modified file
      {remote}: modified file
    Hit return to start merge resolution tool (kdiff3):
  • You get a window containing 4 versions of the same file:
    • Top left: "Base".  This is the original version of the file, the last shared version between what became later branch-A and branch-B.
    • Top Middle: "Local". This is the target branch version of the file.  It is called "Local", because this is the currently selected branch (using the last git checkout command).
    • Top Right: "Remote". This is the source branch version of the file. It is called "Remote", as apposed to "Local".
    • Bottom: "Output". This is the merged version of the file. After successful completion of the merge, this will become the new version of the target branch.  In this pane, you can edit the text, or you can right click on any merged part and select what version(s) of the original file you want to include in the output.  In this case, I decide to include the changes done in both branch-A and branch-B.

    • Close the kdiff3 application (saving the file), and commit the merge:
      > git commit
      (accept the default commit message)
    • This brings us to the following repository state:
    • We can check if the content of the test-file is what we need:
      > Get-Content file.txt
      Branch A line
      Branch B line
       

    quinta-feira, 17 de janeiro de 2013

    FxGqlC: Added aggregation functions ENLIST and ENLISTDISTINCT



    Added aggregation functions ENLIST and ENLISTDISTINCT.
    ENLIST creates a string value containing the list of all string values in their original order.
    ENLISTDISTINCT creates a similar list, but the dupplicate values are removed, and the list is ordered. 

    SELECT [Winner], COUNT(*), ENLIST([Tournament])
       FROM ['SampleFiles/Tennis-ATP-2011.csv' -Heading=On]
       GROUP BY [Winner] ORDER BY 2 DESC

    SELECT [Winner], COUNT(*), ENLISTDISTINCT([Tournament])
       FROM ['SampleFiles/Tennis-ATP-2011.csv' -Heading=On]
       GROUP BY [Winner] ORDER BY 2 DESC


    This feature is added to FxGqlC in v2.5-alpha5.

    FxGqlC: Added new function 'PREFIX'

    Added (non-aggregation) text function PREFIX to return the common prefix of two strings.
    An aggregation function PREFIX (with 1 argument) was already added in v2.4.

    SELECT PREFIX('0032478123456', '0032478654321')  
    -- returns '0032478'

    This feature is added to FxGqlC in v2.5-alpha5.




    quinta-feira, 10 de janeiro de 2013

    Advanced Power Searching with Google -- Registration Opens Today



    Cross-posted at Inside Search Blog

    What historic cafe inspired a poem by a Nobel Laureate? In the last three barista world championships, which winners did not use beans from their home country? If you were preparing a blog post on “Curious Trivia of Coffee Culture,” how would you find the answers to these questions? What else would you discover? Now you can sign up for our Advanced Power Searching with Google online course and find out.

    Building on Power Searching with Google, Advanced Power Searching with Google helps you gain a deeper understanding of how to become a better researcher. You will solve complex search challenges similar to those I pose in my blog, or a Google a Day, and explore Google’s advanced search tools not covered in the first class.

    Oftentimes the most intriguing questions invite you to explore beyond the initial answer, and there’s no single correct path to get there. When looking for questions that can’t be solved with a single query, “search” can quickly turn into “research.” Google Search offers a palette of tools to help you dive deeper into the web of knowledge.

    Visit www.powersearchingwithgoogle.com to learn more about our online search courses, and review our search tips on the Power Searching with Google Quick Reference Guide. Advanced Power Searching begins on January 23 and ends on February 8th.

    quarta-feira, 19 de dezembro de 2012

    Conference Report: Workshop on Internet and Network Economics (WINE) 2012



    Google regularly participates in the WINE conference: Workshop on Internet & Network Economics. WINE’12 just happened last week in Liverpool, UK, where there is a strong economics and computation group. WINE provides a forum for researchers across various disciplines to examine interesting algorithmic and economic problems of mutual interest that have emerged from the Internet over the past decade. For Google, the exchange of ideas at this selective workshop has resulted in innovation and improvements in algorithms and economic auctions, such as our display ad allocation.

    Googlers co-authored three papers this year; here’s a synopsis of each, as well as some highlights from invited talks at the conference:

    Budget Optimization for Online Campaigns with Positive Carryover Effects
    This paper first argues that ad impressions may have some long-term impact on user behaviour, and refers to an older WWW ’10 paper. Based on this motivation, the paper presents a scalable budget optimization algorithm for online advertising campaigns in the presence of Markov user behavior. In such settings, showing an ad to a user may change their actions in the future through a Markov model, and the probability of conversion for the ad does not only depend on the last ad shown, but also on earlier user activities. The main purpose of the paper is to give a simpler algorithm to solve a constrained Markov Decision Process, and confirms this easier solution via simulations on some advertising data sets. The paper was written when Nikolay Archak, a PhD student at NYU business school, was an intern with the New York market algorithms research team.

    On Fixed-Price Marketing for Goods with Positive Network Externalities
    This paper presents an approximation algorithm for marketing “networked goods” and services that exhibit positive network externalities - for example, is the buyer's value for the goods or service influenced positively by other buyers owning the goods or using the service? Such positive network externalities arise in many products like operating systems or smartphone services. While most of previous research is concerned with influence maximization, this paper attempts to identify a revenue maximizing marketing strategy for such networked goods, as follows: The seller selects a set (S) of buyers and gives them the goods for free, then sets a fixed per-unit price (p), at which other consumers can buy the item. The strategy is consistent with practice and is easy to implement. The authors use ideas from non-negative submodular maximization to find the optimal revenue maximizing fixed-price marketing strategy.

    The AND-OR game: Equilibrium Characterization
    Yishay Mansour, former Visiting Faculty in Google New York, presented the results; he first argued that the existence and uniqueness of market equilibria is only known for markets with divisible goods and concave or convex utilities. Then he described a simple market AND-OR game for divisible goods. To my surprise, he showed a class of mixed strategies are basically the unique set of randomized equilibria for this market (up to minor changes in the outcome). At the end, Yishay challenged the audience to give such characterization for more general markets with indivisible goods.

    Kamal Jain of Ebay Research gave an interesting talk about mechanism design problems, inspired by application in companies like Ebay and Google. In one part, Kamal proposed "coopetitive ad auctions" for settings in which the auctioneer runs an auction among buyers who may cooperate with some advertisers, and at the same time compete with others for sealing advertising slots. He gave context around "product ads"; for example, a retailer like Best Buy may cooperate with a manufacturer like HP to put out a product ad for an HP computer sold at Best Buy. Kamal argued that if the cooperation is not an explicit part of the auction, an advertiser may implicitly end up competing with itself, thus decreasing the social welfare. By making the cooperation an explicit part of the auction, he was able to design a mechanism with better social welfare and revenue properties, compared to both first-price and second-price auctions. Kamal also discussed optimal mechanisms for intermediaries, and “surplus auctions” to avoid cyclic bidding behavior resulted from running naive variants of first-price auctions in repeated settings.

    David Parkes of Harvard University discussed techniques to combine mechanism design with machine learning or heuristic search algorithms. At one point David discussed how to implement a branch-and-bound search algorithm in a way that results in a "monotone" allocation rule, so that if we implement a VCG-type allocation and pricing rule based on this allocation algorithm, the resulting mechanism becomes truthful. David also presented ways to compute a set of prices for any allocation, respecting incentive compatibility constraints as much as possible. Both of these topics appeared in ACM EC 2012 papers that he had co-authored.

    At the business meeting, there was a proposal to change the title of the conference from “workshop” to “conference” or “symposium” to reflect its fully peer-reviewed and archival nature, keeping the same acronym of WINE. (Changing the title to “Symposium on the Web, Internet, and Network Economics” was rejected: SWINE!) WINE 2013 will be held at Harvard University in Boston, MA, and we look forward to reconnecting with fellow researchers in the field and continuing to nurture new developments and research topics.

    terça-feira, 18 de dezembro de 2012

    Using online courses in Spain to teach entrepreneurship




    At the end of the third quarter in 2012, roughly 25% of adults in Spain were out of work. More than half of adults under 24 years old are unemployed. Recent graduates and young adults preparing to enter the workforce face the toughest job market in decades.

    The Internet presents an opportunity for growth and economic development. According to recent research, more than 100,000 jobs in Spain originate from the Internet and it directly contributes to the GDP with 26.7 billion euros (2.5%). That impact that could triple by 2015 under the right conditions.

    One of those conditions is making high-quality education accessible, echoed by a recent OECD report on the youth labor market in Spain. This is no easy task. University degrees are in high demand, straining the reach of our existing institutions.

    The web has become a way for learners to develop new skills when traditional institutions aren’t an option. Recent courses on platforms like Udacity, Coursera and edX have seen hundreds of thousands of students enroll and participate in courses taught by prestigious professors and lecturers.

    Google is partnering with numerous organizations and universities in Spain to organize UniMOOC, an online course intended to educate citizens in Spain and the rest of the Spanish-speaking world about entrepreneurship. It was built with Course Builder, Google’s new open source toolkit for constructing online courses.

    To date nearly 10,000 students have registered for the course, over two-thirds of them from Spain and one-third from 93 countries. It recently won an award for the “Most innovative project” in 2012 from the newspaper El Mundo.

    Spain’s situation is not entirely unique in Europe. Policymakers across the continent are asking themselves how best to create economic opportunity for their citizens, and how to ensure that their best and brightest students are on a path toward financial success. Our hope is that the people taking this course will be more empowered with the right skills and tools to start their own businesses that can create jobs. They will push not only Spain, but Europe and the rest of the world towards economic recovery and growth.

    The course is still running, and you’re able to join today.

    segunda-feira, 17 de dezembro de 2012

    Millions of Core-Hours Awarded to Science



    In 2011 Google University Relations launched a new academic research awards program, Google Exacycle for Visiting Faculty, offering up to one billion core-hours to qualifying proposals. We were looking for projects that would consume 100M+ core-hours each and be of critical benefit to society. Not surprisingly, there was no shortage of applications.

    Since then, the following seven scientists have been working on-site at Google offices in Mountain View and Seattle. They are here to run large computing experiments on Google’s infrastructure to change the future. Their projects include exploring antibiotic drug resistance, protein folding and structural modelling, drug discovery, and last but not least, the dynamic universe.

    Today, we would like to introduce the Exacycle award recipients and their work. Please stay tuned for updates next year.

    Simulating a Dynamic Universe with the Large Synoptic Sky Survey
    Jeff Gardner, University of Washington, Seattle, WA
    Collaborators: Andrew Connolly, University of Washington, Seattle, WA, and John Peterson, Purdue University, West Lafayette, IN

    Research subject: The Large Synoptic Survey Telescope (LSST) is one of the most ambitious astrophysical research programs ever undertaken. Starting in 2019, the LSST’s 3.2 Gigapixel camera will repeatedly survey the southern sky, generating tens of petabytes of data every year. The images and catalogs from the LSST have the potential to transform both our understanding of the universe and the way that we engage in science in general.
    Exacycle impact: In order to design the telescope to yield the best possible science, the LSST collaboration has undertaken a formidable computational campaign to simulate the telescope itself. This will optimize how the LSST surveys the sky and provide realistic datasets for the development of analysis pipelines that can operate on hundreds of petabytes. Using Exacycle, we are reducing the time required to simulate one night of LSST observing, roughly 5 million images, from 3 months down to a few days. This rapid turnaround will enable the LSST engineering teams to test new designs and new algorithms with unprecedented precision, which will ultimately lead to bigger and better science from the LSST.

    Designing and Defeating Antibiotic Drug Resistance
    Peter Kasson, Assistant Professor, Departments of Molecular Physiology and Biological Physics and of Biomedical Engineering, University of Virginia

    Research subject: Antibiotics have made most bacterial infections routinely treatable. As antibiotic use has become common, bacterial resistance to these drugs has also increased. Recently, some bacteria have arisen that are resistant to almost all antibiotics. We are studying the basis for this resistance, in particular the enzyme that acts to break down many antibiotics. Identifying the critical changes required for pan-resistance will aid surveillance and prevention; it will also help elucidate targets for the development of new therapeutic agents.
    Exacycle impact: Exacycle allows us to simulate the structure and dynamics of several thousand enzyme variants in great detail. The structural differences between enzymes from resistant and non-resistant bacteria are subtle, so we have developed methods to compare structural "fingerprints" of the enzymes and identify distinguishing characteristics. The complexity of this calculation and large number of potential bacterial sequences mean that this is a computationally intensive task; the massive computing power offered by Exacycle in combination with some novel sampling strategies make this calculation tractable.


    Sampling the conformational space of G protein-coupled receptors
    Kai Kohlhoff, Research Scientist at Google
    Collaborators: Research labs of Vijay Pande and Russ Altman at Stanford University

    Research subject: G protein-coupled receptors (GPCRs) are proteins that act as signal transducers in the cell membrane and influence the response of a cell to a variety of external stimuli. GPCRs play a role in many human diseases, such as asthma and hypertension, and are well established as a primary drug target.
    Exacycle impact: Exacycle let us perform many tens of thousands of molecular simulations of membrane-bound GPCRs in parallel using the Gromacs software. With MapReduce, Dremel, and other technologies, we analyzed the 100s of Terabytes of generated data and built Markov State Models. The information contained in these models can help scientists design drugs that have higher potency and specificity than those presently available.
    Results: Our models let us explore kinetically meaningful receptor states and transition rates, which improved our understanding of the structural changes that take place during activation of a signaling receptor. In addition, we used Exacycle to study the affinity of drug molecules when binding to different receptor states.


    Modeling transport through the nuclear pore complex
    Daniel Russel, post doc in structural biology, University of California, San Francisco

    Research subject: Our goal is to develop a predictive model of transport through the nuclear pore complex (NPC). Developing the model requires understanding how the behavior of the NPC varies as we change the parameters governing the components of the system. Such a model will allow us to understand how transportins, the unstructured domains and the rest of the cellular milieu, interact to determine efficiency and specificity of macromolecular transport into and out of the nucleus.
    Exacycle impact: Since data describing the microscopic behavior of most parts of the nuclear transport process is incomplete and contradictory, we have to explore a larger parameter space than would be feasible with traditional computational resources.
    Status: We are currently modeling various experimental measurements of aspects of the nuclear transport process. These experiments range from simple ones containing only a few components of the transport process to measurements on the whole nuclear pore with transportins and cellular milieu.


    Large scale screening for new drug leads that modulate the activity of disease-relevant proteins
    James Swetnam, Scientific Software Engineer, drugable.org, NYU School of Medicine
    Collaborators: Tim Cardozo, MD, PhD - NYU School of Medicine.

    Research subject: We are using a high throughput, CPU-bound procedure known as virtual ligand screening to ‘dock’, or produce rough estimates of binding energy, for a large sample of bioactive chemical space to the entirety of known protein structures. Our goal is the first computational picture of how bioactive chemistry with therapeutic potential can affect human and pathogen biology.
    Exacycle Impact: Typically, using our academic lab’s resources, we could screen a few tens of thousands of compounds against a single protein to try to find modulators of its function. To date, Exacycle has enabled us to screen 545,130 compounds against 8,535 protein structures that are involved in important and underserved diseases as cancer, diabetes, malaria, and HIV to look for new leads towards future drugs.
    Status: We are currently expanding our screens to an additional 206,190 models from
    ModBase. We aim to have a public dataset for the research community in the first half of 2013.

    Protein Structure Prediction and Design
    Michael Tyka, Research Fellow, University of Washington, Seattle, WA

    Research subject: The precise relationship between the primary sequence and the three dimensional structure of proteins is one of the unsolved grand challenges of computational biochemistry. The Baker Lab has made significant progress in recent years by developing more powerful protein prediction and design algorithms using the Rosetta Protein Modelling suite.
    Exacycle impact: Limitations in the accuracy of the physical model and lack of sufficient computational power have prevented solutions to broader classes of medically relevant problems. Exacycle allows us to improve model quality by conducting large parameter optimization sweeps with a very large dataset of experimental protein structural data. The improved energy functions will benefit the entire theoretical protein research community.

    We are also using Exacycle to conduct simultaneous docking and one-sided protein design to develop novel protein binders for a number of medically relevant targets. For the first time, we are able to aggressively redesign backbone conformations at the binding site. This allows for a much greater flexibility in possible binding shapes but also hugely increases the space of possibilities that have to be sampled. Very promising designs have already been found using this method.