text:
<repo_name>NessCollege2017/LocationAware<file_sep>/app/src/main/java/ness/edu/locationaware/LocationFragment.java
package ness.edu.locationaware;

import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationCallback;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationResult;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;

import java.io.IOException;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * A simple {@link Fragment} subclass.
 */
public class LocationFragment extends Fragment {

    private static final int RC_LOCATION = 11;
    FusedLocationProviderClient locationClient;
    LocationCallback callback;
    @BindView(R.id.tvLocation)
    TextView tvLocation;
    Unbinder unbinder;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_location, container, false);
        unbinder = ButterKnife.bind(this, view);

        locationClient = new FusedLocationProviderClient(getContext());
        callback = new LocationCallback() {
            @Override
            public void onLocationResult(LocationResult locationResult) {
                List<Location> locations = locationResult.getLocations();
                Location lastLocation = locationResult.getLastLocation();
                updateUI(locations.get(0));
            }
        };
        requestLocationUpdates();

        return view;
    }

    private void updateUI(Location location) {

        //INTERNET PERMISSION
        Geocoder geocoder = new Geocoder(getContext());
        //LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());

        try {
            Address address = geocoder.
                    getFromLocation(location.getLatitude(), location.getLongitude(), 1).
                    get(0);

            //Mutable String!
            StringBuilder result = new StringBuilder();

            for (int i = 0; i <= address.getMaxAddressLineIndex(); i++) {
                result.append(address.getAddressLine(i)).append("\n");
            }
            tvLocation.setText(location +"\n" + result);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    //todo:

    //3) given a latLng-> address and vice versa
    //4) know if the user stepped into a certain location()
    //GeoFencing

    //last known location may be null
    private void lastKnownLocation() {
        if (!checkLocationPermission()) return;
        locationClient.getLastLocation().addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {
            @Override
            public void onComplete(@NonNull Task<Location> task) {
                if (task.isSuccessful()) {
                    Location location = task.getResult();
                    if (location != null) {
                        Toast.makeText(getContext(), location.toString(), Toast.LENGTH_SHORT).show();
                    }
                }
            }
        });
    }

    private void requestLocationUpdates() {
        //Request->
        LocationRequest request = new LocationRequest();
        //for my app:
        request.setInterval(2000);
        //if other apps already got the location, Let me know about it.
        request.setFastestInterval(500);
        //PRIORITY_HIGH_ACCURACY == GPS
        //PRIORITY_LOW_POWER == Cellular
        request.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);

        //request.setSmallestDisplacement(1000);
        //request.setMaxWaitTime(60*1000);
        //locationClient.requestLocationUpdates()
       if (!checkLocationPermission())return;
       locationClient.requestLocationUpdates(request, callback, null);
    }

    private boolean checkLocationPermission() {
        String[] permissions = new String[]{Manifest.permission.ACCESS_FINE_LOCATION};
        //If No Permission-> Request the permission and return false.
        if (ActivityCompat.checkSelfPermission(getContext(),
                Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {

            ActivityCompat.requestPermissions(getActivity(), permissions, RC_LOCATION);
            return false;
        }
        return true;//return true if we have a permission
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            //noinspection MissingPermission
           requestLocationUpdates();
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
<file_sep>/app/src/main/java/ness/edu/locationaware/MyMapFragment.java
package ness.edu.locationaware;

import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.view.View;
import android.widget.Toast;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

/**
 * Created by Android2017 on 7/4/2017.
 */

public class MyMapFragment extends SupportMapFragment implements OnMapReadyCallback {
    private static final int RC_LOCATION = 10;
    private GoogleMap mMap;

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        getMapAsync(this);
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;
        addMyLocation();
        addNessMarker();
    }

    private void addNessMarker(){
        //latitude, longitude
        LatLng ness = new LatLng(32.1143876, 34.8397601);
        mMap.addMarker(new MarkerOptions().position(ness));
        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(ness, 17));
    }

    private boolean checkLocationPermission(){
        String[] permissions = new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION};
        //If No Permission-> Request the permission and return false.
        if (ActivityCompat.checkSelfPermission(getContext(),
                android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {

            ActivityCompat.requestPermissions(getActivity(), permissions, RC_LOCATION);
            return false;
        }
        return true;//return true if we have a permission
    }

    private void addMyLocation(){
        if (!checkLocationPermission())return;
        mMap.setMyLocationEnabled(true);
        mMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {
            @Override
            public boolean onMyLocationButtonClick() {
                if (mMap.getMyLocation()!=null) {
                    Location myLocation = mMap.getMyLocation();
                    Toast.makeText(getActivity(), "" + myLocation.getLatitude(), Toast.LENGTH_SHORT).show();
                }
                return false;
            }
        });
    }
    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        if (grantResults[0] == PackageManager.PERMISSION_GRANTED){
            //noinspection MissingPermission
            addMyLocation();
        }
    }
}
<file_sep>/app/src/main/java/ness/edu/locationaware/SignInActivity.java
package ness.edu.locationaware;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnEditorAction;
import butterknife.OnTextChanged;

public class SignInActivity extends AppCompatActivity {

    @BindView(R.id.etName)
    EditText etName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sign_in);
        ButterKnife.bind(this);
    }

    @OnTextChanged(R.id.etName)
    public void etChanged(CharSequence text){
    }

    @OnEditorAction(R.id.etName)
    public boolean etAction(TextView tv, int actionCode, KeyEvent e){
        if (etName.getText().toString().length() < 2){
            etName.setError("Invalid name...");
            return true;
        }
        FirebaseAuth.getInstance().
                signInAnonymously().
                addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
            @Override
            public void onComplete(@NonNull Task<AuthResult> task) {
                if (task.isSuccessful()){
                    //save the user name and goto maps.
                    String userName = etName.getText().toString();
                    //Can do: FirebaseAuth.getInstance().getCurrentUser().getUid();
                    //But here is a nicer way:
                    String uid = task.getResult().getUser().getUid();
                    //1) ref the users table->uid current user
                    DatabaseReference ref =
                            FirebaseDatabase.getInstance().getReference("Users").child(uid);

                    //2) ref.setValue(userName)
                    ref.setValue(userName);

                    //goto Maps Activity:
                    Intent intent = new Intent(SignInActivity.this, MapsActivity.class);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    startActivity(intent);
                }else {
                    //get the exception
                    Exception e = task.getException();
                    //test that the exception is not null
                    if (e != null)
                        Toast.makeText(SignInActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
                    //show Error:
                }
            }
        });
        return true;
    }

}
<file_sep>/app/src/main/java/ness/edu/locationaware/FencingFragment.java
package ness.edu.locationaware;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.support.v4.content.LocalBroadcastManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * A Geo Fence Demo Fragment
 */
public class FencingFragment extends Fragment {

    @BindView(R.id.fabNotify)
    FloatingActionButton fabNotify;
    Unbinder unbinder;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_fencing, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onStart() {
        super.onStart();
        /*
        //The Sending side:
        Intent intent = new Intent("ITunesChannel");
        intent.putExtra("json", "Some Json");

        LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
        */

        IntentFilter filter = new IntentFilter("ITunesChannel");

        //What do we do with the message (onReceive)
        BroadcastReceiver receiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                String json = intent.getStringExtra("json");
                Toast.makeText(context, json, Toast.LENGTH_SHORT).show();
            }
        };

        LocalBroadcastManager.getInstance(getContext()).registerReceiver(
                receiver, filter
        );
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick(R.id.fabNotify)
    public void onNotifyClicked() {
        /*
        Intent intent = new Intent(getContext(), NotificationService.class);
        getActivity().startService(intent);
        */

        //alarm manager may help us schedule repeating tasks
        AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE);

        Intent intent = new Intent(getContext(), NotificationService.class);
        PendingIntent pi = PendingIntent.getService(getContext(), 10, intent, PendingIntent.FLAG_UPDATE_CURRENT);

        //alarmManager.set();
        alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, 10*1000, 60*1000, pi);
        //alarmManager.setInexactRepeating();

        //alarmManager.setExact();
        //alarmManager.setExactAndAllowWhileIdle();

    }
}

repo_language: Java


text:
<repo_name>ozguryigit19/go-tutorial<file_sep>/variables.go
package main

import "fmt"

func main() {
	var var1 = "variable 1"
	fmt.Println(var1)

	const b, c int = 1, 2
	fmt.Println(b, c)

	var e int
	fmt.Println(e)

	f := "apple"
	fmt.Println(f)
}
<file_sep>/hello-world.go
package main

import "fmt"

func main() {
	fmt.Println("initial commit - hello world by goLang!")
}

branch_name: refs/heads/main

repo_language: Go


text:
<repo_name>wics-ashoka/wics-ashoka.github.io<file_sep>/_posts/2020-09-03-cryptichuntsolutions.md
---
layout: post
title:  "Solutions for WiCS' Cryptic Hunt 2020: Waterboarded Witless"
author: rathi
categories: [ Events ]
tags: [ waterboardedwitless, cryptichunt, wicsevents, womenincomputing, womeninstem, ashokauniversity, wicsashoka ]
image: assets/images/cryptichunt-final1.jpg
description: "Solutions for Cryptic Hunt 2020"
featured: false
---
Hello! This post contains the solutions to WiCS' Cryptic Hunt 2020: Waterboarded Witless.

![](/assets/images/cryptichunt/1.png)
![](/assets/images/cryptichunt/2.png)
![](/assets/images/cryptichunt/3.png)
![](/assets/images/cryptichunt/4.png)
![](/assets/images/cryptichunt/5.png)
![](/assets/images/cryptichunt/6.png)
![](/assets/images/cryptichunt/7.png)
![](/assets/images/cryptichunt/8.png)
![](/assets/images/cryptichunt/9.png)
![](/assets/images/cryptichunt/10.png)
![](/assets/images/cryptichunt/11.png)
![](/assets/images/cryptichunt/12.png)
![](/assets/images/cryptichunt/13.png)
![](/assets/images/cryptichunt/14.png)
![](/assets/images/cryptichunt/15.png)
![](/assets/images/cryptichunt/16.png)
![](/assets/images/cryptichunt/17.png)
![](/assets/images/cryptichunt/18.png)
<file_sep>/_pages/scholarships.md
---
layout: page
title: Scholarships and Internship Opportunities
permalink: /scholarships
comments: true

filename: "pages/scholarships.md"
---

<file_sep>/_posts/2020-11-03-uncertainty-confidence-cs@ashoka.md
---
layout: post
title:  "Uncertainty & confidence as a CS student at Ashoka"
author: aasthashah
categories: [ Events ]
tags: [ uncertainty, confidence, computerscience, csstudents, ashokauniversity, womenincomputing, womeninstem, ashokauniversity, wicsashoka ]
image: assets/images/confidence.jpg
description: "Uncertainty & confidence as a CS student at Ashoka"
featured: false

filename: "posts/aastha-3nov-uncertainty.md"
---

*Disclaimer: I’m only a fourth-year and in no way more qualified to be giving out “advice” except by virtue of having spent 3+ years at Ashoka. This is as much for myself as it could be for you if you’re just starting out. Besides, others may have faced issues that I may not have, so I’m speaking solely from my own lens.*

I came to Ashoka 100% certain I’ll major in Computer Science because I had worked with Java through grades 9-12 and loved it. I had brilliant teachers and had a lot of fundamentals covered even before the first day of college. Yet, in Intro to Computer Programming, despite already knowing most of the content, there were moments when it all felt inadequate. I thought I had a lot to catch up on already because some people just knew *so much more*. Later, as a TA for ICP, I met many students more than comfortable with content at higher levels and many who enjoyed the content but were afraid of not knowing or performing well enough. The technical nature of the content and large intro classes can make the major especially scary to students without prior experience. This can be especially worse for women due to the skewed gender ratio and lack of female faculty/ role models. Now I’m not saying any of that will change dramatically any time soon. But there are ways to deal with this uncertainty and doubt as you continue on this tumultuous path that is ‘CS@Ashoka’.

First off, remember that computer science is vast and changes exponentially every few years. Even if you know a few ideas or frameworks inside-out, there are others that you’ve never heard of, some that could very well become the next big thing. If you’re unaware of something, don’t fret because you may never need it. Even if you do, you may worry about what you “should” have known, but with almost every resource freely available, **trust that you can teach yourself**. This becomes especially important after the first year because (surprise!) CS classes aren’t about learning how to code. Use the degree to dabble into different areas/ fundamentals within CS and delve deeper into areas you are drawn to. Regardless, you’ll *have* to rely on yourself to get through. (Although, group projects can either be quite smooth or absolutely disastrous, so you’ll have to find people whose working style complements yours early on.)

Another important thing I’ve learnt, which also holds for other interests, is that there will *always* be someone better than you at something (maybe even everything). As you finish your degree, you’ll find many others more confident/ involved in the CS community, more comfortable interacting with faculty, more privileged/ talented/ hardworking with more stuff on their resume. In a small department it’s easy to look at what others may be up to. This becomes worse if you have friends at engineering schools or schools abroad. But looking outwards will stop you from working on what you truly want to do at the pace you’re comfortable with. And yes, it’s hard to care about all of this when there are 2000+ applications for CS jobs/programs and ~500 for every other job/program because everyone wants to do <\insert AI/blockchain buzz word>. It may be excruciatingly competitive, but refer to paragraph 2! Besides, if you take your time to understand and apply things you find interesting, you might find a niche that helps you stand out further. And when you put these few years into perspective, one less project or one bad grade won’t mean much. (I’m guilty of most of this too, but I’m trying.) Understand the content, try to get decent grades, get some external experience, work on a few projects, but know that **your mental/ emotional/ physical health is more important**. I have to sleep for 8 hrs even during finals because I can’t function otherwise. Try to do your best but go at the pace that works for you.

Lastly and most importantly, CS is *way* more than what you’re going to be exposed to in classes and internships. **The possibilities of what you can do with a CS degree are virtually endless**. Rid yourself of the notion that you *must* get a PhD at a T5 school or work as a software engineer at FAANG. This also holds for the subarea. You don’t *need* to do machine learning or cryptography. There is obviously merit in these. But them being the most common goals among CS majors everywhere doesn’t mean they have to be your goals too. There’s scientific computing, HCI, computational linguistics, operations research, quantitative finance, and many other interdisciplinary, sometimes less ‘fancy’ areas that benefit from computer science. This is even more relevant for people whose skills/ interests don’t lie as neatly within programming or research or a specific area but want to turn CS into a career because of their love of technology. It’s helpful and enjoyable to study the subject in isolation because it’s so vast, but exploring other areas can open up multiple paths. (This is yet another reason to maintain whatever hobbies you enjoy and make friends in other departments to fall back on when <\insert course> eventually takes your sanity.)

All that said, feel free to reach out to alumni or seniors to share your concerns and get some insight; I’ve done that plenty of times and it’s always helpful. They’ll often be able to tell you what they would have benefited from, so you get both perspective and time to do your best. (Personally, I’ve gone back-and-forth about what I want to do multiple times and I’m still unsure, so I haven’t worked on *one thing* consistently. I also suffer from generalized anxiety + panic disorder and am prone to depression. I may be able to talk about it and how CS fits into it if you reach out.)
<file_sep>/_posts/2022-04-23-needforrepresentation.md
---
layout: post
title:  "The Need For Representation In Artificial Intelligence"
author: vrindakhandelwal
categories: [ Advocacy ]
tags: [women in CS, lack of diveristy, ethnicidveristylack, gendergap, racialdiscrimination]
image: assets/images/needforrep.jpeg
description: "The Need For Representation In Artificial Intelligence"
editor: nandinibhattacharya
featured: true

filename: "posts/2022-04-23-needforrepresentation.md"
---

Technological and scientific fields are responsible for orchestrating significant transformations and advancements in our lives. But there exist many contentions regarding the lack of an inclusive culture in this sphere.

One of the many structural issues that plague the technical sector is the homogenised workforce that consists primarily of white, cis men. This homogenized workforce serves as a major obstacle to women, people of colour, ethnic minorities and others who have faced systemic oppression, and prevents them from gaining equal access to this space.

The Lack of Gender, Racial and Ethnic Diversity in Tech

The gender gap, for example, has fatal implications for women. Women in STEM professions make 16,000 dollars less than their male counterparts every year. Another disturbing statistic - in 2017, only 2.2% of the 85 billion dollars invested by venture capitalists went to women-led teams.

This bias can have fatal consequences : A 2011 study showed that female seat-belted drivers were 47% more likely to get injured than their male counterparts in crashes of the same magnitude. This was because of the exclusion of female body prototypes in the designing process of seat belts, safety harnesses and other safety equipment owing to the domination of men in these manufacturing spaces. A decade later, not much has changed.

The following graph displays the percentage distribution of employees working in technical professions on the basis of their race and ethnicity in the United States of America :

![needforrep](../assets/images/needforrep.jpeg)

A clear disparity can be observed. This lack of diversity in the workforce is a cause for concern and needs to be addressed. Instead of shifting the onus of responsibility to social and historical factors, we need to examine the shortcomings and gaps within the technological fields, especially that of Artificial Intelligence (AI).

Why Do We Need A More Representative, Inclusive And Diverse Workforce?

A recurrent problem that large corporations like Google and Microsoft are struggling to address is algorithmic bias. The main reason for our current bias-laden Machine Learning algorithms is the lack of representation in our workforce. Since, AI is an extension of it’s creator, it is very easy for it’s creator’s biases to creep into the algorithmic model. Thus, an inclusive group would lead to better and more developed technology.

Heterogeneity would facilitate more intersectional, innovative and creative thinking. Every person processes the same information differently because of different heuristics, i.e., the mental shortcuts that allow individuals to solve problems and make judgments efficiently are different since they depend on the past experiences of the individual. For example, the availability heuristic is a mental shortcut where people over-rely on information that is easily recallable in their minds to make decisions.

If the workforce is inclusive, there would be a diversity of experiences and thus, of perspectives, which would result in a multi-dimensional approach to problem solving. This, in turn, would lead to the creation of better technology and more financial success. McKinsey & Company found that companies in the top quartile for gender, racial or ethnic diversity are “more likely to have financial returns above their national industry medians.”

Another reason to have people from different castes, ethnicities, races and genders is that the technology created by an inclusive workforce will provide a platform which is useful to everyone, and not just a section of society. A diverse group will have fewer biases and will address issues plaguing society as a whole.

An example of the problem of a homogenised workforce creating technology that doesn’t take into account the needs of a section of society is the health app created by Apple. It had astounding features to track various bodily functions and processes, but lacked a menstruation tracker.

Through advancements in AI, we are hoping to find solutions for uplifting the quality of life of the homeless, the differently-abled and others. However, in our race to achieve this, we need to be careful to not disenfranchise a large section of society.

Our policy makers need to actively ensure the participation of minorities in the field of AI. Otherwise, marginalised people - through internalised doubt or the “imposter syndrome” - might begin to accept and normalise the harsh reality.

The Chief Scientist of Artificial Intelligence and Machine Learning at Google, <NAME>, importantly points out that the damage caused by failing to create equality will be impossible to reverse ten years down the line. The industry has been restricted to a cis-gendered, mostly-white, heteronormative space, but the appropriate policy changes for inclusivity could transform it into a vibrant, inclusive and diverse space that could lead to important developments and changes in society.

References:
Devasia, Akshaya. “This is a Man’s (made) world”
“Why Diversity and Representation Matter in the Tech Industry.” Salesflare  Blog, 11 Oct. 2018, blog.salesflare.com/diversity-in-tech-industry.

<file_sep>/_posts/2021-09-17-cryptichuntfakelore.md
---
layout: post
title:  "Instructions for WiCS' Cryptic Hunt 2021: Fakelore"
author: khushi
categories: [ Events ]
tags: [ fakelore, cryptichunt, wicsevents, womenincomputing, womeninstem, ashokauniversity, wicsashoka ]
image: assets/images/ELON BELIEVES. WHY DON'T YOU.png
description: "Instructions for Fakelore: WiCS' Cryptic Hunt 2021"
featured: true

filename: "posts/2021-09-17-cryptichuntfakelore.md"
---
Hello! This post contains instructional pointers for people who wish to participate in WiCS' Cryptic Hunt 2021: Fakelore.

**General Rules**

1. This hunt is only open to Ashoka University students. All the members in your team should be currently enrolled in Ashoka University as a student. If you are an alumnus, you are welcome to participate, but you will not be rewarded for finishing the hunt.

1. **On the hunt portal, please make sure you (and your teammate) use only one Ashoka email ID for the hunt.**

1. **You can participate individually or in a team of two. Yes, you can participate individually. It doesn't matter what you filled in the registration form. If you want to participate with another person as a team, please go ahead. There is no need to inform us if you decide to change your team.** Hope the flowchart below clarifies things:

![Flowchart](../assets/images/Flowchart.jpeg)

1. There will be 16 levels in all: 15 total levels + Level-0 (hint: folklore).
1. The answers can only have lowercase alphanumeric characters (no space or special characters). If the answer is "Shweta's salty salad", the only acceptable answer is "shwetassaltysalad".
1. You have infinite number of tries for each questions. However, please note that only the single right answer will take you to the next level.
1. For any queries that you have, please use only our email and instagram dms to reach out to us. This way, we can respond to your queries in a more efficient manner. We will try to respond to you as soon as possible. Having said that, please note that we will not entertain any questions if you reach out to us through any other medium including whatsapp.
1. Also follow us and be on the lookout for further hints on our [wics.ashoka](https://www.instagram.com/wics.ashoka/) as well as the Fakelore whatsapp group (the link to which has been emailed to you) ;)
1. We will be available for answering queries only between 6 AM - 12 PM & 2 PM - 11: 59 PM on all days. Please be kind and respectful to us in the language you use, we will be trying our best to help you out with all your queries.
1. Please note:
	1. Each team must have a team name or username. You will be prompted to enter this username when you login for the first time.
	1. Each team can use only one Ashoka email ID. If your team has two members, you cannot login with both your email IDs. Doing so can result in disqualification from the hunt.
1. Lastly, remember to have fun!

**Additional Rules**

But what’s a cryptic hunt?
* A cryptic hunt is an online quiz that is broken down into levels of increasing difficulty (if we’re kind). Each level has a picture or text clue that you have to solve!
* Right answers entered in the text box take you to the next level.
* You can attempt the question any number of times, but only the right answer will lead you to the next level.
* You can participate individually or in teams of two.
* Registration is open to everyone regardless of their major or gender.
* No technical background will be assumed. If you know how to Google to get information, you should be fine.

<file_sep>/_posts/2020-09-03-nlp.md
---
layout: post
title:  "The L in NLP: Why NLP Scientists Need to Linguistics Up"
author: niyati
categories: [ Articles ]
tags: [ nlp, machinelearning, linguistics, womenincomputing, womeninstem, ashokauniversity, wicsashoka ]
image: assets/images/nlpgoogle.png
description: "Article by <NAME>"
featured: false
---
**The NLP Revolution**

Linguistics, or rather, modern linguistics, dates back about 250 years. It was sparked by the discovery of [regular sound change](https://en.wikipedia.org/wiki/Sound_change) in previously thought unrelated languages, and it developed as a field to study the other structural systems – [phonetic](https://www.britannica.com/science/phonetics), [phonological](https://all-about-linguistics.group.shef.ac.uk/branches-of-linguistics/phonology/), [morphological](https://all-about-linguistics.group.shef.ac.uk/branches-of-linguistics/morphology/what-is-morphology/), [syntactic](https://all-about-linguistics.group.shef.ac.uk/branches-of-linguistics/syntax/what-does-syntax-study/), [semantic](https://all-about-linguistics.group.shef.ac.uk/branches-of-linguistics/semantics/what-does-semantics-study/) – that languages exhibit. For example, morphology studies the processes of word formation of languages: some languages agglutinate morphemes, or bits of meaning, to form words, like [Turkish](https://www.surfacelanguages.com/articles/turkish/learningturkish.html):

Anlamıyorum : I don’t understand

and others don’t, or do different things with their words.

Syntax studies things like word order, and agreement of the different words in a sentence, so that a sentence is well-formed and able to express an idea coherently:

This article should get<s>ting</s> to the point<s>s</s>.

In short, different arenas of classical linguistics attempt to, among other things, ‘comprehend’, explain, and sometimes generate language with all of its facets, usually with handwritten rules enumerated with great attention to the structure of specific languages or language groups.

Around 30 or so years ago, with the availability of more compute power, we shifted our m.o. to statistics – we used machine learning algorithms to process large amounts of data and detect statistically prominent patterns. These kinds of machines could, then, generate language using probabilistic approach based on what it had ‘seen’. For example, a Bayesian [n-gram model](https://towardsdatascience.com/introduction-to-language-models-n-gram-e323081503d9) (with n = 3), calculates the frequency of all the triplets of consecutive words. When given a two-word ‘prompt’, it looks for the word most likely to complete the triplet given the prompt with some Bayesian magic. Now it uses the most recent two words to incrementally predict the next word, and so on. Some statistical models, like [decision trees](https://towardsdatascience.com/decision-tree-in-machine-learning-e380942a4c96#:~:text=Decision%20tree%20is%20one%20of,set%20based%20on%20different%20conditions), were in principle similar to hand-crafted rules, although they were automatically ‘learned’.

Even more recently, we found Deep Learning (DL), or neural nets, and were instantly smitten. What’s not to love about a machine that requires no domain expertise, no intelligent execution and is so opaque that no-one can find faults in it? We’ll get to that in a minute. With DL came more and more mind-blowing and data-intensive models of learning language, each with some professed idea of its specialized function: we had [CNNs](https://deepai.org/machine-learning-glossary-and-terms/convolutional-neural-network#:~:text=A%20convolutional%20neural%20network%20is%20a%20special%20kind%20of%20feedforward,There%20is%20no%20convolution%20kernel.), [RNNs](https://www.analyticsvidhya.com/blog/2017/12/introduction-to-recurrent-neural-networks/), which tried to remember sequential information, LSTMs, which addressed the vanishing gradient problem, [CRFs](https://towardsdatascience.com/conditional-random-fields-explained-e5b8256da776), [BiLSTMs](https://datascience.stackexchange.com/questions/25650/what-is-lstm-bilstm-and-when-to-use-them), [GRUs](https://towardsdatascience.com/understanding-gru-networks-2ef37df6c9be), [GPTs](https://towardsdatascience.com/openai-gpt-2-understanding-language-generation-through-visualization-8252f683b2f8)…

And finally, about half a decade ago, there was an even bigger revolution: that of [BERT](https://towardsdatascience.com/bert-explained-state-of-the-art-language-model-for-nlp-f8b21a9b6270), or Bidirectional Encoder Representation from Transformers. We also invented [word2Vec](https://israelg99.github.io/2017-03-23-Word2Vec-Explained/#:~:text=Word2Vec%20is%20a%20shallow%2C%20two,corresponding%20vector%20in%20the%20space.), with the staggering, and beautiful, discovery that we could represent words in large dimensional vectors and retain some of their semantic characteristics. We invented [attention](https://arxiv.org/abs/1706.03762), [transformers](http://jalammar.github.io/illustrated-transformer/), multilingual BERT, character encodings, [GloVe](https://towardsdatascience.com/light-on-math-ml-intuitive-guide-to-understanding-glove-embeddings-b13b4f19c010), CoVe, [ELMo](https://allennlp.org/elmo) and so forth. The face of NLP drastically evolved as principles-first methods turned into more and more elegant and complicated neural architectures, that often used equally complicated tools, like word embeddings. Since it was impossible to actually follow the numbers in those matrices as they were processed millions of times, all eyes turned to the F1 score. Or [BLEU](https://towardsdatascience.com/bleu-bilingual-evaluation-understudy-2b4eab9bcfd1), if you were doing translation, or [GLUE](https://gluebenchmark.com/), or whatever. No +3 F1, no go.

**BLEU skies?** 1

This is where the third year Computer Science student comes in. She takes Machine Learning. She tries out NLP. She reads some research papers in NLP that get 98.8% F1 (wow). She joins some NLP circles that are all about using neural nets like three-year-olds use Lego blocks, so that they can grab that +2 F1 and sneak in a paper. She learns the anthem of the field: you can be an NLP scientist and build machines for languages you don’t know anything about (wow)! All you need to grab a corpus in some language (let it be large) and start pumping those numbers. How tedious it would be, right, if you actually had to take a meaningful, scientific look at the data you’re working with? The data which, actually, is one of the world’s 6500+ languages, with a probably unique set of linguistic characteristics? But that, she comes to believe, is unnecessary, because these large, powerful neural architectures, are, in fact, language-agnostic, right – in the sense that capture and work equally well on different kinds of linguistic features? They just deal in numbers, right? They don’t have any biases, unlike those complex rules linguists once constructed (and still do, by the way).

All of the above ideas, of course, are mistaken – the rather heavy-handed italicization helps to highlight the sarcasm, for those who missed it. At some point, our CS major will have a rude shock i.e. when she realizes just how bad the performance gap of these technique on English versus on other languages can be. Contemporary wisdom will tell her “It’s just the data issue”: however, contemporary wisdom is not telling her the whole story. To be honest, contemporary wisdom simply hasn’t invested in finding other scientific causes for the fact that the same machines perform differently on different languages. It is simply too easy to point to data disparity, bypass that conversation about the typological differences between languages (icky!), and move on to trying other standard blindly implementable techniques, like transfer learning, using multilingual embeddings, etc. Frankly, no-one knows how to characterize or interpret multilingual embeddings (or word embeddings in general). [Here](https://www.aclweb.org/anthology/D19-1006.pdf) and [here](https://www.aclweb.org/anthology/D19-1006.pdf) are two papers that conduct research on multilingual embeddings themselves, and there are a bunch more. Have we spent any time on trying to understand why or on what sort of linguistic data transfer learning works best? Because it certainly doesn’t do equally well on all languages…and still, I don’t see any papers on an attempt to scientifically understand this, other than throwaway comments such as ‘works best on “similar” languages’. Ask an NLP scientist what ‘similar’ means for languages and watch her flounder.

Note that I am talking about two different problems here (and I’ll soon talk about a couple more). Firstly, a utilitarian issue: there is enough evidence to show that NLP tasks and models do discriminate by language, specifically, by typology (in [this paper](https://www.aclweb.org/anthology/P18-1072.pdf), for example). By ignoring the value that linguistic information gives us, NLP scientists are losing out on potentially valuable insights that may improve their models. Secondly, the scientific issue: whether or not such information or insights will help in ‘practical’ terms, without investigating them, we are simply performing bad science. We should not need the promise of higher BLEU scores to make a scientific enquiry into the impact that our models have. We need to be informed about how languages work simply for the explainability of our model architectures, for scientific insights on languages and Maths. Remember when we performed research for the sake of understanding and not demonstrating? It was a lot more fun. And a lot more responsible.

**The Data Issue**

I probably don’t need to spend time on why blind science is at best bad and at worst dangerous – the field of ethical AI is a good place to look for those debates. I will spend a little time on the data-intensiveness of some of these NLP tools, however. NLP has definitely played its part in convincing anyone who ventured to think that we live in a postcolonial world otherwise. How many languages of the world are amenable to mainstream NLP techniques? Conservatively, much less than 1%. Do we think this 1% is distributed randomly across languages and not concentrated among languages with historical colonial power, hard and soft? Hm. This makes for, obviously, a much more rigorous discussion, but in my opinion, NLP should certainly introspect on whether it is structurally propagating linguistic hegemony with the tools it chooses to invest in, along with simply reflecting it. Yes, demand and supply, blah blah, but we do postcolonial literature, you know. And postcolonial art. A lot of research historically does have roots in colonialism (anthropology, sociology, literature, translation studies), but their postcolonial revolutions occurred in parallel with those of the world, and their academicians are concerned with the questions of how to dismantle academia’s systemic propagation of power structures. Why are NLP and Computer Science so many steps behind? Because machine learning scientists are too cool to require a social consciousness or too Mathy to [read, please](https://venturebeat.com/2020/08/04/the-problem-of-underrepresented-languages-snowballs-from-data-sets-to-nlp-models/)? Bad science, bad politics, what’s not to like.
Which is all to point out that ‘low-resource’ NLP, which is, of course, should be the norm as opposed to freakishly-high-resource NLP for mainstream English, Spanish, etc. variants, does rely to a greater extent on understanding the linguistic structures of languages…NLP needs to ask itself why its funds and bestseller techniques are geared towards a very specific one-hundredth of the world’s languages. And mainstream NLP scientists should invest in linguistic knowledge as well, or any other more equitable epistemology than data, in fact, so as to contribute to the balancing of the scales – and, of course, do good NLP.

**I don’t buy-is**

Lastly, the idea that NLP machines have no biases because they are not human, operate solely with numbers (pure, soulful numbers), etc. [This paper](https://www.linguisticsociety.org/sites/default/files/08e_95.1Rawski_0.pdf) points out something both important and obvious: ignorance of bias is not absence of bias (the paper also says a lot of very interesting things about free lunch). Firstly, neural architectures that process words are not free of bias by virtue of being non-human numerically based entities. A small example: one can intuitively guess that an n-gram expects, or will perform better on, languages with rigid [word orders](https://en.wikipedia.org/wiki/Word_order) (like English!)2. I don’t know whether this is true, but I do find it strange that there aren’t any papers about it (that I can find – if you do know of some, get in touch ☺). Neither do I find papers about how to adapt word embeddings to morphologically rich languages (MRLs) which might have a more dynamic or productive vocabulary as compared to isolating languages (like English!). Secondly, data. Given their complete dependence on data, neural nets are highly susceptible to what you feed them, which means that the NLP scientist, or the feeder, should be aware of the characteristics of the data, and should be capable of reading the results in context. Again, this is not possible if the scientist cannot [dependency parse](http://nlp.stanford.edu:8080/corenlp/process) “I need to read Fromkin”. Which is to say that whether or not the current mainstream technologies are biased, NLP scientists with no linguistics background are in no position to make that claim.
Note that there are some multilingual metrics that, by virtue of evaluating models on diversified languages and tasks, should end up giving you an accurate idea of its biases or lack thereof. This doesn’t mean, however, that NLP scientists invest in understanding this diversity in any meaningful way at the ground level, and inform their work accordingly. There is a rather burgeoning linguistics-is-unnecessary view in the NLP community that, much like the medieval Church, is dismissing a field of information that it has no clue about. At worst, linguistics will only leave NLP more informed. At best, it will help us build better science – and that sounds like a hell of a good deal to me.

<NAME>

<<EMAIL>>

(PS: Thanks @Tanma<NAME> and @<NAME> for your contribution and suggestions!)

Related articles!
1. <https://www.linguisticsociety.org/resource/history-modern-linguistics>
1. <https://www.dataversity.net/a-brief-history-of-natural-language-processing-nlp/>
1. <https://analyticsindiamag.com/why-are-some-languages-harder-to-learn-for-ai/>
1. <https://venturebeat.com/2020/08/04 the-problem-of-underrepresented-languages-snowballs-from-data-sets-to-nlp-models/>

1Sometimes, people argue in favour of BLEU because it’s accessible and easy to use. In response, other people narrate the following story: “There’s a person who realizes at their doorstep on a dark night that they’ve dropped their keys. They start searching for them on the ground. Someone else comes up and asks what’s up. Person #1 says ‘I’ve dropped my keys’. Person #2 says ‘Okay, I can help you. Did you drop them here, under this streetlight?’ Person #1 responds ‘No, I dropped them over there in the dark, but it’s easier to look here’.”

2We do have, by the way, Byte Pair Encoding or char grams, useful in processing MRLs. However, BPE also sometimes becomes the end of the morphology discussion rather than the beginning, especially when NLP scientists do not know how to theoretically juxtapose char grams with the concept of morphology. [This paper](https://www.aclweb.org/anthology/W15-3603.pdf) suggests that we do need stronger tools than BPE for MRLs.

<file_sep>/_pages/tags.md
---
layout: tags
title: Tags
permalink: /tags

filename: "pages/tags.md"
---<file_sep>/_posts/2022-03-27-myjourneytomathematicsandwhyIstayed.md
---
layout: post
title:  "My Journey to Maths, and why I Decided to Stay."
author: piyushnaresh
categories: [ Blog ]
tags: [math, passion, experience, grades, anxeity]
image: assets/images/ihatemath.jpeg
description: "My Journey to Maths, and why I Decided to Stay"
editor: nandinibhattacharya
featured: true

filename: "posts/2022-03-27-myjourneytomathematicsandwhyIstayed.md"
---

For as long back as I can remember, I've always hated maths. Numbers, especially, were never really my thing. In fact, they still aren't (I still need my fingers to perform simple addition). My grandmother was a maths teacher, and it was largely through her efforts that I managed to do well in school. I remember her telling me that maths could be pretty fun if I would just try to change my perspective. She even told me, to my utter disbelief, about many of her former students who were “addicted” to maths (my simple mind could not yet conceive of such mental disorders). However, it was not my grandmother who sparked my interest in maths, and it was certainly not my school (which almost succeeded in completely killing it). Rather, I was introduced to maths through physics.
In the 8th grade, I read this awesome book called The Universe in your Hand, written by <NAME>. It was this book that started my almost 4-year love affair with physics. Initially, my interest in physics was very childish. Just the simple curiosity of a boy newly awakened to the magical world of black holes and subatomic particles that simultaneously exist everywhere. Things only took a serious turn when I realised that physics, at even the most basic level, requires some very sophisticated mathematics. It was then that I decided to leave (temporarily?) that magical world of higher physics and immerse myself in the mechanical billiard ball world of Newtonian mechanics. As a result, I started to study mathematics on my own in the 9th grade.
Much to my surprise, I actually started to like maths for its own sake. I mean, who ever knew that it actually made sense? Thinking back, I probably always liked maths. I just didn't like the way I was taught maths. No one ever really taught me maths with just that pure intention of helping me understand something truly beautiful. It was always mainly to enable me to solve problems for an examination. This had the adverse effect of disguising simple and perfectly logical ideas as arcane and seemingly arbitrary rules. To take a very simple example: every child is taught that when you “take something to the other side of the equal sign plus becomes minus and multiplication becomes division.” But why? This is exactly what I asked my brother, in the 8th grade. To my surprise, he said he didn't know why. Simply put, he didn't need to know why. Just knowing that simple rule was all he ever needed to solve any algebraic equation shoved in front of him, and hence, no one even bothered mentioning the reason.
The situation is far worse in the higher grades. It was always an uphill battle, desperately trying to stay interested in maths. I even know of a comrade (God rest his soul) who lost this very battle. I only managed to survive by always staying one step ahead of them. I never went to a math class where I hadn't thoroughly studied the topic on my own beforehand (so as to not spoil its proper enjoyment). And I always managed to do well in the exams and answer the tough questions in class, and so the teachers more or less just left me alone. Anyway, I could just go on venting about the education system, but I'm afraid we'd run out of space. Suffice it to say, my interest in maths is going strong for now.
I'd like to think that over the years I've become wiser. If not better, at mathematics. As cliché as it sounds, it's all about asking the right questions. For example, I never really understood, in my gut, what linear algebra was all about the first time I encountered it. I would always ask questions like: but what really is a vector? Is it an arrow? Why is the sum of two vectors the diagonal of the parallelogram formed by them? Why not something else? Learning abstract algebra truly opened my eyes to the folly of such questions and gave me my first real taste of mathematical thinking. A vector is not really an arrow or even a list of numbers. To understand it, we have to understand something far more abstract: the notion of a vector field. Put simply, a vector field consists of a collection of objects called vectors and certain ways to combine them to obtain other vectors. The specifics of these objects and operations are left completely undefined, but whatever they are, they are required to follow certain rules (or axioms), and as long as they do, we can call these objects vectors. The why of these rules is not the mathematician's concern. They are simply there because they are useful in various situations. The key insight here is that these axioms aren't written somewhere in the stars. Mathematicians simply assume them to be true and are mainly interested in their consequences. It's almost like having your own universe and your own set of fundamental laws, with the whole of creation exploding forth from them with the undeniable force of cold hard logic.
The sheer simplicity and elegance of this kind of thinking absolutely captivated me. It is this axiomatic structure of modern mathematics that has me completely hooked to it, and it is the reason I left physics. I mean, why bother with the real universe in all its approximations and uncertainties when you can create your own? One that is unimaginably intricate and beautiful, like a rare diamond suspended in a state of timeless perfection. This is why I like maths. And even though I'm not particularly clever or even good at it, I still feel most comfortable in it. It is the only certain thing in life.
<file_sep>/_pages/about.md
---
layout: page
permalink: /about
comments: false

filename: "pages/about.md"
---

Photo by Team Ricochet, Ashoka University.

Questions or bug reports?

Head over to our Github repositories!

<file_sep>/_posts/2020-06-27-demo.md
---
layout: post
title:  "Welcome to Ashoka Women in Computing Society's blog!"
author: prashanthi
categories: [ Welcome ]
tags: [ womenincomputing, womeninstem, ashokauniversity, wicsashoka ]
image: assets/images/events-team-2019.jpg
description: "Introductory post"
featured: false

filename: "posts/rathi-27jun-demo.md"
---
> Some members of the WiCS Events Team 2019

Hi! We, the women+ in computing at Ashoka University are very excited to launch our blog. We hope to share experiences, thoughts, ideas and opportunities through this platform with you. This would also serve as an archive of events and projects we want to take up this year. As we all welcome UG Batch of 2023, Team WiCS 2020-21 is very excited for the academic year. To know more about us, click [here](https://wics-ashoka.github.io/about).

<file_sep>/_config.yml
# Site
# site:
name: "Women in Computing Society"
title: "WiCS"
description: "The official blog of the Women in Computing Society at Ashoka University."
logo: 'assets/images/wics-logo.jpg'
favicon: 'assets/images/wics-shortened-logo.png'
baseurl: ''
google_analytics: 'UA-158034654-1'
disqus: 'wics-blog'
mailchimp-list: 'https://github.us4.list-manage.com/subscribe/post?u=b89092d26e086848bc0fd71de&id=3d337091d4'
include: ["_pages"]
permalink: /:title/

# Authors
authors:
  deepraj:
    name: <NAME>
    display_name: Deepraj
    gravatar: 4f0ba5cd9ec13e0c103a265fc4bc231e
    email: <EMAIL>
    web: https://deeprajpandey.github.io
    twitter: https://twitter.com/deeprajpandey
    description: "CS Undergrad, TV Connosieur"
  rathi:
    name: <NAME>
    display_name: Rathi
    avatar: 'assets/images/rathi.jpg'
    email: <EMAIL>
    web:
    twitter: https://github.com/rathikashi
    description: "CS student @ AshokaU"
  prashanthi:
    name: <NAME>
    display_name: <NAME>
    avatar: 'assets/images/IMG-20200208-WA0011.jpg'
    email: <EMAIL>
    web:
    twitter: https://github.com/prashanthi-r/
    description: "ASP student @ AshokaU."
  niyati:
    name: <NAME>
    display_name: <NAME>
    avatar: 'assets/images/niyati.jpeg'
    email: <EMAIL>
    web:
    twitter: https://github.com/niyatibafna
    description: "English-CS grad from Ashoka, now specialising in linguistics/CL"
  aasthashah:
    name: <NAME>
    display_name: <NAME>
    avatar: 'assets/images/IMG-0874 - Aastha Shah.jpg'
    email: <EMAIL>
    twitter:
    description: "ASP student @ AshokaU."
  khushi:
    name: <NAME>
    display_name: <NAME>
    avatar: 'assets/images/khushi.jpeg'
    email: <EMAIL>
    twitter:
    description: "CS student @ AshokaU."
  veda:
    name: <NAME>
    display_name: <NAME>
    avatar: 'assets/images/veda.jpg'
    email: <EMAIL>
    twitter: https://github.com/veda-duddu
    description: "CS student @ AshokaU"
  nandinibhattacharya:
    name: <NAME>
    display_name: <NAME>
    avatar: 'assets/images/nandinib.jpg'
    email: <EMAIL>
    twitter:
    description: " First-year CS student @ AshokaU"
  vrindakhandelwal:
    name: <NAME>
    display_name: <NAME>
    avatar: 'assets/images/vrindakhandelwal.jpeg'
    email: <EMAIL>
    twitter:
    description: " ASP CS student @ AshokaU"
  piyushnaresh:
    name: <NAME>
    display_name: <NAME>
    avatar:
    email: <EMAIL>
    description: " Second-year Math student @ AshokaU"
  mythilli:
  name: <NAME>
  display_name: <NAME>
  avatar:
  email: <EMAIL>
  description: " Second-year Eco-fin student @ AshokaU"
# Plugins
plugins:
  - jekyll-paginate
  - jekyll-sitemap
  - jekyll-feed
  - jekyll-seo-tag
  - jekyll-archives

# Archives
jekyll-archives:
  enabled:
    - categories
  layout: archive
  permalinks:
    category: '/category/:name/'

# Pagination
paginate: 6
paginate_path: /page:num/

# Other
markdown: kramdown

kramdown:
  input: GFM
  syntax_highlighter: rouge
  syntax_highlighter_opts:
    block:
      line_numbers: true

# Adsense (change to "enabled" to activate, also your client id and ad slot. Create a new ad unit from your Adsense account to get the slot.)
adsense: "disabled"
adsense-data-ad-client: ""
adsense-data-ad-slot: ""

# Lazy Images ("enabled" or "disabled")
lazyimages: "enabled"

exclude: [changelog.md, LICENSE.txt, README.md, Gemfile, Gemfile.lock]
<file_sep>/_posts/2022-05-28-thingiwishiknew-vedad.md
---
layout: post
title:  "Things I wish I knew in my Second Semester - Veda D"
author: veda
categories: [ Blog ]
tags: [women in CS, women in STEM, first year struggles, confusion, lack of confidence]
image: assets/images/ashokasunset.jpeg
description: "Things I wish I knew in my Second Semester - Veda D"
featured: true

filename: "posts/2022-05-28-thingiwishiknew-vedad.md"
---

The Second Semester always seems to stress people out more than any other semester, because you have finally, especially in the case of the STEM majors, like me, need to pick out our majors.

I remember being a little angry at the lie of being able to explore till my third semester but being trapped essentially in my second semester. I was utterly confused and mathematics in college, a major I once considered my own, seemed very very different.

With an interest in doing an interdisciplinary major in Mathematics and Computer Science but there was so much confusion in my head. Confusion regarding how many courses, is it 16,18 or 19? I have never coded, will I be okay sitting in a class with coders? What about if I am not meant for any of this? And I was on campus, and quite frankly quite alone and in tears the whole of my first week because every single class I attended made me feel like, what am I doing? At the end of my first week, I was sure that doing an interdisciplinary major in Computer Science and Mathematics would be the right option just because I knew too much of one thing would bore me. It was rough because I didn't stick with the plan I made for my courses that semester either. I was relieved not because I found some inspiration from myself but rather because I asked for some help.

The hardest part of coming to college is not knowing how to navigate so many new barriers, and academics sometimes take high precedence.
On a cold Friday night post-dinner in my first week, I attended a wonderful lecture by Prof <NAME>, and it was about his journey into mathematics, not a colloquium. I ended up seeing him walking back to his room post-dinner and made the jump of just asking him if I could talk for a minute. It ended up being a conversation of about 2.5 hours and that conversation along with many is what gives me the confidence to keep going. Every time, I have been unsure, reaching out to professors or seniors, even those who don't fully understand your story always leaves you maybe a little scared but does leave one with the self-assurance that you can deal with it. I didn't recognise then of course that asking questions is the biggest tool in your time in Ashoka.

Questions about academics, professors, clubs, friends and everything in the hemisphere only open you up to new thoughts, new avenues, and things you came here to experience but never imagined.

Asking takes a lot of self-confidence and courage within us. It's understandable that as a freshman (can I say freshwoman? questions to ask), most people like me have no belief in their abilities, especially when you have peers who are geniuses. However, I don't know if this serves a purpose or not to those of you who read this, it's about stopping that part of yourself from that comparison or rather beginning to build the belief in your own work and capabilities. It may take more hours to do the same code or it may take you twice as long to understand the proof, but you'll get there. And if you don't, after putting in so much effort, none of your TAs or professors will shy away from helping you. This is something I have learnt along the way. However, more often than not, you'll figure it out.

One of my biggest mistakes was not asking professors if there was some work or books I could begin to read to build more understanding. I wish I knew that you don't need to have all the skills to ask or apply for positions. You amass skills along the way, you're never enough in your head. Ask and apply instead of making the decision to reject yourself. This is a lesson I am still trying to learn. Networking does get you ahead in life, but it's also your work ethic that people pay a lot of attention to and can carry you the miles when you need it. Your work doesn't need to pay off in acknowledgement or opportunities all the time, sometimes it just pays off by building your confidence.
<file_sep>/_posts/2022-02-28-successinsegregation.md
---
layout: post
title:  "Success in Segregation: Black women who made history"
author: nandinibhattacharya
categories: [ Advocacy ]
tags: [women in CS, black women in CS, NASA, human computer, black history month,<NAME>,<NAME>,<NAME>,<NAME>,<NAME>,<NAME>]
image: assets/images/sis.jpg
description: "Success in Segregation: Black women who made history"
featured: true

filename: "posts/2022-02-28-successinsegregation.md"
---

If a year ago, you’d have asked me to name all the female computer scientists I knew, I wouldn’t
have been able to go much further than Lady Ada Lovelace. I hadn’t noticed how few role
models women had in the field of Computer Science before I officially began studying it in
college. In fact, representation within CS is so unbalanced that, if the current employment trends
continue, there will be equal representation of genders in the workforce only by 2137. What’s
more? CS is also a largely white-dominated field, with only 17% of all CS majors in the US
being people of colour. So black women stand doubly disadvantaged.
One may be tempted to attribute black underrepresentation in CS to possibly the community's
lack of interest in the field. However, according to the Diversity Gaps in Computer Science:
Exploring the Underrepresentation of Girls, Blacks, and Hispanics report conducted by Google,
Black students are 1.5x more likely than white students to be interested in CS. However, in the
same study, it was found that two-thirds of white students had access to computers at home,
while only half the black and Hispanic students surveyed could say the same.
In acknowledgement of the white, cis-male domination of CS, the fewer opportunities that are
available for women of colour in CS, and in honour of black history month, Women in Computer
Science, Ashoka University would like to celebrate and laud the achievements of black women
in CS. These women were not only pioneers in the field but also broke the glass ceiling and gave
future generations of women the opportunity to dream and contribute to CS.

![KatherineJohnson](../assets/images/sis.jpg)

1) <NAME>

Made famous by the critically acclaimed movie, Hidden Figures, Johnson was called a “human
computer” at NASA. She was instrumental in the development and launch of Project Mercury
and Apollo 11 missions. She was so good that when NASA first began using modern computers,
she helped check the accuracy of their calculations. She was even awarded the Presidential
Medal of Freedom in 2015 by then-President Barack Obama.

2) <NAME>

Easley was one of the first African-American computer scientists at NASA. Inspired by those
like <NAME>, she, too, began her career as a “human computer”. As modern computers
started replacing human computers, she learned to program and became the leading member of
the team that developed the software for the Centaur rocket. In the 197s, after this illustrious
career, she went back to school to earn her degree in mathematics at Cleveland State University.
As she was studying, she also held down her full-time job with NASA.

When talking about the racism she faced in her work, she said “My head is not in the sand. But
my thing is, if I can’t work with you, I will work around you. I was not about to be [so]
discouraged that I’d walk away. That may be a solution for some people, but it’s not mine.”

3) <NAME>

Granville created history first by being the second African-American woman to earn a PhD in
mathematics. From Yale University, no less. After completing her studies, with most teaching
positions being unavailable to black women, she took lower-level teaching positions at various
small universities. Even here, she inspired many black girls to go on to earn their own PhDs.
In 1956, she joined IBM as a computer programmer and wrote software for the IBM 650
computer. Then, in IBM’s Aviation Space and Information Systems division, she worked on
digital computer techniques for NASA’s Apollo space program.

4) <NAME>

Vaughan also worked as a mathematician and “human computer”. Holding powerful positions
such as the head of the National Advisory Committee for Aeronautics (NACA’s) segregated
West Area Computing Unit. She also went on to be NASA’s first African-American manager.
While she worked at NACA, segregation and <NAME> laws persisted. She was assigned to the
West Area computing unit which consisted exclusively of black women who were expected to
use separate bathrooms and dining rooms. Through excellent work, this unit managed to
distinguish itself at NACA. Vaughan was then promoted to manager, hence becoming the first
African-American to hold the position.

5) <NAME>

Mouton was the Assistant Chief of Research Programs at NASA's Trajectory and Geodynamics
Division in the 1960s. She led a team of human computers who tracked the orbit of the Echo 1
satellite. She did this at Goddard Space Flight Center in her capacity as the Head Computer
Programmer and then Program Production Section Chief. She was awarded the Apollo
Achievement Award and an Exceptional Performance Award from NASA before she retired.

6) <NAME>

A more modern example, Bryant founded Black Girls CODE in 2011 to teach young women of
color to code. She also served on the National Champions Board for the National Girls
Collaborative Project, whose vision is to bring together organizations that inform and encourage
women to pursue studies in STEM. She was honored by the White House in 2013 for being a

“Champion of Change for Tech Inclusion”. She was also named by Business Insider in their list
of Most Influential African-Americans in Technology.
<file_sep>/_pages/upcomingevents.md
---
layout: page
permalink: /events
comments: false

filename: "pages/upcomingevents.md"
---

  {% include contact.html %}

Timeline

		Event
		Tentative Dates

    	Annual Cryptic Hunt: Waterboarded Witless
    	29-30th August, 2020

      Chill Coffee Chat
      13th September 2020

        [The WiCS Round Table] Post-Quantum Cryptography by Dr. <NAME>

      17th September, 2020

  		[WiCS x WireByte] Show-N-Tell
  		21st September, 7-8 PM

      Inductions form opens
      21st September

      First podcast goes out
      Late September

      Introduction to Bash: A talk by Cocoa
      1st October, 2020

      Open house for CS+@Ashoka students
      Early October

      "Build your own chatbot" - a workshop
      Mid-November

      Fireside chat on self-mutating code
      Mid-November

More information to follow. Stay tuned!

Questions or bug reports?

Head over to our Github repositories!

<file_sep>/_posts/2020-08-20-cryptichunt.md
---
layout: post
title:  "Instructions for WiCS' Cryptic Hunt 2020: Waterboarded Witless"
author: prashanthi
categories: [ Events ]
tags: [ waterboardedwitless, cryptichunt, wicsevents, womenincomputing, womeninstem, ashokauniversity, wicsashoka ]
image: assets/images/cryptichunt-final1.jpg
description: "Instructions for Cryptic Hunt 2020"
featured: false

filename: "posts/prashanthi-27jun-cryptichunt.md"
---
Hello! This post contains instructional pointers for people who wish to participate in WiCS' Cryptic Hunt 2020: Waterboarded Witless.

**General Rules**

1. *This hunt is only open to Ashoka University students. All the members in your team should be currently enrolled in Ashoka University as a student. If you are an alumnus, you are welcome to participate, but you will not be rewarded for finishing the hunt.*
1. **We realise that a lot of you are confused about the registration process. We are sorry for the confusion - we have now made changes to our hunt logistics. You should be able to participate even without registering. On the hunt portal, please make sure you (and your teammate) use only one Ashoka email ID for the hunt.**
1. **You can participate individually or in a team of two. Yes, you can participate individually. It doesn't matter what you filled in the registration form. If you want to participate with another person as a team, please go ahead. There is no need to inform us if you decide to change your team.** Hope the flowchart below clarifies things:

![Flowchart](asset/images/Flowchart.jpeg)

1. There will be 16 levels in all: 15 total levels + Level-0 (where you have to enter the answer to a clue mentioned in the first email you received to proceed to Level-1).
1. The answers can only have lowercase alphanumeric characters (no space or special characters). If the answer is "Tanvi's toy tiger", the only acceptable answer is "tanvistoytiger".
1. You have infinite number of tries for each questions. However, please note that only the right answer will take you to the next level.
1. We have tried to include as many possible combinations of answers as possible, but if you do not get the answer right, keep trying.
1. Please fill in your queries/doubts/help regarding the portal/questions on the portal in [this form](https://forms.gle/uuGD3B8CqJeEadNy8). This form will be active only between Saturday, 12 PM and Sunday 11:59 PM. This has been created so that we can respond to your queries in a more efficient manner, since emails can get lost sometimes. We will try to respond to you as soon as possible. Having said that, please note that we will not entertain questions about questions from the cryptic hunt that are emailed to <EMAIL>.
1. You can use form to reach out to us if you are stuck with anything. Also follow us and be on the lookout for further hints on our [social media](https://wics-ashoka.github.io/about). ;)
1. The help form mentioned above is also linked under the 'Rules' tab of the cryptic hunt portal.
1. We will be available for answering queries only between 10 AM and 11:59 PM on both the days. Please be kind and respectful to us in the language you use, we will be trying our best to help you out with all your queries.
1. Please note:
	1. Each team must have a team name or username. You will be prompted to enter this username when you login for the first time.
	1. Each team can use only one Ashoka email ID. If your team has two members, you cannot login with both your email IDs. Doing so can result in disqualification from the hunt.
1. Lastly, remember to have fun!

**Additional Rules**

But what’s a cryptic hunt?
* A cryptic hunt is an online quiz that is broken down into levels of increasing difficulty (if we’re kind). Each level has a picture or text clue that you have to solve!
* Right answers entered in the text box take you to the next level.
* You can attempt the question any number of times, but only the right answer will lead you to the next level.
* You can participate individually or in teams of two. However, you cannot register twice or switch between individual/team participation without informing us a priori.
* Registration is open to everyone regardless of their major or gender.
* No technical background will be assumed. If you know how to Google to get information, you should be fine.

branch_name: refs/heads/master

languages: Markdown YAML

repo_language: Markdown


text:
<repo_name>compilers-uff/expressoes-regulares-fernandocostar<file_sep>/er.py
import re
import State

def from_epsilon():
    #sigma = aceitos pela linguagem
    #q = estados do automato
    #delta = função de transicao como sendo {estado de partida: [(simbolo1, estado alcançavel1)...(simbolon, estado alcançaveln)]}
    #inicial = estado inicial do automato
    #finais = estados finais do automato
    #A = {sigma, Q, delta, inicial, finais}
    A = {"sigma": [], "q": ["q0", "q1"], "delta": {"q0": [tuple(("epsilon", "q1"))]}, "inicial": "q0", "finais": ["q1"]}
    return A

def from_symbol(symbol):
    #sigma = aceitos pela linguagem
    #q = estados do automato
    #delta = função de transicao como sendo {estado de partida: [(simbolo1, estado alcançavel1)...(simbolon, estado alcançaveln)]}
    #inicial = estado inicial do automato
    #finais = estados finais do automato
    #A = {sigma, Q, delta, inicial, finais}
    A = {"sigma": [symbol], "q": ["q0", "q1"], "delta": {"q0": [tuple((symbol, "q1"))]}, "inicial": "q0", "finais": ["q1"]}
    return A

def sum_to_name(name, n):
    return "q" + str(int(name[1:]) + n)

def get_struct(postfix):
    keys = list(set(re.sub('[^A-Za-z0-9]+', '', postfix)+'e'))
    return keys

def rename(len_a, B):

    n = len_a

    #rename states
    for i in range(len(B["q"])):
        B["q"][i] = sum_to_name(B["q"][i], n)

    new = {}

    #rename delta
    for each in B["delta"]:
        new[sum_to_name(each, n)] = []
        for i in range(len(B["delta"][each])):
            new[sum_to_name(each, n)].append(tuple((B["delta"][each][i][0], sum_to_name(B["delta"][each][i][1], n))))
    B["delta"] = new

    #rename initial state
    B["inicial"] = sum_to_name(B["inicial"], n)

    #rename final states
    for i in range(len(B["finais"])):
        B["finais"][i] = sum_to_name(B["finais"][i], n)

    return B

def add_epsilon_transition(A, B):

    #starts final A, connects starts B
    res = {"sigma": [], "q": [], "delta": {}, "inicial": None, "finais": []}

    #rename B
    B = rename(len(A["q"]), B)

    #update res sigma
    [res["sigma"].append(symbol) for symbol in A["sigma"] if symbol not in res["sigma"]]
    [res["sigma"].append(symbol) for symbol in B["sigma"] if symbol not in res["sigma"]]

    #update res states, once theres no intersection between those
    res["q"] = A["q"].copy() + B["q"].copy()

    #update delta
    for key in A["delta"]:
        res["delta"][key] = A["delta"][key].copy()
    for key in B["delta"]:
        res["delta"][key] = B["delta"][key].copy()

    #add epsilon transition
    if A["finais"][0] not in res["delta"]:
        res["delta"][A["finais"][0]] = [tuple(("epsilon", B["inicial"]))]
    else:
        res["delta"][A["finais"][0]].append(tuple(("epsilon", B["inicial"])))

    res["inicial"] = A["inicial"]
    res["finais"] = B["finais"].copy()
    return res

def add_symbol_transition(A, B, symbol):

    #starts final A, connects starts B
    res = {"sigma": [], "q": [], "delta": {}, "inicial": None, "finais": []}

    #rename B
    B = rename(len(A["q"]), B)

    #update res sigma
    [res["sigma"].append(symbol) for symbol in A["sigma"] if symbol not in res["sigma"]]
    [res["sigma"].append(symbol) for symbol in B["sigma"] if symbol not in res["sigma"]]

    #update res states, once theres no intersection between those
    res["q"] = A["q"].copy() + B["q"].copy()

    #update delta
    for key in A["delta"]:
        res["delta"][key] = A["delta"][key].copy()
    for key in B["delta"]:
        res["delta"][key] = B["delta"][key].copy()

    #add epsilon transition
    if A["finais"][0] not in res["delta"]:
        res["delta"][A["finais"][0]] = [tuple((symbol, B["inicial"]))]
    else:
        res["delta"][A["finais"][0]].append(tuple((symbol, B["inicial"])))

    if symbol not in res["sigma"]:
        res["sigma"].append(symbol)

    #initial and final states copied
    res["inicial"] = A["inicial"]
    res["finais"] = B["finais"].copy()
    return res

def concat(A, B):

    #starts final A, connects starts B
    res = {"sigma": [], "q": [], "delta": {}, "inicial": None, "finais": []}

    #rename B
    B = rename(len(A["q"])-1, B)

    #update res sigma
    [res["sigma"].append(symbol) for symbol in A["sigma"] if symbol not in res["sigma"]]
    [res["sigma"].append(symbol) for symbol in B["sigma"] if symbol not in res["sigma"]]

    #update res states, once theres no intersection between those
    res["q"] = A["q"].copy() + [each for each in B["q"].copy() if each not in A["q"].copy()]

    #update delta
    for key in A["delta"]:
        res["delta"][key] = A["delta"][key].copy()
    for key in B["delta"]:
        if key not in res["delta"]:
            res["delta"][key] = B["delta"][key].copy()
        else:
             res["delta"][key] += B["delta"][key].copy()

    res["inicial"] = A["inicial"]
    res["finais"] = B["finais"].copy()
    return res

def union(A, B):

        #starts final A, connects starts B
        res = {"sigma": [], "q": [], "delta": {}, "inicial": 'q0', "finais": []}

        #renames
        A = rename(1, A)
        B = rename(len(A["q"])+1, B)

        #update res sigma
        [res["sigma"].append(symbol) for symbol in A["sigma"] if symbol not in res["sigma"]]
        [res["sigma"].append(symbol) for symbol in B["sigma"] if symbol not in res["sigma"]]

        #update res states, once theres no intersection between those
        res["q"] = A["q"].copy() + B["q"].copy() + ["q0"] + ["q" + str(len(A["q"]) + len(B["q"]) + 1)]
        res["q"].sort()

        #update final states
        res["finais"] = ["q" + str(len(A["q"]) + len(B["q"]) + 1)].copy()

        #update delta
        for key in A["delta"]:
            res["delta"][key] = A["delta"][key].copy()
        for key in B["delta"]:
            res["delta"][key] = B["delta"][key].copy()

        #add epsilon transitions
        res["delta"][res["inicial"]] = [ tuple(("epsilon", A["inicial"])), tuple(("epsilon", B["inicial"])) ]
        res["delta"][A["finais"][0]] = [ tuple(("epsilon", res["finais"][0])) ]
        res["delta"][B["finais"][0]] = [ tuple(("epsilon", res["finais"][0])) ]
        return res

def closure(A):

    old_initial = sum_to_name(A["inicial"], 1)
    new_initial = "q0"

    old_final = sum_to_name(A["finais"][0], 1)
    new_final = sum_to_name(old_final, 1)

    A = rename(1, A)

    A["inicial"] = new_initial

    A["q"] += [new_initial, new_final]
    A["q"].sort()

    A["finais"] = [new_final]

    A["delta"][new_initial] = [ tuple(("epsilon", old_initial)), tuple(("epsilon", new_final)) ]
    A["delta"][old_final] = [ tuple(("epsilon", new_final)) ]
    A["delta"][old_final] += [tuple(("epsilon", old_initial))]

    return A

#transforms infix to posfix
def prefix2posfix(expression):

    print("initial exp:", expression)
    expression = expression.replace(",", "")
    expression = expression.replace(" ", "")

    print("replaced exp:", expression)

    s = expression

    stack = []

    s = s[::-1]

    for i in s:

        if i == '+' or i == '|' or i == '.':
            a = stack.pop()
            b = stack.pop()
            temp = a+b+i
            stack.append(temp)

        else:
            stack.append(i)

    print("postfix exp:", "".join(stack))
    return "".join(stack)

def erToAFNe(regex):

    #sigma = aceitos pela linguagem
    #q = estados do automato
    #delta = função de transicao como sendo {estado de partida: [(simbolo1, estado alcançavel1)...(simbolon, estado alcançaveln)]}
    #inicial = estado inicial do automato
    #finais = estados finais do automato
    #A = {sigma, Q, delta, inicial, finais}
    A = {"sigma": [], "q": [], "delta": {}, "inicial": None, "finais": []}

    if regex == "":
        return from_epsilon()

    stack = []

    for token in regex:

        if token == "*":
            print("closure")
            A = stack.pop()
            print("\n")
            stack.append(closure(A))
        elif token == "+":
            print("union")
            r = stack.pop()
            l = stack.pop()
            stack.append(union(r, l))
        elif token == ".":
            print("concat")
            r = stack.pop()
            l = stack.pop()
            stack.append(concat(l, r))
        else:
            print("add ", token)
            stack.append(from_symbol(token))
    return stack.pop()

def verify_epsilon_to_final(A):

    for state in A["delta"]:
        for pair in A["delta"][state]:
            if pair[0] == "epsilon" and pair[1] in A["finais"]:
                return False
    return True

def afneToAFN(A):

    temp_finals = []

    #mark new finals
    while(not verify_epsilon_to_final(A)): #keep until there are no states going with epsilon to final states
        #add all symbols transitions from states that have epsilon to final (careful to do not duplicate transitions)
        for state in A["delta"]:
            aux = []
            for pair in A["delta"][state]:
                if pair[0] == "epsilon":

                    if pair[1] in A["finais"]: A["finais"].append(state)

                    for symbol in A["sigma"]:
                        tmp_tuple = tuple( (symbol, pair[1]) )
                        if tmp_tuple not in aux:
                            aux.append(tmp_tuple)
                else:
                    aux.append(pair)
            A["delta"][state] = aux.copy()

    #remove epsilon transitions that goes finals
    for state in A["delta"]:
        for pair in A["delta"][state]:
            if not (pair[0] == "epsilon") and (pair not in A["delta"][state]):
                aux.append(pair)

    #update finals with the ones temp saved above
    A["finais"] += temp_finals
    print(A)
    return A

def main():

    postfix = prefix2posfix("*(.(a,b))")
    print(postfix)
    A = erToAFNe(postfix)
    A = afneToAFN(A)
    print("\n\n\n\n\n")
    print(A)
    for each in A:
        if each == "delta":
            for item in A[each]:
                print("     ", item, A[each][item])
        else:
            print(each, A[each])

main()
<file_sep>/README.md
[![Work in Repl.it](https://classroom.github.com/assets/work-in-replit-14baed9a392b3a25080506f3b7b6d57f295ec2978f6f33ec97e36a161684cbe9.svg)](https://classroom.github.com/online_ide?assignment_repo_id=4354584&assignment_repo_type=AssignmentRepo)
# Expressões regulares

## Objetivo

Implemente em Python 3 um _matcher_ de expressões regulares. Dada uma expressão regular e uma palavra, sua implementação deve dizer **OK** ou **Not OK** quando a palavra dada "casa" com a expressão regular dada.

## Implementação

- Sua implementação deve ser organizada da seguinte forma e deve sempre implementar os algoritmos descritos no livro-texto da disciplina.

1. Transformador de expressões regulares (ER) à autômatos finitos não-determinísticos com transições vazias (AFNe).

   A função `erToAFNe : ER -> AFNe` deve receber uma expressão regular pré-fixadas e retornar um AFNe que reconheça palavras que "casam" com a expressão regular e somente estas.

   Uma expressão regular pré-fixada é dada, por exemplo por `+(.(a, b), c)`, representando a ER `ab + c`.

   O transformador deve implementar o algoritmo definido no livro-texto.

   Represente a função de transição `delta` como um dicionário em Python 3 onde as chaves são strings representando os estados de origem e os valores são pares de string e conjunto de string representando, respectivamente, um símbolo do alfabeto ou epsilon, e os estados alcançáveis através daquele símbolo.

1. Transformador de AFNe à autômatos finitos não-determinísitcos (AFN).

   A função `afneToAFD : AFNe -> AFN` deve receber um AFNe como descrito acima e produzir um AFN, representado como no item acima porém não permitindo que epsilon seja parâmtro atual de `delta`.

1. Transformador de AFN à AFD.

    A função `afntoAFD : AFN -> AFD` deve receber um AFN e produzir o AFD associado. Utiliza a mesma representação para `delta` acima porém com a restrição de que os valores do dicionário, que representa `delta`, são pares com uma string como primeira projeção e conjunto de string como segunda. A cardinalidade do conjunto da segunda projeção é sempre 1.

1. Transformador de AFD para AFD mínimo.

   A função `afdToAFDmin : AFD -> AFD` deve receber um AFD como descrito acima e retornar o AFD mínimo associado utilizado o algoritmo de minimização descrito no livro-texto.

1. Simiulador de AFD.

   Seja `A = (Sigma, Q, delta, q0, F)` um AFD.  A expressão Booleana `A.delta*(q0, w) in A.F`, em Python 3, é verdadeira quando `w` é aceita por `A` e falsa casa contrário. O predicado `A.accepted(w)` é verdadeiro quando `w` é aceita por `A`.

1. Um _matcher_ de ER.

   A expressão booleana `match(er, w)`, onde `er` é uma expressão Booleana pré-fixada, como em 1., e `w` é uma string no alfabeto de `er` é verdadeira quando `w` "casa" com `er` e falsa caso contrário. O predicado `match: (er : ER) x (w : Sigma*) -> Bool` é definido como `afdToAFDmin(afnToAFD(afneToAFN(erToAFNe(er)))).accepted(w)`.

- Seu programa, `er.py`, deve ler uma ER prefixada da linha de comando ou várias a partir de um arquivo imprimindo "OK" ou "Not OK" dependendo dos parâmtros passados.
```shell
python3 er.py "+( 'a', 'b')" "a"
python3 er.py -f ex1.er "a"
```
Quando um arquivo for passado por parâmetro, as expressões regulares contidas neste arquivo devem ser verificadas contra a palavra passada por parâmetro.
Por exemplo, se o arquivo `ex1.er` contiver as expressões regulares
```
+(a,b)
.(a,b)
*(+(a, b))
```
e a chamada ao seu programa for
```
python3 er.py -f ex1.er "a"
```
seu programa deve imprimir as saídas abaixo.
```
match(+(a,b), a) == OK
match(.(a,b), a) == Not OK
match(*(+(a, b)), a) == OK
```

## Testes

Implemente os testes a seguir como predicados a serem executados pelo autograder, seguindo uma das formas de chamada ao seu programa descrita acima.

1. `match('a', 'a') == OK`
1. `match(+('a', 'b'), 'a') == OK`
2. `match(.('a', 'b'), 'ab') == OK`
3. `match(*(+(`a`, `b`), 'a') == OK`
4. `match(*(+(`a`, `b`), 'aaa') == OK`
5. `match(*(+(`a`, `b`), 'ab') == OK`
6. `match(*(+(`a`, `b`), 'aba') == OK`
7. `match(*(+(`a`, `b`), 'abababa') == OK`
8. Outros exemplos de expressões regulares mais complexas.

languages: Markdown Python


text:
<file_sep>from pyquery import PyQuery
import time, urllib2, re, csv, sqlite3, numpy as np

def get_url(top_url):
	html = urllib2.urlopen(top_url).read()
	Q = PyQuery(html)
	a = Q('table.article-table a')
	href = [a.eq(i).attr('href') for i, foo in enumerate(a)]
	u = top_url.split('/wiki/')[0]
	url = []
	for h in href:
		try:
			url.append(u+h)
		except:
			break
	return url

def get_data(url):
	html = urllib2.urlopen(url).read()
	Q = PyQuery(html)
	infobox = Q('table.infobox')
	text = infobox('td').map(lambda x:PyQuery(this).text())
	link = infobox('td').map(lambda x:PyQuery(this).find('a').attr('href'))
	link = [link[i].split('/')[-1] for i,l in enumerate(link)]
	if text[0]=='':
		text = text[1:]
		link = link[1:]
	infolabel = [t for i,t in enumerate(text) if not i%2]
	infodata = [t.replace(',','') for i,t in enumerate(text) if i%2]
	if re.search('[0-9]+',infodata[0]):
		infodata[0] = re.search('[0-9]+',infodata[0]).group()
	food = Q('table.article-table').eq(0)
	foodvalue = food.find('td').map(lambda x:PyQuery(this).text())
	foodlevel = food.find('th').map(lambda x:PyQuery(this).text())
	foodvalue = foodvalue[foodlevel.index('1')-1:foodlevel.index('9')]
	foodlevel = foodlevel[foodlevel.index('1'):foodlevel.index('9')+1]
	coin = Q('table.article-table').eq(1)
	coinvalue = coin.find('td').map(lambda x:PyQuery(this).text())
	coinlevel = coin.find('th').map(lambda x:PyQuery(this).text())
	coinvalue = coinvalue[coinlevel.index('1'):coinlevel.index('10')+1]
	coinlevel = coinlevel[coinlevel.index('1'):coinlevel.index('10')+1]
#	row = len(coinvalue)/11
#	coinvalue = [coinvalue[i*11:(i+1)*11] for i in xrange(row)]
	return (infolabel,infodata),(foodlevel,foodvalue),(coinlevel,coinvalue)

def write_file(filename,list_data):
	f = open(filename+'.txt','w+')
	for l in list_data:
		f.write(str(l)+'\n')
	f.close()

def write_csv(fh,value):
	csv_writer = csv.writer(fh,delimiter=' ',quotechar='"',quoting=csv.QUOTE_MINIMAL)
	csv_writer.writerow(value)

class sqlite(object):
	def __init__(self,db_name,infolabel,foodlevel,coinlevel):
		self.conn = sqlite3.connect('tinyco.db')
		self.cur = self.conn.cursor()
	def add_value(self,table,value):
		if table == 'infobox':
			self.cur.executemany("INSERT INTO %s VALUES(null,?,?,?,?);" % table,value)
		elif table == 'food':
			self.cur.executemany("INSERT INTO %s VALUES(null,?,?,?,?,?,?,?,?,?);" % table,value)
		else:
			self.cur.executemany("INSERT INTO %s VALUES(null,?,?,?,?,?,?,?,?,?,?);" % table,value[0])
	def commit():
		self.conn.commit()
	def quit():
		self.conn.close()

if __name__ == '__main__':
	t = time.time()
	top_url = 'http://tinymonsters.wikia.com/wiki/Monsters'
	url = get_url(top_url)
#	write_file('url',url)
#	f = open('table.txt','w+')
#	reduce(lambda x,y:f.write(','.join(get_data(y))+'\n'),url[:-5])
#	f.close()
	fh = open('tinymonster.csv','wb')
	for i in xrange(len(url[:-6])):
#		print url[i]
		info,food,coin = get_data(url[i])
#		write_csv(fh,info[0]+food[0]+coin[0])
		write_csv(fh,info[1]+food[1]+coin[1])
	fh.close()
	print time.time()-t

<file_sep>tiny_monsters_wikia
===================

data mining for tiny monsters wikia<file_sep>function rev = tiny_monster(level,fig)
% input tiny_monster(level,fig) where level is int and fig is bool
close all
load tinyco
name = cellfun(@(x) regexp(x,'/','split'),url,'UniformOutput',false);
name = cellfun(@(x) x{end},name,'UniformOutput',false);
food_dollar = user_cost(rate,infobox,food,'level',level,'figure',fig);
coin_dollar = user_earning(rate,coin,'level',level,'figure',fig);
rev = nan(size(food_dollar,1),level);
for i = 1:10
    rev(:,i) = revenue(food_dollar,coin_dollar,infobox,rate,'level',i);
end
if fig
    figure
    pcolor(rev)
    xlabel('monster level');
    ylabel('monster id');
    title('revenue for each monster');
    figure
    plot(mean(rev))
    xlabel('monster level');
    ylabel('average revenue');
    title('average revenue per level')
    d = diff(mean(rev));
    figure
    plot(d)
    xlabel('monster level');
    ylabel('first order differential');
    title('marginal revenue per level');
end
r = sum(rev,2);
over_priced = name(r>mean(r)+std(r)*2);
disp(over_priced)

function food_dollar = user_cost(rate,infobox,food,varargin)
    level = size(food,2);
    fig = 0;
    if mod(length(varargin),2)==0
        for i=1:2:length(varargin)
            switch varargin{i}
                case 'figure'
                    fig = varargin{i+1};
                case 'level'
                    level = varargin{i+1};
            end
        end
    else
        disp 'input taken in pairs'
    end
    food_dollar = food/rate.food;
    if level > 9,level = 9;end
    user_cost = sum(food_dollar(:,1:level)*4,2)+infobox(:,1)/rate.coin;
    mean(user_cost)
    if fig
        figure
        hist(user_cost)
        xlabel('user cost in dollar');
        ylabel('number of monsters');
        title(sprintf('user cost for level %d monster',level));
    end

function coin_dollar = user_earning(rate,coin,varargin)
    level = size(coin,2);
    fig = 0;
    if mod(length(varargin),2)==0
        for i=1:2:length(varargin)
            switch varargin{i}
                case 'figure'
                    fig = varargin{i+1};
                case 'level'
                    level = varargin{i+1};
            end
        end
    else
        disp 'input taken in pairs'
    end
    coin_dollar = coin/rate.coin;
    user_earning = sum(coin_dollar(:,1:level),2);
    mean(user_earning)
    if fig
        figure
        hist(user_earning)
        xlabel('user earning in dollar/min');
        ylabel('number of monsters');
        title(sprintf('user earning for level %d monster',level));
    end

function rev = revenue(food_dollar,coin_dollar,infobox,rate,varargin)
    level = size(coin_dollar,2);
    a = 1;
    fig = 0;
    if mod(length(varargin),2)==0
        for i=1:2:length(varargin)
            switch varargin{i}
                case 'level',
                    level = varargin{i+1};
                case 'a',
                    a = varargin{i+1};
                case 'figure'
                    fig = varargin{i+1};
            end
        end
    else
        disp 'input taken in pairs'
    end
    if level>9
        user_cost = sum(food_dollar*4,2)+infobox(:,1)/rate.coin;
        user_earning = sum(coin_dollar(:,1:size(food_dollar,2)).*(food_dollar/min(min(food_dollar))),2);
    else
        user_cost = sum(food_dollar(:,1:level)*4,2)+infobox(:,1)/rate.coin;
        user_earning = sum(coin_dollar(:,1:level).*(food_dollar(:,1:level)/min(min(food_dollar))),2);
    end
    rev = user_cost-a*user_earning;

languages: Markdown MATLAB Python