hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
98 values
lang
stringclasses
21 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
118
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
118
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
135
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
1.05M
avg_line_length
float64
1
1.03M
max_line_length
int64
2
1.03M
alphanum_fraction
float64
0
1
808e70e28ec04911f440c5cb0fd3393c68e41eac
5,477
java
Java
test/com/thoughtworks/biblioteca/MovieLibraryTest.java
jhalaa/twu-biblioteca-jhalaa
3f98bbcacf0e750faf7c53064a0941ce8054f895
[ "Apache-2.0" ]
null
null
null
test/com/thoughtworks/biblioteca/MovieLibraryTest.java
jhalaa/twu-biblioteca-jhalaa
3f98bbcacf0e750faf7c53064a0941ce8054f895
[ "Apache-2.0" ]
null
null
null
test/com/thoughtworks/biblioteca/MovieLibraryTest.java
jhalaa/twu-biblioteca-jhalaa
3f98bbcacf0e750faf7c53064a0941ce8054f895
[ "Apache-2.0" ]
null
null
null
package com.thoughtworks.biblioteca; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.ArrayList; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; public class MovieLibraryTest { @Test public void shouldHaveAListOfAvailableMovies() { ArrayList<Movies> movies1 = new ArrayList<Movies>(); movies1.add(new Movies("Titanic", 1990, "James Cameron", 5)); MovieLibrary movieLibrary = new MovieLibrary(movies1); assertEquals(movies1, movieLibrary.getMovieLibrary()); } @Test public void shouldReturnEqualIfTheMovieListsAreEqual() { ArrayList<Movies> movies = new ArrayList<Movies>(); movies.add(new Movies("Titanic", 1990, "James Cameron", 5)); movies.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary1 = new MovieLibrary(movies); MovieLibrary movieLibrary2 = new MovieLibrary(movies); assertEquals(movieLibrary1, movieLibrary2); } @Test public void shouldReturnNotEqualIfTheMovieListsAreNotEqual() { ArrayList<Movies> movies = new ArrayList<Movies>(); movies.add(new Movies("Titanic", 1990, "James Cameron", 5)); movies.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary1 = new MovieLibrary(movies); ArrayList<Movies> movies1 = new ArrayList<Movies>(); movies1.add(new Movies("Titanic2", 1990, "James Cameron", 5)); movies1.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary2 = new MovieLibrary(movies1); assertNotEquals(movieLibrary1, movieLibrary2); } @Test public void shouldReturnEqualHashCodeIfTwoMoviesListsAreSame() { ArrayList<Movies> movies = new ArrayList<Movies>(); movies.add(new Movies("Titanic", 1990, "James Cameron", 5)); movies.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary1 = new MovieLibrary(movies); ArrayList<Movies> movies1 = new ArrayList<Movies>(); movies1.add(new Movies("Titanic", 1990, "James Cameron", 5)); movies1.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary2 = new MovieLibrary(movies1); assertEquals(movieLibrary1.hashCode(), movieLibrary2.hashCode()); } @Test public void shouldReturnEqualHashCodeIfTwoMoviesListsAreDifferent() { ArrayList<Movies> movies = new ArrayList<Movies>(); movies.add(new Movies("Titanic", 1990, "James Cameron", 5)); movies.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary1 = new MovieLibrary(movies); ArrayList<Movies> movies1 = new ArrayList<Movies>(); movies1.add(new Movies("Titanicjk", 1990, "James Cameron", 5)); movies1.add(new Movies("Inceptioon1", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary2 = new MovieLibrary(movies1); assertNotEquals(movieLibrary1.hashCode(), movieLibrary2.hashCode()); } @Test public void shouldReturnAValidMovieListAfterCheckout() { ArrayList<Movies> movies = new ArrayList<Movies>(); movies.add(new Movies("Titanic", 1990, "James Cameron", 5)); MovieLibrary movieLibrary1 = new MovieLibrary(movies); movies.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary2 = new MovieLibrary(movies); movieLibrary1.checkout("Inception"); assertEquals(movieLibrary1, movieLibrary2); } @Test public void shouldReturnBeTheSameAfterInvalidCheckout() { ArrayList<Movies> movies = new ArrayList<Movies>(); movies.add(new Movies("Titanic", 1990, "James Cameron", 5)); movies.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary1 = new MovieLibrary(movies); MovieLibrary movieLibrary2 = new MovieLibrary(movies); movieLibrary1.checkout("Inception1"); assertEquals(movieLibrary1, movieLibrary2); } private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); @Before public void setOutputStream() { System.setOut(new PrintStream(outContent)); } @Test public void shouldReturnValidMovie() { ArrayList<Movies> movies = new ArrayList<Movies>(); movies.add(new Movies("Titanic", 1990, "James Cameron", 5)); MovieLibrary movieLibrary = new MovieLibrary(movies); movieLibrary.displayContents(); assertEquals(String.format("%-34s %-34d %-34s %-34d\n", "Titanic", 1990, "James Cameron", 5), outContent.toString()); } @Test public void shouldReturnValidMovies() { ArrayList<Movies> movies = new ArrayList<Movies>(); movies.add(new Movies("Titanic", 1990, "James Cameron", 5)); movies.add(new Movies("Inception", 2010, "Christopher Nolan", 9)); MovieLibrary movieLibrary = new MovieLibrary(movies); movieLibrary.displayContents(); assertEquals(String.format("%-34s %-34d %-34s %-34d\n%-34s %-34d %-34s %-34d\n", "Titanic", 1990, "James Cameron", 5, "Inception", 2010, "Christopher Nolan", 9), outContent.toString()); } @After public void cleanUpStreams() { System.setOut(System.out); } }
42.789063
193
0.678474
fbbaa1b4cdb7afc4abc66eda0c86d4ea0db95ba0
3,858
java
Java
src/test/java/com/project/kcookserver/account/AccountIntegratedTest.java
vividswan/K.Cook-Cake-Server
7c076605fe5ffe6d20e57b974ed7adecb97b393d
[ "MIT" ]
6
2021-09-10T06:33:22.000Z
2022-03-15T12:36:05.000Z
src/test/java/com/project/kcookserver/account/AccountIntegratedTest.java
vividswan/K.Cook-Cake-Server
7c076605fe5ffe6d20e57b974ed7adecb97b393d
[ "MIT" ]
null
null
null
src/test/java/com/project/kcookserver/account/AccountIntegratedTest.java
vividswan/K.Cook-Cake-Server
7c076605fe5ffe6d20e57b974ed7adecb97b393d
[ "MIT" ]
2
2022-02-20T10:38:31.000Z
2022-03-01T13:40:01.000Z
package com.project.kcookserver.account; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.project.kcookserver.account.dto.AccountAuthDto; import com.project.kcookserver.account.dto.SignInReq; import com.project.kcookserver.account.dto.TestAccountAuthDto; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.result.MockMvcResultHandlers; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; @Transactional @AutoConfigureMockMvc @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK) public class AccountIntegratedTest { @Autowired private MockMvc mockMvc; @Autowired private AccountService accountService; @Value("${test.address}") private String realAddress; AccountAuthDto accountAuthDto; @BeforeEach private void createBeforeData() { accountAuthDto = AccountAuthDto.builder() .signInId("testUserId") .email("test@test.com") .nickname("testUser") .password("test1234") .phoneNumber("01012345678") .address(realAddress) .dateOfBirth(LocalDate.now()).build(); } @DisplayName("회원가입 테스트") @Test public void signUpTest() throws Exception { //given TestAccountAuthDto testAccountAuthDto = new TestAccountAuthDto(accountAuthDto); testAccountAuthDto.setPassword(accountAuthDto.getPassword()); String content = new ObjectMapper().registerModule(new JavaTimeModule()).writeValueAsString(testAccountAuthDto); //when ResultActions resultActions = mockMvc.perform(post("/app/sign-up") .contentType(MediaType.APPLICATION_JSON).content(content).accept(MediaType.APPLICATION_JSON)); //then resultActions.andExpect(status().is2xxSuccessful()).andExpect(jsonPath("$.isSuccess").value(true)) .andExpect(jsonPath("$.code").value(1000)) .andExpect(jsonPath("$.result").exists()) .andDo(MockMvcResultHandlers.print()); } @DisplayName("로그인 테스트") @Test public void signInTest() throws Exception { //given accountService.signUp(accountAuthDto); SignInReq signInReq = SignInReq.builder() .signInId("testUserId") .password("test1234").build(); String content = new ObjectMapper().registerModule(new JavaTimeModule()).writeValueAsString(signInReq); //when ResultActions resultActions = mockMvc.perform(post("/app/sign-in") .contentType(MediaType.APPLICATION_JSON).content(content).accept(MediaType.APPLICATION_JSON)); //then resultActions.andExpect(status().is2xxSuccessful()).andExpect(jsonPath("$.isSuccess").value(true)) .andExpect(jsonPath("$.code").value(1000)) .andExpect(jsonPath("$.result.jwt").exists()) .andDo(MockMvcResultHandlers.print()); } }
38.58
120
0.715397
fb83e1bd16d1f510579217347ae27252adfe6005
17,087
java
Java
app/src/main/java/com/codepath/apps/mysimpletweets/TimelineActivity.java
lin1000/codepath-project4-TwitterWithFragement
c699ea9bb67b36a0993b685eda28d37c66cc5dc5
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/codepath/apps/mysimpletweets/TimelineActivity.java
lin1000/codepath-project4-TwitterWithFragement
c699ea9bb67b36a0993b685eda28d37c66cc5dc5
[ "Apache-2.0" ]
1
2017-03-13T06:03:31.000Z
2017-03-13T06:03:31.000Z
app/src/main/java/com/codepath/apps/mysimpletweets/TimelineActivity.java
lin1000/codepath-project4-TwitterWithFragement
c699ea9bb67b36a0993b685eda28d37c66cc5dc5
[ "Apache-2.0" ]
null
null
null
package com.codepath.apps.mysimpletweets; import android.content.Intent; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.support.v4.graphics.drawable.RoundedBitmapDrawable; import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ImageView; import com.astuetz.PagerSlidingTabStrip; import com.bumptech.glide.Glide; import com.codepath.apps.mysimpletweets.adapters.TimelineFragmentAdapter; import com.codepath.apps.mysimpletweets.fragments.ComposeDialogueFragment; import com.loopj.android.http.JsonHttpResponseHandler; import org.json.JSONException; import org.json.JSONObject; import java.util.concurrent.ExecutionException; import cz.msebera.android.httpclient.Header; import static com.loopj.android.http.AsyncHttpClient.log; public class TimelineActivity extends AppCompatActivity implements ComposeDialogueFragment.ComposeDialogueFragmentListener{ private Toolbar tlToolbar; private TwitterClient client; private String userProfileBannerUrl; private String userProfileBackgroundImageUrl; private String userProfileImageUrl; private String userPreferredName; private String userScreenName; private int userFollowerCount; private int userFollowingCount; private String userDescription; ComposeDialogueFragment composeDialogueFragment; private ImageView ivProfileImage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_timeline); //Toolbar // tlToolbar = (Toolbar) findViewById(R.id.toolbar) ; // setSupportActionBar(tlToolbar); //getSupportActionBar().setLogo(R.drawable.twitter); // getSupportActionBar().setDisplayUseLogoEnabled (true); //ViewPager // Get the ViewPager and set it's PagerAdapter so that it can display items ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager); viewPager.setAdapter(new TimelineFragmentAdapter(getSupportFragmentManager())); // Give the PagerSlidingTabStrip the ViewPager PagerSlidingTabStrip tabsStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs); // Attach the view pager to the tab strip tabsStrip.setViewPager(viewPager); // Attach the page change listener to tab strip and **not** the view pager insideivProfileImage. the activity tabsStrip.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { // This method will be invoked when a new page becomes selected. @Override public void onPageSelected(int position) { //Toast.makeText(TimelineActivity.this, // "Selected page position: " + position, Toast.LENGTH_SHORT).show(); } // This method will be invoked when the current page is scrolled @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { // Code goes here Log.d("DEBUG","onPageScrolled position:" +position); } // Called when the scroll state changes: // SCROLL_STATE_IDLE, SCROLL_STATE_DRAGGING, SCROLL_STATE_SETTLING @Override public void onPageScrollStateChanged(int state) { // Code goes here Log.d("DEBUG","onPageScrollStateChanged state:" +state); } }); ivProfileImage = (ImageView) findViewById(R.id.myProfile); populateUserProfile(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. //getMenuInflater().inflate(R.menu.menu_timeline, menu); //MenuItem composeItem = menu.findItem(R.id.action_compose); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); Log.d("DEBUG", "item.getItemId()="+ item.getItemId()); //noinspection SimplifiableIfStatement if (id == R.id.action_compose) { Log.d("DEBUG", " R.id.action_compose clicked"); showComposeDialog(); return true; } return super.onOptionsItemSelected(item); } private void populateUserProfile(){ TwitterApplication.getRestClient().verifyCredentials(new JsonHttpResponseHandler(){ //success @Override public void onSuccess(int statusCode, Header[] headers, JSONObject jsonObject) { //deserialize //create model //load into view Log.d("DEBUG",jsonObject.toString()); try { TimelineActivity.this.userProfileBannerUrl = jsonObject.getString("profile_banner_url"); TimelineActivity.this.userProfileBackgroundImageUrl = jsonObject.getString("profile_background_image_url"); TimelineActivity.this.userProfileImageUrl = jsonObject.getString("profile_image_url"); TimelineActivity.this.userPreferredName = jsonObject.getString("screen_name"); TimelineActivity.this.userScreenName =jsonObject.getString("name"); TimelineActivity.this.userDescription =jsonObject.getString("description"); TimelineActivity.this.userFollowerCount = jsonObject.getInt("followers_count"); //TimelineActivity.this.userFollowingCount = jsonObject.getInt("following"); } catch (JSONException e) { e.printStackTrace(); } String profileBackgroundImageUrl = TimelineActivity.this.userProfileBackgroundImageUrl; String profileImageUrl = TimelineActivity.this.userProfileImageUrl; String preferredName = TimelineActivity.this.userPreferredName; String screenName = TimelineActivity.this.userScreenName; int userFollowerCount = TimelineActivity.this.userFollowerCount; int userFollowingCount = TimelineActivity.this.userFollowingCount; String userProfileBannerUrl = TimelineActivity.this.userProfileBannerUrl; log.d("DEBUG", "userProfileBannerUrl="+ userProfileBannerUrl); Glide.with(TimelineActivity.this).load(userProfileBannerUrl).asBitmap().centerCrop().into(ivProfileImage); //new ProfileOperation().execute(userProfileBackgroundImageUrl); } //failure @Override public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { super.onFailure(statusCode, headers, throwable, errorResponse); Log.d("DEBUG",errorResponse.toString()); } }); } private void showComposeDialog(){ TwitterApplication.getRestClient().verifyCredentials(new JsonHttpResponseHandler(){ //success @Override public void onSuccess(int statusCode, Header[] headers, JSONObject jsonObject) { super.onSuccess(statusCode, headers, jsonObject); //deserialize //create model //load into view Log.d("DEBUG",jsonObject.toString()); try { TimelineActivity.this.userProfileBackgroundImageUrl = jsonObject.getString("profile_background_image_url"); TimelineActivity.this.userProfileImageUrl = jsonObject.getString("profile_image_url"); TimelineActivity.this.userPreferredName = jsonObject.getString("screen_name"); TimelineActivity.this.userScreenName =jsonObject.getString("name"); TimelineActivity.this.userFollowerCount = jsonObject.getInt("followers_count"); TimelineActivity.this.userFollowingCount = jsonObject.getInt("following"); } catch (JSONException e) { e.printStackTrace(); } String profileImageUrl = userProfileImageUrl; String preferredName = userPreferredName; String screenName = userScreenName; FragmentManager fm = getSupportFragmentManager(); //composeDialogueFragment = ComposeDialogueFragmentFactory.getInstance(); composeDialogueFragment = ComposeDialogueFragment.newInstance(profileImageUrl,preferredName,screenName); composeDialogueFragment.show(fm, "compose_fragment"); } //failure @Override public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { super.onFailure(statusCode, headers, throwable, errorResponse); Log.d("DEBUG",errorResponse.toString()); } }); } @Override public void onFinishCompose() { //tweetsListFragment.clear(); //populateTimeline(perRequestTweetCount,1L,1L); } public TwitterClient getClient() { return client; } public void composeButton(View v){ Log.d("DEBUG", "composeButton clicked"); showComposeDialog(); } public void launchProfilelView(){ // first parameter is the context, second is the class of the activity to launch Intent intent = new Intent(TimelineActivity.this, ProfileActivity.class); // put "extras" into the bundle for access in the second activity intent.putExtra("userProfileBannerUrl", userProfileBannerUrl); intent.putExtra("userProfileBackgroundImageUrl", userProfileBackgroundImageUrl); intent.putExtra("userProfileImageUrl", userProfileImageUrl); intent.putExtra("userPreferredName", userPreferredName); intent.putExtra("userScreenName", userScreenName); intent.putExtra("userFollowerCount", userFollowerCount); intent.putExtra("userFollowingCount", userFollowingCount); intent.putExtra("userDescription",userDescription); startActivityForResult(intent,20); } public void onClickProfileImage(View v){ Log.d("DEBUG", "composeButton clicked"); launchProfilelView(); } private class ProfileOperation extends AsyncTask<String, Void, Bitmap> { @Override protected Bitmap doInBackground(String... params) { String profileBackgroundImageUrl = params[0]; Log.d("DEBUG",profileBackgroundImageUrl); Bitmap theBitmap = null; try { theBitmap = Glide. with(TimelineActivity.this). load(profileBackgroundImageUrl). asBitmap(). into(100, 100). // Width and height get(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } return theBitmap; } @Override protected void onPostExecute(Bitmap result) { //ivFloatingProfileImageButton.setImageBitmap(createRoundedBitmapDrawableWithBorder(getResources(),result).getBitmap()); } @Override protected void onPreExecute() { } @Override protected void onProgressUpdate(Void... values) { } } public RoundedBitmapDrawable createRoundedBitmapDrawableWithBorder(Resources mResource, Bitmap bitmap){ int bitmapWidth = bitmap.getWidth(); int bitmapHeight = bitmap.getHeight(); int borderWidthHalf = 10; // In pixels //Toast.makeText(mContext,""+bitmapWidth+"|"+bitmapHeight,Toast.LENGTH_SHORT).show(); Log.d("DEBUG","bitmapWidth="+bitmapWidth); Log.d("DEBUG","bitmapHeight="+bitmapHeight); // Calculate the bitmap radius int bitmapRadius = Math.min(bitmapWidth,bitmapHeight)/2; int bitmapSquareWidth = Math.min(bitmapWidth,bitmapHeight); //Toast.makeText(mContext,""+bitmapMin,Toast.LENGTH_SHORT).show(); int newBitmapSquareWidth = bitmapSquareWidth+borderWidthHalf; //Toast.makeText(mContext,""+newBitmapMin,Toast.LENGTH_SHORT).show(); /* Initializing a new empty bitmap. Set the bitmap size from source bitmap Also add the border space to new bitmap */ Bitmap roundedBitmap = Bitmap.createBitmap(newBitmapSquareWidth,newBitmapSquareWidth,Bitmap.Config.ARGB_8888); /* Canvas The Canvas class holds the "draw" calls. To draw something, you need 4 basic components: A Bitmap to hold the pixels, a Canvas to host the draw calls (writing into the bitmap), a drawing primitive (e.g. Rect, Path, text, Bitmap), and a paint (to describe the colors and styles for the drawing). Canvas(Bitmap bitmap) Construct a canvas with the specified bitmap to draw into. */ // Initialize a new Canvas to draw empty bitmap Canvas canvas = new Canvas(roundedBitmap); /* drawColor(int color) Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, using srcover porterduff mode. */ // Draw a solid color to canvas canvas.drawColor(Color.RED); // Calculation to draw bitmap at the circular bitmap center position int x = borderWidthHalf + bitmapSquareWidth - bitmapWidth; int y = borderWidthHalf + bitmapSquareWidth - bitmapHeight; /* drawBitmap(Bitmap bitmap, float left, float top, Paint paint) Draw the specified bitmap, with its top/left corner at (x,y), using the specified paint, transformed by the current matrix. */ /* Now draw the bitmap to canvas. Bitmap will draw its center to circular bitmap center by keeping border spaces */ canvas.drawBitmap(bitmap, x, y, null); // Initializing a new Paint instance to draw circular border Paint borderPaint = new Paint(); borderPaint.setStyle(Paint.Style.STROKE); borderPaint.setStrokeWidth(borderWidthHalf*1); borderPaint.setColor(Color.DKGRAY); /* drawCircle(float cx, float cy, float radius, Paint paint) Draw the specified circle using the specified paint. */ /* Draw the circular border to bitmap. Draw the circle at the center of canvas. */ canvas.drawCircle(canvas.getWidth()/2, canvas.getWidth()/2, newBitmapSquareWidth/2, borderPaint); /* RoundedBitmapDrawable A Drawable that wraps a bitmap and can be drawn with rounded corners. You can create a RoundedBitmapDrawable from a file path, an input stream, or from a Bitmap object. */ /* public static RoundedBitmapDrawable create (Resources res, Bitmap bitmap) Returns a new drawable by creating it from a bitmap, setting initial target density based on the display metrics of the resources. */ /* RoundedBitmapDrawableFactory Constructs RoundedBitmapDrawable objects, either from Bitmaps directly, or from streams and files. */ // Create a new RoundedBitmapDrawable RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(mResource,roundedBitmap); /* setCornerRadius(float cornerRadius) Sets the corner radius to be applied when drawing the bitmap. */ // Set the corner radius of the bitmap drawable roundedBitmapDrawable.setCornerRadius(bitmapRadius); /* setAntiAlias(boolean aa) Enables or disables anti-aliasing for this drawable. */ roundedBitmapDrawable.setAntiAlias(true); // Return the RoundedBitmapDrawable return roundedBitmapDrawable; } }
41.272947
132
0.649031
f52f63b026d139460c90f89838a7931896934fcc
3,836
cc
C++
src/color_convert.cc
AndrewVebster/toggldesktop
57c0597ee315a624639dd67b553af9dbfdfd2c00
[ "BSD-3-Clause" ]
null
null
null
src/color_convert.cc
AndrewVebster/toggldesktop
57c0597ee315a624639dd67b553af9dbfdfd2c00
[ "BSD-3-Clause" ]
null
null
null
src/color_convert.cc
AndrewVebster/toggldesktop
57c0597ee315a624639dd67b553af9dbfdfd2c00
[ "BSD-3-Clause" ]
null
null
null
// // color_convert.cpp // TogglDesktopLibrary // // Created by Nghia Tran on 5/22/20. // Copyright © 2020 Toggl. All rights reserved. // #include "color_convert.h" #include <math.h> #include <sstream> #include <iomanip> #include <algorithm> namespace toggl { #define min_f(a, b, c) (fminf(a, fminf(b, c))) #define max_f(a, b, c) (fmaxf(a, fmaxf(b, c))) #define safe_range_f(value, min, max) (fmin(max, fmax(value, min))) HsvColor ColorConverter::GetAdaptiveColor(std::string hexColor, AdaptiveColor type) { RgbColor rbg = hexToRgb(hexColor); return GetAdaptiveColor(rbg, type); } HsvColor ColorConverter::GetAdaptiveColor(RgbColor rgbColor, AdaptiveColor type) { HsvColor hsvColor = rgbToHsv(rgbColor); return adjustColor(hsvColor, type); } RgbColor ColorConverter::GetRgbAdaptiveColor(std::string hexColor, AdaptiveColor type) { HsvColor hsv = GetAdaptiveColor(hexColor, type); return hsvToRgb(hsv); } HsvColor ColorConverter::adjustColor(HsvColor hsvColor, AdaptiveColor type) { switch (type) { case AdaptiveColorShapeOnLightBackground: return { hsvColor.h, hsvColor.s, hsvColor.v }; case AdaptiveColorTextOnLightBackground: return { hsvColor.h, hsvColor.s, safe_range_f(hsvColor.v - 0.15, 0.0f, 1.0f) }; case AdaptiveColorShapeOnDarkBackground: return { hsvColor.h, hsvColor.s * hsvColor.v, safe_range_f((hsvColor.v + 2.0) / 3.0, 0.0f, 1.0f) }; case AdaptiveColorTextOnDarkBackground: return { hsvColor.h, hsvColor.s * hsvColor.v, safe_range_f(0.05 + (hsvColor.v + 2.0) / 3.0, 0.0f, 1.0f) }; default: return hsvColor; } return hsvColor; } HsvColor ColorConverter::rgbToHsv(RgbColor rgbColor) { float r = rgbColor.r; float g = rgbColor.g; float b = rgbColor.b; float h, s, v; // h:0-360.0, s:0.0-1.0, v:0.0-1.0 float max = max_f(r, g, b); float min = min_f(r, g, b); v = max; if (max == 0.0f) { s = 0; h = 0; } else if (max - min == 0.0f) { s = 0; h = 0; } else { s = (max - min) / max; if (max == r) { h = 60 * ((g - b) / (max - min)) + 0; } else if (max == g) { h = 60 * ((b - r) / (max - min)) + 120; } else { h = 60 * ((r - g) / (max - min)) + 240; } } if (h < 0) h += 360.0f; return {h / 360.0, s, v}; // Range from 0..1 } RgbColor ColorConverter::hexToRgb(std::string hex) { // Convert to hex value std::istringstream converter(hex); unsigned int hexValue; converter >> std::hex >> hexValue; // Convert to rgb float r = ((hexValue >> 16) & 0xFF) / 255.0; float g = ((hexValue >> 8) & 0xFF) / 255.0; float b = ((hexValue) & 0xFF) / 255.0; return { r, g, b }; } RgbColor ColorConverter::hsvToRgb(HsvColor hsvColor) { double h = hsvColor.h; double s = hsvColor.s; double v = hsvColor.v; double r, g, b; int i = int(h * 6); double f = h * 6 - i; double p = v * (1 - s); double q = v * (1 - f * s); double t = v * (1 - (1 - f) * s); switch(i % 6) { case 0: { r = v; g = t; b = p; break; } case 1: { r = q; g = v; b = p; break; } case 2: { r = p; g = v; b = t; break; } case 3: { r = p; g = q; b = v; break; } case 4: { r = t; g = p; b = v; break; } case 5: { r = v; g = p; b = q; break; } } return { r , g, b }; } }
23.826087
118
0.504953
2db5c5c31dcd5e2af3c633fea53e3b32e813043c
1,199
sql
SQL
sql/patch_93_94_c.sql
avullo/ensembl
5c08d9089451b3ed8e39b5a5a3d2232acb09816c
[ "Apache-2.0" ]
null
null
null
sql/patch_93_94_c.sql
avullo/ensembl
5c08d9089451b3ed8e39b5a5a3d2232acb09816c
[ "Apache-2.0" ]
null
null
null
sql/patch_93_94_c.sql
avullo/ensembl
5c08d9089451b3ed8e39b5a5a3d2232acb09816c
[ "Apache-2.0" ]
null
null
null
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute -- Copyright [2016-2018] EMBL-European Bioinformatics Institute -- -- 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. # patch_93_94_c.sql # # Title: Default align_type is NULL # # Description: # Ensure default align_type in align_feature tables is 'ensembl' ALTER TABLE protein_feature MODIFY COLUMN align_type ENUM('ensembl', 'cigar', 'cigarplus', 'vulgar', 'mdtag') DEFAULT NULL; UPDATE protein_feature SET align_type = NULL WHERE align_type = ''; # patch identifier INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'patch', 'patch_93_94_c.sql|default_aln_type');
41.344828
123
0.761468
761d4b8414495b2f61da0fe1dece50484bd7e05d
1,647
go
Go
src/machine/board_nucleowl55jc.go
attriaayush/tinygo
3883550c446fc8b14115366284316290f3d3c4b1
[ "Apache-2.0" ]
1,562
2018-08-18T07:44:26.000Z
2019-01-31T16:10:39.000Z
src/machine/board_nucleowl55jc.go
attriaayush/tinygo
3883550c446fc8b14115366284316290f3d3c4b1
[ "Apache-2.0" ]
144
2018-08-18T13:03:25.000Z
2019-01-31T15:38:59.000Z
src/machine/board_nucleowl55jc.go
attriaayush/tinygo
3883550c446fc8b14115366284316290f3d3c4b1
[ "Apache-2.0" ]
61
2018-08-18T10:43:14.000Z
2019-01-28T22:43:30.000Z
//go:build nucleowl55jc // +build nucleowl55jc package machine import ( "device/stm32" "runtime/interrupt" ) const ( LED_BLUE = PB15 LED_GREEN = PB9 LED_RED = PB11 LED = LED_RED BTN1 = PA0 BTN2 = PA1 BTN3 = PC6 BUTTON = BTN1 // SubGhz (SPI3) SPI0_NSS_PIN = PA4 SPI0_SCK_PIN = PA5 SPI0_SDO_PIN = PA6 SPI0_SDI_PIN = PA7 //MCU USART1 UART1_TX_PIN = PB6 UART1_RX_PIN = PB7 //MCU USART2 UART2_RX_PIN = PA3 UART2_TX_PIN = PA2 // DEFAULT USART UART_RX_PIN = UART2_RX_PIN UART_TX_PIN = UART2_TX_PIN // I2C1 pins I2C1_SCL_PIN = PA9 I2C1_SDA_PIN = PA10 I2C1_ALT_FUNC = 4 // I2C2 pins I2C2_SCL_PIN = PA12 I2C2_SDA_PIN = PA11 I2C2_ALT_FUNC = 4 // I2C0 alias for I2C1 I2C0_SDA_PIN = I2C1_SDA_PIN I2C0_SCL_PIN = I2C1_SCL_PIN ) var ( // STM32 UART2 is connected to the embedded STLINKV3 Virtual Com Port UART0 = &_UART0 _UART0 = UART{ Buffer: NewRingBuffer(), Bus: stm32.USART2, TxAltFuncSelector: 7, RxAltFuncSelector: 7, } // UART1 is free UART1 = &_UART1 _UART1 = UART{ Buffer: NewRingBuffer(), Bus: stm32.USART1, TxAltFuncSelector: 7, RxAltFuncSelector: 7, } DefaultUART = UART0 // I2C Busses I2C1 = &I2C{ Bus: stm32.I2C1, AltFuncSelector: I2C1_ALT_FUNC, } I2C2 = &I2C{ Bus: stm32.I2C2, AltFuncSelector: I2C2_ALT_FUNC, } I2C0 = I2C1 // SPI SPI3 = SPI{ Bus: stm32.SPI3, } ) func init() { // Enable UARTs Interrupts UART0.Interrupt = interrupt.New(stm32.IRQ_USART2, _UART0.handleInterrupt) UART1.Interrupt = interrupt.New(stm32.IRQ_USART1, _UART1.handleInterrupt) }
16.806122
74
0.663631
fed6d973987ce57d90c2c39d6518a3f9919e480d
12,090
html
HTML
uni/shell/doc/Stream.icn.3.html
MatthewCLane/unicon
29f68fb05ae1ca33050adf1bd6890d03c6ff26ad
[ "BSD-2-Clause" ]
35
2019-11-29T13:19:55.000Z
2022-03-01T06:00:40.000Z
uni/shell/doc/Stream.icn.3.html
MatthewCLane/unicon
29f68fb05ae1ca33050adf1bd6890d03c6ff26ad
[ "BSD-2-Clause" ]
83
2019-11-03T20:07:12.000Z
2022-03-22T11:32:35.000Z
uni/shell/doc/Stream.icn.3.html
jschnet/unicon
df79234dc1b8a4972f3908f601329591c06bd141
[ "BSD-2-Clause" ]
16
2019-10-14T04:32:36.000Z
2022-03-01T06:01:00.000Z
<!-- Creator : groff version 1.18.1 --> <!-- CreationDate: Sat Oct 13 08:52:06 2007 --> <html> <head> <meta name="generator" content="groff -Thtml, see www.gnu.org"> <meta name="Content-Style" content="text/css"> <title>STREAM.ICN</title> </head> <body> <h1 align=center>STREAM.ICN</h1> <a href="#NAME">NAME</a><br> <a href="#SYNOPSIS">SYNOPSIS</a><br> <a href="#DESCRIPTION">DESCRIPTION</a><br> <a href="#RETURNS">RETURNS</a><br> <a href="#PORTABILITY">PORTABILITY</a><br> <a href="#SEE ALSO">SEE ALSO</a><br> <a href="#BUGS AND LIMITATIONS">BUGS AND LIMITATIONS</a><br> <a href="#AUTHOR">AUTHOR</a><br> <hr> <a name="NAME"></a> <h2>NAME</h2> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p><b>Stream</b>--Constructor for sequential access class wrappers for co-expressions, files, and lists</p> </td> </table> <a name="SYNOPSIS"></a> <h2>SYNOPSIS</h2> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <pre> # construct subclass of Stream_Abstract procedure <b>Stream( device, mode, other[ ] ) </b> # base class for StreamC, Streamf, StreamL class Stream_Abstract method <i>Close</i>( ) # &amp;fail method <i>Data</i>( ) # &amp;fail method <i>Flush</i>( ) # &amp;fail method <i>Get</i>( ) # &amp;fail method <i>Pull</i>( ) # &amp;fail method <i>Push</i>( ) # &amp;fail method <i>Put</i>( ) # &amp;fail method <i>Select</i>( ) # &amp;fail method <i>Type</i>( ) # &amp;fail # sequential access class for co-expression class StreamC : Stream_Abstract method <i>Close</i>( ) # null? method <i>Data</i>( ) # co-expression method <i>Flush</i>( ) # null method <i>Get</i>( value ) # any method <i>Put</i>( values[ ] ) # list? method <i>Select</i>( ) # null? method <i>Type</i>( ) # string # sequential access class for file class Streamf : Stream_Abstract method <i>Close</i>( ) # file|integer|null? method <i>Data</i>( ) # file|null method <i>Flush</i>( ) # file? method <i>Get</i>( ) # string? method <i>Put</i>( values[ ] ) # list? method <i>Select</i>( timeout ) # null? method <i>Type</i>( ) # string # sequential access class for list class StreamL : Stream_Abstract method <i>Close</i>( ) # null method <i>Data</i>( ) # list method <i>Flush</i>( ) # null method <i>Get</i>( ) # any? method <i>Pull</i>( ) # any? method <i>Push</i>( values[ ] ) # list? method <i>Put</i>( values[ ] ) # list? method <i>Select</i>( ) # integer? method <i>Type</i>( ) # string </pre> </td> </table> <a name="DESCRIPTION"></a> <h2>DESCRIPTION</h2> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p>For an extended introduction to <b>Stream.icn</b> and ideas about how to apply it, please see [Eschenlauer, 2006].</p> </td> </table> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="4%"></td> <td width="95%"> <p><b>Constructor (Factory)</b></p></td> </table> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p>The <b>Stream( )</b> procedure constructs instances of the <i>StreamC</i>, <i>Streamf</i>, and <i>StreamL</i> classes to provide a common interface to exchange data with co&minus;expressions, files, and lists, respectively.</p> <!-- INDENTATION --> <p>The &quot;returns&quot; section below explains how the arguments determine the class of the object produced.</p> </td> </table> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="4%"></td> <td width="95%"> <p><b>Interface</b></p></td> </table> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p>The <i>StreamC</i>, <i>Streamf</i>, and <i>StreamL</i> classes all implement the following methods:</p> </td> </table> <!-- TABS --> <table width="100%" border=0 rules="none" frame="void" cols="4" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Close</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Closes f, cofails C, or replaces L with an empty list.</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Data</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Produces the list, file, or co-expression managed by <i>StreamC</i>, <i>Streamf</i>, and <i>StreamL</i>.</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Flush</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Produces result of flush(f), or &amp;null.</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Get</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Produces a value; can transmit a value to C</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Pull</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Produces a value (for <i>StreamL</i> only)</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Push</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Produces a list as long as number of args (for <i>StreamL</i> only)</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Put</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Produces a list as long as number of args</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Select</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Produces &amp;null if Get may produce a value</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="8%"> <p><i>Type</i></p> </td> <td width="1%"></td> <td width="77%"> <p>Produces &quot;list&quot; | &quot;file&quot; | &quot;co-expression&quot;</p> </td> </table> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="4%"></td> <td width="95%"> <p><b>Activation of Producers and Consumers</b></p></td> </table> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p>When a producer coexpression uses <i>StreamC</i> object to transmit values to a consumer coexpression that receives them using another <i>StreamC</i> object, the values transmitted will be the same regardless of whether the producer or the consumer was activated first.</p> </td> </table> <a name="RETURNS"></a> <h2>RETURNS</h2> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p>The class produced by the constructor function Stream( ) depends on the arguments supplied:</p> </td> </table> <!-- TABS --> <table width="100%" border=0 rules="none" frame="void" cols="4" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="13%"></td> <td width="25%"> <p><b>Stream(C,&quot;r&quot;|&quot;w&quot;)</b></p> </td> <td width="1%"></td> <td width="60%"> <p>produces an instance of <i>StreamC</i> encapsulating co-expression <i>C</i>.</p> </td> </table> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="39%"></td> <td width="60%"> <p>Note that under <b>shell.icn( 1 )</b>:<br> &minus; A producer task should use the &quot;w&quot; filemode when creating a <i>StreamC</i> instance to manage communication with a consumer task.<br> &minus; A consumer task should use the &quot;r&quot; filemode to when creating a <i>StreamC</i> instance to communicate with a producer task.<br> &minus; A client task should use the &quot;w&quot; filemode when creating a <i>StreamC</i> instance to manage communication with a service task.</p> </td> </table> <!-- TABS --> <table width="100%" border=0 rules="none" frame="void" cols="4" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="11%"></td> <td width="26%"> <p><b>Stream(f)</b></p> </td> <td width="1%"></td> <td width="60%"> <p>produces an instance of <i>Streamf</i> encapsulating file <i>f</i></p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="26%"> <p><b>Stream(s,args[ ])</b></p> </td> <td width="1%"></td> <td width="60%"> <p>produces an instance of <i>Streamf</i> where <i>[s] ||| args</i> is the argument list passed to the open( ) function</p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="26%"> <p><b>Stream(L)</b></p> </td> <td width="1%"></td> <td width="60%"> <p>produces an instance of <i>StreamL</i> encapsulating list <i>L</i></p> </td> <tr valign="top" align="left"> <td width="11%"></td> <td width="26%"> <p><b>Stream(StreamL)</b></p> </td> <td width="1%"></td> <td width="60%"> <p>produces an instance of <i>StreamL</i> encapsulating the list encapsulated by the <i>StreamL</i>-typed argument</p> </td> </table> <a name="PORTABILITY"></a> <h2>PORTABILITY</h2> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p><b>Stream.icn</b> is compatible with Unicon but not Icon since Icon does not support classes. Stream.icn is not Idol-compatible.</p> </td> </table> <a name="SEE ALSO"></a> <h2>SEE ALSO</h2> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p>Eschenlauer, Arthur C., 2006. &quot;A Unicon Shell&quot;, <i>The Generator</i>, Vol. 2, No. 2, pp 3-32.</p> <!-- INDENTATION --> <pre> http://www.unicon.org/generator/v2n2.pdf </pre> <!-- INDENTATION --> <p><b>shell.icn( 1 )</b></p> </td> </table> <a name="BUGS AND LIMITATIONS"></a> <h2>BUGS AND LIMITATIONS</h2> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p>Streamf has been extensively tested only with disk files; databases, network connections, etc., have not been tested much if at all.</p> </td> </table> <a name="AUTHOR"></a> <h2>AUTHOR</h2> <!-- INDENTATION --> <table width="100%" border=0 rules="none" frame="void" cols="2" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="89%"> <p>Art Eschenlauer</p> <!-- INDENTATION --> <p><b>Stream.icn</b> is in the public domain. The freedom of its content is protected by the Lesser GNU public license, version 2.1, February 1999,</p> <!-- INDENTATION --> <pre> http://www.gnu.org/licenses/lgpl.html </pre> <!-- INDENTATION --> <p>which means you are granted permission to use this in any way that does not limit others&rsquo; freedom to use it.</p> </td> </table> <hr> </body> </html>
27.477273
63
0.604218
23ddb5407515c32446cc881345f5b9d433fb9b84
566
swift
Swift
Tests/ListModelTests/ListModelTests.swift
buscarini/ListModel
0cddbcc0a0c92a9ad909c42216533cf370ee3c2b
[ "MIT" ]
1
2020-02-12T09:36:02.000Z
2020-02-12T09:36:02.000Z
Tests/ListModelTests/ListModelTests.swift
buscarini/ListModel
0cddbcc0a0c92a9ad909c42216533cf370ee3c2b
[ "MIT" ]
null
null
null
Tests/ListModelTests/ListModelTests.swift
buscarini/ListModel
0cddbcc0a0c92a9ad909c42216533cf370ee3c2b
[ "MIT" ]
null
null
null
// // ListModelTests.swift // ListModel // // Created by José Manuel Sánchez on 07/12/2018. // Copyright © 2018 ListModel. All rights reserved. // import Foundation import XCTest import ListModel class ListModelTests: XCTestCase { func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. //// XCTAssertEqual(ListModel().text, "Hello, World!") } static var allTests = [ ("testExample", testExample), ] }
23.583333
96
0.660777
529b1992f37ebaa1bff65f1856c61f2f54bb80f3
149
kt
Kotlin
app/src/main/java/com/givekesh/raters/di/scopes/BindingAdaptersScope.kt
jinxul/Raters
4d913ff52171f96c9b29d681e14631346bf32135
[ "Apache-2.0" ]
1
2020-11-20T00:15:41.000Z
2020-11-20T00:15:41.000Z
app/src/main/java/com/givekesh/raters/di/scopes/BindingAdaptersScope.kt
jinxul/Raters
4d913ff52171f96c9b29d681e14631346bf32135
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/givekesh/raters/di/scopes/BindingAdaptersScope.kt
jinxul/Raters
4d913ff52171f96c9b29d681e14631346bf32135
[ "Apache-2.0" ]
null
null
null
package com.givekesh.raters.di.scopes import javax.inject.Scope @Scope @Retention(AnnotationRetention.BINARY) annotation class BindingAdaptersScope
21.285714
38
0.85906
0bbd016623043406efa8543582a60fa06f965982
1,414
html
HTML
Generated/index/System.Management.Automation/R/3188cfc5e2c3bc36.html
Alex-ABPerson/PSSourceBrowser
dc7389c4cb47f00dbfffb04fc1905e2fc935110f
[ "Apache-2.0" ]
null
null
null
Generated/index/System.Management.Automation/R/3188cfc5e2c3bc36.html
Alex-ABPerson/PSSourceBrowser
dc7389c4cb47f00dbfffb04fc1905e2fc935110f
[ "Apache-2.0" ]
null
null
null
Generated/index/System.Management.Automation/R/3188cfc5e2c3bc36.html
Alex-ABPerson/PSSourceBrowser
dc7389c4cb47f00dbfffb04fc1905e2fc935110f
[ "Apache-2.0" ]
null
null
null
<!DOCTYPE html> <html><head><title>_addToHistory</title><link rel="stylesheet" href="../../styles.css"/><script src="../../scripts.js"></script></head><body onload="ro();"> <div class="rH">2 writes to _addToHistory</div><div class="rA">System.Management.Automation (2)</div><div class="rG" id="System.Management.Automation"><div class="rF"><div class="rN">engine\remoting\client\remotepipeline.cs (2)</div> <a href="../engine/remoting/client/remotepipeline.cs.html#74"><b>74</b><i>_addToHistory</i> = addToHistory;</a> <a href="../engine/remoting/client/remotepipeline.cs.html#186"><b>186</b><i>_addToHistory</i> = pipeline._addToHistory;</a> </div> </div> <div class="rH">4 references to _addToHistory</div><div class="rA">System.Management.Automation (4)</div><div class="rG" id="System.Management.Automation"><div class="rF"><div class="rN">engine\remoting\client\remotepipeline.cs (4)</div> <a href="../engine/remoting/client/remotepipeline.cs.html#186"><b>186</b>_addToHistory = pipeline.<i>_addToHistory</i>;</a> <a href="../engine/remoting/client/remotepipeline.cs.html#356"><b>356</b>return <i>_addToHistory</i>;</a> <a href="../engine/remoting/client/remotepipeline.cs.html#894"><b>894</b>settings.AddToHistory = <i>_addToHistory</i>;</a> <a href="../engine/remoting/client/remotepipeline.cs.html#931"><b>931</b>settings.AddToHistory = <i>_addToHistory</i>;</a> </div> </div> </body></html>
94.266667
238
0.70297
75bc6ccb33d82c1bd769be5dc6280a0ae0029459
2,964
cs
C#
Services/ConfigurationsService.cs
xPanini/Bubblim.Core
4d0818bbcb9a4d9f6190a627054008748719e9fd
[ "MIT" ]
2
2019-09-19T21:22:48.000Z
2020-11-20T19:48:34.000Z
Services/ConfigurationsService.cs
Everni/Bubblim.Core
4d0818bbcb9a4d9f6190a627054008748719e9fd
[ "MIT" ]
null
null
null
Services/ConfigurationsService.cs
Everni/Bubblim.Core
4d0818bbcb9a4d9f6190a627054008748719e9fd
[ "MIT" ]
null
null
null
using Bubblim.Core.Common; using System; using System.Collections.Generic; using System.Reflection; using System.Linq; using System.Text; using Discord; using Discord.Commands; using System.Threading.Tasks; namespace Bubblim.Core.Services { public class ConfigurationsService { public List<StoredConfig> configs; public ConfigurationsService() { configs = new List<StoredConfig>(); foreach(Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) { var OnLoadConfigAssemblies = asm.GetTypes() .Where(type => !type.IsInterface && !type.IsAbstract) .Where(type => typeof(IConfigurationBase).IsAssignableFrom(type)) .Where(type => type.GetCustomAttribute<OnLoadConfiguration>() != null); if(OnLoadConfigAssemblies.Count() > 0) { foreach(Type type in OnLoadConfigAssemblies) { // Get the constructor and create an instance of Config ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes); IConfigurationBase config = constructor.Invoke(new object[] { }) as IConfigurationBase; configs.Add(new StoredConfig { Namespace = type.Namespace, Name = type.Name, Config = config }); } } } LoadConfigs(); } public void LoadConfigs() { foreach (StoredConfig data in configs) { data.Config.GetOrCreateConfiguration(); PrettyPrint.Log(LogSeverity.Info, "ConfigurationService", $"{data.Namespace} {data.Name} - Config loaded."); } } public bool LoadConfig(string name) { var dataSet = configs.Where(data => data.Name == name); if(dataSet.Count() == 1) { var data = dataSet.First(); data.Config.GetOrCreateConfiguration(); PrettyPrint.Log(LogSeverity.Info, "ConfigurationService", $"{data.Namespace} {data.Name} - Config loaded."); return true; } else if(dataSet.Count() > 1) { PrettyPrint.Log(LogSeverity.Error, "ConfigurationService", $"More than one config found. No config loaded."); return false; } else { PrettyPrint.Log(LogSeverity.Error, "ConfigurationService", $"No config found."); return false; } } public class StoredConfig { public string Namespace; public string Name; public IConfigurationBase Config; } } }
34.465116
125
0.523617
9c778aa94bbafe7bbf4f2ac0efa18820b6b587f3
155
cpp
C++
src/common/exceptions/ListenerNotFoundException.cpp
smartdu/kafkaclient-cpp
03d108808a50a13d7a26e63461a1ac27c5bc141c
[ "Apache-2.0" ]
5
2019-04-29T11:09:55.000Z
2019-11-28T02:53:59.000Z
src/common/exceptions/ListenerNotFoundException.cpp
smartdu/kafkaclient-cpp
03d108808a50a13d7a26e63461a1ac27c5bc141c
[ "Apache-2.0" ]
2
2019-05-10T09:37:49.000Z
2019-05-14T02:40:16.000Z
src/common/exceptions/ListenerNotFoundException.cpp
smartdu/kafkaclient-cpp
03d108808a50a13d7a26e63461a1ac27c5bc141c
[ "Apache-2.0" ]
1
2019-05-10T10:07:50.000Z
2019-05-10T10:07:50.000Z
#include "ListenerNotFoundException.h" ListenerNotFoundException::ListenerNotFoundException(std::string message) : ApiException(message.c_str()) { }
19.375
73
0.793548
6cace3db3660579ff5375e79f3070b63d6805aef
321
kt
Kotlin
app/src/main/java/fi/exa/cthulhuhelpper/persistence/TokenTypeConverter.kt
Exaltead/arkham-horror-helpper
557e9ff31bc3f65f95b0215bbd56e1a54e87b1f8
[ "MIT" ]
null
null
null
app/src/main/java/fi/exa/cthulhuhelpper/persistence/TokenTypeConverter.kt
Exaltead/arkham-horror-helpper
557e9ff31bc3f65f95b0215bbd56e1a54e87b1f8
[ "MIT" ]
null
null
null
app/src/main/java/fi/exa/cthulhuhelpper/persistence/TokenTypeConverter.kt
Exaltead/arkham-horror-helpper
557e9ff31bc3f65f95b0215bbd56e1a54e87b1f8
[ "MIT" ]
null
null
null
package fi.exa.cthulhuhelpper.persistence import androidx.room.TypeConverter import fi.exa.cthulhuhelpper.model.CthulhuToken class TokenTypeConverter { @TypeConverter fun tokenToString(token: CthulhuToken) = token.name @TypeConverter fun stringToToken(string: String) = CthulhuToken.valueOf(string) }
22.928571
68
0.791277
841f93cdc4d9a2b2b7573aa825b08e58adebdb30
93
sql
SQL
src/test/resources/sql/insert/1c0e4a9f.sql
Shuttl-Tech/antlr_psql
fcf83192300abe723f3fd3709aff5b0c8118ad12
[ "MIT" ]
66
2018-06-15T11:34:03.000Z
2022-03-16T09:24:49.000Z
src/test/resources/sql/insert/1c0e4a9f.sql
Shuttl-Tech/antlr_psql
fcf83192300abe723f3fd3709aff5b0c8118ad12
[ "MIT" ]
13
2019-03-19T11:56:28.000Z
2020-08-05T04:20:50.000Z
src/test/resources/sql/insert/1c0e4a9f.sql
Shuttl-Tech/antlr_psql
fcf83192300abe723f3fd3709aff5b0c8118ad12
[ "MIT" ]
28
2019-01-05T19:59:02.000Z
2022-03-24T11:55:50.000Z
-- file:create_table_like.sql ln:50 expect:true INSERT INTO test_like_id_3 (b) VALUES ('b3')
31
47
0.763441
31500a34dab777016068b7ea798896789b720d0e
85
sql
SQL
data/covid-database/update/98-update-log-end-update.sql
TISTATechnologies/cv19
5200d20d51ee9e0f4f8cc6f0af0267a3670398ed
[ "Apache-2.0" ]
2
2020-10-20T12:05:16.000Z
2021-09-21T13:10:17.000Z
data/covid-database/update/98-update-log-end-update.sql
TISTATechnologies/cv19
5200d20d51ee9e0f4f8cc6f0af0267a3670398ed
[ "Apache-2.0" ]
10
2020-07-01T16:40:39.000Z
2022-01-19T21:37:47.000Z
data/covid-database/update/98-update-log-end-update.sql
TISTATechnologies/cv19
5200d20d51ee9e0f4f8cc6f0af0267a3670398ed
[ "Apache-2.0" ]
1
2021-08-09T13:53:50.000Z
2021-08-09T13:53:50.000Z
INSERT INTO _log(message) SELECT concat('Database "', CURRENT_SCHEMA(), '" updated');
85
85
0.729412
39dfe0ffeb40bd903b35ba7adac699763f678b5a
1,727
java
Java
framework/src/main/java/helix/toolkit/streams/StreamUtils.java
tadejgasparovic/helix
89e571624d2cff20b6bd1f141d260966c8bdfca5
[ "MIT" ]
2
2018-12-25T12:01:47.000Z
2020-09-21T22:15:41.000Z
framework/src/main/java/helix/toolkit/streams/StreamUtils.java
tadejgasparovic/helix
89e571624d2cff20b6bd1f141d260966c8bdfca5
[ "MIT" ]
3
2019-02-05T07:55:27.000Z
2019-02-09T18:03:27.000Z
framework/src/main/java/helix/toolkit/streams/StreamUtils.java
tadejgasparovic/helix
89e571624d2cff20b6bd1f141d260966c8bdfca5
[ "MIT" ]
1
2019-01-10T23:49:42.000Z
2019-01-10T23:49:42.000Z
package helix.toolkit.streams; import java.io.IOException; import java.io.InputStream; public class StreamUtils { /** * Reads a line from the input stream using \r\n as the delimiter * @param inputStream Input stream to read from * @return Line read from the input stream * @throws IOException If the read fails * **/ public static String readLine(InputStream inputStream) throws IOException { return readLine(inputStream, "\r\n"); } /** * Reads a line from the input stream * @param inputStream Input stream to read from * @param delim Delimiter string separating lines * @return Line read from the input stream * @throws IOException If the read fails * **/ public static String readLine(InputStream inputStream, String delim) throws IOException { StringBuilder stringBuilder = new StringBuilder(); int read; int delimIdx = 0; StringBuilder partialDelimBuffer = new StringBuilder(); while((read = inputStream.read()) > -1 && delimIdx < delim.length() - 1) { if(read == delim.charAt(delimIdx)) { delimIdx++; partialDelimBuffer.append((char) read); } else { if(partialDelimBuffer.length() > 0) { stringBuilder.append(partialDelimBuffer); partialDelimBuffer = new StringBuilder(); } delimIdx = 0; stringBuilder.append((char) read); } } if(read < 0 && stringBuilder.length() < 1) return null; return stringBuilder.toString(); } }
28.783333
91
0.57846
c52e420a8942d82b1458cb98e140ed9b91a1d6be
15,216
cpp
C++
Development/Src/WinDrv/Src/WinClient.cpp
addstone/unrealengine3
4579d360dfd52b12493292120b27bb430f978fc8
[ "FSFAP" ]
37
2020-05-22T18:18:47.000Z
2022-03-19T06:51:54.000Z
Development/Src/WinDrv/Src/WinClient.cpp
AdanosGotoman/unrealengine3
4579d360dfd52b12493292120b27bb430f978fc8
[ "FSFAP" ]
null
null
null
Development/Src/WinDrv/Src/WinClient.cpp
AdanosGotoman/unrealengine3
4579d360dfd52b12493292120b27bb430f978fc8
[ "FSFAP" ]
27
2020-05-17T01:03:30.000Z
2022-03-06T19:10:14.000Z
/*============================================================================= WinClient.cpp: UWindowsClient code. Copyright 1997-2004 Epic Games, Inc. All Rights Reserved. Revision history: * Created by Tim Sweeney * Rewritten by Andrew Scheidecker and Daniel Vogel =============================================================================*/ #include "WinDrv.h" #include "..\..\Launch\Resources\resource.h" /*----------------------------------------------------------------------------- Class implementation. -----------------------------------------------------------------------------*/ IMPLEMENT_CLASS(UWindowsClient); /*----------------------------------------------------------------------------- UWindowsClient implementation. -----------------------------------------------------------------------------*/ // // UWindowsClient constructor. // UWindowsClient::UWindowsClient() { KeyMapVirtualToName.Set(VK_LBUTTON,KEY_LeftMouseButton); KeyMapVirtualToName.Set(VK_RBUTTON,KEY_RightMouseButton); KeyMapVirtualToName.Set(VK_MBUTTON,KEY_MiddleMouseButton); KeyMapVirtualToName.Set(VK_BACK,KEY_BackSpace); KeyMapVirtualToName.Set(VK_TAB,KEY_Tab); KeyMapVirtualToName.Set(VK_RETURN,KEY_Enter); KeyMapVirtualToName.Set(VK_PAUSE,KEY_Pause); KeyMapVirtualToName.Set(VK_CAPITAL,KEY_CapsLock); KeyMapVirtualToName.Set(VK_ESCAPE,KEY_Escape); KeyMapVirtualToName.Set(VK_SPACE,KEY_SpaceBar); KeyMapVirtualToName.Set(VK_PRIOR,KEY_PageUp); KeyMapVirtualToName.Set(VK_NEXT,KEY_PageDown); KeyMapVirtualToName.Set(VK_END,KEY_End); KeyMapVirtualToName.Set(VK_HOME,KEY_Home); KeyMapVirtualToName.Set(VK_LEFT,KEY_Left); KeyMapVirtualToName.Set(VK_UP,KEY_Up); KeyMapVirtualToName.Set(VK_RIGHT,KEY_Right); KeyMapVirtualToName.Set(VK_DOWN,KEY_Down); KeyMapVirtualToName.Set(VK_INSERT,KEY_Insert); KeyMapVirtualToName.Set(VK_DELETE,KEY_Delete); KeyMapVirtualToName.Set(0x30,KEY_Zero); KeyMapVirtualToName.Set(0x31,KEY_One); KeyMapVirtualToName.Set(0x32,KEY_Two); KeyMapVirtualToName.Set(0x33,KEY_Three); KeyMapVirtualToName.Set(0x34,KEY_Four); KeyMapVirtualToName.Set(0x35,KEY_Five); KeyMapVirtualToName.Set(0x36,KEY_Six); KeyMapVirtualToName.Set(0x37,KEY_Seven); KeyMapVirtualToName.Set(0x38,KEY_Eight); KeyMapVirtualToName.Set(0x39,KEY_Nine); KeyMapVirtualToName.Set(0x41,KEY_A); KeyMapVirtualToName.Set(0x42,KEY_B); KeyMapVirtualToName.Set(0x43,KEY_C); KeyMapVirtualToName.Set(0x44,KEY_D); KeyMapVirtualToName.Set(0x45,KEY_E); KeyMapVirtualToName.Set(0x46,KEY_F); KeyMapVirtualToName.Set(0x47,KEY_G); KeyMapVirtualToName.Set(0x48,KEY_H); KeyMapVirtualToName.Set(0x49,KEY_I); KeyMapVirtualToName.Set(0x4A,KEY_J); KeyMapVirtualToName.Set(0x4B,KEY_K); KeyMapVirtualToName.Set(0x4C,KEY_L); KeyMapVirtualToName.Set(0x4D,KEY_M); KeyMapVirtualToName.Set(0x4E,KEY_N); KeyMapVirtualToName.Set(0x4F,KEY_O); KeyMapVirtualToName.Set(0x50,KEY_P); KeyMapVirtualToName.Set(0x51,KEY_Q); KeyMapVirtualToName.Set(0x52,KEY_R); KeyMapVirtualToName.Set(0x53,KEY_S); KeyMapVirtualToName.Set(0x54,KEY_T); KeyMapVirtualToName.Set(0x55,KEY_U); KeyMapVirtualToName.Set(0x56,KEY_V); KeyMapVirtualToName.Set(0x57,KEY_W); KeyMapVirtualToName.Set(0x58,KEY_X); KeyMapVirtualToName.Set(0x59,KEY_Y); KeyMapVirtualToName.Set(0x5A,KEY_Z); KeyMapVirtualToName.Set(VK_NUMPAD0,KEY_NumPadZero); KeyMapVirtualToName.Set(VK_NUMPAD1,KEY_NumPadOne); KeyMapVirtualToName.Set(VK_NUMPAD2,KEY_NumPadTwo); KeyMapVirtualToName.Set(VK_NUMPAD3,KEY_NumPadThree); KeyMapVirtualToName.Set(VK_NUMPAD4,KEY_NumPadFour); KeyMapVirtualToName.Set(VK_NUMPAD5,KEY_NumPadFive); KeyMapVirtualToName.Set(VK_NUMPAD6,KEY_NumPadSix); KeyMapVirtualToName.Set(VK_NUMPAD7,KEY_NumPadSeven); KeyMapVirtualToName.Set(VK_NUMPAD8,KEY_NumPadEight); KeyMapVirtualToName.Set(VK_NUMPAD9,KEY_NumPadNine); KeyMapVirtualToName.Set(VK_MULTIPLY,KEY_Multiply); KeyMapVirtualToName.Set(VK_ADD,KEY_Add); KeyMapVirtualToName.Set(VK_SUBTRACT,KEY_Subtract); KeyMapVirtualToName.Set(VK_DECIMAL,KEY_Decimal); KeyMapVirtualToName.Set(VK_DIVIDE,KEY_Divide); KeyMapVirtualToName.Set(VK_F1,KEY_F1); KeyMapVirtualToName.Set(VK_F2,KEY_F2); KeyMapVirtualToName.Set(VK_F3,KEY_F3); KeyMapVirtualToName.Set(VK_F4,KEY_F4); KeyMapVirtualToName.Set(VK_F5,KEY_F5); KeyMapVirtualToName.Set(VK_F6,KEY_F6); KeyMapVirtualToName.Set(VK_F7,KEY_F7); KeyMapVirtualToName.Set(VK_F8,KEY_F8); KeyMapVirtualToName.Set(VK_F9,KEY_F9); KeyMapVirtualToName.Set(VK_F10,KEY_F10); KeyMapVirtualToName.Set(VK_F11,KEY_F11); KeyMapVirtualToName.Set(VK_F12,KEY_F12); KeyMapVirtualToName.Set(VK_NUMLOCK,KEY_NumLock); KeyMapVirtualToName.Set(VK_SCROLL,KEY_ScrollLock); KeyMapVirtualToName.Set(VK_LSHIFT,KEY_LeftShift); KeyMapVirtualToName.Set(VK_RSHIFT,KEY_RightShift); KeyMapVirtualToName.Set(VK_LCONTROL,KEY_LeftControl); KeyMapVirtualToName.Set(VK_RCONTROL,KEY_RightControl); KeyMapVirtualToName.Set(VK_LMENU,KEY_LeftAlt); KeyMapVirtualToName.Set(VK_RMENU,KEY_RightAlt); KeyMapVirtualToName.Set(VK_OEM_1,KEY_Semicolon); KeyMapVirtualToName.Set(VK_OEM_PLUS,KEY_Equals); KeyMapVirtualToName.Set(VK_OEM_COMMA,KEY_Comma); KeyMapVirtualToName.Set(VK_OEM_MINUS,KEY_Underscore); KeyMapVirtualToName.Set(VK_OEM_PERIOD,KEY_Period); KeyMapVirtualToName.Set(VK_OEM_2,KEY_Slash); KeyMapVirtualToName.Set(VK_OEM_3,KEY_Tilde); KeyMapVirtualToName.Set(VK_OEM_4,KEY_LeftBracket); KeyMapVirtualToName.Set(VK_OEM_5,KEY_Backslash); KeyMapVirtualToName.Set(VK_OEM_6,KEY_RightBracket); KeyMapVirtualToName.Set(VK_OEM_7,KEY_Quote); for(UINT KeyIndex = 0;KeyIndex < 256;KeyIndex++) if(KeyMapVirtualToName.Find(KeyIndex)) KeyMapNameToVirtual.Set(KeyMapVirtualToName.FindRef(KeyIndex),KeyIndex); AudioDevice = NULL; RenderDevice = NULL; ProcessWindowsMessages = 1; } // // Static init. // void UWindowsClient::StaticConstructor() { new(GetClass(),TEXT("RenderDeviceClass"),RF_Public)UClassProperty(CPP_PROPERTY(RenderDeviceClass) ,TEXT("Display"),CPF_Config,URenderDevice::StaticClass()); new(GetClass(),TEXT("AudioDeviceClass") ,RF_Public)UClassProperty(CPP_PROPERTY(AudioDeviceClass) ,TEXT("Audio") ,CPF_Config,UAudioDevice::StaticClass()); } // // Initialize the platform-specific viewport manager subsystem. // Must be called after the Unreal object manager has been initialized. // Must be called before any viewports are created. // BOOL CALLBACK EnumJoysticksCallback( LPCDIDEVICEINSTANCE Instance, LPVOID Context ); BOOL CALLBACK EnumAxesCallback( LPCDIDEVICEOBJECTINSTANCE Instance, LPVOID Context ); /** Resource ID of icon to use for Window */ extern INT GGameIcon; void UWindowsClient::Init( UEngine* InEngine ) { Engine = InEngine; // Register windows class. WindowClassName = FString(GPackage) + TEXT("Unreal") + TEXT("UWindowsClient"); #if UNICODE if( GUnicodeOS ) { WNDCLASSEXW Cls; appMemzero( &Cls, sizeof(Cls) ); Cls.cbSize = sizeof(Cls); Cls.style = GIsEditor ? (CS_DBLCLKS|CS_OWNDC) : (CS_OWNDC); Cls.lpfnWndProc = StaticWndProc; Cls.hInstance = hInstance; Cls.hIcon = LoadIconIdX(hInstance,GGameIcon); Cls.lpszClassName = *WindowClassName; Cls.hIconSm = LoadIconIdX(hInstance,GGameIcon); verify(RegisterClassExW( &Cls )); } else #endif { WNDCLASSEXA Cls; appMemzero( &Cls, sizeof(Cls) ); Cls.cbSize = sizeof(Cls); Cls.style = GIsEditor ? (CS_DBLCLKS|CS_OWNDC): (CS_OWNDC); Cls.lpfnWndProc = StaticWndProc; Cls.hInstance = hInstance; Cls.hIcon = LoadIconIdX(hInstance,GGameIcon); Cls.lpszClassName = TCHAR_TO_ANSI(*WindowClassName); Cls.hIconSm = LoadIconIdX(hInstance,GGameIcon); verify(RegisterClassExA( &Cls )); } // Initialize the render device. RenderDevice = CastChecked<URenderDevice>(StaticConstructObject(RenderDeviceClass)); RenderDevice->Init(); // Initialize the audio device. if( GEngine->UseSound ) { AudioDevice = CastChecked<UAudioDevice>(StaticConstructObject(AudioDeviceClass)); if( !AudioDevice->Init() ) { delete AudioDevice; AudioDevice = NULL; } } // Initialize shared DirectInput mouse interface. verify( SUCCEEDED( DirectInput8Create( hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&DirectInput8, NULL ) ) ); verify( SUCCEEDED( DirectInput8->CreateDevice( GUID_SysMouse, &DirectInput8Mouse, NULL ) ) ); verify( SUCCEEDED( DirectInput8Mouse->SetDataFormat(&c_dfDIMouse) ) ); DIPROPDWORD Property; Property.diph.dwSize = sizeof(DIPROPDWORD); Property.diph.dwHeaderSize = sizeof(DIPROPHEADER); Property.diph.dwObj = 0; Property.diph.dwHow = DIPH_DEVICE; Property.dwData = 1023; // buffer size verify( SUCCEEDED( DirectInput8Mouse->SetProperty(DIPROP_BUFFERSIZE,&Property.diph) ) ); Property.dwData = DIPROPAXISMODE_REL; verify( SUCCEEDED( DirectInput8Mouse->SetProperty(DIPROP_AXISMODE,&Property.diph) ) ); #ifdef EMULATE_CONSOLE_CONTROLLER JoystickType = JOYSTICK_None; HRESULT hr; if( SUCCEEDED( hr = DirectInput8->EnumDevices( DI8DEVCLASS_GAMECTRL, EnumJoysticksCallback, NULL, DIEDFL_ATTACHEDONLY )) && DirectInput8Joystick ) { DIDEVCAPS JoystickCaps; JoystickCaps.dwSize = sizeof(JoystickCaps); verify( SUCCEEDED( DirectInput8Joystick->SetDataFormat( &c_dfDIJoystick2 ) ) ); verify( SUCCEEDED( DirectInput8Joystick->GetCapabilities( &JoystickCaps ) ) ); verify( SUCCEEDED( DirectInput8Joystick->EnumObjects( EnumAxesCallback, NULL, DIDFT_AXIS ) ) ); JoystickType = JOYSTICK_None; // Xbox Type S controller with old drivers. if( JoystickCaps.dwAxes == 4 && JoystickCaps.dwButtons == 16 && JoystickCaps.dwPOVs == 1 ) { JoystickType = JOYSTICK_Xbox_Type_S; } // Xbox Type S controller with new drivers. if( JoystickCaps.dwAxes == 7 && JoystickCaps.dwButtons == 24 && JoystickCaps.dwPOVs == 1 ) { JoystickType = JOYSTICK_Xbox_Type_S; } // PS2 controller. if( JoystickCaps.dwAxes == 5 && JoystickCaps.dwButtons == 16 && JoystickCaps.dwPOVs == 1 ) { JoystickType = JOYSTICK_PS2; } if( JoystickType == JOYSTICK_None ) { DirectInput8Joystick->Release(); DirectInput8Joystick = NULL; } } if( DirectInput8Joystick == NULL ) debugf(NAME_Warning,TEXT("Console controller emulation enabled though no compatible joystick found")); #endif // Success. debugf( NAME_Init, TEXT("Client initialized") ); } // // UWindowsClient::Flush // void UWindowsClient::Flush() { RenderDevice->Flush(); if( AudioDevice ) AudioDevice->Flush(); } // // UWindowsClient::Serialize - Make sure objects the client reference aren't garbage collected. // void UWindowsClient::Serialize(FArchive& Ar) { Super::Serialize(Ar); Ar << Engine << RenderDeviceClass << RenderDevice << AudioDeviceClass << AudioDevice; } // // UWindowsClient::Destroy - Shut down the platform-specific viewport manager subsystem. // void UWindowsClient::Destroy() { // Close all viewports. for(INT ViewportIndex = 0;ViewportIndex < Viewports.Num();ViewportIndex++) delete Viewports(ViewportIndex); Viewports.Empty(); // Stop capture. SetCapture( NULL ); ClipCursor( NULL ); // Delete the render device. delete RenderDevice; RenderDevice = NULL; // Delete the audio device. delete AudioDevice; AudioDevice = NULL; SAFE_RELEASE( DirectInput8Joystick ); SAFE_RELEASE( DirectInput8Mouse ); SAFE_RELEASE( DirectInput8 ); debugf( NAME_Exit, TEXT("Windows client shut down") ); Super::Destroy(); } // // Failsafe routine to shut down viewport manager subsystem // after an error has occured. Not guarded. // void UWindowsClient::ShutdownAfterError() { debugf( NAME_Exit, TEXT("Executing UWindowsClient::ShutdownAfterError") ); SetCapture( NULL ); ClipCursor( NULL ); while( ShowCursor(TRUE)<0 ); for(UINT ViewportIndex = 0;ViewportIndex < (UINT)Viewports.Num();ViewportIndex++) Viewports(ViewportIndex)->ShutdownAfterError(); Super::ShutdownAfterError(); } // // UWindowsClient::Tick - Perform timer-tick processing on all visible viewports. // void UWindowsClient::Tick( FLOAT DeltaTime ) { // Process input. BEGINCYCLECOUNTER(GEngineStats.InputTime); for(UINT ViewportIndex = 0;ViewportIndex < (UINT)Viewports.Num();ViewportIndex++) { Viewports(ViewportIndex)->ProcessInput( DeltaTime ); } ENDCYCLECOUNTER; // Cleanup viewports that have been destroyed. for(INT ViewportIndex = 0;ViewportIndex < Viewports.Num();ViewportIndex++) { if(!Viewports(ViewportIndex)->Window) { delete Viewports(ViewportIndex); Viewports.Remove(ViewportIndex--); } } } // // UWindowsClient::Exec // UBOOL UWindowsClient::Exec(const TCHAR* Cmd,FOutputDevice& Ar) { if(RenderDevice && RenderDevice->Exec(Cmd,Ar)) return 1; else return 0; } // // UWindowsClient::CreateViewport // FViewport* UWindowsClient::CreateViewport(FViewportClient* ViewportClient,const TCHAR* Name,UINT SizeX,UINT SizeY,UBOOL Fullscreen) { return new FWindowsViewport(this,ViewportClient,Name,SizeX,SizeY,Fullscreen,NULL); } // // UWindowsClient::CreateWindowChildViewport // FChildViewport* UWindowsClient::CreateWindowChildViewport(FViewportClient* ViewportClient,void* ParentWindow,UINT SizeX,UINT SizeY) { return new FWindowsViewport(this,ViewportClient,TEXT(""),SizeX,SizeY,0,(HWND)ParentWindow); } // // UWindowsClient::CloseViewport // void UWindowsClient::CloseViewport(FChildViewport* Viewport) { FWindowsViewport* WindowsViewport = (FWindowsViewport*)Viewport; WindowsViewport->Destroy(); } // // UWindowsClient::StaticWndProc // LONG APIENTRY UWindowsClient::StaticWndProc( HWND hWnd, UINT Message, UINT wParam, LONG lParam ) { INT i; for( i=0; i<Viewports.Num(); i++ ) if( Viewports(i)->GetWindow()==hWnd ) break; if( i==Viewports.Num() || GIsCriticalError ) return DefWindowProcX( hWnd, Message, wParam, lParam ); else return Viewports(i)->ViewportWndProc( Message, wParam, lParam ); } #ifdef EMULATE_CONSOLE_CONTROLLER // // Joystick callbacks. // BOOL CALLBACK EnumJoysticksCallback( LPCDIDEVICEINSTANCE Instance, LPVOID Context ) { if( FAILED( UWindowsClient::DirectInput8->CreateDevice( Instance->guidInstance, &UWindowsClient::DirectInput8Joystick, NULL ) ) ) { UWindowsClient::DirectInput8Joystick = NULL; return DIENUM_CONTINUE; } return DIENUM_STOP; } BOOL CALLBACK EnumAxesCallback( LPCDIDEVICEOBJECTINSTANCE Instance, LPVOID Context ) { if( UWindowsClient::DirectInput8Joystick ) { DIPROPRANGE Range; Range.diph.dwSize = sizeof(DIPROPRANGE); Range.diph.dwHeaderSize = sizeof(DIPROPHEADER); Range.diph.dwHow = DIPH_BYOFFSET; Range.diph.dwObj = Instance->dwOfs; // Specify the enumerated axis // Ideally we'd like a range of +/- 1 though sliders can't go negative so we'll map 0..65535 to +/- 1 when polling. Range.lMin = 0; Range.lMax = 65535; // Set the range for the axis UWindowsClient::DirectInput8Joystick->SetProperty( DIPROP_RANGE, &Range.diph ); return DIENUM_CONTINUE; } else return DIENUM_STOP; } #endif // // Static variables. // TArray<FWindowsViewport*> UWindowsClient::Viewports; LPDIRECTINPUT8 UWindowsClient::DirectInput8; LPDIRECTINPUTDEVICE8 UWindowsClient::DirectInput8Mouse; #ifdef EMULATE_CONSOLE_CONTROLLER LPDIRECTINPUTDEVICE8 UWindowsClient::DirectInput8Joystick; EJoystickType UWindowsClient::JoystickType; #endif
31.180328
157
0.747897
4a94291971be5644de40e1067832016c1e171444
5,179
html
HTML
platform/marmotta-core/src/main/resources/web/admin/contexts.html
shubhanshu-gupta/Apache-Marmotta
3e6fd5bb45edd26a568c7675251c34803f4924dd
[ "CC-BY-3.0", "Apache-2.0" ]
45
2015-01-07T08:56:24.000Z
2021-12-23T03:06:04.000Z
platform/marmotta-core/src/main/resources/web/admin/contexts.html
shubhanshu-gupta/Apache-Marmotta
3e6fd5bb45edd26a568c7675251c34803f4924dd
[ "CC-BY-3.0", "Apache-2.0" ]
11
2015-08-20T19:15:16.000Z
2020-04-30T01:40:03.000Z
platform/marmotta-core/src/main/resources/web/admin/contexts.html
isabella232/marmotta
28c9b8b0791ea1693578af302981a1358e56933d
[ "CC-BY-3.0", "Apache-2.0" ]
71
2015-02-03T19:59:19.000Z
2022-01-15T17:43:49.000Z
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. --> <html> <head> <!--###BEGIN_HEAD###--> <title>Contexts</title> <link type="text/css" rel="stylesheet" href="../public/js/widgets/configurator/style.css" /> <!--###END_HEAD###--> </head> <body> <div id="main"> <div id="contents"> <!--###BEGIN_CONTENT###--> <h1>Contexts</h1> <h2>Triple Contexts / Graphs</h2> <p> In Marmotta we call <em>contexts</em> to triple containers with their own URI; what is commonly known as <a href="http://www.w3.org/TR/sparql11-query/#namedAndDefaultGraph">graphs</a> in SPARQL. </p> <p> Currently there are <strong><span id="contexts-count">0 contexts</span></strong> in Marmotta: </p> <table id="contexts" class="simple_table"> <thead> <tr class="subtitle"> <th>Label</th> <th>Context</th> <th>Size</th> <th>Download</th> <th>&nbsp;</th> </tr> </thead> <tbody></tbody> </table> <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script> <script type="text/javascript"> jQuery(document).ready(function() { function appendContext(ctx, id) { var uri = ctx["uri"], label = (ctx["label"] ? ctx["label"] : uri.replace(/.*[\/#](.*)/, "$1")), size = ctx["size"]; $("<tr>", {"id": "context_"+id}) .append($("<td>", {"text": label})) .append($("<td>").append($("<a>", {"text": uri, "href": uri}))) .append($("<td>").append(size!==undefined?$("<span>", {"text":size+" triple"+(size==1?"":"s")}):$("<em>", {"text":"unknown"}))) .append(appendDownloadLinks($("<td>"), ctx)) .append($("<td>").append($("<button>", {"text": "delete"}).click(deleteContext(uri, id, size)))) .appendTo($("table#contexts > tbody:last")); } function appendDownloadLinks(target, ctx) { function dl(format) { return _SERVER_URL + "export/download?" + "context=" + encodeURIComponent(ctx["uri"]) + "&format=" + encodeURIComponent(format); } return target .append($("<a>", {"text": "rdf+xml", "href": dl("application/rdf+xml")})) .append("&nbsp;") .append($("<a>", {"text": "turtle", "href": dl("text/turtle")})) .append("&nbsp;") .append($("<a>", {"text": "ld+json", "href": dl("application/ld+json")})); } function deleteContext(uri, id, size) { var question = "This will DELETE context <" + uri + ">"; if (size) { question += " and all " + size + " triple" + (size==1?"":"s") + " contained in it"; } return function() { if (!confirm(question)) return; $.ajax({ url: "../../context?graph=" + encodeURIComponent(uri), type: "DELETE", success: function(result) { alert("Context " + uri + " deleted!"); $("tr#context_" + id).slideUp(function() { $(this).remove(); var c = $("span#contexts-count"), count = c.attr("data-count") -1; c.attr("data-count", count) .text(count + " context" + (count==1?"":"s")); }); } }); } } $.getJSON("../../context/list", {labels:"true"}, function(data) { var count = 0; for (i in data) { appendContext(data[i], count++); } $("span#contexts-count") .attr("data-count", count) .text(count + " context" + (count==1?"":"s")); }); }); </script> <!--###END_CONTENT###--> </div> </div> </body> </html>
41.103175
147
0.46341
14cd809279dff346362c3a41577dfb95fdf41181
2,528
swift
Swift
Nursery Rhymes/Nursery Rhymes/Rhyme/RhymeDetailsProvider.swift
MaciejGad/NurseryRhymesApp
108de22557b256db8749ec9a732b9470e27a04bf
[ "MIT" ]
null
null
null
Nursery Rhymes/Nursery Rhymes/Rhyme/RhymeDetailsProvider.swift
MaciejGad/NurseryRhymesApp
108de22557b256db8749ec9a732b9470e27a04bf
[ "MIT" ]
null
null
null
Nursery Rhymes/Nursery Rhymes/Rhyme/RhymeDetailsProvider.swift
MaciejGad/NurseryRhymesApp
108de22557b256db8749ec9a732b9470e27a04bf
[ "MIT" ]
null
null
null
import Foundation import Models import Connection protocol RhymeDetailsProviderInput { func fetch(listViewModel: ListViewModel, completion: @escaping (Result<RhymeDetailsViewModel, ConnectionError>) -> Void) } final class RhymeDetailsProvider: RhymeDetailsProviderInput { let singleRhymeProvider: SingleRhymeProviderInput let bookListProvider: BookListForRhymeProviderInput let imageDownloader: ImageDownloaderInput init(singleRhymeProvider: SingleRhymeProviderInput, bookListProvider: BookListForRhymeProviderInput, imageDownloader: ImageDownloaderInput) { self.singleRhymeProvider = singleRhymeProvider self.bookListProvider = bookListProvider self.imageDownloader = imageDownloader } func fetch(listViewModel: ListViewModel, completion: @escaping (Result<RhymeDetailsViewModel, ConnectionError>) -> Void) { let image = listViewModel.image let aggregator = Aggregator<Rhyme, BookListForRhyme, ConnectionError> { [weak self] (result) in guard let stronSelf = self else { return } switch result { case .success((let rhyme, let bookList)): let model = stronSelf.createViewModel(rhyme: rhyme, bookList: bookList, image: image) completion(.success(model)) case .failure(let error): completion(.failure(error)) } } singleRhymeProvider.fetch(id: listViewModel.id) { result in aggregator.aResult = result } bookListProvider.fetch(id: listViewModel.id) { result in aggregator.bResult = result } } private func createViewModel(rhyme: Rhyme, bookList: BookListForRhyme, image: ImagePromiseInput?) -> RhymeDetailsViewModel { let imagePromise = image ?? rhyme.image.asImagePromise(downloader: imageDownloader) let books = bookList.toBookViewModels(imageDownloader: imageDownloader) return .init(title: rhyme.title, author: rhyme.author, image: imagePromise, text: rhyme.text, books: books) } } extension BookListForRhyme { func toBookViewModels(imageDownloader: ImageDownloaderInput) -> [BookViewModel] { books.map { BookViewModel(id: $0.id, title: $0.title, author: $0.author, coverImage: $0.coverImage.asImagePromise(downloader: imageDownloader), link: $0.url) } } }
40.126984
128
0.662184
292b2b763cdd72df7f94b67b27e88c3df370598a
5,785
py
Python
tools/fixture_generator/generate_xrp_fixtures.py
RomanWlm/lib-ledger-core
8c068fccb074c516096abb818a4e20786e02318b
[ "MIT" ]
2
2019-06-25T15:10:40.000Z
2019-07-08T12:22:37.000Z
tools/fixture_generator/generate_xrp_fixtures.py
RomanWlm/lib-ledger-core
8c068fccb074c516096abb818a4e20786e02318b
[ "MIT" ]
19
2020-02-11T17:53:36.000Z
2020-04-15T08:58:13.000Z
tools/fixture_generator/generate_xrp_fixtures.py
RomanWlm/lib-ledger-core
8c068fccb074c516096abb818a4e20786e02318b
[ "MIT" ]
6
2020-04-18T01:07:47.000Z
2020-10-07T08:50:20.000Z
#!/usr/bin/env python3 import sys import requests import json import datetime import dateutil.parser import time if len(sys.argv) < 4: print("Should have at least two params <name> <address> <pubKey> <chainCode>") sys.exit(-1) path = "../../core/test/fixtures/" arguments = sys.argv[1:] namespace = str(arguments[0]) address = (arguments[1]) pubKey = (arguments[2]) chainCode = (arguments[3]) def getHashs(txsHash): syncUrl = "https://s2.ripple.com:51234" #Get txs related to address params = "{\"method\":\"account_tx\",\"params\":[{\"account\":\"" + address + "\"}]}" call = requests.post(syncUrl, params) bytes = call.content text = bytes.decode('utf8') response = json.loads(text) transactions = response['result']['transactions'] for i in range(len(transactions)) : hash = transactions[i]['tx']['hash'] txsHash.append(hash) return txsHash def getTxs(hashs): txs = [] url = "https://s2.ripple.com:51234" for i in range(len(hashs)): params = "{\"method\":\"tx\",\"params\":[{\"transaction\":\"" + hashs[i] + "\"}]}" bytes = requests.post(url, params).content text = bytes.decode('utf8') tx = json.loads(text)['result'] txs.append(tx) return txs start = time.time() classPrefix = 'Ripple' extension = '.h' parser = 'RippleLikeTransactionParser' def makeH(namespace, txs): data = ['// This file was GENERATED by command:\n', '// generate_fixtures.py\n', '// DO NOT EDIT BY HAND!!!\n', '#ifndef LEDGER_FIXTURES_TOTO_H\n', '#define LEDGER_FIXTURES_TOTO_H\n', '#include <gtest/gtest.h>\n', '#include <async/QtThreadDispatcher.hpp>\n', '#include <src/database/DatabaseSessionPool.hpp>\n', '#include <NativePathResolver.hpp>\n', '#include <unordered_set>\n', '#include <src/wallet/pool/WalletPool.hpp>\n', '#include <CoutLogPrinter.hpp>\n', '#include <src/api/DynamicObject.hpp>\n', '#include <wallet/common/CurrencyBuilder.hpp>\n', '#include <wallet/'+ classPrefix.lower()+'/explorers/api/'+parser+'.h>\n' , '#include <wallet/'+ classPrefix.lower()+'/'+classPrefix+'LikeWallet'+extension+'>\n', '#include <wallet/'+ classPrefix.lower() +'/database/'+ classPrefix +'LikeTransactionDatabaseHelper.h>\n', '#include <wallet/common/database/AccountDatabaseHelper.h>\n', '#include <wallet/pool/database/PoolDatabaseHelper.hpp>\n', '#include <utils/JSONUtils.h>\n', '#include <async/async_wait.h>\n', '#include <wallet/'+ classPrefix.lower() +'/'+classPrefix+'LikeAccount'+extension+'>\n', '#include <api/'+classPrefix+'LikeOperation.hpp>\n', '#include <api/'+classPrefix+'LikeTransaction.hpp>\n', '#include <api/BigInt.hpp>\n', '#include <net/QtHttpClient.hpp>\n', '#include <events/LambdaEventReceiver.hpp>\n', '#include <soci.h>\n', '#include <utils/hex.h>\n', '#include <api/Account.hpp>\n', '#include <api/'+classPrefix+'LikeAccount.hpp>\n'] externs = [] externs.append("\t\t\textern core::api::AccountCreationInfo XPUB_INFO;\n") for i in range(len(txs)): externs.append("\t\t\textern const std::string TX_"+str(i+1)+";\n") externs.append("\n") externs.append("\t\t\tstd::shared_ptr<core::"+classPrefix+"LikeAccount> inflate(const std::shared_ptr<core::WalletPool>& pool, const std::shared_ptr<core::AbstractWallet>& wallet);\n") newLines = ["namespace ledger {\n","\tnamespace testing {\n","\t\tnamespace "+namespace+" {\n"]+externs+["\t\t}\n","\t}\n", "}\n"] result = data+["\n"]+newLines+["\n"] result[3] = "#ifndef LEDGER_FIXTURES_"+namespace.upper()+"\n" result[4] = "#define LEDGER_FIXTURES_"+namespace.upper()+"\n" result.append("#endif // LEDGER_FIXTURES_"+namespace.upper()+"\n") with open(path+namespace+'_fixtures.h', 'w+') as file: file.writelines(result) file.close() def makeCPP(namespace, txs): data = [ "// This file was GENERATED by command:\n", "// generate_fixtures.py\n", "// DO NOT EDIT BY HAND!!!\n" ] newLines = [] newLines.append("#include \""+namespace+'_fixtures.h'+"\"\n") newLines.append("\n") newLines.append("namespace ledger {\n") newLines.append("\tnamespace testing {\n") newLines.append("\t\tnamespace "+namespace+" {\n") apiCalls = [] apiCalls.append("core::api::AccountCreationInfo XPUB_INFO(\n") apiCalls.append(' 0, {"xrp"}, {"44\'/144\'/0\'"}, \n') apiCalls.append('{ledger::core::hex::toByteArray("' + pubKey + '")} , {ledger::core::hex::toByteArray("' + chainCode + '")}\n') apiCalls.append(');\n') apiCalls.append("std::shared_ptr<core::"+classPrefix+"LikeAccount> inflate(const std::shared_ptr<core::WalletPool>& pool, const std::shared_ptr<core::AbstractWallet>& wallet) {\n") apiCalls.append("\tauto account = std::dynamic_pointer_cast<core::"+classPrefix+"LikeAccount>(wait(wallet->newAccountWithInfo(XPUB_INFO)));\n") apiCalls.append("\tsoci::session sql(pool->getDatabaseSessionPool()->getPool());\n") apiCalls.append("\tsql.begin();") for i,tx in enumerate(txs): apiCalls.append("\taccount->putTransaction(sql, *core::JSONUtils::parse<core::"+parser+">(TX_" + str(i+1) + "));\n") apiCalls.append("\tsql.commit();\n") apiCalls.append("\treturn account;\n") apiCalls.append("}\n") txLines = [] for i,tx in enumerate(txs): txLines.append(('const std::string TX_'+str(i+1)+' = "'+json.dumps(tx).replace('"','\\"')+'";\n')) namespacedLines = apiCalls+txLines for idx, line in enumerate(namespacedLines): namespacedLines[idx] = "\t\t\t"+line newLines += namespacedLines + ["\t\t}\n","\t}\n", "}\n"] result = data+newLines with open(path+namespace+'_fixtures.cpp', 'w+') as file: file.writelines(result) file.close() makeH(namespace, getTxs(getHashs([]))) end = time.time() print("make H over after "+str(end-start)) makeCPP(namespace, getTxs(getHashs([]))) end2 = time.time() print("make cpp over after "+str(end2-start))
46.28
1,468
0.667416
5c53e4fc1444ce22335ada6b423fcee05d9f5cf9
392
css
CSS
hokudai_furima/static/css/details_page.css
TetsuFe/hokuma
b981a52b3bf8d7268bf791c5827bbe8af90afef6
[ "MIT" ]
1
2021-02-13T03:51:42.000Z
2021-02-13T03:51:42.000Z
hokudai_furima/static/css/details_page.css
TetsuFe/hokuma
b981a52b3bf8d7268bf791c5827bbe8af90afef6
[ "MIT" ]
null
null
null
hokudai_furima/static/css/details_page.css
TetsuFe/hokuma
b981a52b3bf8d7268bf791c5827bbe8af90afef6
[ "MIT" ]
1
2021-09-18T09:25:48.000Z
2021-09-18T09:25:48.000Z
.sns-buttons { margin-top: 20px; margin-bottom: 20px; } .fb-share-button > span { display: inline-block; vertical-align: baseline !important; } .twitter-button { display: inline-block; vertical-align: top; } #carouselIndicators { background-color: #cccccc; } .carousel-item { height: 300px; } .carousel-item > img { max-height: 300px; margin: 0 auto; display:block; }
14.518519
37
0.67602
167cebfdac40d5c54f3bfa81fbdbb004c2e2da85
448
ps1
PowerShell
PSChristmasTree/Private/Get-NewYear.ps1
Sofiane-77/PSChristmasTree
a6ec3bc6c8d4adcf63c24bc591740d35c9e35d1e
[ "MIT" ]
null
null
null
PSChristmasTree/Private/Get-NewYear.ps1
Sofiane-77/PSChristmasTree
a6ec3bc6c8d4adcf63c24bc591740d35c9e35d1e
[ "MIT" ]
null
null
null
PSChristmasTree/Private/Get-NewYear.ps1
Sofiane-77/PSChristmasTree
a6ec3bc6c8d4adcf63c24bc591740d35c9e35d1e
[ "MIT" ]
null
null
null
<# .Synopsis Get Year for christmas messages .Description Returns the current year or new year depends on when you call it #> function Get-NewYear() { [OutputType([int])] [int]$currentYear = Get-Date -UFormat "%Y" # The following year is displayed only if the date is greater than December 23 if ((Get-Date) -gt (Get-Date -Year $currentYear -Month 12 -Day 23)) { $newYear = $currentYear + 1 return $newYear } return $currentYear }
24.888889
79
0.703125
4aa240dc4c860100ff63ba0df93f7968e8bd0bb9
1,825
cs
C#
CaptainLib/Collections/MemCache.cs
dzoidx/CaptainLib
bc278c71ced08bf34d684fea1b918745036c07aa
[ "MIT" ]
null
null
null
CaptainLib/Collections/MemCache.cs
dzoidx/CaptainLib
bc278c71ced08bf34d684fea1b918745036c07aa
[ "MIT" ]
null
null
null
CaptainLib/Collections/MemCache.cs
dzoidx/CaptainLib
bc278c71ced08bf34d684fea1b918745036c07aa
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using System.Linq; namespace CaptainLib.Collections { public class MemCache<Key, Value> { private class MemCacheEntry { public DateTime ExpirationDate; public Value Data; } public Value GetOrCreate(Key k, Func<Value> creator, DateTime expDate) { Update(); if (_cache.TryGetValue(k, out MemCacheEntry entry)) return entry.Data; entry = new MemCacheEntry() { Data = creator(), ExpirationDate = expDate }; _cache[k] = entry; return entry.Data; } public Value GetOrCreate(Key k, Func<Value> creator, TimeSpan? lifeTime = null) { DateTime expDate; if (!lifeTime.HasValue) expDate = DateTime.MaxValue; else expDate = DateTime.UtcNow + lifeTime.Value; return GetOrCreate(k, creator, expDate); } public bool Invalidate(Key k) { if (!_cache.ContainsKey(k)) return false; if (_cache[k].Data is IDisposable) (_cache[k].Data as IDisposable).Dispose(); return _cache.Remove(k); } private void Update() { var expKeys = _cache.Where(pair => DateTime.UtcNow > pair.Value.ExpirationDate) .Select(pair => pair.Key) .ToArray(); foreach (var expKey in expKeys) { if(_cache[expKey].Data is IDisposable) (_cache[expKey].Data as IDisposable).Dispose(); _cache.Remove(expKey); } } private Dictionary<Key, MemCacheEntry> _cache = new Dictionary<Key, MemCacheEntry>(); } }
28.968254
93
0.536438
d034518fc1414cc1428cba95aea686e1be0c0e59
816
kt
Kotlin
crypto-hft-client/src/main/kotlin/com/grinisrit/crypto/analysis/models.kt
AndreiKingsley/noa-atra-examples
65b99c55744486a8ff5edd22fcfd8ca445b3e3a7
[ "BSD-2-Clause" ]
8
2021-07-14T16:37:49.000Z
2021-09-02T23:24:48.000Z
crypto-hft-client/src/main/kotlin/com/grinisrit/crypto/analysis/models.kt
AndreiKingsley/noa-atra-examples
65b99c55744486a8ff5edd22fcfd8ca445b3e3a7
[ "BSD-2-Clause" ]
1
2021-07-22T12:30:33.000Z
2021-07-22T12:30:33.000Z
crypto-hft-client/src/main/kotlin/com/grinisrit/crypto/analysis/models.kt
AndreiKingsley/noa-atra-examples
65b99c55744486a8ff5edd22fcfd8ca445b3e3a7
[ "BSD-2-Clause" ]
2
2021-06-28T12:15:20.000Z
2021-09-02T16:25:04.000Z
package com.grinisrit.crypto.analysis // TODO could be tensor typealias Points = Pair<List<Long>, List<Float>> typealias MutablePoints = Pair<MutableList<Long>, MutableList<Float>> fun emptyPoints() = Pair(mutableListOf<Long>(), mutableListOf<Float>()) fun MutablePoints.add(time: Long, data: Float){ first.add(time) second.add(data) } typealias TimestampToValue = Pair<Long, Float?> typealias AggregatedValues = MutableList<TimestampToValue> typealias MinuteToValues = MutableMap<Long, AggregatedValues> fun emptyAggregatedValues() = mutableListOf<TimestampToValue>() fun emptyMinuteToValues() = mutableMapOf<Long, AggregatedValues>() fun MinuteToValues.add(micros: Long, value: Float?) { val minutes = microsToMinutes(micros) getOrPut(minutes) { mutableListOf() }.add(Pair(micros, value)) }
31.384615
71
0.764706
81d88326c520d5e8b9557cc9c151d80ffc34c9b9
31,882
html
HTML
en/doxygen/html/structimmer_1_1detail_1_1hamts_1_1node-members.html
thephez/core-0-14
49e1f5a01cac63084aaa6895505e174c564242ef
[ "MIT-0", "MIT" ]
null
null
null
en/doxygen/html/structimmer_1_1detail_1_1hamts_1_1node-members.html
thephez/core-0-14
49e1f5a01cac63084aaa6895505e174c564242ef
[ "MIT-0", "MIT" ]
null
null
null
en/doxygen/html/structimmer_1_1detail_1_1hamts_1_1node-members.html
thephez/core-0-14
49e1f5a01cac63084aaa6895505e174c564242ef
[ "MIT-0", "MIT" ]
null
null
null
<!-- HTML header for doxygen 1.8.14--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Dash Core: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(document).ready(initResizable); /* @license-end */</script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen_stylesheetextra.css" rel="stylesheet" type="text/css"/> </head> <body> <div class="head"><div> <!--<a id="menumobile" class="menumobile" onclick="mobileMenuShow(event);" ontouchstart="mobileMenuShow(event);"></a>--> <a class="logo" href="/en/"><img src="logotop.png" alt="Dash"></img></a> <ul id="menusimple" class="menusimple menumain" onclick="mobileMenuHover(event);" ontouchstart="mobileMenuHover(event);"> <li><a href="/en/dash-for-developers">Developers</a></li> <li><a>Documentation</a> <ul> <li><a href="/en/developer-guide">Guide</a></li> <li><a href="/en/developer-reference">Reference</a></li> <li><a href="/en/developer-examples">Examples</a></li> <li><a href="/en/developer-glossary">Glossary</a></li> </ul> </li> <li><a>Resources</a> <ul> <li><a rel="noopener noreferrer" target="_blank" href="https://www.dash.org/community/">Community</a></li> <li><a href="/en/vocabulary">Vocabulary</a></li> </ul> </li> </ul> </div></div> <div class="body"> <div class="breadcrumbs"></div> <div id="content" class="content"> <!-- <link rel="stylesheet" href="/css/jquery-ui.min.css"> --> <h1>Dash Core Source Documentation (0.13.1.0)</h1> <p class="summary">Find detailed information regarding the Dash Core source code.</p> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <!-- <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="logotop.png"/></td> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Dash Core &#160;<span id="projectnumber">0.13.1.0</span> </div> <div id="projectbrief">P2P Digital Currency</div> </td> </tr> </tbody> </table> </div> --> <!-- end header part --> <!-- Generated by Doxygen 1.8.14 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('structimmer_1_1detail_1_1hamts_1_1node.html','');}); /* @license-end */ </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt; Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ab86b567ec8fd7240f9e4abd886287cec">children</a>()</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#aec7705d0009932e1057f462d7507f2ec">children</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a7bc5d6f777a87afe12dc687afab11ed5">collision_count</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a4b1265de648b13ef6dd805edf13ce014">collisions</a>()</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ac448ff9f2da5884f06248e402fc48866">collisions</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a0f28f852f6b40d6a23497672ce0bbada">copy_collision_insert</a>(node_t *src, T v)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a2d144dcfe8171626e083666323e07818">copy_collision_remove</a>(node_t *src, T *v)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a377232c42fff16c0f6bda6094965b2b2">copy_collision_replace</a>(node_t *src, T *pos, T v)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ae668f309d7113bf8a4448c079a32c72a">copy_inner_insert_value</a>(node_t *src, bitmap_t bit, T v)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ab503e9762137a826c15ecba65da341ab">copy_inner_remove_value</a>(node_t *src, bitmap_t bit, count_t voffset)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a30bf2176345b9ba6017e58a33b85346d">copy_inner_replace</a>(node_t *src, count_t offset, node_t *child)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#aee3de675c30780289403c4477efa58dd">copy_inner_replace_inline</a>(node_t *src, bitmap_t bit, count_t noffset, T value)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a0d403565548239980e92e91caa41452d">copy_inner_replace_merged</a>(node_t *src, bitmap_t bit, count_t voffset, node_t *node)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a08e7ae83b755c02c82105964d9015951">copy_inner_replace_value</a>(node_t *src, count_t offset, T v)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a1c14e12cf7dc86251968238e02c0f640">datamap</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a172e0b361dded631d2b686076a3271c1">deallocate_collision</a>(node_t *p, count_t n)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#acc9f5f1e5f234bd37b89df2d14d18699">deallocate_inner</a>(node_t *p, count_t n)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#abb7cfd2b52b4be9825be70a5d9d2abbd">deallocate_inner</a>(node_t *p, count_t n, count_t nv)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a1ec4168fd4c40aef7a90266bb5ef50df">deallocate_values</a>(values_t *p, count_t n)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a107d3e790ae6b28ea99af0e7a2d5c082">dec</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a97234c31206c2d4245f3c0662ce0765d">dec_unsafe</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a712dcfd1ef281e586be057a2d5692489">delete_collision</a>(node_t *p)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a30c155d51fca364d79322c9edbc2b466">delete_deep</a>(node_t *p, shift_t s)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#afdb81e5036b0cb782fe998652ab5d2d4">delete_deep_shift</a>(node_t *p, shift_t s)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a6d60a95d6eab17181a0ea60c65e921c0">delete_inner</a>(node_t *p)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a3161b8b960c16813ee30af149829b9be">delete_values</a>(values_t *p, count_t n)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#af5afced837d3f357d464f28b193685a7">edit_t</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a59e00dcd16345948331ff4d455f24820">heap</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#acdaf5c1ae51a1193c47d739e568abc4c">heap_policy</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ada487bd88298d01fddf84812ecbb435f">impl</a></td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a36059a6eca1f0492902398bef0d8e313">impl_t</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a7bcf98f8de72d741fde158c5d0d35a79">inc</a>()</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ab8d34459b9f193217e631e67aef2b016">inc</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a70ec663e052e98a8491b5b77d22058a2">inc_nodes</a>(node_t **p, count_t n)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a7ffa8fa5e9316f47f0ac12165ca03154">kind</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ae5e2adc8140b40fce74e64be723c2ff5">kind_t</a> enum name</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a7f39e7d7c593ea294360f018b02271ce">make_collision</a>(T v1, T v2)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a917d451b6026046a133ef88502042eb5">make_collision_n</a>(count_t n)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a7d140156ab7a5a4b62c03e7cbed5b746">make_inner_n</a>(count_t n)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a9e699025e6c8372d125ec9f9c4fcd552">make_inner_n</a>(count_t n, values_t *values)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ab25e9e35774359b5fb014f07c5131e38">make_inner_n</a>(count_t n, count_t nv)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a373f056412d8966ba1de3db13bf68f5b">make_inner_n</a>(count_t n, count_t idx, node_t *child)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#aebae90bd57a3fa01e81c08d9f70bb133">make_inner_n</a>(count_t n, bitmap_t bitmap, T x)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#aacd369a2ec9a22af8945572ef89de238">make_inner_n</a>(count_t n, count_t idx1, T x1, count_t idx2, T x2)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ae8b8174fb905d2b18e17dd4c889ff04d">make_merged</a>(shift_t shift, T v1, hash_t hash1, T v2, hash_t hash2)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a490cba67ac1735d4e9af7f9e4a28faa5">memory</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a5b7bedc05b1d2c218eefbadf0998eb38">node_t</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#ad37ec4d68ae38346d5ab81403c247cf0">nodemap</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#af1dc28076cb7db2ab057476671570e2f">ownee</a>(const values_t *x)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a9774341365a7fbedbab9d0437c88bc4f">ownee</a>(values_t *x)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a29dbb5d69b96d5ee28c10246e3e6aa5b">ownee</a>(const node_t *x)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a3f231c70a3f0af1e334b3bba6b76c9a6">ownee</a>(node_t *x)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a1d353b4ae696b547e80d70cf4db0c3be">ownee_t</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a0604c7f6c5503c768f4dc53c16b7fc5f">refs</a>(const values_t *x)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a7acfda57b66d11623a37d5f952932c6d">refs</a>(const node_t *x)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a67fbe3f4bce9d6737299a6edcd5b718d">refs_t</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a929593d3d48e87b2bf60ba38c9cb92f4">sizeof_collision_n</a>(count_t count)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#aa888c4f96cd47b23f3e517b29d47915b">sizeof_inner_n</a>(count_t count)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a8d1f91a8ec44f9596d75cf4d5c05eff9">sizeof_values_n</a>(count_t count)</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a5d31f6ca61b5091a9164daaf5f86011a">transience</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#adee0a2f970af557388979b1a0e62dd34">value_t</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a6b5232afed4c6ae1bd89b4ae40ee5755">values</a>()</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a6f3d6377f665e94db46b5590a88e59c1">values</a>() const</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html#a38f6075c3f964af677437186a19f1165">values_t</a> typedef</td><td class="entry"><a class="el" href="structimmer_1_1detail_1_1hamts_1_1node.html">immer::detail::hamts::node&lt; T, Hash, Equal, MemoryPolicy, B &gt;</a></td><td class="entry"></td></tr> </table></div><!-- contents --> </div><!-- doc-content --> <!-- HTML footer for doxygen 1.8.14--> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Mar 20 2019 18:11:53 for Dash Core by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li> </ul> </div> </div> <div class="ddfooter"> <div class="footerlicense">Released under the <a href="http://opensource.org/licenses/mit-license.php" target="_blank">MIT license</a></div> </div> </div> </body> </html>
151.099526
483
0.727025
66f769ecb9a910adf3368fb8f9df288e1df259a6
6,781
cpp
C++
source/Irrlicht/CGUIModalScreen.cpp
Ciapas-Linux/irrlicht-ogles
07bce7448a0714c62475489bc01ce719cb87ace0
[ "IJG" ]
2
2020-11-04T03:17:13.000Z
2020-11-28T23:19:26.000Z
source/Irrlicht/CGUIModalScreen.cpp
Ciapas-Linux/irrlicht-ogles
07bce7448a0714c62475489bc01ce719cb87ace0
[ "IJG" ]
2
2020-01-28T08:36:22.000Z
2020-02-01T10:52:04.000Z
source/Irrlicht/CGUIModalScreen.cpp
Ciapas-Linux/irrlicht-ogles
07bce7448a0714c62475489bc01ce719cb87ace0
[ "IJG" ]
1
2019-09-05T05:39:18.000Z
2019-09-05T05:39:18.000Z
// Copyright (C) 2002-2012 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIModalScreen.h" #ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUIEnvironment.h" #include "os.h" #include "IVideoDriver.h" #include "IGUISkin.h" namespace irr { namespace gui { //! constructor CGUIModalScreen::CGUIModalScreen(IGUIEnvironment* environment, IGUIElement* parent, s32 id) : IGUIElement(EGUIET_MODAL_SCREEN, environment, parent, id, core::recti(0, 0, parent->getAbsolutePosition().getWidth(), parent->getAbsolutePosition().getHeight()) ), BlinkMode(3), MouseDownTime(0) { #ifdef _DEBUG setDebugName("CGUIModalScreen"); #endif setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT); // this element is a tab group setTabGroup(true); } bool CGUIModalScreen::canTakeFocus(IGUIElement* target) const { return (target && ((const IGUIElement*)target == this // this element can take it || isMyChild(target) // own children also || (target->getType() == EGUIET_MODAL_SCREEN ) // other modals also fine (is now on top or explicitely requested) || (target->getParent() && target->getParent()->getType() == EGUIET_MODAL_SCREEN ))) // children of other modals will do ; } bool CGUIModalScreen::isVisible() const { // any parent invisible? IGUIElement * parentElement = getParent(); while ( parentElement ) { if ( !parentElement->isVisible() ) return false; parentElement = parentElement->getParent(); } // if we have no children then the modal is probably abused as a way to block input if ( Children.empty() ) { return IGUIElement::isVisible(); } // any child visible? bool visible = false; core::list<IGUIElement*>::ConstIterator it = Children.begin(); for (; it != Children.end(); ++it) { if ( (*it)->isVisible() ) { visible = true; break; } } return visible; } bool CGUIModalScreen::isPointInside(const core::position2d<s32>& point) const { return true; } //! called if an event happened. bool CGUIModalScreen::OnEvent(const SEvent& event) { if (!isEnabled() || !isVisible() ) return IGUIElement::OnEvent(event); switch(event.EventType) { case EET_GUI_EVENT: switch(event.GUIEvent.EventType) { case EGET_ELEMENT_FOCUSED: if ( event.GUIEvent.Caller == this && isMyChild(event.GUIEvent.Element) ) { Environment->removeFocus(0); // can't setFocus otherwise at it still has focus here Environment->setFocus(event.GUIEvent.Element); if ( BlinkMode&1 ) MouseDownTime = os::Timer::getTime(); return true; } if ( !canTakeFocus(event.GUIEvent.Caller)) { if ( !Children.empty() ) Environment->setFocus(*(Children.begin())); else Environment->setFocus(this); } IGUIElement::OnEvent(event); return false; case EGET_ELEMENT_FOCUS_LOST: if ( !canTakeFocus(event.GUIEvent.Element)) { if ( isMyChild(event.GUIEvent.Caller) ) { if ( !Children.empty() ) Environment->setFocus(*(Children.begin())); else Environment->setFocus(this); } else if ( BlinkMode&1 ) { MouseDownTime = os::Timer::getTime(); } return true; } else { return IGUIElement::OnEvent(event); } case EGET_ELEMENT_CLOSED: // do not interfere with children being removed return IGUIElement::OnEvent(event); default: break; } break; case EET_MOUSE_INPUT_EVENT: if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN && (BlinkMode & 2)) { MouseDownTime = os::Timer::getTime(); } break; case EET_KEY_INPUT_EVENT: // CAREFUL when changing - there's an identical check in CGUIEnvironment::postEventFromUser if (Environment->getFocusBehavior() & EFF_SET_ON_TAB && event.KeyInput.PressedDown && event.KeyInput.Key == KEY_TAB) { IGUIElement* next = Environment->getNextElement(event.KeyInput.Shift, event.KeyInput.Control); if ( next && isMyChild(next) ) { // Pass on the TAB-key, otherwise focus-tabbing inside modal screens breaks return false; } } default: break; } IGUIElement::OnEvent(event); // anyone knows why events are passed on here? Causes p.e. problems when this is child of a CGUIWindow. return true; // absorb everything else } //! draws the element and its children void CGUIModalScreen::draw() { IGUISkin *skin = Environment->getSkin(); if (!skin) return; u32 now = os::Timer::getTime(); if (BlinkMode && now - MouseDownTime < 300 && (now / 70)%2) { core::list<IGUIElement*>::Iterator it = Children.begin(); core::rect<s32> r; video::SColor c = Environment->getSkin()->getColor(gui::EGDC_3D_HIGH_LIGHT); for (; it != Children.end(); ++it) { if ((*it)->isVisible()) { r = (*it)->getAbsolutePosition(); r.LowerRightCorner.X += 1; r.LowerRightCorner.Y += 1; r.UpperLeftCorner.X -= 1; r.UpperLeftCorner.Y -= 1; skin->draw2DRectangle(this, c, r, &AbsoluteClippingRect); } } } IGUIElement::draw(); } //! Removes a child. void CGUIModalScreen::removeChild(IGUIElement* child) { IGUIElement::removeChild(child); if (Children.empty()) { remove(); } } //! adds a child void CGUIModalScreen::addChild(IGUIElement* child) { IGUIElement::addChild(child); Environment->setFocus(child); } void CGUIModalScreen::updateAbsolutePosition() { core::rect<s32> parentRect(0,0,0,0); if (Parent) { parentRect = Parent->getAbsolutePosition(); RelativeRect.UpperLeftCorner.X = 0; RelativeRect.UpperLeftCorner.Y = 0; RelativeRect.LowerRightCorner.X = parentRect.getWidth(); RelativeRect.LowerRightCorner.Y = parentRect.getHeight(); } IGUIElement::updateAbsolutePosition(); } //! Writes attributes of the element. void CGUIModalScreen::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const { IGUIElement::serializeAttributes(out,options); out->addInt("BlinkMode", BlinkMode ); } //! Reads attributes of the element void CGUIModalScreen::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) { IGUIElement::deserializeAttributes(in, options); BlinkMode = in->getAttributeAsInt("BlinkMode", BlinkMode); } } // end namespace gui } // end namespace irr #endif // _IRR_COMPILE_WITH_GUI_
26.488281
166
0.64725
860f58dacdaa25a292940457212a4512dd19b6c9
3,796
java
Java
mensajes/src/main/java/com/ederru/mensajes/MensajesDao.java
ederru/mensajes_app
ba893fa047d78aa4638cb1b87d450258a2c3edb3
[ "MIT" ]
null
null
null
mensajes/src/main/java/com/ederru/mensajes/MensajesDao.java
ederru/mensajes_app
ba893fa047d78aa4638cb1b87d450258a2c3edb3
[ "MIT" ]
null
null
null
mensajes/src/main/java/com/ederru/mensajes/MensajesDao.java
ederru/mensajes_app
ba893fa047d78aa4638cb1b87d450258a2c3edb3
[ "MIT" ]
null
null
null
package com.ederru.mensajes; import java.lang.reflect.Array; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.crypto.spec.PSource; /** * * @author Eder Ruíz */ public class MensajesDao { public static void crearMensajeDB(Mensajes mensaje) { Conexion db_connect = new Conexion(); try (Connection conexion = db_connect.get_Connection()){ PreparedStatement p = null; try { String query = "INSERT INTO mensajes (mensaje, autor_mensaje) VALUES (?,?)"; p = conexion.prepareStatement(query); p.setString(1, mensaje.getMensaje()); p.setString(2, mensaje.getAutor_mensaje()); p.executeUpdate(); System.out.println("El mensaje fue creado exitosamente"); } catch (SQLException ex) { System.out.println(ex); } } catch (SQLException e) { System.out.println(e); } } public static void leerMensajesDB() { Conexion db_connect = new Conexion(); PreparedStatement p = null; ResultSet rs = null; try (Connection conexion = db_connect.get_Connection()){ String query = "SELECT * FROM mensajes"; p = conexion.prepareStatement(query); rs = p.executeQuery(); while(rs.next()) { System.out.println("ID: " + rs.getInt("id_mensaje")); System.out.println("Mensaje: " + rs.getString("mensaje")); System.out.println("Autor: " + rs.getString("autor_mensaje")); System.out.println("Fecha: " + rs.getString("fecha_mensaje")); System.out.println(""); } } catch (SQLException e) { System.out.println("Error: no se pudieron recuperar los mensajes."); System.out.println(e); } } public static void borrarMensajeDB(int id_mensaje) { Conexion db_connect = new Conexion(); try (Connection conexion = db_connect.get_Connection()){ PreparedStatement p = null; try { String query = "DELETE FROM mensajes WHERE ID_MENSAJE = ? "; p = conexion.prepareStatement(query); p.setInt(1, id_mensaje); p.executeUpdate(); System.out.println("Mensaje Eliminado"); } catch (SQLException e) { System.out.println(e); System.out.println("Mensaje no eliminado"); } } catch (SQLException e) { System.out.println(e); } } public static void actualizarMensajeDB(Mensajes mensaje) { Conexion db_connect = new Conexion(); try (Connection conexion = db_connect.get_Connection()){ PreparedStatement p = null; try { String query = "UPDATE mensajes SET MENSAJE = ? WHERE ID_MENSAJE = ? "; p = conexion.prepareStatement(query); p.setString(1, mensaje.getMensaje()); p.setInt(2, mensaje.getId_mensaje()); p.executeUpdate(); System.out.println("Mensaje se atualizó correctamente"); } catch (SQLException e) { System.out.println(e); System.out.println("Falla al actualizar"); } } catch (SQLException e) { System.out.println(e); } } }
32.169492
92
0.518177
64df8115aa60e7db8bea4c88ebd5aac8ed744302
2,727
java
Java
secretBlogBoot-Generation/src/main/java/cn/chenc/blog/generation/MybatisPlusGeneration.java
chenCmengmengda/secretBlogBoot
69c80ca57c46f425cd170cdf085ebc7ede90d319
[ "Apache-2.0" ]
1
2020-08-06T08:32:25.000Z
2020-08-06T08:32:25.000Z
secretBlogBoot-Generation/src/main/java/cn/chenc/blog/generation/MybatisPlusGeneration.java
chenCmengmengda/secretBlogBoot
69c80ca57c46f425cd170cdf085ebc7ede90d319
[ "Apache-2.0" ]
null
null
null
secretBlogBoot-Generation/src/main/java/cn/chenc/blog/generation/MybatisPlusGeneration.java
chenCmengmengda/secretBlogBoot
69c80ca57c46f425cd170cdf085ebc7ede90d319
[ "Apache-2.0" ]
null
null
null
package cn.chenc.blog.generation; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.config.DataSourceConfig; import com.baomidou.mybatisplus.generator.config.GlobalConfig; import com.baomidou.mybatisplus.generator.config.PackageConfig; import com.baomidou.mybatisplus.generator.config.StrategyConfig; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; /** *  @description: TODO *  @author 陈_C *  @date 2020/3/21 22:20 * */ public class MybatisPlusGeneration { public static void main(String[] args) { AutoGenerator mpg = new AutoGenerator(); // 全局配置 GlobalConfig gc = new GlobalConfig(); gc.setOutputDir(System.getProperty("user.dir")+"/secretBlogBoot-Generation" + "/src/main/java"); gc.setFileOverride(true); gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为false gc.setEnableCache(false);// XML 二级缓存 gc.setBaseResultMap(true);// XML ResultMap gc.setBaseColumnList(false);// XML columList gc.setAuthor("陈_C");// 作者 // 自定义文件命名,注意 %s 会自动填充表实体属性! gc.setControllerName("%sController"); gc.setServiceName("%sService"); gc.setServiceImplName("%sServiceImpl"); gc.setMapperName("%sMapper"); gc.setXmlName("%sMapper"); mpg.setGlobalConfig(gc); // 数据源配置 DataSourceConfig dsc = new DataSourceConfig(); dsc.setDbType(DbType.MYSQL); dsc.setDriverName("com.mysql.jdbc.Driver"); dsc.setUsername("root"); dsc.setPassword("111111"); dsc.setUrl("jdbc:mysql://127.0.0.1:3306/secretblogboot?useUnicode=true&useSSL=false&characterEncoding=utf8"); mpg.setDataSource(dsc); // 策略配置 StrategyConfig strategy = new StrategyConfig(); strategy.setTablePrefix(new String[] { "" });// 此处可以修改为您的表前缀 strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略 strategy.setInclude(new String[] { "article","article_category","article_label_key" ,"article_label"}); // 需要生成的表 strategy.setSuperServiceClass(null); strategy.setSuperServiceImplClass(null); strategy.setSuperMapperClass(null); mpg.setStrategy(strategy); // 包配置 PackageConfig pc = new PackageConfig(); pc.setParent("cn.chenc.blog"); pc.setController("controller"); pc.setService("business.service"); pc.setServiceImpl("business.service.impl"); pc.setMapper("business.mapper"); pc.setEntity("business.entity"); pc.setXml("xml"); mpg.setPackageInfo(pc); // 执行生成 mpg.execute(); } }
35.415584
121
0.671067
281048d121855b9e35d4ee9e66bbfdc0ccac8f20
48,355
cxx
C++
pkgs/tools/cmake/src/Source/cmDocumentation.cxx
relokin/parsec
75d63d9bd2368913343be9037e301947ecf78f7f
[ "BSD-3-Clause" ]
2
2017-04-24T22:37:28.000Z
2020-05-26T01:57:37.000Z
pkgs/tools/cmake/src/Source/cmDocumentation.cxx
cota/parsec2-aarch64
cdf7da348afd231dbe067266f24dc14d22f5cebf
[ "BSD-3-Clause" ]
null
null
null
pkgs/tools/cmake/src/Source/cmDocumentation.cxx
cota/parsec2-aarch64
cdf7da348afd231dbe067266f24dc14d22f5cebf
[ "BSD-3-Clause" ]
null
null
null
/*========================================================================= Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmDocumentation.cxx,v $ Language: C++ Date: $Date: 2008-07-22 18:04:24 $ Version: $Revision: 1.69.2.1 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "cmDocumentation.h" #include "cmSystemTools.h" #include "cmVersion.h" #include <cmsys/Directory.hxx> //---------------------------------------------------------------------------- static const char *cmDocumentationStandardOptions[][3] = { {"--copyright [file]", "Print the CMake copyright and exit.", "If a file is specified, the copyright is written into it."}, {"--help", "Print usage information and exit.", "Usage describes the basic command line interface and its options."}, {"--help-full [file]", "Print full help and exit.", "Full help displays most of the documentation provided by the UNIX " "man page. It is provided for use on non-UNIX platforms, but is " "also convenient if the man page is not installed. If a file is " "specified, the help is written into it."}, {"--help-html [file]", "Print full help in HTML format.", "This option is used by CMake authors to help produce web pages. " "If a file is specified, the help is written into it."}, {"--help-man [file]", "Print full help as a UNIX man page and exit.", "This option is used by the cmake build to generate the UNIX man page. " "If a file is specified, the help is written into it."}, {"--version [file]", "Show program name/version banner and exit.", "If a file is specified, the version is written into it."}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmModulesDocumentationDescription[][3] = { {0, " CMake Modules - Modules coming with CMake, the Cross-Platform Makefile " "Generator.", 0}, // CMAKE_DOCUMENTATION_OVERVIEW, {0, "This is the documentation for the modules and scripts coming with CMake. " "Using these modules you can check the computer system for " "installed software packages, features of the compiler and the " "existance of headers to name just a few.", 0}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmCustomModulesDocumentationDescription[][3] = { {0, " Custom CMake Modules - Additional Modules for CMake.", 0}, // CMAKE_DOCUMENTATION_OVERVIEW, {0, "This is the documentation for additional modules and scripts for CMake. " "Using these modules you can check the computer system for " "installed software packages, features of the compiler and the " "existance of headers to name just a few.", 0}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmPropertiesDocumentationDescription[][3] = { {0, " CMake Properties - Properties supported by CMake, " "the Cross-Platform Makefile Generator.", 0}, // CMAKE_DOCUMENTATION_OVERVIEW, {0, "This is the documentation for the properties supported by CMake. " "Properties can have different scopes. They can either be assigned to a " "source file, a directory, a target or globally to CMake. By modifying the " "values of properties the behaviour of the build system can be customized.", 0}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmCompatCommandsDocumentationDescription[][3] = { {0, " CMake Compatibility Listfile Commands - " "Obsolete commands supported by CMake for compatibility.", 0}, // CMAKE_DOCUMENTATION_OVERVIEW, {0, "This is the documentation for now obsolete listfile commands from previous " "CMake versions, which are still supported for compatibility reasons. You " "should instead use the newer, faster and shinier new commands. ;-)", 0}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmDocumentationModulesHeader[][3] = { {0, "The following modules are provided with CMake. " "They can be used with INCLUDE(ModuleName).", 0}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmDocumentationCustomModulesHeader[][3] = { {0, "The following modules are also available for CMake. " "They can be used with INCLUDE(ModuleName).", 0}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmDocumentationGeneratorsHeader[][3] = { {0, "The following generators are available on this platform:", 0}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmDocumentationStandardSeeAlso[][3] = { {0, "The following resources are available to get help using CMake:", 0}, {"Home Page", "http://www.cmake.org", "The primary starting point for learning about CMake."}, {"Frequently Asked Questions", "http://www.cmake.org/Wiki/CMake_FAQ", "A Wiki is provided containing answers to frequently asked questions. "}, {"Online Documentation", "http://www.cmake.org/HTML/Documentation.html", "Links to available documentation may be found on this web page."}, {"Mailing List", "http://www.cmake.org/HTML/MailingLists.html", "For help and discussion about using cmake, a mailing list is provided at " "cmake@cmake.org. " "The list is member-post-only but one may sign up on the CMake web page. " "Please first read the full documentation at " "http://www.cmake.org before posting questions to the list."}, {0, "Summary of helpful links:\n" " Home: http://www.cmake.org\n" " Docs: http://www.cmake.org/HTML/Documentation.html\n" " Mail: http://www.cmake.org/HTML/MailingLists.html\n" " FAQ: http://www.cmake.org/Wiki/CMake_FAQ\n" , 0}, {0,0,0} }; //---------------------------------------------------------------------------- static const char *cmDocumentationCopyright[][3] = { {0, "Copyright (c) 2002 Kitware, Inc., Insight Consortium. " "All rights reserved.", 0}, {0, "Redistribution and use in source and binary forms, with or without " "modification, are permitted provided that the following conditions are " "met:", 0}, {"", "Redistributions of source code must retain the above copyright notice, " "this list of conditions and the following disclaimer.", 0}, {"", "Redistributions in binary form must reproduce the above copyright " "notice, this list of conditions and the following disclaimer in the " "documentation and/or other materials provided with the distribution.", 0}, {"", "The names of Kitware, Inc., the Insight Consortium, or the names of " "any consortium members, or of any contributors, may not be used to " "endorse or promote products derived from this software without " "specific prior written permission.", 0}, {"", "Modified source versions must be plainly marked as such, and must " "not be misrepresented as being the original software.", 0}, {0, "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS " "``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT " "LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR " "A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR " "CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, " "EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, " "PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR " "PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF " "LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING " "NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS " "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", 0}, {0, 0, 0} }; //---------------------------------------------------------------------------- cmDocumentation::cmDocumentation() :CurrentFormatter(0) { this->SetForm(TextForm); cmDocumentationSection *sec; sec = new cmDocumentationSection("Author","AUTHOR"); sec->Append(cmDocumentationEntry (0, "This manual page was generated by the \"--help-man\" option.", 0)); this->AllSections["Author"] = sec; sec = new cmDocumentationSection("Copyright","COPYRIGHT"); sec->Append(cmDocumentationCopyright); this->AllSections["Copyright"] = sec; sec = new cmDocumentationSection("See Also","SEE ALSO"); sec->Append(cmDocumentationStandardSeeAlso); this->AllSections["Standard See Also"] = sec; sec = new cmDocumentationSection("Options","OPTIONS"); sec->Append(cmDocumentationStandardOptions); this->AllSections["Options"] = sec; sec = new cmDocumentationSection("Properties","PROPERTIES"); sec->Append(cmPropertiesDocumentationDescription); this->AllSections["Properties Description"] = sec; sec = new cmDocumentationSection("Generators","GENERATORS"); sec->Append(cmDocumentationGeneratorsHeader); this->AllSections["Generators"] = sec; sec = new cmDocumentationSection("Compatibility Commands", "COMPATIBILITY COMMANDS"); sec->Append(cmCompatCommandsDocumentationDescription); this->AllSections["Compatibility Commands"] = sec; this->PropertySections.push_back("Properties of Global Scope"); this->PropertySections.push_back("Properties on Directories"); this->PropertySections.push_back("Properties on Targets"); this->PropertySections.push_back("Properties on Tests"); this->PropertySections.push_back("Properties on Source Files"); this->VariableSections.push_back("Variables that Provide Information"); this->VariableSections.push_back("Variables That Change Behavior"); this->VariableSections.push_back("Variables That Describe the System"); this->VariableSections.push_back("Variables that Control the Build"); this->VariableSections.push_back("Variables for Languages"); } //---------------------------------------------------------------------------- cmDocumentation::~cmDocumentation() { for(std::vector< char* >::iterator i = this->ModuleStrings.begin(); i != this->ModuleStrings.end(); ++i) { delete [] *i; } for(std::map<std::string,cmDocumentationSection *>::iterator i = this->AllSections.begin(); i != this->AllSections.end(); ++i) { delete i->second; } } //---------------------------------------------------------------------------- bool cmDocumentation::PrintCopyright(std::ostream& os) { cmDocumentationSection *sec = this->AllSections["Copyright"]; const std::vector<cmDocumentationEntry> &entries = sec->GetEntries(); for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end(); ++op) { if(op->Name.size()) { os << " * "; this->TextFormatter.SetIndent(" "); this->TextFormatter.PrintColumn(os, op->Brief.c_str()); } else { this->TextFormatter.SetIndent(""); this->TextFormatter.PrintColumn(os, op->Brief.c_str()); } os << "\n"; } return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintVersion(std::ostream& os) { os << this->GetNameString() << " version " << cmVersion::GetCMakeVersion() << "\n"; return true; } //---------------------------------------------------------------------------- void cmDocumentation::AddSectionToPrint(const char *section) { if (this->AllSections.find(section) != this->AllSections.end()) { this->PrintSections.push_back(this->AllSections[section]); } } //---------------------------------------------------------------------------- void cmDocumentation::ClearSections() { this->PrintSections.erase(this->PrintSections.begin(), this->PrintSections.end()); this->ModulesFound.clear(); } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os) { if ((this->CurrentFormatter->GetForm() != HTMLForm) && (this->CurrentFormatter->GetForm() != DocbookForm) && (this->CurrentFormatter->GetForm() != ManForm)) { this->PrintVersion(os); } switch (ht) { case cmDocumentation::Usage: return this->PrintDocumentationUsage(os); case cmDocumentation::Single: return this->PrintDocumentationSingle(os); case cmDocumentation::SingleModule: return this->PrintDocumentationSingleModule(os); case cmDocumentation::SinglePolicy: return this->PrintDocumentationSinglePolicy(os); case cmDocumentation::SingleProperty: return this->PrintDocumentationSingleProperty(os); case cmDocumentation::SingleVariable: return this->PrintDocumentationSingleVariable(os); case cmDocumentation::List: this->PrintDocumentationList(os,"Commands"); this->PrintDocumentationList(os,"Compatibility Commands"); return true; case cmDocumentation::ModuleList: // find the modules first, print the custom module docs only if // any custom modules have been found actually, Alex this->CreateCustomModulesSection(); this->CreateModulesSection(); if (this->AllSections.find("Custom CMake Modules") != this->AllSections.end()) { this->PrintDocumentationList(os,"Custom CMake Modules"); } this->PrintDocumentationList(os,"Modules"); return true; case cmDocumentation::PropertyList: this->PrintDocumentationList(os,"Properties Description"); for (std::vector<std::string>::iterator i = this->PropertySections.begin(); i != this->PropertySections.end(); ++i) { this->PrintDocumentationList(os,i->c_str()); } return true; case cmDocumentation::VariableList: for (std::vector<std::string>::iterator i = this->VariableSections.begin(); i != this->VariableSections.end(); ++i) { this->PrintDocumentationList(os,i->c_str()); } return true; case cmDocumentation::Full: return this->PrintDocumentationFull(os); case cmDocumentation::Modules: return this->PrintDocumentationModules(os); case cmDocumentation::CustomModules: return this->PrintDocumentationCustomModules(os); case cmDocumentation::Policies: return this->PrintDocumentationPolicies(os); case cmDocumentation::Properties: return this->PrintDocumentationProperties(os); case cmDocumentation::Variables: return this->PrintDocumentationVariables(os); case cmDocumentation::Commands: return this->PrintDocumentationCurrentCommands(os); case cmDocumentation::CompatCommands: return this->PrintDocumentationCompatCommands(os); case cmDocumentation::Copyright: return this->PrintCopyright(os); case cmDocumentation::Version: return true; default: return false; } } //---------------------------------------------------------------------------- bool cmDocumentation::CreateModulesSection() { cmDocumentationSection *sec = new cmDocumentationSection("Standard CMake Modules", "MODULES"); this->AllSections["Modules"] = sec; std::string cmakeModules = this->CMakeRoot; cmakeModules += "/Modules"; cmsys::Directory dir; dir.Load(cmakeModules.c_str()); if (dir.GetNumberOfFiles() > 0) { sec->Append(cmDocumentationModulesHeader[0]); sec->Append(cmModulesDocumentationDescription); this->CreateModuleDocsForDir(dir, *this->AllSections["Modules"]); } return true; } //---------------------------------------------------------------------------- bool cmDocumentation::CreateCustomModulesSection() { bool sectionHasHeader = false; std::vector<std::string> dirs; cmSystemTools::ExpandListArgument(this->CMakeModulePath, dirs); for(std::vector<std::string>::const_iterator dirIt = dirs.begin(); dirIt != dirs.end(); ++dirIt) { cmsys::Directory dir; dir.Load(dirIt->c_str()); if (dir.GetNumberOfFiles() > 0) { if (!sectionHasHeader) { cmDocumentationSection *sec = new cmDocumentationSection("Custom CMake Modules","CUSTOM MODULES"); this->AllSections["Custom CMake Modules"] = sec; sec->Append(cmDocumentationCustomModulesHeader[0]); sec->Append(cmCustomModulesDocumentationDescription); sectionHasHeader = true; } this->CreateModuleDocsForDir (dir, *this->AllSections["Custom CMake Modules"]); } } return true; } //---------------------------------------------------------------------------- void cmDocumentation ::CreateModuleDocsForDir(cmsys::Directory& dir, cmDocumentationSection &moduleSection) { // sort the files alphabetically, so the docs for one module are easier // to find than if they are in random order std::vector<std::string> sortedFiles; for(unsigned int i = 0; i < dir.GetNumberOfFiles(); ++i) { sortedFiles.push_back(dir.GetFile(i)); } std::sort(sortedFiles.begin(), sortedFiles.end()); for(std::vector<std::string>::const_iterator fname = sortedFiles.begin(); fname!=sortedFiles.end(); ++fname) { if(fname->length() > 6) { if(fname->substr(fname->length()-6, 6) == ".cmake") { std::string moduleName = fname->substr(0, fname->length()-6); // this check is to avoid creating documentation for the modules with // the same name in multiple directories of CMAKE_MODULE_PATH if (this->ModulesFound.find(moduleName) == this->ModulesFound.end()) { this->ModulesFound.insert(moduleName); std::string path = dir.GetPath(); path += "/"; path += (*fname); this->CreateSingleModule(path.c_str(), moduleName.c_str(), moduleSection); } } } } } //---------------------------------------------------------------------------- bool cmDocumentation::CreateSingleModule(const char* fname, const char* moduleName, cmDocumentationSection &moduleSection) { std::ifstream fin(fname); if(!fin) { std::cerr << "Internal error: can not open module." << fname << std::endl; return false; } std::string line; std::string text; std::string brief; brief = " "; bool newParagraph = true; while ( fin && cmSystemTools::GetLineFromStream(fin, line) ) { if(line.size() && line[0] == '#') { // blank line if(line.size() <= 2) { text += "\n"; newParagraph = true; } else if(line[2] == '-') { brief = line.c_str()+4; } else { // two spaces if(line[1] == ' ' && line[2] == ' ') { if(!newParagraph) { text += "\n"; newParagraph = true; } // Skip #, and leave space for preformatted text += line.c_str()+1; text += "\n"; } else if(line[1] == ' ') { if(!newParagraph) { text += " "; } newParagraph = false; // skip # and space text += line.c_str()+2; } else { if(!newParagraph) { text += " "; } newParagraph = false; // skip # text += line.c_str()+1; } } } else { if(text.length() < 2 && brief.length() == 1) { return false; } char* pname = strcpy(new char[strlen(moduleName)+1], moduleName); char* ptext = strcpy(new char[text.length()+1], text.c_str()); this->ModuleStrings.push_back(pname); this->ModuleStrings.push_back(ptext); char* pbrief = strcpy(new char[brief.length()+1], brief.c_str()); this->ModuleStrings.push_back(pbrief); moduleSection.Append(pname, pbrief, ptext); return true; } } return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os) { bool result = true; // Loop over requested documentation types. for(std::vector<RequestedHelpItem>::const_iterator i = this->RequestedHelpItems.begin(); i != this->RequestedHelpItems.end(); ++i) { this->SetForm(i->HelpForm); this->CurrentArgument = i->Argument; // If a file name was given, use it. Otherwise, default to the // given stream. std::ofstream* fout = 0; std::ostream* s = &os; if(i->Filename.length() > 0) { fout = new std::ofstream(i->Filename.c_str(), std::ios::out); if(fout) { s = fout; } else { result = false; } } // Print this documentation type to the stream. if(!this->PrintDocumentation(i->HelpType, *s) || !*s) { result = false; } // Close the file if we wrote one. if(fout) { delete fout; } } return result; } #define GET_OPT_ARGUMENT(target) \ if((i+1 < argc) && !this->IsOption(argv[i+1])) \ { \ target = argv[i+1]; \ i = i+1; \ }; cmDocumentation::Form cmDocumentation::GetFormFromFilename( const std::string& filename) { std::string ext = cmSystemTools::GetFilenameExtension(filename); ext = cmSystemTools::UpperCase(ext); if ((ext == ".HTM") || (ext == ".HTML")) { return cmDocumentation::HTMLForm; } if (ext == ".DOCBOOK") { return cmDocumentation::DocbookForm; } // ".1" to ".9" should be manpages if ((ext.length()==2) && (ext[1] >='1') && (ext[1]<='9')) { return cmDocumentation::ManForm; } return cmDocumentation::TextForm; } //---------------------------------------------------------------------------- bool cmDocumentation::CheckOptions(int argc, const char* const* argv) { // Providing zero arguments gives usage information. if(argc == 1) { RequestedHelpItem help; help.HelpType = cmDocumentation::Usage; help.HelpForm = cmDocumentation::UsageForm; this->RequestedHelpItems.push_back(help); return true; } // Search for supported help options. bool result = false; for(int i=1; i < argc; ++i) { RequestedHelpItem help; // Check if this is a supported help option. if((strcmp(argv[i], "-help") == 0) || (strcmp(argv[i], "--help") == 0) || (strcmp(argv[i], "/?") == 0) || (strcmp(argv[i], "-usage") == 0) || (strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "-H") == 0)) { help.HelpType = cmDocumentation::Usage; help.HelpForm = cmDocumentation::UsageForm; GET_OPT_ARGUMENT(help.Argument); help.Argument = cmSystemTools::LowerCase(help.Argument); // special case for single command if (!help.Argument.empty()) { help.HelpType = cmDocumentation::Single; } } else if(strcmp(argv[i], "--help-properties") == 0) { help.HelpType = cmDocumentation::Properties; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-policies") == 0) { help.HelpType = cmDocumentation::Policies; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-variables") == 0) { help.HelpType = cmDocumentation::Variables; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-modules") == 0) { help.HelpType = cmDocumentation::Modules; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-custom-modules") == 0) { help.HelpType = cmDocumentation::CustomModules; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-commands") == 0) { help.HelpType = cmDocumentation::Commands; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-compatcommands") == 0) { help.HelpType = cmDocumentation::CompatCommands; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-full") == 0) { help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-html") == 0) { help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::HTMLForm; } else if(strcmp(argv[i], "--help-man") == 0) { help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::ManForm; } else if(strcmp(argv[i], "--help-command") == 0) { help.HelpType = cmDocumentation::Single; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); help.Argument = cmSystemTools::LowerCase(help.Argument); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-module") == 0) { help.HelpType = cmDocumentation::SingleModule; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-property") == 0) { help.HelpType = cmDocumentation::SingleProperty; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-policy") == 0) { help.HelpType = cmDocumentation::SinglePolicy; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-variable") == 0) { help.HelpType = cmDocumentation::SingleVariable; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); help.HelpForm = this->GetFormFromFilename(help.Filename); } else if(strcmp(argv[i], "--help-command-list") == 0) { help.HelpType = cmDocumentation::List; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::TextForm; } else if(strcmp(argv[i], "--help-module-list") == 0) { help.HelpType = cmDocumentation::ModuleList; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::TextForm; } else if(strcmp(argv[i], "--help-property-list") == 0) { help.HelpType = cmDocumentation::PropertyList; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::TextForm; } else if(strcmp(argv[i], "--help-variable-list") == 0) { help.HelpType = cmDocumentation::VariableList; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::TextForm; } else if(strcmp(argv[i], "--copyright") == 0) { help.HelpType = cmDocumentation::Copyright; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::UsageForm; } else if((strcmp(argv[i], "--version") == 0) || (strcmp(argv[i], "-version") == 0) || (strcmp(argv[i], "/V") == 0)) { help.HelpType = cmDocumentation::Version; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::UsageForm; } if(help.HelpType != None) { // This is a help option. See if there is a file name given. result = true; this->RequestedHelpItems.push_back(help); } } return result; } //---------------------------------------------------------------------------- void cmDocumentation::Print(Form f, std::ostream& os) { this->SetForm(f); this->Print(os); } //---------------------------------------------------------------------------- void cmDocumentation::Print(std::ostream& os) { // if the formatter supports it, print a master index for // all sections this->CurrentFormatter->PrintIndex(os, this->PrintSections); for(unsigned int i=0; i < this->PrintSections.size(); ++i) { std::string name = this->PrintSections[i]-> GetName((this->CurrentFormatter->GetForm())); this->CurrentFormatter->PrintSection(os,*this->PrintSections[i], name.c_str()); } } //---------------------------------------------------------------------------- void cmDocumentation::SetName(const char* name) { this->NameString = name?name:""; } //---------------------------------------------------------------------------- void cmDocumentation::SetSection(const char *name, cmDocumentationSection *section) { if (this->AllSections.find(name) != this->AllSections.end()) { delete this->AllSections[name]; } this->AllSections[name] = section; } //---------------------------------------------------------------------------- void cmDocumentation::SetSection(const char *name, std::vector<cmDocumentationEntry> &docs) { cmDocumentationSection *sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); sec->Append(docs); this->SetSection(name,sec); } //---------------------------------------------------------------------------- void cmDocumentation::SetSection(const char *name, const char *docs[][3]) { cmDocumentationSection *sec = new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str()); sec->Append(docs); this->SetSection(name,sec); } //---------------------------------------------------------------------------- void cmDocumentation ::SetSections(std::map<std::string,cmDocumentationSection *> &sections) { for (std::map<std::string,cmDocumentationSection *>::const_iterator it = sections.begin(); it != sections.end(); ++it) { this->SetSection(it->first.c_str(),it->second); } } //---------------------------------------------------------------------------- void cmDocumentation::PrependSection(const char *name, const char *docs[][3]) { cmDocumentationSection *sec = 0; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection (name, cmSystemTools::UpperCase(name).c_str()); this->SetSection(name,sec); } else { sec = this->AllSections[name]; } sec->Prepend(docs); } //---------------------------------------------------------------------------- void cmDocumentation::PrependSection(const char *name, std::vector<cmDocumentationEntry> &docs) { cmDocumentationSection *sec = 0; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection (name, cmSystemTools::UpperCase(name).c_str()); this->SetSection(name,sec); } else { sec = this->AllSections[name]; } sec->Prepend(docs); } //---------------------------------------------------------------------------- void cmDocumentation::AppendSection(const char *name, const char *docs[][3]) { cmDocumentationSection *sec = 0; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection (name, cmSystemTools::UpperCase(name).c_str()); this->SetSection(name,sec); } else { sec = this->AllSections[name]; } sec->Append(docs); } //---------------------------------------------------------------------------- void cmDocumentation::AppendSection(const char *name, std::vector<cmDocumentationEntry> &docs) { cmDocumentationSection *sec = 0; if (this->AllSections.find(name) == this->AllSections.end()) { sec = new cmDocumentationSection (name, cmSystemTools::UpperCase(name).c_str()); this->SetSection(name,sec); } else { sec = this->AllSections[name]; } sec->Append(docs); } //---------------------------------------------------------------------------- void cmDocumentation::AppendSection(const char *name, cmDocumentationEntry &docs) { std::vector<cmDocumentationEntry> docsVec; docsVec.push_back(docs); this->AppendSection(name,docsVec); } //---------------------------------------------------------------------------- void cmDocumentation::PrependSection(const char *name, cmDocumentationEntry &docs) { std::vector<cmDocumentationEntry> docsVec; docsVec.push_back(docs); this->PrependSection(name,docsVec); } //---------------------------------------------------------------------------- void cmDocumentation::SetSeeAlsoList(const char *data[][3]) { cmDocumentationSection *sec = new cmDocumentationSection("See Also", "SEE ALSO"); this->AllSections["See Also"] = sec; this->SeeAlsoString = ".B "; int i = 0; while(data[i][1]) { this->SeeAlsoString += data[i][1]; this->SeeAlsoString += data[i+1][1]? "(1), ":"(1)"; ++i; } sec->Append(0,this->SeeAlsoString.c_str(),0); sec->Append(cmDocumentationStandardSeeAlso); } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationGeneric(std::ostream& os, const char *section) { if(this->AllSections.find(section) == this->AllSections.end()) { os << "Internal error: " << section << " list is empty." << std::endl; return false; } if(this->CurrentArgument.length() == 0) { os << "Required argument missing.\n"; return false; } const std::vector<cmDocumentationEntry> &entries = this->AllSections[section]->GetEntries(); for(std::vector<cmDocumentationEntry>::const_iterator ei = entries.begin(); ei != entries.end(); ++ei) { if(this->CurrentArgument == ei->Name) { this->PrintDocumentationCommand(os, *ei); return true; } } return false; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationSingle(std::ostream& os) { if (this->PrintDocumentationGeneric(os,"Commands")) { return true; } if (this->PrintDocumentationGeneric(os,"Compatibility Commands")) { return true; } // Argument was not a command. Complain. os << "Argument \"" << this->CurrentArgument.c_str() << "\" to --help-command is not a CMake command. " << "Use --help-command-list to see all commands.\n"; return false; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationSingleModule(std::ostream& os) { if(this->CurrentArgument.length() == 0) { os << "Argument --help-module needs a module name.\n"; return false; } std::string moduleName; // find the module std::vector<std::string> dirs; cmSystemTools::ExpandListArgument(this->CMakeModulePath, dirs); for(std::vector<std::string>::const_iterator dirIt = dirs.begin(); dirIt != dirs.end(); ++dirIt) { moduleName = *dirIt; moduleName += "/"; moduleName += this->CurrentArgument; moduleName += ".cmake"; if(cmSystemTools::FileExists(moduleName.c_str())) { break; } moduleName = ""; } if (moduleName.empty()) { moduleName = this->CMakeRoot; moduleName += "/Modules/"; moduleName += this->CurrentArgument; moduleName += ".cmake"; if(!cmSystemTools::FileExists(moduleName.c_str())) { moduleName = ""; } } if(!moduleName.empty()) { cmDocumentationSection *sec = new cmDocumentationSection("Standard CMake Modules", "MODULES"); this->AllSections["Modules"] = sec; if (this->CreateSingleModule(moduleName.c_str(), this->CurrentArgument.c_str(), *this->AllSections["Modules"])) { this->PrintDocumentationCommand (os, this->AllSections["Modules"]->GetEntries()[0]); os << "\n Defined in: "; os << moduleName << "\n"; return true; } } // Argument was not a module. Complain. os << "Argument \"" << this->CurrentArgument.c_str() << "\" to --help-module is not a CMake module.\n"; return false; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationSingleProperty(std::ostream& os) { bool done = false; for (std::vector<std::string>::iterator i = this->PropertySections.begin(); !done && i != this->PropertySections.end(); ++i) { done = this->PrintDocumentationGeneric(os,i->c_str()); } if (done) { return true; } // Argument was not a command. Complain. os << "Argument \"" << this->CurrentArgument.c_str() << "\" to --help-property is not a CMake property. " << "Use --help-property-list to see all properties.\n"; return false; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationSinglePolicy(std::ostream& os) { if (this->PrintDocumentationGeneric(os,"Policies")) { return true; } // Argument was not a command. Complain. os << "Argument \"" << this->CurrentArgument.c_str() << "\" to --help-policy is not a CMake policy.\n"; return false; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationSingleVariable(std::ostream& os) { bool done = false; for (std::vector<std::string>::iterator i = this->VariableSections.begin(); !done && i != this->VariableSections.end(); ++i) { done = this->PrintDocumentationGeneric(os,i->c_str()); } if (done) { return true; } // Argument was not a command. Complain. os << "Argument \"" << this->CurrentArgument.c_str() << "\" to --help-variable is not a defined variable. " << "Use --help-variable-list to see all defined variables.\n"; return false; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationList(std::ostream& os, const char *section) { if(this->AllSections.find(section) == this->AllSections.end()) { os << "Internal error: " << section << " list is empty." << std::endl; return false; } const std::vector<cmDocumentationEntry> &entries = this->AllSections[section]->GetEntries(); for(std::vector<cmDocumentationEntry>::const_iterator ei = entries.begin(); ei != entries.end(); ++ei) { if(ei->Name.size()) { os << ei->Name << std::endl; } } return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationUsage(std::ostream& os) { this->ClearSections(); this->AddSectionToPrint("Usage"); this->AddSectionToPrint("Options"); this->AddSectionToPrint("Generators"); this->Print(os); return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationFull(std::ostream& os) { this->CreateFullDocumentation(); this->CurrentFormatter->PrintHeader(GetNameString(), os); this->Print(os); this->CurrentFormatter->PrintFooter(os); return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationModules(std::ostream& os) { this->ClearSections(); this->CreateModulesSection(); this->AddSectionToPrint("Description"); this->AddSectionToPrint("Modules"); this->AddSectionToPrint("Copyright"); this->AddSectionToPrint("See Also"); this->CurrentFormatter->PrintHeader(this->GetNameString(), os); this->Print(os); this->CurrentFormatter->PrintFooter(os); return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationCustomModules(std::ostream& os) { this->ClearSections(); this->CreateCustomModulesSection(); this->AddSectionToPrint("Description"); this->AddSectionToPrint("Custom CMake Modules"); // the custom modules are most probably not under Kitware's copyright, Alex // this->AddSectionToPrint("Copyright"); this->AddSectionToPrint("See Also"); this->CurrentFormatter->PrintHeader(this->GetNameString(), os); this->Print(os); this->CurrentFormatter->PrintFooter(os); return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationPolicies(std::ostream& os) { this->ClearSections(); this->AddSectionToPrint("Description"); this->AddSectionToPrint("Policies"); this->AddSectionToPrint("Copyright"); this->AddSectionToPrint("See Also"); this->CurrentFormatter->PrintHeader(this->GetNameString(), os); this->Print(os); this->CurrentFormatter->PrintFooter(os); return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationProperties(std::ostream& os) { this->ClearSections(); this->AddSectionToPrint("Properties Description"); for (std::vector<std::string>::iterator i = this->PropertySections.begin(); i != this->PropertySections.end(); ++i) { this->AddSectionToPrint(i->c_str()); } this->AddSectionToPrint("Copyright"); this->AddSectionToPrint("Standard See Also"); this->CurrentFormatter->PrintHeader(this->GetNameString(), os); this->Print(os); this->CurrentFormatter->PrintFooter(os); return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationVariables(std::ostream& os) { this->ClearSections(); for (std::vector<std::string>::iterator i = this->VariableSections.begin(); i != this->VariableSections.end(); ++i) { this->AddSectionToPrint(i->c_str()); } this->AddSectionToPrint("Copyright"); this->AddSectionToPrint("Standard See Also"); this->CurrentFormatter->PrintHeader(this->GetNameString(), os); this->Print(os); this->CurrentFormatter->PrintFooter(os); return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationCurrentCommands(std::ostream& os) { this->ClearSections(); this->AddSectionToPrint("Commands"); this->AddSectionToPrint("Copyright"); this->AddSectionToPrint("Standard See Also"); this->CurrentFormatter->PrintHeader(this->GetNameString(), os); this->Print(os); this->CurrentFormatter->PrintFooter(os); return true; } //---------------------------------------------------------------------------- bool cmDocumentation::PrintDocumentationCompatCommands(std::ostream& os) { this->ClearSections(); this->AddSectionToPrint("Compatibility Commands Description"); this->AddSectionToPrint("Compatibility Commands"); this->AddSectionToPrint("Copyright"); this->AddSectionToPrint("Standard See Also"); this->CurrentFormatter->PrintHeader(GetNameString(), os); this->Print(os); this->CurrentFormatter->PrintFooter(os); return true; } //---------------------------------------------------------------------------- void cmDocumentation ::PrintDocumentationCommand(std::ostream& os, const cmDocumentationEntry &entry) { // the string "SingleItem" will be used in a few places to detect the case // that only the documentation for a single item is printed cmDocumentationSection *sec = new cmDocumentationSection("SingleItem",""); sec->Append(entry); this->AllSections["temp"] = sec; this->ClearSections(); this->AddSectionToPrint("temp"); this->Print(os); this->AllSections.erase("temp"); delete sec; } //---------------------------------------------------------------------------- void cmDocumentation::CreateFullDocumentation() { this->ClearSections(); this->CreateCustomModulesSection(); this->CreateModulesSection(); std::set<std::string> emitted; this->AddSectionToPrint("Name"); emitted.insert("Name"); this->AddSectionToPrint("Usage"); emitted.insert("Usage"); this->AddSectionToPrint("Description"); emitted.insert("Description"); this->AddSectionToPrint("Options"); emitted.insert("Options"); this->AddSectionToPrint("Generators"); emitted.insert("Generators"); this->AddSectionToPrint("Commands"); emitted.insert("Commands"); this->AddSectionToPrint("Properties Description"); emitted.insert("Properties Description"); for (std::vector<std::string>::iterator i = this->PropertySections.begin(); i != this->PropertySections.end(); ++i) { this->AddSectionToPrint(i->c_str()); emitted.insert(i->c_str()); } emitted.insert("Copyright"); emitted.insert("See Also"); emitted.insert("Standard See Also"); emitted.insert("Author"); // add any sections not yet written out, or to be written out for (std::map<std::string, cmDocumentationSection*>::iterator i = this->AllSections.begin(); i != this->AllSections.end(); ++i) { if (emitted.find(i->first) == emitted.end()) { this->AddSectionToPrint(i->first.c_str()); } } this->AddSectionToPrint("Copyright"); if(this->CurrentFormatter->GetForm() == ManForm) { this->AddSectionToPrint("See Also"); this->AddSectionToPrint("Author"); } else { this->AddSectionToPrint("Standard See Also"); } } //---------------------------------------------------------------------------- void cmDocumentation::SetForm(Form f) { switch(f) { case HTMLForm: this->CurrentFormatter = &this->HTMLFormatter; break; case DocbookForm: this->CurrentFormatter = &this->DocbookFormatter; break; case ManForm: this->CurrentFormatter = &this->ManFormatter; break; case TextForm: this->CurrentFormatter = &this->TextFormatter; break; case UsageForm: this->CurrentFormatter = & this->UsageFormatter; break; } } //---------------------------------------------------------------------------- const char* cmDocumentation::GetNameString() const { if(this->NameString.length() > 0) { return this->NameString.c_str(); } else { return "CMake"; } } //---------------------------------------------------------------------------- bool cmDocumentation::IsOption(const char* arg) const { return ((arg[0] == '-') || (strcmp(arg, "/V") == 0) || (strcmp(arg, "/?") == 0)); }
32.91695
79
0.576135
e838b6a79d936fad2ffce7f60bf42f52dd530ea5
426
dart
Dart
lib/entitlement_wrapper.dart
LaraDP/purchases-flutter
ec4ebb962fbbb46194db43dd634b7eeeadbc23ec
[ "MIT" ]
null
null
null
lib/entitlement_wrapper.dart
LaraDP/purchases-flutter
ec4ebb962fbbb46194db43dd634b7eeeadbc23ec
[ "MIT" ]
null
null
null
lib/entitlement_wrapper.dart
LaraDP/purchases-flutter
ec4ebb962fbbb46194db43dd634b7eeeadbc23ec
[ "MIT" ]
null
null
null
import 'object_wrappers.dart'; class Entitlement { // Map of offerings to their active product for the current platform final Map<String, Product> offerings; Entitlement.fromJson(Map<dynamic, dynamic> json) : offerings = json.map((key, value) => MapEntry(key, value != null ? Product.fromJson(value) : null)); @override String toString() { return 'Entitlement{offerings: $offerings}'; } }
26.625
75
0.683099
8811de06de8e655f697360e233f52e9f55bc24c4
10,485
cpp
C++
src/hardware/vga_pc98_egc.cpp
mediaexplorer74/dosbox-x
be9f94b740234f7813bf5a063a558cef9dc7f9a6
[ "MIT" ]
3
2022-02-20T11:06:29.000Z
2022-03-11T08:16:55.000Z
src/hardware/vga_pc98_egc.cpp
mediaexplorer74/dosbox-x
be9f94b740234f7813bf5a063a558cef9dc7f9a6
[ "MIT" ]
null
null
null
src/hardware/vga_pc98_egc.cpp
mediaexplorer74/dosbox-x
be9f94b740234f7813bf5a063a558cef9dc7f9a6
[ "MIT" ]
null
null
null
/* * Copyright (C) 2018-2020 Jon Campbell * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "dosbox.h" #include "logging.h" #include "setup.h" #include "video.h" #include "pic.h" #include "vga.h" #include "inout.h" #include "programs.h" #include "support.h" #include "setup.h" #include "timer.h" #include "mem.h" #include "util_units.h" #include "control.h" #include "pc98_cg.h" #include "pc98_dac.h" #include "pc98_gdc.h" #include "pc98_gdc_const.h" #include "mixer.h" #include <string.h> #include <stdlib.h> #include <string> #include <stdio.h> #if defined(_MSC_VER) #pragma warning(disable:4065) /* switch statements without case labels */ #endif void pc98_egc_shift_reinit(); extern egc_quad pc98_egc_bgcm; extern egc_quad pc98_egc_fgcm; uint16_t pc98_egc_raw_values[8] = {0}; uint8_t pc98_egc_access=0; uint8_t pc98_egc_srcmask[2]; /* host given (Neko: egc.srcmask) */ uint8_t pc98_egc_maskef[2]; /* effective (Neko: egc.mask2) */ uint8_t pc98_egc_mask[2]; /* host given (Neko: egc.mask) */ uint8_t pc98_egc_fgc = 0; uint8_t pc98_egc_lead_plane = 0; uint8_t pc98_egc_compare_lead = 0; uint8_t pc98_egc_lightsource = 0; uint8_t pc98_egc_shiftinput = 0; uint8_t pc98_egc_regload = 0; uint8_t pc98_egc_rop = 0xF0; uint8_t pc98_egc_foreground_color = 0; uint8_t pc98_egc_background_color = 0; bool pc98_egc_shift_descend = false; uint8_t pc98_egc_shift_destbit = 0; uint8_t pc98_egc_shift_srcbit = 0; uint16_t pc98_egc_shift_length = 0xF; Bitu pc98_egc4a0_read(Bitu port,Bitu iolen) { (void)iolen;//UNUSED /* Neko Project II suggests the I/O ports disappear when not in EGC mode. * Is that true? */ if (!(pc98_gdc_vramop & (1 << VOPBIT_EGC))) { // LOG_MSG("EGC 4A0 read port 0x%x when EGC not enabled",(unsigned int)port); return ~0ul; } /* assume: (port & 1) == 0 [even] and iolen == 2 */ switch (port & 0x0E) { default: LOG_MSG("PC-98 EGC: Unhandled read from 0x%x",(unsigned int)port); break; } return ~0ul; } void pc98_egc4a0_write(Bitu port,Bitu val,Bitu iolen) { (void)iolen;//UNUSED /* Neko Project II suggests the I/O ports disappear when not in EGC mode. * Is that true? */ if (!(pc98_gdc_vramop & (1 << VOPBIT_EGC))) { // LOG_MSG("EGC 4A0 write port 0x%x when EGC not enabled",(unsigned int)port); return; } pc98_egc_raw_values[(port>>1u)&7u] = (uint16_t)val; /* assume: (port & 1) == 0 [even] and iolen == 2 */ switch (port & 0x0E) { case 0x0: /* 0x4A0 */ /* bits [15:8] = 0xFF * bits [7:0] = enable writing to plane (NTS: only bits 3-0 have meaning in 16-color mode). * as far as I can tell, bits [7:0] correspond to the same enable bits as port 0x7C [3:0] */ pc98_egc_access = val & 0xFF; break; case 0x2: /* 0x4A2 */ /* bits [15:15] = 0 * bits [14:13] = foreground, background color * 11 = invalid * 10 = foreground color * 01 = background color * 00 = pattern register * bits [12:12] = 0 * bits [11:8] = lead plane * 0111 = VRAM plane #7 * 0110 = VRAM plane #6 * 0101 = VRAM plane #5 * 0100 = VRAM plane #4 * 0011 = VRAM plane #3 * 0010 = VRAM plane #2 * 0001 = VRAM plane #1 * 0000 = VRAM plane #0 * bits [7:0] = unused (0xFF) */ pc98_egc_fgc = (val >> 13) & 3; pc98_egc_lead_plane = (val >> 8) & 15; break; case 0x4: /* 0x4A4 */ /* bits [15:14] = 0 (unused) * bits [13:13] = 0=compare lead plane 1=don't * bits [12:11] = light source * 11 = invalid * 10 = write the contents of the palette register * 01 = write the result of the raster operation * 00 = write CPU data * bits [10:10] = read source * 1 = shifter input is CPU write data * 0 = shifter input is VRAM data * bits [9:8] = register load * 11 = invalid * 10 = load VRAM data before writing on VRAM write * 01 = load VRAM data into pattern/tile register on VRAM read * 00 = Do not change pattern/tile register * bits [7:0] = ROP * shifter: 11110000 * destination: 11001100 * pattern reg: 10101010 * * examples: * 11110000 = VRAM transfer * 00001111 = VRAM reverse transfer * 11001100 = NOP * 00110011 = VRAM inversion * 11111111 = VRAM fill * 00000000 = VRAM erase * 10101010 = Pattern fill * 01010101 = Pattern reversal fill */ pc98_egc_compare_lead = ((val >> 13) & 1) ^ 1; pc98_egc_lightsource = (val >> 11) & 3; pc98_egc_shiftinput = (val >> 10) & 1; pc98_egc_regload = (val >> 8) & 3; pc98_egc_rop = (val & 0xFF); break; case 0x6: /* 0x4A6 */ /* If FGC = 0 and BGC = 0: * bits [15:0] = 0 * If FGC = 1 or BGC = 1: * bits [15:8] = 0 * bits [7:0] = foreground color (all 8 bits used in 256-color mode) */ pc98_egc_foreground_color = (uint8_t)val; pc98_egc_fgcm[0].w = (val & 1) ? 0xFFFF : 0x0000; pc98_egc_fgcm[1].w = (val & 2) ? 0xFFFF : 0x0000; pc98_egc_fgcm[2].w = (val & 4) ? 0xFFFF : 0x0000; pc98_egc_fgcm[3].w = (val & 8) ? 0xFFFF : 0x0000; break; case 0x8: /* 0x4A8 */ if (pc98_egc_fgc == 0) *((uint16_t*)pc98_egc_mask) = (uint16_t)val; break; case 0xA: /* 0x4AA */ /* If FGC = 0 and BGC = 0: * bits [15:0] = 0 * If FGC = 1 or BGC = 1: * bits [15:8] = 0 * bits [7:0] = foreground color (all 8 bits used in 256-color mode) */ pc98_egc_background_color = (uint8_t)val; pc98_egc_bgcm[0].w = (val & 1) ? 0xFFFF : 0x0000; pc98_egc_bgcm[1].w = (val & 2) ? 0xFFFF : 0x0000; pc98_egc_bgcm[2].w = (val & 4) ? 0xFFFF : 0x0000; pc98_egc_bgcm[3].w = (val & 8) ? 0xFFFF : 0x0000; break; case 0xC: /* 0x4AC */ /* bits[15:13] = 0 * bits[12:12] = shift direction 0=ascend 1=descend * bits[11:8] = 0 * bits[7:4] = destination bit address * bits[3:0] = source bit address */ pc98_egc_shift_descend = !!((val >> 12) & 1); pc98_egc_shift_destbit = (val >> 4) & 0xF; pc98_egc_shift_srcbit = val & 0xF; pc98_egc_shift_reinit(); break; case 0xE: /* 0x4AE */ /* bits[15:12] = 0 * bits[11:0] = bit length (0 to 4095) */ pc98_egc_shift_length = val & 0xFFF; pc98_egc_shift_reinit(); break; default: // LOG_MSG("PC-98 EGC: Unhandled write to 0x%x val 0x%x",(unsigned int)port,(unsigned int)val); break; } } // I/O access to 0x4A0-0x4AF must be WORD sized and even port, or the system hangs if you try. Bitu pc98_egc4a0_read_warning(Bitu port,Bitu iolen) { /* Neko Project II suggests the I/O ports disappear when not in EGC mode. * Is that true? */ if (!(pc98_gdc_vramop & (1 << VOPBIT_EGC))) { // LOG_MSG("EGC 4A0 read port 0x%x when EGC not enabled",(unsigned int)port); return ~0ul; } LOG_MSG("PC-98 EGC warning: I/O read from port 0x%x (len=%u) known to possibly hang the system on real hardware", (unsigned int)port,(unsigned int)iolen); return ~0ul; } // I/O access to 0x4A0-0x4AF must be WORD sized and even port, or the system hangs if you try. void pc98_egc4a0_write_warning(Bitu port,Bitu val,Bitu iolen) { /* Neko Project II suggests the I/O ports disappear when not in EGC mode. * Is that true? */ if (!(pc98_gdc_vramop & (1 << VOPBIT_EGC))) { // LOG_MSG("EGC 4A0 write port 0x%x when EGC not enabled",(unsigned int)port); return; } if (port & 1) { pc98_egc_raw_values[(port>>1u)&7u] &= ~0xFF00u; pc98_egc_raw_values[(port>>1u)&7u] |= val << 8u; } else { pc98_egc_raw_values[(port>>1u)&7u] &= ~0xFFu; pc98_egc_raw_values[(port>>1u)&7u] |= val; } switch (port & 0xF) { case 0x6: /* if the BIOS reports EGC, many early games will write bytewise I/O to port 4A6h */ pc98_egc_foreground_color = (uint8_t)val; pc98_egc_fgcm[0].w = (val & 1) ? 0xFFFF : 0x0000; pc98_egc_fgcm[1].w = (val & 2) ? 0xFFFF : 0x0000; pc98_egc_fgcm[2].w = (val & 4) ? 0xFFFF : 0x0000; pc98_egc_fgcm[3].w = (val & 8) ? 0xFFFF : 0x0000; break; default: LOG_MSG("PC-98 EGC warning: I/O write to port 0x%x (val=0x%x len=%u) known to possibly hang the system on real hardware", (unsigned int)port,(unsigned int)val,(unsigned int)iolen); break; } }
38.833333
133
0.539056
890b2d20aabf01a15dda3a483673ea5b4de21813
45,912
sql
SQL
database/dump/region_city.sql
MallombasiMattawang/project
fe294201d1ec6a66dd00534f7e8dc629439d7eae
[ "BSD-3-Clause" ]
null
null
null
database/dump/region_city.sql
MallombasiMattawang/project
fe294201d1ec6a66dd00534f7e8dc629439d7eae
[ "BSD-3-Clause" ]
null
null
null
database/dump/region_city.sql
MallombasiMattawang/project
fe294201d1ec6a66dd00534f7e8dc629439d7eae
[ "BSD-3-Clause" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.5.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 18, 2016 at 11:53 AM -- Server version: 5.6.27-0ubuntu1 -- PHP Version: 5.6.11-1ubuntu3.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Database: `yii2_old` -- -- -- Dumping data for table `rgn_city` -- INSERT INTO `rgn_city` (`id`, `recordStatus`, `number`, `name`, `abbreviation`, `province_id`, `created_at`, `updated_at`, `deleted_at`, `createdBy_id`, `updatedBy_id`, `deletedBy_id`) VALUES (1, 'used', '1101', 'KAB. ACEH SELATAN', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (2, 'used', '1102', 'KAB. ACEH TENGGARA', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (3, 'used', '1103', 'KAB. ACEH TIMUR', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (4, 'used', '1104', 'KAB. ACEH TENGAH', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (5, 'used', '1105', 'KAB. ACEH BARAT', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (6, 'used', '1106', 'KAB. ACEH BESAR', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (7, 'used', '1107', 'KAB. PIDIE', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (8, 'used', '1108', 'KAB. ACEH UTARA', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (9, 'used', '1109', 'KAB. SIMEULUE', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (10, 'used', '1110', 'KAB. ACEH SINGKIL', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (11, 'used', '1111', 'KAB. BIREUEN', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (12, 'used', '1112', 'KAB. ACEH BARAT DAYA', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (13, 'used', '1113', 'KAB. GAYO LUES', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (14, 'used', '1114', 'KAB. ACEH JAYA', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (15, 'used', '1115', 'KAB. NAGAN RAYA', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (16, 'used', '1116', 'KAB. ACEH TAMIANG', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (17, 'used', '1117', 'KAB. BENER MERIAH', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (18, 'used', '1118', 'KAB. PIDIE JAYA', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (19, 'used', '1171', 'KOTA BANDA ACEH', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (20, 'used', '1172', 'KOTA SABANG', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (21, 'used', '1173', 'KOTA LHOKSEUMAWE', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (22, 'used', '1174', 'KOTA LANGSA', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (23, 'used', '1175', 'KOTA SUBULUSSALAM', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL), (24, 'used', '1201', 'KAB. TAPANULI TENGAH', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (25, 'used', '1202', 'KAB. TAPANULI UTARA', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (26, 'used', '1203', 'KAB. TAPANULI SELATAN', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (27, 'used', '1204', 'KAB. NIAS', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (28, 'used', '1205', 'KAB. LANGKAT', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (29, 'used', '1206', 'KAB. KARO', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (30, 'used', '1207', 'KAB. DELI SERDANG', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (31, 'used', '1208', 'KAB. SIMALUNGUN', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (32, 'used', '1209', 'KAB. ASAHAN', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (33, 'used', '1210', 'KAB. LABUHANBATU', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (34, 'used', '1211', 'KAB. DAIRI', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (35, 'used', '1212', 'KAB. TOBA SAMOSIR', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (36, 'used', '1213', 'KAB. MANDAILING NATAL', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (37, 'used', '1214', 'KAB. NIAS SELATAN', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (38, 'used', '1215', 'KAB. PAKPAK BHARAT', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (39, 'used', '1216', 'KAB. HUMBANG HASUNDUTAN', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (40, 'used', '1217', 'KAB. SAMOSIR', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (41, 'used', '1218', 'KAB. SERDANG BEDAGAI', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (42, 'used', '1219', 'KAB. BATU BARA', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (43, 'used', '1220', 'KAB. PADANG LAWAS UTARA', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (44, 'used', '1221', 'KAB. PADANG LAWAS', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (45, 'used', '1222', 'KAB. LABUHANBATU SELATAN', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (46, 'used', '1223', 'KAB. LABUHANBATU UTARA', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (47, 'used', '1224', 'KAB. NIAS UTARA', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (48, 'used', '1225', 'KAB. NIAS BARAT', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (49, 'used', '1271', 'KOTA MEDAN', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (50, 'used', '1272', 'KOTA PEMATANG SIANTAR', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (51, 'used', '1273', 'KOTA SIBOLGA', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (52, 'used', '1274', 'KOTA TANJUNG BALAI', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (53, 'used', '1275', 'KOTA BINJAI', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (54, 'used', '1276', 'KOTA TEBING TINGGI', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (55, 'used', '1277', 'KOTA PADANGSIDIMPUAN', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (56, 'used', '1278', 'KOTA GUNUNGSITOLI', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL), (57, 'used', '1301', 'KAB. PESISIR SELATAN', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (58, 'used', '1302', 'KAB. SOLOK', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (59, 'used', '1303', 'KAB. SIJUNJUNG', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (60, 'used', '1304', 'KAB. TANAH DATAR', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (61, 'used', '1305', 'KAB. PADANG PARIAMAN', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (62, 'used', '1306', 'KAB. AGAM', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (63, 'used', '1307', 'KAB. LIMA PULUH KOTA', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (64, 'used', '1308', 'KAB. PASAMAN', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (65, 'used', '1309', 'KAB. KEPULAUAN MENTAWAI', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (66, 'used', '1310', 'KAB. DHARMASRAYA', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (67, 'used', '1311', 'KAB. SOLOK SELATAN', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (68, 'used', '1312', 'KAB. PASAMAN BARAT', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (69, 'used', '1371', 'KOTA PADANG', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (70, 'used', '1372', 'KOTA SOLOK', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (71, 'used', '1373', 'KOTA SAWAHLUNTO', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (72, 'used', '1374', 'KOTA PADANG PANJANG', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (73, 'used', '1375', 'KOTA BUKITTINGGI', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (74, 'used', '1376', 'KOTA PAYAKUMBUH', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (75, 'used', '1377', 'KOTA PARIAMAN', NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL), (76, 'used', '1401', 'KAB. KAMPAR', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (77, 'used', '1402', 'KAB. INDRAGIRI HULU', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (78, 'used', '1403', 'KAB. BENGKALIS', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (79, 'used', '1404', 'KAB. INDRAGIRI HILIR', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (80, 'used', '1405', 'KAB. PELALAWAN', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (81, 'used', '1406', 'KAB. ROKAN HULU', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (82, 'used', '1407', 'KAB. ROKAN HILIR', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (83, 'used', '1408', 'KAB. SIAK', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (84, 'used', '1409', 'KAB. KUANTAN SINGINGI', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (85, 'used', '1410', 'KAB. KEPULAUAN MERANTI', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (86, 'used', '1471', 'KOTA PEKANBARU', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (87, 'used', '1472', 'KOTA DUMAI', NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL), (88, 'used', '1501', 'KAB. KERINCI', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (89, 'used', '1502', 'KAB. MERANGIN', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (90, 'used', '1503', 'KAB. SAROLANGUN', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (91, 'used', '1504', 'KAB. BATANGHARI', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (92, 'used', '1505', 'KAB. MUARO JAMBI', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (93, 'used', '1506', 'KAB. TANJUNG JABUNG BARAT', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (94, 'used', '1507', 'KAB. TANJUNG JABUNG TIMUR', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (95, 'used', '1508', 'KAB. BUNGO', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (96, 'used', '1509', 'KAB. TEBO', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (97, 'used', '1571', 'KOTA JAMBI', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (98, 'used', '1572', 'KOTA SUNGAI PENUH', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL), (99, 'used', '1601', 'KAB. OGAN KOMERING ULU', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (100, 'used', '1602', 'KAB. OGAN KOMERING ILIR', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (101, 'used', '1603', 'KAB. MUARA ENIM', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (102, 'used', '1604', 'KAB. LAHAT', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (103, 'used', '1605', 'KAB. MUSI RAWAS', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (104, 'used', '1606', 'KAB. MUSI BANYUASIN', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (105, 'used', '1607', 'KAB. BANYUASIN', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (106, 'used', '1608', 'KAB. OGAN KOMERING ULU TIMUR', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (107, 'used', '1609', 'KAB. OGAN KOMERING ULU SELATAN', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (108, 'used', '1610', 'KAB. OGAN ILIR', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (109, 'used', '1611', 'KAB. EMPAT LAWANG', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (110, 'used', '1612', 'KAB. PENUKAL ABAB LEMATANG ILIR', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (111, 'used', '1613', 'KAB. MUSI RAWAS UTARA', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (112, 'used', '1671', 'KOTA PALEMBANG', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (113, 'used', '1672', 'KOTA PAGAR ALAM', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (114, 'used', '1673', 'KOTA LUBUK LINGGAU', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (115, 'used', '1674', 'KOTA PRABUMULIH', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL), (116, 'used', '1701', 'KAB. BENGKULU SELATAN', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (117, 'used', '1702', 'KAB. REJANG LEBONG', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (118, 'used', '1703', 'KAB. BENGKULU UTARA', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (119, 'used', '1704', 'KAB. KAUR', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (120, 'used', '1705', 'KAB. SELUMA', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (121, 'used', '1706', 'KAB. MUKO MUKO', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (122, 'used', '1707', 'KAB. LEBONG', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (123, 'used', '1708', 'KAB. KEPAHIANG', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (124, 'used', '1709', 'KAB. BENGKULU TENGAH', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (125, 'used', '1771', 'KOTA BENGKULU', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL), (126, 'used', '1801', 'KAB. LAMPUNG SELATAN', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (127, 'used', '1802', 'KAB. LAMPUNG TENGAH', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (128, 'used', '1803', 'KAB. LAMPUNG UTARA', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (129, 'used', '1804', 'KAB. LAMPUNG BARAT', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (130, 'used', '1805', 'KAB. TULANG BAWANG', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (131, 'used', '1806', 'KAB. TANGGAMUS', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (132, 'used', '1807', 'KAB. LAMPUNG TIMUR', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (133, 'used', '1808', 'KAB. WAY KANAN', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (134, 'used', '1809', 'KAB. PESAWARAN', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (135, 'used', '1810', 'KAB. PRINGSEWU', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (136, 'used', '1811', 'KAB. MESUJI', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (137, 'used', '1812', 'KAB. TULANG BAWANG BARAT', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (138, 'used', '1813', 'KAB. PESISIR BARAT', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (139, 'used', '1871', 'KOTA BANDAR LAMPUNG', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (140, 'used', '1872', 'KOTA METRO', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL), (141, 'used', '1901', 'KAB. BANGKA', NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL), (142, 'used', '1902', 'KAB. BELITUNG', NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL), (143, 'used', '1903', 'KAB. BANGKA SELATAN', NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL), (144, 'used', '1904', 'KAB. BANGKA TENGAH', NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL), (145, 'used', '1905', 'KAB. BANGKA BARAT', NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL), (146, 'used', '1906', 'KAB. BELITUNG TIMUR', NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL), (147, 'used', '1971', 'KOTA PANGKAL PINANG', NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL), (148, 'used', '2101', 'KAB. BINTAN', NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL), (149, 'used', '2102', 'KAB. KARIMUN', NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL), (150, 'used', '2103', 'KAB. NATUNA', NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL), (151, 'used', '2104', 'KAB. LINGGA', NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL), (152, 'used', '2105', 'KAB. KEPULAUAN ANAMBAS', NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL), (153, 'used', '2171', 'KOTA BATAM', NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL), (154, 'used', '2172', 'KOTA TANJUNG PINANG', NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL), (155, 'used', '3101', 'KAB. ADM. KEP. SERIBU', NULL, 11, NULL, NULL, NULL, NULL, NULL, NULL), (156, 'used', '3171', 'KOTA ADM. JAKARTA PUSAT', NULL, 11, NULL, NULL, NULL, NULL, NULL, NULL), (157, 'used', '3172', 'KOTA ADM. JAKARTA UTARA', NULL, 11, NULL, NULL, NULL, NULL, NULL, NULL), (158, 'used', '3173', 'KOTA ADM. JAKARTA BARAT', NULL, 11, NULL, NULL, NULL, NULL, NULL, NULL), (159, 'used', '3174', 'KOTA ADM. JAKARTA SELATAN', NULL, 11, NULL, NULL, NULL, NULL, NULL, NULL), (160, 'used', '3175', 'KOTA ADM. JAKARTA TIMUR', NULL, 11, NULL, NULL, NULL, NULL, NULL, NULL), (161, 'used', '3201', 'KAB. BOGOR', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (162, 'used', '3202', 'KAB. SUKABUMI', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (163, 'used', '3203', 'KAB. CIANJUR', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (164, 'used', '3204', 'KAB. BANDUNG', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (165, 'used', '3205', 'KAB. GARUT', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (166, 'used', '3206', 'KAB. TASIKMALAYA', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (167, 'used', '3207', 'KAB. CIAMIS', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (168, 'used', '3208', 'KAB. KUNINGAN', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (169, 'used', '3209', 'KAB. CIREBON', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (170, 'used', '3210', 'KAB. MAJALENGKA', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (171, 'used', '3211', 'KAB. SUMEDANG', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (172, 'used', '3212', 'KAB. INDRAMAYU', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (173, 'used', '3213', 'KAB. SUBANG', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (174, 'used', '3214', 'KAB. PURWAKARTA', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (175, 'used', '3215', 'KAB. KARAWANG', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (176, 'used', '3216', 'KAB. BEKASI', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (177, 'used', '3217', 'KAB. BANDUNG BARAT', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (178, 'used', '3218', 'KAB. PANGANDARAN', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (179, 'used', '3271', 'KOTA BOGOR', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (180, 'used', '3272', 'KOTA SUKABUMI', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (181, 'used', '3273', 'KOTA BANDUNG', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (182, 'used', '3274', 'KOTA CIREBON', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (183, 'used', '3275', 'KOTA BEKASI', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (184, 'used', '3276', 'KOTA DEPOK', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (185, 'used', '3277', 'KOTA CIMAHI', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (186, 'used', '3278', 'KOTA TASIKMALAYA', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (187, 'used', '3279', 'KOTA BANJAR', NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL), (188, 'used', '3301', 'KAB. CILACAP', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (189, 'used', '3302', 'KAB. BANYUMAS', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (190, 'used', '3303', 'KAB. PURBALINGGA', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (191, 'used', '3304', 'KAB. BANJARNEGARA', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (192, 'used', '3305', 'KAB. KEBUMEN', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (193, 'used', '3306', 'KAB. PURWOREJO', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (194, 'used', '3307', 'KAB. WONOSOBO', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (195, 'used', '3308', 'KAB. MAGELANG', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (196, 'used', '3309', 'KAB. BOYOLALI', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (197, 'used', '3310', 'KAB. KLATEN', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (198, 'used', '3311', 'KAB. SUKOHARJO', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (199, 'used', '3312', 'KAB. WONOGIRI', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (200, 'used', '3313', 'KAB. KARANGANYAR', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (201, 'used', '3314', 'KAB. SRAGEN', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (202, 'used', '3315', 'KAB. GROBOGAN', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (203, 'used', '3316', 'KAB. BLORA', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (204, 'used', '3317', 'KAB. REMBANG', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (205, 'used', '3318', 'KAB. PATI', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (206, 'used', '3319', 'KAB. KUDUS', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (207, 'used', '3320', 'KAB. JEPARA', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (208, 'used', '3321', 'KAB. DEMAK', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (209, 'used', '3322', 'KAB. SEMARANG', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (210, 'used', '3323', 'KAB. TEMANGGUNG', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (211, 'used', '3324', 'KAB. KENDAL', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (212, 'used', '3325', 'KAB. BATANG', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (213, 'used', '3326', 'KAB. PEKALONGAN', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (214, 'used', '3327', 'KAB. PEMALANG', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (215, 'used', '3328', 'KAB. TEGAL', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (216, 'used', '3329', 'KAB. BREBES', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (217, 'used', '3371', 'KOTA MAGELANG', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (218, 'used', '3372', 'KOTA SURAKARTA', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (219, 'used', '3373', 'KOTA SALATIGA', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (220, 'used', '3374', 'KOTA SEMARANG', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (221, 'used', '3375', 'KOTA PEKALONGAN', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (222, 'used', '3376', 'KOTA TEGAL', NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL), (223, 'used', '3401', 'KAB. KULON PROGO', NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL), (224, 'used', '3402', 'KAB. BANTUL', NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL), (225, 'used', '3403', 'KAB. GUNUNG KIDUL', NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL), (226, 'used', '3404', 'KAB. SLEMAN', NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL), (227, 'used', '3471', 'KOTA YOGYAKARTA', NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL), (228, 'used', '3501', 'KAB. PACITAN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (229, 'used', '3502', 'KAB. PONOROGO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (230, 'used', '3503', 'KAB. TRENGGALEK', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (231, 'used', '3504', 'KAB. TULUNGAGUNG', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (232, 'used', '3505', 'KAB. BLITAR', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (233, 'used', '3506', 'KAB. KEDIRI', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (234, 'used', '3507', 'KAB. MALANG', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (235, 'used', '3508', 'KAB. LUMAJANG', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (236, 'used', '3509', 'KAB. JEMBER', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (237, 'used', '3510', 'KAB. BANYUWANGI', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (238, 'used', '3511', 'KAB. BONDOWOSO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (239, 'used', '3512', 'KAB. SITUBONDO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (240, 'used', '3513', 'KAB. PROBOLINGGO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (241, 'used', '3514', 'KAB. PASURUAN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (242, 'used', '3515', 'KAB. SIDOARJO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (243, 'used', '3516', 'KAB. MOJOKERTO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (244, 'used', '3517', 'KAB. JOMBANG', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (245, 'used', '3518', 'KAB. NGANJUK', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (246, 'used', '3519', 'KAB. MADIUN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (247, 'used', '3520', 'KAB. MAGETAN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (248, 'used', '3521', 'KAB. NGAWI', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (249, 'used', '3522', 'KAB. BOJONEGORO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (250, 'used', '3523', 'KAB. TUBAN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (251, 'used', '3524', 'KAB. LAMONGAN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (252, 'used', '3525', 'KAB. GRESIK', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (253, 'used', '3526', 'KAB. BANGKALAN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (254, 'used', '3527', 'KAB. SAMPANG', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (255, 'used', '3528', 'KAB. PAMEKASAN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (256, 'used', '3529', 'KAB. SUMENEP', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (257, 'used', '3571', 'KOTA KEDIRI', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (258, 'used', '3572', 'KOTA BLITAR', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (259, 'used', '3573', 'KOTA MALANG', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (260, 'used', '3574', 'KOTA PROBOLINGGO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (261, 'used', '3575', 'KOTA PASURUAN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (262, 'used', '3576', 'KOTA MOJOKERTO', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (263, 'used', '3577', 'KOTA MADIUN', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (264, 'used', '3578', 'KOTA SURABAYA', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (265, 'used', '3579', 'KOTA BATU', NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL), (266, 'used', '3601', 'KAB. PANDEGLANG', NULL, 16, NULL, NULL, NULL, NULL, NULL, NULL), (267, 'used', '3602', 'KAB. LEBAK', NULL, 16, NULL, NULL, NULL, NULL, NULL, NULL), (268, 'used', '3603', 'KAB. TANGERANG', NULL, 16, NULL, NULL, NULL, NULL, NULL, NULL), (269, 'used', '3604', 'KAB. SERANG', NULL, 16, NULL, NULL, NULL, NULL, NULL, NULL), (270, 'used', '3671', 'KOTA TANGERANG', NULL, 16, NULL, NULL, NULL, NULL, NULL, NULL), (271, 'used', '3672', 'KOTA CILEGON', NULL, 16, NULL, NULL, NULL, NULL, NULL, NULL), (272, 'used', '3673', 'KOTA SERANG', NULL, 16, NULL, NULL, NULL, NULL, NULL, NULL), (273, 'used', '3674', 'KOTA TANGERANG SELATAN', NULL, 16, NULL, NULL, NULL, NULL, NULL, NULL), (274, 'used', '5101', 'KAB. JEMBRANA', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (275, 'used', '5102', 'KAB. TABANAN', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (276, 'used', '5103', 'KAB. BADUNG', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (277, 'used', '5104', 'KAB. GIANYAR', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (278, 'used', '5105', 'KAB. KLUNGKUNG', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (279, 'used', '5106', 'KAB. BANGLI', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (280, 'used', '5107', 'KAB. KARANGASEM', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (281, 'used', '5108', 'KAB. BULELENG', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (282, 'used', '5171', 'KOTA DENPASAR', NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL), (283, 'used', '5201', 'KAB. LOMBOK BARAT', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (284, 'used', '5202', 'KAB. LOMBOK TENGAH', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (285, 'used', '5203', 'KAB. LOMBOK TIMUR', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (286, 'used', '5204', 'KAB. SUMBAWA', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (287, 'used', '5205', 'KAB. DOMPU', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (288, 'used', '5206', 'KAB. BIMA', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (289, 'used', '5207', 'KAB. SUMBAWA BARAT', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (290, 'used', '5208', 'KAB. LOMBOK UTARA', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (291, 'used', '5271', 'KOTA MATARAM', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (292, 'used', '5272', 'KOTA BIMA', NULL, 18, NULL, NULL, NULL, NULL, NULL, NULL), (293, 'used', '5301', 'KAB. KUPANG', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (294, 'used', '5302', 'KAB TIMOR TENGAH SELATAN', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (295, 'used', '5303', 'KAB. TIMOR TENGAH UTARA', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (296, 'used', '5304', 'KAB. BELU', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (297, 'used', '5305', 'KAB. ALOR', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (298, 'used', '5306', 'KAB. FLORES TIMUR', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (299, 'used', '5307', 'KAB. SIKKA', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (300, 'used', '5308', 'KAB. ENDE', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (301, 'used', '5309', 'KAB. NGADA', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (302, 'used', '5310', 'KAB. MANGGARAI', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (303, 'used', '5311', 'KAB. SUMBA TIMUR', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (304, 'used', '5312', 'KAB. SUMBA BARAT', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (305, 'used', '5313', 'KAB. LEMBATA', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (306, 'used', '5314', 'KAB. ROTE NDAO', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (307, 'used', '5315', 'KAB. MANGGARAI BARAT', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (308, 'used', '5316', 'KAB. NAGEKEO', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (309, 'used', '5317', 'KAB. SUMBA TENGAH', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (310, 'used', '5318', 'KAB. SUMBA BARAT DAYA', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (311, 'used', '5319', 'KAB. MANGGARAI TIMUR', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (312, 'used', '5320', 'KAB. SABU RAIJUA', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (313, 'used', '5321', 'KAB. MALAKA', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (314, 'used', '5371', 'KOTA KUPANG', NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL), (315, 'used', '6101', 'KAB. SAMBAS', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (316, 'used', '6102', 'KAB. MEMPAWAH', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (317, 'used', '6103', 'KAB. SANGGAU', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (318, 'used', '6104', 'KAB. KETAPANG', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (319, 'used', '6105', 'KAB. SINTANG', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (320, 'used', '6106', 'KAB. KAPUAS HULU', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (321, 'used', '6107', 'KAB. BENGKAYANG', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (322, 'used', '6108', 'KAB. LANDAK', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (323, 'used', '6109', 'KAB. SEKADAU', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (324, 'used', '6110', 'KAB. MELAWI', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (325, 'used', '6111', 'KAB. KAYONG UTARA', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (326, 'used', '6112', 'KAB. KUBU RAYA', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (327, 'used', '6171', 'KOTA PONTIANAK', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (328, 'used', '6172', 'KOTA SINGKAWANG', NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL), (329, 'used', '6201', 'KAB. KOTAWARINGIN BARAT', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (330, 'used', '6202', 'KAB. KOTAWARINGIN TIMUR', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (331, 'used', '6203', 'KAB. KAPUAS', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (332, 'used', '6204', 'KAB. BARITO SELATAN', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (333, 'used', '6205', 'KAB. BARITO UTARA', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (334, 'used', '6206', 'KAB. KATINGAN', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (335, 'used', '6207', 'KAB. SERUYAN', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (336, 'used', '6208', 'KAB. SUKAMARA', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (337, 'used', '6209', 'KAB. LAMANDAU', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (338, 'used', '6210', 'KAB. GUNUNG MAS', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (339, 'used', '6211', 'KAB. PULANG PISAU', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (340, 'used', '6212', 'KAB. MURUNG RAYA', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (341, 'used', '6213', 'KAB. BARITO TIMUR', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (342, 'used', '6271', 'KOTA PALANGKARAYA', NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL), (343, 'used', '6301', 'KAB. TANAH LAUT', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (344, 'used', '6302', 'KAB. KOTABARU', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (345, 'used', '6303', 'KAB. BANJAR', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (346, 'used', '6304', 'KAB. BARITO KUALA', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (347, 'used', '6305', 'KAB. TAPIN', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (348, 'used', '6306', 'KAB. HULU SUNGAI SELATAN', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (349, 'used', '6307', 'KAB. HULU SUNGAI TENGAH', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (350, 'used', '6308', 'KAB. HULU SUNGAI UTARA', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (351, 'used', '6309', 'KAB. TABALONG', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (352, 'used', '6310', 'KAB. TANAH BUMBU', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (353, 'used', '6311', 'KAB. BALANGAN', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (354, 'used', '6371', 'KOTA BANJARMASIN', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (355, 'used', '6372', 'KOTA BANJARBARU', NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL), (356, 'used', '6401', 'KAB. PASER', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (357, 'used', '6402', 'KAB. KUTAI KARTANEGARA', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (358, 'used', '6403', 'KAB. BERAU', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (359, 'used', '6407', 'KAB. KUTAI BARAT', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (360, 'used', '6408', 'KAB. KUTAI TIMUR', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (361, 'used', '6409', 'KAB. PENAJAM PASER UTARA', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (362, 'used', '6411', 'KAB. MAHAKAM ULU', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (363, 'used', '6471', 'KOTA BALIKPAPAN', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (364, 'used', '6472', 'KOTA SAMARINDA', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (365, 'used', '6474', 'KOTA BONTANG', NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL), (366, 'used', '6501', 'KAB. BULUNGAN', NULL, 24, NULL, NULL, NULL, NULL, NULL, NULL), (367, 'used', '6502', 'KAB. MALINAU', NULL, 24, NULL, NULL, NULL, NULL, NULL, NULL), (368, 'used', '6503', 'KAB. NUNUKAN', NULL, 24, NULL, NULL, NULL, NULL, NULL, NULL), (369, 'used', '6504', 'KAB. TANA TIDUNG', NULL, 24, NULL, NULL, NULL, NULL, NULL, NULL), (370, 'used', '6571', 'KOTA TARAKAN', NULL, 24, NULL, NULL, NULL, NULL, NULL, NULL), (371, 'used', '7101', 'KAB. BOLAANG MONGONDOW', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (372, 'used', '7102', 'KAB. MINAHASA', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (373, 'used', '7103', 'KAB. KEPULAUAN SANGIHE', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (374, 'used', '7104', 'KAB. KEPULAUAN TALAUD', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (375, 'used', '7105', 'KAB. MINAHASA SELATAN', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (376, 'used', '7106', 'KAB. MINAHASA UTARA', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (377, 'used', '7107', 'KAB. MINAHASA TENGGARA', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (378, 'used', '7108', 'KAB. BOLAANG MONGONDOW UTARA', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (379, 'used', '7109', 'KAB. KEP. SIAU TAGULANDANG BIARO', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (380, 'used', '7110', 'KAB. BOLAANG MONGONDOW TIMUR', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (381, 'used', '7111', 'KAB. BOLAANG MONGONDOW SELATAN', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (382, 'used', '7171', 'KOTA MANADO', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (383, 'used', '7172', 'KOTA BITUNG', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (384, 'used', '7173', 'KOTA TOMOHON', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (385, 'used', '7174', 'KOTA KOTAMOBAGU', NULL, 25, NULL, NULL, NULL, NULL, NULL, NULL), (386, 'used', '7201', 'KAB. BANGGAI', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (387, 'used', '7202', 'KAB. POSO', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (388, 'used', '7203', 'KAB. DONGGALA', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (389, 'used', '7204', 'KAB. TOLI TOLI', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (390, 'used', '7205', 'KAB. BUOL', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (391, 'used', '7206', 'KAB. MOROWALI', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (392, 'used', '7207', 'KAB. BANGGAI KEPULAUAN', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (393, 'used', '7208', 'KAB. PARIGI MOUTONG', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (394, 'used', '7209', 'KAB. TOJO UNA UNA', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (395, 'used', '7210', 'KAB. SIGI', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (396, 'used', '7211', 'KAB. BANGGAI LAUT', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (397, 'used', '7212', 'KAB. MOROWALI UTARA', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (398, 'used', '7271', 'KOTA PALU', NULL, 26, NULL, NULL, NULL, NULL, NULL, NULL), (399, 'used', '7301', 'KAB. KEPULAUAN SELAYAR', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (400, 'used', '7302', 'KAB. BULUKUMBA', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (401, 'used', '7303', 'KAB. BANTAENG', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (402, 'used', '7304', 'KAB. JENEPONTO', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (403, 'used', '7305', 'KAB. TAKALAR', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (404, 'used', '7306', 'KAB. GOWA', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (405, 'used', '7307', 'KAB. SINJAI', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (406, 'used', '7308', 'KAB. BONE', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (407, 'used', '7309', 'KAB. MAROS', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (408, 'used', '7310', 'KAB. PANGKAJENE KEPULAUAN', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (409, 'used', '7311', 'KAB. BARRU', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (410, 'used', '7312', 'KAB. SOPPENG', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (411, 'used', '7313', 'KAB. WAJO', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (412, 'used', '7314', 'KAB. SIDENRENG RAPPANG', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (413, 'used', '7315', 'KAB. PINRANG', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (414, 'used', '7316', 'KAB. ENREKANG', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (415, 'used', '7317', 'KAB. LUWU', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (416, 'used', '7318', 'KAB. TANA TORAJA', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (417, 'used', '7322', 'KAB. LUWU UTARA', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (418, 'used', '7324', 'KAB. LUWU TIMUR', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (419, 'used', '7326', 'KAB. TORAJA UTARA', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (420, 'used', '7371', 'KOTA MAKASSAR', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (421, 'used', '7372', 'KOTA PARE PARE', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (422, 'used', '7373', 'KOTA PALOPO', NULL, 27, NULL, NULL, NULL, NULL, NULL, NULL), (423, 'used', '7401', 'KAB. KOLAKA', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (424, 'used', '7402', 'KAB. KONAWE', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (425, 'used', '7403', 'KAB. MUNA', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (426, 'used', '7404', 'KAB. BUTON', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (427, 'used', '7405', 'KAB. KONAWE SELATAN', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (428, 'used', '7406', 'KAB. BOMBANA', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (429, 'used', '7407', 'KAB. WAKATOBI', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (430, 'used', '7408', 'KAB. KOLAKA UTARA', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (431, 'used', '7409', 'KAB. KONAWE UTARA', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (432, 'used', '7410', 'KAB. BUTON UTARA', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (433, 'used', '7411', 'KAB. KOLAKA TIMUR', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (434, 'used', '7412', 'KAB. KONAWE KEPULAUAN', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (435, 'used', '7413', 'KAB. MUNA BARAT', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (436, 'used', '7414', 'KAB. BUTON TENGAH', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (437, 'used', '7415', 'KAB. BUTON SELATAN', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (438, 'used', '7471', 'KOTA KENDARI', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (439, 'used', '7472', 'KOTA BAU BAU', NULL, 28, NULL, NULL, NULL, NULL, NULL, NULL), (440, 'used', '7501', 'KAB. GORONTALO', NULL, 29, NULL, NULL, NULL, NULL, NULL, NULL), (441, 'used', '7502', 'KAB. BOALEMO', NULL, 29, NULL, NULL, NULL, NULL, NULL, NULL), (442, 'used', '7503', 'KAB. BONE BOLANGO', NULL, 29, NULL, NULL, NULL, NULL, NULL, NULL), (443, 'used', '7504', 'KAB. PAHUWATO', NULL, 29, NULL, NULL, NULL, NULL, NULL, NULL), (444, 'used', '7505', 'KAB. GORONTALO UTARA', NULL, 29, NULL, NULL, NULL, NULL, NULL, NULL), (445, 'used', '7571', 'KOTA GORONTALO', NULL, 29, NULL, NULL, NULL, NULL, NULL, NULL), (446, 'used', '7601', 'KAB. MAMUJU UTARA', NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL), (447, 'used', '7602', 'KAB. MAMUJU', NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL), (448, 'used', '7603', 'KAB. MAMASA', NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL), (449, 'used', '7604', 'KAB. POLEWALI MANDAR', NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL), (450, 'used', '7605', 'KAB. MAJENE', NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL), (451, 'used', '7606', 'KAB. MAMUJU TENGAH', NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL), (452, 'used', '8101', 'KAB. MALUKU TENGAH', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (453, 'used', '8102', 'KAB. MALUKU TENGGARA', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (454, 'used', '8103', 'KAB MALUKU TENGGARA BARAT', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (455, 'used', '8104', 'KAB. BURU', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (456, 'used', '8105', 'KAB. SERAM BAGIAN TIMUR', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (457, 'used', '8106', 'KAB. SERAM BAGIAN BARAT', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (458, 'used', '8107', 'KAB. KEPULAUAN ARU', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (459, 'used', '8108', 'KAB. MALUKU BARAT DAYA', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (460, 'used', '8109', 'KAB. BURU SELATAN', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (461, 'used', '8171', 'KOTA AMBON', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (462, 'used', '8172', 'KOTA TUAL', NULL, 31, NULL, NULL, NULL, NULL, NULL, NULL), (463, 'used', '8201', 'KAB. HALMAHERA BARAT', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (464, 'used', '8202', 'KAB. HALMAHERA TENGAH', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (465, 'used', '8203', 'KAB. HALMAHERA UTARA', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (466, 'used', '8204', 'KAB. HALMAHERA SELATAN', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (467, 'used', '8205', 'KAB. KEPULAUAN SULA', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (468, 'used', '8206', 'KAB. HALMAHERA TIMUR', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (469, 'used', '8207', 'KAB. PULAU MOROTAI', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (470, 'used', '8208', 'KAB. PULAU TALIABU', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (471, 'used', '8271', 'KOTA TERNATE', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (472, 'used', '8272', 'KOTA TIDORE KEPULAUAN', NULL, 32, NULL, NULL, NULL, NULL, NULL, NULL), (473, 'used', '9101', 'KAB. MERAUKE', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (474, 'used', '9102', 'KAB. JAYAWIJAYA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (475, 'used', '9103', 'KAB. JAYAPURA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (476, 'used', '9104', 'KAB. NABIRE', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (477, 'used', '9105', 'KAB. KEPULAUAN YAPEN', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (478, 'used', '9106', 'KAB. BIAK NUMFOR', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (479, 'used', '9107', 'KAB. PUNCAK JAYA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (480, 'used', '9108', 'KAB. PANIAI', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (481, 'used', '9109', 'KAB. MIMIKA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (482, 'used', '9110', 'KAB. SARMI', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (483, 'used', '9111', 'KAB. KEEROM', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (484, 'used', '9112', 'KAB PEGUNUNGAN BINTANG', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (485, 'used', '9113', 'KAB. YAHUKIMO', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (486, 'used', '9114', 'KAB. TOLIKARA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (487, 'used', '9115', 'KAB. WAROPEN', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (488, 'used', '9116', 'KAB. BOVEN DIGOEL', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (489, 'used', '9117', 'KAB. MAPPI', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (490, 'used', '9118', 'KAB. ASMAT', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (491, 'used', '9119', 'KAB. SUPIORI', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (492, 'used', '9120', 'KAB. MAMBERAMO RAYA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (493, 'used', '9121', 'KAB. MAMBERAMO TENGAH', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (494, 'used', '9122', 'KAB. YALIMO', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (495, 'used', '9123', 'KAB. LANNY JAYA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (496, 'used', '9124', 'KAB. NDUGA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (497, 'used', '9125', 'KAB. PUNCAK', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (498, 'used', '9126', 'KAB. DOGIYAI', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (499, 'used', '9127', 'KAB. INTAN JAYA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (500, 'used', '9128', 'KAB. DEIYAI', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (501, 'used', '9171', 'KOTA JAYAPURA', NULL, 33, NULL, NULL, NULL, NULL, NULL, NULL), (502, 'used', '9201', 'KAB. SORONG', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (503, 'used', '9202', 'KAB. MANOKWARI', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (504, 'used', '9203', 'KAB. FAK FAK', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (505, 'used', '9204', 'KAB. SORONG SELATAN', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (506, 'used', '9205', 'KAB. RAJA AMPAT', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (507, 'used', '9206', 'KAB. TELUK BINTUNI', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (508, 'used', '9207', 'KAB. TELUK WONDAMA', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (509, 'used', '9208', 'KAB. KAIMANA', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (510, 'used', '9209', 'KAB. TAMBRAUW', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (511, 'used', '9210', 'KAB. MAYBRAT', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (512, 'used', '9211', 'KAB. MANOKWARI SELATAN', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (513, 'used', '9212', 'KAB. PEGUNUNGAN ARFAK', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL), (514, 'used', '9271', 'KOTA SORONG', NULL, 34, NULL, NULL, NULL, NULL, NULL, NULL); /*!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 */;
84.087912
191
0.610211
c4b7c071fc02d5d2107409daa320f019c20e64ed
85
sql
SQL
tests/queries/0_stateless/00558_parse_floats.sql
pdv-ru/ClickHouse
0ff975bcf3008fa6c6373cbdfed16328e3863ec5
[ "Apache-2.0" ]
15,577
2019-09-23T11:57:53.000Z
2022-03-31T18:21:48.000Z
tests/queries/0_stateless/00558_parse_floats.sql
pdv-ru/ClickHouse
0ff975bcf3008fa6c6373cbdfed16328e3863ec5
[ "Apache-2.0" ]
16,476
2019-09-23T11:47:00.000Z
2022-03-31T23:06:01.000Z
tests/queries/0_stateless/00558_parse_floats.sql
pdv-ru/ClickHouse
0ff975bcf3008fa6c6373cbdfed16328e3863ec5
[ "Apache-2.0" ]
3,633
2019-09-23T12:18:28.000Z
2022-03-31T15:55:48.000Z
SELECT toFloat64(concat('0.00000', toString(number))) FROM system.numbers LIMIT 100;
42.5
84
0.776471
feec0a216412509da90ab72242853ef4f7d4f6bf
5,231
html
HTML
docs/search/all_64.html
VickaSvetlova/googledrive
d48234639f4a9f32065e0b30c180327f0b48040a
[ "Apache-2.0" ]
108
2015-04-22T08:16:44.000Z
2022-02-16T19:07:42.000Z
docs/search/all_64.html
VickaSvetlova/googledrive
d48234639f4a9f32065e0b30c180327f0b48040a
[ "Apache-2.0" ]
39
2015-01-22T19:14:01.000Z
2019-08-29T11:35:14.000Z
docs/search/all_64.html
VickaSvetlova/googledrive
d48234639f4a9f32065e0b30c180327f0b48040a
[ "Apache-2.0" ]
27
2015-06-26T02:56:44.000Z
2021-04-27T18:19:16.000Z
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div class="SRResult" id="SR_deletefile"> <div class="SREntry"> <a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="../class_google_drive.html#a6b7e746d2b1c717566114b12a5fbedcf" target="_parent">DeleteFile</a> <span class="SRScope">GoogleDrive</span> </div> </div> <div class="SRResult" id="SR_description"> <div class="SREntry"> <a id="Item1" onkeydown="return searchResults.Nav(event,1)" onkeypress="return searchResults.Nav(event,1)" onkeyup="return searchResults.Nav(event,1)" class="SRSymbol" href="../class_google_drive_1_1_file.html#a4b39cbe3bf1eb2798de1ab6cc6a3849d" target="_parent">Description</a> <span class="SRScope">GoogleDrive::File</span> </div> </div> <div class="SRResult" id="SR_done"> <div class="SREntry"> <a id="Item2" onkeydown="return searchResults.Nav(event,2)" onkeypress="return searchResults.Nav(event,2)" onkeyup="return searchResults.Nav(event,2)" class="SRSymbol" href="../class_midworld_1_1_unity_coroutine.html#a8151aee7bf014c544348cd1aafa83fec" target="_parent">done</a> <span class="SRScope">Midworld::UnityCoroutine</span> </div> </div> <div class="SRResult" id="SR_dosync"> <div class="SREntry"> <a id="Item3" onkeydown="return searchResults.Nav(event,3)" onkeypress="return searchResults.Nav(event,3)" onkeyup="return searchResults.Nav(event,3)" class="SRSymbol" href="../class_midworld_1_1_unity_coroutine.html#a0269a08a2e19353ff558751a0dc0a595" target="_parent">DoSync</a> <span class="SRScope">Midworld::UnityCoroutine</span> </div> </div> <div class="SRResult" id="SR_downloadfile"> <div class="SREntry"> <a id="Item4" onkeydown="return searchResults.Nav(event,4)" onkeypress="return searchResults.Nav(event,4)" onkeyup="return searchResults.Nav(event,4)" class="SRSymbol" href="javascript:searchResults.Toggle('SR_downloadfile')">DownloadFile</a> <div class="SRChildren"> <a id="Item4_c0" onkeydown="return searchResults.NavChild(event,4,0)" onkeypress="return searchResults.NavChild(event,4,0)" onkeyup="return searchResults.NavChild(event,4,0)" class="SRScope" href="../class_google_drive.html#aa6e890ff37c1120ce911800cc3343365" target="_parent">GoogleDrive.DownloadFile(File file)</a> <a id="Item4_c1" onkeydown="return searchResults.NavChild(event,4,1)" onkeypress="return searchResults.NavChild(event,4,1)" onkeyup="return searchResults.NavChild(event,4,1)" class="SRScope" href="../class_google_drive.html#a82b7112c3f3d94cd027991cd96f72a8f" target="_parent">GoogleDrive.DownloadFile(string url)</a> </div> </div> </div> <div class="SRResult" id="SR_downloadurl"> <div class="SREntry"> <a id="Item5" onkeydown="return searchResults.Nav(event,5)" onkeypress="return searchResults.Nav(event,5)" onkeyup="return searchResults.Nav(event,5)" class="SRSymbol" href="../class_google_drive_1_1_file.html#a6452f32e74dec375825e921c1f215563" target="_parent">DownloadUrl</a> <span class="SRScope">GoogleDrive::File</span> </div> </div> <div class="SRResult" id="SR_drivetest"> <div class="SREntry"> <a id="Item6" onkeydown="return searchResults.Nav(event,6)" onkeypress="return searchResults.Nav(event,6)" onkeyup="return searchResults.Nav(event,6)" class="SRSymbol" href="../class_drive_test.html" target="_parent">DriveTest</a> </div> </div> <div class="SRResult" id="SR_duplicatefile"> <div class="SREntry"> <a id="Item7" onkeydown="return searchResults.Nav(event,7)" onkeypress="return searchResults.Nav(event,7)" onkeyup="return searchResults.Nav(event,7)" class="SRSymbol" href="javascript:searchResults.Toggle('SR_duplicatefile')">DuplicateFile</a> <div class="SRChildren"> <a id="Item7_c0" onkeydown="return searchResults.NavChild(event,7,0)" onkeypress="return searchResults.NavChild(event,7,0)" onkeyup="return searchResults.NavChild(event,7,0)" class="SRScope" href="../class_google_drive.html#a20431f9ba0fafc99ddae3a0646860079" target="_parent">GoogleDrive.DuplicateFile(File file, string newTitle)</a> <a id="Item7_c1" onkeydown="return searchResults.NavChild(event,7,1)" onkeypress="return searchResults.NavChild(event,7,1)" onkeyup="return searchResults.NavChild(event,7,1)" class="SRScope" href="../class_google_drive.html#aab6bfc1d620544736f62f8a29b1101df" target="_parent">GoogleDrive.DuplicateFile(File file, string newTitle, File newParentFolder)</a> </div> </div> </div> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
70.689189
359
0.757981
62b2635431665388f31ac24a0469f4cf2dd91431
3,425
ps1
PowerShell
main.ps1
altbdoor/d2-api-human
2479e8fe8074b0dc9d5c98d88caab42d997b56f5
[ "MIT" ]
null
null
null
main.ps1
altbdoor/d2-api-human
2479e8fe8074b0dc9d5c98d88caab42d997b56f5
[ "MIT" ]
null
null
null
main.ps1
altbdoor/d2-api-human
2479e8fe8074b0dc9d5c98d88caab42d997b56f5
[ "MIT" ]
null
null
null
. ".\util.ps1" Write-Output 'Loading weapons JSON file...' $weapons = Get-Content 'source/weapons.json' | ConvertFrom-Json # ======================================== Write-Output 'Loading other JSON files...' $sunsetPowercapData = Get-Content 'source/sunset.json' | ConvertFrom-Json $statsData = Get-Content 'source/stats.json' | ConvertFrom-Json $statGroupsData = Get-Content 'source/statgroups.json' | ConvertFrom-Json $socketsData = Get-Content 'source/sockets.json' | ConvertFrom-Json $plugsetsData = Get-Content 'source/plugsets.json' | ConvertFrom-Json # ======================================== Write-Output 'Mapping into objects...' $remappedWeapons = $weapons | ForEach-Object { [ordered]@{ id = $_.hash; name = $_.displayProperties.name; icon = $_.displayProperties.icon; watermark = $_.quality.displayVersionWatermarkIcons[0]; screenshot = $_.screenshot; flavor_text = $_.flavorText; weapon_tier = $_.inventory.tierTypeName.ToLower(); ammo_type = Get-AmmoType -Key $_.equippingBlock.ammoType; element_class = Get-ElementClass -Key $_.damageTypes[0]; weapon_type = Get-WeaponType -TraitIds $_.traitIds; powercap = $sunsetPowercapData.($_.quality.versions[0].powerCapHash); stats = Get-Stats -WeaponStats $_.stats.stats -StatsData $statsData -VisibleStatHashes $statGroupsData.($_.stats.statGroupHash); frame = Get-Frame -SocketsData $socketsData -Entries $_.sockets.socketEntries; perks = Get-Perks -SocketsData $socketsData -PlugsetsData $plugsetsData -Entries $_.sockets.socketEntries; } } Write-Output "Remapped $(($remappedWeapons | Measure-Object).Count) weapons!" # ======================================== Write-Output 'Writing into major JSON files...' New-Item -ItemType Directory -Force -Path 'data/weapons/id' New-Item -ItemType Directory -Force -Path 'data/weapons/name' Copy-Item 'source/version.txt' 'data/' $remappedWeapons | ConvertTo-Json -Compress -Depth 100 | Out-File 'data/weapons/all.json' $remappedWeapons | Foreach-Object { [ordered]@{ id = $_.id; name = $_.name; icon = $_.icon; watermark = $_.watermark; } } | ConvertTo-Json -Compress -Depth 100 | Out-File 'data/weapons/all_lite.json' # ======================================== Write-Output 'Writing into ID-based JSON files...' foreach ($weapon in $remappedWeapons) { $weapon | ConvertTo-Json -Compress -Depth 100 | Out-File "data/weapons/id/$($weapon.id).json" } # ======================================== Write-Output 'Writing into name-based JSON files...' $uniqueWeaponNames = $remappedWeapons.name | Sort-Object | Get-Unique foreach ($weaponName in $uniqueWeaponNames) { # https://stackoverflow.com/a/49941546 $slugName = $weaponName.ToLower().Normalize([Text.NormalizationForm]::FormD) $slugName = $slugName -replace '\p{M}', '' -replace '[^A-Za-z0-9]', '' $matchedWeapons = $remappedWeapons | Where-Object { $_.name -eq $weaponName } if (($matchedWeapons | Measure-Object).Count -ne 1) { $matchedWeapons = ($matchedWeapons | Sort-Object id -Descending)[0] } $matchedWeapons | ConvertTo-Json -Compress -Depth 100 | Out-File "data/weapons/name/${slugName}.json" } # ======================================== Write-Output 'Done!'
43.910256
144
0.626861
91a063cfc1a803e41ba1fd6f24af7a4462a2e802
1,037
asm
Assembly
programs/oeis/206/A206694.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/206/A206694.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/206/A206694.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A206694: Number of n X 2 0..2 arrays avoiding the pattern z-2 z-1 z in any row or column. ; 9,81,676,5625,46656,386884,3207681,26594649,220492801,1828075536,15156318321,125658906256,1041820324416,8637585806529,71613009227809,593733388556025,4922560027477764,40812252925262329,338368649551172496,2805366888436702500,23258902351548986929,192836288482872700689,1598778549124998644601,13255248113579303603776,109897398015946618800321,911143872011168756841024,7554165708118418421990400,62630525539014699913049601,519260879474432957511819225,4305118927743926836681830625,35693135598387758485224414276,295926767698500698304905332569,2453487214623923660670352516096,20341517461022696514690605173956,168648660629159227366501309104225,1398242328110920790871044292919081,11592630506684354450155092243838449,96112869252122824533536086186964496,796858282557110214891765304873131889 seq $0,18919 ; Define the generalized Pisot sequence T(a(0),a(1)) by: a(n+2) is the greatest integer such that a(n+2)/a(n+1) < a(n+1)/a(n). This is T(3,9). pow $0,2
172.833333
778
0.875603
db18001c211d844fffac9fc3e8f5ece73d3e1774
2,516
ps1
PowerShell
Public/Get-Instance.ps1
johnsarie27/AWSReporting
9d102b4c2453d4d68066575521c2a149bbf50cb4
[ "Apache-2.0" ]
5
2019-10-31T06:25:45.000Z
2022-01-21T20:09:44.000Z
Public/Get-Instance.ps1
johnsarie27/AWSReporting
9d102b4c2453d4d68066575521c2a149bbf50cb4
[ "Apache-2.0" ]
5
2019-02-15T22:54:39.000Z
2019-03-21T22:21:39.000Z
Public/Get-Instance.ps1
johnsarie27/AWSReporting
9d102b4c2453d4d68066575521c2a149bbf50cb4
[ "Apache-2.0" ]
1
2021-07-02T23:27:57.000Z
2021-07-02T23:27:57.000Z
function Get-Instance { <# ========================================================================= .SYNOPSIS Get all EC2 instances .DESCRIPTION This function returns a list of the EC2 instances for a given AWS Region using the provided AWS Credential Profile or Credential object. If no profile is provided, the system "Instance Profile" will be used. .PARAMETER ProfileName Name property of an AWS credential profile .PARAMETER Credential AWS Credential Object .PARAMETER Region AWS region .INPUTS Amazon.Runtime.AWSCredentials. .OUTPUTS Amazon.EC2.Model.Instance. .EXAMPLE PS C:\> $All = Get-Instance -Region us-west-2 Return all EC2 instances using the local system's EC2 Instance Profile in the us-west-2 region. ========================================================================= #> [CmdletBinding(DefaultParameterSetName = '__crd')] [OutputType([Amazon.EC2.Model.Instance[]])] Param( [Parameter(Mandatory, Position = 0, ParameterSetName = '__pro', HelpMessage = 'AWS Profile object')] [ValidateScript({ (Get-AWSCredential -ListProfileDetail).ProfileName -contains $_ })] [string[]] $ProfileName, [Parameter(Mandatory, Position = 0, ValueFromPipeline, ParameterSetName = '__crd', HelpMessage = 'AWS Credential Object')] [ValidateNotNullOrEmpty()] [Amazon.Runtime.AWSCredentials[]] $Credential, [Parameter(Position = 1, ValueFromPipelineByPropertyName, HelpMessage = 'AWS Region')] [ValidateScript({ (Get-AWSRegion).Region -contains $_ })] [ValidateNotNullOrEmpty()] [string] $Region ) Process { if ( $PSCmdlet.ParameterSetName -eq '__pro' ) { foreach ( $name in $ProfileName ) { (Get-EC2Instance -ProfileName $name -Region $Region).Instances #Write-Verbose -Message ('[{0}] instances found' -f $ec2Instances.Count) } } elseif ( $PSCmdlet.ParameterSetName -eq '__crd' ) { foreach ( $cred in $Credential ) { (Get-EC2Instance -Credential $cred -Region $Region).Instances #Write-Verbose -Message ('[{0}] instances found' -f $ec2Instances.Count) } } else { (Get-EC2Instance -Region $Region).Instances #Write-Verbose -Message ('[{0}] instances found' -f $ec2Instances.Count) } } }
41.245902
130
0.584658
47c0ac1ca883f4fa0046d36f55be3619215cf442
1,715
cxx
C++
nugen/EventGeneratorBase/GENIE/EvtTimeFlat.cxx
nusense/nugen
ee4fefda7f2aa5e5ca8ee9c741f07bd3dbef2ed7
[ "Apache-2.0" ]
null
null
null
nugen/EventGeneratorBase/GENIE/EvtTimeFlat.cxx
nusense/nugen
ee4fefda7f2aa5e5ca8ee9c741f07bd3dbef2ed7
[ "Apache-2.0" ]
null
null
null
nugen/EventGeneratorBase/GENIE/EvtTimeFlat.cxx
nusense/nugen
ee4fefda7f2aa5e5ca8ee9c741f07bd3dbef2ed7
[ "Apache-2.0" ]
null
null
null
//////////////////////////////////////////////////////////////////////// /// \file EvtTimeFlat.cxx /// \brief Flat time distribution /// /// \version $Id: EvtTimeFlat.cxx,v 1.1 2015/06/30 18:01:24 rhatcher Exp $ /// \author Robert Hatcher <rhatcher \at fnal.gov> /// Fermi National Accelerator Laboratory /// /// \update 2015-06-22 initial version //////////////////////////////////////////////////////////////////////// #include "EvtTimeFlat.h" #include "EvtTimeShiftFactory.h" TIMESHIFTREG3(evgb,EvtTimeFlat,evgb::EvtTimeFlat) #include <iostream> namespace evgb { EvtTimeFlat::EvtTimeFlat(const std::string& config) : EvtTimeShiftI(config) , fDuration(6 * 84 * 1e9/53.103e6) , fGlobalOffset(0) { Config(config); } EvtTimeFlat::~EvtTimeFlat() { ; } void EvtTimeFlat::Config(const std::string& config) { // parse config string if ( config != "" ) { // for now just assume a single number is the duration // optional 2nd arg is global offset int nf = sscanf(config.c_str(),"%lf %lf",&fDuration,&fGlobalOffset); std::cout << "EvtTimeFlat::Config() read " << nf << " values" << std::endl; } PrintConfig(); } double EvtTimeFlat::TimeOffset() { return fRndmGen->Uniform(fDuration); } double EvtTimeFlat::TimeOffset(std::vector<double> /* v */) { // flat ... doesn't need additional parameter so ignore them return TimeOffset(); } void EvtTimeFlat::PrintConfig(bool /* verbose */) { std::cout << "EvtTimeFlat config: " << " GlobalOffset " << fGlobalOffset << " ns" << ", Duration " << fDuration << " ns" << std::endl; } } // namespace evgb
28.114754
74
0.563265
bba06b38c8c43983d4e1db5eef594c56e1691ae0
282
sql
SQL
kata-files/lesson2/postgresql/expected/MYLARGESCHEMA/table/table56.sql
goldmansachs/obevo-kata
5596ff44ad560d89d183ac0941b727db1a2a7346
[ "Apache-2.0" ]
22
2017-09-28T21:35:04.000Z
2022-02-12T06:24:28.000Z
kata-files/lesson2/postgresql/expected/MYLARGESCHEMA/table/table56.sql
goldmansachs/obevo-kata
5596ff44ad560d89d183ac0941b727db1a2a7346
[ "Apache-2.0" ]
6
2017-07-01T13:52:34.000Z
2018-09-13T15:43:47.000Z
kata-files/lesson2/postgresql/expected/MYLARGESCHEMA/table/table56.sql
goldmansachs/obevo-kata
5596ff44ad560d89d183ac0941b727db1a2a7346
[ "Apache-2.0" ]
11
2017-04-30T18:39:09.000Z
2021-08-22T16:21:11.000Z
//// CHANGE name=change0 CREATE TABLE table56 ( id integer NOT NULL, field1 character varying(30), usertype3field usertype3, usertype8field usertype8 ); GO //// CHANGE name=change1 ALTER TABLE ONLY table56 ADD CONSTRAINT table56_pkey PRIMARY KEY (id); GO
14.1
49
0.70922
c3b9c3fb549e0cab1d47720d041ecba5c33d3b5d
20,076
rs
Rust
tytle_core/src/ir/cfg_builder.rs
spacemeshos/tytle
5b7bba80a8971678ef180805a2312ebb97e49057
[ "Apache-2.0" ]
11
2019-03-13T09:37:39.000Z
2021-11-09T16:05:25.000Z
tytle_core/src/ir/cfg_builder.rs
YaronWittenstein/tytle
5b7bba80a8971678ef180805a2312ebb97e49057
[ "Apache-2.0" ]
null
null
null
tytle_core/src/ir/cfg_builder.rs
YaronWittenstein/tytle
5b7bba80a8971678ef180805a2312ebb97e49057
[ "Apache-2.0" ]
1
2022-01-06T20:35:27.000Z
2022-01-06T20:35:27.000Z
pub use crate::ast::{expression::*, semantic::*, statement::*, Ast}; pub use crate::ir::*; pub use std::collections::HashMap; pub struct CfgBuilder<'env> { cfg_graph: CfgGraph, env: &'env mut Environment, current_proc_id: SymbolId, proc_jmp_table: HashMap<SymbolId, CfgProc>, } impl<'env> CfgBuilder<'env> { pub fn new(env: &'env mut Environment) -> Self { let mut cfg_graph = CfgGraph::new(); let main_proc = env.symbol_table.get_proc_by_name("__main__"); Self { current_proc_id: main_proc.id, cfg_graph, env, proc_jmp_table: HashMap::new(), } } pub fn build(mut self, ast: &Ast) -> CfgObject { let entry_id = self.cfg_graph.get_entry_node_id(); let mut node_id = entry_id; for stmt in &ast.statements { node_id = self.build_stmt(node_id, stmt); } // appending `EOC` to the end of `main` self.append_eoc(node_id); let mut jmp_table: HashMap<CfgNodeId, SymbolId> = self .proc_jmp_table .iter() .map(|(proc_id, cfg_proc)| (cfg_proc.node_id, *proc_id)) .collect(); // adding `main` itself let main_proc = self.env.symbol_table.get_proc_by_name("__main__"); jmp_table.insert(entry_id, main_proc.id); CfgObject { graph: self.cfg_graph, jmp_table, } } fn build_stmt(&mut self, node_id: CfgNodeId, stmt: &Statement) -> CfgNodeId { match stmt { Statement::NOP | Statement::EOF => node_id, Statement::Command(cmd) => self.build_cmd(node_id, cmd), Statement::Direction(direct_stmt) => self.build_direct(node_id, direct_stmt), Statement::Expression(expr) => self.build_expr(node_id, expr), Statement::Make(make_stmt) => self.build_make(node_id, make_stmt), Statement::If(if_stmt) => self.build_if(node_id, if_stmt), Statement::Repeat(repeat_stmt) => self.build_repeat(node_id, repeat_stmt), Statement::Procedure(proc_stmt) => self.build_proc(node_id, proc_stmt), Statement::Return(return_stmt) => self.build_return(node_id, return_stmt), Statement::Print(expr) => self.build_print(node_id, expr), } } fn build_print(&mut self, node_id: CfgNodeId, expr: &Expression) -> CfgNodeId { self.build_expr(node_id, expr); let node = self.cfg_graph.get_node_mut(node_id); node.append_inst(CfgInstruction::Print); node_id } fn build_return(&mut self, node_id: CfgNodeId, return_stmt: &ReturnStmt) -> CfgNodeId { if return_stmt.expr.is_some() { let expr: &Expression = return_stmt.expr.as_ref().unwrap(); self.build_expr(node_id, expr); } let node = self.cfg_graph.get_node_mut(node_id); node.append_inst(CfgInstruction::Return); node_id } fn build_proc(&mut self, node_id: CfgNodeId, proc_stmt: &ProcedureStmt) -> CfgNodeId { let proc_id = proc_stmt.id.unwrap(); let cfg_proc = self.proc_jmp_table.get(&proc_id); let parent_proc_id = self.current_proc_id; self.current_proc_id = proc_id; let proc_node_id; if cfg_proc.is_some() { let cfg_proc = cfg_proc.unwrap(); if cfg_proc.built == true { // we've already built the CFG for the procedure // so we just return the start node id return cfg_proc.node_id; } // we have allocated already the proc start node // (even though we didn't build the proc instructions yet) proc_node_id = cfg_proc.node_id; } else { // there is no proc CFG node, so we'll allocate one proc_node_id = self.cfg_graph.new_node(); // we explicitly save immediately the CFG proc in order // to support recursive procedures let cfg_proc = CfgProc { node_id: proc_node_id, proc_id, built: false, }; self.proc_jmp_table.insert(proc_id, cfg_proc); } let last_block_node_id = self.build_block(proc_node_id, &proc_stmt.block); // marking the CFG proc as built let cfg_proc = CfgProc { node_id: proc_node_id, proc_id, built: true, }; self.proc_jmp_table.insert(proc_id, cfg_proc); // we append a `RETURN` instruction to the end of the procedure // in case the last instruction isn't a `RETURN` self.append_ret(last_block_node_id); // restoring the `current_proc_id` self.current_proc_id = parent_proc_id; // the empty CFG node `node_id` will be used in the next non-procedure statement node_id } fn build_cmd(&mut self, node_id: CfgNodeId, cmd: &Command) -> CfgNodeId { let inst = match cmd { Command::Trap => CfgInstruction::Trap, _ => CfgInstruction::Command(cmd.clone()), }; self.append_inst(node_id, inst); node_id } fn build_direct(&mut self, node_id: CfgNodeId, direct_stmt: &DirectionStmt) -> CfgNodeId { self.build_expr(node_id, &direct_stmt.expr); let direct = direct_stmt.direction.clone(); let inst = CfgInstruction::Direction(direct); self.append_inst(node_id, inst); node_id } fn build_make(&mut self, node_id: CfgNodeId, make_stmt: &MakeStmt) -> CfgNodeId { let expr = &make_stmt.expr; let var_id = make_stmt.var_id.unwrap(); self.build_assign(node_id, var_id, expr) } fn build_assign( &mut self, node_id: CfgNodeId, var_id: SymbolId, expr: &Expression, ) -> CfgNodeId { self.build_expr(node_id, expr); let inst = CfgInstruction::Store(var_id); self.append_inst(node_id, inst); node_id } fn build_expr(&mut self, node_id: CfgNodeId, expr: &Expression) -> CfgNodeId { match expr.expr_ast { ExpressionAst::Literal(_) => self.build_lit_expr(node_id, expr), ExpressionAst::Not(_) => self.build_not_expr(node_id, expr), ExpressionAst::Binary(..) => self.build_bin_expr(node_id, expr), ExpressionAst::Parentheses(_) => self.build_parentheses_expr(node_id, expr), ExpressionAst::ProcCall(..) => self.build_proc_call_expr(node_id, expr), } node_id } fn build_proc_call_expr(&mut self, node_id: CfgNodeId, expr: &Expression) { let (_proc_name, proc_args_exprs, proc_id) = expr.as_proc_call_expr(); for proc_arg_expr in proc_args_exprs { self.build_expr(node_id, proc_arg_expr); } let proc_id = *proc_id.unwrap(); let cfg_proc = self.proc_jmp_table.get(&proc_id); let jmp_node_id = if cfg_proc.is_none() { let proc_node_id = self.cfg_graph.new_node(); let cfg_proc = CfgProc { node_id: proc_node_id, proc_id, built: false, }; self.proc_jmp_table.insert(proc_id, cfg_proc); proc_node_id } else { cfg_proc.unwrap().node_id }; self.append_inst(node_id, CfgInstruction::Call(jmp_node_id)); } fn build_parentheses_expr(&mut self, node_id: CfgNodeId, expr: &Expression) { let expr = expr.as_parentheses_expr(); self.build_expr(node_id, expr); } fn build_bin_expr(&mut self, node_id: CfgNodeId, expr: &Expression) { let (bin_op, lexpr, rexpr) = expr.as_binary_expr(); self.build_expr(node_id, lexpr); self.build_expr(node_id, rexpr); let inst = match bin_op { BinaryOp::Add => CfgInstruction::Add, BinaryOp::Mul => CfgInstruction::Mul, BinaryOp::Div => CfgInstruction::Div, BinaryOp::And => CfgInstruction::And, BinaryOp::Or => CfgInstruction::Or, BinaryOp::LessThan => CfgInstruction::LessThan, BinaryOp::GreaterThan => CfgInstruction::GreaterThan, }; self.append_inst(node_id, inst); } fn build_not_expr(&mut self, node_id: CfgNodeId, expr: &Expression) { let expr = expr.as_not_expr(); self.build_expr(node_id, expr); self.append_inst(node_id, CfgInstruction::Not); } fn build_lit_expr(&mut self, node_id: CfgNodeId, expr: &Expression) { let expr = expr.as_lit_expr(); match expr { LiteralExpr::Bool(v) => self.append_bool_lit(node_id, *v), LiteralExpr::Int(v) => self.append_int_lit(node_id, *v), LiteralExpr::Str(v) => self.append_str_lit(node_id, v), LiteralExpr::Var(_, ref var_id) => { self.append_var_lit(node_id, var_id.as_ref().unwrap()) } } } fn append_bool_lit(&mut self, node_id: CfgNodeId, lit: bool) { self.append_inst(node_id, CfgInstruction::Bool(lit)); } fn append_int_lit(&mut self, node_id: CfgNodeId, lit: usize) { self.append_inst(node_id, CfgInstruction::Int(lit as isize)); } fn append_str_lit(&mut self, node_id: CfgNodeId, lit: &str) { self.append_inst(node_id, CfgInstruction::Str(lit.to_string())); } fn append_var_lit(&mut self, node_id: CfgNodeId, var_id: &SymbolId) { let inst = CfgInstruction::Load(var_id.clone()); self.append_inst(node_id, inst); } fn build_repeat(&mut self, node_id: CfgNodeId, repeat_stmt: &RepeatStmt) -> CfgNodeId { // 1) allocate a new local variable of type `INT`, let's call it `TMPVAR_A` // 2) allocate a new local variable of type `INT`, let's call it `TMPVAR_B` // 3) emit instructions for `MAKE TMPVAR_A = 0 (within `CURRENT_NODE_ID node) // 4) emit instructions for `MAKE TMPVAR_B = `cond_expr` (within `CURRENT_NODE_ID node) // 5) emit expression-instructions for `TMPVAR_A < TMPVAR_B` (within `CURRENT_NODE_ID node) // 6) create a new empty CFG node. let's mark its node id as `WHILE_NODE_ID` // 7) add edge `CURRENT_NODE_ID` --jmp-when-true--> `WHILE_NODE_ID` // 8) generate statement-instructions for `block_stmt` (within `WHILE_NODE_ID` node) // the CFG generation will return `LAST_WHILE_BLOCK_NODE_ID` node_id // 9) emit instructions for `TMPVAR_A = TMPVAR_A + 1` (within `LAST_TRUE_BLOCK_NODE_ID`) // 10) emit expression-instructions for `TMPVAR_A < TMPVAR_B` (within `LAST_TRUE_BLOCK_NODE_ID`) // 11) add edge `LAST_TRUE_BLOCK_NODE_ID` --jmp-when-true--> `WHILE_NODE_ID` // 12) create a new empty CFG node. let's mark its node id as `AFTER_NODE_ID` // 13) add edge `LAST_TRUE_BLOCK_NODE_ID` --jmp-fallback--> `AFTER_NODE_ID` // 14) add edge `CURRENT_NODE_ID` --jmp-fallback--> `AFTER_NODE_ID` // 15) return `AFTER_NODE_ID` node_id (empty CFG node to be used for the next statement) // allocating temporary variables: `TMPVAR_A` and `TMPVAR_B` let (var_id_a, var_name_a) = self .env .create_tmp_var(self.current_proc_id, ExpressionType::Int); let (var_id_b, var_name_b) = self .env .create_tmp_var(self.current_proc_id, ExpressionType::Int); // MAKE TMPVAR_A = 0 let zero_lit = LiteralExpr::Int(0); let zero_expr = Expression { expr_type: Some(ExpressionType::Int), expr_ast: ExpressionAst::Literal(zero_lit), }; self.build_assign(node_id, var_id_a, &zero_expr); // MAKE TMPVAR_B = `cond_expr` self.build_assign(node_id, var_id_b, &repeat_stmt.count_expr); // TMPVAR_A < TMPVAR_B let var_lit_a = LiteralExpr::Var(var_name_a, Some(var_id_a)); let var_lit_b = LiteralExpr::Var(var_name_b, Some(var_id_b)); let var_lit_a_clone = var_lit_a.clone(); let var_expr_a = Expression { expr_ast: ExpressionAst::Literal(var_lit_a), expr_type: Some(ExpressionType::Int), }; let var_expr_b = Expression { expr_ast: ExpressionAst::Literal(var_lit_b), expr_type: Some(ExpressionType::Int), }; let cond_ast = ExpressionAst::Binary( BinaryOp::LessThan, Box::new(var_expr_a), Box::new(var_expr_b), ); let cond_expr = Expression { expr_ast: cond_ast, expr_type: Some(ExpressionType::Bool), }; self.build_expr(node_id, &cond_expr); // `REPEAT block` let while_node_id = self.cfg_graph.new_node(); self.add_edge(node_id, while_node_id, CfgJumpType::WhenTrue); let last_while_block_node_id = self.build_block(while_node_id, &repeat_stmt.block); // TMPVAR_A = TMPVAR_A + 1 let one_lit = LiteralExpr::Int(1); let one_expr = Expression { expr_type: Some(ExpressionType::Int), expr_ast: ExpressionAst::Literal(one_lit), }; let var_expr_a = Expression { expr_ast: ExpressionAst::Literal(var_lit_a_clone), expr_type: Some(ExpressionType::Int), }; let incr_var_a_ast = ExpressionAst::Binary(BinaryOp::Add, Box::new(var_expr_a), Box::new(one_expr)); let incr_expr = Expression { expr_type: Some(ExpressionType::Int), expr_ast: incr_var_a_ast, }; self.build_assign(last_while_block_node_id, var_id_a, &incr_expr); // TMPVAR_A < TMPVAR_B self.build_expr(last_while_block_node_id, &cond_expr); // jump when-true to the start of the loop self.add_edge( last_while_block_node_id, while_node_id, CfgJumpType::WhenTrue, ); let after_node_id = self.cfg_graph.new_node(); self.add_edge( last_while_block_node_id, after_node_id, CfgJumpType::Fallback, ); self.add_edge(node_id, after_node_id, CfgJumpType::Fallback); after_node_id } fn build_if(&mut self, node_id: CfgNodeId, if_stmt: &IfStmt) -> CfgNodeId { // 1) let's mark current CFG node as `CURRENT_NODE_ID` (the `node_id` parameter) // this node is assumed to be empty // 2) generate expression-instructions for `if-stmt` conditional-expression (within `CURRENT_NODE_ID` node) // 3) create a new empty CFG node. let's mark its node id as `TRUE_NODE_ID` // 4) generate statement-instructions for `if-stmt` `true-block` (within `TRUE_NODE_ID` node) // the CFG generation will return `LAST_TRUE_BLOCK_NODE_ID` node_id // 5) add edge `CURRENT_NODE_ID` --jmp-when-true--> `TRUE_NODE_ID` // 6) if `if-stmt` has `else-block`: // 6.1) create a new empty CFG node. let's mark its node id as `FALSE_NODE_ID` // 6.2) generate statement-instructions for `false-block` (within `FALSE_NODE_ID` node) // the CFG generation will return `LAST_FALSE_BLOCK_NODE_ID` node_id // 6.3) add edge `CURRENT_NODE_ID` --jmp-fallback--> `FALSE_NODE_ID` // 7) create a new empty CFG node. let's mark its node id as `AFTER_NODE_ID` // 8) add edge `LAST_TRUE_BLOCK_NODE_ID` --jmp-always--> `AFTER_NODE_ID` // 9) if `if-stmt` has `else-block`: // 9.1) add edge `LAST_FALSE_BLOCK_NODE_ID` --jmp-always--> `AFTER_NODE_ID` // else: // 9.1) add edge `CURRENT_NODE_ID` --jmp-fallback--> `AFTER_NODE_ID` // 10) return `AFTER_NODE_ID` node_id (empty CFG node to be used for the next statement) self.build_expr(node_id, &if_stmt.cond_expr); let true_node_id = self.cfg_graph.new_node(); let last_true_block_node_id = self.build_block(true_node_id, &if_stmt.true_block); self.add_edge(node_id, true_node_id, CfgJumpType::WhenTrue); let mut last_false_block_node_id = None; if if_stmt.false_block.is_some() { let false_node_id = self.cfg_graph.new_node(); let last_node_id = self.build_block(false_node_id, if_stmt.false_block.as_ref().unwrap()); last_false_block_node_id = Some(last_node_id); self.add_edge(node_id, false_node_id, CfgJumpType::Fallback); } let true_block_ends_with_empty_node = self.cfg_graph.node_is_empty(last_true_block_node_id); let true_block_ends_with_return = self.cfg_graph.ends_with_return(last_true_block_node_id); let mut draw_true_block_to_after_node_edge = false; let after_node_id = match true_block_ends_with_empty_node { true => Some(last_true_block_node_id), // we'll reuse this empty node false => { // we know the `true-block last node` isn't empty // but we want to allocate a new empty CFG node **only** // when the last node-statement *IS NOT* a `RETURN`-statement if true_block_ends_with_return { // no need to draw edge `LAST_TRUE_BLOCK_NODE_ID` --jmp-always--> `AFTER_NODE_ID` None } else { draw_true_block_to_after_node_edge = true; Some(self.cfg_graph.new_node()) } } }; if draw_true_block_to_after_node_edge { self.add_edge( last_true_block_node_id, after_node_id.unwrap(), CfgJumpType::Always, ); } if if_stmt.false_block.is_some() { // we draw edge `LAST_FALSE_BLOCK_NODE_ID` --jmp-always--> `AFTER_NODE_ID` // only if the `else-block` statement *IS NOT* a `RETURN`-statement let last_false_block_node_id = last_false_block_node_id.unwrap(); let false_block_ends_with_return = self.cfg_graph.ends_with_return(last_false_block_node_id); if false_block_ends_with_return == false { self.add_edge( last_false_block_node_id, after_node_id.unwrap(), CfgJumpType::Always, ); } } else { // there is no `else-block` // we'll draw edge `CURRENT_NODE_ID` --jmp-fallback--> `AFTER_NODE_ID` // in case there is an after node if after_node_id.is_some() { self.add_edge(node_id, after_node_id.unwrap(), CfgJumpType::Fallback); } } if after_node_id.is_some() { after_node_id.unwrap() } else { self.cfg_graph.new_node() } } fn build_block(&mut self, node_id: CfgNodeId, block_stmt: &BlockStatement) -> CfgNodeId { let mut last_node_id = node_id; for stmt in &block_stmt.stmts { last_node_id = self.build_stmt(node_id, stmt); } last_node_id } fn append_inst(&mut self, node_id: CfgNodeId, inst: CfgInstruction) { let node = self.cfg_graph.get_node_mut(node_id); node.append_inst(inst); } fn add_edge(&mut self, src_id: CfgNodeId, dst_id: CfgNodeId, jmp_type: CfgJumpType) { self.cfg_graph.add_edge(src_id, dst_id, jmp_type); } fn append_ret(&mut self, node_id: CfgNodeId) { let node = self.cfg_graph.get_node_mut(node_id); let mut append_ret = false; if node.is_empty() || *node.insts.last().unwrap() != CfgInstruction::Return { append_ret = true; } if append_ret { self.append_inst(node_id, CfgInstruction::Return); } } fn append_eoc(&mut self, node_id: CfgNodeId) { self.append_inst(node_id, CfgInstruction::EOC); } }
37.246753
116
0.604901
54b6707776ec6dd2d74094af4aebbeaed3a01ca0
4,198
sql
SQL
sql/tables.sql
icook/ngpool
194fe0f8d77a83c0600bf001cf40f54527e41c7f
[ "MIT" ]
4
2018-01-23T21:15:03.000Z
2018-10-17T15:50:49.000Z
sql/tables.sql
icook/ngpool
194fe0f8d77a83c0600bf001cf40f54527e41c7f
[ "MIT" ]
32
2017-12-03T20:07:28.000Z
2018-11-25T12:33:43.000Z
sql/tables.sql
icook/ngpool
194fe0f8d77a83c0600bf001cf40f54527e41c7f
[ "MIT" ]
3
2018-01-11T06:53:34.000Z
2018-08-11T20:40:12.000Z
CREATE TABLE share ( username varchar NOT NULL, difficulty double precision NOT NULL, mined_at timestamp with time zone NOT NULL, sharechain varchar NOT NULL, currencies varchar[] NOT NULL ); CREATE TYPE aggregation_type AS ENUM ('sharechain', 'user', 'mature'); CREATE TABLE minute_share ( cat varchar NOT NULL, key varchar NOT NULL, minute timestamp with time zone NOT NULL, difficulty double precision NOT NULL, shares integer NOT NULL, sharechain varchar NOT NULL, stratum varchar NOT NULL, CONSTRAINT minute_share_pkey PRIMARY KEY (cat, key, minute) ); CREATE TABLE utxo ( currency varchar NOT NULL, address varchar NOT NULL, hash varchar NOT NULL, vout integer NOT NULL, amount bigint NOT NULL, spent boolean NOT NULL DEFAULT false, spendable boolean NOT NULL DEFAULT false, CONSTRAINT utxo_pkey PRIMARY KEY (hash) ); CREATE TYPE block_status AS ENUM ('immature', 'orphan', 'mature'); CREATE TABLE block ( currency varchar NOT NULL, powalgo varchar NOT NULL, height bigint NOT NULL, hash varchar NOT NULL, coinbase_hash varchar NOT NULL, powhash varchar NOT NULL, subsidy numeric NOT NULL, mined_at timestamp with time zone NOT NULL, mined_by varchar NOT NULL, target double precision NOT NULL, status block_status DEFAULT 'immature' NOT NULL, credited boolean DEFAULT false NOT NULL, payout_data json DEFAULT '{}'::JSON NOT NULL, CONSTRAINT block_pkey PRIMARY KEY (hash), CONSTRAINT coinbase_hash_fk FOREIGN KEY (coinbase_hash) REFERENCES utxo (hash) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ); CREATE TABLE users ( id SERIAL NOT NULL, username varchar, password varchar, email varchar, verified_email boolean NOT NULL DEFAULT false, tfa_code varchar, tfa_enabled boolean NOT NULL DEFAULT false, CONSTRAINT users_pkey PRIMARY KEY (id), CONSTRAINT unique_email UNIQUE (email), CONSTRAINT unique_username UNIQUE (username) ); CREATE TABLE payout_transaction ( hash varchar NOT NULL, currency varchar, sent timestamp with time zone, signed_tx bytea NOT NULL, confirmed boolean NOT NULL DEFAULT false, CONSTRAINT payout_transaction_pkey PRIMARY KEY (hash) ); CREATE TABLE payout ( user_id integer NOT NULL, amount bigint NOT NULL, payout_transaction varchar NOT NULL, fee integer NOT NULL, address varchar NOT NULL, CONSTRAINT payout_transaction_fkey FOREIGN KEY (payout_transaction) REFERENCES payout_transaction (hash) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT user_id_fk FOREIGN KEY (user_id) REFERENCES users (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ); CREATE TABLE payout_address ( user_id integer NOT NULL, currency varchar, address varchar, CONSTRAINT user_id_fk FOREIGN KEY (user_id) REFERENCES users (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT payout_address_pkey PRIMARY KEY (user_id, currency) ); CREATE TABLE credit ( id SERIAL NOT NULL, user_id integer NOT NULL, amount numeric NOT NULL, currency varchar NOT NULL, blockhash varchar NOT NULL, sharechain varchar NOT NULL, payout_transaction varchar, CONSTRAINT payout_transaction_fkey FOREIGN KEY (payout_transaction) REFERENCES payout_transaction (hash) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT unique_credit UNIQUE (user_id, blockhash, sharechain), CONSTRAINT blockhash_fk FOREIGN KEY (blockhash) REFERENCES block (hash) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT user_id_fk FOREIGN KEY (user_id) REFERENCES users (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT credit_pkey PRIMARY KEY (id) ); INSERT INTO users (id, username, password, email, verified_email, tfa_code, tfa_enabled) VALUES (1, 'fee', '$2a$06$pJF0DSl6M7pTjPv8hBTP1uL/lAe7UqHZl5gKc3QA02yRFV1oCTFum', 'fee@test.com', false, NULL, false);
30.42029
207
0.715102
46a777d477b99c5b03978b043acc49efa2be7577
2,084
html
HTML
contacto.html
alvarogabrielgomez/ckj1-site-github
e2d1e46d343c220e53725b3f035ec96cda1a1f4a
[ "Apache-2.0" ]
null
null
null
contacto.html
alvarogabrielgomez/ckj1-site-github
e2d1e46d343c220e53725b3f035ec96cda1a1f4a
[ "Apache-2.0" ]
null
null
null
contacto.html
alvarogabrielgomez/ckj1-site-github
e2d1e46d343c220e53725b3f035ec96cda1a1f4a
[ "Apache-2.0" ]
null
null
null
<div class="animated fadeIn" style=" width: 100%;display: flex;flex-wrap: wrap; justify-content: center;"> <div class="formulario-contenedor"> <div class="animated fadeIn" style="margin-bottom:3em; "> <div class=""> <h1> Escribeme y te respondo </h1> <h4>Por favor si quieres contactar conmigo puedes llenar el formulario de abajo.</h4> </div> </div> <form class="formulario"> <div class="info"> <div class="nombre"> <i class="fas fa-user fa-lg"></i> <input type="text" required placeholder="Nombre" name="nombre" autofocus/> </div> <div class="email"> <i class="fas fa-envelope fa-lg"></i> <input type="email" required placeholder="E-mail" name="email"/> </div> </div> <div class="comentarios"> <label for="comentarios""> <textarea name="comentarios" placeholder="Escribe tu comentario" id="comentarios" cols="30" rows="7"></textarea> </label> </div> <div class="intereses"> <label for="cotizacion"> <input type="checkbox" id="cotizacion" name="intereses" value="cotizacion">Cotizacion </label> <label for="reclamos"> <input type="checkbox" id="reclamos" name="intereses" value="reclamos">Reclamos </label> <label for="otros"> <input type="checkbox" id="otros" name="intereses" value="otros">Comentarios y Otros </label> </div> <input class="boton-enviar button" type="submit" value="Enviar" style="margin:8px 3px;"/> </form> </div> <div class="mapa-caracas"> </div> </div>
29.352113
128
0.465931
c6cf4d7e5a016153455f6404c714446a670a949a
1,213
kt
Kotlin
library/src/jmh/kotlin/ru/kontur/kinfra/kfixture/FixtureProcessorBenchmark.kt
kubitre/KFixture
eeb34d34268d1b39333003632ad308f6fbb8c953
[ "MIT" ]
1
2019-12-14T09:27:39.000Z
2019-12-14T09:27:39.000Z
library/src/jmh/kotlin/ru/kontur/kinfra/kfixture/FixtureProcessorBenchmark.kt
kubitre/KFixture
eeb34d34268d1b39333003632ad308f6fbb8c953
[ "MIT" ]
16
2019-11-21T16:26:27.000Z
2021-01-19T06:58:37.000Z
library/src/jmh/kotlin/ru/kontur/kinfra/kfixture/FixtureProcessorBenchmark.kt
kubitre/KFixture
eeb34d34268d1b39333003632ad308f6fbb8c953
[ "MIT" ]
2
2020-11-05T08:31:44.000Z
2020-11-05T08:41:35.000Z
package ru.kontur.kinfra.kfixture import org.openjdk.jmh.annotations.* import org.reflections.Reflections import ru.kontur.kinfra.kfixture.data.objects.random1.RandomDataStructure import ru.kontur.kinfra.kfixture.model.CollectionSettings import ru.kontur.kinfra.kfixture.processor.impl.FixtureProcessor import ru.kontur.kinfra.kfixture.processor.scanner.CachedAnnotationScanner import ru.kontur.kinfra.kfixture.processor.scanner.GeneratorAnnotationScannerImpl import ru.kontur.kinfra.kfixture.utils.toKType @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 0) @Measurement(iterations = 5, batchSize = 1) @State(value = Scope.Benchmark) open class FixtureProcessorBenchmark { private lateinit var processor: FixtureProcessor private val clazz = RandomDataStructure::class.java @Setup fun setup() { processor = FixtureProcessor( collectionSettings = CollectionSettings(), generatorAnnotationScanner = CachedAnnotationScanner( GeneratorAnnotationScannerImpl(Reflections()) ) ) } @Benchmark fun sum() { for (i in 0 until 10) processor.generateParam(clazz.kotlin, clazz.toKType(), null) } }
34.657143
81
0.747733
943dd3914f79c0bc07c16308d6817983ae9873c9
517
cpp
C++
lib/src/pass/selector/ConstructTraitSelector.cpp
jplehr/InstRO
62a27e2c0cd24abc615e102c53bad08225aa8c0d
[ "BSD-3-Clause" ]
3
2016-03-30T06:37:59.000Z
2021-08-06T01:39:10.000Z
lib/src/pass/selector/ConstructTraitSelector.cpp
jplehr/InstRO
62a27e2c0cd24abc615e102c53bad08225aa8c0d
[ "BSD-3-Clause" ]
13
2016-04-13T16:11:12.000Z
2018-04-16T11:06:45.000Z
lib/src/pass/selector/ConstructTraitSelector.cpp
jplehr/InstRO
62a27e2c0cd24abc615e102c53bad08225aa8c0d
[ "BSD-3-Clause" ]
1
2019-01-28T17:57:09.000Z
2019-01-28T17:57:09.000Z
#include "instro/pass/selector/ConstructTraitSelector.h" #include "instro/tooling/AnalysisInterface.h" #include "instro/Instrumentor.h" #include "instro/core/Singleton.h" namespace InstRO { namespace Selector { void ConstructTraitSelector::execute() { InstRO::Tooling::ConstructTraitInterface::ConstructTraitInterface* cti = getInstrumentorInstance()->getAnalysisManager()->getConstructTraitInterface(); outputSet = cti->getConstructsByTrait(constructTrait); } } // namespace Selector } // namespace InstRO
27.210526
81
0.794971
1a14e1913f74df70b18a3fb69c0d3f454cb35876
1,267
ps1
PowerShell
Update-AzKeyVaultIpRange.ps1
jeffnelson1/azure-powershell-scripts
5a921656f81fd2ecbd8047000ac306d0cf905216
[ "Apache-2.0" ]
null
null
null
Update-AzKeyVaultIpRange.ps1
jeffnelson1/azure-powershell-scripts
5a921656f81fd2ecbd8047000ac306d0cf905216
[ "Apache-2.0" ]
null
null
null
Update-AzKeyVaultIpRange.ps1
jeffnelson1/azure-powershell-scripts
5a921656f81fd2ecbd8047000ac306d0cf905216
[ "Apache-2.0" ]
null
null
null
## Define variables ## Subscription ID array [array]$subs = @( "subid" ) ## Define array of IP ranges for key vault service endpoint exceptions [array]$sourceIps = @( "0.0.0.0/23" ) foreach ($sub in $subs) { $subName = (Get-AzSubscription -SubscriptionId $sub).Name Write-Output "Setting context to $subName" Set-AzContext -SubscriptionId $sub ## Get all Key Vaults within a subscription and export info to a csv $keyVaults = Get-AzKeyVault foreach ($keyVault in $keyVaults) { ## Updating the key vault IP exception list for the key vault firewall Update-AzKeyVaultNetworkRuleSet -VaultName $keyVault.VaultName -ResourceGroupName $keyVault.ResourceGroupName -IpAddressRange $sourceIps Write-Output "The IP exceptions for $($keyVault.VaultName) have been updated." if ($keyVault.Name -ne "" ) { ## Enabling the firewall on the key vault Update-AzKeyVaultNetworkRuleSet -VaultName $keyVault.VaultName $keyVault.ResourceGroupName -DefaultAction Deny Write-Output "The firewall for $($keyVault.VaultName) has been enabled." } else { Write-Output " will not have the key vault firewall enabled." } } }
29.465116
144
0.664562
c7b50bda1d2a0f3fd9933fd2bd82b0c2334ccab6
37
py
Python
tests/imported/both3levels/a/c/__init__.py
Xion/recursely
6952a32b076844a02a1df19deca6b506a951b286
[ "BSD-2-Clause" ]
null
null
null
tests/imported/both3levels/a/c/__init__.py
Xion/recursely
6952a32b076844a02a1df19deca6b506a951b286
[ "BSD-2-Clause" ]
1
2015-03-26T01:34:17.000Z
2015-03-26T01:34:17.000Z
tests/imported/both3levels/a/c/__init__.py
Xion/recursely
6952a32b076844a02a1df19deca6b506a951b286
[ "BSD-2-Clause" ]
null
null
null
""" Package used by tests. """ C = 3
7.4
22
0.540541
66d41bf3144ea0904cce8a6a8ea431fb0e4a17ee
3,698
hpp
C++
sample_project/env/lib/python3.9/site-packages/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_utils.hpp
Istiakmorsalin/ML-Data-Science
681e68059b146343ef55b0671432dc946970730d
[ "MIT" ]
1
2020-08-07T16:09:57.000Z
2020-08-07T16:09:57.000Z
sample_project/env/lib/python3.9/site-packages/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_utils.hpp
Istiakmorsalin/ML-Data-Science
681e68059b146343ef55b0671432dc946970730d
[ "MIT" ]
8
2020-07-19T23:39:31.000Z
2022-02-27T01:38:46.000Z
vscode/extensions/ms-python.python-2020.3.69010/pythonFiles/lib/python/debugpy/wheels/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_utils.hpp
Adespinoza/dotfiles
e2509402a7fd2623a3ea401b6f9fcbf6a372fc60
[ "CC0-1.0" ]
1
2019-03-29T01:09:56.000Z
2019-03-29T01:09:56.000Z
#ifndef _PY_UTILS_HPP_ #define _PY_UTILS_HPP_ typedef int (Py_IsInitialized)(); typedef PyInterpreterState* (PyInterpreterState_Head)(); typedef enum { PyGILState_LOCKED, PyGILState_UNLOCKED } PyGILState_STATE; typedef PyGILState_STATE(PyGILState_Ensure)(); typedef void (PyGILState_Release)(PyGILState_STATE); typedef int (PyRun_SimpleString)(const char *command); typedef PyThreadState* (PyInterpreterState_ThreadHead)(PyInterpreterState* interp); typedef PyThreadState* (PyThreadState_Next)(PyThreadState *tstate); typedef PyThreadState* (PyThreadState_Swap)(PyThreadState *tstate); typedef PyThreadState* (_PyThreadState_UncheckedGet)(); typedef PyObject* (PyObject_CallFunctionObjArgs)(PyObject *callable, ...); // call w/ varargs, last arg should be nullptr typedef PyObject* (PyInt_FromLong)(long); typedef PyObject* (PyErr_Occurred)(); typedef void (PyErr_Fetch)(PyObject **ptype, PyObject **pvalue, PyObject **ptraceback); typedef void (PyErr_Restore)(PyObject *type, PyObject *value, PyObject *traceback); typedef PyObject* (PyImport_ImportModule) (const char *name); typedef PyObject* (PyImport_ImportModuleNoBlock) (const char *name); typedef PyObject* (PyObject_GetAttrString)(PyObject *o, const char *attr_name); typedef PyObject* (PyObject_HasAttrString)(PyObject *o, const char *attr_name); typedef void* (PyThread_get_key_value)(int); typedef int (PyThread_set_key_value)(int, void*); typedef void (PyThread_delete_key_value)(int); typedef int (PyObject_Not) (PyObject *o); typedef PyObject* (PyDict_New)(); typedef PyObject* (PyUnicode_InternFromString)(const char *u); typedef PyObject * (_PyObject_FastCallDict)( PyObject *callable, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); typedef int (PyTraceBack_Here)(PyFrameObject *frame); typedef PyObject* PyTuple_New(Py_ssize_t len); typedef PyObject* PyEval_CallObjectWithKeywords(PyObject *callable, PyObject *args, PyObject *kwargs); typedef void (PyEval_SetTrace)(Py_tracefunc, PyObject *); typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *frame, int, PyObject *); // holder to ensure we release the GIL even in error conditions class GilHolder { PyGILState_STATE _gilState; PyGILState_Release* _release; public: GilHolder(PyGILState_Ensure* acquire, PyGILState_Release* release) { _gilState = acquire(); _release = release; } ~GilHolder() { _release(_gilState); } }; #ifdef _WIN32 #define PRINT(msg) {std::cout << msg << std::endl << std::flush;} #define DEFINE_PROC_NO_CHECK(func, funcType, funcNameStr, errorCode) \ funcType func=reinterpret_cast<funcType>(GetProcAddress(module, funcNameStr)); #define DEFINE_PROC(func, funcType, funcNameStr, errorCode) \ DEFINE_PROC_NO_CHECK(func, funcType, funcNameStr, errorCode); \ if(func == nullptr){std::cout << funcNameStr << " not found." << std::endl << std::flush; return errorCode;}; #else // LINUX ----------------------------------------------------------------- #define PRINT(msg) {printf(msg); printf("\n");} #define CHECK_NULL(ptr, msg, errorCode) if(ptr == nullptr){printf(msg); return errorCode;} #define DEFINE_PROC_NO_CHECK(func, funcType, funcNameStr, errorCode) \ funcType func; *(void**)(&func) = dlsym(module, funcNameStr); #define DEFINE_PROC(func, funcType, funcNameStr, errorCode) \ DEFINE_PROC_NO_CHECK(func, funcType, funcNameStr, errorCode); \ if(func == nullptr){printf(funcNameStr); printf(" not found.\n"); return errorCode;}; #endif //_WIN32 #endif //_PY_UTILS_HPP_
46.225
130
0.712006
f595b9a2d01e4b782f950204e7beb1fefe0c9ef3
2,190
cc
C++
chrome/browser/task_manager/providers/web_contents/background_contents_tag.cc
Ron423c/chromium
2edf7b980065b648f8b2a6e52193d83832fe36b7
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/browser/task_manager/providers/web_contents/background_contents_tag.cc
Ron423c/chromium
2edf7b980065b648f8b2a6e52193d83832fe36b7
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/browser/task_manager/providers/web_contents/background_contents_tag.cc
Ron423c/chromium
2edf7b980065b648f8b2a6e52193d83832fe36b7
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2021-03-07T14:20:02.000Z
2021-03-07T14:20:02.000Z
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/task_manager/providers/web_contents/background_contents_tag.h" #include <memory> #include "base/strings/utf_string_conversions.h" #include "chrome/browser/background/background_contents.h" #include "chrome/browser/background/background_contents_service.h" #include "chrome/browser/background/background_contents_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/task_manager/providers/web_contents/background_contents_task.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/extension_registry.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" namespace task_manager { std::unique_ptr<RendererTask> BackgroundContentsTag::CreateTask( WebContentsTaskProvider*) const { // Try to lookup the application name from the parent extension (if any). Profile* profile = Profile::FromBrowserContext( web_contents()->GetBrowserContext()); BackgroundContentsService* background_contents_service = BackgroundContentsServiceFactory::GetForProfile(profile); const std::string& application_id = background_contents_service->GetParentApplicationId(background_contents_); const extensions::ExtensionSet& extensions_set = extensions::ExtensionRegistry::Get(profile)->enabled_extensions(); const extensions::Extension* extension = extensions_set.GetByID(application_id); base::string16 application_name; if (extension) application_name = base::UTF8ToUTF16(extension->name()); return std::make_unique<BackgroundContentsTask>(application_name, background_contents_); } BackgroundContentsTag::BackgroundContentsTag( content::WebContents* web_contents, BackgroundContents* background_contents) : WebContentsTag(web_contents), background_contents_(background_contents) { DCHECK(background_contents); } BackgroundContentsTag::~BackgroundContentsTag() { } } // namespace task_manager
39.818182
88
0.782648
85c92ad279638b41babca0bbab374c603ab9e558
520
js
JavaScript
lib/make-svg-sprite.js
blivesta/svgpack
f99ac440210ad2b2239bf2809317540fd769263c
[ "MIT" ]
27
2016-01-17T21:58:23.000Z
2020-11-29T12:27:21.000Z
lib/make-svg-sprite.js
blivesta/flexicon-generator
f99ac440210ad2b2239bf2809317540fd769263c
[ "MIT" ]
2
2016-04-15T09:21:09.000Z
2017-07-12T15:29:59.000Z
lib/make-svg-sprite.js
blivesta/flexicon-generator
f99ac440210ad2b2239bf2809317540fd769263c
[ "MIT" ]
11
2016-03-17T20:04:49.000Z
2020-05-15T17:10:35.000Z
var _ = require('lodash') var path = require('path') var readFileSync = require('./read-file-sync') var writeFileSync = require('./write-file-sync') function makeSvgSprite (options, data) { var input = readFileSync(options.templates.sprite) var output = path.resolve(options.dest + '/' + options.name + '-sprite.svg') var content = _.template(input) data.config = options var result = content(data).replace(/\r?\n|\s\s\s\s|\s\s/g, '') return writeFileSync(output, result) } module.exports = makeSvgSprite
30.588235
78
0.7
05fa0988344c516584078184ec7d731df4c5e1cf
6,663
html
HTML
src/views/pages/FAQ.html
LehaRybkoha/GETDK
a6fd9a8e9ac9a402982a2887ff936b1558c049ff
[ "MIT" ]
null
null
null
src/views/pages/FAQ.html
LehaRybkoha/GETDK
a6fd9a8e9ac9a402982a2887ff936b1558c049ff
[ "MIT" ]
null
null
null
src/views/pages/FAQ.html
LehaRybkoha/GETDK
a6fd9a8e9ac9a402982a2887ff936b1558c049ff
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="ru"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>title</title> <meta name="description" content="description"> <meta name="keywords" content="keywords"> <!-- og image --> <meta property="og:type" content="website"> <meta property="og:site_name" content="site_name"> <meta property="og:title" content="title"> <meta property="og:description" content="description"> <meta property="og:url" content="http://localhost/index.html"> <!-- viewport --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- icon --> <link rel="shortcut icon" href="../img/favicons/apple-touch-icon.png" type="image/x-icon"> <link rel="apple-touch-icon" href="../../img/favicons/apple-touch-icon.png"> <!-- Fonts --> <link href="" rel="stylesheet"> <!-- Font Awesome --> <script src="https://kit.fontawesome.com/38d2cab1a5.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.css"> <!-- Styles --> <link rel="stylesheet" href="../styles/main.css"> </head> <body> <header class="header header-public-offer"> <div class="container"> <div class="header-wrapper"> <div class="header-left"> <div class="logo"> <a href="/index.html" class="logo-link"> <img src="/img/logo.svg" alt="logo" class="logo-pic"> <span class="logo-desc">G E T D K</span> </a> </div> </div> <div class="header-right"> <div class="email"> <a class="email-link email-public-offer" href="mailto:info@getdk.online">info@getdk.online</a> </div> <div class="hamburger nav-open"> <div></div> <div></div> <div></div> </div> </div> </div> <nav id="nav" class="nav"> <div class="nav-head"> <a class="nav-email" href="mailto:info@getdk.online">info@getdk.online</a> <button type="button" class="nav-close" href="javascript:void(0)">&times;</button> </div> <ul class="nav__list"> <li class="nav__item"><a href="/index.html" class="nav__link">Калькулятор<br>диагностической<br>карты</a></li> <li class="nav__item"><a href="/osago.html" class="nav__link">ОСАГО</a></li> <li class="nav__item"><a href="/FAQ.html" class="nav__link">Популярные вопросы?</a></li> </ul> <a href="/public-offer.html" class="nav-footer">Публичная оферта GETDK</a> </nav> </div> </header> <section class="faq"> <div class="wrapper-section"> <div class="faq__title"> <h1 class="faq__title-text">Популярные<br>вопросы? F.A.Q</h1> </div> <div class="faq-content"> <ul class="faq-content__list"> <div class="faq-content__item-title"> <p class="faq-content__item-title--text">1. Зачем нужна диагностическая карта?</p> <button id="faq1" type="button" class="faq-content__item-button"><img src="/img/cross-faq.svg" alt="cross" class="faq-content__item-button--pic"></button> </div> <li id="faqit1" class="faq-content__item"> <p class="faq-content__item-text">Диагностическая карта подтверждает, что ваше транспортное средство соответствует техническим нормам эксплуатации, проще говоря, исправно. Документ обязателен при оформлении страховки ОСАГО и КАСКО. </p> </li> <hr class="form__line"> <div class="faq-content__item-title"> <p class="faq-content__item-title--text">2. Как проверить подлинность диагностической карты?</p> <button id="faq2" type="button" class="faq-content__item-button"><img src="/img/cross-faq.svg" alt="cross" class="faq-content__item-button--pic"></button> </div> <li id="faqit2" class="faq-content__item"> <p class="faq-content__item-text">Мы работаем исключительно с авторизированными пунктами технического осмотра, имеющими лицензию и внесёнными в реестр РСА. Если данные по ДК отображаются на сайте EAISTO.INFO, то она считается легитимной. Как использовать диагностическую карту при оформлении ОСАГО и КАСКО?</p> <p class="faq-content__item-text">Если Вы планируете приобрести страховой полис через интернет, необходимо будет указать уникальный номер (15 цифр) Вашей диагностической карты. Оформляя полис в офисе страховой компании, нужно будет предъявить диагностическую карту в распечатанном или электронном виде. </p> </li> <hr class="form__line"> <div class="faq-content__item-title"> <p class="faq-content__item-title--text">3. Я потерял документ. Могу ли я его восстановить?</p> <button id="faq3" type="button" class="faq-content__item-button"><img src="/img/cross-faq.svg" alt="cross" class="faq-content__item-button--pic"></button> </div> <li id="faqit3" class="faq-content__item"> <p class="faq-content__item-text">Да, для этого напишите нам письмо на <a class="faq-content__item-link" href="mailto:info@getdk.online">info@getdk.online</a>. Все зарегистрированные данные хранятся на государственном сервере ЕАИСТО в течение 5 лет. Сохранность данных защищает ФЗ-№170 РФ.</p> </li> <hr class="form__line"> </ul> </div> </div> </section> <script src="../js/main.js"></script> </body> </html>
58.964602
335
0.520336
afa8ad5a8bf5529f98e73a3857bb6e84fee2881a
4,799
kt
Kotlin
app/src/main/java/edu/stanford/qiwen/starmap/DisplayMapActivity.kt
qwang70/StarMap
04b646ad691c8e82026d563e387bd9cdf273f1c6
[ "Apache-2.0" ]
null
null
null
app/src/main/java/edu/stanford/qiwen/starmap/DisplayMapActivity.kt
qwang70/StarMap
04b646ad691c8e82026d563e387bd9cdf273f1c6
[ "Apache-2.0" ]
null
null
null
app/src/main/java/edu/stanford/qiwen/starmap/DisplayMapActivity.kt
qwang70/StarMap
04b646ad691c8e82026d563e387bd9cdf273f1c6
[ "Apache-2.0" ]
null
null
null
package edu.stanford.qiwen.starmap import android.app.Activity import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.os.Handler import android.os.SystemClock import android.util.Log import android.view.Menu import android.view.MenuItem import android.view.animation.BounceInterpolator import android.widget.Toast import com.google.android.gms.maps.CameraUpdateFactory import com.google.android.gms.maps.GoogleMap import com.google.android.gms.maps.OnMapReadyCallback import com.google.android.gms.maps.SupportMapFragment import com.google.android.gms.maps.model.* import edu.stanford.qiwen.starmap.models.Place import edu.stanford.qiwen.starmap.models.UserMap import kotlin.math.max private const val TAG = "DisplayMapActivity" class DisplayMapActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mMap: GoogleMap private lateinit var userMap: UserMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_display_map) userMap = intent.getSerializableExtra(EXTRA_USER_MAP) as UserMap supportActionBar?.title = userMap.title // Obtain the SupportMapFragment and get notified when the map is ready to be used. val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as SupportMapFragment mapFragment.getMapAsync(this) } override fun onCreateOptionsMenu(menu: Menu?): Boolean { menuInflater.inflate(R.menu.menu_display_map, menu) return super.onCreateOptionsMenu(menu) } override fun onOptionsItemSelected(item: MenuItem): Boolean { if (item.itemId == R.id.miTerrain) { // Switch between Terrain and Normal view val newCheckValue = !item.isChecked item.isChecked = newCheckValue Log.i(TAG, "Switch option set to: $newCheckValue") if (item.isChecked) { mMap.mapType = GoogleMap.MAP_TYPE_TERRAIN } else { mMap.mapType = GoogleMap.MAP_TYPE_NORMAL } } return super.onOptionsItemSelected(item) } /** * Manipulates the map once available. * This callback is triggered when the map is ready to be used. * This is where we can add markers or lines, add listeners or move the camera. In this case, * we just add a marker near Sydney, Australia. * If Google Play services is not installed on the device, the user will be prompted to install * it inside the SupportMapFragment. This method will only be triggered once the user has * installed Google Play services and returned to the app. */ override fun onMapReady(googleMap: GoogleMap) { mMap = googleMap Log.i(TAG, "User map to render: ${userMap.title}") val boundsBuilder = LatLngBounds.Builder() for (place in userMap.places) { val latLng = LatLng(place.latitude, place.longitude) boundsBuilder.include(latLng) val marker = mMap.addMarker( MarkerOptions() .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_VIOLET)) .position(latLng) .title(place.title) .snippet(place.description) ) dropPinEffect(marker) } mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(boundsBuilder.build(), 1000, 1000, 0)) } /* Source: https://guides.codepath.com/android/Google-Maps-API-v2-Usage#falling-pin-animation */ /* Animation of the drop pin effect. */ private fun dropPinEffect(marker: Marker) { // Handler allows us to repeat a code block after a specified delay val handler = Handler() val start = SystemClock.uptimeMillis() val duration = 1500 // Use the bounce interpolator val interpolator = BounceInterpolator() // Animate marker with a bounce updating its position every 15ms handler.post(object : Runnable { override fun run() { val elapsed = SystemClock.uptimeMillis() - start // Calculate t for bounce based on elapsed time val t = max( 1 - interpolator.getInterpolation( elapsed.toFloat() / duration ), 0.toFloat() ) // Set the anchor marker.setAnchor(0.5f, 1.0f + 14 * t) if (t > 0.0) { // Post this event again 15ms from now. handler.postDelayed(this, 15) } } }) } }
37.20155
100
0.645551
f7334cd5a03a8e95360173b8eedd4acf02b45baa
5,786
h
C
ieee_sep/DERSettings.h
Tylores/ieee_sep
1928bed8076f4bfe702d34e436c6a85f197b0832
[ "BSD-2-Clause" ]
null
null
null
ieee_sep/DERSettings.h
Tylores/ieee_sep
1928bed8076f4bfe702d34e436c6a85f197b0832
[ "BSD-2-Clause" ]
null
null
null
ieee_sep/DERSettings.h
Tylores/ieee_sep
1928bed8076f4bfe702d34e436c6a85f197b0832
[ "BSD-2-Clause" ]
null
null
null
/////////////////////////////////////////////////////////// // DERSettings.h // Implementation of the Class DERSettings // Created on: 13-Apr-2020 2:51:26 PM // Original author: shu /////////////////////////////////////////////////////////// #if !defined(EA_27094925_9AE1_4195_859B_AAF62D45E5CD__INCLUDED_) #define EA_27094925_9AE1_4195_859B_AAF62D45E5CD__INCLUDED_ #include "DERControlType.h" #include "UInt32.h" #include "UInt16.h" #include "Int16.h" #include "CurrentRMS.h" #include "AmpereHour.h" #include "ApparentPower.h" #include "VoltageRMS.h" #include "ReactivePower.h" #include "WattHour.h" #include "PowerFactor.h" #include "TimeType.h" #include "SubscribableResource.h" /** * Distributed energy resource settings */ class DERSettings : public SubscribableResource { public: DERSettings(); virtual ~DERSettings(); /** * Bitmap indicating the DER Controls enabled on the device. See DERControlType * for values. If a control is supported (see DERCapability::modesSupported), but * not enabled, the control will not be executed if encountered. */ DERControlType modesEnabled; /** * Enter service delay, in hundredths of a second. */ UInt32 setESDelay; /** * Enter service frequency high. Specified in hundredths of Hz. */ UInt16 setESHighFreq; /** * Enter service voltage high. Specified as an effective percent voltage, defined * as (100% * (locally measured voltage - setVRefOfs) / setVRef), in hundredths of * a percent. */ Int16 setESHighVolt; /** * Enter service frequency low. Specified in hundredths of Hz. */ UInt16 setESLowFreq; /** * Enter service voltage low. Specified as an effective percent voltage, defined * as (100% * (locally measured voltage - setVRefOfs) / setVRef), in hundredths of * a percent. */ Int16 setESLowVolt; /** * Enter service ramp time, in hundredths of a second. */ UInt32 setESRampTms; /** * Enter service randomized delay, in hundredths of a second. */ UInt32 setESRandomDelay; /** * Set default rate of change (ramp rate) of active power output due to command or * internal action, defined in %setWMax / second. Resolution is in hundredths of * a percent/second. A value of 0 means there is no limit. Interpreted as a * percentage change in output capability limit per second when used as a default * ramp rate. */ UInt16 setGradW; /** * AC current maximum. Maximum AC current in RMS Amperes. */ CurrentRMS setMaxA; /** * Maximum usable energy storage capacity of the DER, in AmpHours. Note: this may * be different from physical capability. */ AmpereHour setMaxAh; /** * Apparent power charge maximum. Maximum apparent power the DER can absorb from * the grid in Volt-Amperes. May differ from the apparent power maximum (setMaxVA). */ ApparentPower setMaxChargeRateVA; /** * Maximum rate of energy transfer received by the storage device, in Watts. * Defaults to rtgMaxChargeRateW. */ ActivePower setMaxChargeRateW; /** * Apparent power discharge maximum. Maximum apparent power the DER can deliver to * the grid in Volt-Amperes. May differ from the apparent power maximum (setMaxVA). */ ApparentPower setMaxDischargeRateVA; /** * Maximum rate of energy transfer delivered by the storage device, in Watts. * Defaults to rtgMaxDischargeRateW. */ ActivePower setMaxDischargeRateW; /** * AC voltage maximum setting. */ VoltageRMS setMaxV; /** * Set limit for maximum apparent power capability of the DER (in VA). Defaults to * rtgMaxVA. */ ApparentPower setMaxVA; /** * Set limit for maximum reactive power delivered by the DER (in var). SHALL be a * positive value <= rtgMaxVar (default). */ ReactivePower setMaxVar; /** * Set limit for maximum reactive power received by the DER (in var). If present, * SHALL be a negative value >= rtgMaxVarNeg (default). If absent, defaults to * negative setMaxVar. */ ReactivePower setMaxVarNeg; /** * Set limit for maximum active power capability of the DER (in W). Defaults to * rtgMaxW. */ ActivePower setMaxW; /** * Maximum energy storage capacity of the DER, in WattHours. Note: this may be * different from physical capability. */ WattHour setMaxWh; /** * Set minimum Power Factor displacement limit of the DER when injecting reactive * power (over-excited); SHALL be a positive value between 0.0 (typically > 0.7) * and 1.0. SHALL be >= rtgMinPFOverExcited (default). */ PowerFactor setMinPFOverExcited; /** * Set minimum Power Factor displacement limit of the DER when absorbing reactive * power (under-excited); SHALL be a positive value between 0.0 (typically > 0.7) * and 0.9999. If present, SHALL be >= rtgMinPFUnderExcited (default). If absent, * defaults to setMinPFOverExcited. */ PowerFactor setMinPFUnderExcited; /** * AC voltage minimum setting. */ VoltageRMS setMinV; /** * Set soft-start rate of change (soft-start ramp rate) of active power output due * to command or internal action, defined in %setWMax / second. Resolution is in * hundredths of a percent/second. A value of 0 means there is no limit. * Interpreted as a percentage change in output capability limit per second when * used as a ramp rate. */ UInt16 setSoftGradW; /** * AC voltage nominal setting. */ VoltageRMS setVNom; /** * The nominal AC voltage (RMS) at the utility's point of common coupling. */ VoltageRMS setVRef; /** * The nominal AC voltage (RMS) offset between the DER's electrical connection * point and the utility's point of common coupling. */ VoltageRMS setVRefOfs; /** * Specifies the time at which the DER information was last updated. */ TimeType updatedTime; }; #endif // !defined(EA_27094925_9AE1_4195_859B_AAF62D45E5CD__INCLUDED_)
31.445652
84
0.708434
0fbf3bd8c8c6a93b2d59c357bb572dd3130be7af
968
go
Go
component.go
nwehr/hl7
1b5c49b5123b67632a2046809a392903c5977627
[ "BSD-3-Clause" ]
null
null
null
component.go
nwehr/hl7
1b5c49b5123b67632a2046809a392903c5977627
[ "BSD-3-Clause" ]
null
null
null
component.go
nwehr/hl7
1b5c49b5123b67632a2046809a392903c5977627
[ "BSD-3-Clause" ]
1
2020-06-27T23:13:04.000Z
2020-06-27T23:13:04.000Z
package hl7 import ( "fmt" "strings" ) func (c Component) query(q *Query) (string, error) { if len(c) <= q.RepeatedComponent { return "", fmt.Errorf("component %d does not have repeated component %d for query %s", q.Component, q.RepeatedComponent, q.String()) } return string(c[q.RepeatedComponent]), nil } func (c Component) querySlice(q *Query) []string { if !q.HasRepeatedComponent { return c.SliceOfStrings() } return []string{string(c[q.RepeatedComponent])} } func (c Component) String() string { return strings.Join(c.SliceOfStrings(), string(repeatingComponentSeperator)) } func (c Component) SliceOfStrings() []string { strs := []string{} for _, s := range c { strs = append(strs, string(s)) } return strs } func (c Component) setString(q *Query, value string) (Component, error) { for len(c) < q.RepeatedComponent+1 { c = append(c, RepeatedComponent("")) } c[q.RepeatedComponent] = RepeatedComponent(value) return c, nil }
21.043478
134
0.690083
62f715465292d7fd1465dd23fa21c20688d24ff2
581
dart
Dart
lib/data/programs.dart
SushanShakya/dart_challenges
cd23fd2fc3eeb957a6eec4eec1ae2637a8b6ceba
[ "MIT" ]
null
null
null
lib/data/programs.dart
SushanShakya/dart_challenges
cd23fd2fc3eeb957a6eec4eec1ae2637a8b6ceba
[ "MIT" ]
null
null
null
lib/data/programs.dart
SushanShakya/dart_challenges
cd23fd2fc3eeb957a6eec4eec1ae2637a8b6ceba
[ "MIT" ]
1
2021-06-19T08:06:39.000Z
2021-06-19T08:06:39.000Z
List<Map<String, String>> programs = [ {"title": "Resistor Color", "file": "resistor_color"}, {"title": "Two Fer", "file": "two_fer"}, {"title": "Resistor Color Duo", "file": "resistor_color_duo"}, {"title": "Reverse String", "file": "reverse_string"}, {"title": "Leap", "file": "leap"}, {"title": "Scrabble Score", "file": "scrabble_score"}, {"title": "Beer Song", "file": "beer_song"}, {"title": "Armstrong Numbers", "file": "armstrong_numbers"}, {"title": "Isogram", "file": "isogram"}, {"title": "Difference Of Squares", "file": "difference_of_squares"} ];
44.692308
69
0.614458
af747ce53b1f3b54e5859f82205dbc4b7f8c5f3b
6,692
swift
Swift
test/ViewController.swift
TCJing/CAGradientLayer
36e8a98c3c580b1c5b56984e5eecb579835753ae
[ "Apache-2.0" ]
null
null
null
test/ViewController.swift
TCJing/CAGradientLayer
36e8a98c3c580b1c5b56984e5eecb579835753ae
[ "Apache-2.0" ]
null
null
null
test/ViewController.swift
TCJing/CAGradientLayer
36e8a98c3c580b1c5b56984e5eecb579835753ae
[ "Apache-2.0" ]
null
null
null
// // ViewController.swift // test // // Created by 敬庭超 on 2017/7/14. // Copyright © 2017年 敬庭超. All rights reserved. // import UIKit class ViewController: UIViewController,CAAnimationDelegate { enum PanDirection: Int { case Right case Left case Bottom case Top case TopLeftToBottomRight case TopRightToBottomLeft case BottomLeftToTopRight case BottomRightToTopLeft } var gradientLayer: CAGradientLayer! //数组当中有数组 var colorSets = [[CGColor]]() var currentColorSet: Int! var panDirection: PanDirection! override func viewDidLoad() { super.viewDidLoad() createColorSets() //需要在view的layer层上展示CAGradientLayer createGradientLayer() } func createGradientLayer() { gradientLayer = CAGradientLayer() gradientLayer.frame = self.view.bounds //设置用于产生渐变效果的颜色 gradientLayer.colors = colorSets[currentColorSet] //将 gradientLayer 作为 sublayer 添加至视图 layer 中。 self.view.layer.addSublayer(gradientLayer) //添加手势 let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewController.handleTapGesture(gestureRecognizer:))) self.view.addGestureRecognizer(tapGestureRecognizer) //添加了双指点击 let twoFingerTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewController.handleTwoFingerTapGesture(gestureRecognizer:))) self.view.addGestureRecognizer(twoFingerTapGestureRecognizer) let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(ViewController.handlePanGestureRecognizer(gestureRecognizer:))) self.view.addGestureRecognizer(panGestureRecognizer) } func createColorSets(){ colorSets.append([UIColor.red.cgColor,UIColor.yellow.cgColor,]); colorSets.append([UIColor.green.cgColor,UIColor.magenta.cgColor]); colorSets.append([UIColor.gray.cgColor,UIColor.lightGray.cgColor]) currentColorSet = 0 } func handleTapGesture(gestureRecognizer: UITapGestureRecognizer) { if currentColorSet < colorSets.count - 1 { currentColorSet = 1 + currentColorSet }else{ currentColorSet = 0 } let colorChangeAnimation = CABasicAnimation(keyPath: "colors") colorChangeAnimation.delegate = self colorChangeAnimation.duration = 2.0 colorChangeAnimation.toValue = colorSets[currentColorSet] colorChangeAnimation.fillMode = kCAFillModeForwards colorChangeAnimation.isRemovedOnCompletion = false gradientLayer.add(colorChangeAnimation, forKey: "colorRange") } func handleTwoFingerTapGesture(gestureRecognizer: UITapGestureRecognizer) { let secondColorLocation = arc4random_uniform(100) let firstColorLocation = arc4random_uniform(secondColorLocation - 1) gradientLayer.locations = [NSNumber(floatLiteral: Double(firstColorLocation)/100.0), NSNumber(floatLiteral: Double(secondColorLocation)/100.0)] print(gradientLayer.locations!) } func handlePanGestureRecognizer(gestureRecognizer: UIPanGestureRecognizer) { let velocity = gestureRecognizer.velocity(in: self.view) if gestureRecognizer.state == UIGestureRecognizerState.changed { if velocity.x > 300.0 { if velocity.y > 300.0 { panDirection = PanDirection.TopLeftToBottomRight } else if velocity.y < -300.0{ panDirection = PanDirection.BottomLeftToTopRight } else{ panDirection = PanDirection.Right } }else if velocity.x < -300.0{ if velocity.y > 300.0 { panDirection = PanDirection.TopRightToBottomLeft } else if(velocity.y < -300.0){ panDirection = PanDirection.BottomRightToTopLeft } else{ panDirection = PanDirection.Left } }else{ if velocity.y > 300.0 { panDirection = PanDirection.Bottom } else if velocity.y < -300.0{ panDirection = PanDirection.Top } else{ panDirection = nil } } } else if gestureRecognizer.state == UIGestureRecognizerState.ended { changeGradientDirection() } } func changeGradientDirection() { if panDirection != nil { switch panDirection.rawValue { case PanDirection.Right.rawValue: gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.0 ) gradientLayer.endPoint = CGPoint(x: 1.0, y: 0.5) case PanDirection.Left.rawValue: gradientLayer.startPoint = CGPoint(x: 1.0, y: 0.5) gradientLayer.endPoint = CGPoint(x: 0.0, y: 0.5) case PanDirection.Bottom.rawValue: gradientLayer.startPoint = CGPoint(x: 0.5, y: 0) gradientLayer.endPoint = CGPoint(x: 0.5, y: 1.0) case PanDirection.Top.rawValue: gradientLayer.startPoint = CGPoint(x: 0.5, y: 1.0) gradientLayer.endPoint = CGPoint(x: 0.5, y: 0.0 ) case PanDirection.TopLeftToBottomRight.rawValue: gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.0) gradientLayer.endPoint = CGPoint(x: 1.0, y: 1.0) case PanDirection.TopRightToBottomLeft.rawValue: gradientLayer.startPoint = CGPoint(x: 1.0, y: 0.0) gradientLayer.endPoint = CGPoint(x: 0.0, y: 1.0) case PanDirection.BottomLeftToTopRight.rawValue: gradientLayer.startPoint = CGPoint(x: 0.0, y: 1.0) gradientLayer.endPoint = CGPoint(x: 1.0, y: 0.0) default: gradientLayer.startPoint = CGPoint(x: 1.0, y: 1.0) gradientLayer.endPoint = CGPoint(x: 0.0, y: 0.0) } } } func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { if flag { gradientLayer.colors = colorSets[currentColorSet] } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
38.022727
161
0.599372
53e5d28b79f0db301253bfcd3a197e8f1ed657e3
1,917
java
Java
Android/Les4ElefantCowork/app/src/main/java/com/les4elefantastiq/les4elefantcowork/models/LiveFeedMessage.java
micbelgique/DevCamp2016-Les4Elefantastiq
61354d87e9971d7b4870b414fa948b95470064a8
[ "MIT" ]
null
null
null
Android/Les4ElefantCowork/app/src/main/java/com/les4elefantastiq/les4elefantcowork/models/LiveFeedMessage.java
micbelgique/DevCamp2016-Les4Elefantastiq
61354d87e9971d7b4870b414fa948b95470064a8
[ "MIT" ]
null
null
null
Android/Les4ElefantCowork/app/src/main/java/com/les4elefantastiq/les4elefantcowork/models/LiveFeedMessage.java
micbelgique/DevCamp2016-Les4Elefantastiq
61354d87e9971d7b4870b414fa948b95470064a8
[ "MIT" ]
null
null
null
package com.les4elefantastiq.les4elefantcowork.models; import android.support.annotation.NonNull; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class LiveFeedMessage implements Comparable<LiveFeedMessage> { // -------------- Objects, Variables -------------- // public static final int TYPE_ARRIVAL = 0; public static final int TYPE_TWITTER = 1; public static final int TYPE_COWORKSPACE_ADMIN = 2; public static final int TYPE_COWORKSPACE_OPENING = 3; public String title; public String text; public int type; public String dateTime; public String tweetLink; public String sender; public String coworkerLinkedInId; public Boolean isBirthday; public String pictureUrl; // ----------------- Constructor ------------------ // public LiveFeedMessage(String title, String text, int type, String dateTime, String tweetLink, String sender, String coworkerLinkedInId, Boolean isBirthday, String pictureUrl) { this.title = title; this.text = text; this.type = type; this.tweetLink = tweetLink; this.sender = sender; this.coworkerLinkedInId = coworkerLinkedInId; this.isBirthday = isBirthday; this.pictureUrl = pictureUrl; this.dateTime = dateTime; } // ---------------- Public Methods ---------------- // public Date getDate() { try { return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(dateTime); } catch (ParseException e) { e.printStackTrace(); return null; } } // ---------------- Private Methods --------------- // // ----------------- Miscellaneous ---------------- // @Override public int compareTo(@NonNull LiveFeedMessage liveFeedMessage) { return - getDate().compareTo(liveFeedMessage.getDate()); } }
29.492308
181
0.616067
810c717095deb16a27ae20ebf20ba4f717c1248d
18,608
rs
Rust
src/iocon/pio1_6.rs
geky/lpc55s6x-pac
766a1eec50a670a5872aa1a8c7637a9d5b9d6478
[ "Apache-2.0", "MIT" ]
null
null
null
src/iocon/pio1_6.rs
geky/lpc55s6x-pac
766a1eec50a670a5872aa1a8c7637a9d5b9d6478
[ "Apache-2.0", "MIT" ]
null
null
null
src/iocon/pio1_6.rs
geky/lpc55s6x-pac
766a1eec50a670a5872aa1a8c7637a9d5b9d6478
[ "Apache-2.0", "MIT" ]
null
null
null
#[doc = "Reader of register PIO1_6"] pub type R = crate::R<u32, super::PIO1_6>; #[doc = "Writer for register PIO1_6"] pub type W = crate::W<u32, super::PIO1_6>; #[doc = "Register PIO1_6 `reset()`'s with value 0"] impl crate::ResetValue for super::PIO1_6 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "Possible values of the field `FUNC`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FUNC_A { #[doc = "Alternative connection 0."] ALT0, #[doc = "Alternative connection 1."] ALT1, #[doc = "Alternative connection 2."] ALT2, #[doc = "Alternative connection 3."] ALT3, #[doc = "Alternative connection 4."] ALT4, #[doc = "Alternative connection 5."] ALT5, #[doc = "Alternative connection 6."] ALT6, #[doc = "Alternative connection 7."] ALT7, } impl From<FUNC_A> for u8 { #[inline(always)] fn from(variant: FUNC_A) -> Self { match variant { FUNC_A::ALT0 => 0, FUNC_A::ALT1 => 1, FUNC_A::ALT2 => 2, FUNC_A::ALT3 => 3, FUNC_A::ALT4 => 4, FUNC_A::ALT5 => 5, FUNC_A::ALT6 => 6, FUNC_A::ALT7 => 7, } } } #[doc = "Reader of field `FUNC`"] pub type FUNC_R = crate::R<u8, FUNC_A>; impl FUNC_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, FUNC_A> { use crate::Variant::*; match self.bits { 0 => Val(FUNC_A::ALT0), 1 => Val(FUNC_A::ALT1), 2 => Val(FUNC_A::ALT2), 3 => Val(FUNC_A::ALT3), 4 => Val(FUNC_A::ALT4), 5 => Val(FUNC_A::ALT5), 6 => Val(FUNC_A::ALT6), 7 => Val(FUNC_A::ALT7), i => Res(i), } } #[doc = "Checks if the value of the field is `ALT0`"] #[inline(always)] pub fn is_alt0(&self) -> bool { *self == FUNC_A::ALT0 } #[doc = "Checks if the value of the field is `ALT1`"] #[inline(always)] pub fn is_alt1(&self) -> bool { *self == FUNC_A::ALT1 } #[doc = "Checks if the value of the field is `ALT2`"] #[inline(always)] pub fn is_alt2(&self) -> bool { *self == FUNC_A::ALT2 } #[doc = "Checks if the value of the field is `ALT3`"] #[inline(always)] pub fn is_alt3(&self) -> bool { *self == FUNC_A::ALT3 } #[doc = "Checks if the value of the field is `ALT4`"] #[inline(always)] pub fn is_alt4(&self) -> bool { *self == FUNC_A::ALT4 } #[doc = "Checks if the value of the field is `ALT5`"] #[inline(always)] pub fn is_alt5(&self) -> bool { *self == FUNC_A::ALT5 } #[doc = "Checks if the value of the field is `ALT6`"] #[inline(always)] pub fn is_alt6(&self) -> bool { *self == FUNC_A::ALT6 } #[doc = "Checks if the value of the field is `ALT7`"] #[inline(always)] pub fn is_alt7(&self) -> bool { *self == FUNC_A::ALT7 } } #[doc = "Write proxy for field `FUNC`"] pub struct FUNC_W<'a> { w: &'a mut W, } impl<'a> FUNC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FUNC_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "Alternative connection 0."] #[inline(always)] pub fn alt0(self) -> &'a mut W { self.variant(FUNC_A::ALT0) } #[doc = "Alternative connection 1."] #[inline(always)] pub fn alt1(self) -> &'a mut W { self.variant(FUNC_A::ALT1) } #[doc = "Alternative connection 2."] #[inline(always)] pub fn alt2(self) -> &'a mut W { self.variant(FUNC_A::ALT2) } #[doc = "Alternative connection 3."] #[inline(always)] pub fn alt3(self) -> &'a mut W { self.variant(FUNC_A::ALT3) } #[doc = "Alternative connection 4."] #[inline(always)] pub fn alt4(self) -> &'a mut W { self.variant(FUNC_A::ALT4) } #[doc = "Alternative connection 5."] #[inline(always)] pub fn alt5(self) -> &'a mut W { self.variant(FUNC_A::ALT5) } #[doc = "Alternative connection 6."] #[inline(always)] pub fn alt6(self) -> &'a mut W { self.variant(FUNC_A::ALT6) } #[doc = "Alternative connection 7."] #[inline(always)] pub fn alt7(self) -> &'a mut W { self.variant(FUNC_A::ALT7) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); self.w } } #[doc = "Possible values of the field `MODE`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum MODE_A { #[doc = "Inactive. Inactive (no pull-down/pull-up resistor enabled)."] INACTIVE, #[doc = "Pull-down. Pull-down resistor enabled."] PULL_DOWN, #[doc = "Pull-up. Pull-up resistor enabled."] PULL_UP, #[doc = "Repeater. Repeater mode."] REPEATER, } impl From<MODE_A> for u8 { #[inline(always)] fn from(variant: MODE_A) -> Self { match variant { MODE_A::INACTIVE => 0, MODE_A::PULL_DOWN => 1, MODE_A::PULL_UP => 2, MODE_A::REPEATER => 3, } } } #[doc = "Reader of field `MODE`"] pub type MODE_R = crate::R<u8, MODE_A>; impl MODE_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MODE_A { match self.bits { 0 => MODE_A::INACTIVE, 1 => MODE_A::PULL_DOWN, 2 => MODE_A::PULL_UP, 3 => MODE_A::REPEATER, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `INACTIVE`"] #[inline(always)] pub fn is_inactive(&self) -> bool { *self == MODE_A::INACTIVE } #[doc = "Checks if the value of the field is `PULL_DOWN`"] #[inline(always)] pub fn is_pull_down(&self) -> bool { *self == MODE_A::PULL_DOWN } #[doc = "Checks if the value of the field is `PULL_UP`"] #[inline(always)] pub fn is_pull_up(&self) -> bool { *self == MODE_A::PULL_UP } #[doc = "Checks if the value of the field is `REPEATER`"] #[inline(always)] pub fn is_repeater(&self) -> bool { *self == MODE_A::REPEATER } } #[doc = "Write proxy for field `MODE`"] pub struct MODE_W<'a> { w: &'a mut W, } impl<'a> MODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MODE_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "Inactive. Inactive (no pull-down/pull-up resistor enabled)."] #[inline(always)] pub fn inactive(self) -> &'a mut W { self.variant(MODE_A::INACTIVE) } #[doc = "Pull-down. Pull-down resistor enabled."] #[inline(always)] pub fn pull_down(self) -> &'a mut W { self.variant(MODE_A::PULL_DOWN) } #[doc = "Pull-up. Pull-up resistor enabled."] #[inline(always)] pub fn pull_up(self) -> &'a mut W { self.variant(MODE_A::PULL_UP) } #[doc = "Repeater. Repeater mode."] #[inline(always)] pub fn repeater(self) -> &'a mut W { self.variant(MODE_A::REPEATER) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); self.w } } #[doc = "Possible values of the field `SLEW`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SLEW_A { #[doc = "Standard-mode, output slew rate is slower. More outputs can be switched simultaneously."] STANDARD, #[doc = "Fast-mode, output slew rate is faster. Refer to the appropriate specific device data sheet for details."] FAST, } impl From<SLEW_A> for bool { #[inline(always)] fn from(variant: SLEW_A) -> Self { match variant { SLEW_A::STANDARD => false, SLEW_A::FAST => true, } } } #[doc = "Reader of field `SLEW`"] pub type SLEW_R = crate::R<bool, SLEW_A>; impl SLEW_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLEW_A { match self.bits { false => SLEW_A::STANDARD, true => SLEW_A::FAST, } } #[doc = "Checks if the value of the field is `STANDARD`"] #[inline(always)] pub fn is_standard(&self) -> bool { *self == SLEW_A::STANDARD } #[doc = "Checks if the value of the field is `FAST`"] #[inline(always)] pub fn is_fast(&self) -> bool { *self == SLEW_A::FAST } } #[doc = "Write proxy for field `SLEW`"] pub struct SLEW_W<'a> { w: &'a mut W, } impl<'a> SLEW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLEW_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Standard-mode, output slew rate is slower. More outputs can be switched simultaneously."] #[inline(always)] pub fn standard(self) -> &'a mut W { self.variant(SLEW_A::STANDARD) } #[doc = "Fast-mode, output slew rate is faster. Refer to the appropriate specific device data sheet for details."] #[inline(always)] pub fn fast(self) -> &'a mut W { self.variant(SLEW_A::FAST) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); self.w } } #[doc = "Possible values of the field `INVERT`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum INVERT_A { #[doc = "Disabled. Input function is not inverted."] DISABLED, #[doc = "Enabled. Input is function inverted."] ENABLED, } impl From<INVERT_A> for bool { #[inline(always)] fn from(variant: INVERT_A) -> Self { match variant { INVERT_A::DISABLED => false, INVERT_A::ENABLED => true, } } } #[doc = "Reader of field `INVERT`"] pub type INVERT_R = crate::R<bool, INVERT_A>; impl INVERT_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INVERT_A { match self.bits { false => INVERT_A::DISABLED, true => INVERT_A::ENABLED, } } #[doc = "Checks if the value of the field is `DISABLED`"] #[inline(always)] pub fn is_disabled(&self) -> bool { *self == INVERT_A::DISABLED } #[doc = "Checks if the value of the field is `ENABLED`"] #[inline(always)] pub fn is_enabled(&self) -> bool { *self == INVERT_A::ENABLED } } #[doc = "Write proxy for field `INVERT`"] pub struct INVERT_W<'a> { w: &'a mut W, } impl<'a> INVERT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INVERT_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Disabled. Input function is not inverted."] #[inline(always)] pub fn disabled(self) -> &'a mut W { self.variant(INVERT_A::DISABLED) } #[doc = "Enabled. Input is function inverted."] #[inline(always)] pub fn enabled(self) -> &'a mut W { self.variant(INVERT_A::ENABLED) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); self.w } } #[doc = "Possible values of the field `DIGIMODE`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum DIGIMODE_A { #[doc = "Disable digital mode. Digital input set to 0."] ANALOG, #[doc = "Enable Digital mode. Digital input is enabled."] DIGITAL, } impl From<DIGIMODE_A> for bool { #[inline(always)] fn from(variant: DIGIMODE_A) -> Self { match variant { DIGIMODE_A::ANALOG => false, DIGIMODE_A::DIGITAL => true, } } } #[doc = "Reader of field `DIGIMODE`"] pub type DIGIMODE_R = crate::R<bool, DIGIMODE_A>; impl DIGIMODE_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIGIMODE_A { match self.bits { false => DIGIMODE_A::ANALOG, true => DIGIMODE_A::DIGITAL, } } #[doc = "Checks if the value of the field is `ANALOG`"] #[inline(always)] pub fn is_analog(&self) -> bool { *self == DIGIMODE_A::ANALOG } #[doc = "Checks if the value of the field is `DIGITAL`"] #[inline(always)] pub fn is_digital(&self) -> bool { *self == DIGIMODE_A::DIGITAL } } #[doc = "Write proxy for field `DIGIMODE`"] pub struct DIGIMODE_W<'a> { w: &'a mut W, } impl<'a> DIGIMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIGIMODE_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Disable digital mode. Digital input set to 0."] #[inline(always)] pub fn analog(self) -> &'a mut W { self.variant(DIGIMODE_A::ANALOG) } #[doc = "Enable Digital mode. Digital input is enabled."] #[inline(always)] pub fn digital(self) -> &'a mut W { self.variant(DIGIMODE_A::DIGITAL) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); self.w } } #[doc = "Possible values of the field `OD`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum OD_A { #[doc = "Normal. Normal push-pull output"] NORMAL, #[doc = "Open-drain. Simulated open-drain output (high drive disabled)."] OPEN_DRAIN, } impl From<OD_A> for bool { #[inline(always)] fn from(variant: OD_A) -> Self { match variant { OD_A::NORMAL => false, OD_A::OPEN_DRAIN => true, } } } #[doc = "Reader of field `OD`"] pub type OD_R = crate::R<bool, OD_A>; impl OD_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OD_A { match self.bits { false => OD_A::NORMAL, true => OD_A::OPEN_DRAIN, } } #[doc = "Checks if the value of the field is `NORMAL`"] #[inline(always)] pub fn is_normal(&self) -> bool { *self == OD_A::NORMAL } #[doc = "Checks if the value of the field is `OPEN_DRAIN`"] #[inline(always)] pub fn is_open_drain(&self) -> bool { *self == OD_A::OPEN_DRAIN } } #[doc = "Write proxy for field `OD`"] pub struct OD_W<'a> { w: &'a mut W, } impl<'a> OD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OD_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Normal. Normal push-pull output"] #[inline(always)] pub fn normal(self) -> &'a mut W { self.variant(OD_A::NORMAL) } #[doc = "Open-drain. Simulated open-drain output (high drive disabled)."] #[inline(always)] pub fn open_drain(self) -> &'a mut W { self.variant(OD_A::OPEN_DRAIN) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); self.w } } impl R { #[doc = "Bits 0:3 - Selects pin function."] #[inline(always)] pub fn func(&self) -> FUNC_R { FUNC_R::new((self.bits & 0x0f) as u8) } #[doc = "Bits 4:5 - Selects function mode (on-chip pull-up/pull-down resistor control)."] #[inline(always)] pub fn mode(&self) -> MODE_R { MODE_R::new(((self.bits >> 4) & 0x03) as u8) } #[doc = "Bit 6 - Driver slew rate."] #[inline(always)] pub fn slew(&self) -> SLEW_R { SLEW_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bit 7 - Input polarity."] #[inline(always)] pub fn invert(&self) -> INVERT_R { INVERT_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bit 8 - Select Digital mode."] #[inline(always)] pub fn digimode(&self) -> DIGIMODE_R { DIGIMODE_R::new(((self.bits >> 8) & 0x01) != 0) } #[doc = "Bit 9 - Controls open-drain mode."] #[inline(always)] pub fn od(&self) -> OD_R { OD_R::new(((self.bits >> 9) & 0x01) != 0) } } impl W { #[doc = "Bits 0:3 - Selects pin function."] #[inline(always)] pub fn func(&mut self) -> FUNC_W { FUNC_W { w: self } } #[doc = "Bits 4:5 - Selects function mode (on-chip pull-up/pull-down resistor control)."] #[inline(always)] pub fn mode(&mut self) -> MODE_W { MODE_W { w: self } } #[doc = "Bit 6 - Driver slew rate."] #[inline(always)] pub fn slew(&mut self) -> SLEW_W { SLEW_W { w: self } } #[doc = "Bit 7 - Input polarity."] #[inline(always)] pub fn invert(&mut self) -> INVERT_W { INVERT_W { w: self } } #[doc = "Bit 8 - Select Digital mode."] #[inline(always)] pub fn digimode(&mut self) -> DIGIMODE_W { DIGIMODE_W { w: self } } #[doc = "Bit 9 - Controls open-drain mode."] #[inline(always)] pub fn od(&mut self) -> OD_W { OD_W { w: self } } }
29.166144
118
0.543046
abb01cbbc8af43d9dc35faf57f54e2538fe1e860
3,645
asm
Assembly
coverage/IN_CTS/0475-COVERAGE-brw-fs-2819/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
null
null
null
coverage/IN_CTS/0475-COVERAGE-brw-fs-2819/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
47
2021-03-11T07:42:51.000Z
2022-03-14T06:30:14.000Z
coverage/IN_CTS/0475-COVERAGE-brw-fs-2819/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
4
2021-03-09T13:37:19.000Z
2022-02-25T07:32:11.000Z
; SPIR-V ; Version: 1.0 ; Generator: Khronos Glslang Reference Front End; 10 ; Bound: 62 ; Schema: 0 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %37 OpExecutionMode %4 OriginUpperLeft OpSource ESSL 320 OpName %4 "main" OpName %8 "a" OpName %10 "b" OpName %14 "buf1" OpMemberName %14 0 "_GLF_uniform_float_values" OpName %16 "" OpName %37 "_GLF_color" OpName %43 "buf0" OpMemberName %43 0 "_GLF_uniform_int_values" OpName %45 "" OpDecorate %13 ArrayStride 16 OpMemberDecorate %14 0 Offset 0 OpDecorate %14 Block OpDecorate %16 DescriptorSet 0 OpDecorate %16 Binding 1 OpDecorate %37 Location 0 OpDecorate %42 ArrayStride 16 OpMemberDecorate %43 0 Offset 0 OpDecorate %43 Block OpDecorate %45 DescriptorSet 0 OpDecorate %45 Binding 0 %2 = OpTypeVoid %3 = OpTypeFunction %2 %6 = OpTypeFloat 32 %7 = OpTypePointer Function %6 %9 = OpConstant %6 1 %11 = OpTypeInt 32 0 %12 = OpConstant %11 2 %13 = OpTypeArray %6 %12 %14 = OpTypeStruct %13 %15 = OpTypePointer Uniform %14 %16 = OpVariable %15 Uniform %17 = OpTypeInt 32 1 %18 = OpConstant %17 0 %19 = OpConstant %17 1 %20 = OpTypePointer Uniform %6 %23 = OpTypeBool %24 = OpConstantFalse %23 %26 = OpConstant %6 0 %35 = OpTypeVector %6 4 %36 = OpTypePointer Output %35 %37 = OpVariable %36 Output %42 = OpTypeArray %17 %12 %43 = OpTypeStruct %42 %44 = OpTypePointer Uniform %43 %45 = OpVariable %44 Uniform %46 = OpTypePointer Uniform %17 %4 = OpFunction %2 None %3 %5 = OpLabel %8 = OpVariable %7 Function %10 = OpVariable %7 Function OpStore %8 %9 %21 = OpAccessChain %20 %16 %18 %19 %22 = OpLoad %6 %21 %25 = OpLoad %6 %8 %27 = OpSelect %6 %24 %25 %26 %28 = OpExtInst %6 %1 FClamp %22 %27 %9 OpStore %10 %28 %29 = OpLoad %6 %10 %30 = OpAccessChain %20 %16 %18 %19 %31 = OpLoad %6 %30 %32 = OpFOrdEqual %23 %29 %31 OpSelectionMerge %34 None OpBranchConditional %32 %33 %57 %33 = OpLabel %38 = OpLoad %6 %10 %39 = OpAccessChain %20 %16 %18 %18 %40 = OpLoad %6 %39 %41 = OpFMul %6 %38 %40 %47 = OpAccessChain %46 %45 %18 %18 %48 = OpLoad %17 %47 %49 = OpConvertSToF %6 %48 %50 = OpAccessChain %46 %45 %18 %18 %51 = OpLoad %17 %50 %52 = OpConvertSToF %6 %51 %53 = OpAccessChain %46 %45 %18 %19 %54 = OpLoad %17 %53 %55 = OpConvertSToF %6 %54 %56 = OpCompositeConstruct %35 %41 %49 %52 %55 OpStore %37 %56 OpBranch %34 %57 = OpLabel %58 = OpAccessChain %46 %45 %18 %18 %59 = OpLoad %17 %58 %60 = OpConvertSToF %6 %59 %61 = OpCompositeConstruct %35 %60 %60 %60 %60 OpStore %37 %61 OpBranch %34 %34 = OpLabel OpReturn OpFunctionEnd
35.38835
61
0.490809
907fd8e773cd2a3aa1660818bd8c89b4d670e23d
707
go
Go
politeiawww/cmd/politeiawwwcli/commands/version.go
alexlyp/politeia
769633bc71a9eb4c51c315b1362080489d9489cf
[ "0BSD" ]
null
null
null
politeiawww/cmd/politeiawwwcli/commands/version.go
alexlyp/politeia
769633bc71a9eb4c51c315b1362080489d9489cf
[ "0BSD" ]
null
null
null
politeiawww/cmd/politeiawwwcli/commands/version.go
alexlyp/politeia
769633bc71a9eb4c51c315b1362080489d9489cf
[ "0BSD" ]
null
null
null
// Copyright (c) 2017-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package commands // Help message displayed for the command 'politeiawwwcli help version' var VersionCmdHelpMsg = `version Fetch server info and CSRF token. Arguments: None Result: { "version": (string) Version of backend "route": (string) Version route "pubkey": (string) Server public key "testnet": (bool) Whether of not testnet is being used }` type VersionCmd struct{} func (cmd *VersionCmd) Execute(args []string) error { vr, err := c.Version() if err != nil { return err } return Print(vr, cfg.Verbose, cfg.RawJSON) }
22.09375
71
0.704385
045bd6d6102b1de2f3dafa5add11bad2d2fe6009
656
java
Java
src/main/java/com/charlesbishop/webrest/config/Initializer.java
charleshb417/webrest
bf433a7554ec0785a1dd8e3c1ccd045c3b62b038
[ "MIT" ]
null
null
null
src/main/java/com/charlesbishop/webrest/config/Initializer.java
charleshb417/webrest
bf433a7554ec0785a1dd8e3c1ccd045c3b62b038
[ "MIT" ]
null
null
null
src/main/java/com/charlesbishop/webrest/config/Initializer.java
charleshb417/webrest
bf433a7554ec0785a1dd8e3c1ccd045c3b62b038
[ "MIT" ]
null
null
null
package com.charlesbishop.webrest.config; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; import com.charlesbishop.webrest.config.SpringWebConfig; import com.charlesbishop.webrest.config.WebSecurityConfig; public class Initializer extends AbstractAnnotationConfigDispatcherServletInitializer { @Override protected Class<?>[] getServletConfigClasses() { return new Class[] { SpringWebConfig.class, WebSecurityConfig.class }; } @Override protected String[] getServletMappings() { return new String[] { "/" }; } @Override protected Class<?>[] getRootConfigClasses() { return null; } }
27.333333
100
0.794207
ca65353bc5e947d5552388f2fbdc94baaf5509d1
580
lua
Lua
test/shm-child.lua
LuaDist-testing/lua-apr
d5be82741b2aad3d592a079add2229bdc94b48bc
[ "MIT" ]
null
null
null
test/shm-child.lua
LuaDist-testing/lua-apr
d5be82741b2aad3d592a079add2229bdc94b48bc
[ "MIT" ]
null
null
null
test/shm-child.lua
LuaDist-testing/lua-apr
d5be82741b2aad3d592a079add2229bdc94b48bc
[ "MIT" ]
null
null
null
local status, apr = pcall(require, 'apr') if not status then pcall(require, 'luarocks.require') apr = require 'apr' end local shm_file = assert(apr.shm_attach(arg[1])) local tmp_file = assert(io.open(arg[2])) assert(shm_file:write(tmp_file:read('*a'))) -- You don't actually have to call this, I'm -- just testing that it works as advertised :-) assert(shm_file:detach()) -- Check that removing works on supported platforms. local status, errmsg, errcode = apr.shm_remove(arg[1]) if errcode ~= 'EACCES' then assert(status, errmsg) assert(not apr.shm_attach(arg[1])) end
29
54
0.72069
81d2ec6771594b82912f24575f63a7e83eec367a
970
html
HTML
views/edit.html
beyondblog/go-api-test
9c93be3fc3e0a8be48c92a861e803919615edb5c
[ "MIT" ]
null
null
null
views/edit.html
beyondblog/go-api-test
9c93be3fc3e0a8be48c92a861e803919615edb5c
[ "MIT" ]
null
null
null
views/edit.html
beyondblog/go-api-test
9c93be3fc3e0a8be48c92a861e803919615edb5c
[ "MIT" ]
null
null
null
<h1>Edit {{hostName}}</h1> <div class="starter-template"> <table class="table table-condensed table-bordered"> <tr> <th> Host </th> <th> Method </th> <th> Descript </th> <th> Option </th> </tr> <tr ng-repeat="request in requests"> <td> {{request.Host}} </td> <td> {{request.Method | httpMethod}} </td> <td> {{request.Desc}} </td> <td> <button type="button" class="btn btn-default btn-xs" ng-click="runRequest()">Run</button> <button type="button" class="btn btn-default btn-xs" ng-click="editRequest()">Edit</button> </td> </tr> </table> <div> {{response}} </div> </div>
24.871795
107
0.380412
4b9262d7ed1144622761af0579412c148cea476e
616
go
Go
cmd/pre.go
andersnormal/outlaw
f2b3905178cf614a66707fbff3bce4293b8237c4
[ "Apache-2.0" ]
null
null
null
cmd/pre.go
andersnormal/outlaw
f2b3905178cf614a66707fbff3bce4293b8237c4
[ "Apache-2.0" ]
null
null
null
cmd/pre.go
andersnormal/outlaw
f2b3905178cf614a66707fbff3bce4293b8237c4
[ "Apache-2.0" ]
null
null
null
package cmd import ( // "github.com/andersnormal/outlaw/provider/dynamodb" "github.com/andersnormal/outlaw/provider/mongo" "github.com/andersnormal/lru" "github.com/spf13/cobra" ) func preRunE(cmd *cobra.Command, args []string) error { var err error // create the LRU cache l, err := lru.NewLRU(cfg.CacheSize) if err != nil { return err } // we switch context here in terms of enablement switch { case cfg.Mongo.Enable: cfg.Provider, err = mongo.NewMongo(cfg, l) // case cfg.DynamoDB.Enable: // cfg.Provider, err = dynamodb.NewDynamoDB(cfg) default: return ErrNoProvider } return err }
19.25
55
0.711039
acdfa7a3d8f913f72f123dd187690bb857e4eff8
574
cpp
C++
tests/test_corona10_abstract_factory.cpp
ZeroOneTF/GoF_cpp
a8e40c711a05395ef9cd34cf2da4b112cd0ec6fb
[ "MIT" ]
null
null
null
tests/test_corona10_abstract_factory.cpp
ZeroOneTF/GoF_cpp
a8e40c711a05395ef9cd34cf2da4b112cd0ec6fb
[ "MIT" ]
4
2018-08-11T17:44:52.000Z
2018-09-05T14:40:53.000Z
tests/test_corona10_abstract_factory.cpp
ZeroOneTF/GoF_cpp
a8e40c711a05395ef9cd34cf2da4b112cd0ec6fb
[ "MIT" ]
1
2018-08-14T01:43:33.000Z
2018-08-14T01:43:33.000Z
#include <fstream> #include "gtest/gtest.h" #include "corona10/abstract_factory.hpp" TEST(abstract_factory, IntegerValueTest) { auto& factory = corona10::ValueFactory::getInstance(); corona10::Value* value = factory.CreateIntegerValue(); ASSERT_TRUE(value->is_int()); ASSERT_FALSE(value->is_string()); delete value; } TEST(abstract_factory, StringValueTest) { auto& factory = corona10::ValueFactory::getInstance(); corona10::Value* value = factory.CreateStringValue(); ASSERT_FALSE(value->is_int()); ASSERT_TRUE(value->is_string()); delete value; }
27.333333
57
0.738676
0bbeb1a9a5a39a200dd1011cca903fd232ed0406
8,895
html
HTML
services.html
mdancho84/mdancho84.github.io
87292b5cf888708ccf93d9a1ed87d9bf873b43d2
[ "Apache-2.0" ]
4
2019-06-15T00:56:43.000Z
2022-03-12T04:28:04.000Z
services.html
mdancho84/mdancho84.github.io
87292b5cf888708ccf93d9a1ed87d9bf873b43d2
[ "Apache-2.0" ]
null
null
null
services.html
mdancho84/mdancho84.github.io
87292b5cf888708ccf93d9a1ed87d9bf873b43d2
[ "Apache-2.0" ]
6
2017-01-31T15:53:43.000Z
2020-05-25T06:06:51.000Z
--- layout: default title: Services --- <!-- Header --> <header id="services"> <section class="info" id="blog"> <div class= "container"> <div class="row"> <div class="col-lg-12 text-center"> <h2>Our Services</h2> <hr> <p>We apply data science and machine learning to tackle a variety of business challenges. We then build <strong>machine learning-powered web applications</strong> to communicate data science to decision makers in the organization.</p> </div> </div> </div> </section> </header> <!-- Body --> <!-- WEB APPLICATIONS --> <!--<aside> <div class = "container" style="padding-top: 0px; padding-bottom: 0px;"> <div class="row"> <div class="col-lg-12 text-center"> <p><em>We build <strong>machine learning-powered web applications</strong> to communicate data science to the decision makers in the organization.</em></p> </div> </div> </div> </aside> --> <section class = "info" id = "blog"> <div class="container"> <div class="col-md-12 " role="main"> <!-- CUSTOMER ANALYTICS --> <div class="col-sm-12 col-md-12 col-lg-12 text-center"> <h4>Customer Health Scorecard</h4> <p>Use machine learning to make recommendations on how to improve customer health.</p> <br> <!-- CARDS --> <div class = "row"> <div class="col-lg-4"> <div class="bs-component"> <div class="alert alert-warning"> <div><i class="fa fa-puzzle-piece fa-2x"></i></div> <h5 class="alert-heading">Challenge</h5> <p class="mb-0"><strong>Customer Churn</strong> is analagous to filling a water bucket with a bunch of holes. <strong>If you cant plug the holes, your water bucket is not going to fill up</strong>.</p> </div> </div> </div> <div class="col-lg-4"> <div class="bs-component"> <div class="alert alert-info"> <div><i class="fa fa-calculator fa-2x"></i></div> <h5 class="alert-heading">Algorithm</h5> <p class="mb-0"> Machine learning (Deep Learning with an Artificial Neural Network) is a highly accurate solution that <strong>enables customer health evaluation <em>before</em> customers leave</strong>. </p> </div> </div> </div> <div class="col-lg-4"> <div class="bs-component"> <div class="alert alert-success"> <div><i class="fa fa-wrench fa-2x"></i></div> <h5 class="alert-heading">Solution</h5> <p class="mb-0"> The <strong>Customer Scorecard</strong> is a way to communicate the Deep Learning model in a way that decision makers can easily digest. The end result is that insights can be worked into decision making process. </p> </div> </div> </div> </div> <!-- APP --> <div class="row"> <iframe width="100%" height="700" src="https://app.powerbi.com/view?r=eyJrIjoiNzRhNGI4M2YtZTZhNy00ZjUwLTllM2MtOWVkNDVmOWMzM2I0IiwidCI6IjkxYzM2OWI1LTFjOWUtNDM5Yy05ODljLTE4NjdlYzYwNjYwMyIsImMiOjZ9" frameborder="1" allowFullScreen="true"></iframe> </div> <div class="text-center"> <p><em>Disclaimer: This is a suggested strategy that needs to be tailored to the needs of each organization.</em></p> <p><em>View full screen for best experience.</em></p> </div> </div> </div> </div> </section> <!-- WEB APPLICATIONS --> <!-- Split 1: Call to action --> <aside> <div class = "container" style="padding-top: 0px; padding-bottom: 0px;"> <div class="row"> <div class="col-lg-12 text-center"> <p><em>Want a machine learning-powered web application?</em></p> </div> </div> <div class = "row"> <div class="col-sm-6 col-sm-offset-3 col-md-2 col-md-offset-5"> <a href="/contact.html" class="btn btn-outline" style="width:100%"> <!-- <i class="fa fa-area-chart fa-1x"></i> --> Let's talk </a> </div> </div> </div> </aside> <!-- End Split 1 --> <section class = "info" id = "blog"> <div class="container"> <div class="col-md-12 " role="main"> <!-- HR ANALYTICS --> <div class="col-sm-12 col-md-12 col-lg-12 text-center"> <h4>Employee Smart Scorecard</h4> <p>Use machine learning to premptively fight attrition.</p> <br> <!-- CARDS --> <div class = "row"> <div class="col-lg-4"> <div class="bs-component"> <div class="alert alert-warning"> <div><i class="fa fa-puzzle-piece fa-2x"></i></div> <h5 class="alert-heading">Challenge</h5> <p class="mb-0"> A major issue for an organization is <strong>losing productive employees</strong>. But, what if the at-risk employees could be targeted prior to quiting? </p> </div> </div> </div> <div class="col-lg-4"> <div class="bs-component"> <div class="alert alert-info"> <div><i class="fa fa-calculator fa-2x"></i></div> <h5 class="alert-heading">Algorithm</h5> <p class="mb-0"> Machine learning produces <strong>high accuracy models</strong> to identify those at risk and explain what factors lead to turnover. </p> </div> </div> </div> <div class="col-lg-4"> <div class="bs-component"> <div class="alert alert-success"> <div><i class="fa fa-wrench fa-2x"></i></div> <h5 class="alert-heading">Solution</h5> <p class="mb-0"> The <strong>Employee Smart Scorecard</strong> is a web-based application that recommends attrition prevention strategies. </p> </div> </div> </div> </div> <!-- APP --> <div class="row"> <iframe width="100%" height="700" src="https://app.powerbi.com/view?r=eyJrIjoiZjViM2NjN2QtY2I4ZS00ZTI1LTkxZTMtMGJmOWFiNmM0N2RiIiwidCI6IjkxYzM2OWI1LTFjOWUtNDM5Yy05ODljLTE4NjdlYzYwNjYwMyIsImMiOjZ9" frameborder="1" allowFullScreen="true"></iframe> </div> <div class="text-center"> <p><em>Disclaimer: This is a suggested strategy that needs to be tailored to the needs of each organization.</em></p> <p><em>View full screen for best experience.</em></p> </div> </div> </div> </div> </section> <!-- WEB APPLICATIONS --> <!-- Split 1: Call to action --> <aside> <div class = "container" style="padding-top: 0px; padding-bottom: 0px;"> <div class="row"> <div class="col-lg-12 text-center"> <p><em>We have expertise in a variety of business and financial areas!</em></p> </div> </div> </div> </aside> <!-- End Split 1 --> <!-- Our Expertise --> <section class = "info" id = "blog"> <!--Our Expertise--> <div class="info" id="expertise"> <div class="container"> <div class="text-center"> <h3>Our Expertise</h3> <hr> </div> </div> </div> {% include modal-expertise.html %} </section> <!-- End Primary Services --> <!-- Split 1: Call to action --> {% include free_consultation.html %} <!-- End Split 1 -->
40.067568
248
0.473412
3113a5e30ebea14e5ada8e111e29e4f00c8a0083
909
kt
Kotlin
src/commonMain/kotlin/baaahs/app/ui/editor/ShowEditableManager.kt
baaahs/play
01aa9e9530ff9acbada165a2d7048c4ad67ed74f
[ "MIT" ]
null
null
null
src/commonMain/kotlin/baaahs/app/ui/editor/ShowEditableManager.kt
baaahs/play
01aa9e9530ff9acbada165a2d7048c4ad67ed74f
[ "MIT" ]
8
2019-03-14T23:53:12.000Z
2019-03-15T09:04:45.000Z
src/commonMain/kotlin/baaahs/app/ui/editor/ShowEditableManager.kt
baaahs/play
01aa9e9530ff9acbada165a2d7048c4ad67ed74f
[ "MIT" ]
1
2019-03-16T19:47:06.000Z
2019-03-16T19:47:06.000Z
package baaahs.app.ui.editor import baaahs.gl.Toolchain import baaahs.show.Show import baaahs.show.mutable.MutableDocument import baaahs.show.mutable.MutableShow class ShowEditableManager( onApply: (Show) -> Unit ) : EditableManager<Show>(onApply) { fun openEditor(baseDocument: Show, editIntent: EditIntent, toolchain: Toolchain) { val session = ShowSession(baseDocument, MutableShow(baseDocument), editIntent, toolchain) openEditor(session) } inner class ShowSession( baseDocument: Show, mutableDocument: MutableDocument<Show>, editIntent: EditIntent, val toolchain: Toolchain ) : Session(baseDocument, mutableDocument, editIntent) { override fun createNewSession(newDocument: Show, editIntent: EditIntent): Session { return ShowSession(newDocument, MutableShow(newDocument), editIntent, toolchain) } } }
34.961538
97
0.722772
86190b2bb0730290fa925bd6bba79c87eab0d548
472
java
Java
src/main/java/com/kh/workman/member/model/dao/MemberDao.java
Selectaek/developMental
bdc3f0ce02ebd43b58d0aa093b306be1996e8056
[ "MIT" ]
null
null
null
src/main/java/com/kh/workman/member/model/dao/MemberDao.java
Selectaek/developMental
bdc3f0ce02ebd43b58d0aa093b306be1996e8056
[ "MIT" ]
null
null
null
src/main/java/com/kh/workman/member/model/dao/MemberDao.java
Selectaek/developMental
bdc3f0ce02ebd43b58d0aa093b306be1996e8056
[ "MIT" ]
null
null
null
package com.kh.workman.member.model.dao; import org.mybatis.spring.SqlSessionTemplate; import com.kh.workman.member.model.vo.Member; public interface MemberDao { Member selectLogin(SqlSessionTemplate session, Member m); int insertMember(SqlSessionTemplate session, Member m); Member selectFindEmail(SqlSessionTemplate session, String toemail); int updateMember(SqlSessionTemplate session, Member m); int updateInfoMember(SqlSessionTemplate session, Member m); }
31.466667
68
0.819915
5edeab8529e84cda9716af03343bd27ae8f932e0
1,864
dart
Dart
feature/workspace/workspace_ui_material/lib/src/screen/workspace/widget/tabs_panel/tabs_button.dart
ivk1800/diff
94bcca212b9ff015e41ccb5aa18d3268c04fce65
[ "Apache-2.0" ]
null
null
null
feature/workspace/workspace_ui_material/lib/src/screen/workspace/widget/tabs_panel/tabs_button.dart
ivk1800/diff
94bcca212b9ff015e41ccb5aa18d3268c04fce65
[ "Apache-2.0" ]
null
null
null
feature/workspace/workspace_ui_material/lib/src/screen/workspace/widget/tabs_panel/tabs_button.dart
ivk1800/diff
94bcca212b9ff015e41ccb5aa18d3268c04fce65
[ "Apache-2.0" ]
null
null
null
import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; class TabButton extends StatelessWidget { const TabButton({ Key? key, required this.active, required this.text, required this.context, required this.onPressed, required this.onClosePressed, }) : super(key: key); final bool active; final String text; final BuildContext context; final VoidCallback onPressed; final VoidCallback onClosePressed; @override Widget build(BuildContext context) { return ClipRRect( borderRadius: const BorderRadius.only( topRight: Radius.circular(8.0), topLeft: Radius.circular(8.0), ), child: MaterialButton( elevation: 0.0, highlightElevation: 0.0, hoverElevation: 0.0, color: active ? Theme.of(context).primaryColor : Theme.of(context).highlightColor, onPressed: onPressed, focusElevation: 0.0, child: SizedBox( width: 200, child: Row( children: <Widget>[ Expanded( child: Text( // https://github.com/flutter/flutter/issues/18761#issuecomment-811850377 text.replaceAll('', '\u{200B}'), maxLines: 1, overflow: TextOverflow.ellipsis, style: Theme.of(context).textTheme.bodyText1!.copyWith( color: active ? Theme.of(context).selectedRowColor : null, ), ), ), IconButton( iconSize: 20.0, onPressed: onClosePressed, icon: const Icon(Icons.close), color: active ? Colors.white : null, ) ], ), ), ), ); } }
28.676923
91
0.537017
a0e2f30dacfa0aeaebf3d483c51877ac36e4ba47
10,345
asm
Assembly
codigo/bitmap_peca_vermelha.asm
edivaniap/genius_assembly
b8383a7ce16ff5acf65893de280d6b036ef382f8
[ "MIT" ]
null
null
null
codigo/bitmap_peca_vermelha.asm
edivaniap/genius_assembly
b8383a7ce16ff5acf65893de280d6b036ef382f8
[ "MIT" ]
null
null
null
codigo/bitmap_peca_vermelha.asm
edivaniap/genius_assembly
b8383a7ce16ff5acf65893de280d6b036ef382f8
[ "MIT" ]
null
null
null
.globl pinte_vermelho_desl .globl pinte_vermelho_lig .eqv VERMELHO_LIG 0xFF0000 .eqv VERMELHO_DESL 0xFF6347 # $s0 = pincel pinte_vermelho_desl: addi, $s0, $zero, VERMELHO_DESL # molha o pincel de vermelho claro sw $s0, 10340($t1) # pinta os pixels com a cor no pincel sw $s0, 10344($t1) sw $s0, 10348($t1) sw $s0, 10380($t1) sw $s0, 10384($t1) sw $s0, 10388($t1) sw $s0, 10592($t1) sw $s0, 10596($t1) sw $s0, 10600($t1) sw $s0, 10604($t1) sw $s0, 10608($t1) sw $s0, 10612($t1) sw $s0, 10616($t1) sw $s0, 10620($t1) sw $s0, 10624($t1) sw $s0, 10628($t1) sw $s0, 10632($t1) sw $s0, 10636($t1) sw $s0, 10640($t1) sw $s0, 10644($t1) sw $s0, 10648($t1) sw $s0, 10844($t1) sw $s0, 10848($t1) sw $s0, 10852($t1) sw $s0, 10856($t1) sw $s0, 10860($t1) sw $s0, 10864($t1) sw $s0, 10868($t1) sw $s0, 10872($t1) sw $s0, 10876($t1) sw $s0, 10880($t1) sw $s0, 10884($t1) sw $s0, 10888($t1) sw $s0, 10892($t1) sw $s0, 10896($t1) sw $s0, 10900($t1) sw $s0, 10904($t1) sw $s0, 10908($t1) sw $s0, 11096($t1) sw $s0, 11100($t1) sw $s0, 11104($t1) sw $s0, 11108($t1) sw $s0, 11112($t1) sw $s0, 11116($t1) sw $s0, 11120($t1) sw $s0, 11124($t1) #sw $s0, 11128($t1) #sw $s0, 11132($t1) #sw $s0, 11136($t1) sw $s0, 11140($t1) sw $s0, 11144($t1) sw $s0, 11148($t1) sw $s0, 11152($t1) sw $s0, 11156($t1) sw $s0, 11160($t1) sw $s0, 11164($t1) sw $s0, 11168($t1) sw $s0, 11348($t1) sw $s0, 11352($t1) sw $s0, 11356($t1) sw $s0, 11360($t1) sw $s0, 11364($t1) sw $s0, 11368($t1) sw $s0, 11372($t1) sw $s0, 11376($t1) #sw $s0, 11380($t1) sw $s0, 11384($t1) sw $s0, 11388($t1) sw $s0, 11392($t1) #sw $s0, 11396($t1) sw $s0, 11400($t1) sw $s0, 11404($t1) sw $s0, 11408($t1) sw $s0, 11412($t1) sw $s0, 11416($t1) sw $s0, 11420($t1) sw $s0, 11424($t1) sw $s0, 11428($t1) sw $s0, 11600($t1) sw $s0, 11604($t1) sw $s0, 11608($t1) sw $s0, 11612($t1) sw $s0, 11616($t1) sw $s0, 11620($t1) sw $s0, 11624($t1) sw $s0, 11628($t1) sw $s0, 11632($t1) sw $s0, 11636($t1) sw $s0, 11640($t1) sw $s0, 11644($t1) sw $s0, 11648($t1) #sw $s0, 11652($t1) sw $s0, 11656($t1) sw $s0, 11660($t1) sw $s0, 11664($t1) sw $s0, 11668($t1) sw $s0, 11672($t1) sw $s0, 11676($t1) sw $s0, 11680($t1) sw $s0, 11684($t1) sw $s0, 11688($t1) sw $s0, 11852($t1) sw $s0, 11856($t1) sw $s0, 11860($t1) sw $s0, 11864($t1) sw $s0, 11868($t1) sw $s0, 11872($t1) sw $s0, 11876($t1) sw $s0, 11880($t1) sw $s0, 11884($t1) sw $s0, 11888($t1) sw $s0, 11892($t1) sw $s0, 11896($t1) sw $s0, 11900($t1) #sw $s0, 11904($t1) sw $s0, 11908($t1) sw $s0, 11912($t1) sw $s0, 11916($t1) sw $s0, 11920($t1) sw $s0, 11924($t1) sw $s0, 11928($t1) sw $s0, 11932($t1) sw $s0, 11936($t1) sw $s0, 11940($t1) sw $s0, 11944($t1) sw $s0, 11948($t1) sw $s0, 12104($t1) sw $s0, 12108($t1) sw $s0, 12112($t1) sw $s0, 12116($t1) sw $s0, 12120($t1) sw $s0, 12124($t1) sw $s0, 12128($t1) sw $s0, 12132($t1) sw $s0, 12136($t1) sw $s0, 12140($t1) sw $s0, 12144($t1) sw $s0, 12148($t1) sw $s0, 12152($t1) #sw $s0, 12156($t1) sw $s0, 12160($t1) sw $s0, 12164($t1) sw $s0, 12168($t1) sw $s0, 12172($t1) sw $s0, 12176($t1) sw $s0, 12180($t1) sw $s0, 12184($t1) sw $s0, 12188($t1) sw $s0, 12192($t1) sw $s0, 12196($t1) sw $s0, 12200($t1) sw $s0, 12204($t1) sw $s0, 12208($t1) sw $s0, 12364($t1) sw $s0, 12368($t1) sw $s0, 12372($t1) sw $s0, 12376($t1) sw $s0, 12380($t1) sw $s0, 12384($t1) sw $s0, 12388($t1) sw $s0, 12392($t1) sw $s0, 12396($t1) sw $s0, 12400($t1) sw $s0, 12404($t1) #sw $s0, 12408($t1) sw $s0, 12412($t1) sw $s0, 12416($t1) sw $s0, 12420($t1) sw $s0, 12424($t1) sw $s0, 12428($t1) sw $s0, 12432($t1) sw $s0, 12436($t1) sw $s0, 12440($t1) sw $s0, 12444($t1) sw $s0, 12448($t1) sw $s0, 12452($t1) sw $s0, 12456($t1) sw $s0, 12460($t1) sw $s0, 12624($t1) sw $s0, 12628($t1) sw $s0, 12632($t1) sw $s0, 12636($t1) sw $s0, 12640($t1) sw $s0, 12644($t1) sw $s0, 12648($t1) sw $s0, 12652($t1) sw $s0, 12656($t1) #sw $s0, 12660($t1) #sw $s0, 12664($t1) #sw $s0, 12668($t1) #sw $s0, 12672($t1) #sw $s0, 12676($t1) sw $s0, 12680($t1) sw $s0, 12684($t1) sw $s0, 12688($t1) sw $s0, 12692($t1) sw $s0, 12696($t1) sw $s0, 12700($t1) sw $s0, 12704($t1) sw $s0, 12708($t1) sw $s0, 12712($t1) sw $s0, 12884($t1) sw $s0, 12888($t1) sw $s0, 12892($t1) sw $s0, 12896($t1) sw $s0, 12900($t1) sw $s0, 12904($t1) sw $s0, 12908($t1) sw $s0, 12912($t1) sw $s0, 12916($t1) sw $s0, 12920($t1) sw $s0, 12924($t1) sw $s0, 12928($t1) sw $s0, 12932($t1) sw $s0, 12936($t1) sw $s0, 12940($t1) sw $s0, 12944($t1) sw $s0, 12948($t1) sw $s0, 12952($t1) sw $s0, 12956($t1) sw $s0, 12960($t1) sw $s0, 12964($t1) sw $s0, 13148($t1) sw $s0, 13152($t1) sw $s0, 13156($t1) sw $s0, 13160($t1) sw $s0, 13164($t1) sw $s0, 13168($t1) sw $s0, 13172($t1) sw $s0, 13176($t1) sw $s0, 13180($t1) sw $s0, 13184($t1) sw $s0, 13188($t1) sw $s0, 13192($t1) sw $s0, 13196($t1) sw $s0, 13200($t1) sw $s0, 13204($t1) sw $s0, 13208($t1) sw $s0, 13212($t1) sw $s0, 13420($t1) sw $s0, 13424($t1) sw $s0, 13428($t1) sw $s0, 13432($t1) sw $s0, 13436($t1) sw $s0, 13440($t1) sw $s0, 13444($t1) sw $s0, 13448($t1) sw $s0, 13452($t1) jr $ra pinte_vermelho_lig: addi, $s0, $zero, VERMELHO_LIG # molha o pincel de vermelho sw $s0, 10340($t1) # pinta os pixels com a cor no pincel sw $s0, 10344($t1) sw $s0, 10348($t1) sw $s0, 10380($t1) sw $s0, 10384($t1) sw $s0, 10388($t1) sw $s0, 10592($t1) sw $s0, 10596($t1) sw $s0, 10600($t1) sw $s0, 10604($t1) sw $s0, 10608($t1) sw $s0, 10612($t1) sw $s0, 10616($t1) sw $s0, 10620($t1) sw $s0, 10624($t1) sw $s0, 10628($t1) sw $s0, 10632($t1) sw $s0, 10636($t1) sw $s0, 10640($t1) sw $s0, 10644($t1) sw $s0, 10648($t1) sw $s0, 10844($t1) sw $s0, 10848($t1) sw $s0, 10852($t1) sw $s0, 10856($t1) sw $s0, 10860($t1) sw $s0, 10864($t1) sw $s0, 10868($t1) sw $s0, 10872($t1) sw $s0, 10876($t1) sw $s0, 10880($t1) sw $s0, 10884($t1) sw $s0, 10888($t1) sw $s0, 10892($t1) sw $s0, 10896($t1) sw $s0, 10900($t1) sw $s0, 10904($t1) sw $s0, 10908($t1) sw $s0, 11096($t1) sw $s0, 11100($t1) sw $s0, 11104($t1) sw $s0, 11108($t1) sw $s0, 11112($t1) sw $s0, 11116($t1) sw $s0, 11120($t1) sw $s0, 11124($t1) #sw $s0, 11128($t1) #sw $s0, 11132($t1) #sw $s0, 11136($t1) sw $s0, 11140($t1) sw $s0, 11144($t1) sw $s0, 11148($t1) sw $s0, 11152($t1) sw $s0, 11156($t1) sw $s0, 11160($t1) sw $s0, 11164($t1) sw $s0, 11168($t1) sw $s0, 11348($t1) sw $s0, 11352($t1) sw $s0, 11356($t1) sw $s0, 11360($t1) sw $s0, 11364($t1) sw $s0, 11368($t1) sw $s0, 11372($t1) sw $s0, 11376($t1) #sw $s0, 11380($t1) sw $s0, 11384($t1) sw $s0, 11388($t1) sw $s0, 11392($t1) #sw $s0, 11396($t1) sw $s0, 11400($t1) sw $s0, 11404($t1) sw $s0, 11408($t1) sw $s0, 11412($t1) sw $s0, 11416($t1) sw $s0, 11420($t1) sw $s0, 11424($t1) sw $s0, 11428($t1) sw $s0, 11600($t1) sw $s0, 11604($t1) sw $s0, 11608($t1) sw $s0, 11612($t1) sw $s0, 11616($t1) sw $s0, 11620($t1) sw $s0, 11624($t1) sw $s0, 11628($t1) sw $s0, 11632($t1) sw $s0, 11636($t1) sw $s0, 11640($t1) sw $s0, 11644($t1) sw $s0, 11648($t1) #sw $s0, 11652($t1) sw $s0, 11656($t1) sw $s0, 11660($t1) sw $s0, 11664($t1) sw $s0, 11668($t1) sw $s0, 11672($t1) sw $s0, 11676($t1) sw $s0, 11680($t1) sw $s0, 11684($t1) sw $s0, 11688($t1) sw $s0, 11852($t1) sw $s0, 11856($t1) sw $s0, 11860($t1) sw $s0, 11864($t1) sw $s0, 11868($t1) sw $s0, 11872($t1) sw $s0, 11876($t1) sw $s0, 11880($t1) sw $s0, 11884($t1) sw $s0, 11888($t1) sw $s0, 11892($t1) sw $s0, 11896($t1) sw $s0, 11900($t1) #sw $s0, 11904($t1) sw $s0, 11908($t1) sw $s0, 11912($t1) sw $s0, 11916($t1) sw $s0, 11920($t1) sw $s0, 11924($t1) sw $s0, 11928($t1) sw $s0, 11932($t1) sw $s0, 11936($t1) sw $s0, 11940($t1) sw $s0, 11944($t1) sw $s0, 11948($t1) sw $s0, 12104($t1) sw $s0, 12108($t1) sw $s0, 12112($t1) sw $s0, 12116($t1) sw $s0, 12120($t1) sw $s0, 12124($t1) sw $s0, 12128($t1) sw $s0, 12132($t1) sw $s0, 12136($t1) sw $s0, 12140($t1) sw $s0, 12144($t1) sw $s0, 12148($t1) sw $s0, 12152($t1) #sw $s0, 12156($t1) sw $s0, 12160($t1) sw $s0, 12164($t1) sw $s0, 12168($t1) sw $s0, 12172($t1) sw $s0, 12176($t1) sw $s0, 12180($t1) sw $s0, 12184($t1) sw $s0, 12188($t1) sw $s0, 12192($t1) sw $s0, 12196($t1) sw $s0, 12200($t1) sw $s0, 12204($t1) sw $s0, 12208($t1) sw $s0, 12364($t1) sw $s0, 12368($t1) sw $s0, 12372($t1) sw $s0, 12376($t1) sw $s0, 12380($t1) sw $s0, 12384($t1) sw $s0, 12388($t1) sw $s0, 12392($t1) sw $s0, 12396($t1) sw $s0, 12400($t1) sw $s0, 12404($t1) #sw $s0, 12408($t1) sw $s0, 12412($t1) sw $s0, 12416($t1) sw $s0, 12420($t1) sw $s0, 12424($t1) sw $s0, 12428($t1) sw $s0, 12432($t1) sw $s0, 12436($t1) sw $s0, 12440($t1) sw $s0, 12444($t1) sw $s0, 12448($t1) sw $s0, 12452($t1) sw $s0, 12456($t1) sw $s0, 12460($t1) sw $s0, 12624($t1) sw $s0, 12628($t1) sw $s0, 12632($t1) sw $s0, 12636($t1) sw $s0, 12640($t1) sw $s0, 12644($t1) sw $s0, 12648($t1) sw $s0, 12652($t1) sw $s0, 12656($t1) #sw $s0, 12660($t1) #sw $s0, 12664($t1) #sw $s0, 12668($t1) #sw $s0, 12672($t1) #sw $s0, 12676($t1) sw $s0, 12680($t1) sw $s0, 12684($t1) sw $s0, 12688($t1) sw $s0, 12692($t1) sw $s0, 12696($t1) sw $s0, 12700($t1) sw $s0, 12704($t1) sw $s0, 12708($t1) sw $s0, 12712($t1) sw $s0, 12884($t1) sw $s0, 12888($t1) sw $s0, 12892($t1) sw $s0, 12896($t1) sw $s0, 12900($t1) sw $s0, 12904($t1) sw $s0, 12908($t1) sw $s0, 12912($t1) sw $s0, 12916($t1) sw $s0, 12920($t1) sw $s0, 12924($t1) sw $s0, 12928($t1) sw $s0, 12932($t1) sw $s0, 12936($t1) sw $s0, 12940($t1) sw $s0, 12944($t1) sw $s0, 12948($t1) sw $s0, 12952($t1) sw $s0, 12956($t1) sw $s0, 12960($t1) sw $s0, 12964($t1) sw $s0, 13148($t1) sw $s0, 13152($t1) sw $s0, 13156($t1) sw $s0, 13160($t1) sw $s0, 13164($t1) sw $s0, 13168($t1) sw $s0, 13172($t1) sw $s0, 13176($t1) sw $s0, 13180($t1) sw $s0, 13184($t1) sw $s0, 13188($t1) sw $s0, 13192($t1) sw $s0, 13196($t1) sw $s0, 13200($t1) sw $s0, 13204($t1) sw $s0, 13208($t1) sw $s0, 13212($t1) sw $s0, 13420($t1) sw $s0, 13424($t1) sw $s0, 13428($t1) sw $s0, 13432($t1) sw $s0, 13436($t1) sw $s0, 13440($t1) sw $s0, 13444($t1) sw $s0, 13448($t1) sw $s0, 13452($t1) jr $ra
20.087379
67
0.556114
21f1d4a7b16631e4422a0ef550284d6da02d2507
1,806
lua
Lua
asset/src/framework/platform/bridge.lua
wanmaple/MWFrameworkForCocosLua
170115d08876ca1d194ac6819cc7cc9ad1e50e1a
[ "Apache-2.0" ]
2
2016-07-16T07:35:31.000Z
2017-08-26T09:32:30.000Z
asset/src/framework/platform/bridge.lua
wanmaple/MWFramework2.0
170115d08876ca1d194ac6819cc7cc9ad1e50e1a
[ "Apache-2.0" ]
null
null
null
asset/src/framework/platform/bridge.lua
wanmaple/MWFramework2.0
170115d08876ca1d194ac6819cc7cc9ad1e50e1a
[ "Apache-2.0" ]
null
null
null
--[[ Description: Communication between lua/java, lua/oc Author: M.Wan Date: 06/18/2015 ]] --[[ Bridge provides the way to call java static methods or obj-c static methods. ]] local LanguageBridge = {} local function checkArguments(args, sig) if type(args) ~= "table" then args = {} end if sig then return args, sig end sig = {"("} for i, v in ipairs(args) do local t = type(v) if t == "number" then sig[#sig + 1] = "F" elseif t == "boolean" then sig[#sig + 1] = "Z" elseif t == "function" then sig[#sig + 1] = "I" else sig[#sig + 1] = "Ljava/lang/String;" end end sig[#sig + 1] = ")V" return args, table.concat(sig) end function LanguageBridge.callJavaStaticMethod(className, methodName, args, sig) local args, sig = checkArguments(args, sig) return LuaJavaBridge.callStaticMethod(className, methodName, args, sig) end function LanguageBridge.callOCStaticMethod(className, methodName, args) local ok, ret = LuaObjcBridge.callStaticMethod(className, methodName, args) if not ok then local msg = string.format("luaoc.callStaticMethod(\"%s\", \"%s\", \"%s\") - error: [%s] ", className, methodName, tostring(args), tostring(ret)) if ret == -1 then print(msg .. "INVALID PARAMETERS") elseif ret == -2 then print(msg .. "CLASS NOT FOUND") elseif ret == -3 then print(msg .. "METHOD NOT FOUND") elseif ret == -4 then print(msg .. "EXCEPTION OCCURRED") elseif ret == -5 then print(msg .. "INVALID METHOD SIGNATURE") else print(msg .. "UNKNOWN") end end return ok, ret end return LanguageBridge
29.606557
98
0.579181
d125309d4afcb4985006b9fe64f83b353278ef5c
1,458
asm
Assembly
programs/oeis/085/A085787.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/085/A085787.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/085/A085787.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A085787: Generalized heptagonal numbers: m*(5*m - 3)/2, m = 0, +-1, +-2 +-3, ... ; 0,1,4,7,13,18,27,34,46,55,70,81,99,112,133,148,172,189,216,235,265,286,319,342,378,403,442,469,511,540,585,616,664,697,748,783,837,874,931,970,1030,1071,1134,1177,1243,1288,1357,1404,1476,1525,1600,1651,1729,1782,1863,1918,2002,2059,2146,2205,2295,2356,2449,2512,2608,2673,2772,2839,2941,3010,3115,3186,3294,3367,3478,3553,3667,3744,3861,3940,4060,4141,4264,4347,4473,4558,4687,4774,4906,4995,5130,5221,5359,5452,5593,5688,5832,5929,6076,6175,6325,6426,6579,6682,6838,6943,7102,7209,7371,7480,7645,7756,7924,8037,8208,8323,8497,8614,8791,8910,9090,9211,9394,9517,9703,9828,10017,10144,10336,10465,10660,10791,10989,11122,11323,11458,11662,11799,12006,12145,12355,12496,12709,12852,13068,13213,13432,13579,13801,13950,14175,14326,14554,14707,14938,15093,15327,15484,15721,15880,16120,16281,16524,16687,16933,17098,17347,17514,17766,17935,18190,18361,18619,18792,19053,19228,19492,19669,19936,20115,20385,20566,20839,21022,21298,21483,21762,21949,22231,22420,22705,22896,23184,23377,23668,23863,24157,24354,24651,24850,25150,25351,25654,25857,26163,26368,26677,26884,27196,27405,27720,27931,28249,28462,28783,28998,29322,29539,29866,30085,30415,30636,30969,31192,31528,31753,32092,32319,32661,32890,33235,33466,33814,34047,34398,34633,34987,35224,35581,35820,36180,36421,36784,37027,37393,37638,38007,38254,38626,38875 mul $0,5 div $0,2 add $0,2 bin $0,2 mov $1,$0 div $1,5
145.8
1,318
0.783265
745d1ebae524365c6664632c810164f4fb1924fd
395
html
HTML
src/index.html
YuvantBesre/Riot.js-with-elastic-search
0155df00771c2a5ebc63625c5b5ec72b16e8d8c1
[ "MIT" ]
null
null
null
src/index.html
YuvantBesre/Riot.js-with-elastic-search
0155df00771c2a5ebc63625c5b5ec72b16e8d8c1
[ "MIT" ]
null
null
null
src/index.html
YuvantBesre/Riot.js-with-elastic-search
0155df00771c2a5ebc63625c5b5ec72b16e8d8c1
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head> <title>Riot.JS with ElasticSearch</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.0/milligram.css"> </head> <body> <div> <my-component data-riot-component></my-component> </div> </div> </body> </html>
26.333333
101
0.678481
22a30ddb2afb5bcdf70489ca9e56c10d04c9547b
1,683
html
HTML
docs/javadoc/cufy/convert/package-frame.html
cufyorg/framework
31414b305c5a93dfb81667dce5a8191ebc69904d
[ "Apache-2.0" ]
7
2020-04-15T20:59:54.000Z
2021-06-03T22:50:24.000Z
docs/javadoc/cufy/convert/package-frame.html
cufyorg/framework
31414b305c5a93dfb81667dce5a8191ebc69904d
[ "Apache-2.0" ]
3
2021-06-16T11:26:48.000Z
2021-06-16T11:27:55.000Z
docs/javadoc/cufy/convert/package-frame.html
cufyorg/framework
31414b305c5a93dfb81667dce5a8191ebc69904d
[ "Apache-2.0" ]
3
2020-04-15T21:08:38.000Z
2021-06-16T11:17:19.000Z
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_221) on Tue May 26 20:15:07 AST 2020 --> <title>cufy.convert</title> <meta name="date" content="2020-05-26"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../script.js"></script> </head> <body> <h1 class="bar"><a href="../../cufy/convert/package-summary.html" target="classFrame">cufy.convert</a></h1> <div class="indexContainer"> <h2 title="Interfaces">Interfaces</h2> <ul title="Interfaces"> <li><a href="Converter.html" title="interface in cufy.convert" target="classFrame"><span class="interfaceName">Converter</span></a></li> </ul> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="AbstractConverter.html" title="class in cufy.convert" target="classFrame">AbstractConverter</a></li> <li><a href="BaseConverter.html" title="class in cufy.convert" target="classFrame">BaseConverter</a></li> <li><a href="ConvertToken.html" title="class in cufy.convert" target="classFrame">ConvertToken</a></li> </ul> <h2 title="Exceptions">Exceptions</h2> <ul title="Exceptions"> <li><a href="CloneException.html" title="class in cufy.convert" target="classFrame">CloneException</a></li> <li><a href="ConvertException.html" title="class in cufy.convert" target="classFrame">ConvertException</a></li> </ul> <h2 title="Annotation Types">Annotation Types</h2> <ul title="Annotation Types"> <li><a href="ConvertMethod.html" title="annotation in cufy.convert" target="classFrame">ConvertMethod</a></li> </ul> </div> </body> </html>
46.75
136
0.707665
cb60d789095a9b76ab2827aaf3e67ffd8cdea1fc
3,454
sql
SQL
DATA_BACKUP/BD5W6_424P_sys_service_message_types.sql
CGGTeam/GGFlix
ff4fa9ee984d57c1381f98828f24aa65e3eb0524
[ "MIT" ]
null
null
null
DATA_BACKUP/BD5W6_424P_sys_service_message_types.sql
CGGTeam/GGFlix
ff4fa9ee984d57c1381f98828f24aa65e3eb0524
[ "MIT" ]
null
null
null
DATA_BACKUP/BD5W6_424P_sys_service_message_types.sql
CGGTeam/GGFlix
ff4fa9ee984d57c1381f98828f24aa65e3eb0524
[ "MIT" ]
null
null
null
CREATE TABLE sys.service_message_types ( name sysname NOT NULL, message_type_id int NOT NULL, principal_id int, validation char(2) NOT NULL, validation_desc nvarchar(60), xml_collection_id int ); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/Error', 1, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog', 2, 1, 'E ', 'EMPTY', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/Notifications/QueryNotification', 3, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/Notifications/EventNotification', 4, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/DialogTimer', 5, 1, 'E ', 'EMPTY', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/MissingRoute', 6, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/FailedRoute', 7, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/MissingRemoteServiceBinding', 8, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/FailedRemoteServiceBinding', 9, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/ServiceEcho/Echo', 10, 1, 'N ', 'BINARY', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/ServiceDiagnostic/Query', 11, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/ServiceDiagnostic/Status', 12, 1, 'X ', 'XML', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('http://schemas.microsoft.com/SQL/ServiceBroker/ServiceDiagnostic/Description', 13, 1, 'N ', 'BINARY', null); INSERT INTO sys.service_message_types (name, message_type_id, principal_id, validation, validation_desc, xml_collection_id) VALUES ('DEFAULT', 14, 1, 'N ', 'BINARY', null);
150.173913
261
0.792415
669184b62cc2a8325e7a5db497dd2ffd4a44b565
5,208
sql
SQL
core/store/migrate/migrations/0061_multichain_relations.sql
solidity-external-tests/chainlink
c3c190e60fd2d119336fa1412b304644631cce01
[ "MIT" ]
3,419
2017-08-26T00:04:08.000Z
2022-03-31T23:30:06.000Z
core/store/migrate/migrations/0061_multichain_relations.sql
solidity-external-tests/chainlink
c3c190e60fd2d119336fa1412b304644631cce01
[ "MIT" ]
4,143
2017-09-28T03:34:38.000Z
2022-03-31T18:54:30.000Z
core/store/migrate/migrations/0061_multichain_relations.sql
boss562/chainlink
144e3eac12e574b036cf8939b9a09f072bf8b99d
[ "MIT" ]
990
2017-09-10T09:27:55.000Z
2022-03-31T20:22:32.000Z
-- +goose Up ALTER TABLE evm_chains ADD COLUMN enabled BOOL DEFAULT TRUE NOT NULL; ALTER TABLE eth_txes ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; ALTER TABLE log_broadcasts ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; ALTER TABLE heads ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; ALTER TABLE eth_key_states ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; UPDATE eth_txes SET evm_chain_id = (SELECT id FROM evm_chains ORDER BY created_at, id ASC LIMIT 1); UPDATE log_broadcasts SET evm_chain_id = (SELECT id FROM evm_chains ORDER BY created_at, id ASC LIMIT 1); UPDATE heads SET evm_chain_id = (SELECT id FROM evm_chains ORDER BY created_at, id ASC LIMIT 1); UPDATE eth_key_states SET evm_chain_id = (SELECT id FROM evm_chains ORDER BY created_at, id ASC LIMIT 1); DROP INDEX IF EXISTS idx_eth_txes_min_unconfirmed_nonce_for_key; DROP INDEX IF EXISTS idx_eth_txes_nonce_from_address; DROP INDEX IF EXISTS idx_only_one_in_progress_tx_per_account; DROP INDEX IF EXISTS idx_eth_txes_state_from_address; DROP INDEX IF EXISTS idx_eth_txes_unstarted_subject_id; CREATE INDEX idx_eth_txes_min_unconfirmed_nonce_for_key_evm_chain_id ON eth_txes(evm_chain_id, from_address, nonce) WHERE state = 'unconfirmed'::eth_txes_state; CREATE UNIQUE INDEX idx_eth_txes_nonce_from_address_per_evm_chain_id ON eth_txes(evm_chain_id, from_address, nonce); CREATE UNIQUE INDEX idx_only_one_in_progress_tx_per_account_id_per_evm_chain_id ON eth_txes(evm_chain_id, from_address) WHERE state = 'in_progress'::eth_txes_state; CREATE INDEX idx_eth_txes_state_from_address_evm_chain_id ON eth_txes(evm_chain_id, from_address, state) WHERE state <> 'confirmed'::eth_txes_state; CREATE INDEX idx_eth_txes_unstarted_subject_id_evm_chain_id ON eth_txes(evm_chain_id, subject, id) WHERE subject IS NOT NULL AND state = 'unstarted'::eth_txes_state; DROP INDEX IF EXISTS idx_heads_hash; DROP INDEX IF EXISTS idx_heads_number; CREATE UNIQUE INDEX idx_heads_evm_chain_id_hash ON heads(evm_chain_id, hash); CREATE INDEX idx_heads_evm_chain_id_number ON heads(evm_chain_id, number); DROP INDEX IF EXISTS idx_log_broadcasts_unconsumed_job_id_v2; DROP INDEX IF EXISTS log_consumptions_unique_v2_idx; CREATE INDEX idx_log_broadcasts_unconsumed_job_id_v2 ON log_broadcasts(job_id, evm_chain_id) WHERE consumed = false AND job_id IS NOT NULL; CREATE UNIQUE INDEX log_consumptions_unique_v2_idx ON log_broadcasts(job_id, block_hash, log_index, consumed, evm_chain_id) WHERE job_id IS NOT NULL; ALTER TABLE eth_txes ALTER COLUMN evm_chain_id SET NOT NULL; ALTER TABLE log_broadcasts ALTER COLUMN evm_chain_id SET NOT NULL; ALTER TABLE heads ALTER COLUMN evm_chain_id SET NOT NULL; ALTER TABLE eth_key_states ALTER COLUMN evm_chain_id SET NOT NULL; ALTER TABLE vrf_specs ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; ALTER TABLE direct_request_specs ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; ALTER TABLE keeper_specs ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; ALTER TABLE offchainreporting_oracle_specs ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; ALTER TABLE flux_monitor_specs ADD COLUMN evm_chain_id numeric(78,0) REFERENCES evm_chains (id) DEFERRABLE INITIALLY IMMEDIATE; -- +goose Down ALTER TABLE evm_chains DROP COLUMN enabled; ALTER TABLE heads DROP COLUMN evm_chain_id; ALTER TABLE log_broadcasts DROP COLUMN evm_chain_id; ALTER TABLE eth_txes DROP COLUMN evm_chain_id; ALTER TABLE eth_key_states DROP COLUMN evm_chain_id; CREATE UNIQUE INDEX idx_heads_hash ON heads(hash bytea_ops); CREATE INDEX idx_heads_number ON heads(number int8_ops); CREATE INDEX idx_eth_txes_min_unconfirmed_nonce_for_key ON eth_txes(from_address bytea_ops,nonce int8_ops) WHERE state = 'unconfirmed'::eth_txes_state; CREATE UNIQUE INDEX idx_eth_txes_nonce_from_address ON eth_txes(from_address bytea_ops,nonce int8_ops); CREATE UNIQUE INDEX idx_only_one_in_progress_tx_per_account ON eth_txes(from_address bytea_ops) WHERE state = 'in_progress'::eth_txes_state; CREATE INDEX idx_eth_txes_state_from_address ON eth_txes(from_address bytea_ops,state enum_ops) WHERE state <> 'confirmed'::eth_txes_state; CREATE INDEX idx_eth_txes_unstarted_subject_id ON eth_txes(subject uuid_ops,id int8_ops) WHERE subject IS NOT NULL AND state = 'unstarted'::eth_txes_state; CREATE INDEX idx_log_broadcasts_unconsumed_job_id_v2 ON log_broadcasts(job_id int4_ops) WHERE consumed = false AND job_id IS NOT NULL; CREATE UNIQUE INDEX log_consumptions_unique_v2_idx ON log_broadcasts(job_id int4_ops,block_hash bytea_ops,log_index int8_ops,consumed) WHERE job_id IS NOT NULL; ALTER TABLE vrf_specs DROP COLUMN evm_chain_id; ALTER TABLE direct_request_specs DROP COLUMN evm_chain_id; ALTER TABLE keeper_specs DROP COLUMN evm_chain_id; ALTER TABLE offchainreporting_oracle_specs DROP COLUMN evm_chain_id; ALTER TABLE flux_monitor_specs DROP COLUMN evm_chain_id;
73.352113
165
0.850998
0cbdc5e7cc5bd19da3d1e30a35d3c1cd8334e753
1,209
py
Python
python/caliper-reader/setup.py
slabasan/Caliper
85601f48e7f883fb87dec85e92c849eec2bb61f7
[ "BSD-3-Clause" ]
220
2016-01-19T19:00:10.000Z
2022-03-29T02:09:39.000Z
python/caliper-reader/setup.py
slabasan/Caliper
85601f48e7f883fb87dec85e92c849eec2bb61f7
[ "BSD-3-Clause" ]
328
2016-05-12T15:47:30.000Z
2022-03-30T19:42:02.000Z
python/caliper-reader/setup.py
slabasan/Caliper
85601f48e7f883fb87dec85e92c849eec2bb61f7
[ "BSD-3-Clause" ]
48
2016-03-04T22:04:39.000Z
2021-12-18T12:11:43.000Z
# Copyright (c) 2020-20201, Lawrence Livermore National Security, LLC. # See top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import setuptools from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, "README.md"), encoding="utf-8") as f: long_description = f.read() # Get the version in a safe way which does not refrence the `__init__` file # per python docs: https://packaging.python.org/guides/single-sourcing-package-version/ version = {} with open("./caliperreader/version.py") as fp: exec(fp.read(), version) setuptools.setup( name="caliper-reader", version=version["__version__"], description="A Python library for reading Caliper .cali files", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/LLNL/Caliper", author="David Boehme", author_email="boehme3@llnl.gov", license="BSD-3-Clause", classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", ], packages=setuptools.find_packages() )
31.815789
87
0.715467
2f217148bd369b4efa7c78a7fdd7a8a53533397a
198
java
Java
src/main/java/com/jcloisterzone/game/capability/PhantomCapability.java
stanolacko/JCloisterZone
a79e330a70d1a29451cfc48fcbeb618f6a33e594
[ "MIT" ]
220
2015-01-02T04:55:41.000Z
2022-03-30T12:07:57.000Z
src/main/java/com/jcloisterzone/game/capability/PhantomCapability.java
stanolacko/JCloisterZone
a79e330a70d1a29451cfc48fcbeb618f6a33e594
[ "MIT" ]
317
2015-01-01T10:20:09.000Z
2022-03-12T11:50:02.000Z
src/main/java/com/jcloisterzone/game/capability/PhantomCapability.java
stanolacko/JCloisterZone
a79e330a70d1a29451cfc48fcbeb618f6a33e594
[ "MIT" ]
96
2015-01-14T22:35:36.000Z
2021-11-12T19:47:25.000Z
package com.jcloisterzone.game.capability; import com.jcloisterzone.game.Capability; public class PhantomCapability extends Capability<Void> { private static final long serialVersionUID = 1L; }
22
57
0.818182
81469823af6ee83a16fbecf4d667c5a2416a47e0
612
asm
Assembly
programs/oeis/325/A325939.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/325/A325939.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/325/A325939.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A325939: Expansion of Sum_{k>=1} x^(2*k) / (1 + x^k). ; 0,1,-1,2,-1,1,-1,3,-2,1,-1,3,-1,1,-3,4,-1,1,-1,3,-3,1,-1,5,-2,1,-3,3,-1,1,-1,5,-3,1,-3,4,-1,1,-3,5,-1,1,-1,3,-5,1,-1,7,-2,1,-3,3,-1,1,-3,5,-3,1,-1,5,-1,1,-5,6,-3,1,-1,3,-3,1,-1,7,-1,1,-5,3,-3,1,-1,7,-4,1,-1,5,-3,1,-3,5,-1,1,-3,3,-3,1,-3,9,-1,1,-5,4 mov $4,2 mov $6,$0 lpb $4 mov $0,$6 mov $3,0 sub $4,1 add $0,$4 sub $0,1 mov $5,0 lpb $0 mov $7,$0 sub $0,1 add $3,1 div $7,$3 mod $7,2 add $5,$7 lpe mov $2,$4 mov $7,$5 lpb $2 mov $1,$7 sub $2,1 lpe lpe lpb $6 sub $1,$7 mov $6,0 lpe mov $0,$1
18.545455
250
0.429739
e9fa720043d22011bc02f7cd632307e1713df1d2
909
ps1
PowerShell
eng/build.ps1
mmitche/standard
f2f9e2e819d9db7bb58572d8749d3fe7971a7d87
[ "MIT" ]
null
null
null
eng/build.ps1
mmitche/standard
f2f9e2e819d9db7bb58572d8749d3fe7971a7d87
[ "MIT" ]
null
null
null
eng/build.ps1
mmitche/standard
f2f9e2e819d9db7bb58572d8749d3fe7971a7d87
[ "MIT" ]
null
null
null
[CmdletBinding(PositionalBinding=$false)] Param( [string] $ArchGroup, [switch] $Release, [switch] $c, [switch] $Restore, [switch] $Test, [switch] $Pack, [switch] $Sign, [switch] $Publish, [Parameter(ValueFromRemainingArguments=$true)][String[]]$ExtraArgs ) $defaultargs = "-build -restore -warnaserror:0" foreach ($argument in $PSBoundParameters.Keys) { switch($argument) { "Debug" { $arguments += "-configuration Debug " } "Release" { $arguments += "-configuration Release " } "ExtraArgs" { $arguments += $ExtraArgs } "c" { $arguments += "-rebuild " } "Publish" { $arguments += "" } default { $arguments += "/p:$argument=$($PSBoundParameters[$argument]) " } } } $arguments = "$defaultargs $arguments" Write-Host "Args: $arguments" Invoke-Expression "& `"$PSScriptRoot/common/build.ps1`" $arguments" exit $lastExitCode
26.735294
85
0.625963
29da11858bd93758eb7a563ffde65c58602a6c3a
2,243
go
Go
signidice/usecase/usecase.go
DaoCasino/platform-back
8e74618e3b40a607236ca6c18e57c7de8fb67b68
[ "MIT" ]
null
null
null
signidice/usecase/usecase.go
DaoCasino/platform-back
8e74618e3b40a607236ca6c18e57c7de8fb67b68
[ "MIT" ]
39
2020-04-06T07:52:18.000Z
2021-06-06T16:13:30.000Z
signidice/usecase/usecase.go
DaoCasino/platform-back
8e74618e3b40a607236ca6c18e57c7de8fb67b68
[ "MIT" ]
null
null
null
package usecase import ( "context" "crypto" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/base64" "encoding/pem" "github.com/eoscanada/eos-go" "github.com/eoscanada/eos-go/ecc" "github.com/rs/zerolog/log" "platform-backend/blockchain" ) type SignidiceUseCase struct { bc *blockchain.Blockchain rsaKey *rsa.PrivateKey platformAccountName string signidiceAccountName string } func NewSignidiceUseCase( bc *blockchain.Blockchain, platformAccountName string, signidiceAccountName string, rsaBase64 string, ) *SignidiceUseCase { rsaPem, err := base64.StdEncoding.DecodeString(rsaBase64) if err != nil { log.Panic().Msgf("Cannot decode rsa key: %s", err.Error()) return nil } block, _ := pem.Decode(rsaPem) key, err := x509.ParsePKCS1PrivateKey(block.Bytes) if err != nil { log.Panic().Msgf("Cannot parse PKCS1 private key: %s", err.Error()) return nil } return &SignidiceUseCase{ bc: bc, rsaKey: key, platformAccountName: platformAccountName, signidiceAccountName: signidiceAccountName, } } func (a *SignidiceUseCase) rsaSign(digest eos.Checksum256) (string, error) { sign, err := rsa.SignPKCS1v15(rand.Reader, a.rsaKey, crypto.SHA256, digest) if err != nil { return "", err } // contract require base64 string return base64.StdEncoding.EncodeToString(sign), nil } func (a *SignidiceUseCase) PerformSignidice(ctx context.Context, gameName string, digest []byte, bcSessionID uint64) error { rsaSign, err := a.rsaSign(digest) if err != nil { return err } action := &eos.Action{ Account: eos.AN(gameName), Name: eos.ActN("sgdicefirst"), Authorization: []eos.PermissionLevel{ {Actor: eos.AN(a.signidiceAccountName), Permission: eos.PN("active")}, }, ActionData: eos.NewActionData(struct { SessionId uint64 `json:"ses_id"` Signature string `json:"sign"` }{ SessionId: bcSessionID, Signature: rsaSign, }), } trxID, err := a.bc.PushTransaction( []*eos.Action{action}, []ecc.PublicKey{a.bc.PubKeys.SigniDice}, false, ) if err != nil { return err } log.Info().Msgf("Successfully sent signidice_1 trx, sessionID: %d, trxID: %s", bcSessionID, trxID.String()) return nil }
23.610526
124
0.691485
297577633e49a0c76f9f3e80beddf87cb6ed9343
253
go
Go
notifier/panic/panic.go
jelmersnoeck/env
a3ec8ef519bd229a1c77b2ea94c25a9bcac50e7d
[ "MIT" ]
2
2016-07-06T13:40:31.000Z
2021-11-29T19:20:04.000Z
notifier/panic/panic.go
jelmersnoeck/env
a3ec8ef519bd229a1c77b2ea94c25a9bcac50e7d
[ "MIT" ]
2
2016-12-22T15:57:16.000Z
2019-12-01T16:32:06.000Z
notifier/panic/panic.go
jelmersnoeck/env
a3ec8ef519bd229a1c77b2ea94c25a9bcac50e7d
[ "MIT" ]
2
2016-10-26T14:40:44.000Z
2019-10-03T12:08:30.000Z
package panic import ( "fmt" "github.com/jelmersnoeck/env" ) type panicNotifier struct{} func NewNotifier() env.Notifier { return &panicNotifier{} } func (n *panicNotifier) Notify(msg string, i ...interface{}) { panic(fmt.Sprintf(msg, i...)) }
14.055556
62
0.6917
5b6549388548f0d8d66df74fd09e95db4cde665a
2,162
cpp
C++
SRC/sql/samples/Oracle_RefCursor.cpp
crashangelbr/ChatScript_SQLServer
4a8b53b2a368863d3aae887186ec911a17711fe5
[ "MIT" ]
null
null
null
SRC/sql/samples/Oracle_RefCursor.cpp
crashangelbr/ChatScript_SQLServer
4a8b53b2a368863d3aae887186ec911a17711fe5
[ "MIT" ]
null
null
null
SRC/sql/samples/Oracle_RefCursor.cpp
crashangelbr/ChatScript_SQLServer
4a8b53b2a368863d3aae887186ec911a17711fe5
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> #include <SQLAPI.h> #include <samisc.h> void Ora_Fetch_Cursor(SACommand& cmd, int stage) { for (int s = 1; s < stage; ++s) printf(" "); printf("START CURSOR #%d\n", stage); try { if (cmd.isResultSet()) { //cmd.setOption(SACMD_PREFETCH_ROWS) = _TSA("5"); while (cmd.FetchNext()) { for (int i = 1; i <= cmd.FieldCount(); ++i) { SAField& f = cmd.Field(i); if (SA_dtCursor == f.FieldType()) { SACommand* cur = f.asCursor(); if (NULL == cur) { for (int s = 1; s < stage; ++s) printf(" "); printf("NULL result set\n"); } else Ora_Fetch_Cursor(*cur, stage + 1); } else { for (int s = 1; s < stage; ++s) printf(" "); printf("VAL #%d: %s\n", i, f.asString().GetMultiByteChars()); } } } } else { for (int s = 1; s < stage; ++s) printf(" "); printf("Empty result set\n"); } } catch (SAException &x) { for (int s = 1; s < stage; ++s) printf(" "); printf("ERROR: %s\n", x.ErrText().GetMultiByteChars()); } for (int s = 1; s < stage; ++s) printf(" "); printf("END CURSOR #%d\n", stage); } /* create function func1 return sys_refcursor is v_cur sys_refcursor; begin open v_cur for select 1 a , cursor(select level l from dual connect by level < 5) c from dual connect by level < 5; return v_cur; end; create procedure proc1 (p_cur out sys_refcursor) is begin open p_cur for select level l from dual connect by level < 50; end; / */ int Oracle_RefCur() { SAConnection con; //con.setOption(_TSA("UseAPI")) = _TSA("OCI7"); try { con.Connect(_TSA("ora102"), _TSA("scott"), _TSA("tiger"), SA_Oracle_Client); SACommand cmd(&con, _TSA("select func1() from t1")); //SACommand cmd(&con, _TSA("proc1")); while (true) { //cmd.setOption(SACMD_PREFETCH_ROWS) = _TSA("5"); cmd.Execute(); Ora_Fetch_Cursor(cmd, 1); /* SACommand* pCur = cmd.Param(_TSA("p_routes")).asCursor(); if( NULL != pCur ) Ora_Fetch_Cursor(*pCur, 1); */ } } catch (SAException &x) { printf("ERROR: %s\n", x.ErrText().GetMultiByteChars()); } return 0; }
18.322034
60
0.579093
12d6103e66fc89a6f6a9dcd2f4ccf8427956f53d
641
asm
Assembly
oeis/002/A002409.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/002/A002409.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/002/A002409.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A002409: a(n) = 2^n*C(n+6,6). Number of 6D hypercubes in an (n+6)-dimensional hypercube. ; 1,14,112,672,3360,14784,59136,219648,768768,2562560,8200192,25346048,76038144,222265344,635043840,1778122752,4889837568,13231325184,35283533824,92851404800,241413652480,620777963520,1580162088960,3984756572160,9961891430400,24705490747392,60813515685888,148655260565504,361019918516224,871427389521920,2091425734852608,4992435625132032,11857034609688576,28025718168354816,65942866278481920,154494715281014784,360487668989034496,837890257650188288,1940377438768857088,4477794089466593280 mov $1,-2 pow $1,$0 mov $2,-7 bin $2,$0 mul $1,$2 mov $0,$1
64.1
488
0.839314
4b9837dd2404b7a32603b9baf16d1884e2fb16f5
5,593
go
Go
internal/operator/nodeagent/dep/kernel/dep.go
tribock/orbos
011d127bc2560fdb4bf61b5027212944e2d2138b
[ "Apache-2.0" ]
21
2019-11-29T11:59:05.000Z
2020-03-27T14:22:39.000Z
internal/operator/nodeagent/dep/kernel/dep.go
tribock/orbos
011d127bc2560fdb4bf61b5027212944e2d2138b
[ "Apache-2.0" ]
80
2019-11-29T22:20:49.000Z
2020-04-28T15:14:07.000Z
internal/operator/nodeagent/dep/kernel/dep.go
caos/orbiter
6ffb7588b328b2548dfc6862c8900734a8586aca
[ "Apache-2.0" ]
null
null
null
package kernel import ( "context" "fmt" "io/fs" "os/exec" "path/filepath" "strings" "github.com/caos/orbos/mntr" "github.com/caos/orbos/internal/operator/common" "github.com/caos/orbos/internal/operator/nodeagent" "github.com/caos/orbos/internal/operator/nodeagent/dep" "github.com/caos/orbos/internal/operator/nodeagent/dep/middleware" ) var _ Installer = (*kernelDep)(nil) type Installer interface { isKernel() nodeagent.Installer } type kernelDep struct { ctx context.Context monitor mntr.Monitor manager *dep.PackageManager } /* New returns the kernel dependency Node Agent uninstalls all kernels that don't have a corresponding initramfs file except for the currently loaded kernel. If the currently loaded kernel doesn't have a corresponding initramfs file, Node Agent panics. If ORBITER desires a specific kernel version, Node Agent installs and locks it, checks the initramfs file and reboots. It is in the ORBITERS responsibility to ensure not all nodes are updated and rebooted simultaneously. */ func New(ctx context.Context, monitor mntr.Monitor, manager *dep.PackageManager) *kernelDep { return &kernelDep{ ctx: ctx, monitor: monitor, manager: manager, } } func (kernelDep) isKernel() {} func (kernelDep) Is(other nodeagent.Installer) bool { _, ok := middleware.Unwrap(other).(Installer) return ok } func (kernelDep) String() string { return "Kernel" } func (*kernelDep) Equals(other nodeagent.Installer) bool { _, ok := other.(*kernelDep) return ok } func (*kernelDep) InstalledFilter() []string { return []string{"kernel"} } func (k *kernelDep) Current() (pkg common.Package, err error) { loaded, corrupted, err := k.kernelVersions() if err != nil { return pkg, err } dashIdx := strings.Index(loaded, "-") pkg.Version = loaded[0:dashIdx] pkg.Config = map[string]string{ dep.CentOS7.String(): loaded[dashIdx+1:], } if len(corrupted) > 0 { pkg.Config = map[string]string{"corrupted": strings.Join(corrupted, ",")} } return pkg, nil } func (k *kernelDep) Ensure(remove common.Package, ensure common.Package, _ bool) error { corruptedKernels := make([]*dep.Software, 0) corruptedKernelsStr, ok := remove.Config["corrupted"] if ok && corruptedKernelsStr != "" { corruptedKernelsStrs := strings.Split(corruptedKernelsStr, ",") for i := range corruptedKernelsStrs { corruptedKernels = append(corruptedKernels, &dep.Software{ Package: "kernel", Version: corruptedKernelsStrs[i], }) } } if err := k.manager.Remove(corruptedKernels...); err != nil { return err } removeVersion := fmt.Sprintf("%s-%s", remove.Version, remove.Config[dep.CentOS7.String()]) ensureVersion := fmt.Sprintf("%s-%s", ensure.Version, ensure.Config[dep.CentOS7.String()]) if removeVersion == ensureVersion || ensure.Version == "" { return nil } if err := k.manager.Install(&dep.Software{ Package: "kernel", Version: ensureVersion, }); err != nil { return err } initramfsVersions, err := listInitramfsVersions() if err != nil { return err } var found bool for i := range initramfsVersions { if initramfsVersions[i] == ensureVersion { found = true break } } if !found { return fmt.Errorf("couldn't find a corresponding initramfs file corresponding kernel version %s. Not rebooting", ensure.Version) } k.monitor.Info("Stopping node-agentd in the background") if err := exec.Command("bash", "-c", "systemctl stop node-agentd &").Run(); err != nil { return fmt.Errorf("stopping node-agentd failed: %w", err) } k.monitor.Info("Rebooting system in the background") if err := exec.Command("bash", "-c", "reboot &").Run(); err != nil { return fmt.Errorf("rebooting the system failed: %w", err) } k.monitor.Info("Awaiting SIGTERM") <-k.ctx.Done() return nil } func (k *kernelDep) kernelVersions() (loadedKernel string, corruptedKernels []string, err error) { loadedKernelBytes, err := exec.Command("uname", "-r").CombinedOutput() if err != nil { return loadedKernel, corruptedKernels, fmt.Errorf("getting loaded kernel failed: %s: %w", loadedKernel, err) } loadedKernel = trimArchitecture(string(loadedKernelBytes)) initramfsVersions, err := listInitramfsVersions() if err != nil { return loadedKernel, corruptedKernels, err } corruptedKernels = make([]string, 0) kernels: for _, installedKernel := range k.manager.CurrentVersions("kernel") { for i := range initramfsVersions { if initramfsVersions[i] == installedKernel.Version { continue kernels } } if installedKernel.Version == loadedKernel { panic("The actively loaded kernel has no corresponding initramfs file. Pleases fix it manually so the machine survives the next reboot") } corruptedKernels = append(corruptedKernels, installedKernel.Version) } return loadedKernel, corruptedKernels, nil } func listInitramfsVersions() ([]string, error) { initramfsdir := "/boot/" var initramfsKernels []string if err := filepath.WalkDir(initramfsdir, func(path string, d fs.DirEntry, err error) error { if err != nil { return err } if path != initramfsdir && d.IsDir() { return filepath.SkipDir } if strings.HasPrefix(path, initramfsdir+"initramfs-") && strings.HasSuffix(path, ".img") { version := trimArchitecture(path[len(initramfsdir+"initramfs-"):strings.LastIndex(path, ".img")]) initramfsKernels = append(initramfsKernels, version) } return nil }); err != nil { return nil, err } return initramfsKernels, nil } func trimArchitecture(kernel string) string { return strings.TrimSuffix(strings.TrimSuffix(kernel, "\n"), ".x86_64") }
27.282927
139
0.713571
ee0ac00f8db7401aadd98d133c45741af5be03ab
215
swift
Swift
Hahabbit/Model/ChatUser.swift
pisck888/Hahabbit
3cc87fa1067675a0f2a4c842a9f56932ca1d58e3
[ "MIT" ]
2
2021-08-22T12:06:23.000Z
2021-09-30T07:33:44.000Z
Hahabbit/Model/ChatUser.swift
pisck888/Hahabbit
3cc87fa1067675a0f2a4c842a9f56932ca1d58e3
[ "MIT" ]
null
null
null
Hahabbit/Model/ChatUser.swift
pisck888/Hahabbit
3cc87fa1067675a0f2a4c842a9f56932ca1d58e3
[ "MIT" ]
null
null
null
// // ChatUser.swift // Hahabbit // // Created by TSAI TSUNG-HAN on 2021/5/30. // import Foundation import MessageKit struct ChatUser: SenderType, Equatable { var senderId: String var displayName: String }
14.333333
43
0.711628
1ae634a6adddf68e8629b8140d62a321a8d2003c
550
lua
Lua
gamemodes/terrortown/entities/entities/ttt_tele_object/shared.lua
LukasMandok/ttt2-role_stalker
fe4ce9fdf2d33b6282f848f5b900145d61589000
[ "MIT" ]
null
null
null
gamemodes/terrortown/entities/entities/ttt_tele_object/shared.lua
LukasMandok/ttt2-role_stalker
fe4ce9fdf2d33b6282f848f5b900145d61589000
[ "MIT" ]
null
null
null
gamemodes/terrortown/entities/entities/ttt_tele_object/shared.lua
LukasMandok/ttt2-role_stalker
fe4ce9fdf2d33b6282f848f5b900145d61589000
[ "MIT" ]
null
null
null
------------------------------------------------------------ -- credits go to: https://github.com/nuke-haus/thestalker -- ------------------------------------------------------------ ENT.Type = "anim" ENT.Base = "base_anim" ENT.MaxDamage = 1000 ENT.MinDamage = 30 function ENT:SetCollides(bool) self.Collides = bool end function ENT:SetProp(ent) self.Prop = ent end function ENT:SetMass(mass) self.Mass = mass end function ENT:SetPhysMat(mat) self.PhysMat = mat end function ENT:SetPsyOnly(bool) self.PsyOnly = bool end
17.1875
61
0.547273
758e5b524e0ceb588e3c2c91868f689986f87164
4,405
cs
C#
src/BusinessObjects/MyVote.BusinessObjects.Net.Tests/PollSubmissionResponseCollectionTests.cs
danielmartind/MyVote
e96d45513b098d4b7afff299a2bfefbb9b8200f1
[ "Apache-2.0" ]
null
null
null
src/BusinessObjects/MyVote.BusinessObjects.Net.Tests/PollSubmissionResponseCollectionTests.cs
danielmartind/MyVote
e96d45513b098d4b7afff299a2bfefbb9b8200f1
[ "Apache-2.0" ]
null
null
null
src/BusinessObjects/MyVote.BusinessObjects.Net.Tests/PollSubmissionResponseCollectionTests.cs
danielmartind/MyVote
e96d45513b098d4b7afff299a2bfefbb9b8200f1
[ "Apache-2.0" ]
null
null
null
using System; using System.IO; using Autofac; using Csla; using Csla.Serialization.Mobile; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using MyVote.BusinessObjects.Contracts; using MyVote.BusinessObjects.Core; using MyVote.Core.Extensions; using MyVote.Data.Entities; using Spackle; using Spackle.Extensions; namespace MyVote.BusinessObjects.Net.Tests { [TestClass] public sealed class PollSubmissionResponseCollectionTests { private static BusinessList<IPollOption> CreateOptions() { var generator = new RandomObjectGenerator(); var optionId = generator.Generate<int>(); var optionPosition = generator.Generate<short>(); var optionText = generator.Generate<string>(); var option = new Mock<IPollOption>(MockBehavior.Loose); option.Setup(_ => _.IsChild).Returns(true); option.Setup(_ => _.PollOptionID).Returns(optionId); option.Setup(_ => _.OptionPosition).Returns(optionPosition); option.Setup(_ => _.OptionText).Returns(optionText); var options = new BusinessList<IPollOption>(); options.Add(option.Object); return options; } [TestMethod] public void EnsureCollectionCanBeSerialized() { var builder = new ContainerBuilder(); builder.Register<IEntities>(_ => Mock.Of<IEntities>()); using (new ObjectActivator(builder.Build()).Bind(() => ApplicationContext.DataPortalActivator)) { var responses = DataPortal.CreateChild<PollSubmissionResponseCollection>( PollSubmissionResponseCollectionTests.CreateOptions()); var formatter = new MobileFormatter(); using (var stream = new MemoryStream()) { formatter.Serialize(stream, responses); stream.Position = 0; var newResponses = formatter.Deserialize(stream) as PollSubmissionResponseCollection; Assert.AreEqual(1, newResponses.Count, newResponses.GetPropertyName(_ => _.Count)); Assert.AreEqual(responses[0].OptionText, newResponses[0].OptionText, newResponses.GetPropertyName(_ => _[0].OptionText)); } } } [TestMethod] public void Create() { var builder = new ContainerBuilder(); builder.Register<IEntities>(_ => Mock.Of<IEntities>()); using (new ObjectActivator(builder.Build()).Bind(() => ApplicationContext.DataPortalActivator)) { var responses = DataPortal.CreateChild<PollSubmissionResponseCollection>( PollSubmissionResponseCollectionTests.CreateOptions()); Assert.AreEqual(1, responses.Count, responses.GetPropertyName(_ => _.Count)); } } [TestMethod] [ExpectedException(typeof(NotSupportedException))] public void Clear() { var builder = new ContainerBuilder(); builder.Register<IEntities>(_ => Mock.Of<IEntities>()); using (new ObjectActivator(builder.Build()).Bind(() => ApplicationContext.DataPortalActivator)) { var responses = DataPortal.CreateChild<PollSubmissionResponseCollection>( PollSubmissionResponseCollectionTests.CreateOptions()); responses.Clear(); } } [TestMethod] [ExpectedException(typeof(NotSupportedException))] public void Insert() { var builder = new ContainerBuilder(); builder.Register<IEntities>(_ => Mock.Of<IEntities>()); using (new ObjectActivator(builder.Build()).Bind(() => ApplicationContext.DataPortalActivator)) { var responses = DataPortal.CreateChild<PollSubmissionResponseCollection>( PollSubmissionResponseCollectionTests.CreateOptions()); responses.Insert(1, Mock.Of<IPollSubmissionResponse>()); } } [TestMethod, ExpectedException(typeof(NotSupportedException))] public void Move() { var builder = new ContainerBuilder(); builder.Register<IEntities>(_ => Mock.Of<IEntities>()); using (new ObjectActivator(builder.Build()).Bind(() => ApplicationContext.DataPortalActivator)) { var responses = DataPortal.CreateChild<PollSubmissionResponseCollection>( PollSubmissionResponseCollectionTests.CreateOptions()); responses.Move(0, 0); } } [TestMethod, ExpectedException(typeof(NotSupportedException))] public void Remove() { var builder = new ContainerBuilder(); builder.Register<IEntities>(_ => Mock.Of<IEntities>()); using (new ObjectActivator(builder.Build()).Bind(() => ApplicationContext.DataPortalActivator)) { var responses = DataPortal.CreateChild<PollSubmissionResponseCollection>( PollSubmissionResponseCollectionTests.CreateOptions()); responses.RemoveAt(0); } } } }
32.389706
126
0.738025
5c79f4665d7d83570617826c2aec6ccba8ea54b2
1,049
c
C
Piscine/c_piscine_c_05/aborboll4/ex00/ft_iterative_factorial.c
Bortize/42Madrid
9fdb0316451e59197dd26dca3bc6ed205e254cc7
[ "Apache-2.0" ]
13
2020-02-14T16:26:33.000Z
2022-01-11T15:33:29.000Z
Piscine/c_piscine_c_05/aborboll4/ex00/ft_iterative_factorial.c
dalexhd/42-madrid
e4d7282b15c6da988548248b5b9d222b753fce3a
[ "Apache-2.0" ]
2
2020-02-14T16:26:19.000Z
2021-05-26T14:16:48.000Z
Piscine/c_piscine_c_05/aborboll4/ex00/ft_iterative_factorial.c
dalexhd/42-madrid
e4d7282b15c6da988548248b5b9d222b753fce3a
[ "Apache-2.0" ]
3
2021-04-06T05:29:31.000Z
2021-05-26T09:39:26.000Z
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_iterative_factorial.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: aborboll <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/09/17 18:51:02 by aborboll #+# #+# */ /* Updated: 2019/09/19 11:45:54 by aborboll ### ########.fr */ /* */ /* ************************************************************************** */ int ft_iterative_factorial(int nb) { int result; result = 1; if (nb < 0) return (0); while (nb > 0) { result *= nb; nb--; } return (result); }
38.851852
80
0.185891
2743c3fd3b7985ad81f6fbce0e6d25f3634d2eb0
433
dart
Dart
repo_support/tool/run_ci.dart
tekartik/firestore.dart
4bbf47e48876348e2391ef5c6804d7d80467da04
[ "BSD-2-Clause" ]
1
2021-11-05T18:03:51.000Z
2021-11-05T18:03:51.000Z
repo_support/tool/run_ci.dart
tekartik/firestore.dart
4bbf47e48876348e2391ef5c6804d7d80467da04
[ "BSD-2-Clause" ]
4
2019-01-09T02:37:44.000Z
2021-09-12T05:59:16.000Z
repo_support/tool/run_ci.dart
tekartik/firestore.dart
4bbf47e48876348e2391ef5c6804d7d80467da04
[ "BSD-2-Clause" ]
2
2019-04-19T17:35:48.000Z
2020-11-12T07:52:28.000Z
//@dart=2.9 import 'package:dev_test/package.dart'; import 'package:path/path.dart'; var topDir = '..'; Future<void> main() async { for (var dir in [ 'firestore_rest', 'firestore', 'firestore_sembast', 'firestore', 'firestore_browser', 'firestore_idb', 'firestore_sim', 'firestore_sim_browser', 'firestore_sim_io', 'firestore_test' ]) { await packageRunCi(join(topDir, dir)); } }
18.041667
42
0.635104
93e95784037841b631cfb1d68bfa1c5660573e3d
9,184
sql
SQL
SQL/finance.sql
jkamler/finance_KSJesenik_local
a9fd0329ebfe3696062eb61d4e51f85ee3dab04a
[ "MIT" ]
null
null
null
SQL/finance.sql
jkamler/finance_KSJesenik_local
a9fd0329ebfe3696062eb61d4e51f85ee3dab04a
[ "MIT" ]
null
null
null
SQL/finance.sql
jkamler/finance_KSJesenik_local
a9fd0329ebfe3696062eb61d4e51f85ee3dab04a
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 12, 2016 at 10:40 PM -- Server version: 5.7.15-0ubuntu0.16.04.1 -- PHP Version: 7.0.8-0ubuntu0.16.04.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Database: `finance` -- -- -------------------------------------------------------- -- -- Table structure for table `cis_kategorie` -- CREATE TABLE `cis_kategorie` ( `id_kat` int(11) NOT NULL, `kategorie` varchar(50) COLLATE utf8_czech_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -- Dumping data for table `cis_kategorie` -- INSERT INTO `cis_kategorie` (`id_kat`, `kategorie`) VALUES (81, 'Příjmy - dary'), (72, 'Příjmy - desátky'), (73, 'Výdaje - evangelizace'), (74, 'Výdaje - mládež'), (75, 'Výdaje - nedělka'), (82, 'Výdaje - provoz'), (76, 'Výdaje - služebníci'); -- -------------------------------------------------------- -- -- Table structure for table `cis_skupiny` -- CREATE TABLE `cis_skupiny` ( `id_skup` int(11) NOT NULL, `skupina` varchar(50) COLLATE utf8_czech_ci NOT NULL, `limit_skup` decimal(11,0) NOT NULL, `popis` varchar(50) COLLATE utf8_czech_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -- Dumping data for table `cis_skupiny` -- INSERT INTO `cis_skupiny` (`id_skup`, `skupina`, `limit_skup`, `popis`) VALUES (0, 'Příjmy / Prázdná obálka', '0', 'Nemazat - Úvodní obálka nové kategorie nebo příjmy'), (2, 'Výdaje vnitřní', '20000', 'Provoz sboru'), (3, 'Výdaje vnější', '10000', 'Všechno čím sloužíme mimo sbor'), (4, 'testovací', '1000', 'Popis obálky'); -- -------------------------------------------------------- -- -- Table structure for table `groups` -- CREATE TABLE `groups` ( `id` mediumint(8) UNSIGNED NOT NULL, `name` varchar(20) NOT NULL, `description` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `groups` -- INSERT INTO `groups` (`id`, `name`, `description`) VALUES (1, 'admin', 'Administrator'), (2, 'members', 'General User'); -- -------------------------------------------------------- -- -- Table structure for table `kategorie_skupiny` -- CREATE TABLE `kategorie_skupiny` ( `id_kat` int(11) NOT NULL, `id_skup` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -- Dumping data for table `kategorie_skupiny` -- INSERT INTO `kategorie_skupiny` (`id_kat`, `id_skup`) VALUES (72, 0), (73, 3), (74, 2), (75, 2), (76, 3), (100, 0), (81, 0), (82, 2); -- -------------------------------------------------------- -- -- Table structure for table `login_attempts` -- CREATE TABLE `login_attempts` ( `id` int(11) UNSIGNED NOT NULL, `ip_address` varchar(15) NOT NULL, `login` varchar(100) NOT NULL, `time` int(11) UNSIGNED DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `polozky` -- CREATE TABLE `polozky` ( `id_pol` bigint(20) NOT NULL, `polozka` decimal(11,2) NOT NULL, `datum_vl` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `datum_vz` date NOT NULL, `id_kat` bigint(20) NOT NULL, `popis` varchar(50) COLLATE utf8_czech_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -- Dumping data for table `polozky` -- INSERT INTO `polozky` (`id_pol`, `polozka`, `datum_vl`, `datum_vz`, `id_kat`, `popis`) VALUES (21, '10000.00', '2016-09-26 22:52:54', '2016-09-04', 72, 'Sbírka na shromku'), (22, '-1000.00', '2016-09-26 22:53:25', '2016-09-27', 73, 'letáčky'), (23, '-1000.00', '2016-09-26 22:53:44', '2016-09-02', 74, 'Materiály na tvoření'), (24, '-250.00', '2016-09-26 22:54:01', '2016-09-27', 75, 'Pastelky'), (25, '-500.00', '2016-09-26 22:54:22', '2016-09-27', 76, 'Doprava'), (26, '-100.00', '2016-10-04 19:38:47', '2016-10-28', 76, 'Popis operace'), (27, '-5000.00', '2016-10-04 20:20:48', '2016-10-04', 75, 'Popis operace'), (28, '-1000.00', '2016-10-04 20:31:43', '2016-10-04', 73, 'Popis operace'), (29, '2000.00', '2016-10-04 21:42:03', '2016-10-04', 81, 'Popis operace'), (30, '-15000.00', '2016-10-08 08:07:19', '2016-10-08', 82, 'Nájem '), (51, '20.00', '2016-10-10 13:42:36', '2000-01-01', 5, 'nic'), (52, '20.00', '2016-10-10 13:42:48', '2000-01-01', 5, 'nic'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) UNSIGNED NOT NULL, `ip_address` varchar(45) NOT NULL, `username` varchar(100) DEFAULT NULL, `password` varchar(255) NOT NULL, `salt` varchar(255) DEFAULT NULL, `email` varchar(100) NOT NULL, `activation_code` varchar(40) DEFAULT NULL, `forgotten_password_code` varchar(40) DEFAULT NULL, `forgotten_password_time` int(11) UNSIGNED DEFAULT NULL, `remember_code` varchar(40) DEFAULT NULL, `created_on` int(11) UNSIGNED NOT NULL, `last_login` int(11) UNSIGNED DEFAULT NULL, `active` tinyint(1) UNSIGNED DEFAULT NULL, `first_name` varchar(50) DEFAULT NULL, `last_name` varchar(50) DEFAULT NULL, `company` varchar(100) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`) VALUES (1, '127.0.0.1', 'administrator', '$2y$08$woTY/87yQiIy8h8ZzQiCdu3YPs37q5ALxnsi2MCbe0Q.tC9/3iq8a', '', 'admin@admin.com', '', NULL, NULL, NULL, 1268889823, 1476227803, 1, 'Admin', 'istrator', 'ADMIN', '0'), (2, '127.0.0.1', NULL, '$2y$08$REXkRCpgQNAJzI1MbthryupR62V4SaGNq2tvjQgXS9LFlIIpSEonm', NULL, 'test@test.cz', NULL, NULL, NULL, NULL, 1475915056, NULL, 1, 'test', 'test2', 'dddddd', '123456789'); -- -------------------------------------------------------- -- -- Table structure for table `users_groups` -- CREATE TABLE `users_groups` ( `id` int(11) UNSIGNED NOT NULL, `user_id` int(11) UNSIGNED NOT NULL, `group_id` mediumint(8) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_groups` -- INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES (8, 1, 1), (9, 1, 2), (5, 2, 2); -- -- Indexes for dumped tables -- -- -- Indexes for table `cis_kategorie` -- ALTER TABLE `cis_kategorie` ADD PRIMARY KEY (`id_kat`), ADD UNIQUE KEY `kategorie` (`kategorie`); -- -- Indexes for table `cis_skupiny` -- ALTER TABLE `cis_skupiny` ADD PRIMARY KEY (`id_skup`), ADD UNIQUE KEY `skupina` (`skupina`), ADD UNIQUE KEY `skupina_2` (`skupina`); -- -- Indexes for table `groups` -- ALTER TABLE `groups` ADD PRIMARY KEY (`id`); -- -- Indexes for table `login_attempts` -- ALTER TABLE `login_attempts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `polozky` -- ALTER TABLE `polozky` ADD PRIMARY KEY (`id_pol`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users_groups` -- ALTER TABLE `users_groups` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`), ADD KEY `fk_users_groups_users1_idx` (`user_id`), ADD KEY `fk_users_groups_groups1_idx` (`group_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `cis_kategorie` -- ALTER TABLE `cis_kategorie` MODIFY `id_kat` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=83; -- -- AUTO_INCREMENT for table `cis_skupiny` -- ALTER TABLE `cis_skupiny` MODIFY `id_skup` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `groups` -- ALTER TABLE `groups` MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `login_attempts` -- ALTER TABLE `login_attempts` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `polozky` -- ALTER TABLE `polozky` MODIFY `id_pol` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users_groups` -- ALTER TABLE `users_groups` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- Constraints for dumped tables -- -- -- Constraints for table `users_groups` -- ALTER TABLE `users_groups` ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION; /*!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 */;
28.610592
263
0.652657
759b0b4faf416a844f94b14ec7234af843d27d3a
1,469
cs
C#
Homework/01.Linear Data Structures/04.LongestSubsequence/Program.cs
GoranGit/Data-Structures-and-Algorithms
e22b1eaa2d54aeb9fff5d2e77dae5f34385ca0a2
[ "MIT" ]
null
null
null
Homework/01.Linear Data Structures/04.LongestSubsequence/Program.cs
GoranGit/Data-Structures-and-Algorithms
e22b1eaa2d54aeb9fff5d2e77dae5f34385ca0a2
[ "MIT" ]
null
null
null
Homework/01.Linear Data Structures/04.LongestSubsequence/Program.cs
GoranGit/Data-Structures-and-Algorithms
e22b1eaa2d54aeb9fff5d2e77dae5f34385ca0a2
[ "MIT" ]
null
null
null
namespace _04.LongestSubsequence { using System; using System.Collections.Generic; using System.Linq; public class Program { public static void Main() { List<int> numbers = new List<int> { 1, 1, 1, 2, 3, 2, 4, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 3 }; List<int> resultList = FindLongestSequence(numbers); resultList.ForEach(x => Console.WriteLine(x)); } public static List<int> FindLongestSequence(List<int> list) { List<int> resul = new List<int>(); int maxCountOfNumbersInSequence = 1; int numberWithLongestSequence = 0; int counter = 0; int num = list.FirstOrDefault(); for (var i = 0; i < list.Count; i++) { if (num == list[i]) { counter++; num = list[i]; } else { if (maxCountOfNumbersInSequence < counter) { maxCountOfNumbersInSequence = counter; numberWithLongestSequence = num; } counter = 1; num = list[i]; } } var result = Enumerable.Repeat(numberWithLongestSequence, maxCountOfNumbersInSequence); return result.ToList(); } } }
28.803922
121
0.457454
0807342af490afa7bb09650f069fd7e280a726dc
1,818
html
HTML
walk-base/src/main/webapp/META-INF/static/component/demo/tab.html
lebisous/walk
b1d6390b83ba59e393b1589f1e1851cbd576e09c
[ "Apache-2.0" ]
1
2020-11-13T02:18:27.000Z
2020-11-13T02:18:27.000Z
walk-base/src/main/webapp/META-INF/static/component/demo/tab.html
lebisous/walk
b1d6390b83ba59e393b1589f1e1851cbd576e09c
[ "Apache-2.0" ]
null
null
null
walk-base/src/main/webapp/META-INF/static/component/demo/tab.html
lebisous/walk
b1d6390b83ba59e393b1589f1e1851cbd576e09c
[ "Apache-2.0" ]
1
2021-08-18T09:22:05.000Z
2021-08-18T09:22:05.000Z
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>tab</title> <link type="text/css" rel="stylesheet" href="../resources/css/common.css"/> <script type="text/javascript" src="../resources/scripts/seajs/sea-modules/seajs/seajs/2.2.1/sea.js"></script> <script type="text/javascript" src="../resources/scripts/seajs/sea-modules/config.js"></script> <script type="text/javascript" src="../resources/scripts/seajs/sea-modules/jquery/jquery/1.12.4/jquery.js"></script> <script type="text/javascript" src="../resources/scripts/seajs/sea-modules/jquery/jquery/1.12.4/jquery-extend.js"></script> <script type="text/javascript" src="../resources/scripts/seajs/sea-modules/walk.js"></script> <script type="text/javascript" src="../resources/scripts/seajs/sea-modules/init.js"></script> </head> <body style="padding:10px;background:#fff;"> <div class="m5" style="margin-top:20px;"> <h1>tab样式1</h1><br> <div class="w-tab"> <ul> <li class="tab active" val="1">标签1</li> <li class="tab" val="2">标签2</li> <li class="tab" val="3">标签3</li> </ul> </div> </div> <div class="m5" style="margin-top:20px;"> <h1>tab样式2</h1><br> <div class="w-tab-t"> <ul> <li class="tab active" val="1"><span class="blue">蓝色标签</span></li> <li class="tab" val="2"><span class="green">绿色标签</span></li> <li class="tab" val="3"><span class="orange">橙色标签</span></li> <li class="tab" val="4"><span class="red">红色标签</span></li> <li class="tab" val="5"><span class="purple">紫色标签</span></li> <li class="tab" val="6"><span class="pink">粉色标签</span></li> </ul> </div> </div> </body> </html>
46.615385
124
0.648515
576a7faf568fdaa40fcc233d22dcce35645ae5fb
653
c
C
extlibs/AODT/v72/odtmcidas/navcal/navcal/readd.c
oxelson/gempak
e7c477814d7084c87d3313c94e192d13d8341fa1
[ "BSD-3-Clause" ]
42
2015-06-03T15:26:21.000Z
2022-02-28T22:36:03.000Z
extlibs/AODT/v72/odtmcidas/navcal/navcal/readd.c
oxelson/gempak
e7c477814d7084c87d3313c94e192d13d8341fa1
[ "BSD-3-Clause" ]
60
2015-05-11T21:36:08.000Z
2022-03-29T16:22:42.000Z
extlibs/AODT/v72/odtmcidas/navcal/navcal/readd.c
oxelson/gempak
e7c477814d7084c87d3313c94e192d13d8341fa1
[ "BSD-3-Clause" ]
27
2016-06-06T21:55:14.000Z
2022-03-18T18:23:28.000Z
#include <stdio.h> #include <errno.h> #include <unistd.h> /* read, write, lseek, close */ #include "aracom.h" #include "direct.h" #include "arasubs.h" /* READS DIRECTORY ENTRY FROM AREA */ /* fd INPUT AREA NUMBER */ /* direct OUTPUT 64 WORD DIRECTORY ENTRY */ extern char cerror[120]; extern char **varg; int readd (int fd, int direct[]) { int i; /* index */ int cur_area = -1; for (i=0; i<N_AREAS; i++) {if(aracom[i].fd == fd) {cur_area=i; break;}} if(cur_area == -1) {printf ("file %d not opened \n",fd); return -1;} directptr = (void *)aracom[cur_area].dir; for(i=0;i<64;i++) {direct[i] = aracom[cur_area].dir[i];} return 0; }
22.517241
57
0.623277
4a4119f152ddd00a71f929cdc8e957c824df55d6
461
asm
Assembly
programs/oeis/114/A114890.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/114/A114890.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/114/A114890.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A114890: First differences of A114889. ; 2,1,3,2,1,1,1,1,6,2,1,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,15,2,1,3,2,1,1,1,1,6,2,1,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,42,2,1,3,2,1,1,1,1,6,2,1,3,2,1,1,1,1,1,1 mov $4,2 mov $5,$0 lpb $4 mov $0,$5 sub $4,1 add $0,$4 max $0,0 seq $0,167878 ; A167877(n) + n. mov $2,$4 mul $2,$0 add $1,$2 mov $3,$0 lpe min $5,1 mul $5,$3 sub $1,$5 div $1,2 add $1,1 mov $0,$1
20.043478
203
0.520607
b9ced21803181240bb3418870ddfc4e11c3cb74d
9,213
sql
SQL
sql/finax.sql
xichoo/finax
5a464eb1ab3c36122b3148d17d61495701ecd32e
[ "MIT" ]
null
null
null
sql/finax.sql
xichoo/finax
5a464eb1ab3c36122b3148d17d61495701ecd32e
[ "MIT" ]
1
2022-02-09T22:23:31.000Z
2022-02-09T22:23:31.000Z
sql/finax.sql
xichoo/finax
5a464eb1ab3c36122b3148d17d61495701ecd32e
[ "MIT" ]
null
null
null
/* Navicat MySQL Data Transfer Source Server : Ubuntu Source Server Version : 80021 Source Host : localhost:3306 Source Database : finax Target Server Type : MYSQL Target Server Version : 80021 File Encoding : 65001 Date: 2020-08-04 11:20:53 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for sys_config -- ---------------------------- DROP TABLE IF EXISTS `sys_config`; CREATE TABLE `sys_config` ( `id` bigint NOT NULL AUTO_INCREMENT, `param_key` varchar(20) DEFAULT NULL, `param_value` varchar(255) DEFAULT NULL, `remark` varchar(255) DEFAULT NULL, `create_date` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='系统参数表'; -- ---------------------------- -- Records of sys_config -- ---------------------------- INSERT INTO `sys_config` VALUES ('3', 'test1', '1', '', '2020-04-20 14:58:50'); -- ---------------------------- -- Table structure for sys_dict -- ---------------------------- DROP TABLE IF EXISTS `sys_dict`; CREATE TABLE `sys_dict` ( `id` bigint NOT NULL AUTO_INCREMENT, `parent_id` bigint DEFAULT NULL, `code` varchar(20) DEFAULT NULL, `name` varchar(50) DEFAULT NULL, `value` varchar(100) DEFAULT NULL, `is_default` int DEFAULT NULL, `remark` varchar(255) DEFAULT NULL, `orderby` int DEFAULT NULL, `create_date` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='数据字典表'; -- ---------------------------- -- Records of sys_dict -- ---------------------------- INSERT INTO `sys_dict` VALUES ('6', '0', 'sex', '性别', null, null, '', '1', '2020-04-08 10:45:54'); INSERT INTO `sys_dict` VALUES ('7', '6', 'man', '男', '1', null, '', '1', '2020-04-08 10:46:21'); INSERT INTO `sys_dict` VALUES ('8', '6', 'woman', '女', '0', null, '', '2', '2020-04-08 10:46:33'); -- ---------------------------- -- Table structure for sys_login_log -- ---------------------------- DROP TABLE IF EXISTS `sys_login_log`; CREATE TABLE `sys_login_log` ( `id` bigint NOT NULL AUTO_INCREMENT, `user_id` bigint DEFAULT NULL, `username` varchar(50) DEFAULT NULL, `ip` varchar(20) DEFAULT NULL, `os` varchar(50) DEFAULT NULL, `broswer` varchar(200) DEFAULT NULL, `create_date` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3106 DEFAULT CHARSET=utf8 COMMENT='用户登陆日志表'; -- ---------------------------- -- Records of sys_login_log -- ---------------------------- -- ---------------------------- -- Table structure for sys_menu -- ---------------------------- DROP TABLE IF EXISTS `sys_menu`; CREATE TABLE `sys_menu` ( `id` bigint NOT NULL AUTO_INCREMENT, `parent_id` bigint DEFAULT NULL, `name` varchar(100) DEFAULT NULL, `url` varchar(50) DEFAULT NULL, `icon` varchar(20) DEFAULT NULL, `orderby` int DEFAULT NULL, `create_date` datetime DEFAULT NULL, `permission` varchar(255) DEFAULT NULL, `menu_type` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT='系统菜单表'; -- ---------------------------- -- Records of sys_menu -- ---------------------------- INSERT INTO `sys_menu` VALUES ('1', '0', '系统管理', '-', 'fa-cog', '1', '2020-04-02 16:10:54', null, '1'); INSERT INTO `sys_menu` VALUES ('2', '1', '用户管理', '#system/user/list', 'fa-user', '1', '2020-04-02 16:14:53', null, '2'); INSERT INTO `sys_menu` VALUES ('3', '1', '角色管理', '#system/role/list', 'fa-user-plus', '2', '2020-04-02 16:16:52', null, '2'); INSERT INTO `sys_menu` VALUES ('4', '1', '菜单管理', '#system/menu/list', 'fa-list-ul', '3', '2020-04-02 16:17:53', null, '2'); INSERT INTO `sys_menu` VALUES ('5', '1', '参数设置', '#system/config/list', 'fa-cogs', '4', '2020-04-03 10:31:36', null, '2'); INSERT INTO `sys_menu` VALUES ('6', '1', '字典管理', '#system/dict/list', 'fa-book', '5', '2020-04-07 14:01:55', null, '2'); INSERT INTO `sys_menu` VALUES ('7', '1', '系统日志', '#system/log/operationLogList', 'fa-file', '6', '2020-04-16 15:21:49', null, '2'); INSERT INTO `sys_menu` VALUES ('8', '5', '添加/修改', null, null, '1', '2020-04-17 15:35:44', 'sys:config:add', '3'); INSERT INTO `sys_menu` VALUES ('9', '5', '列表', null, null, '4', '2020-04-17 15:36:17', 'sys:config:list', '3'); INSERT INTO `sys_menu` VALUES ('10', '5', '删除', null, null, '3', '2020-04-17 15:36:32', 'sys:config:delete', '3'); INSERT INTO `sys_menu` VALUES ('11', '2', '新增/修改', null, null, '5', '2020-04-17 15:38:10', 'sys:user:add', '3'); INSERT INTO `sys_menu` VALUES ('12', '2', '列表', null, null, '6', '2020-04-17 15:38:28', 'sys:user:list', '3'); INSERT INTO `sys_menu` VALUES ('13', '2', '删除', null, null, '7', '2020-04-17 15:38:47', 'sys:user:delete', '3'); INSERT INTO `sys_menu` VALUES ('14', '3', '新增/修改', null, null, '1', '2020-04-17 15:39:23', 'sys:role:add', '3'); INSERT INTO `sys_menu` VALUES ('15', '3', '列表', null, null, '2', '2020-04-17 15:39:38', 'sys:role:list', '3'); INSERT INTO `sys_menu` VALUES ('16', '3', '删除', null, null, '3', '2020-04-17 15:39:53', 'sys:role:delete', '3'); INSERT INTO `sys_menu` VALUES ('17', '4', '新增/修改', null, null, '1', '2020-04-17 15:40:28', 'sys:menu:add', '3'); INSERT INTO `sys_menu` VALUES ('18', '4', '列表', null, null, '2', '2020-04-17 15:40:46', 'sys:menu:list', '3'); INSERT INTO `sys_menu` VALUES ('19', '4', '删除', null, null, '3', '2020-04-17 15:41:01', 'sys:menu:delete', '3'); INSERT INTO `sys_menu` VALUES ('20', '6', '新增/修改', null, null, '1', '2020-04-17 15:41:50', 'sys:dict:add', '3'); INSERT INTO `sys_menu` VALUES ('21', '6', '列表', null, null, '2', '2020-04-17 15:42:12', 'sys:dict:list', '3'); INSERT INTO `sys_menu` VALUES ('22', '6', '删除', null, null, '3', '2020-04-17 15:42:25', 'sys:dict:delete', '3'); -- ---------------------------- -- Table structure for sys_operation_log -- ---------------------------- DROP TABLE IF EXISTS `sys_operation_log`; CREATE TABLE `sys_operation_log` ( `id` bigint NOT NULL AUTO_INCREMENT, `user_id` bigint DEFAULT NULL, `username` varchar(50) DEFAULT NULL, `action` varchar(50) DEFAULT NULL, `method` varchar(200) DEFAULT NULL, `url` varchar(200) DEFAULT NULL, `ip` varchar(20) DEFAULT NULL, `params` varchar(2000) DEFAULT NULL, `result` varchar(2000) DEFAULT NULL, `create_date` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3111 DEFAULT CHARSET=utf8 COMMENT='用户操作日志表'; -- ---------------------------- -- Records of sys_operation_log -- ---------------------------- -- ---------------------------- -- Table structure for sys_role -- ---------------------------- DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( `id` bigint NOT NULL AUTO_INCREMENT, `role` varchar(20) DEFAULT NULL, `description` varchar(50) DEFAULT NULL, `create_date` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='角色表'; -- ---------------------------- -- Records of sys_role -- ---------------------------- INSERT INTO `sys_role` VALUES ('1', 'test1', '日志管理员', '2020-05-07 11:39:26'); -- ---------------------------- -- Table structure for sys_role_menu -- ---------------------------- DROP TABLE IF EXISTS `sys_role_menu`; CREATE TABLE `sys_role_menu` ( `id` bigint NOT NULL AUTO_INCREMENT, `role_id` bigint DEFAULT NULL, `menu_id` bigint DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8 COMMENT='角色菜单关系表'; -- ---------------------------- -- Records of sys_role_menu -- ---------------------------- INSERT INTO `sys_role_menu` VALUES ('40', '2', '1'); INSERT INTO `sys_role_menu` VALUES ('41', '2', '7'); INSERT INTO `sys_role_menu` VALUES ('44', '1', '1'); INSERT INTO `sys_role_menu` VALUES ('45', '1', '7'); -- ---------------------------- -- Table structure for sys_user -- ---------------------------- DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `id` bigint NOT NULL AUTO_INCREMENT, `username` varchar(20) DEFAULT NULL, `password` varchar(50) DEFAULT NULL, `email` varchar(20) DEFAULT NULL, `mobile` varchar(20) DEFAULT NULL, `create_date` datetime DEFAULT NULL, `errorcount` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='系统用户表'; -- ---------------------------- -- Records of sys_user -- ---------------------------- INSERT INTO `sys_user` VALUES ('1', 'admin', 'a66abb5684c45962d887564f08346e8d', 'admin@live.cn', '', '2020-01-07 15:57:55', '0'); INSERT INTO `sys_user` VALUES ('7', 'test1', '4a3252a5edf8fcaa8bde0bfcce79560d', '', '', '2020-05-08 11:01:14', null); -- ---------------------------- -- Table structure for sys_user_role -- ---------------------------- DROP TABLE IF EXISTS `sys_user_role`; CREATE TABLE `sys_user_role` ( `id` bigint NOT NULL AUTO_INCREMENT, `user_id` bigint DEFAULT NULL, `role_id` bigint DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='用户角色关系表'; -- ---------------------------- -- Records of sys_user_role -- ---------------------------- INSERT INTO `sys_user_role` VALUES ('9', '8', '1'); INSERT INTO `sys_user_role` VALUES ('13', '5', '1'); INSERT INTO `sys_user_role` VALUES ('14', '6', '2'); INSERT INTO `sys_user_role` VALUES ('15', '7', '1');
42.261468
131
0.585803
3d0bb3b26d3cc33b8c29c76441a961727f0210b5
26,180
go
Go
sdk/resourcemanager/labservices/armlabservices/zz_generated_virtualmachines_client.go
discentem/azure-sdk-for-go
f4515d6fffcc28b4586e8a9819fea4473be45c36
[ "MIT" ]
2
2021-10-12T06:53:01.000Z
2021-11-09T10:46:45.000Z
sdk/resourcemanager/labservices/armlabservices/zz_generated_virtualmachines_client.go
GHOSTMACHINE-MUSIC/azure-sdk-for-go
b5367c48dea904625891c31e72e5cf5a4bad3b09
[ "MIT" ]
1,015
2019-07-17T16:19:06.000Z
2021-07-29T17:12:08.000Z
sdk/resourcemanager/labservices/armlabservices/zz_generated_virtualmachines_client.go
GHOSTMACHINE-MUSIC/azure-sdk-for-go
b5367c48dea904625891c31e72e5cf5a4bad3b09
[ "MIT" ]
2
2020-11-23T10:25:48.000Z
2021-12-09T03:09:34.000Z
//go:build go1.16 // +build go1.16 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package armlabservices import ( "context" "errors" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" "strings" ) // VirtualMachinesClient contains the methods for the VirtualMachines group. // Don't use this type directly, use NewVirtualMachinesClient() instead. type VirtualMachinesClient struct { ep string pl runtime.Pipeline subscriptionID string } // NewVirtualMachinesClient creates a new instance of VirtualMachinesClient with the specified values. func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *VirtualMachinesClient { cp := arm.ClientOptions{} if options != nil { cp = *options } if len(cp.Host) == 0 { cp.Host = arm.AzurePublicCloud } return &VirtualMachinesClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} } // Get - Returns the properties for a lab virtual machine. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesGetOptions) (VirtualMachinesGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return VirtualMachinesGetResponse{}, err } resp, err := client.pl.Do(req) if err != nil { return VirtualMachinesGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { return VirtualMachinesGetResponse{}, client.getHandleError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if labName == "" { return nil, errors.New("parameter labName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) if virtualMachineName == "" { return nil, errors.New("parameter virtualMachineName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualMachineName}", url.PathEscape(virtualMachineName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-11-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil } // getHandleResponse handles the Get response. func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (VirtualMachinesGetResponse, error) { result := VirtualMachinesGetResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachine); err != nil { return VirtualMachinesGetResponse{}, runtime.NewResponseError(err, resp) } return result, nil } // getHandleError handles the Get error response. func (client *VirtualMachinesClient) getHandleError(resp *http.Response) error { body, err := runtime.Payload(resp) if err != nil { return runtime.NewResponseError(err, resp) } errType := ErrorResponse{raw: string(body)} if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) } return runtime.NewResponseError(&errType, resp) } // ListByLab - Returns a list of all virtual machines for a lab. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) ListByLab(resourceGroupName string, labName string, options *VirtualMachinesListByLabOptions) *VirtualMachinesListByLabPager { return &VirtualMachinesListByLabPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listByLabCreateRequest(ctx, resourceGroupName, labName, options) }, advancer: func(ctx context.Context, resp VirtualMachinesListByLabResponse) (*policy.Request, error) { return runtime.NewRequest(ctx, http.MethodGet, *resp.PagedVirtualMachines.NextLink) }, } } // listByLabCreateRequest creates the ListByLab request. func (client *VirtualMachinesClient) listByLabCreateRequest(ctx context.Context, resourceGroupName string, labName string, options *VirtualMachinesListByLabOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if labName == "" { return nil, errors.New("parameter labName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-11-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil } // listByLabHandleResponse handles the ListByLab response. func (client *VirtualMachinesClient) listByLabHandleResponse(resp *http.Response) (VirtualMachinesListByLabResponse, error) { result := VirtualMachinesListByLabResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.PagedVirtualMachines); err != nil { return VirtualMachinesListByLabResponse{}, runtime.NewResponseError(err, resp) } return result, nil } // listByLabHandleError handles the ListByLab error response. func (client *VirtualMachinesClient) listByLabHandleError(resp *http.Response) error { body, err := runtime.Payload(resp) if err != nil { return runtime.NewResponseError(err, resp) } errType := ErrorResponse{raw: string(body)} if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) } return runtime.NewResponseError(&errType, resp) } // BeginRedeploy - Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginRedeployOptions) (VirtualMachinesRedeployPollerResponse, error) { resp, err := client.redeploy(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return VirtualMachinesRedeployPollerResponse{}, err } result := VirtualMachinesRedeployPollerResponse{ RawResponse: resp, } pt, err := armruntime.NewPoller("VirtualMachinesClient.Redeploy", "location", resp, client.pl, client.redeployHandleError) if err != nil { return VirtualMachinesRedeployPollerResponse{}, err } result.Poller = &VirtualMachinesRedeployPoller{ pt: pt, } return result, nil } // Redeploy - Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginRedeployOptions) (*http.Response, error) { req, err := client.redeployCreateRequest(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return nil, err } resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, client.redeployHandleError(resp) } return resp, nil } // redeployCreateRequest creates the Redeploy request. func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginRedeployOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/redeploy" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if labName == "" { return nil, errors.New("parameter labName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) if virtualMachineName == "" { return nil, errors.New("parameter virtualMachineName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualMachineName}", url.PathEscape(virtualMachineName)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-11-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil } // redeployHandleError handles the Redeploy error response. func (client *VirtualMachinesClient) redeployHandleError(resp *http.Response) error { body, err := runtime.Payload(resp) if err != nil { return runtime.NewResponseError(err, resp) } errType := ErrorResponse{raw: string(body)} if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) } return runtime.NewResponseError(&errType, resp) } // BeginReimage - Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published snapshot of the reference // environment of the lab. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginReimageOptions) (VirtualMachinesReimagePollerResponse, error) { resp, err := client.reimage(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return VirtualMachinesReimagePollerResponse{}, err } result := VirtualMachinesReimagePollerResponse{ RawResponse: resp, } pt, err := armruntime.NewPoller("VirtualMachinesClient.Reimage", "location", resp, client.pl, client.reimageHandleError) if err != nil { return VirtualMachinesReimagePollerResponse{}, err } result.Poller = &VirtualMachinesReimagePoller{ pt: pt, } return result, nil } // Reimage - Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published snapshot of the reference environment // of the lab. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) reimage(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginReimageOptions) (*http.Response, error) { req, err := client.reimageCreateRequest(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return nil, err } resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, client.reimageHandleError(resp) } return resp, nil } // reimageCreateRequest creates the Reimage request. func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginReimageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/reimage" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if labName == "" { return nil, errors.New("parameter labName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) if virtualMachineName == "" { return nil, errors.New("parameter virtualMachineName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualMachineName}", url.PathEscape(virtualMachineName)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-11-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil } // reimageHandleError handles the Reimage error response. func (client *VirtualMachinesClient) reimageHandleError(resp *http.Response) error { body, err := runtime.Payload(resp) if err != nil { return runtime.NewResponseError(err, resp) } errType := ErrorResponse{raw: string(body)} if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) } return runtime.NewResponseError(&errType, resp) } // BeginResetPassword - Resets a lab virtual machine password. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) BeginResetPassword(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, body ResetPasswordBody, options *VirtualMachinesBeginResetPasswordOptions) (VirtualMachinesResetPasswordPollerResponse, error) { resp, err := client.resetPassword(ctx, resourceGroupName, labName, virtualMachineName, body, options) if err != nil { return VirtualMachinesResetPasswordPollerResponse{}, err } result := VirtualMachinesResetPasswordPollerResponse{ RawResponse: resp, } pt, err := armruntime.NewPoller("VirtualMachinesClient.ResetPassword", "location", resp, client.pl, client.resetPasswordHandleError) if err != nil { return VirtualMachinesResetPasswordPollerResponse{}, err } result.Poller = &VirtualMachinesResetPasswordPoller{ pt: pt, } return result, nil } // ResetPassword - Resets a lab virtual machine password. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) resetPassword(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, body ResetPasswordBody, options *VirtualMachinesBeginResetPasswordOptions) (*http.Response, error) { req, err := client.resetPasswordCreateRequest(ctx, resourceGroupName, labName, virtualMachineName, body, options) if err != nil { return nil, err } resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, client.resetPasswordHandleError(resp) } return resp, nil } // resetPasswordCreateRequest creates the ResetPassword request. func (client *VirtualMachinesClient) resetPasswordCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, body ResetPasswordBody, options *VirtualMachinesBeginResetPasswordOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/resetPassword" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if labName == "" { return nil, errors.New("parameter labName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) if virtualMachineName == "" { return nil, errors.New("parameter virtualMachineName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualMachineName}", url.PathEscape(virtualMachineName)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-11-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, body) } // resetPasswordHandleError handles the ResetPassword error response. func (client *VirtualMachinesClient) resetPasswordHandleError(resp *http.Response) error { body, err := runtime.Payload(resp) if err != nil { return runtime.NewResponseError(err, resp) } errType := ErrorResponse{raw: string(body)} if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) } return runtime.NewResponseError(&errType, resp) } // BeginStart - Action to start a lab virtual machine. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginStartOptions) (VirtualMachinesStartPollerResponse, error) { resp, err := client.start(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return VirtualMachinesStartPollerResponse{}, err } result := VirtualMachinesStartPollerResponse{ RawResponse: resp, } pt, err := armruntime.NewPoller("VirtualMachinesClient.Start", "location", resp, client.pl, client.startHandleError) if err != nil { return VirtualMachinesStartPollerResponse{}, err } result.Poller = &VirtualMachinesStartPoller{ pt: pt, } return result, nil } // Start - Action to start a lab virtual machine. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return nil, err } resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, client.startHandleError(resp) } return resp, nil } // startCreateRequest creates the Start request. func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginStartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/start" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if labName == "" { return nil, errors.New("parameter labName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) if virtualMachineName == "" { return nil, errors.New("parameter virtualMachineName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualMachineName}", url.PathEscape(virtualMachineName)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-11-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil } // startHandleError handles the Start error response. func (client *VirtualMachinesClient) startHandleError(resp *http.Response) error { body, err := runtime.Payload(resp) if err != nil { return runtime.NewResponseError(err, resp) } errType := ErrorResponse{raw: string(body)} if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) } return runtime.NewResponseError(&errType, resp) } // BeginStop - Action to stop a lab virtual machine. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) BeginStop(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginStopOptions) (VirtualMachinesStopPollerResponse, error) { resp, err := client.stop(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return VirtualMachinesStopPollerResponse{}, err } result := VirtualMachinesStopPollerResponse{ RawResponse: resp, } pt, err := armruntime.NewPoller("VirtualMachinesClient.Stop", "location", resp, client.pl, client.stopHandleError) if err != nil { return VirtualMachinesStopPollerResponse{}, err } result.Poller = &VirtualMachinesStopPoller{ pt: pt, } return result, nil } // Stop - Action to stop a lab virtual machine. // If the operation fails it returns the *ErrorResponse error type. func (client *VirtualMachinesClient) stop(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, labName, virtualMachineName, options) if err != nil { return nil, err } resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, client.stopHandleError(resp) } return resp, nil } // stopCreateRequest creates the Stop request. func (client *VirtualMachinesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachinesBeginStopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/stop" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if labName == "" { return nil, errors.New("parameter labName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{labName}", url.PathEscape(labName)) if virtualMachineName == "" { return nil, errors.New("parameter virtualMachineName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualMachineName}", url.PathEscape(virtualMachineName)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-11-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil } // stopHandleError handles the Stop error response. func (client *VirtualMachinesClient) stopHandleError(resp *http.Response) error { body, err := runtime.Payload(resp) if err != nil { return runtime.NewResponseError(err, resp) } errType := ErrorResponse{raw: string(body)} if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) } return runtime.NewResponseError(&errType, resp) }
45.137931
274
0.765279
5a78618fb227533229d69db09430d71793cd3993
290
ps1
PowerShell
Scripts/2-Content-service.ps1
Muthuramana/mk-spike-web-ui-options-aspcore
e2384cf326eddf2a0b752a4327f95f8a20a536b6
[ "MIT" ]
null
null
null
Scripts/2-Content-service.ps1
Muthuramana/mk-spike-web-ui-options-aspcore
e2384cf326eddf2a0b752a4327f95f8a20a536b6
[ "MIT" ]
null
null
null
Scripts/2-Content-service.ps1
Muthuramana/mk-spike-web-ui-options-aspcore
e2384cf326eddf2a0b752a4327f95f8a20a536b6
[ "MIT" ]
1
2018-05-23T16:26:37.000Z
2018-05-23T16:26:37.000Z
$currentloc = [string](Get-Location) try { $parentloc = (Get-Item $currentloc).Parent.Parent.Parent.FullName Set-Location $parentloc\ContentService\SitefinityMicroservice\DFC.Sitefinity.MicroService.API docker-compose -p dfcspike up -d } finally { Set-Location $currentloc }
26.363636
97
0.755172
3977c37353f7705d1cc964a61ec2129c2793abc3
432
html
HTML
examples/more/index.html
cubsdiary/ts-axios
88ff9033381c0f79c84da9a0e69c6ebb735901ca
[ "MIT" ]
1
2020-02-03T14:07:10.000Z
2020-02-03T14:07:10.000Z
examples/more/index.html
cubsdiary/ts-axios
88ff9033381c0f79c84da9a0e69c6ebb735901ca
[ "MIT" ]
null
null
null
examples/more/index.html
cubsdiary/ts-axios
88ff9033381c0f79c84da9a0e69c6ebb735901ca
[ "MIT" ]
null
null
null
<!-- * @Author: yangjingpuyu@aliyun.com * @Date: 2020-03-30 21:37:10 * @LastEditors: yangjingpuyu@aliyun.com * @LastEditTime: 2020-04-21 23:10:39 * @FilePath: /ts-axios/examples/more/index.html * @Description: Do something ... --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>More example</title> </head> <body> <script src="/__build__/more.js"></script> </body> </html>
24
48
0.62037
e84c4feb1d44950d7b710bfd7f80a20cb22ede3b
492
cpp
C++
S6/CAA/codCad/14.cpp
williamvitorino3/IFCE
9108406a36a56ab332a1021b81e77f385eda2f25
[ "Apache-2.0" ]
null
null
null
S6/CAA/codCad/14.cpp
williamvitorino3/IFCE
9108406a36a56ab332a1021b81e77f385eda2f25
[ "Apache-2.0" ]
null
null
null
S6/CAA/codCad/14.cpp
williamvitorino3/IFCE
9108406a36a56ab332a1021b81e77f385eda2f25
[ "Apache-2.0" ]
null
null
null
#include <cstdio> #include <cstdlib> typedef struct time { int vitorias; int empates; int saldo; } Time; int main(int argc, char const *argv[]) { Time F, C; scanf("%d %d %d %d %d %d", &C.vitorias, &C.empates, &C.saldo, &F.vitorias, &F.empates, &F.saldo); printf("%c\n", (C.vitorias*3+C.empates > F.vitorias*3+F.empates ? 'C' : (C.vitorias*3+C.empates < F.vitorias*3+F.empates ? 'F' : (C.saldo > F.saldo ? 'C' : (C.saldo < F.saldo ? 'F' : '='))))); return 0; }
27.333333
196
0.573171
70b50c4d351acd0340189d81a849eec8716aa4d2
176
cshtml
C#
WebfrontCore/Views/Shared/Components/PenaltyList/_List.cshtml
Frankity/IW4M-Admin
515443c84a574944e946d3691a4682d916fd582e
[ "MIT" ]
null
null
null
WebfrontCore/Views/Shared/Components/PenaltyList/_List.cshtml
Frankity/IW4M-Admin
515443c84a574944e946d3691a4682d916fd582e
[ "MIT" ]
null
null
null
WebfrontCore/Views/Shared/Components/PenaltyList/_List.cshtml
Frankity/IW4M-Admin
515443c84a574944e946d3691a4682d916fd582e
[ "MIT" ]
null
null
null
@{ Layout = null; } @model List<SharedLibraryCore.Dtos.PenaltyInfo> @{ foreach (var penalty in Model) { Html.RenderPartial("_Penalty", penalty); } }
16
48
0.607955