language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
C++
UTF-8
12,698
2.671875
3
[]
no_license
#include <iostream> #include <conio.h> #include <winsock2.h> #include <windows.h> #include <fstream> #include <sstream> #include <assert.h> #include <algorithm> #include <limits.h> #include <set> #include <list> #include <unistd.h> #include "Exit.h" #include "graphviewer.h" #include "RoadNetwork.h" #include "Algorithms.h" bool moreCuts(); void cutRoadInput(); using namespace std; bool RoadNetwork::readRoads() { ifstream inFile; //Ler o ficheiro roads.txt inFile.open("roads.txt"); if (!inFile) { cerr << "Unable to open file datafile.txt"; return false; } std::string line; int idFrom = 0; int idTo = 0; int roadLength = 0; int roadCap = 0; getline(inFile, line); while (std::getline(inFile, line)) { std::stringstream linestream(line); std::string data; linestream >> idFrom; std::getline(linestream, data, ';'); // read up-to the first ; (discard ;). linestream >> idTo; std::getline(linestream, data, ';'); // read up-to the first ; (discard ;). linestream >> roadLength; std::getline(linestream, data, ';'); // read up-to the first ; (discard ;). linestream >> roadCap; Road *newRoad = new Road(idFrom, idTo, roadLength, roadCap); Road *newRoad1 = new Road(idTo, idFrom, roadLength, roadCap); exits[idFrom]->addRoad(newRoad); exits[idTo]->addRoad(newRoad1); } inFile.close(); return true; } bool RoadNetwork::readCars() { ifstream inFile; //Ler o ficheiro roads.txt inFile.open("cars.txt"); if (!inFile) { cerr << "Unable to open file datafile.txt"; return false; } std::string line; int idCar = 0; int origin = 0; int destiny = 0; getline(inFile, line); while (std::getline(inFile, line)) { std::stringstream linestream(line); std::string data; linestream >> idCar; std::getline(linestream, data, ';'); // read up-to the first ; (discard ;). linestream >> origin; std::getline(linestream, data, ';'); // read up-to the first ; (discard ;). linestream >> destiny; Car *newCar = new Car(idCar, origin, destiny); cars.push_back(newCar); } inFile.close(); return true; } bool RoadNetwork::readFiles() { if (readExits()) { if (readRoads()) { return readCars(); } else return false; } else return false; } bool RoadNetwork::readExits() { ifstream inFile; //Ler o ficheiro nos.txt inFile.open("exits.txt"); if (!inFile) { cerr << "Unable to open file datafile.txt"; return false; } std::string line; int idNo = 0; string name; getline(inFile, line); while (std::getline(inFile, line)) { int pos = line.find(';'); int idNo = stoi(line.substr(0, pos)); string name = line.substr(pos + 1, line.length()); Exit *exitRead = new Exit(idNo, name); exits.push_back(exitRead); } inFile.close(); return true; } void RoadNetwork::cutRoad(int from, int to) { for (int i = 0; i < exits[from]->getConnections().size(); ++i) { if (exits[from]->getConnections()[i]->getDestiny() == to) { exits[from]->getConnections()[i]->setStatus(false); } } } bool moreCuts() { cout << "Do you wish to make more road cuts? (Y/N)" << endl; string s; cin >> s; transform(s.begin(), s.end(), s.begin(), ::tolower); if (s.compare("y")) { return false; } return true; } //returns the path distance and you can get the Exits ID's in pathExit int RoadNetwork::dijkstra(vector<Exit *> graph, int start, int end, vector<int> &pathExit) { vector<int> min_distance(graph.size(), INT_MAX); min_distance[start] = 0; std::set<pair<int, Exit *>> vertices; vertices.insert(make_pair(0, graph[start])); pathExit.resize(graph.size(), -1); while (!vertices.empty()) { int where = vertices.begin()->second->getID(); if (where == end) { return min_distance[where]; } vertices.erase(vertices.begin()); for (auto ed : graph[where]->getConnections()) { if (!(ed->getStatus())) continue; if (min_distance[ed->getDestiny()] > min_distance[where] + ed->getDistance()) { vertices.erase({min_distance[ed->getDestiny()], graph[ed->getDestiny()]}); min_distance[ed->getDestiny()] = min_distance[where] + ed->getDistance(); vertices.insert({min_distance[ed->getDestiny()], graph[ed->getDestiny()]}); pathExit[ed->getDestiny()] = where; } } } return INT_MAX; } const vector<Exit *> RoadNetwork::getExits() const { return exits; } RoadNetwork::RoadNetwork() {} RoadNetwork::~RoadNetwork() { } void RoadNetwork::getPath(list<int> fifth) { for (std::list<int>::iterator it = fifth.begin(); it != fifth.end(); it++) std::cout << *it << ' '; } vector<Car *> RoadNetwork::getCars() const { return cars; } void RoadNetwork::printPath(list<int> list) { for (std::list<int>::iterator it = list.begin(); it != list.end(); it++) { int id1 = list.front(); list.pop_front(); if (!list.empty()) { int id2 = list.front(); for (int i = 0; i < exits[id1]->getConnections().size(); ++i) { if (exits[id1]->getConnections()[i]->getDestiny() == id2) { cout << "from " << id1 << " to " << id2 << endl; gv->setEdgeColor(exits[id1]->getConnections()[i]->getID(), "green"); } } } else break; } } void versionChoice() { cout << "Which algorithm do you want to use?" << endl; cout << "1-Diekstra" << endl; cout << "2-Aproximated match String" << endl; cout << "3-Exact match String" << endl; } void RoadNetwork::getPathbyID(int id) { printPath(getCars()[id]->path); gv->rearrange(); Sleep(100000); } void RoadNetwork::regularPath() { cout << "Which car do you want to see the path?" << endl; int id; cin >> id; printPath(getCars()[id]->path); gv->rearrange(); Sleep(100000); } void RoadNetwork::addCar(Car *car) { cars.push_back(car); } int main(int argc, char *argv[]) { //read all files RoadNetwork network; Algorithms algorithms; network.readExits(); network.readRoads(); network.readCars(); bool br = true; int from, to; do { cout << "Which Roads do you want to cut? (From:To)" << endl; cout << "From:"; cin >> from; cout << "To:"; cin >> to; network.cutRoad(from, to); br = moreCuts(); } while (br); //TODO:validate inputs bool valid_inputs = false; do { versionChoice(); int inp; cin >> inp; cin.ignore(1000, '\n'); if (inp == 1) { //TODO: make this work with the 1st project network.regularPath(); } else if (inp == 2) { string start; string end; cout << "Onde se encontra?" << endl; getline(cin, start); int id_start = algorithms.aproximated_match(start, network.getExits()); if (id_start != -1) { cout << "Melhor resultado: " << network.getExits()[id_start]->getName() << endl; cout << "Qual o seu destino?" << endl; getline(cin, end); int id_end = algorithms.aproximated_match(end, network.getExits()); cout << "Melhor resultado: " << network.getExits()[id_end]->getName() << endl; if (id_end != -1) { Car *newCar = new Car(id_start, id_end); network.addCar(newCar); vector<int> path; network.dijkstra(network.getExits(), id_start, id_end, path); for (int vertex = network.getCars()[newCar->getID()]->getDestiny(); vertex != -1; vertex = path[vertex]) { network.getCars()[newCar->getID()]->path.push_front(vertex); } //print path network.getPath(network.getCars()[newCar->getID()]->path); } else { cout << "Lugar Desconhecido!!" << endl; } } else { cout << "Lugar Desconhecido!!" << endl; } } else if (inp == 3) { string start; string end; cout << "Onde se encontra?" << endl; getline(cin, start); vector<Exit *> start_results = algorithms.exact_match(start, network.getExits()); if (start_results.size()) { algorithms.printResults(start_results); cout << "Escolha o inicio do percurso: " << endl; string choice; getline(cin, choice); int id_start = stoi(choice) - 1; cout << "Qual o seu destino?" << endl; getline(cin, end); vector<Exit *> end_results = algorithms.exact_match(end, network.getExits()); if (end_results.size()) { algorithms.printResults(end_results); cout << "Escolha o destino: " << endl; getline(cin, choice); int id_end = stoi(choice) - 1; Car *newCar = new Car(start_results[id_start]->getID(), end_results[id_end]->getID()); network.addCar(newCar); vector<int> path; cout << "from " << start_results[id_start]->getID() << " to " << end_results[id_end]->getID() << endl; network.dijkstra(network.getExits(), start_results[id_start]->getID(), end_results[id_end]->getID(), path); for (int vertex = network.getCars()[newCar->getID()]->getDestiny(); vertex != -1; vertex = path[vertex]) { network.getCars()[newCar->getID()]->path.push_front(vertex); } //print path network.getPath(network.getCars()[newCar->getID()]->path); } else { cout << "Lugar Desconhecido!!" << endl; } } else { cout << "Lugar Desconhecido!!" << endl; } } else { valid_inputs = true; cout << "Invalid choice!! please try again!" << endl; } } while (valid_inputs); //TODO: get some pretty way to make the dijkstra function vector<int> path; for (int i = 0; i < network.getCars().size(); i++) { path.clear(); network.dijkstra(network.getExits(), network.getCars()[i]->getOrigin(), network.getCars()[i]->getDestiny(), path); for (int vertex = network.getCars()[i]->getDestiny(); vertex != -1; vertex = path[vertex]) { network.getCars()[i]->path.push_front(vertex); } } network.getPath(network.getCars()[0]->path); network.gv = new GraphViewer(800, 800, true); network.gv->createWindow(800, 800); network.gv->defineEdgeColor("blue"); network.gv->defineVertexColor("yellow"); for (int i = 0; i < network.getExits().size(); i++) { network.gv->addNode(network.getExits()[i]->getID()); network.gv->setVertexLabel(network.getExits()[i]->getID(), network.getExits()[i]->getName()); } for (int i = 0; i < network.getExits().size(); i++) { for (int j = 0; j < network.getExits()[i]->getConnections().size(); ++j) { network.gv->addEdge(network.getExits()[i]->getConnections()[j]->getID(), i, network.getExits()[i]->getConnections()[j]->getDestiny(), EdgeType::DIRECTED); network.gv->setEdgeLabel(network.getExits()[i]->getConnections()[j]->getID(), to_string(network.getExits()[i]->getConnections()[j]->getDistance())); if (network.getExits()[i]->getConnections()[j]->getStatus()) { network.gv->setEdgeColor(network.getExits()[i]->getConnections()[j]->getID(), "blue"); } else { network.gv->setEdgeColor(network.getExits()[i]->getConnections()[j]->getID(), "red"); } } } network.gv->rearrange(); sleep(10000); return 1; }
Markdown
UTF-8
1,249
3.15625
3
[]
no_license
# 6.Weather_Dashboard A weather dashboard to give you current temps, conditions, etc. of whatever city you search along with the 5 day forecast of that area. This project had its ups and downs during development. I started with a basic HTML and CSS to get the layout down. Having a visual reference for what was going where helped to plug the functionality in. Getting the ajax call functioning and grabbing the information from the response was simple enough until I realized I needed to use the coordinates for the UV index and 5 day forecast. I orginally tried making each ajax call a separate function, but passing the response from one function with an ajax call, to then become the parameters of a different ajax call nested within another function proved difficult. I eventually nested the second ajax call within the first which made it easier to use the lat and lon responses for the query parameters in the second call, as I didn't need to pass them through another function. For a time I got stuck on getting the 5 day forecast to display the correct day's forecast, as well as the correct date, and this issue got put on the backburner as I worked on another project. I did eventually figure it out with some help from our instructor.
Markdown
UTF-8
6,878
3.125
3
[ "CC-BY-4.0", "CC-BY-3.0", "Apache-2.0" ]
permissive
--- layout: post title: "Apache Camel Content Enricher Example" description: "" category: articles tags: [] --- In a [previous article][1] I discussed why Apache Camel is a useful tool for building small modules to perform integration independent of any of the pieces being integrated. With that out of the way I can go straight into showing an example of using Apache Camel's content enricher. [1]:https://dzone.com/articles/apache-camel-content-enricher The basic flow of our Camel route is to listen for data to come in via a publish-subscribe messaging destination and send it back out in a format that another consumer is expecting. However, the incoming data does not have all the information required to complete the outgoing message. So the content enricher is going to fetch that data from somewhere else to fully populate the outgoing message. To illustrate all of this, I've created [an example on GitHub][2]. In order to create a self-contained example, I've included an embedded REST service that will be the source of our "extra" data, and a data generator to replace the initial publish-subscribe message from the first producer. [2]:https://github.com/AlanHohn/java-intro-course/tree/master/src/main/java/org/anvard/introtojava/camel ## Embedded REST web service The embedded REST web service is based on [one I built last year][3] using Jersey and Jetty. I [wrote that up][4] at the time, so no need to go into too much detail. I'll just show the key part of the service so we can see what it's doing with the data it gets: ```java @POST @Path("/lookup") @Consumes({"application/json"}) @Produces({"application/json"}) public OrderInfo fillIn(OrderInfo info) { info.setCustomerName("Johannes Smythe"); info.setOrderTotal(r.nextDouble() * 100.0); return info; } ``` The great thing about JAX-RS is how simple it makes this kind of thing. The `OrderInfo` class is a data transport object (DTO) that just stores information related to an order. This method takes whatever data is passed in and populates a couple additional fields. When we run this via the embedded Jetty server (see [GitHub][2] and [the article][4] for details) we can see the following output (using [httpie][]): ```plain $ http :8680/rest/order/lookup orderNumber=123 HTTP/1.1 200 OK Content-Type: application/json Server: Jetty(9.1.1.v20140108) Transfer-Encoding: chunked { "customerName": "Johannes Smythe", "orderNumber": 123, "orderTotal": 55.91403903011334, "timestamp": null } ``` [3]:https://github.com/AlanHohn/jaxrs [4]:https://dzone.com/articles/standalone-java-application-with-jersey-and-jetty [httpie]:https://github.com/jkbrzt/httpie ## Camel Route So we have our external "resource" ready. Now we need to supply the Camel route that will use it. I'm electing to use the Java DSL, mostly because I have a lot more experience with using either Spring or Blueprint XML. To build a Camel route using the Java DSL, we create a route builder: ```java public class EnrichRoutePost extends RouteBuilder { @Override public void configure() throws Exception { from("timer://ordergen").bean(new OrderGenerator(), "generate") .marshal().json(JsonLibrary.Jackson) .setHeader(Exchange.CONTENT_TYPE, constant("application/json")) .enrich("http://localhost:8680/rest/order/lookup").log("${body}"); } } ``` By extending the `RouteBuilder` class, we get access to lots of useful chaining methods. Under the covers, when the route is built, Camel creates objects representing each stage of the route, and gives each stage a reference to the next stage. As a result, at runtime executing the route is making a series of method calls, where possible directly from one step in the route to the next. This is done for performance reasons. The method calls between steps in the route include a parameter called an `Exchange`, which Camel uses to hold an "incoming" and an "outgoing" message. Each message includes headers and a body. The header names are strings; the header value and body can be of any type. When building and debugging Camel routes, it is critical to think about the state of the exchange at each step in the route, as this will directly affect the behavior of the next step. The most generic route building methods are `from()` and `to()`; with these methods we can provide any URI that Camel understands and configure using path and query parameters in the URI. The URI schemes that Camel understands are dynamic based on what Camel components are on the classpath; this extensibility is a big reason for Camel's success. In this case, we are starting with a timer; for recent versions of Camel it defaults to once per second after one second, so we don't need to do any configuration. At this point, the exchange has no usable data, and we want it to contain an object of type `OrderInfo`, so we use a `bean()` to call an arbitrary method on a Java class that creates an object of the type we want. These two steps together simulate the publish-subscribe message we might receive in a real system. Now that we have an object of type `OrderInfo` we want it to become the input to the REST web service. For this to work, we need to convert it to JSON. We do this with a `marshal()`, specifying JSON as the target using the Jackson library. This works without any configuration as long as the `camel-jackson` library is on the classpath. The exchange now contains a string form of the order info in JSON format. The next step does the content enriching by calling the web service. The `enrich()` processor takes a URI, similar to `from()` and `to()`. Based on the URI, it routes the incoming message to a component, and sets the outgoing message based on what returns from the component. (Headers are copied over.) In our case, this means that the enricher uses the HTTP component to POST to the supplied URL, sending the JSON data as the POST body. The JSON data that comes back becomes the outgoing message body. To run this route, we need to embed it in a Camel context and start that context: ```java RouteBuilder builder = new EnrichRoutePost(); CamelContext context = new DefaultCamelContext(); context.addRoutes(builder); context.start(); ``` We then see output like this: ```plain [Camel (camel-1) thread #0 - timer://ordergen] INFO route1 - {"timestamp":1472045595996,"orderNumber":308,"customerName":"Johannes Smythe","orderTotal":36.50952697279789} ``` The output contains data from both the original generator and the REST web service. ## Wrapping Up Using a content enricher this way, we're really just using `enrich()` as syntactic sugar in place of `to()`; the behavior would be exactly the same. But the content enricher is capable of more complex behavior, and we'll need that in the next article in order to deal with some use cases that aren't quite this simple.
Java
UTF-8
607
2.21875
2
[ "Apache-2.0" ]
permissive
package com.jeremie.qicqfx.dto; /** * Created by jeremie on 2015/6/5. */ public class DisconnectDTO extends MessageDTO { private String username; private String reason; public DisconnectDTO(boolean disconnected) { status = disconnected ? Status.DISCONNECTED : Status.END_SIGNAL; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } }
Java
UTF-8
780
2.03125
2
[]
no_license
package com.wellsfargo.fsd.lms.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.event.EventListener; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Component; import com.wellsfargo.fsd.lms.dao.LMSUserRepo; import com.wellsfargo.fsd.lms.entity.LMSUser; @Component public class AppStartUpEventHandler { @Autowired private LMSUserRepo repo; @Autowired private PasswordEncoder penc; @EventListener public void onAppStartup(ApplicationReadyEvent event) { if(!repo.existsByUserName("admin")) { repo.save(new LMSUser("admin", "admin",penc.encode("admin") , "ADMIN")); } } }
C
UTF-8
473
3.203125
3
[]
no_license
#include"stdio.h" #include"pthread.h" void *runner(void * val) { int i = 0; char *msg; msg = (char *)val; for(i = 0; i < 10; i ++) { sleep(1); printf("Thread is %s and no is %d \n",msg,i); } pthread_exit(0); } int main() { pthread_t tid1; pthread_t tid2; char msg1[] = "tid1"; char msg2[] = "tid2"; pthread_create(&tid1,NULL,runner,(void*)msg1); pthread_create(&tid2,NULL,runner,(void*)msg2); pthread_join(tid1,NULL); pthread_join(tid2,NULL); }
Java
UTF-8
2,754
2.4375
2
[ "Apache-2.0" ]
permissive
package com.androidbegin.shareimagetutorial; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.Menu; import android.view.MenuItem; import android.view.MenuItem.OnMenuItemClickListener; import android.widget.ImageView; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the view from activity_main.xml setContentView(R.layout.activity_main); // Create an actionbar ActionBar actionBar = getActionBar(); actionBar.show(); // Locate ImageView in activity_main.xml ImageView myimage = (ImageView) findViewById(R.id.image); // Attach image into ImageView myimage.setImageResource(R.drawable.wallpaper); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Create an actionbar menu menu.add("Share Image") // Add a new Menu Button .setOnMenuItemClickListener(this.ShareImageClickListener) .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); return super.onCreateOptionsMenu(menu); } // Capture actionbar menu item click OnMenuItemClickListener ShareImageClickListener = new OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { Bitmap bitmap; OutputStream output; // Retrieve the image from the res folder bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.wallpaper); // Find the SD Card path File filepath = Environment.getExternalStorageDirectory(); // Create a new folder AndroidBegin in SD Card File dir = new File(filepath.getAbsolutePath() + "/Share Image Tutorial/"); dir.mkdirs(); // Create a name for the saved image File file = new File(dir, "sample_wallpaper.png"); try { // Share Intent Intent share = new Intent(Intent.ACTION_SEND); // Type of file to share share.setType("image/jpeg"); output = new FileOutputStream(file); // Compress into png format image from 0% - 100% bitmap.compress(Bitmap.CompressFormat.PNG, 100, output); output.flush(); output.close(); // Locate the image to Share Uri uri = Uri.fromFile(file); // Pass the image into an Intnet share.putExtra(Intent.EXTRA_STREAM, uri); // Show the social share chooser list startActivity(Intent.createChooser(share, "Share Image Tutorial")); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return false; } }; }
Java
UTF-8
290
1.640625
2
[]
no_license
package ikigai.repository; import ikigai.entity.Area; import ikigai.entity.Dimension; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository public interface DimensionRepository extends CrudRepository<Dimension, Long> { }
Python
UTF-8
34,254
2.78125
3
[]
no_license
''' Copyright: Copyright (c) 2019 Created: 2019-4-19 Author: Zhang_Licheng Title: complex tensor expression in dummy index summation All rights reserved ''' import re as regx # (a+b)*c --> ['(','a','+','b',')','*','c'] def expr2list (expr): expr_list = [] var = '' for i in range(len(expr)): if expr[i] == '+' or expr[i] == '-' \ or expr[i] == '*' or expr[i] == '/' : if expr[i-1] != ')': expr_list.append(var) expr_list.append(expr[i]) var = '' elif expr[i] == '(': expr_list.append(expr[i]) elif expr[i] == ')': if expr[i-1] != ')': expr_list.append(var) expr_list.append(expr[i]) else: var += expr[i] if expr[len(expr) - 1] != ')': expr_list.append(var) return expr_list # end expr2list() # ['a','*','b','/','c'] --> expr2:'/' --> return head order: 2 # 'a*b/c' / \ # expr1:'*' c # / \ # a b def parsing_equal_grade_opr(expr_list,expr_dict,opr_list,expr_order): expr_i = expr_order expr_name = '' for i in range(len(expr_list)): for strs in opr_list: if expr_list[i] == strs: expr_i += 1 expr_name = 'expr_'+str(expr_i) expr_dict[expr_name] = {} expr_dict[expr_name]['opr'] = expr_list[i] if i > 2: for strr in opr_list: if expr_list[i] == strr: expr_dict[expr_name]['left'] = 'expr_'+str(expr_i-1) else: expr_dict[expr_name]['left'] = expr_list[i-1] expr_dict[expr_name]['righ'] = expr_list[i+1] return expr_i # end parsing_equal_grade_opr() # ['a','-','b','*','c'] --> expr2:'-' --> return head order: 2 # 'a-b*c' / \ # a expr1:'*' # / \ # b c def parsing_unequal_grade_opr(expr_list,expr_dict,opr_lists,expr_order): expr_i = expr_order for oprlist_i in range(len(opr_lists)): opr_list = opr_lists[oprlist_i] upper_expr_lists = [] upper_expr_locat = [] upper_expr_i = 0 # draw the upper grade operator expression list_i = 0 for strs in expr_list: for opr_str in opr_list: if strs == opr_str: upper_start_tag = 0 if list_i == 1 : upper_start_tag = 0 elif list_i > 2 : for opr_str1 in opr_list: if expr_list[list_i-2] == opr_str1: upper_start_tag += 1 if upper_start_tag == 0: upper_expr_lists.append([]) upper_expr_locat.append([]) upper_expr_i += 1 upper_expr_lists[upper_expr_i-1].append(expr_list[list_i-1]) upper_expr_lists[upper_expr_i-1].append(expr_list[list_i]) upper_expr_locat[upper_expr_i-1].append(list_i-1) upper_expr_locat[upper_expr_i-1].append(list_i) upper_end_tag = 0 if list_i == len(expr_list) - 2: upper_end_tag = 0 elif list_i < len(expr_list) - 3: for opr_str1 in opr_list: if expr_list[list_i+2] == opr_str1: upper_end_tag += 1 if upper_end_tag ==0: upper_expr_lists[upper_expr_i-1].append(expr_list[list_i+1]) upper_expr_locat[upper_expr_i-1].append(list_i+1) list_i += 1 # parsing the upper grade operator expression and replace them in expr_list list_i = 0 for upper_list in upper_expr_lists: # parsing expr_i = parsing_equal_grade_opr(upper_list,expr_dict,opr_list,expr_i) # replacing upper_locat = upper_expr_locat[list_i] for locat_i in range(len(upper_locat)): if locat_i == 0: expr_list[int(upper_locat[locat_i])] = 'expr_'+str(expr_i) else: expr_list[int(upper_locat[locat_i])] = '' list_i += 1 # replacing temp_list = expr_list.copy() expr_list.clear() for strs in temp_list: if strs != '': expr_list.append(strs) return expr_i # end parsing_unequal_grade_opr() # ['a','*','(','b','-','c','/','d') --> expr3:'*' --> return head order: 3 # 'a*(b-c/d)' / \ # a expr2:'-' # / \ # b expr1:'/' # / \ # c d def parsing_with_bracket_opr(expr_list,expr_dict,opr_lists,expr_order): expr_i = expr_order # count the max level of bracket bracket_tag = 0 max_bracket_level = 0 for strs in expr_list: if strs == '(': bracket_tag += 1 elif strs == ')': bracket_tag -= 1 if max_bracket_level < bracket_tag: max_bracket_level = bracket_tag for level in reversed(range(1,max_bracket_level+1)): # locate the bracket bracket_tag = 0 left_bracket_locat = [] righ_bracket_locat = [] list_i = 0 for strs in expr_list: if strs == '(': bracket_tag += 1 if bracket_tag == level: left_bracket_locat.append(list_i) elif strs == ')': if bracket_tag == level: righ_bracket_locat.append(list_i) bracket_tag -= 1 list_i += 1 # draw expression in bracket, parsing and replace them bracket_expr = [] for bracket_i in range(len(righ_bracket_locat)): bracket_expr.append([]) for kk in range(left_bracket_locat[bracket_i]+1, \ righ_bracket_locat[bracket_i]): bracket_expr[bracket_i].append(expr_list[kk]) # parsing bracket expression expr_i = parsing_unequal_grade_opr(bracket_expr[bracket_i],expr_dict,opr_lists,expr_i) # replace the bracket expression in expr_list for kk in range(left_bracket_locat[bracket_i], \ righ_bracket_locat[bracket_i]+1): if kk == left_bracket_locat[bracket_i]: expr_list[kk] = 'expr_'+str(expr_i) else: expr_list[kk] = '' # replace the bracket expression in expr_list temp_list = expr_list.copy() expr_list.clear() for strs in temp_list: if strs != '': expr_list.append(strs) expr_i = parsing_unequal_grade_opr(expr_list,expr_dict,opr_lists,expr_i) return expr_i # end parsing_with_bracket_opr() # --------------------------------------------------------------------------------------------------------------------------- # [a1,a2,..] opr [b1,b2,...] --> [a1 opr b1, a2 opr b2, ...] # [a1,a2,..] opr b --> [a1 opr b, a2 opr b, ...], opr: + - * / # b opr [a1,a2,..] --> [b opr a1, b opr a2, ...] # follow as max size law : [a1,a2] opr [b1,b2,b3] --> [a1 opr b1,a2 opr b2,x opr b3], x=1 when opr = '*''/', x=0 when opr = '+''-' def vector_opr(left,righ,opr_str): vector_list = [] if righ == '': opr = '' if isinstance(left,list) \ and isinstance(righ,list) : if len(left) == 0 \ and len(righ) == 0 : return [] if (len(left) != 0 and not isinstance(left[0],str)) \ or (len(righ) != 0 and not isinstance(righ[0],str)) : return [] left_len = len(left) righ_len = len(righ) max_len = left_len if left_len > righ_len else righ_len min_len = left_len if left_len < righ_len else righ_len for ii in range(max_len): left_str = left[ii] if ii < left_len else '' righ_str = righ[ii] if ii < righ_len else '' if opr_str == '/' and left_str == '': left_str = '1' opr = opr_str elif opr_str == '-' and left_str == '': opr = opr_str else: opr = opr_str if ii < min_len else '' if righ_str == '': opr = '' vector_list.append(left_str+opr+righ_str) elif isinstance(left,list) and len(left) != 0 \ and isinstance(righ,str) : if isinstance(left[0],str) : for ii in range(len(left)): vector_list.append(left[ii]+opr_str+righ) elif isinstance(left,str) \ and isinstance(righ,list) and len(righ) != 0 : if isinstance(righ[0],str) : for ii in range(len(righ)): vector_list.append(left+opr_str+righ[ii]) else: return [] return vector_list # end vector_opr() # [a1,a2,..] * [b1,b2,...]^T --> a1*b1 + a2*b2 + ... # follow as min size law : [a1,a2,a3] * [b1,b2]^T --> a1*b1+a2*b2 # and right item is considered as Transposition def vector_dot_multiply(left,righ): opr = '*' if isinstance(left,list) and len(left) !=0 and isinstance(left[0],str) \ and isinstance(righ,list) and len(righ) !=0 and isinstance(righ[0],str) : left_len = len(left) righ_len = len(righ) min_len = left_len if left_len < righ_len else righ_len if righ[0] == '': opr = '' scalar_strs = left[0]+opr+righ[0] for ii in range(1,min_len): if righ[ii] == '': opr = '' scalar_strs += '+'+left[ii]+opr+righ[ii] return scalar_strs else: return '' # end vector_dot_multiply() # [[a11, a12, ...] ] [[b11, b12, ...] ] [[a11 opr b11, a12 opr b12, ...] ] # [[a21, a22, ...] ] [[b21, b22, ...] ] [[a21 opr b21, a22 opr b22, ...] ] # [[a31, a32, ...] , ... ] opr [[b31, b32, ...] , ... ] --> [[a31 opr b31, a32 opr b32, ...] , ... ] , opr: + - * / # [ ... ] [ ... ] [ ... ] # [ ... ] [ ... ] [ ... ] # ------------------------------------------------------------------------------------------------------------------- # [[a11, a12, ...] ] [[a11 opr b, a12 opr b, ...] ] # [[a21, a22, ...] ] [[a21 opr b, a22 opr b, ...] ] # [[a31, a32, ...] , ... ] opr b --> [[a31 opr b, a32 opr b, ...] , ... ] or b is at left # [ ... ] [ ... ] # [ ... ] [ ... ] # follow as max size law def tensor_opr(left,righ,opr_str): tensor_list = [] if isinstance(left,list) \ and isinstance(righ,list) : left_len = len(left) righ_len = len(righ) max_len = left_len if left_len > righ_len else righ_len if isinstance(left[0],list) \ and isinstance(righ[0],list): for ii in range(max_len): if isinstance(left[0][0],str): left_list = left[ii].copy() if ii < left_len else [] elif isinstance(left[0][0],list): left_list = left[ii].copy() if isinstance(righ[0][0],str): righ_list = righ[ii].copy() if ii < righ_len else [] elif isinstance(righ[0][0],list): righ_list = righ[ii].copy() if isinstance(left[0][0],str) \ and isinstance(righ[0][0],str): tensor_list.append(vector_opr(left_list,righ_list,opr_str)) else: tensor_list.append(tensor_opr(left_list,righ_list,opr_str)) elif isinstance(left[0],str) \ and isinstance(righ[0],list): for ii in range(righ_len): righ_list = righ[ii].copy() if isinstance(righ[0][0],list): tensor_list.append(tensor_opr(left,righ_list,opr_str)) elif isinstance(righ[0][0],str): tensor_list.append(vector_opr(left,righ_list,opr_str)) elif isinstance(left[0],list) \ and isinstance(righ[0],str): for ii in range(left_len): left_list = left[ii].copy() if isinstance(left[0][0],list): tensor_list.append(tensor_opr(left_list,righ,opr_str)) elif isinstance(left[0][0],str): tensor_list.append(vector_opr(left_list,righ,opr_str)) elif isinstance(left[0],str) \ and isinstance(righ[0],str): tensor_list = vector_opr(left,righ,opr_str) elif isinstance(left,str) \ and isinstance(righ,list): if isinstance(righ[0],str): tensor_list = vector_opr(left,righ,opr_str) elif isinstance(righ[0],list): for ii in range(len(righ)): if isinstance(righ[0][0],str): tensor_list.append(vector_opr(left,righ[ii],opr_str)) elif isinstance(righ[0][0],list): tensor_list.append(tensor_opr(left,righ[ii],opr_str)) elif isinstance(left,list) \ and isinstance(righ,str): if isinstance(left[0],str): tensor_list = vector_opr(left,righ,opr_str) elif isinstance(left[0],list): for ii in range(len(left)): if isinstance(left[0][0],str): tensor_list.append(vector_opr(left[ii],righ,opr_str)) elif isinstance(left[0][0],list): tensor_list.append(tensor_opr(left[ii],righ,opr_str)) elif isinstance(left,str) \ and isinstance(righ,str) : return left+opr_str+righ return tensor_list # tensor_opr() # [a11,a12] * [b11,b21]^T --> [a11*b11+a12*b21, a11*b12+a12*b22] # [a21,a22] [b12,b22] [a21*b11+a22*b21, a21*b12+a22*b22] # ------------------------------------------------------------ # [a11,a12] * [b1,b2]^T --> [a11*b1+a12*b2, a21*b1+a22*b2] # [a21,a22] # follow as min size law, and right item is considered as Transposed def matrix_multiply(left,righ): matrix_list = [] vector_list = [] if isinstance(left,list) \ and isinstance(righ,list) : # M · M if isinstance(left[0],list) \ and isinstance(righ[0],list) : if isinstance(left[0][0],str) \ and isinstance(righ[0][0],str) : for ii in range(len(righ)): matrix_list.append([]) for jj in range(len(left)): matrix_list[ii].append(vector_dot_multiply(left[ii],righ[jj])) return matrix_list else: return None # M · V elif isinstance(left[0],list) \ and isinstance(righ[0],str) : if isinstance(left[0][0],str) : for ii in range(len(left)): vector_list.append(vector_dot_multiply(left[ii],righ)) return vector_list else: return None # V · M elif isinstance(left[0],str) \ and isinstance(righ[0],list) : if isinstance(righ[0][0],str) : for ii in range(len(righ)): vector_list.append(vector_dot_multiply(left,righ[ii])) return vector_list else: return None # V · V elif isinstance(left[0],str) \ and isinstance(righ[0],str) : return vector_dot_multiply(left,righ) else: return None elif isinstance(left,list) \ and isinstance(righ,str) : # M · S if isinstance(left[0],list) : if isinstance(left[0][0],str) : for ii in range(len(left)) : matrix_list.append(vector_opr(left[ii],righ,'*')) return matrix_list else: return None # V · S elif isinstance(left[0],str) : return vector_opr(left,righ,'*') else: return None elif isinstance(left,str) \ and isinstance(righ,list) : # S · M if isinstance(righ[0],list) : if isinstance(righ[0][0],str) : for ii in range(len(righ)) : matrix_list.append(vector_opr(left,righ[ii],'*')) return matrix_list else: return None # S · V elif isinstance(righ[0],str) : return vector_opr(left,righ,'*') else: return None # S · S elif isinstance(left,str) \ and isinstance(righ,str) : return left+'*'+righ else: return None # end matrix_multiply() # follw as left move law: [a11,a12] [a11,a21] # [a21,a22,a23] --> [a12,a22] # [a23] def matrix_transpose(matrix): tran_matrix = [] max_len = 0 if isinstance(matrix,str): return matrix elif isinstance(matrix,list) \ and isinstance(matrix[0],str): for ii in range(len(matrix)): tran_matrix.append([]) tran_matrix[ii].append(matrix[ii]) return tran_matrix elif isinstance(matrix,list) \ and isinstance(matrix[0],list) \ and isinstance(matrix[0][0],str) : for ii in range(len(matrix)): max_len = max_len if max_len > len(matrix[ii]) else len(matrix[ii]) for ii in range(max_len): tran_matrix.append([]) for jj in range(len(matrix)): if ii < len(matrix[jj]): tran_matrix[ii].append(matrix[jj][ii]) return tran_matrix else: return None # end matrix_inverse() def vector_add_bracket(vector_list): temp_list = [] for strs in vector_list: temp_list.append('('+strs+')') return temp_list # end vector_add_bracket() def tensor_add_bracket(tensor_list): temp_list = [] if isinstance(tensor_list,list) \ and isinstance(tensor_list[0],str) : temp_list = vector_add_bracket(tensor_list) elif isinstance(tensor_list,list) \ and isinstance(tensor_list[0],list) : for alist in tensor_list: temp_list.append(tensor_add_bracket(alist)) return temp_list # end tensor_add_bracket() # calculate tensor expression directly without dummy index # note: do not use it after matrix_expr() or make a copy of expr_dict befor matrix_expr() def tensor_expr(expr_head,expr_dict): tensor_list = [] expr_sub = '' for strs in ['left','righ']: if not isinstance(expr_dict[expr_head][strs],list) \ and expr_dict[expr_head][strs].find('expr') != -1: expr_sub = expr_dict[expr_head][strs] expr_dict[expr_head][strs] = tensor_expr(expr_sub,expr_dict) if (expr_dict[expr_head]['opr'] == '*' \ or expr_dict[expr_head]['opr'] == '/') \ and (expr_dict[expr_sub ]['opr'] == '+' \ or expr_dict[expr_sub ]['opr'] == '-') : expr_dict[expr_head][strs] = tensor_add_bracket(expr_dict[expr_head][strs]) tensor_list = tensor_opr(expr_dict[expr_head]['left'], \ expr_dict[expr_head]['righ'], \ expr_dict[expr_head]['opr']) return tensor_list # end tensor_expr() def tensor_summation(tensor_list): expr_strs = '' if isinstance(tensor_list,list) \ and isinstance(tensor_list[0],str) : for strs in tensor_list: expr_strs += strs+'+' expr_strs = expr_strs.rstrip('+') elif isinstance(tensor_list,list) \ and isinstance(tensor_list[0],list) : for alist in tensor_list: expr_strs += tensor_summation(alist)+'+' expr_strs = expr_strs.rstrip('+') return expr_strs # end tensor_summation() def tensor_production(tensor_list): expr_strs = '' if isinstance(tensor_list,list) \ and isinstance(tensor_list[0],str) : for strs in tensor_list: expr_strs += '('+strs+')'+'*' expr_strs = expr_strs.rstrip('*') elif isinstance(tensor_list,list) \ and isinstance(tensor_list[0],list) : for alist in tensor_list: expr_strs += tensor_production(alist)+'*' expr_strs = expr_strs.rstrip('*') return expr_strs # end tensor_production() # calculate expression contained matrix vector and scalar without dummy index # note: do not use it after tensor_expr() or make a copy of expr_dict befor tensor_expr() def matrix_expr(expr_head,expr_dict): matrix_list = [] expr_sub = '' for strs in ['left','righ']: if not isinstance(expr_dict[expr_head][strs],list) \ and expr_dict[expr_head][strs].find('expr') != -1: expr_sub = expr_dict[expr_head][strs] expr_dict[expr_head][strs] = matrix_expr(expr_sub,expr_dict) if (expr_dict[expr_head]['opr'] == '*' \ or expr_dict[expr_head]['opr'] == '/') \ and (expr_dict[expr_sub ]['opr'] == '+' \ or expr_dict[expr_sub ]['opr'] == '-' \ or expr_dict[expr_sub ]['opr'] == '*') : expr_dict[expr_head][strs] = tensor_add_bracket(expr_dict[expr_head][strs]) if expr_dict[expr_head]['opr'] == '*' : #print(expr_head) matrix_list = matrix_multiply(expr_dict[expr_head]['left'], \ expr_dict[expr_head]['righ']) else: #print(expr_head) matrix_list = tensor_opr(expr_dict[expr_head]['left'], \ expr_dict[expr_head]['righ'], \ expr_dict[expr_head]['opr']) return matrix_list # end matrix_expr() # transform a_i_j to list in expr_dict and save the dummy index def trans_tensor_expr_list(expr_dict,xde_lists): for expr_key in expr_dict.keys(): for item in ['left','righ']: if not isinstance(expr_dict[expr_key][item],list) \ and expr_dict[expr_key][item].find('expr') == -1: items_list = expr_dict[expr_key][item].split('_') var_name = items_list[0] if len(items_list) > 1: expr_dict[expr_key][item] = var_name idx_i = 0 for idx in items_list: if idx_i == 0: expr_dict[expr_key][item+'_indx'] = [] else: expr_dict[expr_key][item+'_indx'].append(idx) idx_i += 1 # vector if len(items_list) == 2: if 'vect' in xde_lists and var_name in xde_lists['vect']: expr_dict[expr_key][item] = xde_lists['vect'][var_name] if 'fvect' in xde_lists and var_name in xde_lists['fvect']: expr_dict[expr_key][item] = xde_lists['fvect'][var_name] # matrix elif len(items_list) == 3: if 'matrix' in xde_lists and var_name in xde_lists['matrix']: expr_dict[expr_key][item] = [] for lists in xde_lists['matrix'][var_name]: expr_dict[expr_key][item].append(lists) if 'fmatr' in xde_lists and var_name in xde_lists['fmatr']: expr_dict[expr_key][item] = [] for lists in xde_lists['fmatr'][var_name]: expr_dict[expr_key][item].append(lists) # scalar elif len(items_list) == 1: pass # tensor not defined else : print('not defined') # end trans_tensor_expr_list() # xde_tnsr --> xde_tnsr_list & tnsr_dict return-> # a_i_j --> [a,i,j] {i:2,j:3} [i,j] def parse_xde_type_tensor(xde_tnsr,xde_tnsr_list,tnsr_dict,xde_lists): if xde_tnsr.find('_') != -1: for strs in xde_tnsr.split('_'): xde_tnsr_list.append(strs) if len(xde_tnsr_list) == 2: tnsr_dict[xde_tnsr_list[1]] = len(xde_lists['vect'][xde_tnsr_list[0]]) elif len(xde_tnsr_list) == 3: tnsr_dict[xde_tnsr_list[1]] = len(xde_lists['matrix'][xde_tnsr_list[0]]) tnsr_dict[xde_tnsr_list[2]] = len(xde_lists['matrix'][xde_tnsr_list[0]][0]) else: pass return list(tnsr_dict.keys()) # end parse_xde_type_tensor() # transform "a_i_j" to "xde_lists['matrix']['a'][i][j]" # "a_i" to "xde_lists['vect']['a'][i]" def trans_xde_type_tensor(tnsr_indxs,var_list): if len(tnsr_indxs) == 1: tensor_tag = 'vect' elif len(tnsr_indxs) == 2: tensor_tag = 'matrix' tnsr_strs = '' tnsr_strs += 'xde_lists[\''+tensor_tag+'\']' tnsr_strs += '[\''+var_list[0]+'\']' for ii in range(len(tnsr_indxs)): tnsr_strs += '['+tnsr_indxs[ii]+']' return tnsr_strs # end trans_xde_type_tensor() def idx_summation(left_var,righ_expr,xde_lists): SAEfile = open('temppy.temp', mode='w') # expand the bracket # righ_expr = expand_expr(righ_expr) # write the self-auto-executing file SAEfile.write('import json\n') SAEfile.write('jsonfile = open(\'tempjson.temp\', mode=\'r\')\n') SAEfile.write('json_str = jsonfile.read()\n') SAEfile.write('xde_lists = json.loads(json_str)\n') SAEfile.write('jsonfile.close()\n\n') SAEfile.write('tempfile = open(\'tempexpr.temp\', mode=\'w\')\n') SAEfile.write('exprs={}\n') SAEfile.write('\n') # find left variable's indexs left_var_list = [] left_idxlen = {} left_indxs = parse_xde_type_tensor(left_var,left_var_list,left_idxlen,xde_lists) tnsr_xde_l = trans_xde_type_tensor(left_indxs,left_var_list) # write "for i1 in range(n1): for i2 in range(n2): ..." left_indentation = '' for ii in range(len(left_indxs)): SAEfile.write(left_indentation+'for '+left_indxs[ii]+' in range('+str(left_idxlen[left_indxs[ii]])+'):\n') left_indentation += '\t' # write "exprs[str(i1)+str(i2)+...] = xde_lists['vect/matrix']['a'][i1][i2]..." temp_expr_key = '' for ii in range(len(left_indxs)): temp_expr_key += '+str('+left_indxs[ii]+')' temp_expr_key = temp_expr_key.lstrip('+') left_item = 'exprs['+temp_expr_key+']' SAEfile.write(left_indentation+left_item+' = ') SAEfile.write(tnsr_xde_l+'+\'=\'') SAEfile.write('\n') # split expr to list by the lowest priority righ_expr_list = [] bracket_count = 0 expr_left_addr = 0 expr_righ_addr = 0 for ii in range(len(righ_expr)): if righ_expr[ii] == '(': bracket_count += 1 elif righ_expr[ii] == ')': bracket_count -= 1 if ((righ_expr[ii] == '+' \ or righ_expr[ii] == '-') \ and bracket_count == 0) \ or ii == len(righ_expr)-1: if ii == len(righ_expr)-1: expr_righ_addr = ii+1 else: expr_righ_addr = ii righ_expr_list.append(righ_expr[expr_left_addr:expr_righ_addr]) expr_left_addr = expr_righ_addr for expr_strs in righ_expr_list: # find tensors in right expression righ_idxlen = {} righ_indxs = [] pattern = regx.compile(r'[a-zA-Z]+(?:_[a-zA-Z])+') tensor_list = pattern.findall(expr_strs) # find indexs in right expression and pop non-repetitive tensors and indexs temp_list = [] for strs in tensor_list: if temp_list.count(strs) == 0: temp_list.append(strs) temp_idxsl = strs.split('_') if len(temp_idxsl) == 2: if not temp_idxsl[1] in left_idxlen: righ_idxlen[temp_idxsl[1]] = len(xde_lists['vect'][temp_idxsl[0]]) elif len(temp_idxsl) == 3: if not temp_idxsl[1] in left_idxlen: righ_idxlen[temp_idxsl[1]] = len(xde_lists['matrix'][temp_idxsl[0]]) if not temp_idxsl[2] in left_idxlen: righ_idxlen[temp_idxsl[2]] = len(xde_lists['matrix'][temp_idxsl[0]][0]) else: pass tensor_list = temp_list.copy() righ_indxs = list(righ_idxlen.keys()) righ_indentation = left_indentation for ii in range(len(righ_indxs)): SAEfile.write(righ_indentation+'for '+righ_indxs[ii]+' in range('+str(righ_idxlen[righ_indxs[ii]])+'):\n') righ_indentation += '\t' SAEfile.write(righ_indentation+left_item+' += ') def tran_index(matched): tnsr_strs = matched.group('index') tnsr_list = tnsr_strs.split('_') tensor_tag = '' if len(tnsr_list) == 2: tensor_tag = 'vect' elif len(tnsr_list) == 3: tensor_tag = 'matrix' tnsr_strs = '' tnsr_strs += 'xde_lists[\''+tensor_tag+'\']' tnsr_strs += '[\''+tnsr_list[0]+'\']' for ii in range(1,len(tnsr_list)): tnsr_strs += '['+tnsr_list[ii]+']' return '\'+'+tnsr_strs+'+\'' expr_strs = regx.sub(r'(?P<index>([a-zA-Z]+(?:_[a-zA-Z])+))',tran_index,expr_strs) SAEfile.write('\''+expr_strs+'\'') SAEfile.write('\n') SAEfile.write('\nfor strs in exprs.keys():\n') SAEfile.write('\ttempfile.write(exprs[strs]+\'\\n\')\n') SAEfile.write('tempfile.close()\n') SAEfile.close() import json tempjson = {} tempjson['vect']=xde_lists['vect'] tempjson['matrix']=xde_lists['matrix'] file = open('tempjson.temp',mode='w') file.write(json.dumps(tempjson,indent=4)) file.close() import os import platform osinfo = platform.system() if osinfo == 'Windows': del_wds = 'del' elif osinfo == 'Linux': del_wds = 'rm' os.system('python temppy.temp') os.system(del_wds+' temppy.temp') os.system(del_wds+' tempjson.temp') exprfile = open('tempexpr.temp',mode='r') expr_strs = exprfile.read() exprfile.close() os.system(del_wds+' tempexpr.temp') return expr_strs # end idx_summation() def idx_summation_lua(left_var,righ_expr,xde_lists): SAEfile = open('templua.temp', mode='w') # expand the bracket # righ_expr = expand_expr(righ_expr) # write the self-auto-executing file SAEfile.write('xde_lists = {}\n') for strs in ['vect','matrix']: if strs in xde_lists: vect_str = 'xde_lists[\''+strs+'\']' SAEfile.write(vect_str+'={}\n') for keys in xde_lists[strs].keys(): SAEfile.write(vect_str+'[\''+keys+'\']='+str(xde_lists[strs][keys]).replace('[','{').replace(']','}')+'\n') SAEfile.write('tempfile = io.open(\'tempexpr.temp\', \'w\')\n') SAEfile.write('exprs={}\n') SAEfile.write('\n') # find left variable's indexs left_var_list = [] left_idxlen = {} left_indxs = parse_xde_type_tensor(left_var,left_var_list,left_idxlen,xde_lists) tnsr_xde_l = trans_xde_type_tensor(left_indxs,left_var_list) # write "for i1=1,n1 do for i2=1,n2 do ..." left_indentation = '' for ii in range(len(left_indxs)): SAEfile.write(left_indentation+'for '+left_indxs[ii]+'=1,'+str(left_idxlen[left_indxs[ii]])+' do\n') left_indentation += '\t' # write "exprs[tostring(i1)+tostring(i2)+...] = xde_lists['vect/matrix']['a'][i1][i2]..." temp_expr_key = '' for ii in range(len(left_indxs)): temp_expr_key += '+tostring('+left_indxs[ii]+')' temp_expr_key = temp_expr_key.lstrip('+') left_item = 'exprs['+temp_expr_key+']' SAEfile.write(left_indentation+left_item+' = ') SAEfile.write(tnsr_xde_l+'..\'=\'') SAEfile.write('\n') # split expr to list by the lowest priority righ_expr_list = [] bracket_count = 0 expr_left_addr = 0 expr_righ_addr = 0 for ii in range(len(righ_expr)): if righ_expr[ii] == '(': bracket_count += 1 elif righ_expr[ii] == ')': bracket_count -= 1 if ((righ_expr[ii] == '+' \ or righ_expr[ii] == '-') \ and bracket_count == 0) \ or ii == len(righ_expr)-1: if ii == len(righ_expr)-1: expr_righ_addr = ii+1 else: expr_righ_addr = ii righ_expr_list.append(righ_expr[expr_left_addr:expr_righ_addr]) expr_left_addr = expr_righ_addr for expr_strs in righ_expr_list: # find tensors in right expression righ_idxlen = {} righ_indxs = [] pattern = regx.compile(r'[a-zA-Z]+(?:_[a-zA-Z])+') tensor_list = pattern.findall(expr_strs) # find indexs in right expression and pop non-repetitive tensors and indexs temp_list = [] for strs in tensor_list: if temp_list.count(strs) == 0: temp_list.append(strs) temp_idxsl = strs.split('_') if len(temp_idxsl) == 2: if not temp_idxsl[1] in left_idxlen: righ_idxlen[temp_idxsl[1]] = len(xde_lists['vect'][temp_idxsl[0]]) elif len(temp_idxsl) == 3: if not temp_idxsl[1] in left_idxlen: righ_idxlen[temp_idxsl[1]] = len(xde_lists['matrix'][temp_idxsl[0]]) if not temp_idxsl[2] in left_idxlen: righ_idxlen[temp_idxsl[2]] = len(xde_lists['matrix'][temp_idxsl[0]][0]) else: pass tensor_list = temp_list.copy() righ_indxs = list(righ_idxlen.keys()) righ_indentation = left_indentation for ii in range(len(righ_indxs)): SAEfile.write(righ_indentation+'for '+righ_indxs[ii]+'=1,'+str(righ_idxlen[righ_indxs[ii]])+' do\n') righ_indentation += '\t' SAEfile.write(righ_indentation+left_item+' = '+left_item+'..') def tran_index(matched): tnsr_strs = matched.group('index') tnsr_list = tnsr_strs.split('_') tensor_tag = '' if len(tnsr_list) == 2: tensor_tag = 'vect' elif len(tnsr_list) == 3: tensor_tag = 'matrix' tnsr_strs = '' tnsr_strs += 'xde_lists[\''+tensor_tag+'\']' tnsr_strs += '[\''+tnsr_list[0]+'\']' for ii in range(1,len(tnsr_list)): tnsr_strs += '['+tnsr_list[ii]+']' return '\'..'+tnsr_strs+'..\'' expr_strs = regx.sub(r'(?P<index>([a-zA-Z]+(?:_[a-zA-Z])+))',tran_index,expr_strs) SAEfile.write('\''+expr_strs+'\'') SAEfile.write('\n') for ii in range(len(left_indentation),len(righ_indentation)): SAEfile.write((len(righ_indentation)-ii)*'\t'+'end\n') for ii in range(len(left_indentation)): SAEfile.write((len(left_indentation)-ii-1)*'\t'+'end\n') SAEfile.write('\nfor key,value in pairs(exprs) do\n') SAEfile.write('\ttempfile:write(value..\'\\n\')\n') SAEfile.write('end\n') SAEfile.write('tempfile:close()\n') SAEfile.close() import json tempjson = {} tempjson['vect']=xde_lists['vect'] tempjson['matrix']=xde_lists['matrix'] file = open('tempjson.temp',mode='w') file.write(json.dumps(tempjson,indent=4)) file.close() import os import platform osinfo = platform.system() if osinfo == 'Windows': del_wds = 'del' elif osinfo == 'Linux': del_wds = 'rm' os.system('lua templua.temp') os.system(del_wds+' templua.temp') exprfile = open('tempexpr.temp',mode='r') expr_strs = exprfile.read() exprfile.close() os.system(del_wds+' tempexpr.temp') return expr_strs # end idx_summation_lua() # transform 'a' to ['ar','ai'] in expr_dict def trans_complex_expr_list(expr_dict): for keys in expr_dict.keys(): for side in ['left','righ']: if expr_dict[keys][side].find('expr') == -1: var = expr_dict[keys][side] expr_dict[keys][side] = [var+'r',var+'i'] # end trans_complex_expr_list() # expand complex expression def complex_expr(expr_head,expr_dict): expr_sub = '' for strs in ['left','righ']: if not isinstance(expr_dict[expr_head][strs],list) \ and expr_dict[expr_head][strs].find('expr') != -1: expr_sub = expr_dict[expr_head][strs] expr_dict[expr_head][strs] = complex_expr(expr_sub,expr_dict) left = expr_dict[expr_head]['left'] righ = expr_dict[expr_head]['righ'] if expr_dict[expr_head]['opr'] == '+' : return complex_add(left,righ) elif expr_dict[expr_head]['opr'] == '-' : return complex_sub(left,righ) elif expr_dict[expr_head]['opr'] == '*' : return complex_multiply(left,righ) elif expr_dict[expr_head]['opr'] == '/' : return complex_division(left,righ) return ['',''] # end def complex_expr() def complex_add(left,righ): return [left[0]+'+'+righ[0], \ left[1]+'+'+righ[1]] def complex_sub(left,righ): return [left[0]+'-'+righ[0], \ left[1]+'-'+righ[1]] def complex_multiply(left,righ): return [left[0]+'*'+righ[0]+'-'+left[1]+'*'+righ[1], \ left[0]+'*'+righ[1]+'+'+left[1]+'*'+righ[0]] def complex_division(left,righ): return ['('+left[0]+'*'+righ[0]+'+'+left[1]+'*'+righ[1]+')/('+righ[0]+'*'+righ[0]+'+'+righ[1]+'*'+righ[1]+')', \ '(-'+left[0]+'*'+righ[1]+'+'+left[1]+'*'+righ[0]+')/('+righ[0]+'*'+righ[0]+'+'+righ[1]+'*'+righ[1]+')'] def complex_expr_trans(expr): cplx_list = [] if expr.find('_') != -1: return ['',''] expr = expr.replace(' ','') expr_dict = {} expr_list = expr2list(expr) expr_order = parsing_with_bracket_opr(expr_list,expr_dict,[['*','/'],['+','-']],0) trans_complex_expr_list(expr_dict) return complex_expr('expr_'+str(expr_order),expr_dict) # end complex_expr_trans()
Java
UTF-8
2,882
2.40625
2
[]
no_license
package ch.epfl.xblast; import java.util.ArrayList; import java.util.List; import com.sun.jndi.url.iiopname.iiopnameURLContextFactory; import com.sun.swing.internal.plaf.basic.resources.basic; /** * Class RunLengthEncoder * * @author Loïs Bilat (258560) * @author Nicolas Jeitziner (258692) * */ public final class RunLengthEncoder { private RunLengthEncoder(){} /** * Encode a list using the length encoder method * @param list * the list of bytes we want to encode * @return the encoded list */ public static List<Byte> encode(List<Byte> list) { List<Byte> provList = new ArrayList<>(); List<Byte> finalList = new ArrayList<>(); for (Byte b : list) { if (b < 0){throw new IllegalArgumentException();} if (!provList.contains(b)) { if (!list.isEmpty()) { int size = provList.size(); if(size <= 2) { finalList.addAll(provList); } else { finalList.add((byte)(-(size-2))); finalList.add(provList.get(0)); } provList.clear(); } } provList.add(b); if (provList.size()>=130) { finalList.add((byte)(-(provList.size()-2))); finalList.add(provList.get(0)); provList.clear(); } } int size = provList.size(); if(size <= 2) { finalList.addAll(provList); } else { finalList.add((byte)(-(size-2))); finalList.add(provList.get(0)); } return finalList; } /** * Docode a list using the length encoder method * @param list * the list of bytes we want to decode * @return the decoded list */ public static List<Byte> decode(List<Byte> list) { if (list.get(list.size()-1)<0){throw new IllegalArgumentException();} List<Byte> finalList = new ArrayList<>(); for(int i = 0; i < list.size(); ++i) { Byte actualByte = list.get(i); if(actualByte < 0) { for(int j = 0; j < -(actualByte-2); ++j) { finalList.add(list.get(i+1)); } ++i; } else { finalList.add(actualByte); } } return finalList; } }
Python
UTF-8
890
3.390625
3
[]
no_license
from flask import Flask, render_template from random import sample app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" @app.route("/haedal") def haedal(): return "This is Haedal" @app.route("/greeting/<string:name>") def greeting(name): return f'반갑습니다. {name}!' @app.route("/cube/<int:num>") def cube(num): result = num ** 3 return f'{num}의 세제곱은 {result}' # 사람 수 만큼 점심 메뉴 추천 @app.route("/lunch/<int:people>") def lunch(people): menu = ["짜장면", "짬뽕", "라면", "브리또", "사과", "찜닭"] return f'{sample(menu, people)}' # 점심 메뉴 보여주자 @app.route("/show") def show(): menu = ['짜장면.jpg', '짬뽕.jpeg'] pickme = ''.join(sample(menu,1)) return render_template('index.html', food_img=pickme) # Flask를 쉽게 켜자 if __name__ == '__main__': app.run(debug=True)
C++
UTF-8
580
3.703125
4
[]
no_license
/* Program 3_9 :Compute tax */ #include <iostream> #include <string> using namespace std; int main() { float Price, Tax, Total, Tax_Rate = 0.07f; string ProductName; cout << "Enter product name : "; cin >> ProductName; cout << "Enter product price : "; cin >> Price; cout << endl; //case 1 Tax = Price * Tax_Rate; Total = Price + Tax; //case 2 //Total = Price + Price * Tax_Rate; cout << "Price of " << ProductName << " = " << Price << endl; cout << "Tax(&7) of " << ProductName << " = " << Total << endl; return (0); }
Java
UTF-8
2,864
2.265625
2
[]
no_license
package ECP.handle; import org.json.JSONObject; import ECP.service.StoreService; import csAsc.EIO.MsgEngine.CEIOMsgRouter.CParam; public class StoreHandle extends CMsgBaseHandle { private StoreService storeService; public StoreHandle(){ storeService = new StoreService(); } @Override public int handleMsg(CParam param) throws Exception { System.out.println("进入StoreHandle的handleMsg"); JSONObject data=getReqMessage(param); //这里初步设想是根据传入参数的长度来转发各种操作。或者像以前一样增加一个op的字段。 System.out.println("收到的请求信息为:"+data.toString()); String op=data.getString("op"); JSONObject result=null; switch(op){ case "setStoreInfo": result=storeService.setStorInfo(data); break; case "setQualification": result=storeService.setQualification(data); break; case "setDelivery": result=storeService.setDelivery(data); break; case "setProductInfo": result=storeService.setProductInfo(data); break; case "setBankInfo": result=storeService.setBankInfo(data); break; case "setSubmitGoodsIformation": result=storeService.setSubmitGoodsIformation(data); break; case "getGoodsList": result=storeService.getGoodsList(data); break; case "getGoodsIformation": result=storeService.getGoodsIformation(data); break; case "setEditGoodsIformation": result=storeService.setEditGoodsIformation(data); break; case "setDeleteGoodsIformation": result=storeService.setDeleteGoodsIformation(data); break; case "getOrdersList": result=storeService.getOrdersList(data); break; case "getOrderInfo": result=storeService.getOrderInfo(data); break; case "setDelOrder": result=storeService.setDelOrder(data); break; case "setDeliveryInfo": result=storeService.setDeliveryInfo(data); break; case "getStoreList": result=storeService.getStoreList(data); break; case "getStoreInfo": result=storeService.getStoreInfo(data); break; case "getQualificationInfo": result=storeService.getQualificationInfo(data); break; case "getDistributionInfo": result=storeService.getDistributionInfo(data); break; case "getCollectionInfo": result=storeService.getCollectionInfo(data); break; case "setOrderState": result=storeService.setOrderState(data); break; case "getQualification": result=storeService.getQualification(data); break; case "getDelivery": result=storeService.getDelivery(data); break; case "getBankInfo": result=storeService.getBankInfo(data); break; default: String str = "{\"result\":\"0\",\"resultTip\":\"请求参数出错\"}"; result = new JSONObject(str); } param.respData.append(result.toString()); System.out.println("输出数据:"+param.respData); return super.handleMsg(param); } }
C#
UTF-8
933
3.78125
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Cap05_Ativ02 { class Program { static void Main(string[] args) { int n; Console.Write("Entre com um número: "); n = int.Parse(Console.ReadLine()); Console.WriteLine(); Console.Write("A série de Fibonacci dos {0} primeiros números é: 1", n); Fibonacci(n); Console.WriteLine(); Console.Write("Tecle algo para encerrar..."); Console.ReadKey(); } public static void Fibonacci(int x) { int t1 = 0, t2 = 1, aux; for (int cont = 0; cont < x; cont++) { aux = t1; t1 = t2; t2 = t1 + aux; Console.Write(", {0}", t2); } } } }
Markdown
UTF-8
3,819
2.546875
3
[]
no_license
わからなかったら飛ばして脳死でコマンド打ってもOK ------------------------- フロントエンド編(環境構築) ============== やること - nodeをインストール - vue-cliをインストール - vueを立ち上げて動作させてみる Step1 環境構築 ---------- めんどくさいですが環境構築から始めましょう まずはnodenv [https://qiita.com/1000ch/items/41ea7caffe8c42c5211c](https://qiita.com/1000ch/items/41ea7caffe8c42c5211c) まずは上のリンクを参考にしてnodevnをダウンロードしてnodeを動かせるようにする。 nodeをインストールするとnpm(node package manger)が使用できるようになっていると思います。 ```bash node -v npm -v ``` 上のコマンドを打ち込んでバージョンが表示されていればうまくインストールできている。 Nodeって何? -------- > V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application. [](https://v8.dev/)[https://v8.dev/](https://v8.dev/) > サーバーサイドの JavaScript 実行環境。 > Google V8 JavaScript エンジンを使用しており、高速。 > Linux サーバにインストールして使用することが多いが、macOS 版や、Windows 版もある。 > npm (Node Package Manager) と呼ばれるパッケージ管理システムを同梱。 > ノンブロッキングI/O と イベントループ アーキテクチャにより、10K問題 (クライアント1万台レベルになると性能が極端に悪化する問題) に対応。 [](http://www.tohoho-web.com/ex/nodejs.html)[http://www.tohoho-web.com/ex/nodejs.html](http://www.tohoho-web.com/ex/nodejs.html) とほほNode.js入門 ブラウザ上でしか動作しなかったJavascriptをlinux, Mac, Windows上でも動作するようにしたもの。 NPM(Node Package Manager) ------------------------- npm公式サイト about npm [](https://docs.npmjs.com/about-npm)[https://docs.npmjs.com/about-npm](https://docs.npmjs.com/about-npm) 今回使用するのはパッケージ管理の部分なので使用するのは以下のコマンド npm install 概要は以下(飛ばし読みでもok) ``` npm install (with no args, in package dir) npm install [<@scope>/]<name> npm install [<@scope>/]<name>@<tag> npm install [<@scope>/]<name>@<version> npm install [<@scope>/]<name>@<version range> npm install <alias>@npm:<name> npm install <git-host>:<git-user>/<repo-name> npm install <git repo url> npm install <tarball file> npm install <tarball url> npm install <folder> aliases: npm i, npm add ``` [](https://docs.npmjs.com/cli/v7/commands/npm-install)[https://docs.npmjs.com/cli/v7/commands/npm-install](https://docs.npmjs.com/cli/v7/commands/npm-install) Vueを導入する --- Why Vue 日本での使用率はReactと争っている。 国内での採用事例が多いい ```bash npm install -g @vue/cli ``` ``` vue create my-project ``` 上のコマンドを押すといくつか質問を聞かれる question1 ❯ Manually select features question2 ![](./sec1_1.png) question3 - 3.x (どちらでもいい) これ以降の質問はすべてEnterを押すと、Vueの環境がmy-project/以下に自動で立ち上がる。 ``` cd my-project npm run serve ``` ブラウザで `http://localhost:8080/` をアクセスするとサンプルが表示される。 ![](./sec1_2.png) 参考サイト https://jp.vuejs.org/v2/guide/installation.html https://qiita.com/567000/items/dde495d6a8ad1c25fa43
Java
UTF-8
1,711
2.21875
2
[ "MIT" ]
permissive
/* * Copyright (C) 2017 Miles Talmey. * Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). */ package com.emarte.regurgitator.extensions; import com.emarte.regurgitator.core.Log; import com.emarte.regurgitator.core.Message; import com.emarte.regurgitator.core.RegurgitatorException; import com.emarte.regurgitator.core.ValueProcessor; import javax.xml.xpath.*; import java.util.Map; import static com.emarte.regurgitator.core.StringType.stringify; import static com.emarte.regurgitator.extensions.XPathUtil.strip; import static com.emarte.regurgitator.extensions.XmlUtil.getDocument; public class XpathProcessor implements ValueProcessor { private static final Log log = Log.getLog(XpathProcessor.class); private final Map<String, String> namespaceUris; private final String xpath; public XpathProcessor(String xpath, Map<String, String> namespaceUris) { this.xpath = xpath; this.namespaceUris = namespaceUris; } @Override public Object process(Object value, Message message) throws RegurgitatorException { log.debug("Applying xpath '{}'", xpath); XPathFactory xPathfactory = XPathFactory.newInstance(); XPath xpath = xPathfactory.newXPath(); if (namespaceUris != null) { xpath.setNamespaceContext(new SimpleNamespaceContext(namespaceUris)); } try { XPathExpression expression = xpath.compile(this.xpath); return strip(expression.evaluate(getDocument(stringify(value)), XPathConstants.NODESET)); } catch (XPathExpressionException e) { throw new RegurgitatorException("Error evaluating xpath", e); } } }
Python
UTF-8
938
2.515625
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- from rdkit import Chem from .pdb import * from .ctab import * T, F = True, False class rawmol(object): """ read/write RDKit mol """ def __init__(self, zs, chgs, bom, coords): na = len(zs) self.na = na self.zs = zs self.chgs = chgs self.bom = bom self.coords = coords def build(self, sort_atom=F, sanitize=True, removeHs=False): """ create a RDKit molecule object from scratch info """ if self.na > 999: ctab = write_pdb( (self.zs, self.chgs, self.bom, self.coords), sort_atom=sort_atom) m = Chem.MolFromPDBBlock(ctab, sanitize=sanitize, removeHs=removeHs) else: ctab = write_ctab(self.zs, self.chgs, self.bom, self.coords, sort_atom=sort_atom) #print('ctab=',ctab) m = Chem.MolFromMolBlock(ctab, sanitize=sanitize, removeHs=removeHs) return m
Java
UTF-8
3,733
2.359375
2
[]
no_license
package com.hmd.util; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Bitmap.Config; import android.graphics.PorterDuff.Mode; import android.widget.ImageView; public class ImageUtil { private static String imageURL[] = new String[]{ "http://www.cnu.edu.cn/download.jsp?attachSeq=15815&filename=20131209144643404.jpg", "http://www.cnu.edu.cn/download.jsp?attachSeq=15820&filename=20131209145251129.jpg", "http://www.cnu.edu.cn/download.jsp?attachSeq=15823&filename=20131210130505295.jpg", "http://www.cnu.edu.cn/download.jsp?attachSeq=15362&filename=20131031155715804.jpg", "http://www.cnu.edu.cn/download.jsp?attachSeq=15368&filename=20131101090654481.jpg", "http://www.cnu.edu.cn/download.jsp?attachSeq=15257&filename=20131021165222134.jpg" }; public static String getTestImageURL1(){ int random = (int)(Math.random() * imageURL.length); return imageURL[random]; } // 取测试数据 public static String[] getTestImageURL2(){ int random1 = (int)(Math.random() * imageURL.length); int random2 = (int)(Math.random() * imageURL.length); return new String[]{imageURL[random1], imageURL[random2]}; } public static String[] getTopMediaImageList(){ return new String[]{"http://www.cnu.edu.cn/download.jsp?attachSeq=15820&filename=20131209145251129.jpg", "http://www.cnu.edu.cn/download.jsp?attachSeq=15781&filename=20131205161653892.jpg", "http://www.cnu.edu.cn/download.jsp?attachSeq=15780&filename=20131205161646324.jpg"}; } // http://my.oschina.net/u/143926/blog/137637 public static void loadImage(int resid, String url, ImageView imageView){ DisplayImageOptions options = new DisplayImageOptions.Builder() .showImageOnLoading(resid) .showImageForEmptyUri(resid) .showImageOnFail(resid) .cacheInMemory(true) .cacheOnDisc(true) .bitmapConfig(Bitmap.Config.ARGB_8888) .build(); ImageLoader.getInstance().displayImage(url, imageView, options); } /** * 对指定的图片进行圆角处理 * * @param bitmap * 要圆角处理的图片的bitmap信息 * @return 圆角之后的图片的bitmap信息 */ public static Bitmap getRoundedCornerBitmap(Bitmap bitmap) { try { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final RectF rectF = new RectF(new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight())); final float roundPx = 4; paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(Color.BLACK); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); final Rect src = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); canvas.drawBitmap(bitmap, src, rect, paint); return output; } catch (Exception e) { return bitmap; } } /** * 对指定的图片进行旋转处理 * * @param bitmap * 要旋转的图片的bitmap信息 * @return 旋转之后的图片的bitmap信息 */ public static Bitmap rotateBitmap(Bitmap bitmap) { int w = bitmap.getWidth(); int h = bitmap.getHeight(); Matrix mtx = new Matrix(); mtx.postRotate(90);// Setting post rotate to 90 return Bitmap.createBitmap(bitmap, 0, 0, w, h, mtx, true); } }
PHP
UTF-8
2,126
2.890625
3
[]
no_license
<?php namespace CatchOfTheDay\DevExamBundle\Manager; use CatchOfTheDay\DevExamBundle\Model\TodoListItem; use Symfony\Component\Filesystem\Filesystem; class TodoListManager { const DATA_FILE = '@CatchOfTheDayDevExamBundle/Resources/data/todo-list.json'; /** * @var \Symfony\Component\Config\FileLocatorInterface */ private $fileLocator; /** * @param \Symfony\Component\Config\FileLocatorInterface $fileLocator */ public function __construct($fileLocator) { $this->fileLocator = $fileLocator; } /** * @return string */ private function getDataFilePath() { return $this->fileLocator->locate(self::DATA_FILE); } /** * @return \CatchOfTheDay\DevExamBundle\Model\TodoListItem[] */ public function read() { $jsonFile = $this->getDataFilePath(); // TODO - Parse JSON and translate to array of TodoListItem. Hint: TodoListItem::fromAssocArray() $readArr = json_decode(file_get_contents($jsonFile), true); $itemsList = []; if(!empty($readArr)){ foreach($readArr as $key => $itemArr){ $itemObj = TodoListItem::fromAssocArray($itemArr); $itemsList[$key] = $itemObj; } return $itemsList; } else { return $itemsList; } } /** * @param \CatchOfTheDay\DevExamBundle\Model\TodoListItem[] $items */ public function write(array $items) { $jsonFile = $this->getDataFilePath(); // TODO - Serialise $items to JSON and write to $jsonFile. Hint: TodoListItem::toAssocArray() $todoArr = []; if(count($items) > 0){ foreach($items as $itemkey => $todoObj){ $todoItem = $todoObj->toAssocArray(); $todoArr[$itemkey] = $todoItem; } } if(count($todoArr) > 0){ $newJson = json_encode($todoArr); //now insert to file $file = new Filesystem(); $file->dumpFile($jsonFile, $newJson); return true; } return false; } }
Python
UTF-8
566
3.390625
3
[]
no_license
import random def randInt(min=0, max=0): if min == 0 and max == 0: num = random.random() return num if min == 0 and max > 0: num = random.random() * max return num if min > 0 and max > min: num = random.random() * max return num if min > 0 and max > 0: num = random.random() * (max-min) + min return num if min > 0 and max == 0: num = random.random() * 90 + min return num print(randInt()) print(randInt(max=50)) print(randInt(min=50)) print(randInt(min=50,max=500))
Python
UTF-8
1,099
3.90625
4
[ "MIT" ]
permissive
__author__ = Rohit Kamal Saxena __email__ = rohit_kamal2003@yahoo.com """ Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Note that an empty string is also considered valid. Example 1: Input: "()" Output: true """ class Solution(object): def isValid(self, s): """ :type s: str :rtype: bool """ if not s: return True n = len(s) if n % 2 != 0: return False st = [] for i, v in enumerate(s): if v in "({[": st.append(v) continue elif len(st) == 0: return False elif v == ')' and st[-1] != '(': return False elif v == '}' and st[-1] != '{': return False elif v == ']' and st[-1] != '[': return False st.pop() return len(st) == 0
C++
UTF-8
5,962
3.234375
3
[]
no_license
#ifndef MONITOR_HPP #define MONITOR_HPP #include <iostream> #include <vector> #include <algorithm> #include <map> #include <pthread.h> #include <unistd.h> using namespace std; /** * Struct contendo as variáveis de condição para cada um dos 8 personagens do problema. Fazer * um vetor de 8 posições se provou ineficaz por um problema ao enviar o sinal. */ typedef struct conditions { pthread_cond_t c1; pthread_cond_t c2; pthread_cond_t c3; pthread_cond_t c4; pthread_cond_t c5; pthread_cond_t c6; pthread_cond_t c7; pthread_cond_t c8; } conditions; /** * Classe contendo todos os métodos do monitor do forno. Esse monitor é responsável por escolher o próximo * a esquentar a comida, delegar acesso e checar por deadlock. */ class Monitor { public: /** * Método que controla o acesso ao forno. Irá inserir o personagem que pediu acesso na fila de espera, e retirá-lo * quando for selecionado. * * @param {int} id - Identificador do personagem. */ void getLock(int id); /** * Método que libera o forno. Irá também chamar a função para calcular a próxima pessoa a ser selecionada para esquentar * a comida. * * @param {int} id - Identificador do personagem. */ void unlock(int id); /** * Método chamado por Raj quando o mesmo detectou um deadlock. * * @param {int} id - Identificador do personagem selecionado por Raj, randomicamente, para usar o forno. */ void setRajChoice(int id); /** * Método que calcula a próxima pessoa a utilizar o forno. Leva em conta todos os personagens na fila * de espera. */ void calculateNextToUse(); /** * Método que verifica se há deadlock na fila de espera. */ vector<int> checkForDeadlock(); Monitor(); private: /** * Mutex usado para controlar acesso ao forno. */ pthread_mutex_t monitorMutex; /** * Mutex usado para controlar acesso à fila de espera. Duas ou mais threads não podem acessar esse * espaço de memória ao mesmo tempo. */ pthread_mutex_t queueMutex; /** * Mutex usado para controlar acesso ao vetor de todas as threads esperando por um sinal para utilizar o forno. */ pthread_mutex_t waitingMutex; /** * Mutex usado para controlar acesso às variáveis relacionadas com o deadlock. */ pthread_mutex_t deadlockMutex; /** * Variável de condição que será sinalizada quando Raj achar um deadlock. O sinal será aguardado no cálculo do próximo * personagem a utilizar o forno. */ pthread_cond_t deadlockConditional; /** * Escolha do Raj quando um deadlock for encontrado. */ int rajChoice; /** * Booleano que indica se a função que calcula o próximo personagem a usar o forno encontrou um deadlock e está esperando * por um sinal de Raj. */ bool isWaitingForDeadlockSignal; /** * Variável que diz se o forno está sendo utilizado por algum personagem. */ bool isOvenBusy; /************************************************ * Threads conditional variables ***********************************************/ /** * Variáveis de condição dos 8 personagens. Todos esperarão um sinal antes de começar a utilizar o forno. */ conditions threadsCondition; /** * Método de inicialização das variáveis de condição. */ void initializeConditions(); /** * Método que irá aguardar por um sinal na variável de condição do personagem passado como parâmetro. * * @param {int} id - Identificador do personagem. */ void waitSignal(int id); /** * Método que emitirá um sinal para a variável de condição do personagem passado como parâmetro. * * @param {int} id - Identificador do personagem. */ void signalCondition(int id); /************************************************ * Queue ***********************************************/ /** * Fila de espera para utilizar o forno */ vector<int> queue; /** * Método que retorna o tamanho da fila da espera. */ int getQueueSize(); /** * Método que retorna o primeiro elemento da fila da espera. */ int queueGetFirstElement(); /** * Método que insere um elemento na fila da espera. * * @param {int} id - Identificador do personagem. */ int queuePushBackElement(int id); /** * Método que remove o elemento passado como parâmetro da fila de espera. * * @param {int} id - Identificador do personagem a ser removido da fila. */ void queueEraseElement(int id); /************************************************ * Waiting signal queue ***********************************************/ /** * Vetor representando quais personagens estão esperando um sinal em sua variável de condição para * começar a utilizar o forno. waitingSignal[i] = true se, e somente se, o personagem cujo identificado é i * está esperando por um sinal de sua variável de condição. */ vector<bool> waitingSignal; /** * Método usado para definir que um personagem está esperando pelo sinal. * * @param {int} id - Identificador do personagem que está agora esperando pelo sinal. */ void setWaitingSignal(int id); /** * Método usado para definir que um personagem não está mais esperando pelo sinal. * * @param {int} id - Identificador do personagem. */ void unsetWaitingSignal(int id); /** * Método que bloqueia a execução do código enquanto o personagem passado como parâmetro não estiver esperando * por um sinal para usar o forno. * * @param {int} id - Identificador do personagem. */ void waitForIdListening(int id); }; #endif
C++
ISO-8859-1
738
3.90625
4
[]
no_license
/*6. Escribe un programa que defina un vector de nmeros y calcule si existe algn nmero en el vector cuyo valor equivale a la sula del resto de nmeros del vector.*/ #include <iostream> #include <conio.h> using namespace std; int main() { int numeros[5] = {1, 2, 3, 4, 10}; int suma = 0, mayor = 0;; for(int i = 0; i < 5; i++) { suma += numeros[i]; if(numeros[i] > mayor) { mayor = numeros[i]; } } if(mayor == (suma - mayor)) { cout << "El numero " << mayor << " equivale a la suma de los demas"; } else { cout << "No existe ningun numero que sea igual a la suma de los demas"; } getch(); return 0; }
Python
UTF-8
3,486
2.890625
3
[]
no_license
import sys import os SPARK_HOME = "/spark" # Set this to wherever you have compiled Spark os.environ["SPARK_HOME"] = SPARK_HOME # Add Spark path os.environ["SPARK_LOCAL_IP"] = "127.0.0.1" # Set Local IP sys.path.append( SPARK_HOME + "/python") # Add python files to Python Path sys.path.append( SPARK_HOME + "/python/lib/py4j-0.10.9-src.zip") # Add python files to Python Path import numpy as np from pyspark import SparkConf, SparkContext from pyspark.mllib.regression import LabeledPoint import math def getSparkContext(): """ Gets the Spark Context """ conf = (SparkConf() .setMaster("local") # run on local .setAppName("Logistic Regression") # Name of App .set("spark.executor.memory", "1g")) # Set 1 gig of memory sc = SparkContext(conf = conf) return sc def mapper(line): """ Mapper that converts an input line to a feature vector """ feats = line.strip().split(",") # labels must be at the beginning for LRSGD label = feats[len(feats) - 1] _feats = feats[: len(feats) - 1] _feats.insert(0,label) features = [ float(feature) for feature in _feats ] # need floats #return np.array(features) ff = LabeledPoint(features[0],features[1:] ) return ff sc = getSparkContext() # Load and parse the data data = sc.textFile("data_banknote_authentication.txt") parsedData = data.map(mapper) # split whole data into training & testing set train,test = parsedData.randomSplit((0.9,0.1)) # Train model #model = LogisticRegressionWithSGD.train(train) iteration = 1300 length = train.count() update_rate = 0.02 def sigmoid(num): return float(1/(1+math.exp(-1*num))) def calculate(each): """ wx = (w * each.features) _z = wx.sum() yhat = sigmoid(_z) """ yhat = predict(each) loss = yhat - each.label #grad.append(loss*yhat*(1-each.label)) grad =loss*each.features #loss*yhat*(1-each.label)*each.features grad = np.insert(grad,0,loss*yhat*(1-each.label)) return grad def predict(each): wx = (w[1:] * each.features) _z = wx.sum() + w[0] yhat = sigmoid(_z) return yhat def test_predict(each): num = predict(each) if num>0.5: yhat= 1 else: yhat = 0 return (yhat,each.label) w = [0.0] * (len(parsedData.first().features)+1) #with bias for i in range(iteration): gradRDD = train.map(calculate) sum_grad = gradRDD.reduce(lambda a,b:a+b) w = w - update_rate* sum_grad/length update_rate = update_rate* 0.999 #print(i,'w ',w) # Predict the first elem will be actual data and the second # item will be the prediction of the modeli labelsAndPreds = test.map(test_predict) testErr = labelsAndPreds.filter(lambda (p,t): t!=p ).count() one = test.filter(lambda each: each.label==1 ).count() test_len =labelsAndPreds.count() # Print some stuff #print("total sample in training set ",test_len) #print("training Error item = " , testErr ) print("training Error rate = " ,float( 1.0*testErr/test_len )) labelsAndPreds = train.map(test_predict) testErr = labelsAndPreds.filter(lambda (p,t): t!=p ).count() one = test.filter(lambda each: each.label==1 ).count() test_len =labelsAndPreds.count() # Print some stuff #print("total sample in training set ",test_len) #print("training Error item = " , testErr ) print("training Error rate = " ,float( 1.0*testErr/test_len ))
SQL
UTF-8
877
2.78125
3
[]
no_license
CREATE TABLE news ( id INT NOT NULL AUTO_INCREMENT, title VARCHAR(100), link VARCHAR(100), image VARCHAR(100), likecount INT, commentcount INT, createddate DATE, userId INT, PRIMARY KEY ( id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE user ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100), password VARCHAR(256), salt VARCHAR(100), head_url VARCHAR(256), PRIMARY KEY ( id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE loginticket ( id INT NOT NULL AUTO_INCREMENT, userId INT, expired Date, status INT, ticket VARCHAR(256), PRIMARY KEY ( id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8;
Java
UTF-8
3,606
2.96875
3
[]
no_license
package com.nigiri.pokeapp.Utils; import com.nigiri.pokeapp.Models.Monster; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class DatabaseConnection { Connection db; public DatabaseConnection() { try { this.db = DriverManager.getConnection( "jdbc:postgresql://localhost/pokeMaven", "postgres", "password"); } catch (Exception e) { System.err.println("Could not connect!"); } } public Monster makeAMonster(int pokemonID, int level, String name) { String query = "SELECT * FROM pokemon where number = " + pokemonID; return getMonster(level, query, name); } public Monster makeAMonster(int pokemonID, int level) { String query = "SELECT * FROM pokemon where number = " + pokemonID; return getMonster(level, query); } public Monster makeAMonster(String pokemonName, int level, String name) { String query = "SELECT * FROM pokemon WHERE pokemon.name = " + "'" + pokemonName + "'"; return getMonster(level, query, name); } public Monster makeAMonster(String pokemonName, int level) { String query = "SELECT * FROM pokemon WHERE pokemon.name = " + "'" + pokemonName + "'"; return getMonster(level, query); } private Monster getMonster(int level, String query, String name) { try { Statement stmt = db.createStatement(); ResultSet results = stmt.executeQuery(query); results.next(); return new Monster( results.getInt("HP"), results.getInt("Attack"), results.getInt("Defense"), results.getInt("Special"), results.getInt("Speed"), results.getInt("typeOne"), results.getInt("typeTwo"), level, name, results.getString("name"), results.getInt("ID")); } catch (Exception e) { System.err.println("Couldn't create pokemon"); return new Monster(0, 0, 0, 0, 0, 0, 0, 0, "missingNo", 0); } } private Monster getMonster(int level, String query) { try { Statement stmt = db.createStatement(); ResultSet results = stmt.executeQuery(query); results.next(); return new Monster( results.getInt("HP"), results.getInt("Attack"), results.getInt("Defense"), results.getInt("Special"), results.getInt("Speed"), results.getInt("typeOne"), results.getInt("typeTwo"), level, results.getString("name"), results.getInt("ID")); } catch (Exception e) { System.err.println("Couldn't create pokemon"); return new Monster(0, 0, 0, 0, 0, 0, 0, 0, "missingNo", 0); } } public boolean isValidPoke(String pokename) { String query = "SELECT * from pokemon where pokemon.name = '" + pokename + "'"; try { Statement stmt = db.createStatement(); ResultSet resultSet = stmt.executeQuery(query); resultSet.next(); return resultSet.getString("name") != null; } catch (Exception e) { System.err.println("Sorry, that is not a valid pokemon name."); return false; } } }
PHP
UTF-8
698
2.71875
3
[]
no_license
<?php namespace antidrop; use pocketmine\event\Listener; use pocketmine\event\player\PlayerDropItemEvent; use pocketmine\plugin\PluginBase; class Main extends PluginBase implements Listener { public function onEnable() { $this->getLogger()->notice("[ Anti Drop ] activé ! - Par UnNyanCat"); } public function onDisable() { $this->getLogger()->notice("[ Anti Drop ] désactivé - Par UnNyanCat"); } public function onDrop(PlayerDropItemEvent $event){ $player = $event->getPlayer(); $item = $event->getItem(); if($item->getId() == 1){ $event->setCancelled(true); $player->sendMessage("Vous ne pouvez pas lancer l'objet : item1"); } } }
C++
UTF-8
427
2.640625
3
[]
no_license
#include <util.hpp> namespace masys { u32 itoa( u32 n, char * dst, u8 base ) { u32 l = 0; if ( n == 0 ) { dst[0] = '0'; ++l; } while ( n > 0 ) { u8 d = n % base; for ( int i = l; i > 0; --i ) dst[ i ] = dst[ i - 1 ]; dst[ 0 ] = d + ( d > 9 ? 'a' - 10 : '0'); n /= base; ++l; } dst[ l ] = 0; return l; } } /* masys */
Markdown
UTF-8
1,042
2.625
3
[]
no_license
## Part 5: Pipline and Dockerize ### Author: Yuning Song ### 1. [pipline.py](https://github.com/kinyang007/INFO_6105/blob/master/Assignment2/Part5/pipeline.py) * Make the output of the get_learning_data.py as the input of the logistic_regression.py automaticly using luigi * Input: * [fintech_related_keywords.csv](https://github.com/kinyang007/INFO_6105/blob/master/Assignment2/Part2/csv/fintech_related_keywords.csv) * [top_100_key_words_with_jobs.csv](https://github.com/kinyang007/INFO_6105/blob/master/Assignment2/Part1/top_100_key_words_with_jobs.csv) * Output: * [result.txt](https://github.com/kinyang007/INFO_6105/blob/master/Assignment2/Part3/result.txt) *This part of code should run under the luigi environment and the connection with localhost:8082 ### 2. Dockerize the pipline and push it to the docker hub. * Download and install docker environment. Create a container to run both the localhost and the pipline application. * [My Docker Hub](https://cloud.docker.com/repository/registry-1.docker.io/shadder2k/info6105)
Markdown
UTF-8
2,279
2.96875
3
[]
no_license
--- title: sqlalchemy批量插入的坑 date: 2016-10-14 23:20:42 tags: python --- 默认提供的bulk_save_objects是在一次事务中提交多次save 需求:一个sql语句插入多个实体 直接上代码 models.py from sqlalchemy import (Column, String, DateTime, UnicodeText, BigInteger, Boolean, Integer, Text, Float) from sqlalchemy import TypeDecorator from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class People(Base): """ people类 """ __tablename__ = 'people' id = Column(Integer, primary_key=True, unique=True, index=True, autoincrement=False) name = Column(String(100)) age = Column(Integer, default=0) add_time = Column(DateTime, default=datetime.now, nullable=False) #注意 sqlalchemy字段默认可以为空,和django model相反 views.py value_list = [] dict_list = [] people1 = People() people2 = People() value_list.append(people1) value_list.append(people2) for item in value_list: item_dict = item.__dict__ if "_sa_instance_state" in item_dict: del item_dict["_sa_instance_state"] dict_list.append(item_dict) engine = create_engine('mssql+pymssql://user:password@127.0.0.1:1433/data') DBSession = sessionmaker(bind=engine) session = TWDBSession() session.execute(timeline.__table__.insert(dict_list)) session.commit() 这里有个巨大的坑,如果people中任何一个实体没有某个字段,则即使其他实体有该字段也无法将该值插入到数据库中, 如下代码: people1 = People() people1.name = "bobby1" people2 = People() people2.name = "bobby1" people2.age = 3 #注意people1没有设置age字段, 则在批量插入的时候, people1和people2都在数据库中都没有age字段。 解决办法: 加上people1.age = None 具体原因还没有看源码,以后有时间再研究 最后欢迎大家观看我关于 django + xadmin的教程: http://coding.imooc.com/class/evaluation/78.html
SQL
UTF-8
110,583
2.765625
3
[]
no_license
# ************************************************************ # Sequel Pro SQL dump # Version 5446 # # https://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: 127.0.0.1 (MySQL 8.0.23) # Database: Weather_and_Music # Generation Time: 2021-04-14 15:35:43 +0000 # ************************************************************ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; SET NAMES utf8mb4; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; # Dump of table audio_features # ------------------------------------------------------------ DROP TABLE IF EXISTS `audio_features`; CREATE TABLE `audio_features` ( `id` varchar(40) NOT NULL, `track_name` varchar(40) DEFAULT NULL, `valence` float DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; LOCK TABLES `audio_features` WRITE; /*!40000 ALTER TABLE `audio_features` DISABLE KEYS */; INSERT INTO `audio_features` (`id`, `track_name`, `valence`) VALUES ('','Fever (avec Angèle)',NULL), ('00ETaeHUQ6lops3oWU1Wrt','Hot Stuff',0.429), ('00PesUdTmC3Y5xtZbZND0p','Hard For Me',0.158), ('017PF4Q3l4DBUiWoXk4OWT','Break My Heart',0.467), ('02OpQWSd5wOAO0dYTIpoKl','BrokEn',0.44), ('02y9ciX9JY6pAR0q0cWhSD','Habibi',0.567), ('04luhZs8xjkIoDqAUidg79','La Rose Et L\'armure',0.225), ('06eEMrvlkBmLLaezDSDcEl','A Vava Inouva',0.432), ('06O3hxudc6V0BOuoCFSy71','Tout oublier',0.285), ('079OwtobI8CKoSUbVYKBey','À côté de toi',0.671), ('07JoaFTGT3QGuPn5EuusCZ','C\'Était Le Rap',0.61), ('07Oz5StQ7GRoygNLaXs2pd','Good As Hell',0.478), ('08bNPGLD8AhKpnnERrAc6G','Friends',0.534), ('08qp0YWWVUdqn5Aa2LOcuE','Toutes les machines ont un coeur',0.307), ('09WkK0MhHkBVH0GZ6gLmoE','Facile',0.676), ('0AUvWawuP0ibk4SQ3sIZjk','Daisy',0.774), ('0AvrSFPS8mN8OjUNCwemwa','Filon',0.404), ('0BD9boQC7jUTWkAoib4Z0d','Melegim',0.57), ('0bYg9bo50gSsH3LtXe2SQn','All I Want For Christmas Is You',0.35), ('0cSNN4fgW1RFDQV58eVRKK','Summer Is a Curse',0.425), ('0d28khcov6AiegSCpG5TuT','Feel Good',0.772), ('0dixaX03wQULd5oDRegfUL','N\'attendons pas',0.712), ('0F7FA14euOIX8KcbEturGH','Old Town Road',0.507), ('0GNI8K3VATWBABQFAzBAYe','Stay',0.125), ('0GWYApQBwErVPkyXYCTJjI','React',0.544), ('0H4ugk6rhnXmTl47ayy9O5','Daechwita',0.223), ('0hGKNE4OiaH890jUAkF4zY','Jusqu\'À Mon Dernier Souffle',0.398), ('0hPK1K6ttXf5KLjUjAUwGz','L\'âme dans l\'eau',0.17), ('0i0hqOQdyFFd4cR5s32w8x','Boy In Luv',0.473), ('0J2p4KYdr6Mg4ET6JPlbe1','Super Trouper',0.961), ('0JNZGIavoUrdup1NsgJOQs','Alabama Song',0.901), ('0JP9xo3adEtGSdUEISiszL','Moon',0.711), ('0KBwGCY9RYD9t2zjeW4h48','Djomb',0.631), ('0KKIdDRSfwZVDIJUnx9jL5','La rumeur',0.716), ('0l7iZcjZCLTBA5DXIJYDY1','Comme c\'est bon',0.615), ('0lx2cLdOt3piJbcaXIV74f','willow',0.529), ('0MHXrqn909p0LRTPsNsGEi','Move On Up',0.928), ('0moO0eGbUWazDoK02JeeXs','Baby It\'s You',0.119), ('0n2moJpAEWHwaPYYjkzMDl','Blue & Grey',0.364), ('0nbXyq5TXYPCO7pr3N8S4I','The Box',0.642), ('0NVFkXUf2tyFKSkpBZOkRm','Que mon coeur lâche',0.553), ('0ofHAoxe9vBkTCp2UQIavz','Dreams',0.789), ('0oHUBAmUVHjbMDNx0vNPi4','Dolce vita',0.636), ('0OlE17VM4jDcmQb96RqxcX','Encore',0.786), ('0ono6UCNVZ1XqOm6j78Blu','Filter',0.86), ('0PXukVbYpvz40KcEFKnIw7','Don\'t Rush',0.324), ('0pYacDCZuRhcrwGUA5nTBe','eight',0.594), ('0QaVAoRnez6qMlLPqbB4fd','On fait comme si',0.172), ('0QPlafvsnmTJBvGNek2cI8','Ça Fait Des Années',0.527), ('0qprlw0jfsW4H9cG0FFE0Z','Cold Little Heart',0.153), ('0RUavidTwACAYUoNhAxNNp','N\'y pense plus',0.44), ('0sfdiwck2xr4PteGOdyOfz','Shot In The Dark',0.822), ('0t1idbwF54o2DdiM4Qz2SV','Kubrick - 3 Films - 4k',0.177), ('0U0ldCRmgCqhVvD6ksG63j','Nightcall',0.361), ('0USQrLiSMnzlaoMKkgIaT6','Désolé pour hier soir XXV - Remix 2020',0.689), ('0VjIjW4GlUZAMYd2vXMi3b','Blinding Lights',0.334), ('0W44nIsrStSC7Hvf626pvh','Transmission',0.119), ('0w6webWdhjRKdqJ3DeGgM1','Stats',0.172), ('0wlSyBOMoRhBrshW1C7TGr','Barracuda I',0.0947), ('0xQQVapVkWYbatSPnnh6el','7Ème Continent',0.193), ('0y1QJc3SJVPKJ1OvFmFqe6','Way Down We Go',0.337), ('0y7lBqpOH32F12NitTHL4S','Les feux d\'artifice',0.0813), ('0yKrEJvEwJhWe9HUwg1puw','Dans Mes Bras',0.775), ('0YU17F0BlVXvmx5ytsR43w','Monster',0.607), ('0Z8DRG0HgZJ1bIhCQqyzPo','Coeur Noir',0.457), ('11ajcVj3qSyyMPUpTJUP3y','Protect The Land',0.248), ('127QTOFJsJQp5LbJbu3A1y','Toosie Slide',0.837), ('18GOglIwbhTMxON307ln4H','Mon refuge',0.747), ('18HNGxDOcshRU2Hdu8tMOM','Popopop',0.413), ('19ZitU4vAGoAVYS7V0D2J1','Comment est ta peine ?',0.543), ('1aKuG1GG76xPLUkjBbQo3W','UGH!',0.333), ('1cSaqhkvwepFfxlPFtSoTb','Malheur, Malheur',0.504), ('1Cv1YLb4q0RzL6pybtaMLo','Sunday Best',0.694), ('1eg2GUAxtsngVbrylDQ4tO','Je Reviens Te Chercher',0.193), ('1eISthH1NcavO1m4qtk5uA','One',0.228), ('1fS7TxIKa8PpWEOJMK8PAG','A.I.E. (A\'Mwana)',0.919), ('1GTFU5LWvgyVf9Dno5199s','Shut up Chicken',0.671), ('1Jaah2tmN9Hv81A87KZ1MU','Torn',0.609), ('1jDJFeK9x3OZboIAHsY9k2','I\'m Still Standing',0.772), ('1jL5Uf9T93w7Ge9k2leUdB','Les Gens',0.822), ('1JLiWwAySe34RQ1P6JoEgI','Tristana',0.526), ('1KixkQVDUHggZMU9dUobgm','My Head & My Heart',0.436), ('1kYjNPTvZ8G68dYTkG3BqD','Nous',0.629), ('1Lulg5ZiMEXy3QNwb1PB8I','Zipette',0.72), ('1malvU2QXTWKhVbQaCsCnE','Le Jeu',0.401), ('1N4ixxhbBH1ClnPdTTsRzz','Aline',0.519), ('1nzFfwPVH9Hyt7BFtxdBdS','Gros Vendeurs',0.36), ('1P37gwlsx2ghfr8tGzJsRE','Ça m\'énerve',0.679), ('1PA1LTNLAJrbJPWPxEFQvD','1ère fois',0.78), ('1Pmp486RrLRkaEkE3HFHXP','Who\'s Laughing Now',0.505), ('1qrpoAMXodY6895hGKoUpA','You Belong',0.474), ('1Ri9P0ZPrqr6h0REDRdJBd','Oh Santa!',0.849), ('1RighqmKZNqLP9rklJ4HCz','Le coach',0.834), ('1Sb7QJRawbARgpMqyYNMkT','Distant',0.447), ('1sRQzflFI4OooCN1dQK9NG','Dilemme',0.378), ('1SSoLdnoptUGfs5kwgVQms','Horizons Into Battlegrounds',0.0993), ('1sviDBcAqVOxMXq4xITVEs','Que Calor',0.46), ('1TfqLAPs4K3s2rJMoCokcS','Sweet Dreams (Are Made of This)',0.875), ('1U7wXZmCTsOF3GLJJlV1vl','Stupid Love',0.784), ('1UvYiDcJVolpUAQWpwrxNw','Goulag',0.551), ('1v7L65Lzy0j0vdpRjJewt1','Lose Yourself',0.0596), ('1veiLBp9DEZ5qUV8yBjDml','Donnez-moi',0.662), ('1vxw6aYJls2oq3gW0DujAo','Crazy',0.64), ('1WEIE2px011rGQpYfXottY','Blue Moon Rising Ep',0.321), ('1WnF8aQf2WezWlJIpslJ7m','beau-papa',0.482), ('1wraUfjeUvBskSGtJrm21J','Rare',0.637), ('1x5sYLZiu9r5E43kMlt9f8','Symphony',0.457), ('1XcnxfOeLvLPGh2Drr2yNb','Bella Ciao',0.602), ('1xQ6trAsedVPCdbtDAmk0c','Savage',0.761), ('1xugsCboIm1yILqpLvH9aD','You Raise Me Up',0.0981), ('1yoMvmasuxZfqHEipJhRbp','Hawái',0.558), ('1yvMUkIOTeUNtNWlWRgANS','Unstoppable',0.26), ('202DfCIz0fZV2SVhUNnIi4','Thirteen Thirtyfive',0.36), ('21MChSGdLldUOOaOCdWmzD','I Love Me',0.712), ('249gnXrbfmV8NG6jTEMSwD','Life Goes On',0.45), ('24Yi9hE78yPEbZ4kxyoXAI','Roses',0.898), ('24ySl2hOPGCDcxBxFIqWBu','Rain On Me',0.646), ('260GXOGpTNlVu0nqBgcZlh','Bien sûr',0.246), ('27jzdLZg3naniynbrXi8yE','Les yeux de la mama',0.414), ('27u7t9d7ZQoyjsCROHuZJ3','Tick Tock',0.946), ('27ycaQnQAxaPiyeg3nr2aB','Midnight Sky',0.259), ('2Aa9Z2lnyCrLJqMwPQg6dO','Devant soi',0.319), ('2alc8VZAzDgdAsL2QMk3hu','Skechers',0.274), ('2AwQnGx2eLQIKGub1mjcrD','J\'y vais',0.302), ('2BwQ6Qizq49QKAmcNgjNJL','Faut Pardonner',0.456), ('2cKovq3l6OJjhVVDbVKOsr','The Other Side',0.31), ('2diEeH1DjfrYGRlXENLkdY','Gotaga',0.342), ('2DnnTFkreV0FtinIYGHDb9','Revival',0.753), ('2ez6qvOTHKeI3ss80NGqnI','Trampoline',0.498), ('2FVpOsjT1iquZ3SpCjZ9Ne','Telepathy',0.57), ('2Fxmhks0bxGSBdJ92vM42m','Bad Guy',0.562), ('2fZPJHGEBOT69cN0xungBj','Les Marionnettes',0.746), ('2G2YzndIA6jeWFPBXhUjh5','Be My Baby',0.818), ('2gNyCHDGyHrw3lCpT9LqlY','Pourvu qu\'elles soient douces',0.93), ('2hwxHtaQRwgDigEkHbR3Zg','Vivre Pour Le Meilleur',0.25), ('2imLYhuE0rBYnSrhXDOaRX','Ninja',0.641), ('2iXcvnD3d1gfLBum0cE5Eg','Tutti Frutti',0.937), ('2JO3HwMRPeya8bXbtbyPcf','Love Will Tear Us Apart',0.909), ('2jX5c5RFp0A9E1GDsvGxIa','Balance ton quoi',0.381), ('2kUXqI4t2eLYqCh7Z8guP1','Jusqu\'au bout',0.68), ('2MbgQKWhoii8bqsMBWWWgA','Courage to Change',0.11), ('2MHUcKjtFneRCpKeUN1eCN','C\'est Magnifique',0.347), ('2MlOUXmcofMackX3bxfSwi','Jerusalema',0.827), ('2Nib4r0saYQf2pUV4RFDhl','Interlude : Shadow',0.141), ('2p8IUWQDrpjuFltbdgLOag','After Hours',0.143), ('2PrzyVdwaZTFVzhIbUbYh4','Allô téléphone',0.762), ('2q5qVYEWK5LcG35JfSlYYx','Swimming In The Stars',0.521), ('2qbw3lSGERDdUawZ736wmN','Baby Love D.c.',0.715), ('2qH3Ulxrpemyt2ZIjlSJ7J','Respire',0.366), ('2QpUWi6VSNOt2WyH5FIeLD','Pookie',0.533), ('2QSAj76Ba6aMFX9RlXdUdO','J\'ai demandé à la lune',0.619), ('2qzUpSVI4NnPyWxbXwumTj','BLACK PARADE',0.0611), ('2rbDhOo9Fh61Bbu23T2qCk','Always Remember Us This Way',0.296), ('2RGQvREPnf6uRNsyCcwtvy','Sans logique',0.893), ('2rkw1gqH62Tc9ydm9jsEJ1','Tous Les Cris Les S.O.S',0.404), ('2rWeNybwVZTWEbkb9JOjcz','People, I\'ve been sad',0.221), ('2slqvGLwzZZYsT4K4Y1GBC','Only The Young',0.602), ('2tnVG71enUj33Ic2nFN6kZ','Ride It',0.884), ('2twcZTB1udOEzDCPpTiOju','Mais je t\'aime',0.209), ('2u6Jm2klS4yvAlbSHlxUwI','Alane',0.662), ('2UC5XnHA1Wn9FjQmbjNca9','L\'aventurier',0.633), ('2vBET2pmrQqafaS6zIaYta','Girl Like Me',0.318), ('2vruJV9zbgg0CE1x14vVFW','Reste',0.695), ('2VxeLyX666F8uXCJ0dZF8B','Shallow',0.323), ('2WfaOiMkCvy7F5fcp2zZ8L','Take On Me',0.876), ('2wgxi49lLbb0gawT0BEOuH','Tout ce qu\'on veut dans la vie',0.534), ('2XlLHcTNLBkxqCdKasBrRM','Bobo Au Coeur',0.544), ('2XU0oxnq2qxCpomAAuJY8K','Dance Monkey',0.513), ('2ygvZOXrIeVL4xZmAWJT2C','my future',0.0875), ('2yTH2kLPOR2Hin61Qcdovr','Mauvais Djo',0.587), ('2ZTYlnhhV1UAReg7wIGolx','To Die For',0.307), ('2ZUJj80Mfmj13MKJXf9pnP','Matches',0.817), ('2zYzyRzz6pRmhPzyfMEC8s','Highway To Hell',0.423), ('301e5NlZjS5o5Z8BXO1AXS','Puisque tu pars',0.122), ('31H6au3jhblhr6MMJiXnCq','Hungry Eyes',0.552), ('33NTeQz7sVYLmkJ1k8GsVR','Bim Bam Toi',0.467), ('35gJuqfvrdlCA2MmAtaD3J','Mamacita',0.559), ('35mvY5S1H3J2QZyna3TFe0','positions',0.682), ('364dI1bYnvamSnBJ8JcNzN','Intentions',0.86), ('38zsOOcu31XbbYj9BIPUF1','Your Song',0.325), ('399mh97iAmjU34de5MebHp','Tom',0.546), ('39EXZNMxb4RBHlRjnRaOKp','Sweet Night',0.149), ('39Yp9wwQiSRIDOvrVg7mbk','The Scotts',0.28), ('3AtPpsOe8qQHtDdFywaWyY','Amour Censure',0.633), ('3AzjcOeAmA57TIOr9zF1ZW','Physical',0.746), ('3b89BehicGUgc60pLBo092','Flou',0.468), ('3Be7CLdHZpyzsVijme39cW','What\'s Love Got To Do With It',0.617), ('3bkkMZEAhx7rTVz1C0itRQ','Black Swan',0.49), ('3CdDFnkFxwd6mPZtTR9JzN','M.I.L.S 3',0.408), ('3DKpA54hrFIdPN6AtL9HXa','I\'ll Never Love Again',0.25), ('3Dv1eDb0MEgF93GpLXlucZ','Say So',0.786), ('3eqwBUWgebO3QOkyNhAXrD','Va dire à ton ex',0.645), ('3FGiFUJRRp5RGikVrs6kig','Underdog',0.301), ('3i8GllbdGuwIXaVrlIoE0r','What Do You Think?',0.136), ('3iXgSRk7u8qcnM5xOsxyVw','I\'m On My Way',0.738), ('3iXhLi33EpUfcOwasC8un1','Ta reine',0.127), ('3KW4lmROWaAg0sQlBHRzW7','Pompeii',0.223), ('3LAeNhaSAvEvkUvMhkQQIG','Il Mio Rifugio',0.287), ('3MxX4ISqkBaNCSHULKHXTx','Chelou',0.678), ('3o8cpHgLK9x0G5eB1UusOQ','Yé ké yé ké',0.547), ('3oI0TV5oIDrgKmYnI908uW','X',0.261), ('3op7HNwLli54MBjFGzIlZO','Louder Than Bombs',0.485), ('3PfIrDoz19wz7qK7tYeu62','Don\'t Start Now',0.679), ('3Q76RJ43ot3GrOSW8tE2MQ','Ma sœur',0.631), ('3QH8rQGNFX8VLbCgZ7uPTS','Fly To My Room',0.588), ('3qnd4BIjwJtIwjhrAQOppE','Back On My Feet',0.499), ('3r9FFjLrAIQjoR8pSHVPC9','Outro : Ego',0.473), ('3rfDjFBGWeDW88inQfLzmm','Nue',0.961), ('3RkKeT2ALw3OBUhFllxxjF','Dernier métro',0.533), ('3s6ltUrI93LBKU8taezsLn','Magic',0.884), ('3Sg3bOiD0kE4D5DcXk48Ds','Genocidal Humanoidz',0.0977), ('3TZ7NHkMT82AhwuYsd00Hz','Your Eyes Tell',0.258), ('3TZwjdclvWt7iPJUnMpgcs','Jump Around',0.818), ('3U34tMYhMbr6tBWZdCUp6f','La Vida Tombola',0.963), ('3uR5fLv1di1Nxal4lV50CU','Californian Soil',0.172), ('3v5HUAz7UsmplamYrOxEz2','Succès fou',0.164), ('3V6NCwBywAwpAlAyGL7h0p','Doudou',0.697), ('3wS2dXzQw58b1e3AR8YStR','Interlude : Set Me Free',0.207), ('3x5ZzNhmXSgKjM3wl0UGgD','Plus Grandir',0.886), ('3xbws1uOAaxeTPEviKWONY','Ça va ça vient',0.544), ('3Ys2PYl1wyPKQIwyqhP9cQ','Stay Gold',0.582), ('3zbZNJ1yewL5HqjvIEjjUD','Folie',0.689), ('3ZCTVFBt2Brf31RLEnCkWJ','everything i wanted',0.243), ('3ZjkQbe5JzzQbzRtkXyZNv','Love To Go',0.46), ('41A89rj3GoMG6ktN37L7PG','Alice',0.323), ('41mbANHqOIULPmYi5Hp4ey','Derrière Le Brouillard',0.229), ('41zXlQxzTi6cGAjpOXyLYH','idontwannabeyouanymore',0.247), ('42WlUYoPW2cJ08p9FZv2LC','Fait D\'or',0.468), ('44W3PGV0HOeAGBkxwPc98S','Donne-moi ton Cœur',0.293), ('44WLOqH7QayQOQdeUHeKUK','We Are Bulletproof : The Eternal',0.19), ('45UVzUVdOmTXVkkaGp0eeG','quelque chose',0.689), ('47LFcy7prvEY5D08d26zOo','40%',0.678), ('49IzWufYtbt3tgUN8ORNe0','Préféré',0.631), ('4AlihYDqxXshKhvh5tnMfP','00:00 (Zero O’Clock)',0.196), ('4BKOjYosPhw334moS3wlbO','Inner Child',0.332), ('4dGduWL29no2tupqBsW12I','The Makarrata Project',0.256), ('4DOZJGlIU37McIF7prMcWv','Anyone',0.584), ('4dtITJAraRpBBaNvfpAMXO','Intro (m.i.l.s 3)',0.277), ('4Eefey3uN90Abhbr47zKmC','Winter Flower',0.241), ('4ffoWIfe9UWfyuJT5I0I7L','Les mots bleus',0.431), ('4fW3EMRzAfj8aNMsF3zMwt','Jauné',0.655), ('4FXO1gRCfRKJOqIKxElQSy','Nos coeurs à la fenêtre',0.24), ('4GVwjLRT7oSsKby7Vy8EHr','Skit',0.544), ('4h3SqMd5F16XJVdGp5fsZG','A nos souvenirs',0.455), ('4HBZA5flZLE435QTztThqH','Stuck With U',0.537), ('4hCHnvepjWmpP2kgYuEC7d','Calumet',0.392), ('4HlDJ6SM3DyZ7KAp1oS8le','Si t\'es pas là',0.282), ('4iNPp0BZ4lBu7bipdWLcWk','Avant toi',0.246), ('4ISzA5zhHdncqZa4zkIQYZ','Goliath',0.147), ('4IxLPU4pNd30IzINN1DU1o','Blue Nocturne',0.24), ('4JDjZ2AzlHnde5uUy0TveV','Realize',0.22), ('4Jn63SJwKLr55PdUXlD205','The Best in Me - Eurovision France 2020',0.202), ('4kTF7OQVjTSZ5zdRqo8zxx','Dieu Merci',0.825), ('4mt7C6wYeTUWDDk7xKym9w','Feel Me',0.392), ('4Ngeca4zs304bDnDh3pjzI','Un été français',0.649), ('4NhDYoQTYCdWHTvlbGVgwo','Gooba',0.393), ('4nkHvkwaYMzGxorVldkGd3','Mourir Sur Scène',0.769), ('4oLp7k4fINGrjuNxElKKGw','La Zone',0.414), ('4poybupy26pTWPr9zY1i7h','Some Say',0.482), ('4qDRw32NwvsGhQ4a9evbMm','Centre Commercial',0.628), ('4R2kfaDFhslZEMJqAFNpdd','Cardigan',0.551), ('4rMIWVinfurrct4MG6n7sn','Pour les Gens Du Secours',0.278), ('4saklk6nie3yiGePpBwUoc','Dynamite',0.737), ('4SFknyjLcyTLJFPKD2m96o','How You Like That',0.344), ('4TjnO2vIsXNGBhlzovPIQB','Pharmacist',0.155), ('4TM0Air5YJq7pIfsm4nafL','Imbécile',0.728), ('4TnjEaWOeW0eKTKIEvJyCa','Falling',0.236), ('4u7EnebtmKWzUH433cf5Qv','Bohemian Rhapsody',0.224), ('4UNffdkJafgeDFxr54iky3','Combien De Murs',0.502), ('4uqh9bualXNHXXwO2wPorc','Daisies',0.149), ('4VgYtXCVJ7IbWAZ5ryfvEQ','Muévelo',0.919), ('4vLs3Gatchl0AjJv7w1WGe','La face cachée',0.438), ('4VnY4807mGuFEUKBs0UVg0','Strange',0.961), ('4VpkCmCnqgcUcysgHdTbYf','One Minute You\'re Here',0.193), ('4vTgx6h4seHvkuFh84JXYP','My Time',0.664), ('4vWalWi55l3pa9zh4X7NBx','En Chien',0.66), ('4wNIkl5XGiAACjFBlDWuSd','What A Man Gotta Do',0.324), ('4Ws314Ylb27BVsvlZOy30C','Lovesick Girls',0.448), ('4y4spB9m0Q6026KfkAvy9Q','Lonely',0.0927), ('4yDjzVhXig9tfO7Zv46FE8','Over The Rainbow',0.658), ('4YdoE1VZUCHMKh4uKb9gEf','Lost Horse',0.567), ('4yrKn5K6wwO8uoNlFNuCKK','Rue Saint-Louis en l’Île',0.155), ('4zdlwusc7gvtqTywDEvslg','Pas essentiel',0.591), ('4zKqWCgGqwWlfJTNaj2R19','A Nos Héros Du Quotidien',0.407), ('509AITjdQYNihHOLBWBCg3','Mesdames',0.374), ('50TIALxJW2k7XntjaVzrt1','Nos célébrations',0.59), ('51aYPHVdOL9sIPOZj9dlXK','Be Honest',0.635), ('51o4fQv8MM4hisP68pPGtW','Croîs au printemps',0.571), ('525GY0mXYnxajolwgS8Eaz','Cooler Than Me',0.296), ('54bFM56PmE4YLRnqpW6Tha','Therefore I Am',0.716), ('54DmTIv86D3sYdiawjULQ0','Dis-ease',0.484), ('5508AUnsthPFxPYA8XPvzk','The Whole 9',0.368), ('55EbjQa4Th0gmzKQdSnMrw','Atmosphere',0.119), ('56E6eU3tWIbJDt71jWhDb6','Te ressembler',0.631), ('58AGoOGbwsQMhBbH0eFLRR','Over Now',0.679), ('593oNiMJ6d9PQkaOLOvIDo','Coco',0.921), ('59o6ojGNGJOYiVJSzC6Lsa','Memories',NULL), ('59qrUpoplZxbIZxk6X0Bm3','Take You Dancing',0.753), ('5a548EzcJXWye2MVBUbzNl','Ça Pleure Aussi Un Homme',0.0751), ('5BJRUplWRyXtN2rs5hmyEL','Philippine\'s Smiles',0.689), ('5d1fRuGL7Vz0TNu8OSS2Fo','Quand je marche',0.175), ('5Ea38RCmV570c6Sj4EUqIq','S\'en aller',0.378), ('5gHyAV9B3sy3m48nLyq7Ii','Likolo',0.595), ('5Gz9p2oDVHNHLoQOPHzaXm','Ti amo',0.679), ('5h405snk6LTdc9dkmzdulq','Presque',0.765), ('5HEtuK03ygUzqca6yfgOYZ','Lettre À Une Femme',0.905), ('5HHdKznp8Dqp7nNNd5gEW0','5G',0.548), ('5hILiyJbTPMy4F1oXGWqha','Printemps éternel',0.968), ('5hReWjUHqPqkHi31G7izL4','Inner City Blues (make Me Wanna Holla)',0.645), ('5hvwx5i67IwnCkjl9VHkNv','Diamonds',0.556), ('5iuKYic7hUbMrOr27nzRuX','Tu es toujours là',0.123), ('5iyZwawawLjHYpX4MxUKVF','Salt',0.744), ('5JqZ3oqF00jkT81foAFvqg','Prisoner',0.595), ('5KG2ahk1cONbHvg3dBdTbx','Mr. Lonely',0.344), ('5KPnuRrT1y1fGf8HkKMUUO','Fingertips',0.646), ('5kQ5tKaEs3RHlaLqwjagly','So Maness',0.315), ('5LPgl92IU1oHCTCxluhUjs','Bizness',0.529), ('5MHnT8tTakjzZsiuHGxXyc','Waiting For The Stars',0.754), ('5MxaqqlBzcHWSXceo972sf','SOS d\'un terrien en détresse',0.214), ('5MYDvUdIBOCX3a42L85kM3','Les planètes',0.528), ('5Ncjypx5upZS5ZZTaqUzIf','Honsool',0.187), ('5nujrmhLynf4yMoMtj8AQF','Levitating',0.915), ('5p9XWUdvbUzmPCukOmwoU3','Suddenly I See',0.664), ('5Pummf3Y9hkAH0Tsfjw06i','Guitar Safari',0.395), ('5Qx4tRDy8RnVxACujLF6Vp','(G)rave',0.231), ('5R2FLI5NJc6T3mCNdooKaj','Yummy',0.497), ('5RKpHwLrHz96Y6XlaLXmrv','Jusqu\'ici Tout Va Bien',0.451), ('5RrrQhJKKKMJt3wB5n2N3t','Living In A Ghost Town',0.776), ('5s8onl5Lw5q1AijP5BUm7G','La Mano De Dios',0.504), ('5SiZJoLXp3WOl3J4C8IK0d','Darkness',0.195), ('5tZWtGT65sMrDVPB5H444n','Castles',0.429), ('5vcvA0w8YoGQiifOmas9uo','Tahiti',0.718), ('5xLB0Hx994lwfuic5faKtD','Danse avec moi',0.161), ('5YfWtM9VGkkuDeoPfdgDf0','Écris l\'histoire',0.167), ('5yY9lUy8nbvjM1Uyo1Uqoc','Life Is Good',0.508), ('5Z0RJAaQLZwiOsCZuZYw67','Deux Sortes D\'Hommes',0.62), ('60G0YTBb4gtAgb0ODAPNAn','What A Life',0.64), ('60nZcImufyMA1MKQY3dcCH','Happy',0.962), ('62Pp6exz0ywSlBqvNqiY6Z','Anissa',0.582), ('64GT5b6M5tzqnWcgGlJHyu','C\'est une chanson',0.731), ('64XJOksESduPbepHxmW2rT','Immortels',0.173), ('65RWVU6N81CeH65nu52K1U','Jolie nana',0.488), ('65Uc29xtvhUIk6KUASvQ7Z','NRV',0.577), ('67HVYTs46uyQKdDRuv0P5l','Je m\'appelle Bagdad',0.278), ('67JISBbKShmWCHHzbBHi48','Together We Stand',0.559), ('67k9LmI9vp8G5YDRHVM1Pg','Je remercie mon ex',0.81), ('67Wep0ydky4pQeC0VVxKNg','E penso a te',0.311), ('696DnlkuDOXcMAnKlTgXXK','ROXANNE',0.457), ('6ab3CQvDlAVttThZucwGQ1','Angela',0.378), ('6ARJHbYGKNatxHVghTkWWp','Joli Bébé',0.243), ('6b5P51m8xx2XA6U7sdNZ5E','Alone Again',0.0599), ('6ckdrS5x6ZfiR2Zm1tPCBC','L\'ours',0.579), ('6cy3ki60hLwimwIje7tALf','RITMO (Bad Boys For Life)',0.667), ('6DEMMeWXfmFAXgDUMMzeg6','All I Ask',0.357), ('6DPrYPPGYK218iVIZDix3i','Free',0.0379), ('6E2BLHjDkrGcnS0nolZRq8','Suite Et Fin',0.335), ('6F9zYTeHis63GodcFJl3cb','Celui d\'en bas',0.502), ('6FkWtOHO9PQpCUjCT6lEmo','BOY',0.835), ('6fRxMU4LWwyaSSowV441IU','Beautiful',0.721), ('6gCDChAT4ZEyXKvHgLdhYL','Ngarbuh',0.59), ('6hluRlFf8XucT5KaELb7SF','CAVALIERO',0.561), ('6hSrPj9ikfFsxE04iVYvCa','La Puerta',0.171), ('6iZiygCxjFEhV8VWAP6GZy','Les paradis perdus',0.191), ('6kXjsO0sGgaiR2wKN5uSz7','Tout Gacher',0.645), ('6lhZLbb0czULpjb2kFryPS','Let\'s Love',0.353), ('6M1f126jYXwFo3eUMrOmem','Speed Limit',0.454), ('6muOWhMh7Tf0UFUtMDBhUR','Orphans',0.282), ('6NKjfTR7VV2oJnCeKVPNSw','Mood Ring (by Demand)',0.288), ('6OGpURRDL26WAeouxgnfX9','L\'amour L\'amour L\'amour',0.382), ('6OH3FwtqKBD6TRdPhplQuz','Parc Fermé',0.643), ('6PmjmuQxr4bkssYwUxMNrQ','Emmène moi',0.342), ('6R6ZoHTypt5lt68MWbzZXv','Sour Candy',0.784), ('6RBLVUkcXQ3SEF6bEfEdPU','Grand prix',0.645), ('6RhvzmN2NRZSc24hF2R9lf','Oveillé',0.501), ('6RNDeRnWsRMjPdNVgupZCs','I Just Called To Say I Love You',0.65), ('6Rqn2GFlmvmV4w9Ala0I1e','Feeling Good',0.546), ('6RwkmsgTmxUK2TziYWqlqL','I Don\'t Search I Find',0.207), ('6tgEc2O1uFHcZDKPoo6PC8','Already',0.548), ('6TyQgRUcnfiRwdapyk6Mvo','L\'instant X',0.293), ('6UelLqGlWMcVH1E5c4H7lY','Watermelon Sugar',0.557), ('6v3KW9xbzN5yKLt9YKDYA2','Señorita',0.749), ('6Vc5wAMmXdKIAM7WUoEb7N','Say Something',0.0765), ('6VIRrzxG8W5J8FZMqooOpx','Holy',0.372), ('6xQscjpYokg8SyP43tAf8X','Ma vie',0.289), ('6XRNCAnxJIB1p4RPdFVSq0','People',0.153), ('6yHVyMdC08djbP86mdkP3G','In My Bones',0.709), ('6yQy9tpVsMznuU1xrQcg39','Ton héritage',0.32), ('6YZ9E41Ku875VoVOK6yTYg','Lose You To Love Me',0.0993), ('6ZE1RQaB4gqubhlqohWcr0','Comme j\'ai mal',0.513), ('6zFMeegAMYQo0mt8rXtrli','Holiday',0.837), ('70APCdHsWV5BEsacwjzXmd','Amour toxic',0.642), ('70LcF31zb1H0PyJoS1Sx1r','Creep',0.104), ('70pkwEEG7nDTXBFqoGQkH0','Coffret',0.606), ('70wHpjn8cJjniO0sKcrMup','Pale Yellow',0.0587), ('71S0bmeVlFckwhq5R0Is2d','Si on disait',0.289), ('72PoJMDfdaw9gGECgA9kTZ','Nothing From Nothing',0.909), ('73SpzrcaHk0RQPFP73vqVR','No Time To Die',0.0517), ('74sCnaxY2KxCdxMErYn9Vj','Le cour en deux',0.191), ('76Tuo484SLohJakHLnGI3B','Sweet Melody',0.419), ('780be5fB7823aHG06mwTat','Baianá',0.466), ('78lTICiATPWoCkxducWgKU','Les Gens Qui Doutent',0.355), ('79jeTvkW3gvUdldDkQpYOf','La fièvre',0.412), ('7a53HqqArd4b9NF4XAmlbI','Kings & Queens',0.457), ('7cch3mlEo2IfYgyrjyDwFv','Si Bien Du Mal',0.952), ('7ce20yLkzuXXLUhzIDoZih','Before You Go',0.183), ('7Cg3F9ZsZ2TYUnlza49NYh','Kong',0.674), ('7CVUB1BfTxVYNnTLK2WCz3','On t\'emmène',0.96), ('7eJMfftS33KTjuF7lTsMCx','Death Bed',0.348), ('7FIWs0pqAYbP91WWM0vlTQ','Godzilla',0.829), ('7ixCRBD0FZMRBeOBhTu2KD','La grenade',0.961), ('7iZVBT6LV32t4l00p73VAw','Plus jamais',0.291), ('7jlSV7VE37txK1FJaJmSVU','Casting',0.507), ('7mOBZM9q6nzBu2NZ9PXsYO','Chere amie',0.489), ('7n2IirOomwTTGdGZVZ3vCD','Grand Bain',0.336), ('7N3PAbqfTjSEU1edb2tY8j','Jump',0.795), ('7oZryU4VFbqOxT0bRceSjj','Candide Crush',0.747), ('7qEHsqek33rTcFNT9PFqLf','Someone You Loved',0.446), ('7rBP4bLjMLNkix1nGHjheP','Oui ou non',0.361), ('7s25THrKz86DM225dOYwnr','Respect',0.965), ('7s3tBGYEpSKISjk0hbheS5','Dead Bae',0.719), ('7sf6ZlKaJPtYydEF0JWO4I','Fais le vide',0.922), ('7szuecWAPwGoV1e5vGu8tl','In Your Eyes',0.717), ('7tbbz1bDAW8T9cmhTPZPTQ','3SEX',0.303), ('7tKKdcWvu1kpz6FvGWdPNI','Et demain ?',0.509), ('7vdq8RlxxuhB1GFIN9FIlI','No me ama',0.697), ('7wCmS9TTVUcIhRalDYFgPy','Where Is My Mind?',0.25), ('7wPJBOC2AlfMzgfpJxNcqL','Elle Me Demande',0.304), ('7xbWAw3LMgRMn4omR5yVn3','Lose Somebody',0.507), ('7xcBqYe8VQiKIZMjw6fDVa','Sous les pavés',0.693), ('7y9gbZ9CUnYkpBK4q0qnjB','La fête',0.824); /*!40000 ALTER TABLE `audio_features` ENABLE KEYS */; UNLOCK TABLES; # Dump of table Mean_Temp_week # ------------------------------------------------------------ DROP TABLE IF EXISTS `Mean_Temp_week`; CREATE TABLE `Mean_Temp_week` ( `weeks` int NOT NULL, `mean_temp` float DEFAULT NULL, PRIMARY KEY (`weeks`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; LOCK TABLES `Mean_Temp_week` WRITE; /*!40000 ALTER TABLE `Mean_Temp_week` DISABLE KEYS */; INSERT INTO `Mean_Temp_week` (`weeks`, `mean_temp`) VALUES (1,5.86617), (2,7.09723), (3,7.32967), (4,4.62954), (5,9.48448), (6,8.06323), (7,9.39326), (8,8.49193), (9,8.37653), (10,7.4372), (11,9.94375), (12,11.0856), (13,7.63522), (14,8.36499), (15,14.7261), (16,14.06), (17,15.2101), (18,13.9062), (19,16.6692), (20,12.3535), (21,17.3833), (22,17.7784), (23,16.9585), (24,15.6917), (25,17.1639), (26,21.6309), (27,19.5556), (28,19.7551), (29,19.8706), (30,21.7883), (31,23.489), (32,22.9447), (33,24.0383), (34,22.3329), (35,19.0561), (36,17.9424), (37,19.4354), (38,22.3133), (39,15.2288), (40,13.3696), (41,13.4073), (42,9.89485), (43,14.1075), (44,12.7356), (45,11.5619), (46,12.4465), (47,8.84), (48,7.67668), (49,4.94463), (50,5.46354), (51,9.02617), (52,6.37573), (53,3.7437); /*!40000 ALTER TABLE `Mean_Temp_week` ENABLE KEYS */; UNLOCK TABLES; # Dump of table song_rank_week # ------------------------------------------------------------ DROP TABLE IF EXISTS `song_rank_week`; CREATE TABLE `song_rank_week` ( `weeks` int DEFAULT NULL, `top` int DEFAULT NULL, `artist` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, `track_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; LOCK TABLES `song_rank_week` WRITE; /*!40000 ALTER TABLE `song_rank_week` DISABLE KEYS */; INSERT INTO `song_rank_week` (`weeks`, `top`, `artist`, `track_name`) VALUES (1,1,'The Weeknd','Blinding Lights\r'), (1,2,'Tones and I','Dance Monkey\r'), (1,3,'Angèle','Oui ou non\r'), (1,4,'Vitaa','Avant toi\r'), (1,5,'Ne Reviens Pas','Stats\r'), (1,6,'Maroon 5','Memories\r'), (1,7,'Vitaa','Ça va ça vient\r'), (1,8,'Major Lazer','Que Calor\r'), (1,9,'Soprano','Le coach\r'), (1,10,'M. Pokora','Tombé\r'), (1,11,'Dua Lipa','Don\'t Start Now\r'), (1,12,'Moulaga','Stats\r'), (1,13,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (1,14,'Lady Gaga','I\'ll Never Love Again\r'), (1,15,'Regard','Ride It\r'), (1,16,'Sound Of Legend','Sweet Dreams (Are Made of This)\r'), (1,17,'Clara Luciani','La grenade\r'), (1,18,'Angèle','Balance ton quoi\r'), (1,19,'Soprano','A Nos Héros Du Quotidien\r'), (1,20,'Maître Gims','Reste\r'), (1,21,'Shaed','Trampoline\r'), (1,22,'Lady Gaga','Shallow\r'), (1,23,'Sia','Unstoppable\r'), (1,24,'Shawn Mendes','Señorita\r'), (1,25,'Mariah Carey','All I Want For Christmas Is You\r'), (1,26,'Billie Eilish','Bad Guy\r'), (1,27,'Les Frangines','Donnez-moi\r'), (1,28,'Bakermat','Baianá\r'), (1,29,'Trois Cafés Gourmands','A nos souvenirs\r'), (1,30,'Gambi','Popopop\r'), (1,31,'Billie Eilish','everything i wanted\r'), (1,32,'M. Pokora','Les planètes\r'), (1,33,'Ava Max','Torn\r'), (1,34,'Clara Luciani','Ma sœur\r'), (1,35,'Dadju','Ma vie\r'), (1,36,'SAINt JHN','Roses\r'), (1,37,'Aya Nakamura','40%\r'), (1,38,'Lewis Capaldi','Someone You Loved\r'), (1,39,'Coldplay','Orphans\r'), (1,40,'Jean-Louis Aubert','Bien sûr\r'), (1,41,'Angèle','Tout oublier\r'), (1,42,'Lady Gaga','Always Remember Us This Way\r'), (1,43,'Clara Luciani','Nue\r'), (1,44,'Aya Nakamura','Pookie\r'), (1,45,'Lil Nas X','Old Town Road\r'), (1,46,'Maëlle','Toutes les machines ont un coeur\r'), (1,47,'Jorja Smith','Be Honest\r'), (1,48,'Christophe Maé','Les Gens\r'), (1,49,'Turn Me On','Stats\r'), (1,50,'Angèle','Flou\r'), (2,1,'The Weeknd','Blinding Lights\r'), (2,2,'Tones and I','Dance Monkey\r'), (2,3,'Vitaa','Avant toi\r'), (2,4,'Ne Reviens Pas','Stats\r'), (2,5,'Angèle','Oui ou non\r'), (2,6,'Justin Bieber','Yummy\r'), (2,7,'Maroon 5','Memories\r'), (2,8,'Moulaga','Stats\r'), (2,9,'Vitaa','Ça va ça vient\r'), (2,10,'Lady Gaga','I\'ll Never Love Again\r'), (2,11,'Regard','Ride It\r'), (2,12,'Dua Lipa','Don\'t Start Now\r'), (2,13,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (2,14,'Lady Gaga','Shallow\r'), (2,15,'Shaed','Trampoline\r'), (2,16,'Soprano','A Nos Héros Du Quotidien\r'), (2,17,'Sia','Unstoppable\r'), (2,18,'M. Pokora','Tombé\r'), (2,19,'Maître Gims','Reste\r'), (2,20,'Ava Max','Torn\r'), (2,21,'Major Lazer','Que Calor\r'), (2,22,'SAINt JHN','Roses\r'), (2,23,'Bakermat','Baianá\r'), (2,24,'Sound Of Legend','Sweet Dreams (Are Made of This)\r'), (2,25,'Shawn Mendes','Señorita\r'), (2,26,'Lewis Capaldi','Someone You Loved\r'), (2,27,'Angèle','Balance ton quoi\r'), (2,28,'Clara Luciani','Ma sœur\r'), (2,29,'Soprano','Le coach\r'), (2,30,'Ginette Reno','Ça Pleure Aussi Un Homme\r'), (2,31,'Les Frangines','Donnez-moi\r'), (2,32,'Younha','Winter Flower\r'), (2,33,'Mylène Farmer','L\'instant X\r'), (2,34,'Billie Eilish','Bad Guy\r'), (2,35,'Jorja Smith','Be Honest\r'), (2,36,'Nea','Some Say\r'), (2,37,'Clara Luciani','La grenade\r'), (2,38,'Billie Eilish','everything i wanted\r'), (2,39,'Aya Nakamura','40%\r'), (2,40,'Dadju','Ma vie\r'), (2,41,'Gambi','Popopop\r'), (2,42,'Jean-Louis Aubert','Bien sûr\r'), (2,43,'Lady Gaga','Always Remember Us This Way\r'), (2,44,'Lizzo','Good As Hell\r'), (2,45,'Coldplay','Orphans\r'), (2,46,'The Avener','You Belong\r'), (2,47,'Angèle','Tout oublier\r'), (2,48,'Aya Nakamura','Pookie\r'), (2,49,'Lil Nas X','Old Town Road\r'), (2,50,'Lewis Capaldi','Before You Go\r'), (3,1,'The Weeknd','Blinding Lights\r'), (3,2,'Tones and I','Dance Monkey\r'), (3,3,'Vitaa','Avant toi\r'), (3,4,'Ne Reviens Pas','Stats\r'), (3,5,'Maroon 5','Memories\r'), (3,6,'Alicia Keys','Underdog\r'), (3,7,'Vitaa','Ça va ça vient\r'), (3,8,'Angèle','Oui ou non\r'), (3,9,'Dua Lipa','Don\'t Start Now\r'), (3,10,'Moulaga','Stats\r'), (3,11,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (3,12,'Regard','Ride It\r'), (3,13,'SAINt JHN','Roses\r'), (3,14,'M. Pokora','Tombé\r'), (3,15,'Ava Max','Torn\r'), (3,16,'Lady Gaga','I\'ll Never Love Again\r'), (3,17,'Lady Gaga','Shallow\r'), (3,18,'Antoine Elie','La Rose Et L\'armure\r'), (3,19,'Billie Eilish','Bad Guy\r'), (3,20,'Maître Gims','Reste\r'), (3,21,'Sia','Unstoppable\r'), (3,22,'Justin Bieber','Yummy\r'), (3,23,'Lil Nas X','Old Town Road\r'), (3,24,'Vitalic','Waiting For The Stars\r'), (3,25,'Les Frangines','Donnez-moi\r'), (3,26,'Shaed','Trampoline\r'), (3,27,'Selena Gomez','Rare\r'), (3,28,'Nicky Jam','Muévelo\r'), (3,29,'Soprano','A Nos Héros Du Quotidien\r'), (3,30,'Nea','Some Say\r'), (3,31,'Bakermat','Baianá\r'), (3,32,'Lewis Capaldi','Someone You Loved\r'), (3,33,'Angèle','Balance ton quoi\r'), (3,34,'Shawn Mendes','Señorita\r'), (3,35,'Clara Luciani','Ma sœur\r'), (3,36,'Major Lazer','Que Calor\r'), (3,37,'Selena Gomez','Lose You To Love Me\r'), (3,38,'Robin Schulz','In Your Eyes\r'), (3,39,'Soprano','Le coach\r'), (3,40,'Future','Life Is Good\r'), (3,41,'Billie Eilish','everything i wanted\r'), (3,42,'Clara Luciani','La grenade\r'), (3,43,'Lady Gaga','Always Remember Us This Way\r'), (3,44,'Indochine','Un été français\r'), (3,45,'Gambi','Popopop\r'), (3,46,'Dadju','Ma vie\r'), (3,47,'Carla','Bim Bam Toi\r'), (3,48,'Jean-Louis Aubert','Bien sûr\r'), (3,49,'Aya Nakamura','40%\r'), (3,50,'Jorja Smith','Be Honest\r'), (4,1,'The Weeknd','Blinding Lights\r'), (4,2,'Tones and I','Dance Monkey\r'), (4,3,'BTS','Black Swan\r'), (4,4,'Vitaa','Avant toi\r'), (4,5,'Ne Reviens Pas','Stats\r'), (4,6,'Dua Lipa','Don\'t Start Now\r'), (4,7,'Maroon 5','Memories\r'), (4,8,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (4,9,'Dans l\'espace','Stats\r'), (4,10,'Regard','Ride It\r'), (4,11,'Blanche','Stats\r'), (4,12,'Vitaa','Ça va ça vient\r'), (4,13,'Moulaga','Stats\r'), (4,14,'Angèle','Oui ou non\r'), (4,15,'Antoine Elie','La Rose Et L\'armure\r'), (4,16,'SAINt JHN','Roses\r'), (4,17,'Soprano','A Nos Héros Du Quotidien\r'), (4,18,'Nea','Some Say\r'), (4,19,'Shaed','Trampoline\r'), (4,20,'Clara Luciani','Ma sœur\r'), (4,21,'M. Pokora','Tombé\r'), (4,22,'Bakermat','Baianá\r'), (4,23,'Lady Gaga','I\'ll Never Love Again\r'), (4,24,'Ava Max','Torn\r'), (4,25,'Jonas Brothers','What A Man Gotta Do\r'), (4,26,'Lady Gaga','Shallow\r'), (4,27,'Maître Gims','Reste\r'), (4,28,'Billie Eilish','Bad Guy\r'), (4,29,'Soprano','Le coach\r'), (4,30,'Sia','Unstoppable\r'), (4,31,'Gregory Porter','Revival\r'), (4,32,'Good Time Girl','Stats\r'), (4,33,'Angèle','Balance ton quoi\r'), (4,34,'Lewis Capaldi','Someone You Loved\r'), (4,35,'Les Frangines','Donnez-moi\r'), (4,36,'Shawn Mendes','Señorita\r'), (4,37,'Dybala','Stats\r'), (4,38,'M. Pokora','Si t\'es pas là\r'), (4,39,'Maes','Distant\r'), (4,40,'Femme Like U (Donne-moi ton corps)','Stats\r'), (4,41,'Eminem','Darkness\r'), (4,42,'Billie Eilish','everything i wanted\r'), (4,43,'Eminem','Godzilla\r'), (4,44,'Justin Bieber','Yummy\r'), (4,45,'Jean-Louis Aubert','Bien sûr\r'), (4,46,'Gambi','Popopop\r'), (4,47,'Vitalic','Waiting For The Stars\r'), (4,48,'Queen','Bohemian Rhapsody\r'), (4,49,'Lady Gaga','Always Remember Us This Way\r'), (4,50,'Carla','Bim Bam Toi\r'), (5,1,'The Weeknd','Blinding Lights\r'), (5,2,'Tones and I','Dance Monkey\r'), (5,3,'Vitaa','Avant toi\r'), (5,4,'Billie Eilish','Bad Guy\r'), (5,5,'Dua Lipa','Don\'t Start Now\r'), (5,6,'Ne Reviens Pas','Stats\r'), (5,7,'Maroon 5','Memories\r'), (5,8,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (5,9,'Regard','Ride It\r'), (5,10,'Nea','Some Say\r'), (5,11,'Billie Eilish','everything i wanted\r'), (5,12,'Moulaga','Stats\r'), (5,13,'Vitaa','Ça va ça vient\r'), (5,14,'Shaed','Trampoline\r'), (5,15,'Angèle','Oui ou non\r'), (5,16,'Soprano','A Nos Héros Du Quotidien\r'), (5,17,'Christophe Maé','Casting\r'), (5,18,'Dans l\'espace','Stats\r'), (5,19,'Bakermat','Baianá\r'), (5,20,'Sia','Unstoppable\r'), (5,21,'M. Pokora','Tombé\r'), (5,22,'Good Time Girl','Stats\r'), (5,23,'SAINt JHN','Roses\r'), (5,24,'Demi Lovato','Anyone\r'), (5,25,'Lady Gaga','I\'ll Never Love Again\r'), (5,26,'The Avener','Beautiful\r'), (5,27,'Blanche','Stats\r'), (5,28,'Clara Luciani','Ma sœur\r'), (5,29,'Justin Bieber','Yummy\r'), (5,30,'Lewis Capaldi','Before You Go\r'), (5,31,'Lil Nas X','Old Town Road\r'), (5,32,'Les Frangines','Donnez-moi\r'), (5,33,'Maître Gims','Reste\r'), (5,34,'Ava Max','Torn\r'), (5,35,'Lady Gaga','Shallow\r'), (5,36,'Lewis Capaldi','Someone You Loved\r'), (5,37,'Angèle','Balance ton quoi\r'), (5,38,'M. Pokora','Si t\'es pas là\r'), (5,39,'Damso','Oveillé\r'), (5,40,'Jonas Brothers','What A Man Gotta Do\r'), (5,41,'Freya Ridings','Castles\r'), (5,42,'Dj Arafat','Kong\r'), (5,43,'Benjamin Biolay','Ton héritage\r'), (5,44,'Queen','Bohemian Rhapsody\r'), (5,45,'Toss A Coin To Your Witcher','Stats\r'), (5,46,'Soprano','Le coach\r'), (5,47,'Aya Nakamura','40%\r'), (5,48,'Shawn Mendes','Señorita\r'), (5,49,'Alicia Keys','Underdog\r'), (5,50,'Gregory Porter','Revival\r'), (6,1,'The Weeknd','Blinding Lights\r'), (6,2,'Tones and I','Dance Monkey\r'), (6,3,'Vitaa','Avant toi\r'), (6,4,'Billie Eilish','Bad Guy\r'), (6,5,'Ne Reviens Pas','Stats\r'), (6,6,'Dua Lipa','Don\'t Start Now\r'), (6,7,'Nea','Some Say\r'), (6,8,'Maroon 5','Memories\r'), (6,9,'Dua Lipa','Physical\r'), (6,10,'Regard','Ride It\r'), (6,11,'Lovely','Stats\r'), (6,12,'Vitaa','Ça va ça vient\r'), (6,13,'Angèle','Oui ou non\r'), (6,14,'Shaed','Trampoline\r'), (6,15,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (6,16,'Billie Eilish','everything i wanted\r'), (6,17,'Clara Luciani','Ma sœur\r'), (6,18,'Moulaga','Stats\r'), (6,19,'Billie Eilish','idontwannabeyouanymore\r'), (6,20,'Sia','Unstoppable\r'), (6,21,'M. Pokora','Tombé\r'), (6,22,'Soprano','A Nos Héros Du Quotidien\r'), (6,23,'Lady Gaga','I\'ll Never Love Again\r'), (6,24,'Bakermat','Baianá\r'), (6,25,'Ava Max','Torn\r'), (6,26,'Maître Gims','Reste\r'), (6,27,'SAINt JHN','Roses\r'), (6,28,'Justin Bieber','Yummy\r'), (6,29,'Lewis Capaldi','Before You Go\r'), (6,30,'Carla','Bim Bam Toi\r'), (6,31,'Soprano','Le coach\r'), (6,32,'Lady Gaga','Shallow\r'), (6,33,'Alicia Keys','Underdog\r'), (6,34,'Angèle','Balance ton quoi\r'), (6,35,'Taylor Swift','Only The Young\r'), (6,36,'Marina Kaye','The Whole 9\r'), (6,37,'Les Frangines','Donnez-moi\r'), (6,38,'Clara Luciani','La grenade\r'), (6,39,'Lewis Capaldi','Someone You Loved\r'), (6,40,'Dans l\'espace','Stats\r'), (6,41,'Shawn Mendes','Señorita\r'), (6,42,'Roddy Ricch','The Box\r'), (6,43,'M. Pokora','Si t\'es pas là\r'), (6,44,'Freya Ridings','Castles\r'), (6,45,'Major Lazer','Que Calor\r'), (6,46,'Aya Nakamura','40%\r'), (6,47,'Lady Gaga','Always Remember Us This Way\r'), (6,48,'M. Pokora','Les planètes\r'), (6,49,'Christophe Maé','Casting\r'), (6,50,'Jean-Louis Aubert','Bien sûr\r'), (7,1,'The Weeknd','Blinding Lights\r'), (7,2,'Tones and I','Dance Monkey\r'), (7,3,'Vitaa','Avant toi\r'), (7,4,'Soolking','Melegim\r'), (7,5,'Nea','Some Say\r'), (7,6,'Ne Reviens Pas','Stats\r'), (7,7,'Billie Eilish','Bad Guy\r'), (7,8,'Maroon 5','Memories\r'), (7,9,'Dua Lipa','Don\'t Start Now\r'), (7,10,'Eminem','Lose Yourself\r'), (7,11,'Regard','Ride It\r'), (7,12,'Lady Gaga','I\'ll Never Love Again\r'), (7,13,'Shaed','Trampoline\r'), (7,14,'Vitaa','Ça va ça vient\r'), (7,15,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (7,16,'Billie Eilish','everything i wanted\r'), (7,17,'Angèle','Oui ou non\r'), (7,18,'Lady Gaga','Shallow\r'), (7,19,'Sia','Unstoppable\r'), (7,20,'Clara Luciani','Ma sœur\r'), (7,21,'The Pussycat Dolls','React\r'), (7,22,'M. Pokora','Si t\'es pas là\r'), (7,23,'Moulaga','Stats\r'), (7,24,'Bakermat','Baianá\r'), (7,25,'Lewis Capaldi','Before You Go\r'), (7,26,'Soprano','A Nos Héros Du Quotidien\r'), (7,27,'Maître Gims','Reste\r'), (7,28,'Ava Max','Torn\r'), (7,29,'Justin Bieber','Yummy\r'), (7,30,'M. Pokora','Tombé\r'), (7,31,'Clara Luciani','La grenade\r'), (7,32,'Dua Lipa','Physical\r'), (7,33,'Tusa','Stats\r'), (7,34,'Lady Gaga','Always Remember Us This Way\r'), (7,35,'Roddy Ricch','The Box\r'), (7,36,'Christine and the Queens','People, I\'ve been sad\r'), (7,37,'SAINt JHN','Roses\r'), (7,38,'Carla','Bim Bam Toi\r'), (7,39,'Shawn Mendes','Señorita\r'), (7,40,'Lewis Capaldi','Someone You Loved\r'), (7,41,'Dans l\'espace','Stats\r'), (7,42,'Major Lazer','Que Calor\r'), (7,43,'Jean-Louis Aubert','Bien sûr\r'), (7,44,'Soprano','Le coach\r'), (7,45,'Les Frangines','Donnez-moi\r'), (7,46,'Benjamin Biolay','C\'est Magnifique\r'), (7,47,'The Faim','Summer Is a Curse\r'), (7,48,'Justin Bieber','Intentions\r'), (7,49,'Aya Nakamura','40%\r'), (7,50,'Freya Ridings','Castles\r'), (8,1,'The Weeknd','Blinding Lights\r'), (8,2,'Tones and I','Dance Monkey\r'), (8,3,'Billie Eilish','No Time To Die\r'), (8,4,'Vitaa','Avant toi\r'), (8,5,'Pomme','La face cachée\r'), (8,6,'Nea','Some Say\r'), (8,7,'Vitaa','Ça va ça vient\r'), (8,8,'Billie Eilish','Bad Guy\r'), (8,9,'Clara Luciani','Ma sœur\r'), (8,10,'Clara Luciani','Nue\r'), (8,11,'Angèle','Oui ou non\r'), (8,12,'David Bowie','Alabama Song\r'), (8,13,'Clara Luciani','La grenade\r'), (8,14,'Soolking','Melegim\r'), (8,15,'Regard','Ride It\r'), (8,16,'Dua Lipa','Don\'t Start Now\r'), (8,17,'Maroon 5','Memories\r'), (8,18,'Billie Eilish','everything i wanted\r'), (8,19,'Tusa','Stats\r'), (8,20,'Ne Reviens Pas','Stats\r'), (8,21,'Shaed','Trampoline\r'), (8,22,'Dead Or Alive','You Spin Me Round (Like A Record) (Re-Recorded / Remastered)'), (8,23,'Bakermat','Baianá\r'), (8,24,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (8,25,'Eminem','Lose Yourself\r'), (8,26,'M. Pokora','Si t\'es pas là\r'), (8,27,'Lady Gaga','I\'ll Never Love Again\r'), (8,28,'Lady Gaga','Shallow\r'), (8,29,'Lewis Capaldi','Before You Go\r'), (8,30,'Les Enfoirés','À côté de toi\r'), (8,31,'Alain Souchon','Presque\r'), (8,32,'Soprano','A Nos Héros Du Quotidien\r'), (8,33,'Hoshi','Amour Censure\r'), (8,34,'Justin Bieber','Yummy\r'), (8,35,'Angèle','Balance ton quoi\r'), (8,36,'Moulaga','Stats\r'), (8,37,'Tom Leeb','The Best in Me - Eurovision France 2020\r'), (8,38,'Tina Arena','Je m\'appelle Bagdad\r'), (8,39,'Sia','Unstoppable\r'), (8,40,'Dua Lipa','Physical\r'), (8,41,'Carla','Bim Bam Toi\r'), (8,42,'M. Pokora','Tombé\r'), (8,43,'Maître Gims','Reste\r'), (8,44,'Freya Ridings','Castles\r'), (8,45,'Soprano','Le coach\r'), (8,46,'Ava Max','Torn\r'), (8,47,'Les Frangines','Donnez-moi\r'), (8,48,'SAINt JHN','Roses\r'), (8,49,'Sam Smith','To Die For\r'), (8,50,'Lady Gaga','Always Remember Us This Way\r'), (9,1,'BTS','ON\r'), (9,2,'The Weeknd','Blinding Lights\r'), (9,3,'Tones and I','Dance Monkey\r'), (9,4,'Vitaa','Avant toi\r'), (9,5,'Billie Eilish','No Time To Die\r'), (9,6,'Nea','Some Say\r'), (9,7,'Tusa','Stats\r'), (9,8,'Ne Reviens Pas','Stats\r'), (9,9,'BTS','Filter\r'), (9,10,'Dua Lipa','Don\'t Start Now\r'), (9,11,'BTS','We Are Bulletproof : The Eternal\r'), (9,12,'BTS','Louder Than Bombs\r'), (9,13,'Maroon 5','Memories\r'), (9,14,'Billie Eilish','Bad Guy\r'), (9,15,'Regard','Ride It\r'), (9,16,'BTS','UGH!\r'), (9,17,'Soolking','Melegim\r'), (9,18,'BTS','Friends\r'), (9,19,'BTS','My Time\r'), (9,20,'BTS','Inner Child\r'), (9,21,'Angèle','Oui ou non\r'), (9,22,'BTS','Interlude : Shadow\r'), (9,23,'BTS','00:00 (Zero O’Clock)\r'), (9,24,'BTS','Moon\r'), (9,25,'Clara Luciani','La grenade\r'), (9,26,'Vitaa','Ça va ça vient\r'), (9,27,'Shaed','Trampoline\r'), (9,28,'Bts','Outro : Ego\r'), (9,29,'Billie Eilish','everything i wanted\r'), (9,30,'Clara Luciani','Ma sœur\r'), (9,31,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (9,32,'Bts','Respect\r'), (9,33,'Lewis Capaldi','Before You Go\r'), (9,34,'The Weeknd','After Hours\r'), (9,35,'Selena Gomez','Feel Me\r'), (9,36,'Bakermat','Baianá\r'), (9,37,'Lady Gaga','Shallow\r'), (9,38,'Les Enfoirés','À côté de toi\r'), (9,39,'Dua Lipa','Physical\r'), (9,40,'M. Pokora','Si t\'es pas là\r'), (9,41,'Lady Gaga','I\'ll Never Love Again\r'), (9,42,'BTS','Black Swan\r'), (9,43,'Angèle','Balance ton quoi\r'), (9,44,'Moulaga','Stats\r'), (9,45,'6.3','Stats\r'), (9,46,'Carla','Bim Bam Toi\r'), (9,47,'Soprano','A Nos Héros Du Quotidien\r'), (9,48,'Izia','Sous les pavés\r'), (9,49,'Coldplay','BrokEn\r'), (9,50,'The Faim','Summer Is a Curse\r'), (10,1,'Lady Gaga','Stupid Love\r'), (10,2,'The Weeknd','Blinding Lights\r'), (10,3,'Tones and I','Dance Monkey\r'), (10,4,'Vitaa','Avant toi\r'), (10,5,'Christine And The Queens','La Vita Nuova - EP\r'), (10,6,'Nea','Some Say\r'), (10,7,'Tusa','Stats\r'), (10,8,'Ne Reviens Pas','Stats\r'), (10,9,'Dua Lipa','Don\'t Start Now\r'), (10,10,'Roddy Ricch','The Box\r'), (10,11,'Maroon 5','Memories\r'), (10,12,'Lady Gaga','Shallow\r'), (10,13,'Billie Eilish','Bad Guy\r'), (10,14,'Vitaa','Ça va ça vient\r'), (10,15,'Regard','Ride It\r'), (10,16,'Lewis Capaldi','Before You Go\r'), (10,17,'Soolking','Melegim\r'), (10,18,'Angèle','Oui ou non\r'), (10,19,'Bakermat','Baianá\r'), (10,20,'Clara Luciani','La grenade\r'), (10,21,'6.3','Stats\r'), (10,22,'Les Enfoirés','À côté de toi\r'), (10,23,'SZA & Justin Timberlake','The Other Side\r'), (10,24,'Shaed','Trampoline\r'), (10,25,'Clara Luciani','Ma sœur\r'), (10,26,'Freya Ridings','Castles\r'), (10,27,'Billie Eilish','everything i wanted\r'), (10,28,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (10,29,'Billy Preston','Nothing From Nothing\r'), (10,30,'Moulaga','Stats\r'), (10,31,'M. Pokora','Si t\'es pas là\r'), (10,32,'Louis Chedid','Tout ce qu\'on veut dans la vie\r'), (10,33,'Billie Eilish','No Time To Die\r'), (10,34,'SAINt JHN','Roses\r'), (10,35,'Dua Lipa','Physical\r'), (10,36,'Soprano','A Nos Héros Du Quotidien\r'), (10,37,'Ava Max','Torn\r'), (10,38,'Lady Gaga','I\'ll Never Love Again\r'), (10,39,'Ninho','M.I.L.S 3\r'), (10,40,'Pixies','Where Is My Mind?\r'), (10,41,'M. Pokora','Tombé\r'), (10,42,'Angèle','Balance ton quoi\r'), (10,43,'Jean-Louis Aubert','Bien sûr\r'), (10,44,'Dead Or Alive','You Spin Me Round (Like A Record) (Re-Recorded / Remastered)'), (10,45,'Maître Gims','Reste\r'), (10,46,'Doja Cat','Say So\r'), (10,47,'Angèle','Ta reine\r'), (10,48,'Carla','Bim Bam Toi\r'), (10,49,'SDM','La Zone\r'), (10,50,'Clara Luciani','Nue\r'), (11,1,'The Weeknd','Blinding Lights\r'), (11,2,'Vitaa','Avant toi\r'), (11,3,'Les Enfoirés','À côté de toi\r'), (11,4,'Tusa','Stats\r'), (11,5,'Tones and I','Dance Monkey\r'), (11,6,'Les Enfoirés','Mourir Sur Scène\r'), (11,7,'Ninho','Lettre À Une Femme\r'), (11,8,'Nea','Some Say\r'), (11,9,'Ne Reviens Pas','Stats\r'), (11,10,'Dua Lipa','Don\'t Start Now\r'), (11,11,'Lady Gaga','Stupid Love\r'), (11,12,'Clara Luciani','La grenade\r'), (11,13,'Booba','CAVALIERO\r'), (11,14,'Lewis Capaldi','Before You Go\r'), (11,15,'Les Enfoirés','Vivre Pour Le Meilleur\r'), (11,16,'Regard','Ride It\r'), (11,17,'Maroon 5','Memories\r'), (11,18,'Vitaa','Ça va ça vient\r'), (11,19,'Who','Stats\r'), (11,20,'Billie Eilish','Bad Guy\r'), (11,21,'Soprano','A Nos Héros Du Quotidien\r'), (11,22,'Freya Ridings','Castles\r'), (11,23,'Dua Lipa','Physical\r'), (11,24,'Soolking','Melegim\r'), (11,25,'Doja Cat','Say So\r'), (11,26,'Angèle','Oui ou non\r'), (11,27,'Shaed','Trampoline\r'), (11,28,'Roddy Ricch','The Box\r'), (11,29,'Demi Lovato','I Love Me\r'), (11,30,'M. Pokora','Si t\'es pas là\r'), (11,31,'Richard Clayderman','I Just Called To Say I Love You\r'), (11,32,'Clara Luciani','Ma sœur\r'), (11,33,'Bakermat','Baianá\r'), (11,34,'Billie Eilish','everything i wanted\r'), (11,35,'Les Enfoirés','Combien De Murs\r'), (11,36,'Lady Gaga','Shallow\r'), (11,37,'6.3','Stats\r'), (11,38,'Soprano','Le coach\r'), (11,39,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (11,40,'Carla','Bim Bam Toi\r'), (11,41,'Billie Eilish','No Time To Die\r'), (11,42,'Moulaga','Stats\r'), (11,43,'Ava Max','Salt\r'), (11,44,'Josh Groban','You Raise Me Up\r'), (11,45,'M. Pokora','Tombé\r'), (11,46,'Noel Gallagher\'s High Flying Birds','Blue Moon Rising Ep\r'), (11,47,'Hoshi','Amour Censure\r'), (11,48,'You Raise Me Up','Stats\r'), (11,49,'Les Enfoirés','Your Song\r'), (11,50,'Maître Gims','Reste\r'), (12,1,'The Weeknd','Blinding Lights\r'), (12,2,'Tones and I','Dance Monkey\r'), (12,3,'Tusa','Stats\r'), (12,4,'Vitaa','Avant toi\r'), (12,5,'Ninho','Lettre À Une Femme\r'), (12,6,'Les Enfoirés','À côté de toi\r'), (12,7,'Nea','Some Say\r'), (12,8,'Ne Reviens Pas','Stats\r'), (12,9,'Ava Max','Kings & Queens\r'), (12,10,'V','Sweet Night\r'), (12,11,'Dua Lipa','Don\'t Start Now\r'), (12,12,'Lady Gaga','Stupid Love\r'), (12,13,'Roddy Ricch','The Box\r'), (12,14,'Maroon 5','Memories\r'), (12,15,'Lewis Capaldi','Before You Go\r'), (12,16,'Doja Cat','Say So\r'), (12,17,'Soolking','Melegim\r'), (12,18,'Regard','Ride It\r'), (12,19,'Billie Eilish','everything i wanted\r'), (12,20,'Billie Eilish','Bad Guy\r'), (12,21,'Les Enfoirés','Mourir Sur Scène\r'), (12,22,'M. Pokora','Si t\'es pas là\r'), (12,23,'Clean Bandit','Symphony\r'), (12,24,'Freya Ridings','Castles\r'), (12,25,'Therapie TAXI','Candide Crush\r'), (12,26,'Vitaa','Ça va ça vient\r'), (12,27,'Shaed','Trampoline\r'), (12,28,'Bakermat','Baianá\r'), (12,29,'Ava Max','Salt\r'), (12,30,'Dua Lipa','Physical\r'), (12,31,'Soprano','A Nos Héros Du Quotidien\r'), (12,32,'6.3','Stats\r'), (12,33,'Soprano','Ninja\r'), (12,34,'Angèle','Oui ou non\r'), (12,35,'Moulaga','Stats\r'), (12,36,'Clara Luciani','Ma sœur\r'), (12,37,'Soprano','Le coach\r'), (12,38,'SAINt JHN','Roses\r'), (12,39,'Ava Max','Torn\r'), (12,40,'Clara Luciani','La grenade\r'), (12,41,'Lady Gaga','Shallow\r'), (12,42,'Mouloudji','L\'amour L\'amour L\'amour\r'), (12,43,'SZA & Justin Timberlake','The Other Side\r'), (12,44,'Ily','Stats\r'), (12,45,'Booba','CAVALIERO\r'), (12,46,'Baila Conmigo','Stats\r'), (12,47,'Carla','Bim Bam Toi\r'), (12,48,'Black Blood','A.I.E. (A\'Mwana)\r'), (12,49,'Hoshi','Amour Censure\r'), (12,50,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (13,1,'Ninho','Lettre À Une Femme\r'), (13,2,'The Weeknd','Blinding Lights\r'), (13,3,'6.3','Stats\r'), (13,4,'Soolking','Melegim\r'), (13,5,'Ninho','Zipette\r'), (13,6,'Roddy Ricch','The Box\r'), (13,7,'Tones and I','Dance Monkey\r'), (13,8,'Ne Reviens Pas','Stats\r'), (13,9,'Promo','Stats\r'), (13,10,'Tusa','Stats\r'), (13,11,'SAINt JHN','Roses\r'), (13,12,'Every Day','Stats\r'), (13,13,'Blanche','Stats\r'), (13,14,'Ninho','La Puerta\r'), (13,15,'Maes','Distant\r'), (13,16,'Regard','Ride It\r'), (13,17,'Nea','Some Say\r'), (13,18,'Dua Lipa','Don\'t Start Now\r'), (13,19,'MD','Stats\r'), (13,20,'Dybala','Stats\r'), (13,21,'Ninho','Filon\r'), (13,22,'Moulaga','Stats\r'), (13,23,'Ninho','Centre Commercial\r'), (13,24,'Aya Nakamura','40%\r'), (13,25,'Ninho','Gros Vendeurs\r'), (13,26,'Vitaa','Avant toi\r'), (13,27,'Ninho','Le Jeu\r'), (13,28,'Pirate','Stats\r'), (13,29,'Ninho','M.I.L.S 3\r'), (13,30,'Ninho','C\'Était Le Rap\r'), (13,31,'Bakermat','Baianá\r'), (13,32,'Doja Cat','Say So\r'), (13,33,'Imen Es','1ère fois\r'), (13,34,'Angèle','Oui ou non\r'), (13,35,'Soolking','Ça Fait Des Années\r'), (13,36,'Ninho','En Chien\r'), (13,37,'The Weeknd','In Your Eyes\r'), (13,38,'Dans l\'espace','Stats\r'), (13,39,'93% (Tijuana)','Stats\r'), (13,40,'Ninho','Mauvais Djo\r'), (13,41,'Surfaces','Sunday Best\r'), (13,42,'Trevor Daniel','Falling\r'), (13,43,'Arizona Zervas','ROXANNE\r'), (13,44,'Ninho','Intro (m.i.l.s 3)\r'), (13,45,'Soso Maness','So Maness\r'), (13,46,'La Kichta','Stats\r'), (13,47,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (13,48,'Hornet La Frappe','Calumet\r'), (13,49,'Tu Sais Qu\'on Est Gang','Stats\r'), (13,50,'The Weeknd','Alone Again\r'), (18,1,'The Rolling Stones','Living In A Ghost Town\r'), (18,2,'The Weeknd','Blinding Lights\r'), (18,3,'Young T & Bugsey','Don\'t Rush\r'), (18,4,'Benjamin Biolay','Comment est ta peine ?\r'), (18,5,'Et demain ? Le collectif','Et demain ?\r'), (18,6,'Tones and I','Dance Monkey\r'), (18,7,'Christophe','Les mots bleus\r'), (18,8,'SAINt JHN','Roses\r'), (18,9,'Calogero','On fait comme si\r'), (18,10,'Tusa','Stats\r'), (18,11,'Black Eyed Peas','Mamacita\r'), (18,12,'Ily','Stats\r'), (18,13,'Christophe','Les paradis perdus\r'), (18,14,'Doja Cat','Say So\r'), (18,15,'The Scotts','The Scotts\r'), (18,16,'Lost Frequencies','Love To Go\r'), (18,17,'Bilal Hassani','Fais le vide\r'), (18,18,'Vitaa','Avant toi\r'), (18,19,'Woodkid','Goliath\r'), (18,20,'Nea','Some Say\r'), (18,21,'Christophe','Aline\r'), (18,22,'Dua Lipa','Physical\r'), (18,23,'Christophe','Les Marionnettes\r'), (18,24,'Imen Es','1ère fois\r'), (18,25,'Dua Lipa','Don\'t Start Now\r'), (18,26,'Regard','Ride It\r'), (18,27,'Soprano','A Nos Héros Du Quotidien\r'), (18,28,'Lady Gaga','Stupid Love\r'), (18,29,'Christophe','Daisy\r'), (18,30,'Manu Pilas','Bella Ciao\r'), (18,31,'Lewis Capaldi','Before You Go\r'), (18,32,'The Weeknd','In Your Eyes\r'), (18,33,'Freya Ridings','Castles\r'), (18,34,'Pagny Obispo Lavoine','Pour les Gens Du Secours\r'), (18,35,'Billie Eilish','Bad Guy\r'), (18,36,'Les Enfoirés','À côté de toi\r'), (18,37,'Powfu','Death Bed\r'), (18,38,'Soprano','Ninja\r'), (18,39,'Soolking','Melegim\r'), (18,40,'Megan Thee Stallion','Savage\r'), (18,41,'Ava Max','Salt\r'), (18,42,'Drake','Toosie Slide\r'), (18,43,'Helmut Fritz','Ça m\'énerve\r'), (18,44,'Lara Fabian','Nos coeurs à la fenêtre\r'), (18,45,'Astronomia','Stats\r'), (18,46,'Maroon 5','Memories\r'), (18,47,'Christophe','Succès fou\r'), (18,48,'Hoshi','Amour Censure\r'), (18,49,'Pharrell Williams','Happy\r'), (18,50,'Shaed','Trampoline\r'), (19,1,'Idir','A Vava Inouva\r'), (19,2,'The Weeknd','Blinding Lights\r'), (19,3,'Doja Cat','Say So\r'), (19,4,'Et demain ? Le collectif','Et demain ?\r'), (19,5,'Young T & Bugsey','Don\'t Rush\r'), (19,6,'Tones and I','Dance Monkey\r'), (19,7,'The Rolling Stones','Living In A Ghost Town\r'), (19,8,'SAINt JHN','Roses\r'), (19,9,'Iu','eight\r'), (19,10,'Benjamin Biolay','Comment est ta peine ?\r'), (19,11,'Black Eyed Peas','Mamacita\r'), (19,12,'Soprano','A Nos Héros Du Quotidien\r'), (19,13,'Tusa','Stats\r'), (19,14,'Ily','Stats\r'), (19,15,'Dua Lipa','Physical\r'), (19,16,'Calogero','On fait comme si\r'), (19,17,'Nea','Some Say\r'), (19,18,'Megan Thee Stallion','Savage\r'), (19,19,'Jenifer','Comme c\'est bon\r'), (19,20,'Elton John','I\'m Still Standing\r'), (19,21,'The Weeknd','In Your Eyes\r'), (19,22,'Regard','Ride It\r'), (19,23,'Vitaa','Avant toi\r'), (19,24,'Elton John','Your Song\r'), (19,25,'Ava Max','Salt\r'), (19,26,'Lewis Capaldi','Before You Go\r'), (19,27,'Soprano','Ninja\r'), (19,28,'Powfu','Death Bed\r'), (19,29,'Madonna','I Don\'t Search I Find\r'), (19,30,'Dua Lipa','Don\'t Start Now\r'), (19,31,'Drake','Toosie Slide\r'), (19,32,'Freya Ridings','Castles\r'), (19,33,'Lady Gaga','Stupid Love\r'), (19,34,'Soolking','Melegim\r'), (19,35,'Breaking Me','Stats\r'), (19,36,'I Love You','Stats\r'), (19,37,'Maroon 5','Memories\r'), (19,38,'Billie Eilish','Bad Guy\r'), (19,39,'Manu Pilas','Bella Ciao\r'), (19,40,'Lady Gaga','Shallow\r'), (19,41,'Robin Schulz','In Your Eyes\r'), (19,42,'Christophe','Les mots bleus\r'), (19,43,'Camélia Jordana','Facile\r'), (19,44,'Soprano','Le coach\r'), (19,45,'Imen Es','1ère fois\r'), (19,46,'Les Enfoirés','À côté de toi\r'), (19,47,'Helmut Fritz','Ça m\'énerve\r'), (19,48,'The Scotts','The Scotts\r'), (19,49,'Hoshi','Amour Censure\r'), (19,50,'Supalonely','Stats\r'), (20,1,'Ariana Grande','Stuck With U\r'), (20,2,'The Weeknd','Blinding Lights\r'), (20,3,'Et demain ? Le collectif','Et demain ?\r'), (20,4,'Doja Cat','Say So\r'), (20,5,'6ix9ine','Gooba\r'), (20,6,'Tones and I','Dance Monkey\r'), (20,7,'Booba','Jauné\r'), (20,8,'Young T & Bugsey','Don\'t Rush\r'), (20,9,'Vianney','N\'attendons pas\r'), (20,10,'SAINt JHN','Roses\r'), (20,11,'(I\'ve Had) The Time Of My Life','Stats\r'), (20,12,'The Rolling Stones','Living In A Ghost Town\r'), (20,13,'Tusa','Stats\r'), (20,14,'Lady Gaga','Shallow\r'), (20,15,'Black Eyed Peas','Mamacita\r'), (20,16,'Little Richard','Tutti Frutti\r'), (20,17,'Dua Lipa','Physical\r'), (20,18,'Ily','Stats\r'), (20,19,'The Weeknd','In Your Eyes\r'), (20,20,'Aldebert','Corona Minus, la chanson des gestes barrières pour l\'école\r'), (20,21,'Vitaa','Avant toi\r'), (20,22,'Benjamin Biolay','Comment est ta peine ?\r'), (20,23,'Jenifer','Comme c\'est bon\r'), (20,24,'Soprano','A Nos Héros Du Quotidien\r'), (20,25,'Powfu','Death Bed\r'), (20,26,'Lady Gaga','Stupid Love\r'), (20,27,'Vladimir Cauchemar','(G)rave\r'), (20,28,'I Love You','Stats\r'), (20,29,'Ava Max','Salt\r'), (20,30,'Eric Carmen','Hungry Eyes\r'), (20,31,'Lewis Capaldi','Before You Go\r'), (20,32,'Nea','Some Say\r'), (20,33,'She\'s Like The Wind','Stats\r'), (20,34,'Calogero','On fait comme si\r'), (20,35,'Soolking','Melegim\r'), (20,36,'Robin Schulz','In Your Eyes\r'), (20,37,'Richard Bona','Ngarbuh\r'), (20,38,'Soprano','Ninja\r'), (20,39,'Hatik','Angela\r'), (20,40,'Camélia Jordana','Facile\r'), (20,41,'Regard','Ride It\r'), (20,42,'Dua Lipa','Don\'t Start Now\r'), (20,43,'Keen\'v','Tahiti\r'), (20,44,'Les Enfoirés','À côté de toi\r'), (20,45,'Head Shoulders Knees & Toes','Stats\r'), (20,46,'Imen Es','1ère fois\r'), (20,47,'Drake','Toosie Slide\r'), (20,48,'Marc Lavoine','Chere amie\r'), (20,49,'Hoshi','Amour Censure\r'), (20,50,'The Ronettes','Be My Baby\r'), (21,1,'The Weeknd','Blinding Lights\r'), (21,2,'Doja Cat','Say So\r'), (21,3,'The Weeknd','In Your Eyes\r'), (21,4,'Tones and I','Dance Monkey\r'), (21,5,'Ariana Grande','Stuck With U\r'), (21,6,'Ily','Stats\r'), (21,7,'SAINt JHN','Roses\r'), (21,8,'-M-','Croîs au printemps\r'), (21,9,'Tusa','Stats\r'), (21,10,'Young T & Bugsey','Don\'t Rush\r'), (21,11,'Dua Lipa','Physical\r'), (21,12,'Jenifer','Comme c\'est bon\r'), (21,13,'Aldebert','Corona Minus, la chanson des gestes barrières pour l\'école\r'), (21,14,'Camélia Jordana','Facile\r'), (21,15,'Breaking Me','Stats\r'), (21,16,'Vianney','N\'attendons pas\r'), (21,17,'Katy Perry','Daisies\r'), (21,18,'6ix9ine','Gooba\r'), (21,19,'Benjamin Biolay','Comment est ta peine ?\r'), (21,20,'Kygo','Lose Somebody\r'), (21,21,'Hatik','Angela\r'), (21,22,'Et demain ? Le collectif','Et demain ?\r'), (21,23,'Soprano','Ninja\r'), (21,24,'Powfu','Death Bed\r'), (21,25,'Nea','Some Say\r'), (21,26,'I Love You','Stats\r'), (21,27,'Black Eyed Peas','Mamacita\r'), (21,28,'Booba','Jauné\r'), (21,29,'Lady Gaga','Stupid Love\r'), (21,30,'Soolking','Melegim\r'), (21,31,'Jonas Brothers','X\r'), (21,32,'Robin Schulz','In Your Eyes\r'), (21,33,'Vitaa','Avant toi\r'), (21,34,'Ava Max','Salt\r'), (21,35,'Gregory Porter','Revival\r'), (21,36,'Lewis Capaldi','Before You Go\r'), (21,37,'Lady Gaga','Shallow\r'), (21,38,'Curtis Mayfield','Move On Up\r'), (21,39,'Freya Ridings','Castles\r'), (21,40,'Regard','Ride It\r'), (21,41,'Master Kg','Jerusalem\r'), (21,42,'The Rolling Stones','Living In A Ghost Town\r'), (21,43,'Supalonely','Stats\r'), (21,44,'Soprano','A Nos Héros Du Quotidien\r'), (21,45,'Dua Lipa','Don\'t Start Now\r'), (21,46,'Israel Kamakawiwo\'ole','Over The Rainbow\r'), (21,47,'Imen Es','1ère fois\r'), (21,48,'Drake','Toosie Slide\r'), (21,49,'Vladimir Cauchemar','(G)rave\r'), (21,50,'Jul','Fait D\'or\r'), (22,1,'Indochine','Nos célébrations\r'), (22,2,'Lady Gaga','Rain On Me\r'), (22,3,'Agust D','Daechwita\r'), (22,4,'The Weeknd','Blinding Lights\r'), (22,5,'Candela','Stats\r'), (22,6,'Doja Cat','Say So\r'), (22,7,'Mory Kante','Yé ké yé ké\r'), (22,8,'The Weeknd','In Your Eyes\r'), (22,9,'Camélia Jordana','Facile\r'), (22,10,'SAINt JHN','Roses\r'), (22,11,'Tusa','Stats\r'), (22,12,'Agust D','Strange\r'), (22,13,'Agust D','Moonlight\r'), (22,14,'Agust D','What Do You Think?\r'), (22,15,'Burn It','Stats\r'), (22,16,'Agust D','People\r'), (22,17,'Hatik','Angela\r'), (22,18,'Black Eyed Peas','Mamacita\r'), (22,19,'28','Stats\r'), (22,20,'Tones and I','Dance Monkey\r'), (22,21,'Ily','Stats\r'), (22,22,'Dua Lipa','Physical\r'), (22,23,'Dear My Friend','Stats\r'), (22,24,'Ariana Grande','Stuck With U\r'), (22,25,'Agust D','Honsool\r'), (22,26,'Lady Gaga','Stupid Love\r'), (22,27,'Aldebert','Corona Minus, la chanson des gestes barrières pour l\'école\r'), (22,28,'Agust D','Interlude : Set Me Free\r'), (22,29,'Breaking Me','Stats\r'), (22,30,'Powfu','Death Bed\r'), (22,31,'Et demain ? Le collectif','Et demain ?\r'), (22,32,'Jenifer','Comme c\'est bon\r'), (22,33,'Criminel','Stats\r'), (22,34,'I Love You','Stats\r'), (22,35,'Young T & Bugsey','Don\'t Rush\r'), (22,36,'Curtis Mayfield','Move On Up\r'), (22,37,'Robin Schulz','In Your Eyes\r'), (22,38,'Marvin Gaye','Inner City Blues (make Me Wanna Holla)\r'), (22,39,'Soolking','Melegim\r'), (22,40,'Lady Gaga','Sour Candy\r'), (22,41,'Master Kg','Jerusalem\r'), (22,42,'Benjamin Biolay','Comment est ta peine ?\r'), (22,43,'Vianney','N\'attendons pas\r'), (22,44,'Soprano','Ninja\r'), (22,45,'Lewis Capaldi','Before You Go\r'), (22,46,'Vitaa','Avant toi\r'), (22,47,'Nea','Some Say\r'), (22,48,'Jul','Folie\r'), (22,49,'Ava Max','Salt\r'), (22,50,'Regard','Ride It\r'), (23,1,'Indochine','Nos célébrations\r'), (23,2,'The Weeknd','Blinding Lights\r'), (23,3,'The Weeknd','In Your Eyes\r'), (23,4,'Lady Gaga','Rain On Me\r'), (23,5,'SAINt JHN','Roses\r'), (23,6,'Ily','Stats\r'), (23,7,'Deluxe','Suite Et Fin\r'), (23,8,'Mr. Oizo','Pharmacist\r'), (23,9,'Doja Cat','Say So\r'), (23,10,'Hatik','Angela\r'), (23,11,'Breaking Me','Stats\r'), (23,12,'Tones and I','Dance Monkey\r'), (23,13,'Black Eyed Peas','Mamacita\r'), (23,14,'Lady Gaga','Stupid Love\r'), (23,15,'Dua Lipa','Physical\r'), (23,16,'Britney Spears','Mood Ring (by Demand)\r'), (23,17,'Lady Gaga','Sour Candy\r'), (23,18,'Powfu','Death Bed\r'), (23,19,'Tusa','Stats\r'), (23,20,'I Love You','Stats\r'), (23,21,'Jul','Folie\r'), (23,22,'Bob Sinclar','I\'m On My Way\r'), (23,23,'Master Kg','Jerusalem\r'), (23,24,'Ava Max','Kings & Queens\r'), (23,25,'Benjamin Biolay','Comment est ta peine ?\r'), (23,26,'Soprano','Ninja\r'), (23,27,'Nea','Some Say\r'), (23,28,'Robin Schulz','In Your Eyes\r'), (23,29,'Soolking','Melegim\r'), (23,30,'Camélia Jordana','Facile\r'), (23,31,'Ariana Grande','Stuck With U\r'), (23,32,'Jenifer','Comme c\'est bon\r'), (23,33,'Hoshi','Amour Censure\r'), (23,34,'Young T & Bugsey','Don\'t Rush\r'), (23,35,'Et demain ? Le collectif','Et demain ?\r'), (23,36,'Vitaa','Avant toi\r'), (23,37,'Lady Gaga','Shallow\r'), (23,38,'Supalonely','Stats\r'), (23,39,'Dua Lipa','Don\'t Start Now\r'), (23,40,'Regard','Ride It\r'), (23,41,'Vianney','N\'attendons pas\r'), (23,42,'Curtis Mayfield','Move On Up\r'), (23,43,'Lady Gaga','Alice\r'), (23,44,'Lewis Capaldi','Before You Go\r'), (23,45,'Aldebert','Corona Minus, la chanson des gestes barrières pour l\'école\r'), (23,46,'Tryo','Désolé pour hier soir XXV - Remix 2020\r'), (23,47,'Soprano','A Nos Héros Du Quotidien\r'), (23,48,'Ninho','Lettre À Une Femme\r'), (23,49,'DripReport','Skechers\r'), (23,50,'Freya Ridings','Castles\r'), (24,1,'Indochine','Nos célébrations\r'), (24,2,'The Weeknd','Blinding Lights\r'), (24,3,'The Weeknd','In Your Eyes\r'), (24,4,'Sheila','7Ème Continent\r'), (24,5,'Doja Cat','Say So\r'), (24,6,'Hatik','Angela\r'), (24,7,'Bosh','Djomb\r'), (24,8,'Ily','Stats\r'), (24,9,'Breaking Me','Stats\r'), (24,10,'SAINt JHN','Roses\r'), (24,11,'Lady Gaga','Rain On Me\r'), (24,12,'Dua Lipa','Physical\r'), (24,13,'Ava Max','Kings & Queens\r'), (24,14,'Tones and I','Dance Monkey\r'), (24,15,'Master Kg','Jerusalem\r'), (24,16,'Black Eyed Peas','Mamacita\r'), (24,17,'Hoshi','Amour Censure\r'), (24,18,'Tusa','Stats\r'), (24,19,'Powfu','Death Bed\r'), (24,20,'Jul','Folie\r'), (24,21,'I Love You','Stats\r'), (24,22,'Camélia Jordana','Facile\r'), (24,23,'Soolking','Melegim\r'), (24,24,'Benjamin Biolay','Comment est ta peine ?\r'), (24,25,'Lady Gaga','Stupid Love\r'), (24,26,'Robin Schulz','In Your Eyes\r'), (24,27,'Nea','Some Say\r'), (24,28,'Curtis Mayfield','Move On Up\r'), (24,29,'Vitaa','Avant toi\r'), (24,30,'Soprano','Ninja\r'), (24,31,'Vianney','N\'attendons pas\r'), (24,32,'Lewis Capaldi','Before You Go\r'), (24,33,'Young T & Bugsey','Don\'t Rush\r'), (24,34,'Ariana Grande','Stuck With U\r'), (24,35,'Wejdene','Anissa\r'), (24,36,'Stevie Wonder','Free\r'), (24,37,'Amir','La fête\r'), (24,38,'Et demain ? Le collectif','Et demain ?\r'), (24,39,'Keen\'v','Tahiti\r'), (24,40,'Dua Lipa','Don\'t Start Now\r'), (24,41,'Lady Gaga','Shallow\r'), (24,42,'Freya Ridings','Castles\r'), (24,43,'Ava Max','Salt\r'), (24,44,'The Quantic Soul Orchestra','Feeling Good\r'), (24,45,'Imen Es','1ère fois\r'), (24,46,'DripReport','Skechers\r'), (24,47,'Supalonely','Stats\r'), (24,48,'Regard','Ride It\r'), (24,49,'Kendji Girac','Habibi\r'), (24,50,'Tryo','Désolé pour hier soir XXV - Remix 2020\r'), (25,1,'Kendji Girac','Habibi\r'), (25,2,'Indochine','Nos célébrations\r'), (25,3,'Bosh','Djomb\r'), (25,4,'The Weeknd','In Your Eyes\r'), (25,5,'The Weeknd','Blinding Lights\r'), (25,6,'Ryan Paris','Dolce vita\r'), (25,7,'Trollz','Stats\r'), (25,8,'Hatik','Angela\r'), (25,9,'Breaking Me','Stats\r'), (25,10,'Benjamin Biolay','Comment est ta peine ?\r'), (25,11,'Master Kg','Jerusalem\r'), (25,12,'Black Eyed Peas','Mamacita\r'), (25,13,'Doja Cat','Say So\r'), (25,14,'Camélia Jordana','Facile\r'), (25,15,'Hoshi','Amour Censure\r'), (25,16,'Dua Lipa','Physical\r'), (25,17,'SAINt JHN','Roses\r'), (25,18,'Ava Max','Kings & Queens\r'), (25,19,'I Love You','Stats\r'), (25,20,'Et demain ? Le collectif','Et demain ?\r'), (25,21,'Ily','Stats\r'), (25,22,'Amir','La fête\r'), (25,23,'Vitaa','Avant toi\r'), (25,24,'Amel Bent','Jusqu\'au bout\r'), (25,25,'Soolking','Melegim\r'), (25,26,'Tones and I','Dance Monkey\r'), (25,27,'Vianney','N\'attendons pas\r'), (25,28,'Robin Schulz','In Your Eyes\r'), (25,29,'Powfu','Death Bed\r'), (25,30,'Wejdene','Anissa\r'), (25,31,'Tusa','Stats\r'), (25,32,'Clara Luciani','La grenade\r'), (25,33,'Keen\'v','Tahiti\r'), (25,34,'Lady Gaga','Rain On Me\r'), (25,35,'Lovely','Stats\r'), (25,36,'Clara Luciani','Ma sœur\r'), (25,37,'Michele Morrone','Hard For Me\r'), (25,38,'Head Shoulders Knees & Toes','Stats\r'), (25,39,'Imen Es','1ère fois\r'), (25,40,'Dadju','Bobo Au Coeur\r'), (25,41,'Tryo','Désolé pour hier soir XXV - Remix 2020\r'), (25,42,'Soprano','Ninja\r'), (25,43,'Kendji Girac','Les yeux de la mama\r'), (25,44,'El Capon','Shut up Chicken\r'), (25,45,'Jul','Folie\r'), (25,46,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (25,47,'Lady Gaga','Stupid Love\r'), (25,48,'Pas Beaux','Stats\r'), (25,49,'Maître Gims','Malheur, Malheur\r'), (25,50,'Nea','Some Say\r'), (26,1,'Grand Corps Malade','Mais je t\'aime\r'), (26,2,'Black Eyed Peas','Mamacita\r'), (26,3,'Bosh','Djomb\r'), (26,4,'Benjamin Biolay','Comment est ta peine ?\r'), (26,5,'Master KG','Jerusalema\r'), (26,6,'Ryan Paris','Dolce vita\r'), (26,7,'The Weeknd','In Your Eyes\r'), (26,8,'The Weeknd','Blinding Lights\r'), (26,9,'Hatik','Angela\r'), (26,10,'Camélia Jordana','Facile\r'), (26,11,'Kendji Girac','Habibi\r'), (26,12,'Breaking Me','Stats\r'), (26,13,'Indochine','Nos célébrations\r'), (26,14,'Doja Cat','Say So\r'), (26,15,'Ily','Stats\r'), (26,16,'Ava Max','Kings & Queens\r'), (26,17,'Dua Lipa','Physical\r'), (26,18,'BTS','Stay Gold\r'), (26,19,'Wejdene','Anissa\r'), (26,20,'Hoshi','Amour Censure\r'), (26,21,'Tayc','N\'y pense plus\r'), (26,22,'SAINt JHN','Roses\r'), (26,23,'Tones and I','Dance Monkey\r'), (26,24,'I Love You','Stats\r'), (26,25,'Powfu','Death Bed\r'), (26,26,'Amir','La fête\r'), (26,27,'Hélène Ségara','Plus jamais\r'), (26,28,'Dadju','Grand Bain\r'), (26,29,'Head Shoulders Knees & Toes','Stats\r'), (26,30,'Keen\'v','Tahiti\r'), (26,31,'Tusa','Stats\r'), (26,32,'Fally Ipupa','Allô téléphone\r'), (26,33,'Soolking','Melegim\r'), (26,34,'Gilbert Bécaud','Je Reviens Te Chercher\r'), (26,35,'Robin Schulz','In Your Eyes\r'), (26,36,'Beyoncé','BLACK PARADE\r'), (26,37,'Vianney','N\'attendons pas\r'), (26,38,'Vitaa','Avant toi\r'), (26,39,'Banana','Stats\r'), (26,40,'Que Ça Dure','Stats\r'), (26,41,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (26,42,'Jean-Baptiste Guegan','Tu es toujours là\r'), (26,43,'M. Pokora','Danse avec moi\r'), (26,44,'Lady Gaga','Rain On Me\r'), (26,45,'Nea','Some Say\r'), (26,46,'Astronomia','Stats\r'), (26,47,'Soprano','Ninja\r'), (26,48,'Jul','Folie\r'), (26,49,'Black Eyed Peas','RITMO (Bad Boys For Life)\r'), (26,50,'Boulevard Des Airs','Emmène moi\r'), (27,1,'Grand Corps Malade','Mais je t\'aime\r'), (27,2,'Benjamin Biolay','Comment est ta peine ?\r'), (27,3,'Julien Doré','La fièvre\r'), (27,4,'Black Eyed Peas','Mamacita\r'), (27,5,'Master KG','Jerusalema\r'), (27,6,'The Weeknd','Blinding Lights\r'), (27,7,'Hatik','Angela\r'), (27,8,'The Weeknd','In Your Eyes\r'), (27,9,'Bosh','Djomb\r'), (27,10,'BLACKPINK','How You Like That\r'), (27,11,'Camélia Jordana','Facile\r'), (27,12,'Breaking Me','Stats\r'), (27,13,'Indochine','Nos célébrations\r'), (27,14,'Gilbert Bécaud','Je Reviens Te Chercher\r'), (27,15,'Ryan Paris','Dolce vita\r'), (27,16,'Ava Max','Kings & Queens\r'), (27,17,'Dua Lipa','Physical\r'), (27,18,'Astronomia','Stats\r'), (27,19,'Keen\'v','Tahiti\r'), (27,20,'Ily','Stats\r'), (27,21,'Kendji Girac','Habibi\r'), (27,22,'Doja Cat','Say So\r'), (27,23,'Wejdene','Anissa\r'), (27,24,'Tones and I','Dance Monkey\r'), (27,25,'I Love You','Stats\r'), (27,26,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (27,27,'Tusa','Stats\r'), (27,28,'SAINt JHN','Roses\r'), (27,29,'Head Shoulders Knees & Toes','Stats\r'), (27,30,'Hoshi','Amour Censure\r'), (27,31,'Powfu','Death Bed\r'), (27,32,'Robin Schulz','In Your Eyes\r'), (27,33,'Soprano','Ninja\r'), (27,34,'M. Pokora','Danse avec moi\r'), (27,35,'Rockstar','Stats\r'), (27,36,'Lady Gaga','Rain On Me\r'), (27,37,'Soolking','Melegim\r'), (27,38,'Dadju','Grand Bain\r'), (27,39,'Vitaa','Avant toi\r'), (27,40,'Flo Delavega','Printemps éternel\r'), (27,41,'Vianney','N\'attendons pas\r'), (27,42,'Maître Gims','Malheur, Malheur\r'), (27,43,'Amir','La fête\r'), (27,44,'Britney Spears','Mood Ring (by Demand)\r'), (27,45,'Nea','Some Say\r'), (27,46,'Banana','Stats\r'), (27,47,'Imen Es','1ère fois\r'), (27,48,'Regard','Ride It\r'), (27,49,'Mylène Farmer','Devant soi\r'), (27,50,'Tayc','N\'y pense plus\r'), (28,1,'Grand Corps Malade','Mais je t\'aime\r'), (28,2,'Master KG','Jerusalema\r'), (28,3,'Benjamin Biolay','Comment est ta peine ?\r'), (28,4,'Grand Corps Malade','Mesdames\r'), (28,5,'Indochine','Nos célébrations\r'), (28,6,'The Weeknd','Blinding Lights\r'), (28,7,'Black Eyed Peas','Mamacita\r'), (28,8,'Hatik','Angela\r'), (28,9,'Louane','Donne-moi ton Cœur\r'), (28,10,'Ava Max','Kings & Queens\r'), (28,11,'The Weeknd','In Your Eyes\r'), (28,12,'Breaking Me','Stats\r'), (28,13,'Kendji Girac','Habibi\r'), (28,14,'Camélia Jordana','Facile\r'), (28,15,'Bosh','Djomb\r'), (28,16,'Étienne Daho','Comateens Vs. Etienne Daho / Exclu Fnac\r'), (28,17,'Reality','Stats\r'), (28,18,'Keen\'v','Tahiti\r'), (28,19,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (28,20,'Julien Doré','La fièvre\r'), (28,21,'Doja Cat','Say So\r'), (28,22,'Dua Lipa','Physical\r'), (28,23,'Wejdene','Anissa\r'), (28,24,'Ily','Stats\r'), (28,25,'Head Shoulders Knees & Toes','Stats\r'), (28,26,'I Love You','Stats\r'), (28,27,'Tones and I','Dance Monkey\r'), (28,28,'Kaaris','Goulag\r'), (28,29,'Astronomia','Stats\r'), (28,30,'Gilbert Bécaud','Je Reviens Te Chercher\r'), (28,31,'Robin Schulz','Alane\r'), (28,32,'Polo & Pan','Feel Good\r'), (28,33,'Tusa','Stats\r'), (28,34,'Amel Bent','Jusqu\'au bout\r'), (28,35,'SAINt JHN','Roses\r'), (28,36,'Dua Lipa','Break My Heart\r'), (28,37,'Rockstar','Stats\r'), (28,38,'Powfu','Death Bed\r'), (28,39,'Soprano','Ninja\r'), (28,40,'Robin Schulz','In Your Eyes\r'), (28,41,'Tayc','N\'y pense plus\r'), (28,42,'Amir','La fête\r'), (28,43,'Hoshi','Amour Censure\r'), (28,44,'Dadju','Grand Bain\r'), (28,45,'Banana','Stats\r'), (28,46,'Island','Stats\r'), (28,47,'Nea','Some Say\r'), (28,48,'Soolking','Melegim\r'), (28,49,'Vitaa','Avant toi\r'), (28,50,'Eva','Chelou\r'), (29,1,'Master KG','Jerusalema\r'), (29,2,'Indochine','Nos célébrations\r'), (29,3,'Grand Corps Malade','Mais je t\'aime\r'), (29,4,'Black Eyed Peas','Mamacita\r'), (29,5,'The Weeknd','Blinding Lights\r'), (29,6,'Ava Max','Kings & Queens\r'), (29,7,'The Weeknd','In Your Eyes\r'), (29,8,'Hatik','Angela\r'), (29,9,'Bosh','Djomb\r'), (29,10,'Benjamin Biolay','Comment est ta peine ?\r'), (29,11,'Camélia Jordana','Facile\r'), (29,12,'Keen\'v','Tahiti\r'), (29,13,'Ily','Stats\r'), (29,14,'Breaking Me','Stats\r'), (29,15,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (29,16,'Robin Schulz','Alane\r'), (29,17,'Bts','Your Eyes Tell\r'), (29,18,'Booba','Dolce Vita\r'), (29,19,'Dua Lipa','Physical\r'), (29,20,'Doja Cat','Say So\r'), (29,21,'Head Shoulders Knees & Toes','Stats\r'), (29,22,'Tones and I','Dance Monkey\r'), (29,23,'Banana','Stats\r'), (29,24,'Mylène Farmer','Comme j\'ai mal\r'), (29,25,'Mylène Farmer','Tristana\r'), (29,26,'Julien Doré','La fièvre\r'), (29,27,'I Love You','Stats\r'), (29,28,'Calogero','La rumeur\r'), (29,29,'Astronomia','Stats\r'), (29,30,'Wejdene','Anissa\r'), (29,31,'Louane','Donne-moi ton Cœur\r'), (29,32,'Kendji Girac','Habibi\r'), (29,33,'Grand Corps Malade','Mesdames\r'), (29,34,'Tusa','Stats\r'), (29,35,'Tayc','N\'y pense plus\r'), (29,36,'Soprano','Ninja\r'), (29,37,'Mylène Farmer','Plus Grandir\r'), (29,38,'Depeche Mode','Violator - The 12\r'), (29,39,'Mylène Farmer','Sans logique\r'), (29,40,'Trois Cafés Gourmands','On t\'emmène\r'), (29,41,'Powfu','Death Bed\r'), (29,42,'SAINt JHN','Roses\r'), (29,43,'Robin Schulz','In Your Eyes\r'), (29,44,'Amir','La fête\r'), (29,45,'La Meilleure','Stats\r'), (29,46,'Mylène Farmer','Que mon coeur lâche\r'), (29,47,'Amel Bent','Jusqu\'au bout\r'), (29,48,'BTS','Moon\r'), (29,49,'Mylène Farmer','Pourvu qu\'elles soient douces\r'), (29,50,'Dadju','Grand Bain\r'), (30,1,'Master KG','Jerusalema\r'), (30,2,'Aya Nakamura','Jolie nana\r'), (30,3,'Indochine','Nos célébrations\r'), (30,4,'Grand Corps Malade','Mais je t\'aime\r'), (30,5,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (30,6,'Keen\'v','Tahiti\r'), (30,7,'The Weeknd','In Your Eyes\r'), (30,8,'Black Eyed Peas','Mamacita\r'), (30,9,'Joy Division','Love Will Tear Us Apart\r'), (30,10,'Joy Division','Atmosphere\r'), (30,11,'The Weeknd','Blinding Lights\r'), (30,12,'Hatik','Angela\r'), (30,13,'Breaking Me','Stats\r'), (30,14,'Robin Schulz','Alane\r'), (30,15,'Ava Max','Kings & Queens\r'), (30,16,'Joy Division','Transmission\r'), (30,17,'Camélia Jordana','Facile\r'), (30,18,'Benjamin Biolay','Comment est ta peine ?\r'), (30,19,'Bosh','Djomb\r'), (30,20,'Doja Cat','Say So\r'), (30,21,'Julien Doré','La fièvre\r'), (30,22,'Ily','Stats\r'), (30,23,'Tayc','N\'y pense plus\r'), (30,24,'Amir','La fête\r'), (30,25,'Tones and I','Dance Monkey\r'), (30,26,'Booba','Dolce Vita\r'), (30,27,'Banana','Stats\r'), (30,28,'Louane','Donne-moi ton Cœur\r'), (30,29,'SAINt JHN','Roses\r'), (30,30,'Wejdene','Anissa\r'), (30,31,'Head Shoulders Knees & Toes','Stats\r'), (30,32,'I Love You','Stats\r'), (30,33,'Dua Lipa','Physical\r'), (30,34,'Kygo','What\'s Love Got To Do With It\r'), (30,35,'Kendji Girac','Habibi\r'), (30,36,'La Meilleure','Stats\r'), (30,37,'Astronomia','Stats\r'), (30,38,'Depeche Mode','Violator - The 12\r'), (30,39,'Amel Bent','Jusqu\'au bout\r'), (30,40,'Grand Corps Malade','Mesdames\r'), (30,41,'Tusa','Stats\r'), (30,42,'Mylène Farmer','Comme j\'ai mal\r'), (30,43,'Lady Gaga','Rain On Me\r'), (30,44,'House Of Pain','Jump Around\r'), (30,45,'Kill Me Slow','Stats\r'), (30,46,'Powfu','Death Bed\r'), (30,47,'Dua Lipa','Break My Heart\r'), (30,48,'Jean-Jacques Goldman','Puisque tu pars\r'), (30,49,'Dadju','Grand Bain\r'), (30,50,'Rockstar','Stats\r'), (31,1,'Master KG','Jerusalema\r'), (31,2,'Julien Doré','La fièvre\r'), (31,3,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (31,4,'Aya Nakamura','Jolie nana\r'), (31,5,'Grand Corps Malade','Mais je t\'aime\r'), (31,6,'Indochine','Nos célébrations\r'), (31,7,'The Weeknd','In Your Eyes\r'), (31,8,'Robin Schulz','Alane\r'), (31,9,'Black Eyed Peas','Mamacita\r'), (31,10,'Benjamin Biolay','Comment est ta peine ?\r'), (31,11,'Keen\'v','Tahiti\r'), (31,12,'Ava Max','Kings & Queens\r'), (31,13,'The Weeknd','Blinding Lights\r'), (31,14,'Hatik','Angela\r'), (31,15,'Camélia Jordana','Facile\r'), (31,16,'Breaking Me','Stats\r'), (31,17,'Ily','Stats\r'), (31,18,'Banana','Stats\r'), (31,19,'Bosh','Djomb\r'), (31,20,'Head Shoulders Knees & Toes','Stats\r'), (31,21,'Mylène Farmer','Pourvu qu\'elles soient douces\r'), (31,22,'Tones and I','Dance Monkey\r'), (31,23,'Tayc','N\'y pense plus\r'), (31,24,'Dua Lipa','Physical\r'), (31,25,'Wejdene','Anissa\r'), (31,26,'I Love You','Stats\r'), (31,27,'Little Mix','Holiday\r'), (31,28,'Astronomia','Stats\r'), (31,29,'SAINt JHN','Roses\r'), (31,30,'Amel Bent','Jusqu\'au bout\r'), (31,31,'Louane','Donne-moi ton Cœur\r'), (31,32,'Doja Cat','Say So\r'), (31,33,'Kill Me Slow','Stats\r'), (31,34,'Amir','La fête\r'), (31,35,'Kendji Girac','Habibi\r'), (31,36,'Control','Stats\r'), (31,37,'Dua Lipa','Break My Heart\r'), (31,38,'Kylie Minogue','Say Something\r'), (31,39,'Tusa','Stats\r'), (31,40,'Powfu','Death Bed\r'), (31,41,'La Meilleure','Stats\r'), (31,42,'Dadju','Grand Bain\r'), (31,43,'The Sound Of Silence','Stats\r'), (31,44,'Booba','Dolce Vita\r'), (31,45,'Grand Corps Malade','Mesdames\r'), (31,46,'Taylor Swift','Cardigan\r'), (31,47,'Rockstar','Stats\r'), (31,48,'Reality','Stats\r'), (31,49,'Nea','Some Say\r'), (31,50,'Summer Wine','Stats\r'), (32,1,'Master KG','Jerusalema\r'), (32,2,'Woodkid','Goliath\r'), (32,3,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (32,4,'Grand Corps Malade','Mais je t\'aime\r'), (32,5,'Aya Nakamura','Jolie nana\r'), (32,6,'Indochine','Nos célébrations\r'), (32,7,'Robin Schulz','Alane\r'), (32,8,'The Weeknd','In Your Eyes\r'), (32,9,'Black Eyed Peas','Mamacita\r'), (32,10,'The Weeknd','Blinding Lights\r'), (32,11,'Ava Max','Kings & Queens\r'), (32,12,'Benjamin Biolay','Comment est ta peine ?\r'), (32,13,'Tayc','N\'y pense plus\r'), (32,14,'Keen\'v','Tahiti\r'), (32,15,'Camélia Jordana','Facile\r'), (32,16,'Banana','Stats\r'), (32,17,'Hatik','Angela\r'), (32,18,'Head Shoulders Knees & Toes','Stats\r'), (32,19,'Julien Doré','La fièvre\r'), (32,20,'Billie Eilish','my future\r'), (32,21,'BTS','Filter\r'), (32,22,'Ily','Stats\r'), (32,23,'Breaking Me','Stats\r'), (32,24,'Doja Cat','Say So\r'), (32,25,'Bosh','Djomb\r'), (32,26,'Tones and I','Dance Monkey\r'), (32,27,'Amir','La fête\r'), (32,28,'Wejdene','Anissa\r'), (32,29,'Bilal Hassani','Dead Bae\r'), (32,30,'Dadju','Grand Bain\r'), (32,31,'Dua Lipa','Physical\r'), (32,32,'Amel Bent','Jusqu\'au bout\r'), (32,33,'I Love You','Stats\r'), (32,34,'Kaaris','NRV\r'), (32,35,'Astronomia','Stats\r'), (32,36,'Louane','Donne-moi ton Cœur\r'), (32,37,'Grand Corps Malade','Mesdames\r'), (32,38,'Dua Lipa','Break My Heart\r'), (32,39,'Kill Me Slow','Stats\r'), (32,40,'Kendji Girac','Habibi\r'), (32,41,'SAINt JHN','Roses\r'), (32,42,'Control','Stats\r'), (32,43,'Ava Max','Who\'s Laughing Now\r'), (32,44,'Powfu','Death Bed\r'), (32,45,'La Meilleure','Stats\r'), (32,46,'Summer Wine','Stats\r'), (32,47,'Trois Cafés Gourmands','On t\'emmène\r'), (32,48,'Tusa','Stats\r'), (32,49,'Beyoncé','Already\r'), (32,50,'Daniela Andrade','Crazy\r'), (33,1,'Master KG','Jerusalema\r'), (33,2,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (33,3,'Grand Corps Malade','Mais je t\'aime\r'), (33,4,'Indochine','Nos célébrations\r'), (33,5,'Aya Nakamura','Jolie nana\r'), (33,6,'Robin Schulz','Alane\r'), (33,7,'The Weeknd','In Your Eyes\r'), (33,8,'Black Eyed Peas','Mamacita\r'), (33,9,'The Weeknd','Blinding Lights\r'), (33,10,'Ava Max','Kings & Queens\r'), (33,11,'Benjamin Biolay','Comment est ta peine ?\r'), (33,12,'Tayc','N\'y pense plus\r'), (33,13,'Julien Doré','La fièvre\r'), (33,14,'Camélia Jordana','Facile\r'), (33,15,'Keen\'v','Tahiti\r'), (33,16,'Banana','Stats\r'), (33,17,'Head Shoulders Knees & Toes','Stats\r'), (33,18,'Hatik','Angela\r'), (33,19,'BTS','Inner Child\r'), (33,20,'Dua Lipa','Physical\r'), (33,21,'Breaking Me','Stats\r'), (33,22,'Dua Lipa','Break My Heart\r'), (33,23,'Bosh','Djomb\r'), (33,24,'Wap','Stats\r'), (33,25,'Ily','Stats\r'), (33,26,'Control','Stats\r'), (33,27,'Louane','Donne-moi ton Cœur\r'), (33,28,'Kygo','What\'s Love Got To Do With It\r'), (33,29,'SAINt JHN','Roses\r'), (33,30,'Doja Cat','Say So\r'), (33,31,'Astronomia','Stats\r'), (33,32,'Wejdene','Anissa\r'), (33,33,'Amel Bent','Jusqu\'au bout\r'), (33,34,'I Love You','Stats\r'), (33,35,'Tones and I','Dance Monkey\r'), (33,36,'Amir','La fête\r'), (33,37,'Grand Corps Malade','Mesdames\r'), (33,38,'Powfu','Death Bed\r'), (33,39,'Dadju','Grand Bain\r'), (33,40,'Kendji Girac','Habibi\r'), (33,41,'Tusa','Stats\r'), (33,42,'La Meilleure','Stats\r'), (33,43,'Maître Gims','Malheur, Malheur\r'), (33,44,'Hypnotized','Stats\r'), (33,45,'Trois Cafés Gourmands','On t\'emmène\r'), (33,46,'Alliel','Encore\r'), (33,47,'Tom Gregory','Fingertips\r'), (33,48,'Nea','Some Say\r'), (33,49,'Claudio Capéo','C\'est une chanson\r'), (33,50,'Harry Styles','Watermelon Sugar\r'), (34,1,'Master KG','Jerusalema\r'), (34,2,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (34,3,'Grand Corps Malade','Mais je t\'aime\r'), (34,4,'Indochine','Nos célébrations\r'), (34,5,'Bande Organisée','Stats\r'), (34,6,'Miley Cyrus','Midnight Sky\r'), (34,7,'Robin Schulz','Alane\r'), (34,8,'Aya Nakamura','Jolie nana\r'), (34,9,'Ava Max','Kings & Queens\r'), (34,10,'Camélia Jordana','Facile\r'), (34,11,'The Weeknd','In Your Eyes\r'), (34,12,'BTS','My Time\r'), (34,13,'Black Eyed Peas','Mamacita\r'), (34,14,'Head Shoulders Knees & Toes','Stats\r'), (34,15,'Benjamin Biolay','Comment est ta peine ?\r'), (34,16,'The Weeknd','Blinding Lights\r'), (34,17,'Ça Ira','Stats\r'), (34,18,'Julien Doré','La fièvre\r'), (34,19,'Tayc','N\'y pense plus\r'), (34,20,'Banana','Stats\r'), (34,21,'Keen\'v','Tahiti\r'), (34,22,'Dua Lipa','Levitating\r'), (34,23,'Hatik','Angela\r'), (34,24,'Breaking Me','Stats\r'), (34,25,'Ily','Stats\r'), (34,26,'Louane','Donne-moi ton Cœur\r'), (34,27,'Wejdene','Anissa\r'), (34,28,'Bosh','Djomb\r'), (34,29,'Dua Lipa','Break My Heart\r'), (34,30,'Amel Bent','Jusqu\'au bout\r'), (34,31,'Grand Corps Malade','Mesdames\r'), (34,32,'Tones and I','Dance Monkey\r'), (34,33,'Dua Lipa','Physical\r'), (34,34,'Laugh Now Cry Later','Stats\r'), (34,35,'I Love You','Stats\r'), (34,36,'Astronomia','Stats\r'), (34,37,'Doja Cat','Say So\r'), (34,38,'SAINt JHN','Roses\r'), (34,39,'Amir','La fête\r'), (34,40,'Kygo','What\'s Love Got To Do With It\r'), (34,41,'Dadju','Grand Bain\r'), (34,42,'Control','Stats\r'), (34,43,'Wap','Stats\r'), (34,44,'Kylie Minogue','Say Something\r'), (34,45,'Wejdene','Coco\r'), (34,46,'Kendji Girac','Habibi\r'), (34,47,'Harry Styles','Watermelon Sugar\r'), (34,48,'Alliel','Encore\r'), (34,49,'La Meilleure','Stats\r'), (34,50,'Vitaa','Avant toi\r'), (35,1,'BTS','Dynamite\r'), (35,2,'Master KG','Jerusalema\r'), (35,3,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (35,4,'Grand Corps Malade','Mais je t\'aime\r'), (35,5,'Bande Organisée','Stats\r'), (35,6,'Woodkid','Pale Yellow\r'), (35,7,'Indochine','Nos célébrations\r'), (35,8,'Vianney','beau-papa\r'), (35,9,'The Weeknd','In Your Eyes\r'), (35,10,'Robin Schulz','Alane\r'), (35,11,'Head Shoulders Knees & Toes','Stats\r'), (35,12,'Aya Nakamura','Jolie nana\r'), (35,13,'Ava Max','Kings & Queens\r'), (35,14,'Camélia Jordana','Facile\r'), (35,15,'The Weeknd','Blinding Lights\r'), (35,16,'Amel Bent','Jusqu\'au bout\r'), (35,17,'Tayc','N\'y pense plus\r'), (35,18,'Benjamin Biolay','Comment est ta peine ?\r'), (35,19,'Black Eyed Peas','Mamacita\r'), (35,20,'Julien Doré','La fièvre\r'), (35,21,'Wejdene','Coco\r'), (35,22,'Keen\'v','Tahiti\r'), (35,23,'Control','Stats\r'), (35,24,'Dua Lipa','Break My Heart\r'), (35,25,'Breaking Me','Stats\r'), (35,26,'Banana','Stats\r'), (35,27,'Bosh','Djomb\r'), (35,28,'Astronomia','Stats\r'), (35,29,'Ily','Stats\r'), (35,30,'Kendji Girac','Habibi\r'), (35,31,'London Grammar','Baby It\'s You\r'), (35,32,'Dua Lipa','Physical\r'), (35,33,'Louane','Donne-moi ton Cœur\r'), (35,34,'Harry Styles','Watermelon Sugar\r'), (35,35,'Hatik','Angela\r'), (35,36,'Amir','La fête\r'), (35,37,'Tones and I','Dance Monkey\r'), (35,38,'Wejdene','Anissa\r'), (35,39,'I Love You','Stats\r'), (35,40,'Grand Corps Malade','Mesdames\r'), (35,41,'Radiohead','Creep\r'), (35,42,'Julien Doré','Barracuda II\r'), (35,43,'Kygo','What\'s Love Got To Do With It\r'), (35,44,'Dadju','Grand Bain\r'), (35,45,'Doja Cat','Say So\r'), (35,46,'SAINt JHN','Roses\r'), (35,47,'Clean Bandit','Tick Tock\r'), (35,48,'Save The Day','Stats\r'), (35,49,'Hypnotized','Stats\r'), (35,50,'Tom Gregory','Fingertips\r'), (36,1,'Master KG','Jerusalema\r'), (36,2,'BTS','Dynamite\r'), (36,3,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (36,4,'Bande Organisée','Stats\r'), (36,5,'Indochine','Nos célébrations\r'), (36,6,'Grand Corps Malade','Mais je t\'aime\r'), (36,7,'The Weeknd','In Your Eyes\r'), (36,8,'Robin Schulz','Alane\r'), (36,9,'Tayc','N\'y pense plus\r'), (36,10,'Ice Cream','Stats\r'), (36,11,'Head Shoulders Knees & Toes','Stats\r'), (36,12,'Julien Doré','La fièvre\r'), (36,13,'Kendji Girac','Dernier métro\r'), (36,14,'The Weeknd','Blinding Lights\r'), (36,15,'Benjamin Biolay','Comment est ta peine ?\r'), (36,16,'Camélia Jordana','Facile\r'), (36,17,'Ava Max','Kings & Queens\r'), (36,18,'Aya Nakamura','Jolie nana\r'), (36,19,'Calogero','Les feux d\'artifice\r'), (36,20,'Control','Stats\r'), (36,21,'Wejdene','Coco\r'), (36,22,'Keen\'v','Tahiti\r'), (36,23,'Amel Bent','Jusqu\'au bout\r'), (36,24,'Julien Doré','Barracuda I\r'), (36,25,'Black Eyed Peas','Mamacita\r'), (36,26,'Breaking Me','Stats\r'), (36,27,'Wap','Stats\r'), (36,28,'Hatik','Angela\r'), (36,29,'Harry Styles','Watermelon Sugar\r'), (36,30,'Hypnotized','Stats\r'), (36,31,'Amir','La fête\r'), (36,32,'Banana','Stats\r'), (36,33,'Louane','Donne-moi ton Cœur\r'), (36,34,'Dua Lipa','Physical\r'), (36,35,'Wejdene','Anissa\r'), (36,36,'Francis Cabrel','Te ressembler\r'), (36,37,'Vianney','beau-papa\r'), (36,38,'Kygo','What\'s Love Got To Do With It\r'), (36,39,'Tones and I','Dance Monkey\r'), (36,40,'Dua Lipa','Break My Heart\r'), (36,41,'Ily','Stats\r'), (36,42,'Calvin Harris','Over Now\r'), (36,43,'Be Mine Tonight','Stats\r'), (36,44,'Le Coeur Holiday','Stats\r'), (36,45,'Gregory Porter','Revival\r'), (36,46,'Grand Corps Malade','Mesdames\r'), (36,47,'Tom Gregory','Fingertips\r'), (36,48,'Dadju','Grand Bain\r'), (36,49,'Kanoé','Bizness\r'), (36,50,'SAINt JHN','Roses\r'), (37,1,'Master KG','Jerusalema\r'), (37,2,'Bande Organisée','Stats\r'), (37,3,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (37,4,'Grand Corps Malade','Mais je t\'aime\r'), (37,5,'Julien Doré','La fièvre\r'), (37,6,'Indochine','Nos célébrations\r'), (37,7,'Head Shoulders Knees & Toes','Stats\r'), (37,8,'The Weeknd','In Your Eyes\r'), (37,9,'Robin Schulz','Alane\r'), (37,10,'Tayc','N\'y pense plus\r'), (37,11,'Control','Stats\r'), (37,12,'Restons Amis','Stats\r'), (37,13,'Grégory Lemarchal','Écris l\'histoire\r'), (37,14,'The Weeknd','Blinding Lights\r'), (37,15,'Bilal Hassani','Tom\r'), (37,16,'Aya Nakamura','Jolie nana\r'), (37,17,'Benjamin Biolay','Comment est ta peine ?\r'), (37,18,'Keen\'v','Tahiti\r'), (37,19,'Black Eyed Peas','Mamacita\r'), (37,20,'Wejdene','Coco\r'), (37,21,'Louane','Donne-moi ton Cœur\r'), (37,22,'Amel Bent','Jusqu\'au bout\r'), (37,23,'Camélia Jordana','Facile\r'), (37,24,'Ava Max','Kings & Queens\r'), (37,25,'Grégory Lemarchal','SOS d\'un terrien en détresse\r'), (37,26,'Wap','Stats\r'), (37,27,'Grand Corps Malade','Mesdames\r'), (37,28,'Breaking Me','Stats\r'), (37,29,'Banana','Stats\r'), (37,30,'Harry Styles','Watermelon Sugar\r'), (37,31,'BTS','Dynamite\r'), (37,32,'Julien Doré','Barracuda I\r'), (37,33,'Amir','La fête\r'), (37,34,'Kygo','What\'s Love Got To Do With It\r'), (37,35,'Dua Lipa','Physical\r'), (37,36,'Hypnotized','Stats\r'), (37,37,'Ily','Stats\r'), (37,38,'Tones and I','Dance Monkey\r'), (37,39,'Dua Lipa','Break My Heart\r'), (37,40,'Wejdene','Anissa\r'), (37,41,'Gregory Porter','Revival\r'), (37,42,'Billie Eilish','idontwannabeyouanymore\r'), (37,43,'Vianney','beau-papa\r'), (37,44,'Hatik','Angela\r'), (37,45,'Popstar','Stats\r'), (37,46,'Kendji Girac','Dernier métro\r'), (37,47,'Lady Gaga','Shallow\r'), (37,48,'Tom Gregory','Fingertips\r'), (37,49,'Dadju','Grand Bain\r'), (37,50,'Ava Max','Who\'s Laughing Now\r'), (38,1,'Master KG','Jerusalema\r'), (38,2,'Mylène Farmer','Coffret\r'), (38,3,'Bande Organisée','Stats\r'), (38,4,'Grand Corps Malade','Mais je t\'aime\r'), (38,5,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (38,6,'David Guetta','Let\'s Love\r'), (38,7,'Grand Corps Malade','Mesdames\r'), (38,8,'Control','Stats\r'), (38,9,'Indochine','Nos célébrations\r'), (38,10,'Head Shoulders Knees & Toes','Stats\r'), (38,11,'The Weeknd','In Your Eyes\r'), (38,12,'Julien Doré','La fièvre\r'), (38,13,'Naza','Joli Bébé\r'), (38,14,'Hypnotized','Stats\r'), (38,15,'The Weeknd','Blinding Lights\r'), (38,16,'Benjamin Biolay','Comment est ta peine ?\r'), (38,17,'Robin Schulz','Alane\r'), (38,18,'Wejdene','Coco\r'), (38,19,'Louane','Donne-moi ton Cœur\r'), (38,20,'Vianney','beau-papa\r'), (38,21,'Ava Max','Kings & Queens\r'), (38,22,'Amel Bent','Jusqu\'au bout\r'), (38,23,'Camélia Jordana','Facile\r'), (38,24,'Lucenzo','No me ama\r'), (38,25,'Tayc','N\'y pense plus\r'), (38,26,'Grand Corps Malade','Derrière Le Brouillard\r'), (38,27,'Aya Nakamura','Jolie nana\r'), (38,28,'Pendant 24h','Stats\r'), (38,29,'Kygo','What\'s Love Got To Do With It\r'), (38,30,'Kendji Girac','Dernier métro\r'), (38,31,'Wap','Stats\r'), (38,32,'BTS','Dynamite\r'), (38,33,'Adele','All I Ask\r'), (38,34,'Julien Doré','Barracuda II\r'), (38,35,'Mood','Stats\r'), (38,36,'Blueberry Eyes','Stats\r'), (38,37,'Wejdene','Anissa\r'), (38,38,'Ray Dalton','In My Bones\r'), (38,39,'Hatik','Angela\r'), (38,40,'Keen\'v','Tahiti\r'), (38,41,'Harry Styles','Watermelon Sugar\r'), (38,42,'Ava Max','Who\'s Laughing Now\r'), (38,43,'Tom Gregory','Fingertips\r'), (38,44,'Michael Kiwanuka','Cold Little Heart\r'), (38,45,'Black Eyed Peas','Mamacita\r'), (38,46,'Breaking Me','Stats\r'), (38,47,'Banana','Stats\r'), (38,48,'Asaf Avidan','Lost Horse\r'), (38,49,'Oh My Gawd','Stats\r'), (38,50,'Dua Lipa','Physical\r'), (39,1,'Master KG','Jerusalema\r'), (39,2,'Mylène Farmer','L\'âme dans l\'eau\r'), (39,3,'Bande Organisée','Stats\r'), (39,4,'Grand Corps Malade','Mais je t\'aime\r'), (39,5,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (39,6,'BTS','Dynamite\r'), (39,7,'Control','Stats\r'), (39,8,'Mylène Farmer','Coffret\r'), (39,9,'Grand Corps Malade','Mesdames\r'), (39,10,'Naza','Joli Bébé\r'), (39,11,'Head Shoulders Knees & Toes','Stats\r'), (39,12,'Indochine','Nos célébrations\r'), (39,13,'David Guetta','Let\'s Love\r'), (39,14,'Ava Max','Kings & Queens\r'), (39,15,'The Weeknd','In Your Eyes\r'), (39,16,'The Weeknd','Blinding Lights\r'), (39,17,'Julien Doré','La fièvre\r'), (39,18,'Hypnotized','Stats\r'), (39,19,'Benjamin Biolay','Comment est ta peine ?\r'), (39,20,'Kygo','Hot Stuff\r'), (39,21,'Justin Bieber','Holy\r'), (39,22,'Vianney','beau-papa\r'), (39,23,'Amel Bent','Jusqu\'au bout\r'), (39,24,'Lucenzo','No me ama\r'), (39,25,'Louane','Donne-moi ton Cœur\r'), (39,26,'Robin Schulz','Alane\r'), (39,27,'Radiohead','Creep\r'), (39,28,'Christophe Maé','L\'ours\r'), (39,29,'Mood','Stats\r'), (39,30,'Kendji Girac','Dernier métro\r'), (39,31,'Ava Max','Who\'s Laughing Now\r'), (39,32,'Harry Styles','Watermelon Sugar\r'), (39,33,'Wejdene','Coco\r'), (39,34,'Ben Mazué','Quand je marche\r'), (39,35,'Camélia Jordana','Facile\r'), (39,36,'Vida Loca','Stats\r'), (39,37,'Calogero','Celui d\'en bas\r'), (39,38,'Hatik','Angela\r'), (39,39,'Keen\'v','Tahiti\r'), (39,40,'Dadju','Grand Bain\r'), (39,41,'Patrick Fiori','J\'y vais\r'), (39,42,'Michael Kiwanuka','Cold Little Heart\r'), (39,43,'Tayc','N\'y pense plus\r'), (39,44,'Kygo','What\'s Love Got To Do With It\r'), (39,45,'Ray Dalton','In My Bones\r'), (39,46,'Amir','La fête\r'), (39,47,'Tom Gregory','Fingertips\r'), (39,48,'Jason Derulo','Take You Dancing\r'), (39,49,'Lady Gaga','Shallow\r'), (39,50,'Breaking Me','Stats\r'), (40,1,'Master KG','Jerusalema\r'), (40,2,'Bande Organisée','Stats\r'), (40,3,'Naza','Joli Bébé\r'), (40,4,'M. Pokora','Si on disait\r'), (40,5,'Grand Corps Malade','Mais je t\'aime\r'), (40,6,'Mylène Farmer','L\'âme dans l\'eau\r'), (40,7,'Control','Stats\r'), (40,8,'Indochine','Nos célébrations\r'), (40,9,'Asaf Avidan','Lost Horse\r'), (40,10,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (40,11,'Grand Corps Malade','Mesdames\r'), (40,12,'Hypnotized','Stats\r'), (40,13,'Julien Doré','La fièvre\r'), (40,14,'David Guetta','Let\'s Love\r'), (40,15,'Vianney','beau-papa\r'), (40,16,'The Weeknd','In Your Eyes\r'), (40,17,'The Weeknd','Blinding Lights\r'), (40,18,'Radiohead','Creep\r'), (40,19,'Head Shoulders Knees & Toes','Stats\r'), (40,20,'Amel Bent','Jusqu\'au bout\r'), (40,21,'Ava Max','Kings & Queens\r'), (40,22,'Benjamin Biolay','Comment est ta peine ?\r'), (40,23,'Kygo','Hot Stuff\r'), (40,24,'Louane','Donne-moi ton Cœur\r'), (40,25,'Kendji Girac','Dernier métro\r'), (40,26,'BTS','Dynamite\r'), (40,27,'Wejdene','Coco\r'), (40,28,'La Meilleure','Stats\r'), (40,29,'Kylie Minogue','Magic\r'), (40,30,'Harry Styles','Watermelon Sugar\r'), (40,31,'Ava Max','Who\'s Laughing Now\r'), (40,32,'Dadju','Amour toxic\r'), (40,33,'Mood','Stats\r'), (40,34,'Pendant 24h','Stats\r'), (40,35,'Sam Smith','Diamonds\r'), (40,36,'Patrick Fiori','J\'y vais\r'), (40,37,'Camélia Jordana','Facile\r'), (40,38,'Michael Kiwanuka','Cold Little Heart\r'), (40,39,'Tayc','N\'y pense plus\r'), (40,40,'Robin Schulz','Alane\r'), (40,41,'Kygo','What\'s Love Got To Do With It\r'), (40,42,'Lucky Luke','Cooler Than Me\r'), (40,43,'Hatik','Angela\r'), (40,44,'Vida Loca','Stats\r'), (40,45,'Tom Gregory','Fingertips\r'), (40,46,'Dadju','Grand Bain\r'), (40,47,'Ray Dalton','In My Bones\r'), (40,48,'Pa\' Ti','Stats\r'), (40,49,'Ça Ira','Stats\r'), (40,50,'Wejdene','Anissa\r'), (41,1,'Master KG','Jerusalema\r'), (41,2,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (41,3,'Bande Organisée','Stats\r'), (41,4,'Naza','Joli Bébé\r'), (41,5,'Control','Stats\r'), (41,6,'Grand Corps Malade','Mais je t\'aime\r'), (41,7,'Hypnotized','Stats\r'), (41,8,'Indochine','Nos célébrations\r'), (41,9,'Van Halen','Jump\r'), (41,10,'David Guetta','Let\'s Love\r'), (41,11,'Patrick Fiori','J\'y vais\r'), (41,12,'Billie Eilish','No Time To Die\r'), (41,13,'Mylène Farmer','L\'âme dans l\'eau\r'), (41,14,'The Weeknd','In Your Eyes\r'), (41,15,'The Weeknd','Blinding Lights\r'), (41,16,'Head Shoulders Knees & Toes','Stats\r'), (41,17,'Vianney','beau-papa\r'), (41,18,'Kygo','Hot Stuff\r'), (41,19,'Amel Bent','Jusqu\'au bout\r'), (41,20,'Julien Doré','La fièvre\r'), (41,21,'M. Pokora','Si on disait\r'), (41,22,'Grand Corps Malade','Mesdames\r'), (41,23,'Jean-Pierre Danel','Speed Limit\r'), (41,24,'Blackpink','Lovesick Girls\r'), (41,25,'Ça Ira','Stats\r'), (41,26,'Kendji Girac','Dernier métro\r'), (41,27,'Jean-Pierre Danel','Philippine\'s Smiles\r'), (41,28,'Dreams','Stats\r'), (41,29,'Benjamin Biolay','Comment est ta peine ?\r'), (41,30,'La Meilleure','Stats\r'), (41,31,'Asaf Avidan','Lost Horse\r'), (41,32,'Josh Groban','You Raise Me Up\r'), (41,33,'Louane','Donne-moi ton Cœur\r'), (41,34,'Ava Max','Who\'s Laughing Now\r'), (41,35,'BTS','Dynamite\r'), (41,36,'AC/DC','Shot In The Dark\r'), (41,37,'Harry Styles','Watermelon Sugar\r'), (41,38,'Ray Dalton','In My Bones\r'), (41,39,'Mappemonde','Stats\r'), (41,40,'Vida Loca','Stats\r'), (41,41,'Jean-Pierre Danel','Blue Nocturne\r'), (41,42,'Ava Max','Kings & Queens\r'), (41,43,'Camélia Jordana','Facile\r'), (41,44,'Tayc','N\'y pense plus\r'), (41,45,'London Grammar','Californian Soil\r'), (41,46,'Dillon','Thirteen Thirtyfive\r'), (41,47,'This Incredible Fortune To Be Two','Stats\r'), (41,48,'Robin Schulz','Alane\r'), (41,49,'Hatik','Angela\r'), (41,50,'Mood','Stats\r'), (42,1,'Johnny Hallyday','Deux Sortes D\'Hommes / Nashville Blues (live)\r'), (42,2,'Johnny Hallyday','Deux Sortes D\'Hommes / La Terre Promise (live)\r'), (42,3,'Johnny Hallyday','Deux Sortes D\'hommes / Tes Tendres Années (live)\r'), (42,4,'Master KG','Jerusalema\r'), (42,5,'Bande Organisée','Stats\r'), (42,6,'Control','Stats\r'), (42,7,'Dreams','Stats\r'), (42,8,'Patrick Fiori','J\'y vais\r'), (42,9,'Naza','Joli Bébé\r'), (42,10,'Hypnotized','Stats\r'), (42,11,'Kendji Girac','Dernier métro\r'), (42,12,'Indochine','Nos célébrations\r'), (42,13,'Johnny Hallyday','Deux Sortes D\'Hommes\r'), (42,14,'Julien Doré','La fièvre\r'), (42,15,'David Guetta','Let\'s Love\r'), (42,16,'Je Suis Marseille','Stats\r'), (42,17,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (42,18,'Grand Corps Malade','Mais je t\'aime\r'), (42,19,'Billie Eilish','No Time To Die\r'), (42,20,'AC/DC','Shot In The Dark\r'), (42,21,'L\'Étoile Sur Le Maillot','Stats\r'), (42,22,'Aya Nakamura','Doudou\r'), (42,23,'Kygo','Hot Stuff\r'), (42,24,'The Weeknd','In Your Eyes\r'), (42,25,'Head Shoulders Knees & Toes','Stats\r'), (42,26,'Benjamin Biolay','Comment est ta peine ?\r'), (42,27,'The Weeknd','Blinding Lights\r'), (42,28,'Carla Bruni','quelque chose\r'), (42,29,'Vianney','beau-papa\r'), (42,30,'Myd','Together We Stand\r'), (42,31,'Louane','Donne-moi ton Cœur\r'), (42,32,'Amel Bent','Jusqu\'au bout\r'), (42,33,'BTS','Dynamite\r'), (42,34,'M. Pokora','Si on disait\r'), (42,35,'Mylène Farmer','L\'âme dans l\'eau\r'), (42,36,'Kylie Minogue','Magic\r'), (42,37,'Mood','Stats\r'), (42,38,'Dadju','Dieu Merci\r'), (42,39,'Kendji Girac','Dans Mes Bras\r'), (42,40,'Van Halen','Jump\r'), (42,41,'La Meilleure','Stats\r'), (42,42,'Trois Cafés Gourmands','On t\'emmène\r'), (42,43,'Ava Max','Who\'s Laughing Now\r'), (42,44,'Kendji Girac','Habibi\r'), (42,45,'Vida Loca','Stats\r'), (42,46,'Lucky Luke','Cooler Than Me\r'), (42,47,'Harry Styles','Watermelon Sugar\r'), (42,48,'Wejdene','Coco\r'), (42,49,'Ava Max','Kings & Queens\r'), (42,50,'C\'est Maintenant','Stats\r'), (43,1,'Master KG','Jerusalema\r'), (43,2,'U2','One\r'), (43,3,'Control','Stats\r'), (43,4,'Bande Organisée','Stats\r'), (43,5,'Johnny Hallyday','Deux Sortes D\'hommes / Tes Tendres Années (live)\r'), (43,6,'Johnny Hallyday','Deux Sortes D\'Hommes / Nashville Blues (live)\r'), (43,7,'Naza','Joli Bébé\r'), (43,8,'Johnny Hallyday','Deux Sortes D\'Hommes / La Terre Promise (live)\r'), (43,9,'Hypnotized','Stats\r'), (43,10,'David Guetta','Let\'s Love\r'), (43,11,'BTS','Dynamite\r'), (43,12,'Grand Corps Malade','Mais je t\'aime\r'), (43,13,'Vianney','beau-papa\r'), (43,14,'Indochine','Nos célébrations\r'), (43,15,'Dreams','Stats\r'), (43,16,'Julien Doré','La fièvre\r'), (43,17,'Kendji Girac','Dernier métro\r'), (43,18,'Head Shoulders Knees & Toes','Stats\r'), (43,19,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (43,20,'Je Suis Marseille','Stats\r'), (43,21,'The Weeknd','In Your Eyes\r'), (43,22,'Amel Bent','Jusqu\'au bout\r'), (43,23,'Benjamin Biolay','Comment est ta peine ?\r'), (43,24,'Under The Sky','Stats\r'), (43,25,'Green Montana','Tout Gacher\r'), (43,26,'Kygo','Hot Stuff\r'), (43,27,'Francis Cabrel','Te ressembler\r'), (43,28,'The Weeknd','Blinding Lights\r'), (43,29,'Scarlet Pleasure','What A Life\r'), (43,30,'Patrick Fiori','J\'y vais\r'), (43,31,'Justin Bieber','Lonely\r'), (43,32,'Mood','Stats\r'), (43,33,'Trois Cafés Gourmands','On t\'emmène\r'), (43,34,'Ava Max','Who\'s Laughing Now\r'), (43,35,'M. Pokora','S\'en aller\r'), (43,36,'La Meilleure','Stats\r'), (43,37,'BTS','Boy In Luv\r'), (43,38,'Sia','Courage to Change\r'), (43,39,'Christophe Maé','L\'ours\r'), (43,40,'Louane','Donne-moi ton Cœur\r'), (43,41,'Ray Dalton','In My Bones\r'), (43,42,'Amir','La fête\r'), (43,43,'M. Pokora','Si on disait\r'), (43,44,'Lucky Luke','Cooler Than Me\r'), (43,45,'Aya Nakamura','Doudou\r'), (43,46,'Harry Styles','Watermelon Sugar\r'), (43,47,'Tones and I','Dance Monkey\r'), (43,48,'Vida Loca','Stats\r'), (43,49,'Calentita','Stats\r'), (43,50,'Billie Eilish','No Time To Die\r'), (44,1,'Master KG','Jerusalema\r'), (44,2,'U2','One\r'), (44,3,'Control','Stats\r'), (44,4,'Louane','Donne-moi ton Cœur\r'), (44,5,'Johnny Hallyday','Deux Sortes D\'Hommes / La Terre Promise (live)\r'), (44,6,'Johnny Hallyday','Deux Sortes D\'Hommes / Nashville Blues (live)\r'), (44,7,'Johnny Hallyday','Deux Sortes D\'hommes / Tes Tendres Années (live)\r'), (44,8,'Bande Organisée','Stats\r'), (44,9,'Ariana Grande','positions\r'), (44,10,'Vianney','beau-papa\r'), (44,11,'Naza','Joli Bébé\r'), (44,12,'David Guetta','Let\'s Love\r'), (44,13,'BTS','Dynamite\r'), (44,14,'Hypnotized','Stats\r'), (44,15,'Dreams','Stats\r'), (44,16,'Indochine','Nos célébrations\r'), (44,17,'Grand Corps Malade','Mais je t\'aime\r'), (44,18,'Depeche Mode','Songs Of Faith And Devotion - The 12\r'), (44,19,'Julien Doré','Nous\r'), (44,20,'Kendji Girac','Dernier métro\r'), (44,21,'Scarlet Pleasure','What A Life\r'), (44,22,'Kygo','Hot Stuff\r'), (44,23,'Head Shoulders Knees & Toes','Stats\r'), (44,24,'Amel Bent','Jusqu\'au bout\r'), (44,25,'Je Suis Marseille','Stats\r'), (44,26,'Julien Doré','La fièvre\r'), (44,27,'The Weeknd','Blinding Lights\r'), (44,28,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (44,29,'Bruce Springsteen','One Minute You\'re Here\r'), (44,30,'La Meilleure','Stats\r'), (44,31,'The Weeknd','In Your Eyes\r'), (44,32,'Ava Max','Who\'s Laughing Now\r'), (44,33,'Dua Lipa','Levitating\r'), (44,34,'Mood','Stats\r'), (44,35,'Ray Dalton','In My Bones\r'), (44,36,'Christophe Maé','L\'ours\r'), (44,37,'Benjamin Biolay','Comment est ta peine ?\r'), (44,38,'Harry Styles','Watermelon Sugar\r'), (44,39,'Shy\'m','BOY\r'), (44,40,'Quoi Qu\'il Arrive','Stats\r'), (44,41,'Trois Cafés Gourmands','On t\'emmène\r'), (44,42,'Aya Nakamura','Doudou\r'), (44,43,'Bobby Vinton','Mr. Lonely\r'), (44,44,'Pride','Stats\r'), (44,45,'Francis Cabrel','Te ressembler\r'), (44,46,'Little Mix','Sweet Melody\r'), (44,47,'Patrick Fiori','J\'y vais\r'), (44,48,'Jason Derulo','Take You Dancing\r'), (44,49,'KT Tunstall','Suddenly I See\r'), (44,50,'M. Pokora','Si on disait\r'), (45,1,'Master KG','Jerusalema\r'), (45,2,'Control','Stats\r'), (45,3,'Dua Lipa','Fever (avec Angèle)\r'), (45,4,'Vianney','beau-papa\r'), (45,5,'Patrick Fiori','J\'y vais\r'), (45,6,'David Guetta','Let\'s Love\r'), (45,7,'Naza','Joli Bébé\r'), (45,8,'Bande Organisée','Stats\r'), (45,9,'U2','One\r'), (45,10,'BTS','Dynamite\r'), (45,11,'Louane','Donne-moi ton Cœur\r'), (45,12,'Hypnotized','Stats\r'), (45,13,'Amel Bent','1,2,3 (avec Hatik)\r'), (45,14,'Grand Corps Malade','Mais je t\'aime\r'), (45,15,'Julien Doré','Nous\r'), (45,16,'La Meilleure','Stats\r'), (45,17,'Kendji Girac','Dernier métro\r'), (45,18,'Kygo','Hot Stuff\r'), (45,19,'Dreams','Stats\r'), (45,20,'Depeche Mode','Songs Of Faith And Devotion - The 12\r'), (45,21,'Dadju','Va dire à ton ex\r'), (45,22,'Alain Bashung','Immortels\r'), (45,23,'Dua Lipa','Levitating\r'), (45,24,'Midnight Oil','The Makarrata Project\r'), (45,25,'Francis Cabrel','Te ressembler\r'), (45,26,'The Weeknd','In Your Eyes\r'), (45,27,'Ava Max','Who\'s Laughing Now\r'), (45,28,'Indochine','Nos célébrations\r'), (45,29,'Julien Doré','La fièvre\r'), (45,30,'Amel Bent','Jusqu\'au bout\r'), (45,31,'The Weeknd','Blinding Lights\r'), (45,32,'Christophe Maé','L\'ours\r'), (45,33,'Benjamin Biolay','Comment est ta peine ?\r'), (45,34,'Head Shoulders Knees & Toes','Stats\r'), (45,35,'Ariana Grande','positions\r'), (45,36,'Dadju','Elle Me Demande\r'), (45,37,'Mood','Stats\r'), (45,38,'Kylie Minogue','Magic\r'), (45,39,'Aya Nakamura','Doudou\r'), (45,40,'Vianney','N\'attendons pas\r'), (45,41,'Ray Dalton','In My Bones\r'), (45,42,'Trois Cafés Gourmands','On t\'emmène\r'), (45,43,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (45,44,'Jean-Louis Murat','Baby Love D.c.\r'), (45,45,'Bobby Vinton','Mr. Lonely\r'), (45,46,'Dadju','Amour toxic\r'), (45,47,'Bruce Springsteen','One Minute You\'re Here\r'), (45,48,'Dadju','Dieu Merci\r'), (45,49,'Abba','Super Trouper\r'), (45,50,'Harry Styles','Watermelon Sugar\r'), (46,1,'Master KG','Jerusalema\r'), (46,2,'Dua Lipa','Fever (avec Angèle)\r'), (46,3,'Booba','5G\r'), (46,4,'Vianney','beau-papa\r'), (46,5,'Gims','Jusqu\'ici Tout Va Bien\r'), (46,6,'Control','Stats\r'), (46,7,'BTS','Dynamite\r'), (46,8,'Mylène Farmer','L\'âme dans l\'eau\r'), (46,9,'David Guetta','Let\'s Love\r'), (46,10,'Bande Organisée','Stats\r'), (46,11,'Kendji Girac','Dernier métro\r'), (46,12,'Julien Doré','Nous\r'), (46,13,'Hypnotized','Stats\r'), (46,14,'System Of A Down','Protect The Land\r'), (46,15,'Patrick Fiori','J\'y vais\r'), (46,16,'Grand Corps Malade','Mais je t\'aime\r'), (46,17,'Mood','Stats\r'), (46,18,'Kygo','Hot Stuff\r'), (46,19,'Naza','Joli Bébé\r'), (46,20,'La Meilleure','Stats\r'), (46,21,'Dreams','Stats\r'), (46,22,'Benjamin Biolay','Comment est ta peine ?\r'), (46,23,'Louane','Donne-moi ton Cœur\r'), (46,24,'Kylie Minogue','Magic\r'), (46,25,'Julien Doré','La fièvre\r'), (46,26,'The Weeknd','In Your Eyes\r'), (46,27,'System Of A Down','Genocidal Humanoidz\r'), (46,28,'Ray Dalton','In My Bones\r'), (46,29,'Amel Bent','1,2,3 (avec Hatik)\r'), (46,30,'Head Shoulders Knees & Toes','Stats\r'), (46,31,'Gaël Faye','Respire\r'), (46,32,'The Weeknd','Blinding Lights\r'), (46,33,'Indochine','Nos célébrations\r'), (46,34,'London Grammar','Californian Soil\r'), (46,35,'Ava Max','Who\'s Laughing Now\r'), (46,36,'Amel Bent','Jusqu\'au bout\r'), (46,37,'Trois Cafés Gourmands','On t\'emmène\r'), (46,38,'Harry Styles','Watermelon Sugar\r'), (46,39,'Mariah Carey','All I Want For Christmas Is You\r'), (46,40,'Christophe Maé','L\'ours\r'), (46,41,'Maluma','Hawái\r'), (46,42,'a-ha','Take On Me\r'), (46,43,'Ça Ira','Stats\r'), (46,44,'Dua Lipa','Levitating\r'), (46,45,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (46,46,'Vida Loca','Stats\r'), (46,47,'Dadju','Va dire à ton ex\r'), (46,48,'Vianney','N\'attendons pas\r'), (46,49,'U2','One\r'), (46,50,'Hervé','Si Bien Du Mal\r'), (47,1,'Master KG','Jerusalema\r'), (47,2,'Dua Lipa','Fever (avec Angèle)\r'), (47,3,'Vianney','beau-papa\r'), (47,4,'Control','Stats\r'), (47,5,'Gims','Jusqu\'ici Tout Va Bien\r'), (47,6,'Billie Eilish','Therefore I Am\r'), (47,7,'David Guetta','Let\'s Love\r'), (47,8,'Hypnotized','Stats\r'), (47,9,'Bande Organisée','Stats\r'), (47,10,'Julien Doré','Nous\r'), (47,11,'Naza','Joli Bébé\r'), (47,12,'Grand Corps Malade','Mais je t\'aime\r'), (47,13,'Kendji Girac','Dernier métro\r'), (47,14,'Mood','Stats\r'), (47,15,'BTS','Dynamite\r'), (47,16,'Benjamin Biolay','Comment est ta peine ?\r'), (47,17,'Aya Nakamura','Plus Jamais\r'), (47,18,'La Meilleure','Stats\r'), (47,19,'Patrick Fiori','J\'y vais\r'), (47,20,'Kygo','Hot Stuff\r'), (47,21,'AC/DC','Realize\r'), (47,22,'Aya Nakamura','Doudou\r'), (47,23,'Ray Dalton','In My Bones\r'), (47,24,'Mariah Carey','All I Want For Christmas Is You\r'), (47,25,'Kylie Minogue','Magic\r'), (47,26,'Dreams','Stats\r'), (47,27,'Mylène Farmer','L\'âme dans l\'eau\r'), (47,28,'Ava Max','Who\'s Laughing Now\r'), (47,29,'The Weeknd','Blinding Lights\r'), (47,30,'Louane','Donne-moi ton Cœur\r'), (47,31,'AC/DC','Shot In The Dark\r'), (47,32,'Naza','Faut Pardonner\r'), (47,33,'Indochine','Nos célébrations\r'), (47,34,'The Weeknd','In Your Eyes\r'), (47,35,'Amel Bent','Jusqu\'au bout\r'), (47,36,'Head Shoulders Knees & Toes','Stats\r'), (47,37,'London Grammar','Californian Soil\r'), (47,38,'Grand Corps Malade','Mesdames\r'), (47,39,'Julien Doré','La fièvre\r'), (47,40,'Aya Nakamura','Préféré\r'), (47,41,'Vida Loca','Stats\r'), (47,42,'Dua Lipa','Levitating\r'), (47,43,'Tones and I','Dance Monkey\r'), (47,44,'Harry Styles','Watermelon Sugar\r'), (47,45,'Trois Cafés Gourmands','On t\'emmène\r'), (47,46,'Hervé','Si Bien Du Mal\r'), (47,47,'Dadju','Dieu Merci\r'), (47,48,'AC/DC','Highway To Hell\r'), (47,49,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (47,50,'Lucenzo','No me ama\r'), (48,1,'BTS','Life Goes On\r'), (48,2,'Master KG','Jerusalema\r'), (48,3,'Dua Lipa','Fever (avec Angèle)\r'), (48,4,'Vianney','beau-papa\r'), (48,5,'Julien Doré','Nous\r'), (48,6,'Control','Stats\r'), (48,7,'BTS','Dynamite\r'), (48,8,'Hypnotized','Stats\r'), (48,9,'David Guetta','Let\'s Love\r'), (48,10,'Bande Organisée','Stats\r'), (48,11,'BTS','Blue & Grey\r'), (48,12,'Miley Cyrus','Prisoner\r'), (48,13,'Gims','Jusqu\'ici Tout Va Bien\r'), (48,14,'Manu Chao','La Vida Tombola\r'), (48,15,'Billie Eilish','Therefore I Am\r'), (48,16,'Mariah Carey','All I Want For Christmas Is You\r'), (48,17,'Bird Of Prey Et La Fantabuleuse Histoire De Harley Quinn','Stats\r'), (48,18,'Naza','Joli Bébé\r'), (48,19,'Shawn Mendes','Monster\r'), (48,20,'BTS','Fly To My Room\r'), (48,21,'Indochine','3SEX\r'), (48,22,'Julien Doré','La fièvre\r'), (48,23,'BTS','Dis-ease\r'), (48,24,'BTS','Telepathy\r'), (48,25,'Ray Dalton','In My Bones\r'), (48,26,'BTS','Stay\r'), (48,27,'Kendji Girac','Dernier métro\r'), (48,28,'Grand Corps Malade','Mais je t\'aime\r'), (48,29,'Mood','Stats\r'), (48,30,'The Weeknd','Blinding Lights\r'), (48,31,'Patrick Fiori','J\'y vais\r'), (48,32,'Kygo','Hot Stuff\r'), (48,33,'Ava Max','Who\'s Laughing Now\r'), (48,34,'Kylie Minogue','Magic\r'), (48,35,'The Weeknd','In Your Eyes\r'), (48,36,'Hervé','Si Bien Du Mal\r'), (48,37,'Benjamin Biolay','Comment est ta peine ?\r'), (48,38,'BTS','Skit\r'), (48,39,'La Meilleure','Stats\r'), (48,40,'Benjamin Biolay','Parc Fermé\r'), (48,41,'Dreams','Stats\r'), (48,42,'Claudio Capéo','E penso a te\r'), (48,43,'Indochine','Nos célébrations\r'), (48,44,'Aya Nakamura','Plus Jamais\r'), (48,45,'Jawsh 685','Savage Love (Laxed - Siren Beat)\r'), (48,46,'Aya Nakamura','Doudou\r'), (48,47,'Louane','Donne-moi ton Cœur\r'), (48,48,'Kavinsky','Nightcall\r'), (48,49,'Ava Max','My Head & My Heart\r'), (48,50,'Jean-Pierre Danel','Guitar Safari\r'), (49,1,'Master KG','Jerusalema\r'), (49,2,'Dua Lipa','Fever (avec Angèle)\r'), (49,3,'Indochine','3SEX\r'), (49,4,'Vianney','beau-papa\r'), (49,5,'Mariah Carey','All I Want For Christmas Is You\r'), (49,6,'Julien Doré','Nous\r'), (49,7,'Control','Stats\r'), (49,8,'Hypnotized','Stats\r'), (49,9,'Richard Cocciante','Il Mio Rifugio\r'), (49,10,'David Guetta','Let\'s Love\r'), (49,11,'Gims','Jusqu\'ici Tout Va Bien\r'), (49,12,'Kygo','Hot Stuff\r'), (49,13,'Manu Chao','La Vida Tombola\r'), (49,14,'Bande Organisée','Stats\r'), (49,15,'BTS','Dynamite\r'), (49,16,'Billie Eilish','Therefore I Am\r'), (49,17,'BTS','Life Goes On\r'), (49,18,'Patrick Fiori','J\'y vais\r'), (49,19,'Indochine','Nos célébrations\r'), (49,20,'Britney Spears','Swimming In The Stars\r'), (49,21,'Mood','Stats\r'), (49,22,'Julien Doré','La fièvre\r'), (49,23,'The Weeknd','In Your Eyes\r'), (49,24,'Naza','Joli Bébé\r'), (49,25,'Kendji Girac','Dernier métro\r'), (49,26,'Rodrigo','La Mano De Dios\r'), (49,27,'Grand Corps Malade','Mais je t\'aime\r'), (49,28,'Last Christmas','Stats\r'), (49,29,'The Weeknd','Blinding Lights\r'), (49,30,'Kylie Minogue','Magic\r'), (49,31,'Ben Mazué','Quand je marche\r'), (49,32,'Anne Sylvestre','Les Gens Qui Doutent\r'), (49,33,'Claudio Capéo','E penso a te\r'), (49,34,'Bird Of Prey Et La Fantabuleuse Histoire De Harley Quinn','Stats\r'), (49,35,'Billie Eilish','No Time To Die\r'), (49,36,'Miley Cyrus','Prisoner\r'), (49,37,'1917','Stats\r'), (49,38,'Louane','Donne-moi ton Cœur\r'), (49,39,'Johnny Hallyday','Deux Sortes D\'hommes / Tes Tendres Années (live)\r'), (49,40,'Ray Dalton','In My Bones\r'), (49,41,'Grand Corps Malade','Mesdames\r'), (49,42,'Kaleo','Way Down We Go\r'), (49,43,'Benjamin Biolay','Comment est ta peine ?\r'), (49,44,'Claudio Capéo','Ti amo\r'), (49,45,'La Meilleure','Stats\r'), (49,46,'Vald','Gotaga\r'), (49,47,'Dua Lipa','Levitating\r'), (49,48,'Tones and I','Dance Monkey\r'), (49,49,'Fally Ipupa','Likolo\r'), (49,50,'Johnny Hallyday','Deux Sortes D\'Hommes / La Terre Promise (live)\r'), (50,1,'Mylène Farmer','L\'âme dans l\'eau\r'), (50,2,'Dua Lipa','Fever (avec Angèle)\r'), (50,3,'Total Recall * 4k Ultra Hd + Blu-ray','Stats\r'), (50,4,'Mariah Carey','All I Want For Christmas Is You\r'), (50,5,'Gims','Jusqu\'ici Tout Va Bien\r'), (50,6,'Master KG','Jerusalema\r'), (50,7,'Noir Désir','Imbécile\r'), (50,8,'Vianney','beau-papa\r'), (50,9,'Julien Doré','Nous\r'), (50,10,'David Guetta','Let\'s Love\r'), (50,11,'Grand Corps Malade','Mais je t\'aime\r'), (50,12,'Indochine','3SEX\r'), (50,13,'The Weeknd','Blinding Lights\r'), (50,14,'1917','Stats\r'), (50,15,'Control','Stats\r'), (50,16,'Grand Corps Malade','Mesdames\r'), (50,17,'Hypnotized','Stats\r'), (50,18,'Kendji Girac','Dernier métro\r'), (50,19,'Indochine','Nos célébrations\r'), (50,20,'Eva','Coeur Noir\r'), (50,21,'Dua Lipa','Levitating\r'), (50,22,'Terrenoire','Jusqu\'À Mon Dernier Souffle\r'), (50,23,'JSX','Pompeii\r'), (50,24,'Larusso','Tous Les Cris Les S.O.S\r'), (50,25,'Bande Organisée','Stats\r'), (50,26,'Coffret James Bond / Daniel Craig','Stats\r'), (50,27,'Julien Doré','La fièvre\r'), (50,28,'Amel Bent','Jusqu\'au bout\r'), (50,29,'Coldplay','Christmas Lights (vinyle Bleu)\r'), (50,30,'BTS','Dynamite\r'), (50,31,'M. Pokora','Si on disait\r'), (50,32,'Dua Lipa','Physical\r'), (50,33,'Benjamin Biolay','Comment est ta peine ?\r'), (50,34,'Kygo','Hot Stuff\r'), (50,35,'David Guetta','Dreams\r'), (50,36,'Patrick Fiori','J\'y vais\r'), (50,37,'Mariah Carey','Oh Santa!\r'), (50,38,'Louane','Donne-moi ton Cœur\r'), (50,39,'Britney Spears','Swimming In The Stars\r'), (50,40,'Last Christmas','Stats\r'), (50,41,'Calogero','Celui d\'en bas\r'), (50,42,'Sia','Courage to Change\r'), (50,43,'The Weeknd','In Your Eyes\r'), (50,44,'Vitaa','Avant toi\r'), (50,45,'Kylie Minogue','Magic\r'), (50,46,'Divers','Kubrick - 3 Films - 4k\r'), (50,47,'Black Eyed Peas','Girl Like Me\r'), (50,48,'Mood','Stats\r'), (50,49,'Johnny Hallyday','Deux Sortes D\'Hommes / La Terre Promise (live)\r'), (50,50,'Camille Lellouche','Je remercie mon ex\r'), (51,1,'Johnny Hallyday','Le cour en deux\r'), (51,2,'Mariah Carey','All I Want For Christmas Is You\r'), (51,3,'Dua Lipa','Fever (avec Angèle)\r'), (51,4,'Master KG','Jerusalema\r'), (51,5,'Grand Corps Malade','Pas essentiel\r'), (51,6,'Julien Doré','Nous\r'), (51,7,'Vianney','beau-papa\r'), (51,8,'Indochine','3SEX\r'), (51,9,'Benjamin Biolay','Grand prix\r'), (51,10,'Gims','Jusqu\'ici Tout Va Bien\r'), (51,11,'Kendji Girac','Dernier métro\r'), (51,12,'Grand Corps Malade','Mais je t\'aime\r'), (51,13,'Indochine','Nos célébrations\r'), (51,14,'David Guetta','Let\'s Love\r'), (51,15,'Grand Corps Malade','Mesdames\r'), (51,16,'Mother Fuck','Stats\r'), (51,17,'Kimberose','Back On My Feet\r'), (51,18,'The Weeknd','Blinding Lights\r'), (51,19,'Benjamin Biolay','Comment est ta peine ?\r'), (51,20,'Total Recall * 4k Ultra Hd + Blu-ray','Stats\r'), (51,21,'Hypnotized','Stats\r'), (51,22,'Taylor Swift','willow\r'), (51,23,'Woodkid','Horizons Into Battlegrounds\r'), (51,24,'Julien Doré','La fièvre\r'), (51,25,'Amir','La fête\r'), (51,26,'Patrick Fiori','J\'y vais\r'), (51,27,'Terrenoire','Jusqu\'À Mon Dernier Souffle\r'), (51,28,'BTS','Dynamite\r'), (51,29,'Lous and The Yakuza','Dilemme\r'), (51,30,'Last Christmas','Stats\r'), (51,31,'Control','Stats\r'), (51,32,'Dua Lipa','Levitating\r'), (51,33,'Bande Organisée','Stats\r'), (51,34,'Benjamin Biolay','Rue Saint-Louis en l’Île\r'), (51,35,'Julien Clerc','Mon refuge\r'), (51,36,'Benjamin Biolay','Ton héritage\r'), (51,37,'1917','Stats\r'), (51,38,'Indochine','L\'aventurier\r'), (51,39,'Kylie Minogue','Magic\r'), (51,40,'Britney Spears','Matches\r'), (51,41,'Sia','Courage to Change\r'), (51,42,'Calogero','Celui d\'en bas\r'), (51,43,'Johnny Hallyday','Deux Sortes D\'hommes / Tes Tendres Années (live)\r'), (51,44,'Black Eyed Peas','Girl Like Me\r'), (51,45,'Indochine','J\'ai demandé à la lune\r'), (51,46,'The Weeknd','In Your Eyes\r'), (51,47,'Johnny Hallyday','Deux Sortes D\'Hommes / Nashville Blues (live)\r'), (51,48,'Ca','Stats\r'), (51,49,'Mylène Farmer','L\'âme dans l\'eau\r'), (51,50,'Mood','Stats\r'); /*!40000 ALTER TABLE `song_rank_week` ENABLE KEYS */; UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
C
UTF-8
5,925
2.9375
3
[]
no_license
#include "stdio.h" #include "assert.h" #include "fcntl.h" #include "stdlib.h" #include "unistd.h" #include "string.h" #include "errno.h" #include "elf.h" void read_elf_header(int32_t fd, Elf32_Ehdr *elf_header) { assert(lseek(fd, (off_t)0, SEEK_SET) == (off_t)0); assert(read(fd, (void *)elf_header, sizeof(Elf32_Ehdr)) == sizeof(Elf32_Ehdr)); } int check_ELF(Elf32_Ehdr elfheader){ printf("\nBinary Format = "); if(!strncmp((char *)elfheader.e_ident,"\177ELF",4)){ printf("Linux ELF binary detected\n"); return 1; } else{ printf("Not a Linux ELF binary\n"); return 0; } } void print_elf_header(Elf32_Ehdr eh){ printf("###############################\nElf_header_entries\tValue\n###############################\n"); printf("elf_hdr_entry\t\t%x\n",eh.e_entry); printf("program_hdr_nmbr\t%x\n",eh.e_phnum); printf("section_hdr_nmbrt\t%x\n",eh.e_shnum); printf("section_hdr_strnIndex\t%x\n",eh.e_shstrndx); printf("program_hdr_entsize\t%x\n",eh.e_phentsize); printf("###############################\n"); } void type_ELF_storage(Elf32_Ehdr elftype){ printf("Storage class = "); switch(elftype.e_ident[EI_CLASS]){ case ELFCLASS32: printf("32 bit Linux binary\n"); break; case ELFCLASS64: printf("64 bit Linux binary\n"); break; default: printf("class unknown\n"); } printf("\nELF header size\t= 0x%08x\n\n", elftype.e_ehsize); } void read_section_header_table(int32_t fd, Elf32_Ehdr eh, Elf32_Shdr sh_table[]) { uint32_t i; assert(lseek(fd, (off_t)eh.e_shoff, SEEK_SET) == (off_t)eh.e_shoff); for(i=0; i<eh.e_shnum; i++) { assert(read(fd, (void *)&sh_table[i], eh.e_shentsize) == eh.e_shentsize); } } char *read_section(int32_t fd, Elf32_Shdr sh){ char *buff = malloc(sh.sh_size); if(!buff){ printf("failed to allocate size\n"); } assert(buff!=NULL); assert(lseek(fd, (off_t)sh.sh_offset, SEEK_SET) == (off_t)sh.sh_offset); assert(read(fd,(void *)buff,sh.sh_size) == sh.sh_size); return buff; } void print_sections(int32_t fd, Elf32_Ehdr eh, Elf32_Shdr sh_table[]) { uint32_t i; char *sh_str; sh_str = read_section(fd, sh_table[eh.e_shstrndx]); printf("\n####################################################################################################################################\n"); printf("Sl.no\tSection type\tSection flags\tSection size\tSection link\t Section info\tAddress align\tEntry size\tSection name\n"); printf("####################################################################################################################################\n"); for(i=1; i<eh.e_shnum; i++){ printf(" %3d\t", i); printf("%08x\t", sh_table[i].sh_type); printf("%x\t\t", sh_table[i].sh_flags); printf("%x\t\t", sh_table[i].sh_size); printf("%x\t\t", sh_table[i].sh_link); printf("%x\t\t", sh_table[i].sh_info); printf("%d\t\t", sh_table[i].sh_addralign); printf("%08x\t", sh_table[i].sh_entsize); printf("%s\t", (sh_str + sh_table[i].sh_name)); printf("\n"); } printf("####################################################################################################################################\n"); } void read_program_header_table(int32_t fd, Elf32_Ehdr eh, Elf32_Phdr ph_table[]) { uint32_t i; assert(lseek(fd, (off_t)eh.e_phoff, SEEK_SET) == (off_t)eh.e_phoff); for(i=0; i<eh.e_phnum; i++) { assert(read(fd, (void *)&ph_table[i], eh.e_phentsize) == eh.e_phentsize); } } char *read_segments(int32_t fd, Elf32_Phdr ph, Elf32_Ehdr eh){ char *buff = malloc(eh.e_phnum * eh.e_phentsize); if(!buff){ printf("failed to allocate size\n"); } assert(buff!=NULL); assert(lseek(fd, (off_t)eh.e_phoff, SEEK_SET) == (off_t)eh.e_phoff); assert(read(fd,(void *)buff,eh.e_phentsize) == eh.e_phentsize); return buff; } void print_segments(int32_t fd, Elf32_Ehdr eh, Elf32_Phdr ph_table[]) { uint32_t i; char *ph_str; ph_str = read_segments(fd, ph_table[eh.e_phoff], eh); printf("\n####################################################################################################################################\n"); printf("Sl.no\tSegment type\tSegment offset\tSegment vaddr\tSegment paddr\tSegment filesz\tSeg memsz\tSeg flags\tSeg allign\n"); printf("####################################################################################################################################\n"); for(i=0; i<eh.e_phnum; i++){ printf(" %3d\t", i); printf("%08x\t", ph_table[i].p_type); printf("%x\t\t", ph_table[i].p_offset); printf("%x\t\t", ph_table[i].p_vaddr); printf("%x\t\t", ph_table[i].p_paddr); printf("%x\t\t", ph_table[i].p_filesz); printf("%d\t\t", ph_table[i].p_memsz); printf("%08x\t", ph_table[i].p_flags); printf("%x\t", ph_table[i].p_align); printf("\n"); } printf("####################################################################################################################################\n"); } int32_t main(int32_t argc, char *argv[]){ int32_t fd; Elf32_Ehdr eh; Elf32_Shdr* sh_tbl; Elf32_Phdr* ph_tbl; if(argc!=2){ printf("Specify an executable file as an argument\n"); } fd=open(argv[1],O_RDONLY|O_SYNC); if(fd<0){ printf("unable to open:%s\n",argv[1]); return 0; } read_elf_header(fd, &eh); if(check_ELF(eh)!=1){ type_ELF_storage(eh); return 0; } type_ELF_storage(eh); sh_tbl = malloc(eh.e_shentsize * eh.e_shnum); read_section_header_table(fd, eh, sh_tbl); print_elf_header(eh); print_sections(fd, eh, sh_tbl); ph_tbl = malloc(eh.e_phentsize * eh.e_phnum); read_program_header_table(fd, eh, ph_tbl); print_segments(fd, eh, ph_tbl); printf("\nEOP!\n"); return 0; }
Markdown
UTF-8
1,366
2.6875
3
[]
no_license
## Soru İsmi: Rengarenk Dosya Hazırlayan: [penny](https://github.com/pennylaneparker) ## Soru Metni: Online CTF'teki rengarenk string isimli sorunun aynısı gibi değil mi? Onu çözebildiysen bunu da rahatlıkla çözebilirsin bence :) Bizim TV ekranı renkli renkli karıncalandı. Saydım 103x54 kutucuk var. ilk kutucuktaki rengin RGB değeri de (137,80,78). Belki flag çıkar bir yerlerden. ![Preview](rengarenk_dosya.png) ## Çözüm: 1. Her kutucuktaki RGB değerini decimal olarak okuyoruz. Tüm RGB değerlerini hexadecimal e çeviriyoruz ve binary dosya elde ediyoruz. 2. Aşağıdaki script yazılarak flag elde edilir. ```python import binascii import sys from PIL import Image, ImageFont, ImageDraw, ImageEnhance #Open image file im = Image.open("rengarenk_dosya.png") pix = im.load() hexcontent="" #Imaj dosyasindaki 10x10 kutucuklarin her birindeki ilk pixeliin rgb degerini okuyor. for j in range(0,54): for i in range(0,103): color=pix[i*10,j*10] #Get the RGBA Value of the a pixel of an image hexcontent=hexcontent+''.join(hex(c)[2:].zfill(2) for c in color) #RGB degerlerini decimalden hex value ya degistiriyor ve hex value basindaki 0x degerini atiyor. print color #Hex degerinden binary dosya olustuyor. fout=open('flag', 'wb') fout.write(binascii.unhexlify(hexcontent)) fout.close() ``` **Flag = STMCTF{0_Z4mAn_D4n5!_R3nK!!!}**
JavaScript
UTF-8
551
3.171875
3
[]
no_license
/** * @example * // return ' boni!' * binaryDecode('00100000 01100010 01101111 01101110 01101001 00100001'); * function binaryDecode returns an English translated sentence * of the passed binary string * @param {String} str, passed binary string * @return {String} passed string translated to english */ function binaryDecode(str) { if (!str) { return ''; } const chars = str.split(' '); const res = chars.map((item) => { return String.fromCharCode(parseInt(item, 2)); } ); return res.join(''); } export {binaryDecode};
C++
UTF-8
396
2.71875
3
[]
no_license
#include <iostream> #include <cstdio> using namespace std; int main() { // Complete the code. int i; long l; char ch; float f; double d; cin >> i >> l >> ch >> f >> d; cout << i << endl; cout << l << endl; cout << ch << endl; cout.precision(3); cout << fixed << f << endl; cout.precision(9); cout << fixed << d << endl; return 0; }
Swift
UTF-8
3,503
2.953125
3
[]
no_license
// // ViewController.swift // CenterofGravity // // Created by Kyle Jones on 3/5/19. // Copyright © 2019 Kyle Jones. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var heightTextField: UITextField! @IBOutlet weak var baseWidthTextField: UITextField! @IBOutlet weak var topWidthTextField: UITextField! @IBOutlet weak var descriptionLabel: UILabel! @IBOutlet weak var resultLabel: UILabel! @IBOutlet weak var previousResultLabel: UILabel! @IBOutlet weak var clearButton: UIButton! override func viewDidLoad() { super.viewDidLoad() heightTextField.keyboardType = UIKeyboardType.decimalPad baseWidthTextField.keyboardType = UIKeyboardType.numberPad topWidthTextField.keyboardType = UIKeyboardType.numberPad updateUI() } @IBAction func unwindToMain(_ unwindSegue: UIStoryboardSegue) { _ = unwindSegue.source // Use data from the view controller which initiated the unwind segue } @IBAction func calculateButtonPressed(_ sender: UIButton) { updateUI() } @IBAction func clearButtonPressed(_ sender: UIButton) { heightTextField.text = "" baseWidthTextField.text = "" topWidthTextField.text = "" updateUI() } @IBAction func tapOutsideTextField(_ sender: UITapGestureRecognizer) { self.view .endEditing(true) } func calculateCenterOfGravity() -> String? { if heightTextField.text == "" && baseWidthTextField.text == "" && topWidthTextField.text == "" { return "" } guard let heightString = heightTextField.text, let baseString = baseWidthTextField.text, let topString = topWidthTextField.text, let height = Double(heightString), let base = Double(baseString), let top = Double(topString), base + top != 0 else {return nil} // Center of gravity equation Y = h (b+2a) / 3 (b + a) let centerOfGravityInInches = ((height * 12) * (base + (top * 2.0))) / (3.0 * (base + top)) let centerOfGravity = centerOfGravityInInches / 12 let feet = Int(centerOfGravity) let inches = Int((centerOfGravity - Double(feet)) * 12) return "\(feet) ft. \(inches) in." } var previousResult: String = "" func updateUI () { if previousResult == "" { previousResultLabel.isHidden = true } else { previousResultLabel.isHidden = false previousResultLabel.text = "Previous result: \(previousResult)" } if calculateCenterOfGravity() == "" { descriptionLabel.text = "Enter trap or shaft dimensions." resultLabel.isHidden = true resultLabel.text = "" clearButton.isHidden = true } else if calculateCenterOfGravity() == nil { descriptionLabel.text = "Invalid dimensions entered.\nPlease refer to help section." resultLabel.isHidden = true clearButton.isHidden = false } else { descriptionLabel.text = "Distance from base to center of gravity" resultLabel.isHidden = false resultLabel.text = calculateCenterOfGravity() clearButton.isHidden = false topWidthTextField.resignFirstResponder() previousResult = "\(resultLabel.text ?? "Error")" } } }
Markdown
UTF-8
7,221
2.578125
3
[]
no_license
# Virtual Reality Portfolio // Spring 2021 // Rebecca Kent All projects based on chapters of "Unity 2020 Virtual Reality Projects" by John Linowes https://www.packtpub.com/product/unity-2020-virtual-reality-projects-third-edition/9781839217333 ----------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------- **DIORAMA || Chapter 1** - **_Development_** This is the development project from chapter one, setting up a simple diorama scene. The player can just look around, no other implementation as of yet. _Scene View_ ![image](https://user-images.githubusercontent.com/49692399/116902797-6f230980-abf0-11eb-9103-56181254a5c2.png) _Game View_ ![image](https://user-images.githubusercontent.com/49692399/116902827-79dd9e80-abf0-11eb-8181-64e39233c9b3.png) https://scionglobe.itch.io/diorama-development ----------------------------------------------------------------------------------------------- - **_Production_** For this production, I found a space skybox and an Earth model for the player to stand on, and added some planets and a space ship, removing the ground plane and the photo plane. _Scene View_ ![image](https://user-images.githubusercontent.com/49692399/116903806-be1d6e80-abf1-11eb-8040-22c2b7cc582a.png) _Game View_ ![image](https://user-images.githubusercontent.com/49692399/116913688-a1d3fe80-abfe-11eb-9b5e-9c0b477525f8.png) https://scionglobe.itch.io/diorama-production ----------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------- **ZOMBIES VS CYCLOPS || Chapter 2** - **_Development_** This is the development project from chapter two, where a zombie spawns in random positions and moves towards the target, which is controlled by the player's head movements. If the player stays looking at the zombie for long enough, the zombie explodes! _Scene View_ ![image](https://user-images.githubusercontent.com/49692399/116913473-61748080-abfe-11eb-8fef-7bd1aa4e7617.png) _Game View_ ![image](https://user-images.githubusercontent.com/49692399/116913505-6a655200-abfe-11eb-8a84-5e907046c6eb.png) https://scionglobe.itch.io/zombies-versus-cyclops-development ----------------------------------------------------------------------------------------------- - **_Production_** For this production, I adjusted the skybox and added more obstacles for the zombie to move around, as well as adjusting materials and backgrounds. _Scene View_ ![image](https://user-images.githubusercontent.com/49692399/116914356-7b629300-abff-11eb-8084-9af49ae08f81.png) _Game View_ ![image](https://user-images.githubusercontent.com/49692399/116914380-83bace00-abff-11eb-85f4-ea6a59b80518.png) https://scionglobe.itch.io/zombies-versus-cyclops-production ----------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------- **BALLOONS! || Chapter 3** - **_Development_** This is the development project from chapter three, where the player can use the balloon gun and make balloons appear, and can then pop the balloons with a throwable ball. The player can pick up the balloon gun by reaching for it and grabbing it with the hand controls, and then can click and hold to blow up a balloon, and release to let it fly! Throw the ball at the balloons to pop them. _Scene View_ ![image](https://user-images.githubusercontent.com/49692399/116916586-63404300-ac02-11eb-84bb-c789d7c77af4.png) _Game View_ ![image](https://user-images.githubusercontent.com/49692399/116916603-69362400-ac02-11eb-911d-c555b7c9ea9c.png) https://scionglobe.itch.io/balloons-development ----------------------------------------------------------------------------------------------- - **_Production_** For this production, I adjusted the aesthetics for the game, with a mirrored floor and pedestal. _Scene View_ ![image](https://user-images.githubusercontent.com/49692399/116916687-84089880-ac02-11eb-8ddd-4eafc5d53079.png) _Game View_ ![image](https://user-images.githubusercontent.com/49692399/116916707-8a971000-ac02-11eb-9d32-a6af218589cb.png) https://scionglobe.itch.io/balloons-production ----------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------- **UI SMORGASBORD || Chapter 4** - **_Development_** This is the development project from chapter four, which is an upgraded version of zombies vs. cyclops, with a water hose that can be activated via new UI controls. Tap the arm controls (on the left arm) to toggle the water on and off. _Scene View_ ![image](https://user-images.githubusercontent.com/49692399/116922230-ea44e980-ac09-11eb-82bf-ea41a806405f.png) _Game View_ ![image](https://user-images.githubusercontent.com/49692399/116922242-efa23400-ac09-11eb-9e69-644ea3a22f4c.png) https://scionglobe.itch.io/ui-smorgasbord-development ----------------------------------------------------------------------------------------------- - **_Production_** For this production, I adjusted the aesthetics for the game, including a fire hydrant for the water stream, and creating a street view. I also added instructions for the water control. _Scene View_ ![image](https://user-images.githubusercontent.com/49692399/116926292-0e56f980-ac0f-11eb-97ef-618b87cb5f4e.png) _Game View_ ![image](https://user-images.githubusercontent.com/49692399/116926307-144cda80-ac0f-11eb-9033-d2ab7da6190c.png) https://scionglobe.itch.io/ui-smorgasbord-production ----------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------- **MOVEMENT || Chapter 5** - **_Development_** This is the development project for chapter 5, where we experiment with multiple movement types in VR, including Gliding, Climbing, Locomotion, and Teleportation. https://scionglobe.itch.io/movement-development ----------------------------------------------------------------------------------------------- - **_Production_** For this production I adjusted the aesthetics into a snowy world, using an ice axe for climbing, and adding snowmen and ice. ![image](https://user-images.githubusercontent.com/49692399/117032442-5715bd80-acb6-11eb-8726-592ad58a4ea2.png) ![image](https://user-images.githubusercontent.com/49692399/117032488-60068f00-acb6-11eb-906c-b4aa0029d7de.png) ![image](https://user-images.githubusercontent.com/49692399/117032541-698ff700-acb6-11eb-960d-75fd9a7bdbab.png) ![image](https://user-images.githubusercontent.com/49692399/117032567-6eed4180-acb6-11eb-8a9f-9cc58ee47c92.png) https://scionglobe.itch.io/movement-production
Python
UTF-8
22,827
3.453125
3
[ "MIT" ]
permissive
import math import colorama colorama.init() colors = { "WHITE": 0, "YELLOW": 1, "BLUE": 2, "GREEN": 3, "RED": 4, "PURPLE": 5 } color_strings = { 0: colorama.Fore.WHITE + 'W', 1: colorama.Fore.YELLOW + 'Y', 2: colorama.Fore.BLUE + 'B', 3: colorama.Fore.GREEN + 'G', 4: colorama.Fore.RED + 'R', 5: colorama.Fore.MAGENTA + 'P', } DIMENSION = 3 LAST = DIMENSION - 1 FIRST = 0 iter_dim = range(DIMENSION) class Cube(object): def __init__(self): self.to_solved() def __eq__(self, other): if isinstance(other, Cube): return (self._F == other._F and self._B == other._B and self._R == other._R and self._L == other._L and self._U == other._U and self._D == other._D) else: return False ''' --------------------------------------------------------------------------- | Public Methods: | --------------------------------------------------------------------------- ''' def do(self, formula, times=1): if isinstance(formula, str): for _ in range(times): self._parse_formula(formula) else: print 'Error: Input formula is not a string.' # Turn the right face clockwise. Affects faces F, D, U, B def r(self): # First create a temporary buffer holding the front face's right col temp = Cube._get_col(self._F, LAST) # Second, swap the temporary buffer (which currently contains the front) # right col) with the right column of the up face Cube._swap(temp, self._U, col=LAST) # Third, swap the temporary buffer with the *LEFT* column of the back face Cube._swap(temp, self._B, col=FIRST, reverse=True) # Fourth, swap the temporary buffer with the right column of the down face Cube._swap(temp, self._D, col=LAST, reverse=True) # Fifth, swap the buffer with the right column of the front face (where we started) Cube._swap(temp, self._F, col=LAST) Cube._rotate_face_cw(self._R) # Turn the right face counter-clockwise. Affects faces F, D, U, B def r_prime(self): # First create a temporary buffer for swapping rows and cols btw faces temp = Cube._get_col(self._F, LAST) # Second, swap the temporary buffer (which currently contains the front) # right col) with the right column of the down face Cube._swap(temp, self._D, col=LAST) # Third, swap the temporary buffer with the *LEFT* column of the back face Cube._swap(temp, self._B, col=FIRST, reverse=True) # Fourth, swap the temporary buffer with the right column of the up face Cube._swap(temp, self._U, col=LAST, reverse=True) # Fifth, swap the buffer with the right column of the front face (where we started) Cube._swap(temp, self._F, col=LAST) Cube._rotate_face_ccw(self._R) def r2(self): self.r() self.r() def l(self): # First create a temporary buffer holding the front face's left col temp = Cube._get_col(self._F, FIRST) # Second, swap the temporary buffer (which currently contains the front) # left col) with the left column of the down face Cube._swap(temp, self._D, col=FIRST) # Third, swap the temporary buffer with the *RIGHT* column of the back face Cube._swap(temp, self._B, col=LAST, reverse=True) # Fourth, swap the temporary buffer with the left column of the up face Cube._swap(temp, self._U, col=FIRST, reverse=True) # Fifth, swap the buffer with the left column of the front face (where we started) Cube._swap(temp, self._F, col=FIRST) Cube._rotate_face_cw(self._L) def l_prime(self): # First create a temporary buffer holding the front face's left col temp = Cube._get_col(self._F, FIRST) # Second, swap the temporary buffer (which currently contains the front) # left col) with the left column of the up face Cube._swap(temp, self._U, col=FIRST) # Third, swap the temporary buffer with the *RIGHT* column of the back face Cube._swap(temp, self._B, col=LAST, reverse=True) # Fourth, swap the temporary buffer with the left column of the down face Cube._swap(temp, self._D, col=FIRST, reverse=True) # Fifth, swap the buffer with the left column of the front face (where we started) Cube._swap(temp, self._F, col=FIRST) Cube._rotate_face_ccw(self._L) def l2(self): self.l() self.l() def u(self): # First create a temporary buffer holding the front face's first row temp = Cube._get_row(self._F, FIRST) # Second, swap the temporary buffer (which currently contains the front) # top row) with the first row of the left face Cube._swap(temp, self._L, row=FIRST) # Third, swap the temporary buffer with the first row of the back face Cube._swap(temp, self._B, row=FIRST) # Fourth, swap the temporary buffer with the first row of the right face Cube._swap(temp, self._R, row=FIRST) # Fifth, swap the buffer with the first row of the front face (where we started) Cube._swap(temp, self._F, row=FIRST) Cube._rotate_face_cw(self._U) def u_prime(self): # First create a temporary buffer holding the front face's first row temp = Cube._get_row(self._F, FIRST) # Second, swap the temporary buffer (which currently contains the front) # top row) with the first row of the right face Cube._swap(temp, self._R, row=FIRST) # Third, swap the temporary buffer with the first row of the back face Cube._swap(temp, self._B, row=FIRST) # Fourth, swap the temporary buffer with the first row of the left face Cube._swap(temp, self._L, row=FIRST) # Fifth, swap the buffer with the first row of the front face (where we started) Cube._swap(temp, self._F, row=FIRST) Cube._rotate_face_ccw(self._U) def u2(self): self.u() self.u() def d(self): # First create a temporary buffer holding the front face's last row temp = Cube._get_row(self._F, LAST) # Second, swap the temporary buffer (which currently contains the front) # top row) with the last row of the right face Cube._swap(temp, self._R, row=LAST) # Third, swap the temporary buffer with the last row of the back face Cube._swap(temp, self._B, row=LAST) # Fourth, swap the temporary buffer with the last row of the left face Cube._swap(temp, self._L, row=LAST) # Fifth, swap the buffer with the last row of the front face (where we started) Cube._swap(temp, self._F, row=LAST) Cube._rotate_face_cw(self._D) def d_prime(self): # First create a temporary buffer holding the front face's last row temp = Cube._get_row(self._F, LAST) # Second, swap the temporary buffer (which currently contains the front) # top row) with the last row of the left face Cube._swap(temp, self._L, row=LAST) # Third, swap the temporary buffer with the last row of the back face Cube._swap(temp, self._B, row=LAST) # Fourth, swap the temporary buffer with the last row of the right face Cube._swap(temp, self._R, row=LAST) # Fifth, swap the buffer with the last row of the front face (where we started) Cube._swap(temp, self._F, row=LAST) Cube._rotate_face_ccw(self._D) def d2(self): self.d() self.d() def f(self): # First create a temporary buffer holding the up face's last row temp = Cube._get_row(self._U, LAST) # Second, swap the temporary buffer (which currently contains the front) # top row) with the first row of the right face Cube._swap(temp, self._R, col=FIRST) # Third, swap the temporary buffer with the first row of the down face Cube._swap(temp, self._D, row=FIRST, reverse=True) # Fourth, swap the temporary buffer with the last col of the left face Cube._swap(temp, self._L, col=LAST) # Fifth, swap the buffer with the last row of the up face (where we started) Cube._swap(temp, self._U, row=LAST, reverse=True) Cube._rotate_face_cw(self._F) def f_prime(self): # First create a temporary buffer holding the up face's last row temp = Cube._get_row(self._U, LAST) # Second, swap the temporary buffer (which currently contains the front) # top row) with the last row of the left face Cube._swap(temp, self._L, col=LAST, reverse=True) # Third, swap the temporary buffer with the last row of the back face Cube._swap(temp, self._D, row=FIRST) # Fourth, swap the temporary buffer with the last row of the right face Cube._swap(temp, self._R, col=FIRST, reverse=True) # Fifth, swap the buffer with the last row of the front face (where we started) Cube._swap(temp, self._U, row=LAST) Cube._rotate_face_ccw(self._F) def f2(self): self.f() self.f() def b(self): # First create a temporary buffer holding the up face's first row temp = Cube._get_row(self._U, FIRST) # Second, swap the temporary buffer (which currently contains the front) # top row) with the last row of the left face Cube._swap(temp, self._L, col=FIRST, reverse=True) # Third, swap the temporary buffer with the last row of the back face Cube._swap(temp, self._D, row=LAST) # Fourth, swap the temporary buffer with the last row of the right face Cube._swap(temp, self._R, col=LAST, reverse=True) # Fifth, swap the buffer with the last row of the front face (where we started) Cube._swap(temp, self._U, row=FIRST) Cube._rotate_face_cw(self._B) def b_prime(self): # First create a temporary buffer holding the up face's last row temp = Cube._get_row(self._U, FIRST) # Second, swap the temporary buffer (which currently contains the front) # top row) with the last row of the left face Cube._swap(temp, self._R, col=LAST) # Third, swap the temporary buffer with the last row of the back face Cube._swap(temp, self._D, row=LAST, reverse=True) # Fourth, swap the temporary buffer with the last row of the right face Cube._swap(temp, self._L, col=FIRST) # Fifth, swap the buffer with the last row of the front face (where we started) Cube._swap(temp, self._U, row=FIRST, reverse=True) Cube._rotate_face_ccw(self._B) def b2(self): self.b() self.b() def is_solved(self): return all([elm == face[DIMENSION / 2][DIMENSION / 2] for face in [self._F, self._B, self._L, self._R, self._U, self._D] for row in face for elm in row]) def to_solved(self): self._F = [[colors['RED'] for j in iter_dim] for i in iter_dim] self._B = [[colors['PURPLE'] for j in iter_dim] for i in iter_dim] self._L = [[colors['GREEN'] for j in iter_dim] for i in iter_dim] self._R = [[colors['BLUE'] for j in iter_dim] for i in iter_dim] self._U = [[colors['WHITE'] for j in iter_dim] for i in iter_dim] self._D = [[colors['YELLOW'] for j in iter_dim] for i in iter_dim] def to_checker(self): if not self.is_solved(): self.to_solved() self.l2() self.r2() self.f2() self.b2() self.u2() self.d2() def to_centers(self, times=1): if not self.is_solved(): self.to_solved() times = max(times, 0) times_to_solve = 3 times %= times_to_solve for i in range(times): self.r() self.l_prime() self.u() self.d_prime() self.f_prime() self.b() self.r() self.l_prime() def trigger(self, times=1): times = max(times, 0) times_to_solve = 4 times %= times_to_solve for i in range(times): self.r() self.u() self.r_prime() def trigger_u2(self, times=1): times = max(times, 0) times_to_solve = 2 times %= times_to_solve for i in range(times): self.r() self.u2() self.r_prime() def sune(self, times=1): times = max(times, 0) times_to_solve = 6 times %= times_to_solve for i in range(times): self.trigger() self.u() self.trigger_u2() ''' --------------------------------------------------------------------------- | Helper Methods: | --------------------------------------------------------------------------- ''' def _parse_formula(self, formula): moves = formula.strip().split() for move in moves: if len(move) >= 3 or len(move) == 0: print 'Error at move ' + move + '. Moves must have a length of 1 or 2.' else: self._perform(move) def _perform(self, move): if move == 'F': self.f() elif move == 'B': self.b() elif move == 'R': self.r() elif move == 'L': self.l() elif move == 'U': self.u() elif move == 'D': self.d() elif move == 'F\'': self.f_prime() elif move == 'B\'': self.b_prime() elif move == 'R\'': self.r_prime() elif move == 'L\'': self.l_prime() elif move == 'U\'': self.u_prime() elif move == 'D\'': self.d_prime() elif move == 'F2' or move == '2F': self.f2() elif move == 'B2' or move == '2B': self.b2() elif move == 'R2' or move == '2R': self.r2() elif move == 'L2' or move == '2L': self.l2() elif move == 'U2' or move == '2U': self.u2() elif move == 'D2' or move == '2D': self.d2() # Swaps the elements in the buffer list with the cooresponding row or col of the face @staticmethod def _swap(swap_buffer, face, row=None, col=None, reverse=False): if (col != None and row != None) or (col == None and row == None): print('Invalid use of _swap. Supply row or col.') return # Swap between the swap_buffer and the face along the specified column if col != None: column = Cube._get_col(face, col) Cube._swap_row_or_col(swap_buffer, column) if reverse: column.reverse() # We have to manually add back the swapped column, because there is # no way to get a mutable reference to a standard 2D list's column Cube._set_col(face, column, col) # Swap between the swap_buffer and the face along the specified row elif row != None: # {r} is a (mutable) reference to the current face's row. Because # of this we don't need to set explicitly the row of the face after. _row = Cube._get_row(face, row) Cube._swap_row_or_col(swap_buffer, _row) if reverse: _row.reverse() # Face *MUST* be a square matrix @staticmethod def _rotate_face_cw(face): dim = len(face) if dim <= 1: # Cant rotate a single edge return # number of edges *per top row!* (number of pieces in the top row minus # 2 corners) num_edges = dim - 2 first = 0 last = dim - 1 # swap all the edges for i in range(num_edges): temp_edge = face[first][i + 1] temp_edge = Cube._swap_piece(temp_edge, face, i + 1, last) temp_edge = Cube._swap_piece(temp_edge, face, last, last - (i + 1)) temp_edge = Cube._swap_piece(temp_edge, face, last - (i + 1), first) temp_edge = Cube._swap_piece(temp_edge, face, first, last - (i + 1)) # swap all the corners temp_corner = face[first][first] temp_corner = Cube._swap_piece(temp_corner, face, first, last) temp_corner = Cube._swap_piece(temp_corner, face, last, last) temp_corner = Cube._swap_piece(temp_corner, face, last, first) temp_corner = Cube._swap_piece(temp_corner, face, first, first) inner_face = Cube._get_inner_face(face) # Rotate the inner layers Cube._rotate_face_cw(inner_face) @staticmethod def _rotate_face_ccw(face): dim = len(face) if dim <= 1: # Cant rotate a single edge return # number of edges *per top row!* (number of pieces in the top row minus # 2 corners) num_edges = dim - 2 first = 0 last = dim - 1 # swap all the edges for i in range(num_edges): temp_edge = face[FIRST][i + 1] temp_edge = Cube._swap_piece(temp_edge, face, i + 1, first) temp_edge = Cube._swap_piece(temp_edge, face, last, (i + 1)) temp_edge = Cube._swap_piece(temp_edge, face, last - (i + 1), last) temp_edge = Cube._swap_piece(temp_edge, face, first, last - (i + 1)) # swap all the corners temp_corner = face[FIRST][FIRST] temp_corner = Cube._swap_piece(temp_corner, face, last, first) temp_corner = Cube._swap_piece(temp_corner, face, last, last) temp_corner = Cube._swap_piece(temp_corner, face, first, last) temp_corner = Cube._swap_piece(temp_corner, face, first, first) inner_face = Cube._get_inner_face(face) # Rotate the inner layers Cube._rotate_face_ccw(inner_face) @staticmethod def _get_inner_face(face): inner_rows = face[1:len(face) - 1] inner_face = [] for row in inner_rows: inner_face.append(row[1:len(face) - 1]) return inner_face @staticmethod def _swap_piece(temp_piece, face, row=0, col=0): piece_buffer = face[row][col] face[row][col] = temp_piece return piece_buffer @staticmethod def _get_row_or_col(face, row=None, col=None): if col != None: return Cube._get_col(face, col) elif row != None: return Cube._get_row(face, row) @staticmethod def _set_row_or_col(face, row_or_col, row=None, col=None): if col != None: return Cube._set_col(face, row_or_col, col) elif row != None: return Cube._set_row(face, row_or_col, row) @staticmethod def _swap_row_or_col(swap_buffer, row_or_col): temp_buffer = row_or_col[:] row_or_col[:] = swap_buffer[:] swap_buffer[:] = temp_buffer @staticmethod def _get_col(face, col=0): return [row[col] for row in face] @staticmethod def _get_row(face, row=0): return face[row] @staticmethod def _set_col(face, col_buffer, col=0): for r in iter_dim: face[r][col] = col_buffer[r] @staticmethod def _set_row(face, row_buffer, row=0): face[row] = row_buffer[:] # {face} *MUST* be a 2D list. Returns a list of length {len(face) * len(face[0])} # of the elements of face ordered by column. ''' Example: > a = [[random.randint(1,100) for x in range(3)] for y in range(3)] #=> a = #=> [[49, 84, 51], [80, 7, 37], [20, 34, 70]] > b = _flatten_face_columns(a) #=> b = #=> [49, 80, 20, 84, 7, 34, 51, 37, 70] ''' @staticmethod def _flatten_face_columns(face): return [face[i][j] for j in range(len(face[0])) for i in range(len(face))] # {face} *MUST* be a 2D list. Returns a list of length {len(face) * len(face[0])} # of the elements of face ordered by row. ''' Example: > a = [[random.randint(1,100) for x in range(3)] for y in range(3)] #=> a = #=> [[49, 84, 51], [80, 7, 37], [20, 34, 70]] > b = _flatten_face_rows(a) #=> b = #=> [49, 84, 51, 80, 7, 37, 20, 34, 70] ''' @staticmethod def _flatten_face_rows(face): return [face[i][j] for i in range(len(face)) for j in range(len(face[0]))] # Reconstructs a 2D list of a flattened column-ordered list. ''' Example: > a = [[random.randint(1,100) for x in range(3)] for y in range(3)] #=> a = #=> [[49, 84, 51], [80, 7, 37], [20, 34, 70]] > b = _flatten_face_columns(a) #=> b = #=> [49, 80, 20, 84, 7, 34, 51, 37, 70] > c = _reconstruct_face_columns(b) #=> c = #=> [[49, 84, 51], [80, 7, 37], [20, 34, 70]] ''' @staticmethod def _reconstruct_face_columns(flat_face): return [[flat_face[DIMENSION * i + j] for i in iter_dim] for j in iter_dim] # Reconstructs a 2D list of a flattened column-ordered list. ''' Example: > a = [[random.randint(1,100) for x in range(3)] for y in range(3)] #=> a = #=> [[49, 84, 51], [80, 7, 37], [20, 34, 70]] > b = _flatten_face_rows(a) #=> b = #=> [49, 84, 51, 80, 7, 37, 20, 34, 70] > c = _reconstruct_face_rows(b) #=> c = #=> [[49, 84, 51], [80, 7, 37], [20, 34, 70]] ''' @staticmethod def _reconstruct_face_rows(flat_face): return [[flat_face[DIMENSION * i + j] for j in iter_dim] for i in iter_dim] def __str__(self): string = '' # Stringify all dimensions of the cube plus 1 for the header string for i in range(DIMENSION + 1): # First print the head string if i == 0: space = ' ' * DIMENSION first_space = ' ' * (DIMENSION / 2) # The below order is the same order we add in the init method string += colorama.Fore.BLACK + first_space + 'F' + space + 'B' + space + 'L' + space + 'R' + space + 'U' + space + 'D\n' # Next print each row of each face else: for face in [self._F, self._B, self._L, self._R, self._U, self._D]: for j in iter_dim: string += color_strings[face[i - 1][j]] string += ' ' string += '\n' string += colorama.Style.RESET_ALL return string
Markdown
UTF-8
1,044
2.59375
3
[]
no_license
--- title: Imperative label: [Common,Frontend,Backend] origin: Imperative pronunciation: 임퍼러티브 mean: 명령적인 relation: [C,Java등대부분의프로그래밍언어 ,DeclarativeProgramming(명령형프로그래밍) ] slug: /I/Imperative --- <content> <p>컴퓨터 과학에서 명령형 프로그래밍(Imperative programming)은 선언형 프로그래밍과 반대되는 개념으로, 프로그래밍의 <span style="color:#FFBF00; font-weight:bold;">상태와 상태를 변경시키는 구문의 관점에서 연산을 설명</span>하는 프로그래밍 패러다임의 일종이다. 자연 언어에서의 명령법이 어떤 동작을 할 것인지를 명령으로 표현하듯이, 명령형 프로그램은 컴퓨터가 수행할 명령들을 순서대로 써 놓은 것이다.</p> <p><img src="../2TAT1C/Imperative_1.png" alt="명령형 vs 선언형" /></p> <p><a href="https://ko.wikipedia.org/wiki/%EB%AA%85%EB%A0%B9%ED%98%95_%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D">참고 - 위키피디아</a></p> </content>
SQL
UTF-8
106
2.734375
3
[]
no_license
SELECT COUNT(id) AS 'Number of movies that starts with "eX"' FROM movies WHERE title LIKE BINARY ('eX%');
C#
UTF-8
2,835
3.328125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LabsLINQ2._3._4 { class Empleado { private int _idEmpleado; private string _nomEmpleado; private decimal _sueldoEmp; public int IdEmp { get { return _idEmpleado; } set { _idEmpleado = value; } } public string NombreEmp { get { return _nomEmpleado; } set { _nomEmpleado = value; } } public decimal SueldoEmp { get { return _sueldoEmp; } set { _sueldoEmp = value; } } public void Menu(List<Empleado> emp) { bool ok = true; int op = 0; while (ok) { Console.WriteLine("Menu de opciones"); Console.WriteLine("1. Ingrese un nuevo empleado"); Console.WriteLine("2. Mostrar empleados"); op = int.Parse(Console.ReadLine()); switch (op) { case 1: emp.Add(AltaEmp()); break; case 2: MostrarEmpleado(emp); break; } } } public Empleado AltaEmp() { Empleado emp = new Empleado(); Console.WriteLine("Ingresar nombre para el nuevo empleado"); emp.NombreEmp = Console.ReadLine(); Console.WriteLine("Ingresar ID para el nuevo empleado"); emp.IdEmp = int.Parse(Console.ReadLine()); Console.WriteLine("Ingresar Sueldo para el nuevo empleado"); emp.SueldoEmp = decimal.Parse(Console.ReadLine()); return emp; } public void MostrarEmpleado(List<Empleado> empleados) { var misEmpleadosasc = from e in empleados orderby e.SueldoEmp ascending select e; var misEmpleadosdesc = from e in empleados orderby e.SueldoEmp descending select e; foreach (var e in misEmpleadosasc) { Console.WriteLine("ID: "+e.IdEmp+ " Nombre: "+ e.NombreEmp +" Sueldo: "+e.SueldoEmp); } foreach(var e in misEmpleadosdesc) { Console.WriteLine("ID: " + e.IdEmp + " Nombre: " + e.NombreEmp + " Sueldo: " + e.SueldoEmp); } } } }
SQL
UTF-8
164
3.203125
3
[]
no_license
select o.order_id, o.date, l.name, o.currency, o.amount, o.order_type, o.status from orders o join landing_pages l on o.landing_id = l.id where o.client_id = $1
Java
UTF-8
1,777
2.8125
3
[ "Apache-2.0" ]
permissive
package cn.ieclipse.common; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; public class LimitArrayListTest { private int limit = 3; LimitArrayList<Integer> list; @Before public void setUp() throws Exception { list = new LimitArrayList<>(this.limit); } @After public void tearDown() throws Exception { } @Test public void testAddE() { for (int i = 0; i < 5; i++) { list.add(i); } assertEquals(this.limit, list.size()); assertEquals(4, list.get(this.limit - 1).intValue()); } @Test public void testAddIntE() { try { list.add(0, 3); } catch (Exception e) { assertEquals(e.getClass(), UnsupportedOperationException.class); } } @Test public void testAddAllCollectionOfQextendsE() { List<Integer> c = Arrays.asList(0, 1); list.add(1); list.addAll(c); assertEquals(list, Arrays.asList(1, 0, 1)); c = Arrays.asList(11, 12); list.addAll(c); assertEquals(list, Arrays.asList(1, 11, 12)); c = Arrays.asList(21, 22, 23); list.addAll(c); assertEquals(list, c); c = Arrays.asList(31, 32, 33, 34); list.addAll(c); assertEquals(list, Arrays.asList(32, 33, 34)); } @Test public void testAddAllIntCollectionOfQextendsE() { try { list.addAll(0, null); } catch (Exception e) { assertEquals(e.getClass(), UnsupportedOperationException.class); } } }
Rust
UTF-8
43,638
2.59375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
use std::rc::Rc; use crate::co; use crate::gui::events::func_store::FuncStore; use crate::gui::very_unsafe_cell::VeryUnsafeCell; use crate::handles::{HDC, HICON}; use crate::msg::{MsgSendRecv, wm, WndMsg}; /// The result of processing a message. pub(crate) enum ProcessResult { /// Message was not handled because no function was found. NotHandled, /// Message handled, and return value is meaningful. HandledWithRet(isize), /// Message handled, but you should return the default value (0 or FALSE). HandledWithoutRet, } //------------------------------------------------------------------------------ /// Exposes window /// [messages](https://docs.microsoft.com/en-us/windows/win32/winmsg/about-messages-and-message-queues). /// /// You cannot directly instantiate this object, it is created internally by the /// window. pub struct WindowEvents(VeryUnsafeCell<Obj>); struct Obj { // actual fields of WindowEvents msgs: FuncStore< // ordinary WM messages co::WM, Box<dyn FnMut(WndMsg) -> Option<isize>>, // return value may be meaningful >, tmrs: FuncStore< // WM_TIMER messages u32, Box<dyn FnMut()>, // return value is never meaningful >, cmds: FuncStore< // WM_COMMAND notifications (co::CMD, u16), // code, ctrl_id Box<dyn FnMut()>, // return value is never meaningful >, nfys: FuncStore< // WM_NOTIFY notifications (u16, co::NM), // idFrom, code Box<dyn FnMut(wm::Notify) -> Option<isize>>, // return value may be meaningful >, } impl WindowEvents { pub(crate) fn new() -> WindowEvents { Self( VeryUnsafeCell::new( Obj { msgs: FuncStore::new(), tmrs: FuncStore::new(), cmds: FuncStore::new(), nfys: FuncStore::new(), }, ), ) } /// Tells whether no functions have been added. pub(crate) fn is_empty(&self) -> bool { self.0.msgs.is_empty() && self.0.tmrs.is_empty() && self.0.cmds.is_empty() && self.0.nfys.is_empty() } /// Searches for the last added user function for the given message, and runs /// if it exists, returning the result. pub(crate) fn process_effective_message(&self, wm_any: WndMsg) -> ProcessResult { match wm_any.msg_id { co::WM::NOTIFY => { let wm_nfy = wm::Notify::from_generic_wm(wm_any); let key = (wm_nfy.nmhdr.idFrom as u16, wm_nfy.nmhdr.code); match self.0.as_mut().nfys.find(key) { Some(func) => { // we have a stored function to handle this WM_NOTIFY notification match func(wm_nfy) { // execute user function Some(res) => ProcessResult::HandledWithRet(res), // meaningful return value None => ProcessResult::HandledWithoutRet, } }, None => ProcessResult::NotHandled, // no stored WM_NOTIFY notification } }, co::WM::COMMAND => { let wm_cmd = wm::Command::from_generic_wm(wm_any); let key = (wm_cmd.code, wm_cmd.ctrl_id); match self.0.as_mut().cmds.find(key) { Some(func) => { // we have a stored function to handle this WM_COMMAND notification func(); // execute user function ProcessResult::HandledWithoutRet }, None => ProcessResult::NotHandled, // no stored WM_COMMAND notification } }, co::WM::TIMER => { let wm_tmr = wm::Timer::from_generic_wm(wm_any); match self.0.as_mut().tmrs.find(wm_tmr.timer_id) { Some(func) => { // we have a stored function to handle this WM_TIMER message func(); // execute user function ProcessResult::HandledWithoutRet }, None => ProcessResult::NotHandled, // no stored WM_TIMER message } } _ => { // any other message match self.0.as_mut().msgs.find(wm_any.msg_id) { Some(func) => { // we have a stored function to handle this message match func(wm_any) { // execute user function Some(res) => ProcessResult::HandledWithRet(res), // meaningful return value None => ProcessResult::HandledWithoutRet, } }, None => ProcessResult::NotHandled, // no stored function } }, } } /// Searches for all user functions for the given message, and runs all of /// them, discarding the results. pub(crate) fn process_all_messages(&self, wm_any: WndMsg) { match wm_any.msg_id { co::WM::NOTIFY => { let wm_nfy = wm::Notify::from_generic_wm(wm_any); let key = (wm_nfy.nmhdr.idFrom as u16, wm_nfy.nmhdr.code); self.0.as_mut().nfys.find_all(key, |func| { func(wm_nfy); }); }, co::WM::COMMAND => { let wm_cmd = wm::Command::from_generic_wm(wm_any); let key = (wm_cmd.code, wm_cmd.ctrl_id); self.0.as_mut().cmds.find_all(key, |func| { func(); }); }, co::WM::TIMER => { let wm_tmr = wm::Timer::from_generic_wm(wm_any); self.0.as_mut().tmrs.find_all(wm_tmr.timer_id, |func| { func(); }); }, _ => { // any other message self.0.as_mut().msgs.find_all(wm_any.msg_id, |func| { func(wm_any); }); }, } } /// Raw add message. pub(crate) fn add_msg<F>(&self, ident: co::WM, func: F) where F: FnMut(WndMsg) -> Option<isize> + 'static, { self.0.as_mut().msgs.insert(ident, Box::new(func)); } /// Raw add notification. pub(crate) fn add_nfy<F>(&self, id_from: u16, code: co::NM, func: F) where F: FnMut(wm::Notify) -> Option<isize> + 'static, { self.0.as_mut().nfys.insert((id_from, code), Box::new(func)); } } /// A message which has no parameters and returns zero. macro_rules! wm_empty { ( $name:ident, $wmconst:expr, $(#[$doc:meta])* ) => { $(#[$doc])* pub fn $name<F>(&self, func: F) where F: FnMut() + 'static, { self.add_msg($wmconst, { let mut func = func; move |_| { func(); None } // return value is never meaningful }); } }; } /// A message with parameters which returns zero. macro_rules! wm_ret_none { ( $name:ident, $wmconst:expr, $parm:ty, $(#[$doc:meta])* ) => { $(#[$doc])* pub fn $name<F>(&self, func: F) where F: FnMut($parm) + 'static, { self.add_msg($wmconst, { let mut func = func; move |p| { func(<$parm>::from_generic_wm(p)); None } // return value is never meaningful }); } }; } impl WindowEvents { /// Event to any [window message](crate::co::WM). /// /// **Note:** Instead of using this event, you should always prefer the /// specific events, which will give you the correct message parameters. This /// generic method should be used when you have a custom, non-standard window /// message. /// /// # Examples /// /// Handling a custom, user-defined message: /// /// ```rust,ignore /// use winsafe::{co, gui::WindowMain}; /// /// let wnd: WindowMain; // initialize it somewhere... /// /// let CUSTOM_MSG = co::WM::from(0x1234); /// /// wnd.on().wm(CUSTOM_MSG, { /// let wnd = wnd.clone(); // pass into the closure /// move |parms| { /// println!("HWND: {}, msg ID: {}", wnd.hwnd(), parms.msg_id); /// 0 /// } /// }); /// ``` pub fn wm<F>(&self, ident: co::WM, func: F) where F: FnMut(WndMsg) -> isize + 'static, { self.add_msg(ident, { let mut func = func; move |p| Some(func(p)) // return value is meaningful }); } /// [`WM_TIMER`](crate::msg::wm::Timer) message, narrowed to a specific timer /// ID. /// /// Posted to the installing thread's message queue when a timer expires. pub fn wm_timer<F>(&self, timer_id: u32, func: F) where F: FnMut() + 'static, { self.0.as_mut().tmrs.insert(timer_id, Box::new(func)); } /// [`WM_COMMAND`](crate::msg::wm::Command) message, for specific code and /// control ID. /// /// A command notification must be narrowed by the /// [command code](crate::co::CMD) and the control ID, so the closure will /// be fired for that specific control at that specific event. /// /// **Note:** Instead of using this event, you should always prefer the /// specific command notifications, which will give you the correct message /// parameters. This generic method should be used when you have a custom, /// non-standard window notification. pub fn wm_command<F>(&self, code: co::CMD, ctrl_id: u16, func: F) where F: FnMut() + 'static, { self.0.as_mut().cmds.insert((code, ctrl_id), Box::new(func)); } /// [`WM_COMMAND`](crate::msg::wm::Command) message, handling both /// `co::CMD::Accelerator` and `co::CMD::Menu`, for a specific command ID. /// /// Ideal to be used with menu commands whose IDs are shared with /// accelerators. /// /// # Examples /// /// Closing the window on ESC key: /// /// ```rust,ignore /// use winsafe::{co, gui::WindowMain, msg::wm}; /// /// let wnd: WindowMain; // initialize it somewhere... /// /// wnd.on().wm_command_accel_menu(co::DLGID::CANCEL.into(), { /// let wnd = wnd.clone(); // pass into the closure /// move || { /// wnd.hwnd().PostMessage(wm::Close {}).unwrap(); /// } /// }); /// ``` pub fn wm_command_accel_menu<F>(&self, ctrl_id: u16, func: F) where F: FnMut() + 'static, { let shared_func = Rc::new(VeryUnsafeCell::new(func)); self.wm_command(co::CMD::Menu, ctrl_id, { let shared_func = shared_func.clone(); move || shared_func.as_mut()() }); self.wm_command(co::CMD::Accelerator, ctrl_id, { let shared_func = shared_func.clone(); move || shared_func.as_mut()() }); } /// [`WM_NOTIFY`](crate::msg::wm::Notify) message, for specific ID and /// notification code. /// /// A notification must be narrowed by the [notification code](crate::co::NM) /// and the control ID, so the closure will be fired for that specific /// control at the specific event. /// /// **Note:** Instead of using this event, you should always prefer the /// specific notifications, which will give you the correct notification /// struct. This generic method should be used when you have a custom, /// non-standard window notification. pub fn wm_notify<F>(&self, id_from: u16, code: co::NM, func: F) where F: FnMut(wm::Notify) -> isize + 'static, { self.add_nfy(id_from, code, { let mut func = func; move |p| Some(func(p)) // return value is meaningful }); } wm_ret_none! { wm_activate, co::WM::ACTIVATE, wm::Activate, /// [`WM_ACTIVATE`](crate::msg::wm::Activate) message. /// /// Sent to both the window being activated and the window being /// deactivated. If the windows use the same input queue, the message is /// sent synchronously, first to the window procedure of the top-level /// window being deactivated, then to the window procedure of the /// top-level window being activated. If the windows use different input /// queues, the message is sent asynchronously, so the window is activated /// immediately. /// /// # Default handling /// /// If you handle this event, you'll overwrite the default handling in: /// /// * non-dialog [`WindowMain`](crate::gui::WindowMain). } wm_ret_none! { wm_activate_app, co::WM::ACTIVATEAPP, wm::ActivateApp, /// [`WM_ACTIVATEAPP`](crate::msg::wm::ActivateApp) message. /// /// Sent when a window belonging to a different application than the /// active window is about to be activated. The message is sent to the /// application whose window is being activated and to the application /// whose window is being deactivated. } /// [`WM_APPCOMMAND`](crate::msg::wm::AppCommand) message. /// /// Notifies a window that the user generated an application command event, /// for example, by clicking an application command button using the mouse or /// typing an application command key on the keyboard. pub fn wm_app_command<F>(&self, func: F) where F: FnMut(wm::AppCommand) + 'static, { self.add_msg(co::WM::APPCOMMAND, { let mut func = func; move |p| { func(wm::AppCommand::from_generic_wm(p)); Some(true as isize) } }); } wm_empty! { wm_cancel_mode, co::WM::CANCELMODE, /// [`WM_CANCELMODE`](crate::msg::wm::CancelMode) message. /// /// Sent to cancel certain modes, such as mouse capture. For example, the /// system sends this message to the active window when a dialog box or /// message box is displayed. Certain functions also send this message /// explicitly to the specified window regardless of whether it is the /// active window. For example, the /// [`EnableWindow`](crate::HWND::EnableWindow) function sends this /// message when disabling the specified window. } wm_ret_none! { wm_char, co::WM::CHAR, wm::Char, /// [`WM_CHAR`](crate::msg::wm::Char) message. /// /// Posted to the window with the keyboard focus when a /// [`WM_KEYDOWN`](crate::msg::wm::KeyDown) message is translated by the /// [`TranslateMessage`](crate::TranslateMessage) function. The `WM_CHAR` /// message contains the character code of the key that was pressed. } wm_empty! { wm_child_activate, co::WM::CHILDACTIVATE, /// [`WM_CHILDACTIVATE`](crate::msg::wm::ChildActivate) message. /// /// Sent to a child window when the user clicks the window's title bar or /// when the window is activated, moved, or sized. } wm_empty! { wm_close, co::WM::CLOSE, /// [`WM_CLOSE`](crate::msg::wm::Close) message. /// /// Sent as a signal that a window or an application should terminate. /// /// # Default handling /// /// If you handle this event, you'll overwrite the default handling in: /// /// * dialog [`WindowMain`](crate::gui::WindowMain); /// * dialog [`WindowModal`](crate::gui::WindowModal); /// * non-dialog [`WindowModal`](crate::gui::WindowModal). } wm_empty! { wm_context_menu, co::WM::CONTEXTMENU, /// [`WM_CONTEXTMENU`](crate::msg::wm::ContextMenu) message. /// /// Notifies a window that the user desires a context menu to appear. The /// user may have clicked the right mouse button (right-clicked) in the /// window, pressed Shift+F10 or pressed the applications key (context /// menu key) available on some keyboards. } /// [`WM_CREATE`](crate::msg::wm::Create) message, sent only to non-dialog /// windows. Dialog windows receive /// [`WM_INITDIALOG`](crate::gui::events::WindowEvents::wm_init_dialog) /// instead. /// /// Sent when an application requests that a window be created by calling the /// [`CreateWindowEx`](crate::HWND::CreateWindowEx) function. The message is /// sent before the function returns. The window procedure of the new window /// receives this message after the window is created, but before the window /// becomes visible. /// /// # Examples /// /// ```rust,ignore /// use winsafe::gui::WindowMain; /// /// let wnd: WindowMain; // initialize it somewhere... /// /// wnd.on().wm_create({ /// let wnd = wnd.clone(); // pass into the closure /// move |parms| { /// println!("HWND: {}, client area: {}x{}", /// wnd.hwnd(), /// parms.createstruct.cx, /// parms.createstruct.cy, /// ); /// 0 /// } /// }); /// ``` pub fn wm_create<F>(&self, func: F) where F: FnMut(wm::Create) -> i32 + 'static, { self.add_msg(co::WM::CREATE, { let mut func = func; move |p| Some(func(wm::Create::from_generic_wm(p)) as isize) }); } /// [`WM_CTLCOLORBTN`](crate::msg::wm::CtlColorBtn) message. /// /// Sent to the parent window of a button before drawing the button. The /// parent window can change the button's text and background colors. /// However, only owner-drawn buttons respond to the parent window processing /// this message. pub fn wm_ctl_color_btn<F>(&self, func: F) where F: FnMut(wm::CtlColorBtn) -> HDC + 'static, { self.add_msg(co::WM::CTLCOLORBTN, { let mut func = func; move |p| Some(func(wm::CtlColorBtn::from_generic_wm(p)).ptr as isize) }); } /// [`WM_CTLCOLORDLG`](crate::msg::wm::CtlColorDlg) message. /// /// Sent to a dialog box before the system draws the dialog box. By /// responding to this message, the dialog box can set its text and /// background colors using the specified display device context handle. pub fn wm_ctl_color_dlg<F>(&self, func: F) where F: FnMut(wm::CtlColorDlg) -> HDC + 'static, { self.add_msg(co::WM::CTLCOLORDLG, { let mut func = func; move |p| Some(func(wm::CtlColorDlg::from_generic_wm(p)).ptr as isize) }); } /// [`WM_CTLCOLOREDIT`](crate::msg::wm::CtlColorEdit) message. /// /// An edit control that is not read-only or disabled sends the message to /// its parent window when the control is about to be drawn. By responding to /// this message, the parent window can use the specified device context /// handle to set the text and background colors of the edit control. pub fn wm_ctl_color_edit<F>(&self, func: F) where F: FnMut(wm::CtlColorEdit) -> HDC + 'static, { self.add_msg(co::WM::CTLCOLOREDIT, { let mut func = func; move |p| Some(func(wm::CtlColorEdit::from_generic_wm(p)).ptr as isize) }); } /// [`WM_CTLCOLORLISTBOX`](crate::msg::wm::CtlColorListBox) message. /// /// Sent to the parent window of a list box before the system draws the list /// box. By responding to this message, the parent window can set the text /// and background colors of the list box by using the specified display /// device context handle. pub fn wm_ctl_color_list_box<F>(&self, func: F) where F: FnMut(wm::CtlColorListBox) -> HDC + 'static, { self.add_msg(co::WM::CTLCOLORLISTBOX, { let mut func = func; move |p| Some(func(wm::CtlColorListBox::from_generic_wm(p)).ptr as isize) }); } /// [`WM_CTLCOLORSCROLLBAR`](crate::msg::wm::CtlColorScrollBar) message. /// /// Sent to the parent window of a scroll bar control when the control is /// about to be drawn. By responding to this message, the parent window can /// use the display context handle to set the background color of the scroll /// bar control. pub fn wm_ctl_color_scroll_bar<F>(&self, func: F) where F: FnMut(wm::CtlColorScrollBar) -> HDC + 'static, { self.add_msg(co::WM::CTLCOLORSCROLLBAR, { let mut func = func; move |p| Some(func(wm::CtlColorScrollBar::from_generic_wm(p)).ptr as isize) }); } /// [`WM_CTLCOLORSTATIC`](crate::msg::wm::CtlColorStatic) message. /// /// A static control, or an edit control that is read-only or disabled, sends /// the message to its parent window when the control is about to be drawn. /// By responding to this message, the parent window can use the specified /// device context handle to set the text foreground and background colors of /// the static control. pub fn wm_ctl_color_static<F>(&self, func: F) where F: FnMut(wm::CtlColorStatic) -> HDC + 'static, { self.add_msg(co::WM::CTLCOLORSTATIC, { let mut func = func; move |p| Some(func(wm::CtlColorStatic::from_generic_wm(p)).ptr as isize) }); } wm_ret_none! { wm_dead_char, co::WM::DEADCHAR, wm::DeadChar, /// [`WM_DEADCHAR`](crate::msg::wm::DeadChar) message. /// /// Posted to the window with the keyboard focus when a /// [`WM_KEYUP`](crate::msg::wm::KeyUp) message is translated by the /// [`TranslateMessage`](crate::TranslateMessage) function. `WM_DEADCHAR` /// specifies a character code generated by a dead key. A dead key is a /// key that generates a character, such as the umlaut (double-dot), that /// is combined with another character to form a composite character. For /// example, the umlaut-O character (Ö) is generated by typing the dead /// key for the umlaut character, and then typing the O key. } wm_empty! { wm_destroy, co::WM::DESTROY, /// [`WM_DESTROY`](crate::msg::wm::Destroy) message. /// /// Sent when a window is being destroyed. It is sent to the window /// procedure of the window being destroyed after the window is removed /// from the screen. /// /// This message is sent first to the window being destroyed and then to /// the child windows (if any) as they are destroyed. During the /// processing of the message, it can be assumed that all child windows /// still exist. } wm_ret_none! { wm_drop_files, co::WM::DROPFILES, wm::DropFiles, /// [`WM_DROPFILES`](crate::msg::wm::DropFiles) message. /// /// Sent when the user drops a file on the window of an application that /// has registered itself as a recipient of dropped files. } wm_ret_none! { wm_enable, co::WM::ENABLE, wm::Enable, /// [`WM_ENABLE`](crate::msg::wm::Enable) message. /// /// Sent when an application changes the enabled state of a window. It is /// sent to the window whose enabled state is changing. This message is /// sent before the [`EnableWindow`](crate::HWND::EnableWindow) function /// returns, but after the enabled state /// ([`WS_DISABLED`](crate::co::WS::DISABLED) style bit) of the window has /// changed. } wm_ret_none! { wm_end_session, co::WM::ENDSESSION, wm::EndSession, /// [`WM_ENDSESSION`](crate::msg::wm::EndSession) message. /// /// Sent to an application after the system processes the results of the /// [`WM_QUERYENDSESSION`](crate::gui::events::WindowEvents) message. The /// `WM_ENDSESSION` message informs the application whether the session is ending. } wm_ret_none! { wm_enter_idle, co::WM::ENTERIDLE, wm::EnterIdle, /// [`WM_ENTERIDLE`](crate::msg::wm::EnterIdle) message. /// /// Sent to the owner window of a modal dialog box or menu that is /// entering an idle state. A modal dialog box or menu enters an idle /// state when no messages are waiting in its queue after it has processed /// one or more previous messages. } wm_ret_none! { wm_enter_size_move, co::WM::ENTERSIZEMOVE, wm::EnterSizeMove, /// [`WM_ENTERSIZEMOVE`](crate::msg::wm::EnterSizeMove) message. /// /// Sent one time to a window after it enters the moving or sizing modal /// loop. The window enters the moving or sizing modal loop when the user /// clicks the window's title bar or sizing border, or when the window /// passes the /// [`WM_SYSCOMMAND`](crate::gui::events::WindowEvents::wm_sys_command) /// message to the `DefWindowProc` function and the `wParam` parameter of /// the message specifies the [`SC_MOVE`](crate::co::SC::MOVE) or /// [`SC_SIZE`](crate::co::SC::SIZE) value. The operation is complete when /// `DefWindowProc` returns. /// /// The system sends the message regardless of whether the dragging of /// full windows is enabled. } /// [`WM_ERASEBKGND`](crate::msg::wm::EraseBkgnd) message. /// /// Sent when the window background must be erased (for example, when a /// window is resized). The message is sent to prepare an invalidated portion /// of a window for painting. pub fn wm_erase_bkgnd<F>(&self, func: F) where F: FnMut(wm::EraseBkgnd) -> i32 + 'static, { self.add_msg(co::WM::ERASEBKGND, { let mut func = func; move |p| Some(func(wm::EraseBkgnd::from_generic_wm(p)) as isize) }); } wm_ret_none! { wm_exit_size_move, co::WM::EXITSIZEMOVE, wm::ExitSizeMove, /// [`WM_EXITSIZEMOVE`](crate::msg::wm::ExitSizeMove) message. /// /// Sent one time to a window, after it has exited the moving or sizing /// modal loop. The window enters the moving or sizing modal loop when the /// user clicks the window's title bar or sizing border, or when the /// window passes the /// [`WM_SYSCOMMAND`](crate::gui::events::WindowEvents::wm_sys_command) /// message to the `DefWindowProc` function and the `wParam` parameter of /// the message specifies the [`SC_MOVE`](crate::co::SC::MOVE) or /// [`SC_SIZE`](crate::co::SC::SIZE) value. The operation is complete when /// `DefWindowProc` returns. } wm_ret_none! { wm_get_min_max_info, co::WM::GETMINMAXINFO, wm::GetMinMaxInfo, /// [`WM_GETMINMAXINFO`](crate::msg::wm::GetMinMaxInfo) message. /// /// Sent to a window when the size or position of the window is about to /// change. An application can use this message to override the window's /// default maximized size and position, or its default minimum or maximum /// tracking size. } wm_ret_none! { wm_help, co::WM::HELP, wm::Help, /// [`WM_HELP`](crate::msg::wm::Help) message. /// /// Indicates that the user pressed the F1 key. } /// [`WM_INITDIALOG`](crate::msg::wm::InitDialog) message, sent only to dialog /// windows. Non-dialog windows receive /// [`WM_CREATE`](crate::gui::events::WindowEvents::wm_create) instead. /// /// Sent to the dialog box procedure immediately before a dialog box is /// displayed. Dialog box procedures typically use this message to initialize /// controls and carry out any other initialization tasks that affect the /// appearance of the dialog box. pub fn wm_init_dialog<F>(&self, func: F) where F: FnMut(wm::InitDialog) -> bool + 'static, { self.add_msg(co::WM::INITDIALOG, { let mut func = func; move |p| Some(func(wm::InitDialog::from_generic_wm(p)) as isize) }); } wm_ret_none! { wm_init_menu_popup, co::WM::INITMENUPOPUP, wm::InitMenuPopup, /// [`WM_INITMENUPOPUP`](crate::msg::wm::InitMenuPopup) message. /// /// Sent when a drop-down menu or submenu is about to become active. This /// allows an application to modify the menu before it is displayed, /// without changing the entire menu. } wm_ret_none! { wm_key_down, co::WM::KEYDOWN, wm::KeyDown, /// [`WM_KEYDOWN`](crate::msg::wm::KeyDown) message. /// /// Posted to the window with the keyboard focus when a nonsystem key is /// pressed. A nonsystem key is a key that is pressed when the ALT key is /// not pressed. } wm_ret_none! { wm_key_up, co::WM::KEYUP, wm::KeyUp, /// [`WM_KEYUP`](crate::msg::wm::KeyUp) message. /// /// Posted to the window with the keyboard focus when a nonsystem key is /// released. A nonsystem key is a key that is pressed when the ALT key is /// not pressed, or a keyboard key that is pressed when a window has the /// keyboard focus. } wm_ret_none! { wm_kill_focus, co::WM::KILLFOCUS, wm::KillFocus, /// [`WM_KILLFOCUS`](crate::msg::wm::KillFocus) message. /// /// Sent to a window immediately before it loses the keyboard focus. } wm_ret_none! { wm_l_button_dbl_clk, co::WM::LBUTTONDBLCLK, wm::LButtonDblClk, /// [`WM_LBUTTONDBLCLK`](crate::msg::wm::LButtonDblClk) message. /// /// Posted when the user double-clicks the left mouse button while the /// cursor is in the client area of a window. If the mouse is not /// captured, the message is posted to the window beneath the cursor. /// Otherwise, the message is posted to the window that has captured the /// mouse. } wm_ret_none! { wm_l_button_down, co::WM::LBUTTONDOWN, wm::LButtonDown, /// [`WM_LBUTTONDOWN`](crate::msg::wm::LButtonDown) message. /// /// Posted when the user presses the left mouse button while the cursor is /// in the client area of a window. If the mouse is not captured, the /// message is posted to the window beneath the cursor. Otherwise, the /// message is posted to the window that has captured the mouse. } wm_ret_none! { wm_l_button_up, co::WM::LBUTTONUP, wm::LButtonUp, /// [`WM_LBUTTONUP`](crate::msg::wm::LButtonUp) message. /// /// Posted when the user releases the left mouse button while the cursor /// is in the client area of a window. If the mouse is not captured, the /// message is posted to the window beneath the cursor. Otherwise, the /// message is posted to the window that has captured the mouse. } wm_ret_none! { wm_m_button_dbl_clk, co::WM::MBUTTONDBLCLK, wm::MButtonDblClk, /// [`WM_MBUTTONDBLCLK`](crate::msg::wm::MButtonDblClk) message. /// /// Posted when the user double-clicks the middle mouse button while the /// cursor is in the client area of a window. If the mouse is not /// captured, the message is posted to the window beneath the cursor. /// Otherwise, the message is posted to the window that has captured the /// mouse. } wm_ret_none! { wm_m_button_down, co::WM::MBUTTONDOWN, wm::MButtonDown, /// [`WM_MBUTTONDOWN`](crate::msg::wm::MButtonDown) message. /// /// Posted when the user presses the middle mouse button while the cursor /// is in the client area of a window. If the mouse is not captured, the /// message is posted to the window beneath the cursor. Otherwise, the /// message is posted to the window that has captured the mouse. } wm_ret_none! { wm_m_button_up, co::WM::MBUTTONUP, wm::MButtonUp, /// [`WM_MBUTTONUP`](crate::msg::wm::MButtonUp) message. /// /// Posted when the user releases the middle mouse button while the cursor /// is in the client area of a window. If the mouse is not captured, the /// message is posted to the window beneath the cursor. Otherwise, the /// message is posted to the window that has captured the mouse. } wm_ret_none! { wm_mouse_hover, co::WM::MOUSEHOVER, wm::MouseHover, /// [`WM_MOUSEHOVER`](crate::msg::wm::MouseHover) message. /// /// Posted to a window when the cursor hovers over the client area of the /// window for the period of time specified in a prior call to /// [`TrackMouseEvent`](crate::TrackMouseEvent). } wm_ret_none! { wm_mouse_move, co::WM::MOUSEMOVE, wm::MouseMove, /// [`WM_MOUSEMOVE`](crate::msg::wm::MouseMove) message. /// /// Posted to a window when the cursor moves. If the mouse is not /// captured, the message is posted to the window that contains the /// cursor. Otherwise, the message is posted to the window that has /// captured the mouse. } wm_ret_none! { wm_move, co::WM::MOVE, wm::Move, /// [`WM_MOVE`](crate::msg::wm::Move) message. /// /// Sent after a window has been moved. } wm_ret_none! { wm_moving, co::WM::MOVING, wm::Moving, /// [`WM_MOVING`](crate::msg::wm::Moving) message. /// /// Sent to a window that the user is moving. By processing this message, /// an application can monitor the position of the drag rectangle and, if /// needed, change its position. } /// [`WM_NCCALCSIZE`](crate::msg::wm::NcCalcSize) message. /// /// Sent when the size and position of a window's client area must be /// calculated. By processing this message, an application can control the /// content of the window's client area when the size or position of the /// window changes. pub fn wm_nc_calc_size<F>(&self, func: F) where F: FnMut(wm::NcCalcSize) -> co::WVR + 'static { self.add_msg(co::WM::NCCALCSIZE, { let mut func = func; move |p| Some(func(wm::NcCalcSize::from_generic_wm(p)).0 as isize) }); } /// [`WM_NCCREATE`](crate::msg::wm::NcCreate) message. /// /// Sent prior to the /// [`WM_CREATE`](crate::gui::events::WindowEvents::wm_create) message when a /// window is first created. pub fn wm_nc_create<F>(&self, func: F) where F: FnMut(wm::NcCreate) -> bool + 'static, { self.add_msg(co::WM::NCCREATE, { let mut func = func; move |p| Some(func(wm::NcCreate::from_generic_wm(p)) as isize) }); } wm_empty! { wm_nc_destroy, co::WM::NCDESTROY, /// [`WM_NCDESTROY`](crate::msg::wm::NcDestroy) message. /// /// Notifies a window that its nonclient area is being destroyed. The /// [`DestroyWindow`](crate::HWND::DestroyWindow) function sends the /// message to the window following the /// [`WM_DESTROY`](crate::gui::events::WindowEvents::wm_destroy) message. /// `WM_DESTROY` is used to free the allocated memory object associated /// with the window. /// /// The `WM_NCDESTROY` message is sent after the child windows have been /// destroyed. In contrast, `WM_DESTROY` is sent before the child windows /// are destroyed. /// /// # Default handling /// /// If you handle this event, you'll overwrite the default handling in: /// /// * non-dialog [`WindowMain`](crate::gui::WindowMain); /// * dialog [`WindowMain`](crate::gui::WindowMain). } wm_ret_none! { wm_nc_paint, co::WM::NCPAINT, wm::NcPaint, /// [`WM_NCPAINT`](crate::msg::wm::NcPaint) message. /// /// Sent to a window when its frame must be painted. /// /// # Default handling /// /// If you handle this event, you'll overwrite the default handling in: /// /// * non-dialog [`WindowControl`](crate::gui::WindowControl); /// * dialog [`WindowControl`](crate::gui::WindowControl). } wm_empty! { wm_null, co::WM::NULL, /// [`WM_NULL`](crate::msg::wm::Null) message. /// /// Performs no operation. An application sends the message if it wants to /// post a message that the recipient window will ignore. } wm_empty! { wm_paint, co::WM::PAINT, /// [`WM_PAINT`](crate::msg::wm::Paint) message. /// /// Sent when the system or another application makes a request to paint a /// portion of an application's window. The message is sent when the /// [`UpdateWindow`](crate::HWND::UpdateWindow) or /// [`RedrawWindow`](crate::HWND::RedrawWindow) function is called, or by /// the [`DispatchMessage`](crate::DispatchMessage) function when the /// application obtains a `WM_PAINT` message by using the /// [`GetMessage`](crate::GetMessage) or /// [`PeekMessage`](crate::PeekMessage) function. } wm_ret_none! { wm_parent_notify, co::WM::PARENTNOTIFY, wm::ParentNotify, /// [`WM_PARENTNOTIFY`](crate::msg::wm::ParentNotify) message. /// /// Sent to a window when a significant action occurs on a descendant /// window. } /// [`WM_QUERYOPEN`](crate::msg::wm::QueryOpen) message. /// /// Sent to an icon when the user requests that the window be restored to its /// previous size and position. pub fn wm_query_open<F>(&self, func: F) where F: FnMut(wm::QueryOpen) -> bool + 'static, { self.add_msg(co::WM::QUERYOPEN, { let mut func = func; move |p| Some(func(wm::QueryOpen::from_generic_wm(p)) as isize) }); } wm_ret_none! { wm_r_button_dbl_clk, co::WM::RBUTTONDBLCLK, wm::RButtonDblClk, /// [`WM_RBUTTONDBLCLK`](crate::msg::wm::RButtonDblClk) message. /// /// Posted when the user double-clicks the right mouse button while the /// cursor is in the client area of a window. If the mouse is not /// captured, the message is posted to the window beneath the cursor. /// Otherwise, the message is posted to the window that has captured the /// mouse. } wm_ret_none! { wm_r_button_down, co::WM::RBUTTONDOWN, wm::RButtonDown, /// [`WM_RBUTTONDOWN`](crate::msg::wm::RButtonDown) message. /// /// Posted when the user presses the right mouse button while the cursor /// is in the client area of a window. If the mouse is not captured, the /// message is posted to the window beneath the cursor. Otherwise, the /// message is posted to the window that has captured the mouse. } wm_ret_none! { wm_r_button_up, co::WM::RBUTTONUP, wm::RButtonUp, /// [`WM_RBUTTONUP`](crate::msg::wm::RButtonUp) message. /// /// Posted when the user releases the right mouse button while the cursor /// is in the client area of a window. If the mouse is not captured, the /// message is posted to the window beneath the cursor. Otherwise, the /// message is posted to the window that has captured the mouse. } wm_ret_none! { wm_set_focus, co::WM::SETFOCUS, wm::SetFocus, /// [`WM_SETFOCUS`](crate::msg::wm::SetFocus) message. /// /// Sent to a window after it has gained the keyboard focus. /// /// # Default handling /// /// If you handle this event, you'll overwrite the default handling in: /// /// * non-dialog [`WindowMain`](crate::gui::WindowMain); /// * non-dialog [`WindowModal`](crate::gui::WindowModal). } wm_ret_none! { wm_set_font, co::WM::SETFONT, wm::SetFont, /// [`WM_SETFONT`](crate::msg::wm::SetFont) message. /// /// Sets the font that a control is to use when drawing text. } /// [`WM_SETICON`](crate::msg::wm::SetIcon) message. /// /// Associates a new large or small icon with a window. The system displays /// the large icon in the Alt+TAB dialog box, and the small icon in the /// window caption. pub fn wm_set_icon<F>(&self, func: F) where F: FnMut(wm::SetIcon) -> Option<HICON> + 'static, { self.add_msg(co::WM::SETICON, { let mut func = func; move |p| Some( match func(wm::SetIcon::from_generic_wm(p)) { Some(hicon) => hicon.ptr as isize, None => 0, }, ) }); } wm_ret_none! { wm_show_window, co::WM::SHOWWINDOW, wm::ShowWindow, /// [`WM_SHOWWINDOW`](crate::msg::wm::ShowWindow) message. /// /// Sent to a window when the window is about to be hidden or shown. } wm_ret_none! { wm_size, co::WM::SIZE, wm::Size, /// [`WM_SIZE`](crate::msg::wm::Size) message. /// /// Sent to a window after its size has changed. /// /// # Examples /// /// ```rust,ignore /// use winsafe::gui::WindowMain; /// /// let wnd: WindowMain; // initialize it somewhere... /// /// wnd.on().wm_size({ /// let wnd = wnd.clone(); // pass into the closure /// move |parms| { /// println!("HWND: {}, client area: {}x{}", /// wnd.hwnd(), /// parms.width, /// parms.height, /// ); /// } /// }); /// ``` } wm_ret_none! { wm_sizing, co::WM::SIZING, wm::Sizing, /// [`WM_SIZING`](crate::msg::wm::Sizing) message. /// /// Sent to a window that the user is resizing. By processing this /// message, an application can monitor the size and position of the drag /// rectangle and, if needed, change its size or position. } wm_ret_none! { wm_style_changed, co::WM::STYLECHANGED, wm::StyleChanged, /// [`WM_STYLECHANGED`](crate::msg::wm::StyleChanged) message. /// /// Sent to a window after the /// [`SetWindowLongPtr`](crate::HWND::SetWindowLongPtr) function has /// changed one or more of the window's styles. } wm_ret_none! { wm_style_changing, co::WM::STYLECHANGING, wm::StyleChanging, /// [`WM_STYLECHANGING`](crate::msg::wm::StyleChanging) message. /// /// Sent to a window when the /// [`SetWindowLongPtr`](crate::HWND::SetWindowLongPtr) function is about /// to change one or more of the window's styles. } wm_ret_none! { wm_sys_char, co::WM::SYSCHAR, wm::SysChar, /// [`WM_SYSCHAR`](crate::msg::wm::SysChar) message. /// /// Posted to the window with the keyboard focus when a /// [`WM_SYSKEYDOWN`](crate::msg::wm::SysKeyDown) message is translated by /// the [`TranslateMessage`](crate::TranslateMessage) function. It /// specifies the character code of a system character key that is, a /// character key that is pressed while the ALT key is down. } wm_ret_none! { wm_sys_command, co::WM::SYSCOMMAND, wm::SysCommand, /// [`WM_SYSCOMMAND`](crate::msg::wm::SysCommand) message. /// /// A window receives this message when the user chooses a command from /// the Window menu (formerly known as the system or control menu) or when /// the user chooses the maximize button, minimize button, restore button, /// or close button. } wm_ret_none! { wm_sys_dead_char, co::WM::SYSDEADCHAR, wm::SysDeadChar, /// [`WM_SYSDEADCHAR`](crate::msg::wm::SysDeadChar) message. /// /// Sent to the window with the keyboard focus when a /// [`WM_SYSKEYDOWN`](crate::msg::wm::SysKeyDown) message is translated by /// the [`TranslateMessage`](crate::TranslateMessage) function. /// `WM_SYSDEADCHAR` specifies the character code of a system dead key /// that is, a dead key that is pressed while holding down the ALT key. } wm_ret_none! { wm_sys_key_down, co::WM::SYSKEYDOWN, wm::SysKeyDown, /// [`WM_SYSKEYDOWN`](crate::msg::wm::SysKeyDown) message. /// /// Posted to the window with the keyboard focus when the user presses the /// F10 key (which activates the menu bar) or holds down the ALT key and /// then presses another key. It also occurs when no window currently has /// the keyboard focus; in this case, the `WM_SYSKEYDOWN` message is sent /// to the active window. The window that receives the message can /// distinguish between these two contexts by checking the context code in /// the lParam parameter. } wm_ret_none! { wm_sys_key_up, co::WM::SYSKEYUP, wm::SysKeyUp, /// [`WM_SYSKEYUP`](crate::msg::wm::SysKeyUp) message. /// /// Posted to the window with the keyboard focus when the user releases a /// key that was pressed while the ALT key was held down. It also occurs /// when no window currently has the keyboard focus; in this case, the /// `WM_SYSKEYUP` message is sent to the active window. The window that /// receives the message can distinguish between these two contexts by /// checking the context code in the lParam parameter. } wm_ret_none! { wm_theme_changed, co::WM::THEMECHANGED, wm::ThemeChanged, /// [`WM_THEMECHANGED`](crate::msg::wm::ThemeChanged) message. /// /// Broadcast to every window following a theme change event. Examples of /// theme change events are the activation of a theme, the deactivation of /// a theme, or a transition from one theme to another. } wm_ret_none! { wm_window_pos_changed, co::WM::WINDOWPOSCHANGED, wm::WindowPosChanged, /// [`WM_WINDOWPOSCHANGED`](crate::msg::wm::WindowPosChanged) message. /// /// Sent to a window whose size, position, or place in the Z order has /// changed as a result of a call to the /// [`SetWindowPos`](crate::HWND::SetWindowPos) function or another /// window-management function. } wm_ret_none! { wm_window_pos_changing, co::WM::WINDOWPOSCHANGING, wm::WindowPosChanging, /// [`WM_WINDOWPOSCHANGING`](crate::msg::wm::WindowPosChanging) message. /// /// Sent to a window whose size, position, or place in the Z order is /// about to change as a result of a call to the /// [`SetWindowPos`](crate::HWND::SetWindowPos) function or another /// window-management function. } wm_ret_none! { wm_x_button_dbl_clk, co::WM::XBUTTONDBLCLK, wm::XButtonDblClk, /// [`WM_XBUTTONDBLCLK`](crate::msg::wm::XButtonDblClk) message. /// /// Posted when the user double-clicks the first or second X button while /// the cursor is in the client area of a window. If the mouse is not /// captured, the message is posted to the window beneath the cursor. /// Otherwise, the message is posted to the window that has captured the /// mouse. } wm_ret_none! { wm_x_button_down, co::WM::XBUTTONDOWN, wm::XButtonDown, /// [`WM_XBUTTONDOWN`](crate::msg::wm::XButtonDown) message. /// /// Posted when the user presses the first or second X button while the /// cursor is in the client area of a window. If the mouse is not /// captured, the message is posted to the window beneath the cursor. /// Otherwise, the message is posted to the window that has captured the /// mouse. } wm_ret_none! { wm_x_button_up, co::WM::XBUTTONUP, wm::XButtonUp, /// [`WM_XBUTTONUP`](crate::msg::wm::XButtonUp) message. /// /// Posted when the user releases the first or second X button while the /// cursor is in the client area of a window. If the mouse is not /// captured, the message is posted to the window beneath the cursor. /// Otherwise, the message is posted to the window that has captured the /// mouse. } }
C++
UTF-8
557
3.265625
3
[]
no_license
#include <math.h> #include "HW/HW01/point2.h" // Copyright 2018 Prof. Keefe using std::pow; using std::sqrt; Point2::Point2() { x_ = 0.0; y_ = 0.0; } Point2::Point2(float x, float y) { x_ = x; y_ = y; } Point2::~Point2() {} float Point2::DistanceBetween(Point2 other_p) { float d1 = pow(other_p.GetX() - x_, 2); float d2 = pow(other_p.GetY() - y_, 2); return sqrt(d1 + d2); } float Point2::GetX() { return x_; } float Point2::GetY() { return y_; } void Point2::SetX(float x) { x_ = x; } void Point2::SetY(float y) { y_ = y; }
Python
UTF-8
3,144
3.65625
4
[]
no_license
import math _handle = "test.txt" _handle = "input.txt" with open(_handle, 'r') as file: _data = [[_[0], int(_[1:])] for _ in file.read().splitlines()] # wanted to try out classes in this solution class Ship: def __init__(self, x, y, direction=1): self.x = x self.y = y self.orientation = direction self.frame_dict = {"N": (0, 1), "E": (1, 0), "S": (0, -1), "W": (-1, 0)} self.orientation_dict = {0: "N", 1: "E", 2: "S", 3: "W"} self.turns_dict = {"L": -1, "R": 1} def move(self, dx, dy): self.x += dx self.y += dy def turn(self, amount): self.orientation += (amount // 90) self.orientation %= 4 def execute_instruction(self, instruction, amount): if instruction in "NEWS": _dx = self.frame_dict[instruction][0] * amount _dy = self.frame_dict[instruction][1] * amount self.move(_dx, _dy) elif instruction in "LR": _dw = self.turns_dict[instruction] * amount self.turn(_dw) elif instruction == "F": _instruction = self.orientation_dict[self.orientation] self.execute_instruction(_instruction, amount) def get_manhattan_dist(self): return abs(self.x) + abs(self.y) class ShipWithWaypoint(Ship): def __init__(self, x, y, waypointx, waypointy): Ship.__init__(self, x, y) self.waypointx = waypointx self.waypointy = waypointy def move_waypoint(self, x, y): self.waypointx += x self.waypointy += y def set_waypoint(self, x, y): self.waypointx = x self.waypointy = y def rotate_waypoint(self, amount): _amount = -math.radians(amount) _cosvalue = math.cos(_amount) _sinvalue = math.sin(_amount) _newx = round(self.waypointx * _cosvalue - self.waypointy * _sinvalue, 5) _newy = round(self.waypointx * _sinvalue + self.waypointy * _cosvalue, 5) self.set_waypoint(_newx, _newy) def execute_instruction(self, instruction, amount): if instruction in "NEWS": _dx = self.frame_dict[instruction][0] * amount _dy = self.frame_dict[instruction][1] * amount self.move_waypoint(_dx, _dy) elif instruction in "LR": _dw = self.turns_dict[instruction] * amount self.rotate_waypoint(_dw) elif instruction == "F": _offsetx = self.waypointx * amount _offsety = self.waypointy * amount self.move(_offsetx, _offsety) def pt1(data): ship = Ship(0, 0, direction=1) for _list in data: _instruction = _list[0] _value = _list[1] ship.execute_instruction(_instruction, _value) return ship.get_manhattan_dist() def pt2(data): shipwp = ShipWithWaypoint(0, 0, 10, 1) for _list in data: _instruction = _list[0] _value = _list[1] shipwp.execute_instruction(_instruction, _value) return int(shipwp.get_manhattan_dist()) print(f"PART 1: {pt1(_data)}") print(f"PART 2: {pt2(_data)}")
JavaScript
UTF-8
897
2.921875
3
[ "MIT" ]
permissive
//adds interactivity to change the item list to the correct partial's list window.addEventListener('load', function() { var proposalId = document.getElementById('proposalId').value; if (document.getElementById('supplemental') !== null) { document.getElementById('supplemental').onchange = changeSupplementalItems; changeSupplementalItems(); } function changeSupplementalItems() { var supplemental = document.getElementById('supplemental').options[document.getElementById('supplemental').selectedIndex].id console.log(supplemental); var all = document.getElementsByClassName('items'); for (item in all) { if (all[item].classList !== undefined) { all[item].classList.add('hidden') } } var rows = document.getElementsByClassName(supplemental); for (row in rows) { if (rows[row].classList !== undefined){ rows[row].classList.remove('hidden'); } } } });
Python
UTF-8
1,120
4.125
4
[]
no_license
class Dog: def __init__(self, name, breed, age, color): self.name = name self.breed = breed self.age = age self.color = color def eat(self, food): print(food, '를 먹는다.') def sleep(self): print(self.name, '가 잠들다') def play(self): print(self.name, '가 놀고 있다.') def __str__(self): return self.name,self.breed,self.age,self.color def __lt__(self, other): return self.age < other.age def __eq__(self, other): return self.age == other.age dog1 = Dog('a', 'Neapolitan Mastiff', 1, 'black') dog2 = Dog('b', 'Maltese', 2, 'white') dog3 = Dog('c', 'ChowChow', 3, 'brown') # dog1.eat('apple') # dog2.eat('banana') # dog3.eat('watermelon') # dog1.sleep() # dog2.sleep() # dog3.sleep() # dog1.play() # dog2.play() # dog3.play() # print(dog1.__str__()) # print(dog1.__lt__(dog2)) # print(dog1.__eq__(dog2)) if dog1 < dog2: print(dog2.age) if dog2 == dog3: print(dog2.age,dog3.age) # dogL = [dog1,dog2,dog3] # for i in dogL: # print(dogL[i]) # print(dog1<dog2) # print(dog1==dog3)
Java
UTF-8
1,747
2.515625
3
[ "MIT" ]
permissive
package com.moxun.s2v.utils; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import org.junit.Test; public class SVGAttrParserTest { @Test public void rectToPath() { assertThat(SVGAttrParser.rectToPath(10, 10.5, 100, 100, 0, 0), is("M 10,10.5 L 110,10.5 L 110,110.5 L 10,110.5 z")); assertThat(SVGAttrParser.rectToPath(10, 10.5, 100, 100, 15, 15), is("" + "M 95,10.5 Q 110,10.5 110,25.5 " + "L 110,95.5 Q 110,110.5 95,110.5 " + "L 25,110.5 Q 10,110.5 10,95.5 " + "L 10,25.5 Q 10,10.5 25,10.5 " + "z")); } @Test public void circleToPath() { assertThat(SVGAttrParser.circleToPath(16.852, 7.376, 5), is("" + "M 11.85,7.38 " + "a 5,5 0 0 1 10,0 " + "a 5,5 0 0 1 -10,0 " + "z")); } @Test public void polygonToPath() { assertThat(SVGAttrParser.polygonToPath("0 0 0 100 100 100 100 0 0 0"), is("M 0,0 L 0,100 L 100,100 L 100,0 L 0,0 z")); assertThat(SVGAttrParser.polygonToPath(" 60,20 100,40 100,80 60,100 20,80 20,40 "), is("M 60,20 L 100,40 L 100,80 L 60,100 L 20,80 L 20,40 z")); assertThat(SVGAttrParser.polygonToPath("0 0 1,1"), is("M 0,0 L 1,1 z")); } @Test public void ellipseToPath() { assertThat(SVGAttrParser.ellipseToPath(20, 16, 20, 16), is("" + "M 20,0 " + "C 31.05,0 40,7.16 40,16 " + "C 40,24.84 31.05,32 20,32 " + "C 8.95,32 0,24.84 0,16 " + "C 0,7.16 8.95,0 20,0 " + "z")); } }
JavaScript
UTF-8
753
4.1875
4
[]
no_license
// Given two strings needle and haystack, return the index of // the first occurrence of needle in haystack, or -1 if needle // is not part of haystack. // time complexity = n(m-1) where n is length of the haystack // and m is length of the needle // evident in ex. w/ haystack = 'mississississississississippi', // needle = 'issip' const strStr = (haystack, needle) => { for (let i=0; i<haystack.length; i++) { if (haystack[i] === needle[0]) { for (let k=0, j=i; k<needle.length; k++, j++) { if (haystack[j] !== needle[k]) { break; }; if (k === needle.length-1) { return i; } } } } return -1; };
TypeScript
UTF-8
547
2.59375
3
[]
no_license
import {Point} from "../model/Point"; import {NameFactory} from "./NameFactory"; import {HashProvider} from "./HashProvider"; import {Location} from '../model/Location' export class LocationFactory { constructor(private hashProvider: HashProvider, private nameFactory: NameFactory) {} createLocation(name: string, point: Point) { const _name = this.nameFactory.createName(name); const _hash = this.hashProvider.provideHash(_name.hash, point.hash); return new Location(_name, point, _hash); } }
Java
UTF-8
642
2.765625
3
[]
no_license
package com.company.HomeWorkA; import java.util.concurrent.CountDownLatch; public class Uploader extends Thread{ private CountDownLatch countDownLatch; private int sizeOfFile=500; private int speedOfDownload=20; public Uploader (CountDownLatch countDownLatch){ this.countDownLatch=countDownLatch; } @Override public void run(){ try{ for (int i = 0; i < 15; i++) { System.out.println("-"); sleep(50); } countDownLatch.countDown(); } catch (InterruptedException e) { e.printStackTrace(); } } }
Shell
UTF-8
1,427
3.734375
4
[ "MIT" ]
permissive
#!/bin/sh # # 863gs Process Monitor # restart 863gs process if it is killed or not working. # WORK_PATH=`pwd` LOCK_GTSERVER="gt_server" LOCK_SENSOR="split_hash" RESTART_GTSERVER="${WORK_PATH}/${LOCK_GTSERVER} -f" RESTART_SENSOR="${WORK_PATH}/${LOCK_SENSOR} -i eth2,eth3" #RESTART_SENSOR="${WORK_PATH}/${LOCK_SENSOR} -i dag0:0,dag0:2" LOG_DAEMON="${WORK_PATH}/p2p-daemon.log" LOG_GTSERVER="gs.log" LOG_SENSOR="traffic.log" BACKUP_PATH="log/" #path to pgrep command PGREP="/usr/bin/pgrep" SLEEP="sleep 60" # check BACKUP_PATH, if not exists, create it if [ ! -e "${BACKUP_PATH}" ]; then mkdir "${BACKUP_PATH}" fi echo "[`date \"+%F %H:%M:%S\"`] === daemon-863gs start ===" > ${LOG_DAEMON} while [ 1 ] do # find gt_server pid $PGREP ${LOCK_GTSERVER} > /dev/null if [ $? -ne 0 ] # if process not running then # restart echo "[`date \"+%F %H:%M:%S\"`] restart ${LOCK_GTSERVER}" >> ${LOG_DAEMON} if [ -e "${LOG_GTSERVER}" ]; then mv ${LOG_GTSERVER} "${BACKUP_PATH}${LOG_GTSERVER}.`date \"+%s\"`" fi $RESTART_GTSERVER > ${LOG_GTSERVER} & fi # find sensor $PGREP ${LOCK_SENSOR} > /dev/null if [ $? -ne 0 ] # if process not running then echo "[`date \"+%F %H:%M:%S\"`] restart ${LOCK_SENSOR}" >> ${LOG_DAEMON} if [ -e "${LOG_SENSOR}" ]; then mv ${LOG_SENSOR} "${BACKUP_PATH}${LOG_SENSOR}.`date \"+%s\"`" fi $RESTART_SENSOR > ${LOG_SENSOR} & fi $SLEEP done
Java
UTF-8
1,203
2.03125
2
[]
no_license
package cn.springmvc.service.impl.function; import java.util.Map; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSON; import com.springmvc.utils.RequestUtil; import cn.springmvc.model.BasicModel; import cn.springmvc.service.function.MenuService; import cn.springmvc.service.wechat.WechartService; @Service public class MenuServiceImpl implements MenuService { @Autowired public WechartService wechartService; Logger logger = Logger.getLogger(MenuServiceImpl.class); // 设置菜单 public boolean setMenu(String jsonStr, BasicModel basicModel) throws Exception { String accessToken = wechartService.getAccessToken(basicModel); String url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + accessToken; String response = RequestUtil.doPost(url, jsonStr); logger.error("set menu response message : >>> " + response); Map<String, Object> res = (Map<String, Object>) JSON.parse(response); logger.error("after fastJson parse <<< " + res); if (Integer.parseInt(res.get("errcode").toString()) == 0) { return true; } return false; } }
Java
UTF-8
4,971
2.09375
2
[]
no_license
package com.notification.model; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.hibernate.annotations.CreationTimestamp; @Entity @Table(name = "EMAIL_TRACKER") public class EmailTracker { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name="ID") private int id; @Column(name="EMAILFROM") private String emailfrom; @Column(name = "EMAILTO") private String emailto; @Column(name="CC") private String cc; @Column(name="BCC") private String bcc; @Column(name="SUBJECT") private String subject; @Column(name="BODY") private String body; @Column(name="ATTACHMENT") private String attachment; @Column(name="INLINEIMAGE") private String inlineimage; @Column(name="SENT_STATUS") private String sentstatus; @Column(name="DATA_PIC_STATUS") private String datapicstatus; @Column(name="CREATEDBY") private int createdby; @CreationTimestamp @Temporal(TemporalType.TIMESTAMP) @Column(name="CREATED_DATE_TIME") private Date createddatetime = new java.sql.Date(new java.util.Date().getTime()); @Column(name="MODIFIEDBY") private int modifiedby; @CreationTimestamp @Temporal(TemporalType.TIMESTAMP) @Column(name="MODIFIED_DATE_TIME") private Date modifieddatetime = new java.sql.Date(new java.util.Date().getTime()); @Column(name="REMARK") private String remark; @Override public String toString() { return "EmailTracker [id=" + id + ", emailfrom=" + emailfrom + ", emailto=" + emailto + ", cc=" + cc + ", bcc=" + bcc + ", subject=" + subject + ", body=" + body + ", attachment=" + attachment + ", inlineimage=" + inlineimage + ", sentstatus=" + sentstatus + ", datapicstatus=" + datapicstatus + ", createdby=" + createdby + ", createddatetime=" + createddatetime + ", modifiedby=" + modifiedby + ", modifieddatetime=" + modifieddatetime + ", remark=" + remark + "]"; } public EmailTracker(int id, String emailfrom, String emailto, String cc, String bcc, String subject, String body, String attachment, String inlineimage, String sentstatus, String datapicstatus, int createdby, Date createddatetime, int modifiedby, Date modifieddatetime, String remark) { super(); this.id = id; this.emailfrom = emailfrom; this.emailto = emailto; this.cc = cc; this.bcc = bcc; this.subject = subject; this.body = body; this.attachment = attachment; this.inlineimage = inlineimage; this.sentstatus = sentstatus; this.datapicstatus = datapicstatus; this.createdby = createdby; this.createddatetime = createddatetime; this.modifiedby = modifiedby; this.modifieddatetime = modifieddatetime; this.remark = remark; } public EmailTracker() { super(); } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getEmailfrom() { return emailfrom; } public void setEmailfrom(String emailfrom) { this.emailfrom = emailfrom; } public String getEmailto() { return emailto; } public void setEmailto(String emailto) { this.emailto = emailto; } public String getCc() { return cc; } public void setCc(String cc) { this.cc = cc; } public String getBcc() { return bcc; } public void setBcc(String bcc) { this.bcc = bcc; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public String getBody() { return body; } public void setBody(String body) { this.body = body; } public String getAttachment() { return attachment; } public void setAttachment(String attachment) { this.attachment = attachment; } public String getInlineimage() { return inlineimage; } public void setInlineimage(String inlineimage) { this.inlineimage = inlineimage; } public String getSentstatus() { return sentstatus; } public void setSentstatus(String sentstatus) { this.sentstatus = sentstatus; } public String getDatapicstatus() { return datapicstatus; } public void setDatapicstatus(String datapicstatus) { this.datapicstatus = datapicstatus; } public int getCreatedby() { return createdby; } public void setCreatedby(int createdby) { this.createdby = createdby; } public Date getCreateddatetime() { return createddatetime; } public void setCreateddatetime(Date createddatetime) { this.createddatetime = createddatetime; } public int getModifiedby() { return modifiedby; } public void setModifiedby(int modifiedby) { this.modifiedby = modifiedby; } public Date getModifieddatetime() { return modifieddatetime; } public void setModifieddatetime(Date modifieddatetime) { this.modifieddatetime = modifieddatetime; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } }
Java
UTF-8
4,019
2.015625
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file * except in compliance with the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ package com.amazon.ask.model.interfaces.alexa.experimentation; import java.util.Objects; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; /** * ExperimentationState */ @JsonDeserialize(builder = ExperimentationState.Builder.class) public final class ExperimentationState { @JsonProperty("activeExperiments") private List<com.amazon.ask.model.interfaces.alexa.experimentation.ExperimentAssignment> activeExperiments = new ArrayList<com.amazon.ask.model.interfaces.alexa.experimentation.ExperimentAssignment>(); private ExperimentationState() { } public static Builder builder() { return new Builder(); } private ExperimentationState(Builder builder) { if (builder.activeExperiments != null) { this.activeExperiments = builder.activeExperiments; } } /** * Get activeExperiments * @return activeExperiments **/ @JsonProperty("activeExperiments") public List<com.amazon.ask.model.interfaces.alexa.experimentation.ExperimentAssignment> getActiveExperiments() { return activeExperiments; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExperimentationState interfacesAlexaExperimentationExperimentationState = (ExperimentationState) o; return Objects.equals(this.activeExperiments, interfacesAlexaExperimentationExperimentationState.activeExperiments); } @Override public int hashCode() { return Objects.hash(activeExperiments); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ExperimentationState {\n"); sb.append(" activeExperiments: ").append(toIndentedString(activeExperiments)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static class Builder { private List<com.amazon.ask.model.interfaces.alexa.experimentation.ExperimentAssignment> activeExperiments; private Builder() {} @JsonProperty("activeExperiments") public Builder withActiveExperiments(List<com.amazon.ask.model.interfaces.alexa.experimentation.ExperimentAssignment> activeExperiments) { this.activeExperiments = activeExperiments; return this; } public Builder addActiveExperimentsItem(com.amazon.ask.model.interfaces.alexa.experimentation.ExperimentAssignment activeExperimentsItem) { if (this.activeExperiments == null) { this.activeExperiments = new ArrayList<com.amazon.ask.model.interfaces.alexa.experimentation.ExperimentAssignment>(); } this.activeExperiments.add(activeExperimentsItem); return this; } public ExperimentationState build() { return new ExperimentationState(this); } } }
Java
UTF-8
1,738
1.828125
2
[ "Apache-2.0" ]
permissive
package org.bian.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.bian.dto.SDCreditChargeCardRetrieveOutputModelServiceDomainOfferedServiceServiceDomainServiceRecord; import javax.validation.Valid; /** * SDCreditChargeCardRetrieveOutputModelServiceDomainOfferedService */ public class SDCreditChargeCardRetrieveOutputModelServiceDomainOfferedService { private String serviceDomainServiceReference = null; private SDCreditChargeCardRetrieveOutputModelServiceDomainOfferedServiceServiceDomainServiceRecord serviceDomainServiceRecord = null; /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to a service offered by the service center * @return serviceDomainServiceReference **/ public String getServiceDomainServiceReference() { return serviceDomainServiceReference; } public void setServiceDomainServiceReference(String serviceDomainServiceReference) { this.serviceDomainServiceReference = serviceDomainServiceReference; } /** * Get serviceDomainServiceRecord * @return serviceDomainServiceRecord **/ public SDCreditChargeCardRetrieveOutputModelServiceDomainOfferedServiceServiceDomainServiceRecord getServiceDomainServiceRecord() { return serviceDomainServiceRecord; } public void setServiceDomainServiceRecord(SDCreditChargeCardRetrieveOutputModelServiceDomainOfferedServiceServiceDomainServiceRecord serviceDomainServiceRecord) { this.serviceDomainServiceRecord = serviceDomainServiceRecord; } }
Java
UTF-8
11,684
2.375
2
[ "Apache-2.0" ]
permissive
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.exoplayer2.util; import android.net.Uri; import android.text.TextUtils; import androidx.annotation.Nullable; /** * Utility methods for manipulating URIs. * * @deprecated com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which * contains the same ExoPlayer code). See <a * href="https://developer.android.com/guide/topics/media/media3/getting-started/migration-guide">the * migration guide</a> for more details, including a script to help with the migration. */ @Deprecated public final class UriUtil { /** The length of arrays returned by {@link #getUriIndices(String)}. */ private static final int INDEX_COUNT = 4; /** * An index into an array returned by {@link #getUriIndices(String)}. * * <p>The value at this position in the array is the index of the ':' after the scheme. Equals -1 * if the URI is a relative reference (no scheme). The hier-part starts at (schemeColon + 1), * including when the URI has no scheme. */ private static final int SCHEME_COLON = 0; /** * An index into an array returned by {@link #getUriIndices(String)}. * * <p>The value at this position in the array is the index of the path part. Equals (schemeColon + * 1) if no authority part, (schemeColon + 3) if the authority part consists of just "//", and * (query) if no path part. The characters starting at this index can be "//" only if the * authority part is non-empty (in this case the double-slash means the first segment is empty). */ private static final int PATH = 1; /** * An index into an array returned by {@link #getUriIndices(String)}. * * <p>The value at this position in the array is the index of the query part, including the '?' * before the query. Equals fragment if no query part, and (fragment - 1) if the query part is a * single '?' with no data. */ private static final int QUERY = 2; /** * An index into an array returned by {@link #getUriIndices(String)}. * * <p>The value at this position in the array is the index of the fragment part, including the '#' * before the fragment. Equal to the length of the URI if no fragment part, and (length - 1) if * the fragment part is a single '#' with no data. */ private static final int FRAGMENT = 3; private UriUtil() {} /** * Like {@link #resolve(String, String)}, but returns a {@link Uri} instead of a {@link String}. * * @param baseUri The base URI. * @param referenceUri The reference URI to resolve. */ public static Uri resolveToUri(@Nullable String baseUri, @Nullable String referenceUri) { return Uri.parse(resolve(baseUri, referenceUri)); } /** * Performs relative resolution of a {@code referenceUri} with respect to a {@code baseUri}. * * <p>The resolution is performed as specified by RFC-3986. * * @param baseUri The base URI. * @param referenceUri The reference URI to resolve. */ public static String resolve(@Nullable String baseUri, @Nullable String referenceUri) { StringBuilder uri = new StringBuilder(); // Map null onto empty string, to make the following logic simpler. baseUri = baseUri == null ? "" : baseUri; referenceUri = referenceUri == null ? "" : referenceUri; int[] refIndices = getUriIndices(referenceUri); if (refIndices[SCHEME_COLON] != -1) { // The reference is absolute. The target Uri is the reference. uri.append(referenceUri); removeDotSegments(uri, refIndices[PATH], refIndices[QUERY]); return uri.toString(); } int[] baseIndices = getUriIndices(baseUri); if (refIndices[FRAGMENT] == 0) { // The reference is empty or contains just the fragment part, then the target Uri is the // concatenation of the base Uri without its fragment, and the reference. return uri.append(baseUri, 0, baseIndices[FRAGMENT]).append(referenceUri).toString(); } if (refIndices[QUERY] == 0) { // The reference starts with the query part. The target is the base up to (but excluding) the // query, plus the reference. return uri.append(baseUri, 0, baseIndices[QUERY]).append(referenceUri).toString(); } if (refIndices[PATH] != 0) { // The reference has authority. The target is the base scheme plus the reference. int baseLimit = baseIndices[SCHEME_COLON] + 1; uri.append(baseUri, 0, baseLimit).append(referenceUri); return removeDotSegments(uri, baseLimit + refIndices[PATH], baseLimit + refIndices[QUERY]); } if (referenceUri.charAt(refIndices[PATH]) == '/') { // The reference path is rooted. The target is the base scheme and authority (if any), plus // the reference. uri.append(baseUri, 0, baseIndices[PATH]).append(referenceUri); return removeDotSegments(uri, baseIndices[PATH], baseIndices[PATH] + refIndices[QUERY]); } // The target Uri is the concatenation of the base Uri up to (but excluding) the last segment, // and the reference. This can be split into 2 cases: if (baseIndices[SCHEME_COLON] + 2 < baseIndices[PATH] && baseIndices[PATH] == baseIndices[QUERY]) { // Case 1: The base hier-part is just the authority, with an empty path. An additional '/' is // needed after the authority, before appending the reference. uri.append(baseUri, 0, baseIndices[PATH]).append('/').append(referenceUri); return removeDotSegments(uri, baseIndices[PATH], baseIndices[PATH] + refIndices[QUERY] + 1); } else { // Case 2: Otherwise, find the last '/' in the base hier-part and append the reference after // it. If base hier-part has no '/', it could only mean that it is completely empty or // contains only one segment, in which case the whole hier-part is excluded and the reference // is appended right after the base scheme colon without an added '/'. int lastSlashIndex = baseUri.lastIndexOf('/', baseIndices[QUERY] - 1); int baseLimit = lastSlashIndex == -1 ? baseIndices[PATH] : lastSlashIndex + 1; uri.append(baseUri, 0, baseLimit).append(referenceUri); return removeDotSegments(uri, baseIndices[PATH], baseLimit + refIndices[QUERY]); } } /** Returns true if the URI is starting with a scheme component, false otherwise. */ public static boolean isAbsolute(@Nullable String uri) { return uri != null && getUriIndices(uri)[SCHEME_COLON] != -1; } /** * Removes query parameter from a URI, if present. * * @param uri The URI. * @param queryParameterName The name of the query parameter. * @return The URI without the query parameter. */ public static Uri removeQueryParameter(Uri uri, String queryParameterName) { Uri.Builder builder = uri.buildUpon(); builder.clearQuery(); for (String key : uri.getQueryParameterNames()) { if (!key.equals(queryParameterName)) { for (String value : uri.getQueryParameters(key)) { builder.appendQueryParameter(key, value); } } } return builder.build(); } /** * Removes dot segments from the path of a URI. * * @param uri A {@link StringBuilder} containing the URI. * @param offset The index of the start of the path in {@code uri}. * @param limit The limit (exclusive) of the path in {@code uri}. */ private static String removeDotSegments(StringBuilder uri, int offset, int limit) { if (offset >= limit) { // Nothing to do. return uri.toString(); } if (uri.charAt(offset) == '/') { // If the path starts with a /, always retain it. offset++; } // The first character of the current path segment. int segmentStart = offset; int i = offset; while (i <= limit) { int nextSegmentStart; if (i == limit) { nextSegmentStart = i; } else if (uri.charAt(i) == '/') { nextSegmentStart = i + 1; } else { i++; continue; } // We've encountered the end of a segment or the end of the path. If the final segment was // "." or "..", remove the appropriate segments of the path. if (i == segmentStart + 1 && uri.charAt(segmentStart) == '.') { // Given "abc/def/./ghi", remove "./" to get "abc/def/ghi". uri.delete(segmentStart, nextSegmentStart); limit -= nextSegmentStart - segmentStart; i = segmentStart; } else if (i == segmentStart + 2 && uri.charAt(segmentStart) == '.' && uri.charAt(segmentStart + 1) == '.') { // Given "abc/def/../ghi", remove "def/../" to get "abc/ghi". int prevSegmentStart = uri.lastIndexOf("/", segmentStart - 2) + 1; int removeFrom = prevSegmentStart > offset ? prevSegmentStart : offset; uri.delete(removeFrom, nextSegmentStart); limit -= nextSegmentStart - removeFrom; segmentStart = prevSegmentStart; i = prevSegmentStart; } else { i++; segmentStart = i; } } return uri.toString(); } /** * Calculates indices of the constituent components of a URI. * * @param uriString The URI as a string. * @return The corresponding indices. */ private static int[] getUriIndices(String uriString) { int[] indices = new int[INDEX_COUNT]; if (TextUtils.isEmpty(uriString)) { indices[SCHEME_COLON] = -1; return indices; } // Determine outer structure from right to left. // Uri = scheme ":" hier-part [ "?" query ] [ "#" fragment ] int length = uriString.length(); int fragmentIndex = uriString.indexOf('#'); if (fragmentIndex == -1) { fragmentIndex = length; } int queryIndex = uriString.indexOf('?'); if (queryIndex == -1 || queryIndex > fragmentIndex) { // '#' before '?': '?' is within the fragment. queryIndex = fragmentIndex; } // Slashes are allowed only in hier-part so any colon after the first slash is part of the // hier-part, not the scheme colon separator. int schemeIndexLimit = uriString.indexOf('/'); if (schemeIndexLimit == -1 || schemeIndexLimit > queryIndex) { schemeIndexLimit = queryIndex; } int schemeIndex = uriString.indexOf(':'); if (schemeIndex > schemeIndexLimit) { // '/' before ':' schemeIndex = -1; } // Determine hier-part structure: hier-part = "//" authority path / path // This block can also cope with schemeIndex == -1. boolean hasAuthority = schemeIndex + 2 < queryIndex && uriString.charAt(schemeIndex + 1) == '/' && uriString.charAt(schemeIndex + 2) == '/'; int pathIndex; if (hasAuthority) { pathIndex = uriString.indexOf('/', schemeIndex + 3); // find first '/' after "://" if (pathIndex == -1 || pathIndex > queryIndex) { pathIndex = queryIndex; } } else { pathIndex = schemeIndex + 1; } indices[SCHEME_COLON] = schemeIndex; indices[PATH] = pathIndex; indices[QUERY] = queryIndex; indices[FRAGMENT] = fragmentIndex; return indices; } }
Markdown
UTF-8
1,637
2.84375
3
[]
no_license
## Overview TDSQL supports real-time online scaling. There are two scaling methods: adding new shards and scaling up existing shards. The entire scaling process is completely imperceptible to the business with no business interruption caused. Only the involved shards will become read-only (or interrupted) for just seconds during scaling, while the entire cluster will not be affected. ## Scaling Process TDSQL ensures the stability of automatic scaling with its proprietary automatic rebalancing technology. ### Adding a new shard 1. Scale node A in the [console](https://console.cloud.tencent.com/dcdb). 2. According to the configuration of new node G, some data of node A will be migrated (from the slave) to node G. 3. After the data is completely synced, nodes A and G will check the database (read-only status for one to tens of seconds), but the entire service will not be suspended. 4. The scheduling system notifies the proxy to switch route. ![](https://main.qcloudimg.com/raw/50299d47e5a0ee8760e9bde16701148a.png) ### Scaling up an existing shard Scaling up an existing shard is actually replacing it with a larger physical shard. >?This does not add any new shards and will not change the logic rules of sharding or number of shards. 1. Assign a new physical shard (the "new shard") based on the required configuration. 2. Sync the data and configuration of the physical shard to be upgraded (the "old shard") to the new shard. 3. After the data sync is completed, switch the route in the Tencent Cloud gateway to the new shard for continued use. ![](https://main.qcloudimg.com/raw/7f29be1908e9452fbaf5264293cbe59c.png)
C++
UTF-8
1,031
3.078125
3
[ "MIT" ]
permissive
#ifndef GAME_BOARD_HPP #define GAME_BOARD_HPP #include <cstdlib> // for size_t #include <vector> #include "GamePiece.hpp" class GameBoard { public: explicit GameBoard(size_t inWidth = kDefaultWidth, size_t inHeight = kDefaultHeight); GameBoard(const GameBoard& src); virtual ~GameBoard(); GameBoard& operator=(const GameBoard& rhs); void setPieceAt(size_t x, size_t y, std::unique_ptr<GamePiece> inPiece); std::unique_ptr<GamePiece>& getPieceAt(size_t x, size_t y); const std::unique_ptr<GamePiece>& getPieceAt(size_t x, size_t y) const; size_t getHeight() const { return mHeight; } size_t getWidth() const { return mWidth; } static const size_t kDefaultWidth = 10; static const size_t kDefaultHeight = 10; private: void copyFrom(const GameBoard& src); void initializeCellsContainer(); std::vector<std::vector<std::unique_ptr<GamePiece>>> mCells; size_t mWidth, mHeight; }; #endif
Python
UTF-8
6,815
2.828125
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ """ import click import logging import numpy as np import matplotlib.pyplot as plt import os import skimage from scipy import ndimage as ndi from PIL import Image import gzip import matplotlib.patches as mpatches from Segmentation_pipeline_helper import find, watershed_lab, resize_pad from Segmentation_pipeline_helper import shift_center_mass, pixel_norm ############################################ # EXECUTION PIPELINE FOR CELL SEGMENTATION # ############################################ def extract_img_arrays(microtubule_imgs, protein_imgs, nuclei_imgs): """ Extract the numerical arrays that represent the input images. Extracts only the relevant channel of the input image if it is RGB, blue for nuclei, red for microtubule, and green for proteins. This always results in every returned array being 2D (grayscale). The function assumes that all the input lists are of the same length. If an image is missing, all channels on the same index will be skipped. Arguments: microtubule_imgs: A list of paths to microtubule images. protein_imgs: A list of paths to protein images. nuclei_imgs: A list of paths to nuclei images. Returns: A generator which yields grayscale image tuples from the input images. (grayscale microtubule, grayscale protein, grayscale nuclei). Raises: IndexError: if the input lists are not the same size. """ image_arrays = [] num_images = len(nuclei_imgs) for index in range(num_images): nuclei_img = nuclei_imgs[index] microtubule_img = microtubule_imgs[index] protein_img = protein_imgs[index] current_array = [] for i, img in enumerate([microtubule_img, protein_img, nuclei_img]): try: if img.endswith('.gz'): file_handle = gzip.open(img) else: file_handle = open(img) img_arr = plt.imread(file_handle) file_handle.close() if len(img_arr.shape) > 2: img_arr = img_arr[:, :, i] current_array.append(img_arr) except IOError as e: logging.error('{}, when reading {}'.format(e, img)) yield current_array def plot_boundaries(nucleus_array, regions): fig, ax = plt.subplots(figsize=(10, 6)) ax.imshow(nucleus_array) for region in regions: # take regions with large enough areas if region.area >= 20000: # draw rectangle around segmented coins minr, minc, maxr, maxc = region.bbox rect = mpatches.Rectangle((minc, minr), maxc - minc, maxr - minr, fill=False, edgecolor='red', linewidth=2) ax.add_patch(rect) ax.set_axis_off() plt.tight_layout() plt.show() def cut_bounding_box(im_arrays, plot=False): """ Cut out individual cells from images. Each of the arguments to this function should be lists of the same length. The elements on the same index in the different arrays are assumed to be from the same original image. Arguments: microtubule_arrays: A list of grayscale microtubule image arrays. protein_arrays: A list of grayscale protein image arrays. nuclei_arrays: A list of grayscale nuclei image arrays. Returns: A generator which yields a list of cell arrays for each image in succession. """ images = [] for arrays in im_arrays: cells = [] seeds, num = watershed_lab(arrays[2], rm_border=True) regions = skimage.measure.regionprops(seeds) if plot: plot_boundaries(arrays[2], regions) for i, region in enumerate(regions): minr, minc, maxr, maxc = region.bbox mask = seeds[minr:maxr, minc:maxc].astype(np.uint8) mask[mask != region.label] = 0 mask[mask == region.label] = 1 cell_nuclei = pixel_norm(arrays[2][minr:maxr, minc:maxc] * mask) cell_nucleoli = pixel_norm(arrays[1][minr:maxr, minc:maxc] * mask) cell_microtubule = np.full_like(cell_nuclei, 0) cell = np.dstack((cell_microtubule, cell_nucleoli, cell_nuclei)) cell = (cell * 255).astype(np.uint8) # the input file was uint16 # Align cell orientation theta = region.orientation * 180 / np.pi # radiant to degree cell = ndi.rotate(cell, 90 - theta) cells.append(cell) yield cells return images @click.command() @click.argument('imageinput') @click.argument('imageoutput') @click.option('--blue-suffix', default='blue.tif.gz', help='Set the blue image suffix') @click.option('--green-suffix', default='green.tif.gz', help='Set the green image suffix') @click.option('--red-suffix', default='red.tif.gz', help='Set the red image suffix') @click.option('--plot-boundaries', default=False, is_flag=True) @click.option('--verbose', default=False, is_flag=True) def main(imageinput, imageoutput, blue_suffix, green_suffix, red_suffix, verbose, plot_boundaries): if not os.path.exists(imageoutput): os.makedirs(imageoutput) if verbose: numeric_level = getattr(logging, 'INFO') logging.basicConfig(level=numeric_level) nuclei_imgs = find(imageinput, suffix=blue_suffix, recursive=False) microtubule_imgs = [] protein_imgs = [] logging.info('Finding images') for nucleus_img in nuclei_imgs: microtubule_imgs.append(nucleus_img.replace(blue_suffix, red_suffix)) protein_imgs.append(nucleus_img.replace(blue_suffix, green_suffix)) logging.info('Setting up extraction') im_arrays = extract_img_arrays(microtubule_imgs, protein_imgs, nuclei_imgs) logging.info('Setting up bounding box separation') cells = cut_bounding_box(im_arrays, plot=plot_boundaries) if plot_boundaries: logging.info('Segmentation plots enabled') logging.info('Segmenting') for i, (image, filename) in enumerate(zip(cells, nuclei_imgs)): if verbose: progress = i / len(nuclei_imgs) * 100 print('\r{:.2f}% done'.format(progress), end='', flush=True) filename = filename.replace(blue_suffix, '') filename = os.path.basename(filename) filename = os.path.join(imageoutput, filename) for i, cell in enumerate(image): fig = resize_pad(cell) fig = shift_center_mass(fig) fig = Image.fromarray(fig) savename = filename + str(i) + '.png' fig.save(savename) if verbose: print() if __name__ == '__main__': main()
Java
UTF-8
1,355
2.609375
3
[]
no_license
package cn.logcode.xhufiveface.utils; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.*; import java.util.Objects; public class Imagebase64 { static BASE64Encoder encoder = new sun.misc.BASE64Encoder(); static BASE64Decoder decoder = new sun.misc.BASE64Decoder(); public static String imageToBase64(String imgPath) { byte[] data = null; // 读取图片字节数组 try { InputStream in = new FileInputStream(imgPath); data = new byte[in.available()]; in.read(data); in.close(); } catch (IOException e) { e.printStackTrace(); } // 对字节数组Base64编码 BASE64Encoder encoder = new BASE64Encoder(); return encoder.encode(Objects.requireNonNull(data)); } public static void base64StringToImage(String imgPath,String base64String) { try { byte[] bytes1 = decoder.decodeBuffer(base64String); ByteArrayInputStream bais = new ByteArrayInputStream(bytes1); BufferedImage bi1 = ImageIO.read(bais); File f1 = new File(imgPath); ImageIO.write(bi1, "jpg", f1); } catch (IOException e) { e.printStackTrace(); } } }
Python
UTF-8
4,281
2.578125
3
[ "BSD-3-Clause" ]
permissive
#!/usr/bin/env python import time import sys, os sys.path.append("../../litenc") import litenc import litenc_lxml import lxml import argparse def main(): print(""" #Description: Demonstrate that ietf-yang-library is implemented. #Procedure: #1 - Verify ietf-yang-library is listed as capability in the hello message. #2 - Verify /modules-state/module[name='test-yang-library'] container is present. """) parser = argparse.ArgumentParser() parser.add_argument("--server", help="server name e.g. 127.0.0.1 or server.com (127.0.0.1 if not specified)") parser.add_argument("--user", help="username e.g. admin ($USER if not specified)") parser.add_argument("--port", help="port e.g. 830 (830 if not specified)") parser.add_argument("--password", help="password e.g. mypass123 (passwordless if not specified)") args = parser.parse_args() if(args.server==None or args.server==""): server="127.0.0.1" else: server=args.server if(args.port==None or args.port==""): port=830 else: port=int(args.port) if(args.user==None or args.user==""): user=os.getenv('USER') else: user=args.user if(args.password==None or args.password==""): password=None else: password=args.password conn_raw = litenc.litenc() ret = conn_raw.connect(server=server, port=port, user=user, password=password) if ret != 0: print("[FAILED] Connecting to server=%(server)s:" % {'server':server}) return(-1) print("[OK] Connecting to server=%(server)s:" % {'server':server}) conn=litenc_lxml.litenc_lxml(conn_raw) ret = conn_raw.send(""" <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> </capabilities> </hello> """) if ret != 0: print("[FAILED] Sending <hello>") return(-1) # receive <hello> result=conn.receive() print("#1 - Verify ietf-yang-library is listed as capability in the hello message.") print(lxml.etree.tostring(result)) result=litenc_lxml.strip_namespaces(result) found=False for capability in result.xpath("/hello/capabilities/capability"): #print lxml.etree.tostring(capability) print(capability.text) if(capability.text.startswith('urn:ietf:params:netconf:capability:yang-library:1.0?')): print(("Found it:" + capability.text)) found=True assert(found==True) print("#2 - Verify /modules-state/module[name='test-yang-library'] container is present.") get_rpc = """ <get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <filter type="subtree"> <modules-state xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"> <module><name>test-yang-library</name></module> </modules-state> </filter> </get> """ print("get ...") result = conn.rpc(get_rpc) result=litenc_lxml.strip_namespaces(result) print(lxml.etree.tostring(result)) name = result.xpath('data/modules-state/module/name') assert(len(name)==1) namespace = result.xpath('data/modules-state/module/namespace') assert(len(namespace)==1) assert(namespace[0].text=="http://yuma123.org/ns/test-yang-library") conformance_type = result.xpath('data/modules-state/module/conformance-type') assert(len(conformance_type)==1) assert(conformance_type[0].text=="implement") feature = result.xpath('data/modules-state/module/feature') assert(len(feature)==1) assert(feature[0].text=="foo") deviation = result.xpath('data/modules-state/module/deviation/name') assert(len(deviation)==1) assert(deviation[0].text=="test-yang-library-deviation") get_rpc = """ <get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <filter type="subtree"> <modules-state xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"> <module><name>test-yang-library-import</name></module> </modules-state> </filter> </get> """ print("get ...") result = conn.rpc(get_rpc) result=litenc_lxml.strip_namespaces(result) print(lxml.etree.tostring(result)) name = result.xpath('data/modules-state/module/name') assert(len(name)==1) namespace = result.xpath('data/modules-state/module/namespace') assert(len(namespace)==1) assert(namespace[0].text=="http://yuma123.org/ns/test-yang-library-import") conformance_type = result.xpath('data/modules-state/module/conformance-type') assert(len(conformance_type)==1) #assert(conformance_type[0].text=="import") return(0) sys.exit(main())
Markdown
UTF-8
1,343
3.59375
4
[ "MIT" ]
permissive
## fs 文件系统 > * fs 文件系统提供了异步、同步两种方法来读取文件,如 `readFile()/readFileSync` > * 异步读取的最后一个参数为回调函数,回调函数的第一个参为 err 错误提示,第二个参为 data 数据 > * 异步读取性能好,不阻塞 #### 同步操作文件(进程阻塞) > * `fs.readFileSync(path)` 同步读取文件 > * `path` 路径 > * 无回调,直接回返回 `data` ```js const path = '' const fs = require('fs') const data = fs.readFileSync(path) ``` #### 异步操作文件(非阻塞) > * `fs.readFile(path, callback(err, data))` 异步读取文件 > * `path` 路径 > * `callback(err, data)`, `err` 错误信息,`data` 读取的数据 ```js fs.readFile(path, (err, data) => { if (err) { return console.error(err) } console.log(data.toString()) }) ```` #### fs write 文件写入 > * `fs.write(path, data, options, callback(err) => {})` > * `path` 路径,如无则新建 > * `data` 待写入的数据 > * `options` 配置,包含如`{encoding, mode, flag}`等信息 > * `callback(err)` 回调,只包含 `err` 信息 ```js const fs = require('fs') const path = './life.txt' const data = 'Life is difficult\rShow me the light' const options = {} const callback = (err) => { console.error(err) } fs.writeFile(path, data, options, callback) ```
Java
UTF-8
1,064
2.65625
3
[]
no_license
package study1.behavior.objects.StrategyPattern.mes1; public class Wip { private String lotNo; private String equipId; private String orderId; private String preWipId; public String getEquipId() { return equipId; } public void setEquipId(String equipId) { this.equipId = equipId; } public String getOrderId() { return orderId; } public void setOrderId(String orderId) { this.orderId = orderId; } public String getLotNo() { return lotNo; } public void setLotNo(String lotNo) { this.lotNo = lotNo; } public String getPreWipId() { return preWipId; } public void setPreWipId(String preWipId) { this.preWipId = preWipId; } @Override public String toString() { return "Wip{" + "lotNo='" + lotNo + '\'' + ", equipId='" + equipId + '\'' + ", orderId='" + orderId + '\'' + ", preWipId='" + preWipId + '\'' + '}'; } }
Java
UTF-8
2,157
2.53125
3
[]
no_license
package edu.cmu.sv.flight.rescheduler.entities; /** * Created by hsuantzl on 2015/4/28. */ public class Airport { private Integer id; // Primary key private String name; private String city; private String code; private double latitude; private double longitude; private String timezone; public Airport(String name, String city, String code, double latitude, double longitude, String timezone) { this.name = name; this.city = city; this.code = code; this.latitude = latitude; this.longitude = longitude; this.timezone = timezone; } public Integer getId() { return id; } public void setId(Integer _id) { this.id = _id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public double getLatitude() { return latitude; } public void setLatitude(double latitude) { this.latitude = latitude; } public double getLongitude() { return longitude; } public void setLongitude(double longitude) { this.longitude = longitude; } public String getTimezone() { return timezone; } public void setTimezone(String timezone) { this.timezone = timezone; } @Override public String toString() { final StringBuilder sb = new StringBuilder("Airport{"); sb.append("id=").append(id); sb.append(", name='").append(name).append('\''); sb.append(", city='").append(city).append('\''); sb.append(", code='").append(code).append('\''); sb.append(", latitude=").append(latitude); sb.append(", longitude=").append(longitude); sb.append(", timezone='").append(timezone).append('\''); sb.append('}'); return sb.toString(); } }
JavaScript
UTF-8
689
2.546875
3
[ "MIT" ]
permissive
import { reactive, toRefs } from 'vue' const state = reactive({ error: null, patients: null, loaded: false, loading: false, }) export default function getPatients() { const load = async () => { if (!state.loaded) { try { const patientsResponse = await fetch('/api/v1/patient') //check if patientsResponse ok if (!patientsResponse.ok) { throw Error('some thing not ok') } state.patients = await patientsResponse.json() } catch (e) { state.error = e } } } return { ...toRefs(state), load } }
Java
UTF-8
2,287
2.21875
2
[]
no_license
package com.teamide.idecomobility; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.TextView; import androidx.annotation.NonNull; import java.util.zip.Inflater; public class BusHelpDialog extends Dialog implements View.OnClickListener{ private Button cancelButton; private Button callButton; private TextView busNm; private TextView telNum; private Context context; String tel = "1588-4388"; String bus = "1156"; private androidx.appcompat.widget.Toolbar toolbar; private CalltexiDialog.GroupDialogListener groupDialogListener; private Inflater inflater; public BusHelpDialog(Context context) { super(context); this.context = context; } interface GroupDialogListener{ void onCancelClicked(); void onCallClicked(); } public void dialogListener(CalltexiDialog.GroupDialogListener groupDialogListener){ this.groupDialogListener = groupDialogListener; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bus_dialog); toolbar = findViewById(R.id.bustoolbar); toolbar.setTitle("저상버스 호출"); toolbar.setTitleTextColor(Color.parseColor("#ffffff")); cancelButton = findViewById(R.id.button25); callButton = findViewById(R.id.button26); busNm = findViewById(R.id.num); busNm.setText(bus); telNum = findViewById(R.id.callNum); telNum.setText(tel); cancelButton.setOnClickListener(this); callButton.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()){ case R.id.button26: ((Activity)context).startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"+tel))); break; case R.id.button25: cancel(); break; } } }
Java
UHC
1,183
3.546875
4
[]
no_license
package Test2; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class StreamEx2_DB { public static void main(String[] args) { // TODO Auto-generated method stub List<EmployeeData> list = new ArrayList<>(); Employee ep = new Employee(); list = ep.getEmpList(); // salary 6000 ū list.stream() .filter( salary -> salary.getSalary() > 6000 ) .forEach(System.out::println); System.out.println("========================================================================"); // 1 , first_name 7 ū . 2 first_name 7 ū߿ Alexander // list.stream() // .filter( first_name -> first_name.getFirst_name().length() > 7) // .filter( first_name -> first_name.getFirst_name().equals("Alexander")) // .forEach(System.out::println); // . ͸ ϳ ħ list.stream() .filter( first_name -> first_name.getFirst_name().length() > 7 && first_name.getFirst_name().equals("Alexander")) .forEach(System.out::println); } }
C++
UTF-8
2,317
2.828125
3
[]
no_license
#include <iostream> #include <queue> using namespace std; queue<pair<int, int> > q; // 左上顺时针到左 int x0[8] = {-1, -1, -1, 0, 0, 1, 1, 1}; int y0[8] = {-1, 0, 1, -1, 1, -1, 0, 1}; int n, m, k, l; // 结果 int res[22][22]; // 炸弹位置 int boom[22][22]; // 翻开的点 int visited[22][22]; bool win() { int sum = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (res[i][j] == -1) sum++; } } if (sum == k) { return true; } else { return false; } } void func(int a, int b) { q.push({a, b}); visited[a][b] = 1; while (!q.empty()) { int x = q.front().first; int y = q.front().second; q.pop(); int num = 0; for (int i = 0; i < 8; i++) { int x2 = x + x0[i]; int y2 = y + y0[i]; if (x2 >= 0 && y2 >= 0 && x2 < n && y2 < m && boom[x2][y2] == 1) { num++; } } if (num != 0) res[x][y] = num; else { res[x][y] = 0; for (int i = 0; i < 8; i++) { int x2 = x + x0[i]; int y2 = y + y0[i]; if (x2 >= 0 && y2 >= 0 && x2 < n && y2 < m && visited[x2][y2] == 0) { visited[x2][y2] = 1; res[x2][y2] = 0; q.push({x2, y2}); } } } } } int main() { cin >> n >> m >> k >> l; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { res[i][j] = -1; } } for (int i = 0; i < k; i++) { int a, b; cin >> a >> b; boom[a][b] = 1; } for (int i = 0; i < l; i++) { int a, b; cin >> a >> b; if (boom[a][b] == 1) { cout << "You lose"; } else if (visited[a][b] == 1) { continue; } else { func(a, b); for (int j = 0; j < n; j++) { for (int w = 0; w < m; w++) { cout << res[j][w] << " "; } cout << endl; } if (win()) { cout << "You win"; } else { cout << endl; } } } return (0); }
C#
UTF-8
3,698
3.484375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UnderstandingLINQ { class Program { static void Main(string[] args) { List<Car> myCars = new List<Car>() { new Car() { VIN= "A1", Make = "BMW", Model= "550i", StickerPrice= 55000, Year = 2009}, new Car() { VIN= "B2", Make = "Toyota", Model= "4Runner", StickerPrice= 35000, Year = 2010}, new Car() { VIN= "C3", Make = "BMW", Model= "745li", StickerPrice= 75000, Year = 2008}, new Car() { VIN= "D4", Make = "Ford", Model= "Escape", StickerPrice= 25000, Year = 2008}, new Car() { VIN= "E5", Make = "BMW", Model= "55i", StickerPrice= 57000, Year = 2010} }; // LINQ Query - FIND ALL BMW IN THE LIST OF CARS IN myCars /*var bmws = from car in myCars where car.Make == "BMW"5/ && car.Year == 2010 select car; // Orders cars from decending order by year var orderedCars = from car in myCars orderby car.Year descending select car; */ // LINQ Method // Land expression (mini method) // given an instance in a collection return back to me, the instances of car which make is equal to "BMW" // var keyword is used to make the compiler work out what the data type is // var bmws = myCars.Where(p => p.Make == "BMW" && p.Year == 2010); //var orderedCars = myCars.OrderByDescending(p => p.Year); /* //bmws (old collection) foreach (var car in orderedCars) { Console.WriteLine("{0} {1}", car.Year, car.VIN); } */ /* //Method chaining - makes collection desending order ,then checks the first bmw in order var firstBmw = myCars.OrderByDescending(p => p.Year).First(p => p.Make == "BMW"); Console.WriteLine(firstBmw.VIN); */ //Console.WriteLine(myCars.TrueForAll(p => p.Year > 2007)); //myCars.ForEach(p => p.StickerPrice -= 3000); //myCars.ForEach(p => Console.WriteLine("{0} {1:c}", p.VIN, p.StickerPrice)); // Checks if a certain car model exist in the collection //Console.WriteLine(myCars.Exists(p => p.Model == "745li")); //Console.WriteLine("{0:C}",myCars.Sum(p => p.StickerPrice)); // Prints what type of data type it is Console.WriteLine(myCars.GetType()); var orderedCars = myCars.OrderByDescending(p => p.Year); Console.WriteLine(orderedCars.GetType()); var bmws = myCars.Where(p => p.Make == "BMW" && p.Year == 2010); Console.WriteLine(bmws.GetType()); var newCars = from car in myCars where car.Make == "BMW" && car.Year == 2010 // new anonmous type, that has 2 string types select new { car.Make, car.Model }; Console.WriteLine(newCars.GetType()); Console.ReadLine(); } class Car { public string VIN { get; set; } public string Make { get; set; } public string Model { get; set; } public double StickerPrice { get; set; } public int Year { get; set; } } } }
Python
UTF-8
516
3.21875
3
[]
no_license
def can(a, b): if not b: return all(not x.isupper() for x in a) elif not a and b: return False if a[0].isupper(): if a[0] == b[0]: return can(a[1:], b[1:]) return False if a[0] == b[0]: return can(a[1:], b[1:]) or can(a[1:], b) elif a[0].upper() == b[0]: return can(a[1:], b[1:]) or can(a[1:], b) return can(a[1:], b) for _ in range(int(input())): if can(input(), input()): print("YES") else: print("NO")
Java
UTF-8
453
2.5625
3
[]
no_license
package main; import org.lwjgl.input.Mouse; import org.lwjgl.util.vector.Vector2f; public class Camera { public static Camera single; Vector2f pos; float zoom; public Camera(Vector2f pos, float zoom){ this.pos = pos; this.zoom = zoom; Camera.single = this; } public Vector2f getAbsoluteMouse(){ return new Vector2f((Mouse.getX() + Camera.single.pos.x)/zoom, ((Main.screenHeight-Mouse.getY()) + Camera.single.pos.y)/zoom); } }
Java
UTF-8
5,774
2.3125
2
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* * Copyright 2019 BROCKHAUS AG * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.openvalidation.antlr.test.sourcetests.operand; import static io.openvalidation.common.unittesting.astassertion.ModelRootAssertion.assertRules; import static io.openvalidation.common.unittesting.astassertion.ModelRootAssertion.assertVariable; import io.openvalidation.antlr.ANTLRExecutor; import io.openvalidation.common.ast.ASTModel; import io.openvalidation.common.utils.GrammarBuilder; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; class SimpleOperandTest { // ast operand static @ParameterizedTest @ValueSource(strings = {"true", " true", "true ", " true ", " true\n", "true\r\n"}) void test_operand_static_bool_true(String staticString) throws Exception { String input = GrammarBuilder.create().with(staticString).AS("variable").getText(); String expectedSource = GrammarBuilder.create().with(staticString).getText(); ASTModel ast = ANTLRExecutor.run(input); assertVariable(ast) .first() // .hasNumber(Double.parseDouble(staticString)) .string() .hasOriginalSource(staticString.trim()) .hasPreprocessedSource(expectedSource); } // ast operand static @ParameterizedTest @ValueSource(strings = {"false", " false", "false ", " false ", " false\n", "false\r\n"}) void test_operand_static_bool_false(String staticString) throws Exception { String input = GrammarBuilder.create().with(staticString).AS("variable").getText(); String expectedSource = GrammarBuilder.create().with(staticString).getText(); ASTModel ast = ANTLRExecutor.run(input); assertVariable(ast) .first() // .hasNumber(Double.parseDouble(staticString)) .string() .hasOriginalSource(staticString.trim()) .hasPreprocessedSource(expectedSource); } // ast operand static string @ParameterizedTest @ValueSource(strings = {"wolf", "wolf wolf", "wölf", "u n f a ll"}) void test_operand_static_string(String staticString) throws Exception { String input = GrammarBuilder.create().with(staticString).AS("variable").getText(); String expectedSource = GrammarBuilder.create().with(staticString).getText(); ASTModel ast = ANTLRExecutor.run(input); assertVariable(ast) .first() // .hasNumber(Double.parseDouble(staticString)) .string() .hasOriginalSource(staticString) .hasPreprocessedSource(expectedSource); } // ast operand static number @ParameterizedTest @ValueSource(strings = {"5", "15", "1.5", "-1", "-1.5", "-15"}) void test_operand_static_number(String staticNumber) throws Exception { String input = GrammarBuilder.create().with(staticNumber).AS("variable").getText(); String expectedSource = GrammarBuilder.create().with(staticNumber).getText(); ASTModel ast = ANTLRExecutor.run(input); assertVariable(ast) .first() // .hasNumber(Double.parseDouble(staticNumber)) .number() .hasOriginalSource(staticNumber) .hasPreprocessedSource(expectedSource); } // ast operand variable @ParameterizedTest @ValueSource(strings = {"varName", "valName", "space name", "s l i c e d n a m e", "glyphnäme"}) void test_operand_variable(String variableName) throws Exception { String input = GrammarBuilder.create() .with(1) .AS(variableName) .PARAGRAPH() .with(variableName) .AS(variableName + "2") .getText(); String expectedSource = GrammarBuilder.create().with(variableName).getText(); ASTModel ast = ANTLRExecutor.run(input); assertVariable(ast) .second() // .hasNumber(Double.parseDouble(staticNumber)) .variable() .hasOriginalSource(variableName) .hasPreprocessedSource(expectedSource); } // ast operand function @ParameterizedTest @ValueSource( strings = {"customer.price", "chicken.egg", "world.place", "something else entirely"}) void test_sum_of_variable(String paramName) throws Exception { String input = GrammarBuilder.create() .SUMOF(paramName) .AS("value") .getText(); // "SUM OF customer.price AS value"; String expectedSource = GrammarBuilder.create().SUMOF(paramName).getText(); // PreProcessorUtils.preProcStr2Sysout(input, Locale("en")); ASTModel ast = ANTLRExecutor.run(input); assertVariable(ast) .first() .function() .hasPreprocessedSource(expectedSource) .parameters() .first() .hasOriginalSource(paramName); } // ast operand array @Test void test_one_of_array_as_string() throws Exception { String input = GrammarBuilder.createRule() .with("name") .AT_LEAST_ONE_OF("Jimmy, Donald, Boris") .THEN() .with("error") .getText(); ASTModel ast = ANTLRExecutor.run(input); assertRules(ast) .hasSizeOf(1) .first() .condition() .hasOriginalSource("name ONE_OF Jimmy, Donald, Boris"); } }
Java
UTF-8
4,196
2.15625
2
[]
no_license
package com.example.testtab; import java.util.List; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.ImageView; import android.widget.TextView; public class FileAdapter extends BaseAdapter { private LayoutInflater mLayoutInflater; private List<ItemBean> mDataList; // public FileAdapter(Context context, List<ItemBean> list) { // mLayoutInflater = LayoutInflater.from(context); // mDataList = list; // } // // @Override // public int getCount() { // return mDataList.size(); // } // // @Override // public Object getItem(int position) { // return mDataList.get(position); // } // // @Override // public long getItemId(int position) { // return position; // } // // @Override // public View getView(int position, View convertView, ViewGroup parent) { // ViewHolder viewholder; // if(convertView==null){ // viewholder =new ViewHolder(); // convertView = mLayoutInflater.inflate(R.layout.item_view, null); // viewholder.img=(ImageView) convertView.findViewById(R.id.image); // viewholder.name=(TextView) convertView.findViewById(R.id.file_name); // viewholder.path=(TextView) convertView.findViewById(R.id.file_path); // viewholder.check = (CheckBox)convertView.findViewById(R.id.checkbox); // convertView.setTag(viewholder); // }else{ // viewholder = (ViewHolder) convertView.getTag(); // } // ItemBean bean = mDataList.get(position); // viewholder.img.setImageResource(bean.itemImage); // viewholder.name.setText(bean.itemName); // viewholder.path.setText(bean.itemPath); // // return convertView; // } // class ViewHolder{ // public ImageView img; // public TextView name; // public TextView path; // public CheckBox check; // } public List<ItemBean> getmDataList() { return mDataList; } public FileAdapter(Context context, List<ItemBean> list) { mLayoutInflater = LayoutInflater.from(context); mDataList = list; } @Override public int getCount() { return mDataList.size(); } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { final int index = position; ViewHolder viewholder; if (convertView == null) { viewholder = new ViewHolder(); convertView = mLayoutInflater.inflate(R.layout.otheritem_view, null); viewholder.img = (ImageView) convertView.findViewById(R.id.image); viewholder.name = (TextView) convertView.findViewById(R.id.file_name); viewholder.path = (TextView) convertView.findViewById(R.id.file_path); viewholder.check = (CheckBox) convertView.findViewById(R.id.checkbox); convertView.setTag(viewholder); } else { viewholder = (ViewHolder) convertView.getTag(); } ItemBean bean = mDataList.get(position); viewholder.img.setImageResource(bean.itemImage); viewholder.name.setText(bean.itemName); viewholder.path.setText(bean.itemPath); viewholder.check.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { mDataList.get(index).type = 1; } else { mDataList.get(index).type = 0; } } }); if (mDataList.get(position).type == 1) { viewholder.check.setChecked(true); } else { viewholder.check.setChecked(false); } return convertView; } class ViewHolder { public ImageView img; public TextView name; public TextView path; public CheckBox check; } /* * View view = mLayoutInflater.inflate(R.layout.item_view, null); ImageView * img=(ImageView) view.findViewById(R.id.image); TextView name=(TextView) * view.findViewById(R.id.file_name); TextView * path=(TextView)view.findViewById(R.id.file_path); * * ItemBean bean = mDataList.get(position); * img.setImageResource(bean.itemImage); name.setText(bean.itemName); * path.setText(bean.itemPath); */ }
PHP
UTF-8
3,404
2.640625
3
[ "MIT" ]
permissive
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\User; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; use Illuminate\Http\Request; use Image; class RegisterController extends Controller { /* |-------------------------------------------------------------------------- | Register Controller |-------------------------------------------------------------------------- | | This controller handles the registration of new users as well as their | validation and creation. By default this controller uses a trait to | provide this functionality without requiring any additional code. | */ use RegistersUsers; /** * Where to redirect users after registration. * * @var string */ protected $redirectTo = '/admin'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } /** * Get a validator for an incoming registration request. * * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'nrc' => ['required', 'string'], 'image' => ['required','mimes:jpeg,jpg,png'], /*'usertype'=>['required','string'],*/ 'password' => ['required', 'string', 'min:8', 'confirmed'], ]); } /** * Create a new user instance after a valid registration. * * @param array $data * @return \App\User */ protected function register(Request $request){ $request->validate([ 'name' => 'required|min:5', 'email' => 'required|email|unique:users', 'password' => 'required|min:8', 'nrc' => 'required', 'usertype'=>'required', 'image' => 'required|mimes:jpeg,jpg,png' ]); if ($request->image) { $file_name = time() . '.' . $request->image->getClientOriginalExtension(); $file_path = '/storage/image/' . $file_name; $image = Image::make($request->image)->save(public_path($file_path)); } // dd($image); $user = User::create([ 'name' => $request->name, 'email' => $request->email, 'password' => Hash::make($request->password), 'nrc' => $request->nrc, 'image' => $file_path ]); /*$user = new User(); $user->name = $request->name; $user->email = $request->email; $user->password = Hash::make($request->password); $user->nrc = $request->nrc; $user->image = $file_path; $user->save();*/ if ($request->usertype == 'User') { $usertype='user'; }elseif ($request->usertype == 'Owner') { $usertype='owner'; } /*else{ $usertype='admin'; }*/ $user->assignRole($usertype); $this->guard()->login($user); return redirect()->route('owner.index'); } }
Shell
UTF-8
982
3.625
4
[]
no_license
#!/bin/sh -f if `test "$1" == ""`; then echo "Usage: `basename ${0}` [pkg-config packages]" fi PACKAGES="${1}" packages_dirs=`pkg-config --cflags "${PACKAGES}" | sed 's/^\(.\)/\ \1/g' | sed 's/\ \-[^I][^\ ]\+//g' | sed 's/\ \-I\(\/[^\ ]\+\)/\ \1/g'` isystem=""; for package_dir in ${packages_dirs} do isystem="${isystem} -isystem ${package_dir}"; for include_dir in `/usr/bin/find ${package_dir} -type d` do isystem="${isystem} -isystem ${include_dir}"; done done extra_cflags=`pkg-config --cflags "${PACKAGES}" | sed 's/^\([^\ ]\)/\ \1/g' | sed 's/\ \-I\/[^\ ]\+//g'` if `test "${extra_cflags}" != ""`; then if `test "${isystem}" == ""`; then isystem="${extra_cflags}"; else isystem="${extra_cflags}${isystem}"; fi fi unset extra_cflags if `test "$isystem" != ""`; then export CFLAGS_ISYSTEM="$isystem"; unset isystem echo "$CFLAGS_ISYSTEM" fi if `test "$include_dir" != ""`; then unset include_dir; fi unset packages unset package_dirs unset packages_dir
Python
UTF-8
193
2.71875
3
[]
no_license
import unittest from classes.guest import Guest class TestGuest(unittest.TestCase): def setUp(self): self.guest_1 = Guest("Bruce", 50) self.guest_2 = Guest("Sheila", 75)
Shell
UTF-8
841
3.046875
3
[]
no_license
#!/usr/bin/sh echo "running tests..." # big one for i in `seq 1 1 64`; do python3 ./generator.py -f data$i.txt -c 20050 -m 65536; done ../run $(ls -1 data*.txt | tr "\n" " ") 1>/dev/null echo "test 1 (large input):" python3 checker.py -f sequence.txt rm *.txt # different sizes python3 generator.py -f data1.txt -c 16384 -m 16384 python3 generator.py -f data1.txt -c 8192 -m 8192 python3 generator.py -f data1.txt -c 4096 -m 4096 ../run $(ls -1 data*.txt | tr "\n" " ") 1>/dev/null echo "test2 (different file sizes):" python3 checker.py -f sequence.txt rm *.txt # one file python3 generator.py -f data1.txt -c 4096 -m 4096 ../run $(ls -1 data*.txt | tr "\n" " ") 1>/dev/null echo "test 3 (one input file):" python3 checker.py -f sequence.txt rm *.txt # empty input (expecting usage) echo "test4 (empty input, expecting usage):" ../run
Markdown
UTF-8
5,842
3.65625
4
[]
no_license
# ASSESSMENT 1: Tech Interview Practice Questions Answer the following questions. First, without external resources. Challenge yourself to answer from memory as if you were in a job interview. Then, research the question to expand on your answer. Even if you feel you have answered the question completely, there is always something more to learn. Write your researched answer in your OWN WORDS. 1. What is a function? Why would you use one? Your answer: A function is a program that holds all it needs to run inside itself. It is often times reusable which makes it a very valuable tool to create when needing to run the same type of algorithm multiple times. Researched answer: A function is a section of code created to be ran when it is called on and only when called on, otherwise it remains idle. For example a function will be called when console.log(function(input)). 2. What is the difference between .map() and .filter()? Your answer: .map takes an array and manipulates the data and places new data into a new array (You can multiply entire array by 5 and have a new array that reflects the results). .filter makes a sub-array and removes certain factors of the original array. (You are in a sense using an if/else statement to remove certain components from array and placing results in a new array) Researched answer: .map returns an array the same length as the original and performs a type of action to it. .filter returns a subset of the array that has been filtered with a built in if/else statement. 3. What is the difference between console.log() and return? Your answer: console.log is used to show in terminal what the result of program is. Return is used inside a function to show result of a section of code but does not print to the terminal until completed function and is console.log'ed Researched answer: console.log "prints" the answer in the terminal to show code results while return only returns result within a function, not showing result in terminal, but being allowed to be used in a console.log to show result. 4. In regards to functions, what is an argument? Your answer: An argument is the information that will be ran through the function provided by user. This will often be a variable that is provided with an array or string. Researched answer: An argument is a value that is passed through a function, used as a local variable which can be used within the function to create a new result. 5. Give a brief description of proper pair programming techniques. What are the roles of each person? Your answer: Pair programming usually has two distinct roles, the driver and the navigator. The driver is typing the code and running it while the navigator is directing the driver on what code should be used and the approach to the problem. It is best practice to switch roles frequently and to communicate often and clearly on the direction being taken. Researched answer: Communication is key in pair programming. Establishing roles early on and switching frequently to give breaks to each other from mentally taxing tasks is extremely beneficial. The roles are often divided into driver and navigator. The driver has their hands on the keys and are typing out the code while the navigator is walking the driver through the steps of what code to type. The navigator often times is problem solving through the equation and communicating clearly any pseudo code and specific steps they wish to execute. 6. What is iteration? Your answer: An iteration is a cycle of a loop. Each time a loop is repeated is an iteration. Researched answer: An iteration is a repeated action on a loop. Each time an item is repeated inside a for loop, the action is called an iteration. 7. What are advantages and disadvantages for using terminal commands to interact with your computer? Your answer: The advantages are you are directly communicating to the brain of your computer so there are no weird quirks that gui's can occasionally have. The disadvantages are that it can get a little confusing, especially if you are in a different directory then intended, and the terminal is not as user "friendly" and "pretty" as a gui. Researched answer: Advantages: Using terminal commands use less memory and can be much faster of you know how to use it properly. You can also rerun commands quickly which is very handy for checking and debugging code. Disadvantages: You can cause serious damage to your computer by typing the wrong commands, and commands can be very long depending on the size of file. Can be confusing at first, especially when learning how to interface with github. 8. What is something we did in class this week you found helpful? Your answer: Each time we used pair programming, it really helped engrain the topic and materials into my head. I also LOVED the peanut butter and jelly sandwich activity, because it had a great message that a computer can only do EXACTLY step by step what it is told...plus it was funny! ## Looking Ahead: Terms for Next Week Research and define the following terms to the best of your ability. - Jest - Jest is a popular test runner for javascript - Test Driven Development - a process that creates test cases and requirements prior to creating software so the software is developed to the parameters set. - Classes - This depends on the area you are discussing. From my research, often times it refers to a set that is defined by a keyword. - React - A javascript library that is used to create a build interactive user interfaces. - React State - This is a built in method that stores a value and allows the value to be changed later on. - CRUD - Create, read, update and delete is the acronym for the process of performing persistent storage applications.
C++
GB18030
6,076
3.640625
4
[]
no_license
/* ñ㷨 㷨 Ԫ @param beg ʼ @param end @param _callback صߺ @return for_each(iterator beg, iterator end, _callback); transform㷨 ָԪذ˵һ ע : transform Ŀڴ棬Ҫǰڴ @param beg1 Դʼ @param end1 Դ @param beg2 Ŀʼ @param _cakkback صߺ @return Ŀ transform(iterator beg1, iterator end1, iterator beg2, _callbakc) ò㷨 find㷨 Ԫ @param beg ʼ @param end @param value ҵԪ @return زԪصλ find(iterator beg, iterator end, value) adjacent_find㷨 ظԪ @param beg ʼ @param end @param _callback صν(bool͵ĺ) @return Ԫصĵһλõĵ adjacent_find(iterator beg, iterator end, _callback); binary_search㷨 ֲҷ ע: в @param beg ʼ @param end @param value ҵԪ @return bool ҷtrue false bool binary_search(iterator beg, iterator end, value); find_if㷨 @param beg ʼ @param end @param callback صν(bool͵ĺ) @return bool ҷtrue false bool find_if(iterator beg, iterator end, _callback); count㷨 ͳԪسִ @param beg ʼ @param end @param valueصν(bool͵ĺ) @return intԪظ size_t count(iterator beg, iterator end, value); count_if㷨 ͳԪسִ @param beg ʼ @param end @param callback صν(bool͵ĺ) @return intԪظ size_t count_if(iterator beg, iterator end, _callback); 㷨 merge㷨 Ԫغϲ洢һ @param beg1 1ʼ @param end1 1 @param beg2 2ʼ @param end2 2 @param dest Ŀʼ merge(iterator beg1, iterator end1, iterator beg2, iterator end2, iterator dest) sort㷨 Ԫ ע: @param beg 1ʼ @param end 1 @param _callback صν(bool͵ĺ) sort(iterator beg, iterator end, _callback) sort㷨 ָΧڵԪ @param beg ʼ @param end random_shuffle(iterator beg, iterator end) reverse㷨 תָΧԪ @param beg ʼ @param end reverse(iterator beg, iterator end) ÿ滻㷨 copy㷨 ָΧԪؿһ @param beg ʼ @param end @param dest Ŀ @return Ŀĵ copy(iterator beg, iterator end, iterator dest) replace㷨 ָΧľԪ޸ΪԪ @param beg ʼ @param end @param oldvalue Ԫ @param newvalue Ԫ @return void replace(iterator beg, iterator end, oldvalue, newvalue) replace_if㷨 ָΧԪ滻ΪԪ @param beg ʼ @param end @param callbackصν(Bool͵ĺ) @param newvalue Ԫ @return void replace_if(iterator beg, iterator end, _callback, newvalue) swap㷨 Ԫ @param c11 @param c22 @return void swap(container c1, container c2) 㷨 accumulate㷨 Ԫۼܺ @param beg ʼ @param end @param valueۼֵ @return value accumulate(iterator beg, iterator end, value) fill㷨 Ԫ @param beg ʼ @param end @param value tԪ @return void fill(iterator beg, iterator end, value) ü㷨 set_intersection㷨 setϵĽ ע:ϱ @param beg1 1ʼ @param end1 1 @param beg2 2ʼ @param end2 2 @param dest Ŀʼ @return ĿһԪصĵַ set_intersection(iterator beg1, iterator end1, iterator beg2, iterator end2, iterator dest) set_union㷨 setϵIJ ע:ϱ @param beg1 1ʼ @param end1 1 @param beg2 2ʼ @param end2 2 @param dest Ŀʼ @return ĿһԪصĵַ set_union(iterator beg1, iterator end1, iterator beg2, iterator end2, iterator dest) set_difference㷨 setϵIJ ע:ϱ @param beg1 1ʼ @param end1 1 @param beg2 2ʼ @param end2 2 @param dest Ŀʼ @return ĿһԪصĵַ set_difference(iterator beg1, iterator end1, iterator beg2, iterator end2, iterator dest) */ int main(void) { return 0; }
Python
UTF-8
3,399
3.796875
4
[ "Apache-2.0" ]
permissive
__source__ = 'https://leetcode.com/problems/remove-element/' # https://github.com/kamyu104/LeetCode/blob/master/Python/remove-element.py # Time: O(n) # Space: O(1) # Array # # Description: Leetcode # 27. Remove Element # # Given an array and a value, remove all instances of that value in place and return the new length. # # Do not allocate extra space for another array, you must do this in place with constant memory. # # The order of elements can be changed. It doesn't matter what you leave beyond the new length. # # Example: # Given input array nums = [3,2,2,3], val = 3 # # Your function should return length = 2, with the first two elements of nums being 2. # Related Topics # Array Two Pointers # Similar Questions # Remove Duplicates from Sorted Array Remove Linked List Elements Move Zeroes # import unittest class Solution: # @param A a list of integers # @param elem an integer, value need to be removed # @return an integer def removeElement(self, A, elem): i, last = 0, len(A) - 1 while i <= last: if A[i] == elem: A[i], A[last] = A[last], A[i] last -= 1 else: i += 1 return last + 1 class SolutionOther: # @param A a list of integers # @param elem an integer, value need to be removed # @return an integer def removeElement(self, A, elem): answer =0 for i in range(len(A)): if A[i] != elem: A[answer]=A[i] answer += 1 return answer class TestMethods(unittest.TestCase): def test_Local(self): self.assertEqual(1, 1) t1 = SolutionOther() print t1.removeElement([1,1,1],1) print t1.removeElement([1, 2, 3, 4, 5, 2, 2], 2) A = [1, 2, 3, 4, 5, 2, 2] print Solution().removeElement(A, 2) , A if __name__ == '__main__': unittest.main() Java = ''' # Thought: https://leetcode.com/problems/remove-element/solution/ # Two pointers # 27.72% 10ms class Solution { public int removeElement(int[] nums, int val) { int end = -1; for (int i = 0; i < nums.length; i++) { if (nums[i] != val) { nums[++end] = nums[i]; } } return end + 1; } } # Two pointers # 4ms 98.55% class Solution { public int removeElement(int[] nums, int val) { int j = 0; for (int i = 0; i < nums.length; i++) { if (nums[i] != val) { nums[j++] = nums[i]; } } return j; } } # 6ms 45.82% class Solution { public int removeElement(int[] nums, int val) { int i = 0; int n = nums.length; while (i < n) { if (nums[i] == val) { nums[i] = nums[n - 1]; // reduce array size by one n--; } else { i++; } } return n; } } # 4ms 98.55% class Solution { public int removeElement(int[] nums, int val) { int end = nums.length; for (int i = 0; i < end; i++) { if (nums[i] == val) { swap(nums, i--, --end); } } return end; } private void swap(int[] nums, int i, int j) { int tmp = nums[i]; nums[i] = nums[j]; nums[j] = tmp; } } '''
Python
UTF-8
100
3.265625
3
[]
no_license
Contador = 1 while Contador < 3: print("Hola") Contador += 1 print("El ciclo se termino")
Python
UTF-8
1,870
3.078125
3
[]
no_license
from Tests.UnitTests.LineParserTestCaseBase import LineParserTestCaseBase from parsers.InsideParser.InsideSetArrayParser import InsideSetArrayParser class TestInsideSetArrayParser(LineParserTestCaseBase): _validSingleValueTest = "inside 'my.txt' set KEY with values 'value1'" _validMultiValueTest = "inside 'my.txt' set KEY with values 'value1:value2:value3'" def setUp(self): self.textParser = InsideSetArrayParser('txt') def test_isValid(self): self.isValidText(TestInsideSetArrayParser._validSingleValueTest) self.isValidText(TestInsideSetArrayParser._validMultiValueTest) self.isValidText("inside 'my.txt' set KEY with values 'value1:value2:value3'") def test_isNotValid(self): self.isNotValidText("inside 'my.sln' set KEY with values 'value1'") self.isNotValidText("inside 'my.sln' set KEY with values 'value1:value2'") self.isNotValidText("inside 'my.txt' set KEY with values 'value1' ") self.isNotValidText("inside 'my.txt' set KEY with values 'value1' bla bla") def test_parse(self): self.checkParse(TestInsideSetArrayParser._validSingleValueTest, 'my.txt', 'KEY', 'value1') self.checkParse(TestInsideSetArrayParser._validMultiValueTest, 'my.txt', 'KEY', 'value1:value2:value3') def test_values(self): self.checkValues(TestInsideSetArrayParser._validSingleValueTest, ['value1']) self.checkValues(TestInsideSetArrayParser._validMultiValueTest, ['value1', 'value2', 'value3']) def checkParse(self, line, filePath, key, value): result = self.textParser.parseLine(line) self.assertEqual(filePath, result[0]) self.assertEqual(key, result[1]) self.assertEqual(value, result[2]) def checkValues(self, text, expectedValues): self.textParser.parseLine(text) self.assertEqual(len(expectedValues), len(self.textParser.values)) for v in self.textParser.values: self.assertTrue(v in expectedValues)
TypeScript
UTF-8
1,476
2.625
3
[]
no_license
import { Injectable, Req, Res } from '@nestjs/common'; import { PassportStrategy } from '@nestjs/passport'; import { Strategy } from 'passport-local'; import { AuthService } from '../auth.service'; import { AuthError } from '@exceptions'; @Injectable() export class LocalStrategySignIn extends PassportStrategy(Strategy, 'signin') { constructor(private readonly authService: AuthService) { super({ usernameField: 'email', passwordField: 'password', passReqToCallback: true }); } public async validate(@Res() res, email: string, password: string) { const user = await this.authService.signIn({ email, password }); if (!user) { throw new AuthError('Incorrect email or password'); } return user; } } @Injectable() export class LocalStrategySignUp extends PassportStrategy(Strategy, 'signup') { constructor(private readonly authService: AuthService) { super({ usernameField: 'email', passwordField: 'password', passReqToCallback: true }); } public async validate(@Req() req, email: string, password: string) { if (req.user) { return req.user; } const user = await this.authService.signUp({ email, password, fullname: req.body.fullname, }); return user; } }
Java
UTF-8
1,816
3.421875
3
[]
no_license
package Best_Time_to_Buy_and_Sell_Stock_IV; /** * @program: LeetCode * @Description: 188. 买卖股票的最佳时机 IV dp经典解法 * @Author: SOYANGA * @Create: 2019-06-29 02:09 * @Version 1.0 */ public class Best_Time_to_Buy_and_Sell_Stock_IV { class Solution { public int maxProfit(int k, int[] prices) { if(prices==null || k==0 || prices.length==0){ return 0; } //k>n/2 即为 买卖股票的最佳时机 II k为无穷 ,使用其方法即可 if(k>prices.length/2){ return maxProfit(prices); } int [][][] mp = new int [prices.length][k+1][2]; int max = 0; for(int i = 0;i < prices.length; i++){ for(int n = k; n > 0 ; n--){ //交易次数 if(i-1 == -1){ //初始化 mp[i][n][0] = 0; mp[i][n][1] = -prices[i]; continue; } mp[i][n][0] = Math.max(mp[i-1][n][0], mp[i-1][n][1] + prices[i]); mp[i][n][1] = Math.max(mp[i-1][n][1], mp[i-1][n-1][0] - prices[i]); } } return mp[prices.length-1][k][0]; } public int maxProfit(int[] prices) { int max = 0; for(int i = 1; i < prices.length;i++){ if(prices[i-1]<prices[i]){ max+=prices[i]-prices[i-1]; } } return max; } } } /* base case: dp[-1][k][0] = dp[i][0][0] = 0 dp[-1][k][1] = dp[i][0][1] = -infinity 状态转移方程: dp[i][k][0] = max(dp[i-1][k][0], dp[i-1][k][1] + prices[i]) dp[i][k][1] = max(dp[i-1][k][1], dp[i-1][k-1][0] - prices[i]) */
Java
UTF-8
2,020
2.671875
3
[]
no_license
package org.jaxen.pattern; import com.google.firebase.remoteconfig.FirebaseRemoteConfig; import org.jaxen.Context; import org.jaxen.Navigator; public class NameTest extends NodeTest { private String name; private short nodeType; public double getPriority() { return FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE; } public NameTest(String str, short s) { this.name = str; this.nodeType = s; } public boolean matches(Object obj, Context context) { Navigator navigator = context.getNavigator(); short s = this.nodeType; if (s == 1) { if (!navigator.isElement(obj) || !this.name.equals(navigator.getElementName(obj))) { return false; } return true; } else if (s == 2) { if (!navigator.isAttribute(obj) || !this.name.equals(navigator.getAttributeName(obj))) { return false; } return true; } else if (navigator.isElement(obj)) { return this.name.equals(navigator.getElementName(obj)); } else { if (navigator.isAttribute(obj)) { return this.name.equals(navigator.getAttributeName(obj)); } return false; } } public short getMatchType() { return this.nodeType; } public String getText() { if (this.nodeType != 2) { return this.name; } StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("@"); stringBuffer.append(this.name); return stringBuffer.toString(); } public String toString() { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(super.toString()); stringBuffer.append("[ name: "); stringBuffer.append(this.name); stringBuffer.append(" type: "); stringBuffer.append(this.nodeType); stringBuffer.append(" ]"); return stringBuffer.toString(); } }
Java
UTF-8
224
1.5
2
[]
no_license
package com.met.account.dto.response; import lombok.Data; @Data public class ExecuteTransactionResponse { private String fromId; private String toId; private boolean success; private String errorMessage; }
C++
UTF-8
340
2.765625
3
[]
no_license
#include<iostream> #include<cmath> using namespace std; int main() { int n,i,count1=0,count2=0,k,l; cin>>n; int a[n]; for(i=0;i<n;i++) { cin>>a[i]; if(a[i]%2==0) { count1++; k=i+1; continue; } else { count2++; l=i+1; continue; } } if(count1<count2) { cout<<k; } else { cout<<l; } return 0; }
Java
UTF-8
209
1.5625
2
[]
no_license
package com.example.administrator.xiazoliuxing.view.main; import com.example.administrator.xiazoliuxing.base.BaseMvpView; public interface VerifyView extends BaseMvpView { void setData(String data); }
Java
UTF-8
1,358
2.765625
3
[]
no_license
package serverUtils; /** * This program creates requested object (factory pattern) * * @author Arsene INDAMUTSA * <p> * Andrew ID: aindamut * <p> * On my honor, as a Carnegie-Mellon Rwanda student, I have neither * given nor received unauthorized assistance on this work. */ import util.Courrier; public class StrategyFactory { public static StrategyContext getProtocol(Courrier courrier) { String message = courrier.getMessage(); switch (message) { case "Upload": return new StrategyContext(new UploadPizzeriaProtocol()); case "show": return new StrategyContext(new DisplayPizzeriaProtocol()); case "Print": return new StrategyContext(new PrintPizzeriaProtocol()); case "Delete": return new StrategyContext(new DeletePizzeriaProtocol()); case "UpdateBP": return new StrategyContext(new UpdateBasePriceProtocol()); case "UpdateOption": return new StrategyContext(new OptionAdditionProtocol()); case "showlist": return new StrategyContext(new DisplayOptionSet()); case "calculate": return new StrategyContext(new CalculatePrice()); default: return null; } } }
Java
UTF-8
1,675
3.671875
4
[]
no_license
/* Problem Description There is given an integer array A of size N denoting the heights of N trees. Lumberjack Ojas needs to chop down B metres of wood. It is an easy job for him since he has a nifty new woodcutting machine that can take down forests like wildfire. However, Ojas is only allowed to cut a single row of trees. Ojas's machine works as follows: Ojas sets a height parameter H (in metres), and the machine raises a giant sawblade to that height and cuts off all tree parts higher than H (of course, trees not higher than H meters remain intact). Ojas then takes the parts that were cut off. For example, if the tree row contains trees with heights of 20, 15, 10, and 17 metres, and Ojas raises his sawblade to 15 metres, the remaining tree heights after cutting will be 15, 15, 10, and 15 metres, respectively, while Ojas will take 5 metres off the first tree and 2 metres off the fourth tree (7 metres of wood in total). Ojas is ecologically minded, so he doesn't want to cut off more wood than necessary. That's why he wants to set his sawblade as high as possible. Help Ojas find the maximum integer height of the sawblade that still allows him to cut off at least B metres of wood. */ public class Solution { public int solve(ArrayList<Integer> A, int B) { Collections.sort(A); int sum = 0; for(Integer i:A){ sum += i; } double max_h = 0; int local_sum = 0; for(int i=0;i<A.size()-1;i++){ local_sum += A.get(i); int m = A.size()-1-i; double h = (sum-local_sum-B)/m; max_h = Math.max(h,max_h); } return (int)max_h; } }
Java
UTF-8
7,112
2.265625
2
[]
no_license
package com.contactlist; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.sql.ResultSet; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.border.TitledBorder; import com.jgoodies.forms.factories.FormFactory; import com.jgoodies.forms.layout.ColumnSpec; import com.jgoodies.forms.layout.FormLayout; import com.jgoodies.forms.layout.RowSpec; @SuppressWarnings("serial") public class CategoryUI extends JPanel implements Textable { private UIType type; private int id; private JTextField nametxf; private JLabel namelbl; private JLabel descriptionlbl; private JPanel controlpnl; private JButton savebtn; private JButton deletebtn; private JTextArea descriptiontxf; private int currentCategoryId = -1; public CategoryUI(UIType type, int id) { this(); this.type = type; this.id = id; if (this.type.equals(UIType.NEW)) { deletebtn.setVisible(false); savebtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { if (DBConnection .executeUpdate("INSERT INTO B8XCYHMAD4TXDLPU.CATEGORY (NAME, DESCRIPTION) " + "VALUES ('" + nametxf.getText() + "', '" + descriptiontxf.getText() + "')") == 1) { JOptionPane.showMessageDialog( null, LanguageEngine.getLanguage().getBundleText( "category.successfullSave"), "", JOptionPane.INFORMATION_MESSAGE); JTabbedPane tab = (JTabbedPane) getParent(); tab.removeTabAt(tab.getSelectedIndex()); } else JOptionPane.showMessageDialog( null, LanguageEngine.getLanguage().getBundleText( "category.unsuccessfullSave"), "", JOptionPane.ERROR_MESSAGE); } catch (Exception e) { e.printStackTrace(); } } }); } if (this.type.equals(UIType.EDIT)) { loadCategory(this.id); savebtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { if (DBConnection .executeUpdate("UPDATE B8XCYHMAD4TXDLPU.CATEGORY " + "SET NAME = '" + nametxf.getText() + "', DESCRIPTION = '" + descriptiontxf.getText() + "' WHERE id = " + currentCategoryId) == 1) { JOptionPane.showMessageDialog( null, LanguageEngine.getLanguage().getBundleText( "category.editSuccessfullSave"), "", JOptionPane.INFORMATION_MESSAGE); JTabbedPane tab = (JTabbedPane) getParent(); tab.removeTabAt(tab.getSelectedIndex()); } else JOptionPane.showMessageDialog( null, LanguageEngine.getLanguage().getBundleText( "category.editUnsuccessfullSave"), "", JOptionPane.ERROR_MESSAGE); } catch (Exception e) { e.printStackTrace(); } } }); deletebtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { if (DBConnection .executeUpdate("delete from category where id = " + currentCategoryId) == 1) { JOptionPane.showMessageDialog( null, LanguageEngine.getLanguage().getBundleText( "category.deleteSuccessfullSave"), "", JOptionPane.INFORMATION_MESSAGE); JTabbedPane tab = (JTabbedPane) getParent(); tab.removeTabAt(tab.getSelectedIndex()); } else JOptionPane .showMessageDialog( null, LanguageEngine .getLanguage() .getBundleText( "category.deleteUnsuccessfullSave"), "", JOptionPane.ERROR_MESSAGE); } catch (Exception e) { e.printStackTrace(); } } }); } else if (this.type.equals(UIType.VIEW)) { savebtn.setVisible(false); deletebtn.setVisible(false); controlpnl.setVisible(false); } } public CategoryUI() { setLayout(new BorderLayout(0, 0)); controlpnl = new JPanel(); controlpnl.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null)); FlowLayout fl_controlpnl = (FlowLayout) controlpnl.getLayout(); fl_controlpnl.setAlignment(FlowLayout.RIGHT); add(controlpnl, BorderLayout.SOUTH); savebtn = new JButton("save"); controlpnl.add(savebtn); deletebtn = new JButton("delete"); controlpnl.add(deletebtn); JPanel general = new JPanel(); add(general, BorderLayout.CENTER); general.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), })); namelbl = new JLabel("website : "); general.add(namelbl, "2, 2, right, default"); nametxf = new JTextField(); nametxf.setColumns(20); general.add(nametxf, "4, 2, left, default"); nametxf.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent arg0) { JTabbedPane tabs = (JTabbedPane) getParent(); tabs.setTitleAt( tabs.getSelectedIndex(), LanguageEngine.getLanguage().getBundleText( "category.newCategoryTabTitle") + " - " + (nametxf.getText().substring(0, nametxf .getText().length() > 15 ? 15 : nametxf .getText().length()))); } }); descriptionlbl = new JLabel("address : "); general.add(descriptionlbl, "2, 4, right, top"); JScrollPane descriptionscrl = new JScrollPane(); general.add(descriptionscrl, "4, 4, left, top"); descriptiontxf = new JTextArea(); descriptiontxf.setRows(5); descriptiontxf.setColumns(35); descriptionscrl.setViewportView(descriptiontxf); LanguageEngine.registerUI(this); } private void loadCategory(int id) { currentCategoryId = id; try { ResultSet result = DBConnection .executeQuery("SELECT NAME, DESCRIPTION FROM B8XCYHMAD4TXDLPU.CATEGORY WHERE ID = " + currentCategoryId); if (result.next()) { nametxf.setText(result.getString(1)); descriptiontxf.setText(result.getString(2)); } } catch (Exception e) { e.printStackTrace(); } } @Override public void updateText() { Language lang = LanguageEngine.getLanguage(); namelbl.setText(lang.getBundleText("category.name")); descriptionlbl.setText(lang.getBundleText("category.description")); savebtn.setText(lang.getBundleText("contact.save")); deletebtn.setText(lang.getBundleText("contact.delete")); } }
Java
UTF-8
1,210
3.78125
4
[]
no_license
package Workshop7_5_3; import java.util.ArrayList; public class RandomService { ArrayList<Integer> list1 = new ArrayList<Integer>(); ArrayList<Integer> list2 = new ArrayList<Integer>(); public ArrayList<Integer> makeRandomInt(ArrayList<Integer> list) { //비어있는 리스트받아서 아래 포문 호출 list1 했다가 list2작동 for(int i = 0 ; i < 10; i++) { int randomValue1 = (int) (Math.random() * 10); list.add(randomValue1); } return list; //랜덤한값 10개 들어있는게 메인으로 리턴 list1로 끝나면 2로 } public void printArrayList(ArrayList<Integer> list1, ArrayList<Integer> list2) { //1번과 2번을 받아서 나눗셈 해줌 for(int i = 0; i < 10; i++) { int list1Value = list1.get(i); int list2Value = list2.get(i); try { System.out.println(list1Value + "/" + list2Value + " "); System.out.println(list1Value / list2Value); } catch (Exception e) { System.out.println("분모가 0입니다"); } } } }
TypeScript
UTF-8
725
2.546875
3
[ "ISC" ]
permissive
import { Schema, model } from 'mongoose' const UserSchema = new Schema({ name: { type: String, required: [true, 'Please add a name'] }, email: { type: String, required: [true, 'Please add an email'], unique: true, match: [ /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/, 'Please add a valid email' ] }, role: { type: String, enum: ['user', 'publisher'], default: 'user' }, password: { type: String, required: [true, 'Please add a password'], minlength: 6, select: false }, resetPasswordToken: String, resetPasswordExpire: Date, createdAt: { type: Date, default: Date.now } }) export const User = model('User', UserSchema)
Java
UTF-8
1,019
2.046875
2
[]
no_license
package android.util.http; /** * Http * <p/> * Created by Haidy on 15/8/26. */ public class Http { /** * get */ public static final String GET = "GET"; /** * post */ public static final String POST = "POST"; /** * content type default name */ public static final String CONTENT_TYPE = "Content-Type"; /** * content encoding default name */ public static final String CONTENT_ENCODING = "Content-Encoding"; /** * content type default name */ public static final String PLAIN_TEXT_TYPE = "text/plain"; /** * json type */ public static final String APPLICATION_JSON = "application/json"; public static final String CONTENT_LEN = "Content-Length"; public static final String APPLICATION_X_WWW_FORM_URLENCODE = "application/x-www-form-urlencoded"; public static final String FORM_DATA = "form-data"; public static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; }
Swift
UTF-8
2,207
2.9375
3
[ "MIT" ]
permissive
// // CSVWriter+Test.swift // swift-csv // // Created by Matthias Hochgatterer on 02/06/2017. // Copyright © 2017 Matthias Hochgatterer. All rights reserved. // import XCTest class CSVWriter_Test: XCTestCase { var stream: OutputStream! var writer: CSV.Writer! override func setUp() { super.setUp() stream = OutputStream(toMemory: ()) let configuration = CSV.Configuration(delimiter: ",") writer = CSV.Writer(outputStream: stream, configuration: configuration) } func testQuotedFields() throws { try writer.writeLine(of: ["aaa", "b \r\nbb", "ccc"]) try writer.writeLine(of: ["zzz", "yyy", "xxx"]) guard let data = stream.property(forKey: .dataWrittenToMemoryStreamKey) as? Data else { XCTFail("Could not retrieve data") return } if let string = String(data: data, encoding: .utf8) { let expected = "aaa,\"b \r\nbb\",ccc\nzzz,yyy,xxx" XCTAssertEqual(string, expected) } else { XCTFail("Invalid data \(data)") } } func testEmptyFields() throws { try writer.writeLine(of: ["zzz", "", "xxx", ""]) guard let data = stream.property(forKey: .dataWrittenToMemoryStreamKey) as? Data else { XCTFail("Could not retrieve data") return } if let string = String(data: data, encoding: .utf8) { let expected = "zzz,,xxx," XCTAssertEqual(string, expected) } else { XCTFail("Invalid data \(data)") } } func testSemicolonDelimiter() throws { let writer = CSV.Writer(outputStream: stream, configuration: CSV.Configuration(delimiter: ";")) try writer.writeLine(of: ["zzz", "yyy", "xxx"]) guard let data = stream.property(forKey: .dataWrittenToMemoryStreamKey) as? Data else { XCTFail("Could not retrieve data") return } if let string = String(data: data, encoding: .utf8) { let expected = "zzz;yyy;xxx" XCTAssertEqual(string, expected) } else { XCTFail("Invalid data \(data)") } } }
C#
UTF-8
2,131
2.625
3
[ "MIT" ]
permissive
using API.Entities; using API.Interfaces; using API.DTOs; using API.Helpers; using System.Threading.Tasks; using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore; using AutoMapper.QueryableExtensions; using AutoMapper; namespace API.Data { public class UserRepository : IUserRepository { private readonly DataContext _context; private readonly IMapper _mapper; public UserRepository(DataContext context, IMapper mapper) { _mapper = mapper; _context = context; } public void Update(AppUser user) { _context.Entry(user).State = EntityState.Modified; } public async Task<bool> SaveAllAsync() { return await _context.SaveChangesAsync() > 0; } public async Task<IEnumerable<AppUser>> GetUsersAsync() { return await _context.Users.Include(p => p.Photos).ToListAsync(); } public async Task<AppUser> GetUserByIdAsync(int id) { return await _context.Users.FindAsync(id); } public async Task<AppUser> GetUserByUsernameAsync(string username) { return await _context .Users .Include(p => p.Photos) .SingleOrDefaultAsync(x => x.UserName == username); } public async Task<PagedList<MemberDto>> GetMembersAsync(UserParams userParams) { var query = _context .Users .ProjectTo<MemberDto>(_mapper.ConfigurationProvider) .AsNoTracking(); return await PagedList<MemberDto>.CreateAsync(query, userParams.PageNumber, userParams.PageSize); } public async Task<MemberDto> GetMemberAsync(string username) { return await _context .Users .Where(x => x.UserName == username) .ProjectTo<MemberDto>(_mapper.ConfigurationProvider) .SingleOrDefaultAsync(); } } }
Markdown
UTF-8
2,105
2.765625
3
[]
no_license
@title[git] ![Git logo](assets/git-logo.png) --- @title[What is git?] ### What is git? #### The Basics ![Press Down Key](assets/down-arrow.png) +++ @title[git basics] ```bash git help git init git clone git status git show git log git branch git checkout git commit git add git rm git mv git reset git revert git diff git merge git rebase ECHO more on this later git tag git fetch git remote git pull git push git stash git cherry-pick ``` @[1] @[2] @[3] @[4] @[5] @[6] @[7] @[8] @[9] @[10] @[11] @[12] @[13] @[14] @[15] @[16] @[17] @[18] @[19] @[20] @[21] @[22] @[23] @[24] #### Everything in git is a file. --- @title[Subcommands] ### Subcommands ![Subcommands](assets/2kdbvg.jpg) --- @title[Git lifecycle] ### Git lifecycle ![Git lifecycle](assets/git-lifecycle.png) --- @title[Git local operations] ### Git local operations ![Git local operations](assets/git-localoperations.png) --- @title[Git remote operations] ### Git remote operations ![Git remote operations](assets/git-remoteoperations.png) --- ### Github Flow ![Press Down Key](assets/down-arrow.png) +++ @title[Github Flow] ![Github flow](assets/github-flow.png) --- @title[DEMO] ### DEMO --- @title[A Word About Rebase] ### A Word About Rebase ![Rebase](assets/2kd978.jpg) --- @title[Questions?] ### Questions? --- #### DO * DO keep master in working order * DO pull in changes * DO tag releases * DO push feature branches for discussion * DO learn when to use rebase (HINT: interactive merge conflicts and clean history) --- #### DON’T * DON'T merge in broken code. * DON'T commit onto master directly. * DON'T hotfix onto master! Use a feature branch. * DON'T rebase master. * DON'T merge with conflicts. Handle conflicts upon rebasing. --- ### Resources #### [Atlassian git tutorials](https://www.atlassian.com/git/tutorials) #### [Github git handbook](https://guides.github.com/introduction/git-handbook) #### [Atlassian git tutorials](https://www.atlassian.com/git/tutorials) #### [Learn git branching](https://learngitbranching.js.org/) #### [Github - learning git](https://try.github.io/)
PHP
UTF-8
4,848
3
3
[ "MIT" ]
permissive
<?php class ViewHelpers { /* Inclui arquivos css * Se o caminho começar com / deve ser considerado a partir da pasta ASSETS_FOLDER * caso contrário a partir de ASSETS_FORLDER/css/ */ public static function stylesheetIncludeTag() { $params = func_get_args(); $links = ""; foreach($params as $param) { $path = ASSETS_FOLDER; $path .= (substr($param, 0, 1) === '/') ? $param : '/css/' . $param ; $links .= "<link href='{$path}' rel='stylesheet' type='text/css' />"; } return $links; } /* * Inclui arquivos js * Se o caminho começar com / deve ser considerado a partir da pasta ASSETS_FOLDER * caso contrário a partir de ASSETS_FORLDER/css/ */ public static function javascriptIncludeTag(){ $params = func_get_args(); $links = ""; foreach($params as $param){ $path = ASSETS_FOLDER; $path .= (substr($param, 0, 1) === '/') ? $param : '/js/' . $param ; $links .= "<script src='{$path}' type='text/JavaScript'></script>"; } return $links; } /* * Função para criar links. * Importante para definir os caminhos dos arquivos * Caso começe com / indica caminho absolute a partir do root da aplicação, * caso contrário é camaminho relativo */ public static function linkTo($path, $name, $options = '') { if (substr($path, 0, 1) == '/') $link = SITE_ROOT . $path; else $link = $path; return "<a href='{$link}' {$options}> $name </a>"; } /* * Função para criação de urls * Importante, pois com elas não é necessário fazer diversas * alterações quando mudar a url principal do site */ public static function urlFor($path){ return SITE_ROOT . $path; } public static function imageTag($path, $options = "") { $full_path = ASSETS_FOLDER; $full_path .= (substr($path, 0, 1) === '/') ? $path : '/images/' . $path ; return "<img src=\"{$full_path}\" {$options} />"; } /* * Método destinada ao redirecionamento de páginas * Lembre-se que quando um endereço inicia-se com '/' diz respeito * a um caminho absoluto, caso contrário é um caminho relativo. */ public static function redirectTo($address) { if (substr($address, 0, 1) == '/') header('location: ' . SITE_ROOT . $address); else header('location: ' . $address); exit(); } public static function previousUrlOr($address = '/' ) { if (isset($_SERVER['HTTP_REFERER'])){ return 'javascript:history.back()'; //return $_SERVER['HTTP_REFERER']; }else{ return ViewHelpers::urlFor($address); } } /* * Função para converter boleano em formato amigável */ public static function prettyBool($value){ return $value ? 'Sim' : 'Não'; } public static function dateFormat($date){ return date('d/m/Y', strtotime($date)); } public static function dateTimeFormat($dateTime){ return date('d/m/Y H:i:s', strtotime($dateTime)); } public static function currencyFormat($number) { return 'R$ ' . number_format($number, 2, ',', '.'); } public static function activeClass($route) { $route = SITE_ROOT . $route; if (preg_match('#^' . $route . '$#', $_SERVER['REQUEST_URI'])) return 'active'; return ''; } public static function fullTitle($pageTitle = "") { $baseTitle = APP_NAME; if (empty($pageTitle)) return $baseTitle; else return $pageTitle . " | " . $baseTitle; } public static function truncate($text, $chars = 25) { if(strlen($text) < $chars) return $text; $text = $text." "; $text = substr($text,0,$chars); $text = substr($text,0,strrpos($text,' ')); $text = $text."..."; return $text; } public static function paginate($pageController) { $paginationHTML = "<nav><ul class='pagination'>"; if($pageController->page > 1) { $paginationHTML .= "<li><a href="; $previous = $pageController->page - 1; $paginationHTML .= self::urlFor("/{$pageController->urlSegment}/pagina/{$previous}"); $paginationHTML .= " aria-label='Previous'><span aria-hidden='true'>&laquo;</span></a></li>"; } for($i = 1; $i <= $pageController->totalPages; $i++) { $class = $i == $pageController->page ? 'active' : ''; $url = ViewHelpers::urlFor("/{$pageController->urlSegment}/pagina/{$i}"); $paginationHTML .= "<li class='{$class}'><a class='item' href='{$url}'>{$i}</a></li>"; } if($pageController->page < $pageController->totalPages) { $paginationHTML .= "<li><a href="; $next = $pageController->page + 1; $paginationHTML .= self::urlFor("/{$pageController->urlSegment}/pagina/{$next}"); $paginationHTML .= " aria-label='Next'><span aria-hidden='true'>&raquo;</span></a></li></ul></nav>"; } return $paginationHTML; } } ?>