blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
fe839c72a410c389672a993626710fcae81b1b02
a36fdf72ed460dbdac45f0c28b521218196066d7
/web-module/src/test/java/com/gmail/yauheniylebedzeu/web/controller/api/OrderAPISecurityTest.java
054c54c9ad3d07417ad979eb4f4ef103877e00c1
[]
no_license
yauheni-lebedzeu/JavaEE_Final_Project
4959311898fecf9069cd03dc24fe6140247f554e
a018bb998faff09e833cc49b4004261923f99397
refs/heads/develop
2023-05-26T14:52:05.612615
2021-06-05T14:27:17
2021-06-05T14:27:17
362,118,767
0
0
null
2021-06-05T14:31:59
2021-04-27T13:17:30
Java
UTF-8
Java
false
false
5,610
java
package com.gmail.yauheniylebedzeu.web.controller.api; import com.gmail.yauheniylebedzeu.service.OrderService; import com.gmail.yauheniylebedzeu.service.converter.impl.BindingResultConverterImpl; import com.gmail.yauheniylebedzeu.web.configuration.TestUserDetailsConfig; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc; import static com.gmail.yauheniylebedzeu.web.constant.TestConstant.TEST_UUID; import static com.gmail.yauheniylebedzeu.web.controller.constant.ControllerUrlConstant.API_CONTROLLER_URL; import static com.gmail.yauheniylebedzeu.web.controller.constant.ControllerUrlConstant.ARTICLES_CONTROLLER_URL; import static com.gmail.yauheniylebedzeu.web.controller.constant.ControllerUrlConstant.ORDERS_CONTROLLER_URL; import static org.springframework.http.MediaType.APPLICATION_JSON; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @WebMvcTest(excludeAutoConfiguration = UserDetailsServiceAutoConfiguration.class, controllers = OrderAPIController.class) @Import({BindingResultConverterImpl.class, TestUserDetailsConfig.class}) public class OrderAPISecurityTest { public static final String CUSTOMER_USER_ROLE_NAME = "CUSTOMER_USER"; public static final String SALE_USER_ROLE_NAME = "SALE_USER"; @MockBean private OrderService orderService; @Autowired private MockMvc mockMvc; @Test void shouldVerifyThatUserWithRoleSecureRESTApiHasAccessToGetOrders() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL) .contentType(APPLICATION_JSON) .with(httpBasic("user", "1234")) ).andExpect(status().isOk()); } @Test void shouldVerifyThatUserWithWrongPasswordHasNoAccessToGetOrders() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL) .contentType(APPLICATION_JSON) .with(httpBasic("user", "5678")) ).andExpect(status().isUnauthorized()); } @Test void shouldVerifyThatUserWithAdminRoleHasNoAccessToGetOrders() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL) .contentType(APPLICATION_JSON) .with(httpBasic("admin", "1234")) ).andExpect(status().isForbidden()); } @Test @WithMockUser(roles = CUSTOMER_USER_ROLE_NAME) void shouldVerifyThatUserWithCustomerUserRoleHasNoAccessToGetOrders() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL) .contentType(APPLICATION_JSON) ).andExpect(status().isForbidden()); } @Test @WithMockUser(roles = SALE_USER_ROLE_NAME) void shouldVerifyThatUserWithSaleUserRoleHasNoAccessToGetOrders() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL) .contentType(APPLICATION_JSON) ).andExpect(status().isForbidden()); } @Test void shouldVerifyThatUserWithRoleSecureRESTApiHasAccessToGetOrder() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL + "/" + TEST_UUID) .contentType(APPLICATION_JSON) .with(httpBasic("user", "1234")) ).andExpect(status().isOk()); } @Test void shouldVerifyThatUserWithWrongPasswordHasNoAccessToGetOrder() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ARTICLES_CONTROLLER_URL + "/" + TEST_UUID) .contentType(APPLICATION_JSON) .with(httpBasic("user", "5678")) ).andExpect(status().isUnauthorized()); } @Test void shouldVerifyThatUserWithAdminRoleHasNoAccessToGetOrder() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL + "/" + TEST_UUID) .contentType(APPLICATION_JSON) .with(httpBasic("admin", "1234")) ).andExpect(status().isForbidden()); } @Test @WithMockUser(roles = CUSTOMER_USER_ROLE_NAME) void shouldVerifyThatUserWithCustomerUserRoleHasNoAccessToGetOrder() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL + "/" + TEST_UUID) .contentType(APPLICATION_JSON) ).andExpect(status().isForbidden()); } @Test @WithMockUser(roles = SALE_USER_ROLE_NAME) void shouldVerifyThatUserWithSaleUserRoleHasNoAccessToGetOrder() throws Exception { mockMvc.perform( get(API_CONTROLLER_URL + ORDERS_CONTROLLER_URL + "/" + TEST_UUID) .contentType(APPLICATION_JSON) ).andExpect(status().isForbidden()); } }
654120c7912689f5723c1fc76446f3be00b399eb
f156765f52139bf645ca4919fc07ca0898fa40f8
/app/src/main/java/com/psx/androidcourseproject/tabFragments/LeftFragment.java
18082c1bcad07bd8c569dc7ef72961cb5c38af35
[ "MIT" ]
permissive
psx95/TestVideos2
a1f43e4de6f6994c24e89fb775555935f2bf2186
968a5020a541571aa1dad0fce169f7ab5749cebf
refs/heads/master
2021-01-09T06:35:32.087961
2017-10-18T14:33:22
2017-10-18T14:33:22
81,011,587
0
0
null
2017-10-18T14:33:23
2017-02-05T18:12:58
Java
UTF-8
Java
false
false
8,230
java
package com.psx.androidcourseproject.tabFragments; import android.app.ProgressDialog; import android.content.Context; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.Toast; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.android.volley.toolbox.Volley; import com.google.android.youtube.player.YouTubePlayerFragment; import com.psx.androidcourseproject.Adapters.NewVideosAdapter; import com.psx.androidcourseproject.Config; import com.psx.androidcourseproject.Helper.AppController; import com.psx.androidcourseproject.R; import com.psx.androidcourseproject.model.VideoCard; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; public class LeftFragment extends Fragment { private AppCompatActivity appCompatActivity; private RecyclerView recyclerView; private NewVideosAdapter newVideosAdapter; private List<VideoCard> videoCards = new ArrayList<>(); private List<VideoCard> cards = new ArrayList<>(); private SwipeRefreshLayout swipeRefreshLayout; private JSONArray jsonArray; private JSONObject jsonObject; private VideoCard videoCard; private Context context; private Button button; private RequestQueue requestQueue ; // for commit public static final String url = "https://www.googleapis.com/youtube/v3/search?key=AIzaSyCzQJQPSPIqnou4AwreMLlch1cr4SHf1qw&channelId=UCJ5v_MCY6GNUBTO8-D3XoAg&part=snippet&maxResults=10"; public LeftFragment() { // Required empty public constructor } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); appCompatActivity = (AppCompatActivity) getActivity(); context = appCompatActivity.getApplicationContext(); requestQueue = Volley.newRequestQueue(context); populateCards(); button = (Button) appCompatActivity.findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { makeJSONArrayRequest(); for (int i = 0;i<cards.size();i++){ //Toast.makeText(context,cards.get(i).getVideo_code(),Toast.LENGTH_SHORT).show(); Log.d("LIST CODES",cards.get(i).getVideo_code()); } } }); swipeRefreshLayout = (SwipeRefreshLayout) appCompatActivity.findViewById(R.id.swipe_refresh_view); swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { // update teh recyclerview refreshContent(); Log.d("REFRESH","REFRESH Finished"); } }); //makeJSONArrayRequest(); new JSONFetch().execute(); recyclerView = (RecyclerView) appCompatActivity.findViewById(R.id.recycler_new_videos); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context); linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); recyclerView.setLayoutManager(linearLayoutManager); //recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); newVideosAdapter = new NewVideosAdapter(cards,getContext()); recyclerView.setAdapter(newVideosAdapter); } public void makeJSONArrayRequest (){ JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { try { jsonArray = response.getJSONArray("items"); if (jsonArray.length() == 0){ Log.d("ERROR","List is empty"); } else { for (int i =0;i<jsonArray.length();i++){ jsonObject = jsonArray.getJSONObject(i); videoCard = new VideoCard(jsonObject.getJSONObject("id").getString("videoId")); videoCard.setVideo_title(jsonObject.getJSONObject("snippet").getString("title")); cards.add(videoCard); } } } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(context,"Some Error has Occoured. Please try again.",Toast.LENGTH_LONG).show(); } }); requestQueue.add(jsonObjectRequest); } public class JSONFetch extends AsyncTask <Void,Void,Void> { private ProgressDialog progressDialog = new ProgressDialog(appCompatActivity); @Override protected Void doInBackground(Void... voids) { makeJSONArrayRequest(); return null; } @Override protected void onPreExecute() { super.onPreExecute(); Log.d("LeftFragment","preexecute"); //progressDialog = new ProgressDialog(getActivity()); progressDialog.setMessage("Fetching the latest videos"); progressDialog.setCancelable(false); progressDialog.show(); } @Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); Log.d("LeftFragment","postexecute"); if (cards!=null){ Log.d("LeftFragment","cards not null"); newVideosAdapter = new NewVideosAdapter(cards,context); recyclerView.setAdapter(newVideosAdapter); } else { Log.d("LeftFragment","cards were null"); populateCards(); newVideosAdapter = new NewVideosAdapter(videoCards,context); recyclerView.setAdapter(newVideosAdapter); } progressDialog.dismiss(); } } public void refreshContent (){ new Handler().postDelayed(new Runnable() { @Override public void run() { videoCards.clear(); populateCards(); //cards.clear(); // makeJSONArrayRequest(); newVideosAdapter = new NewVideosAdapter(videoCards,getContext()); recyclerView.setAdapter(newVideosAdapter); swipeRefreshLayout.setRefreshing(false); } },4000); } // function to populate the vide cards public void populateCards () { /*for (int i = 0 ;i<3;i++){ videoCards.add(new VideoCard()); }*/ new JSONFetch().execute(); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_left, container, false); } @Override public void onAttach(Context context) { super.onAttach(context); } @Override public void onResume() { super.onResume(); } @Override public void onDetach() { super.onDetach(); } }
1f34ae17720f909169d9c1a68cb3568e30030bd6
7af928921898828426b7af6eff4dd9b7e4252817
/platforms/android-28/android-stubs-src/file/android/graphics/drawable/shapes/ArcShape.java
35b38309af439a385165514bc249e0472ab0170f
[]
no_license
Davidxiahao/RAPID
40c546a739a818a6562d0c9bce5df9f1a462d92b
e99f46155a2f3e6b84324ba75ecd22a278ba7167
refs/heads/master
2023-06-27T13:09:02.418736
2020-03-06T01:38:16
2020-03-06T01:38:16
239,509,129
0
0
null
null
null
null
UTF-8
Java
false
false
2,194
java
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.graphics.drawable.shapes; import android.graphics.Canvas; import android.graphics.Paint; /** * Creates an arc shape. The arc shape starts at a specified angle and sweeps * clockwise, drawing slices of pie. * <p> * The arc can be drawn to a {@link Canvas} with its own * {@link #draw(Canvas, Paint)} method, but more graphical control is available * if you instead pass the ArcShape to a * {@link android.graphics.drawable.ShapeDrawable}. */ @SuppressWarnings({"unchecked", "deprecation", "all"}) public class ArcShape extends android.graphics.drawable.shapes.RectShape { /** * ArcShape constructor. * * @param startAngle the angle (in degrees) where the arc begins * @param sweepAngle the sweep angle (in degrees). Anything equal to or * greater than 360 results in a complete circle/oval. */ public ArcShape(float startAngle, float sweepAngle) { throw new RuntimeException("Stub!"); } /** * @return the angle (in degrees) where the arc begins */ public final float getStartAngle() { throw new RuntimeException("Stub!"); } /** * @return the sweep angle (in degrees) */ public final float getSweepAngle() { throw new RuntimeException("Stub!"); } public void draw(android.graphics.Canvas canvas, android.graphics.Paint paint) { throw new RuntimeException("Stub!"); } public void getOutline(android.graphics.Outline outline) { throw new RuntimeException("Stub!"); } public android.graphics.drawable.shapes.ArcShape clone() throws java.lang.CloneNotSupportedException { throw new RuntimeException("Stub!"); } }
594bf62c0a1c16375c08f7128016d8e613bad75c
81d7654b08c3f34be35351a5532348e455e5acd5
/java/projects/bullsfirst-oms-common/bfoms-common-domain/src/main/java/org/archfirst/bfoms/domain/marketdata/MarketDataAdapter.java
b8c0cd08d4e45a2e5971df87fae888f61b889eb2
[]
no_license
popbones/archfirst
832f036ab7c948e5b2fc70dd627374280d9f8f0e
89e6ed128a01cb7fe422fa8e5925a61a2edfdb5d
refs/heads/master
2021-01-10T06:18:26.497760
2014-03-02T06:53:37
2014-03-02T06:53:37
43,199,746
1
0
null
null
null
null
UTF-8
Java
false
false
872
java
/** * Copyright 2010 Archfirst * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.archfirst.bfoms.domain.marketdata; import java.util.List; /** * Adapter for getting market data from an external source * * @author Naresh Bhatia */ public interface MarketDataAdapter { List<MarketPrice> getMarketPrices(); }
[ "[email protected]@5f1d654b-2d44-f8f1-813d-ae2f855fe689" ]
[email protected]@5f1d654b-2d44-f8f1-813d-ae2f855fe689
12ff3a99ac27db4cca640074c0f0df27cdc65cc2
e7bf01082d34560c999af134320438d1f382c80f
/viikko3/LoginEasyBv1/src/main/java/ohtu/App.java
5df794ba31659eadae128e5bfd6ade889825f68c
[]
no_license
sasumaki/ohtu2016
f8d2375be05f407c1f9b9e8c14b9e9a7b6fb04fb
cf5169f8632fb2828394651a9fa8eb8b88f36693
refs/heads/master
2021-01-17T08:23:15.444961
2016-05-09T14:25:37
2016-05-09T14:25:37
54,116,388
0
0
null
2016-03-17T12:34:19
2016-03-17T12:34:19
null
UTF-8
Java
false
false
2,360
java
package ohtu; import ohtu.data_access.InMemoryUserDao; import ohtu.data_access.UserDao; import ohtu.io.ConsoleIO; import ohtu.io.IO; import ohtu.services.AuthenticationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import org.springframework.stereotype.Component; @Component public class App { private IO io; private AuthenticationService auth; @Autowired public App(IO io, AuthenticationService auth) { this.io = io; this.auth = auth; } public String[] ask() { String[] userPwd = new String[2]; userPwd[0] = io.readLine("username:"); userPwd[1] = io.readLine("password:"); return userPwd; } public void run() { while (true) { String command = io.readLine(">"); if (command.isEmpty()) { break; } if (command.equals("new")) { String[] usernameAndPasword = ask(); if (auth.createUser(usernameAndPasword[0], usernameAndPasword[1])) { io.print("new user registered"); } else { io.print("new user not registered"); } } else if (command.equals("login")) { String[] usernameAndPasword = ask(); if (auth.logIn(usernameAndPasword[0], usernameAndPasword[1])) { io.print("logged in"); } else { io.print("wrong username or password"); } } } } public static void main(String[] args) { ApplicationContext ctx = new FileSystemXmlApplicationContext("src/main/resources/spring-context.xml"); App application = ctx.getBean(App.class); application.run(); } // testejä debugatessa saattaa olla hyödyllistä testata ohjelman ajamista // samoin kuin testi tekee, eli injektoimalla käyttäjän syötteen StubIO:n avulla // // UserDao dao = new InMemoryUserDao(); // StubIO io = new StubIO("new", "eero", "sala1nen" ); // AuthenticationService auth = new AuthenticationService(dao); // new App(io, auth).run(); // System.out.println(io.getPrints()); }
0e4651754fd17711e1258ef3387e17b9cb638fb1
85710a7d28c9b0fa3de0f0a122078db9e7674898
/oopPart1/src/interfacesETC/package-info.java
e7fffe6e379b5a0a9926abe1b3e5c5117c7c4715
[]
no_license
sebaschi/learning
cae9866be8056b011e19f7042d1b0bebabdae53f
f3137c754aa7e4bc43e2668d5d88a97f14172ea0
refs/heads/master
2023-02-23T08:52:00.982932
2021-01-27T17:58:22
2021-01-27T17:58:22
314,531,663
0
0
null
null
null
null
UTF-8
Java
false
false
22
java
package interfacesETC;
1928fc3a88a06f6cdf2c99b140bac804ab12f958
fe0ef89aac4e5376a7f549500d7a80e510e4e447
/Spring-11-Rest-Jeckson/src/main/java/com/jackson/enums/MovieType.java
f7c193fecbcba1754a72a9fbaf752aeffa8000ed
[]
no_license
nicolaevpetru/spring-framework
3b593f50ae945703e524fed1e35d5bc68ca17e5b
71e4d0049499596f8e819d7441cb8de1f9b72642
refs/heads/main
2023-03-16T13:48:07.276864
2021-03-06T19:01:46
2021-03-06T19:01:46
304,899,044
0
0
null
null
null
null
UTF-8
Java
false
false
75
java
package com.jackson.enums; public enum MovieType { PREMIER,REGULAR; }
18719bdb256772df7d0d38d281ae23c5767f9c16
7443cad6728a78e81ff18dfe95349044129c47b4
/src/skylight-commons-core/src/test/java/br/skylight/commons/FixedListTest.java
cc5652daadee150afa1340b17d13db6a0a694112
[ "MIT" ]
permissive
nibbleshift/skylight-uas
c78e022248a81e635f6ae13bc7fa9a7569eb29ec
d9be7a377ebd25bbf00aac857309a310d5121255
refs/heads/master
2021-05-21T03:48:19.477508
2020-04-02T18:12:01
2020-04-02T18:12:01
252,528,996
0
1
MIT
2020-04-02T17:59:33
2020-04-02T17:59:32
null
UTF-8
Java
false
false
1,755
java
package br.skylight.commons; import br.skylight.commons.infra.FixedList; public class FixedListTest { public static void main(String[] args) { FixedList<Integer> l = new FixedList<Integer>(5); if(l.getSize()!=0) throw new AssertionError("OPS!"); l.addItem(1); if(l.getSize()!=1) throw new AssertionError("OPS!"); if(l.getItem(0)!=1) throw new AssertionError("OPS!"); l.addItem(2); l.addItem(3); if(l.getSize()!=3) throw new AssertionError("OPS!"); if(l.getItem(0)!=1) throw new AssertionError("OPS!"); if(l.getItem(1)!=2) throw new AssertionError("OPS!"); if(l.getItem(2)!=3) throw new AssertionError("OPS!"); l.addItem(4); l.addItem(5); if(l.getSize()!=5) throw new AssertionError("OPS!"); if(l.getItem(0)!=1) throw new AssertionError("OPS!"); if(l.getItem(1)!=2) throw new AssertionError("OPS!"); if(l.getItem(2)!=3) throw new AssertionError("OPS!"); if(l.getItem(3)!=4) throw new AssertionError("OPS!"); if(l.getItem(4)!=5) throw new AssertionError("OPS!"); l.addItem(6); if(l.getItem(0)!=2) throw new AssertionError("OPS!"); if(l.getItem(1)!=3) throw new AssertionError("OPS!"); if(l.getItem(2)!=4) throw new AssertionError("OPS!"); if(l.getItem(3)!=5) throw new AssertionError("OPS!"); if(l.getItem(4)!=6) throw new AssertionError("OPS!"); if(l.getSize()!=5) throw new AssertionError("OPS!"); l.addItem(7); if(l.getItem(0)!=3) throw new AssertionError("OPS!"); if(l.getItem(1)!=4) throw new AssertionError("OPS!"); if(l.getItem(2)!=5) throw new AssertionError("OPS!"); if(l.getItem(3)!=6) throw new AssertionError("OPS!"); if(l.getItem(4)!=7) throw new AssertionError("OPS!"); if(l.getSize()!=5) throw new AssertionError("OPS!"); } }
f08fc5f7bcd5f6c1542dbadbf89367d6ec07f516
e57ef1b81d5e30a64aab25b1c588a7fd7d9ebd2a
/Bai_6_Inheritance/BaiTap/Cylinder.java
dd692f73df01e4c8a2e58fc4b8b1beecce20e538
[]
no_license
nguyenanhtam2608/C0821G1-NGUYENANHTAM-module2
0bd62e8a35d1a10f4817e665f712a27a215c69d5
e7283dca9d40d12e8ca3a465f7839f2b24ba145a
refs/heads/main
2023-08-28T15:43:49.334193
2021-11-08T09:17:02
2021-11-08T09:17:02
412,359,072
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package bai_6_inheritance.baitap; class Cylinder extends Circle { private double height = 10; Cylinder() { } Cylinder(double height) { this.height = height; } Cylinder(double radius, String color, double height) { super(radius, color); this.height = height; } public double getHeight() { return height; } public void setHeight(double height) { this.height = height; } public double getVolume() { return this.area * this.height; } public String toString() { return "Hình trụ : màu sắc " + getColor() + " bán kính " + getRadius() + " Chiều cao " + getHeight() + " Diện tích đáy " + getArea() + " Thể tích " + getVolume() + "\n" + super.toString(); } public static void main(String[] args) { Cylinder cylinder = new Cylinder(); System.out.println(cylinder); cylinder = new Cylinder(40); System.out.println(cylinder); } }
35ce3a14b614eb2de179126fcb7e7b3561dad0c7
477781f9346c956597cfc46f8d1cb559ff179474
/jnetwork/src/main/java/top/jplayer/networklibrary/net/interceptor/JsonFixInterceptor.java
90a813ad1d99b6a12ae2a97c9caac164aba1fbf7
[]
no_license
CleverMod/jnetwork
31afd4bd0a44b0a676e75bf2271d6b77375cc12c
8efeeb4b06491d48b5405d460a7e58cd9b78b428
refs/heads/master
2023-04-19T16:24:16.852574
2021-01-30T10:03:14
2021-01-30T10:03:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,193
java
package top.jplayer.networklibrary.net.interceptor; import androidx.annotation.NonNull; import java.io.IOException; import java.nio.charset.Charset; import okhttp3.Interceptor; import okhttp3.MediaType; import okhttp3.Request; import okhttp3.Response; import okhttp3.ResponseBody; import okio.Buffer; import okio.BufferedSource; /** * Created by Administrator on 2018/1/26. * json 解析自定义,如果返回的Json并不是规范的,可自行修改 method: getJsonBody(String sting) */ public class JsonFixInterceptor implements Interceptor { private static final Charset UTF8 = Charset.forName("UTF-8"); @Override public Response intercept(@NonNull Chain chain) throws IOException { Request request = chain.request(); Response response = chain.proceed(request); response = decrypt(response); return response; } private Response decrypt(Response response) throws IOException { if (response.isSuccessful()) { ResponseBody body = response.body(); if (body != null) { BufferedSource source = body.source(); source.request(Long.MAX_VALUE); // Buffer the entire body. Buffer buffer = source.buffer(); MediaType contentType = body.contentType(); if (contentType != null && contentType.type().contains("json")) {//判断是否是json类型 String string = buffer.clone().readString(UTF8); String bodyString = getJsonBody(string); ResponseBody responseBody = ResponseBody.create(contentType, bodyString); response = response.newBuilder().body(responseBody).build(); } } return response; } return response; } /** * @param string 原生body * @return 修复的body */ @NonNull public String getJsonBody(String string) { String bodyString = string; if (string.contains("(") && string.contains(")")) { bodyString = string.substring(string.indexOf("(") + 1, string.lastIndexOf(")")); } return bodyString; } }
38705da99bd6aed00ad69374a7a77bbbec71e471
8eb8c0f47a2566c5ab54490a8166d0ee6b586ff0
/app/src/main/java/org/zhenghao/mvp/model/bean/NoticeListBean.java
dc8edef5233823b936ccc9a95f52597c327ef2b3
[]
no_license
A-fliga/zhenghao
3f50837cee33f1273fed74d8289156112f95f678
d9dcf82fae19110bd1fd4d0457cd0c76467e612d
refs/heads/master
2021-09-06T11:53:19.019414
2018-02-06T08:04:21
2018-02-06T08:04:21
117,769,705
0
0
null
null
null
null
UTF-8
Java
false
false
2,002
java
package org.zhenghao.mvp.model.bean; import java.util.List; /** * Created by www on 2018/1/9. */ public class NoticeListBean { /** * result : [{"informFor":1,"publishTime":1514872270000,"id":1,"synopsis":"简介1","title":"标题1"}] * msg : 操作成功! * code : 0 */ private String msg; private int code; private List<ResultBean> result; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public List<ResultBean> getResult() { return result; } public void setResult(List<ResultBean> result) { this.result = result; } public static class ResultBean { /** * informFor : 1 * publishTime : 1514872270000 * id : 1 * synopsis : 简介1 * title : 标题1 */ private int informFor; private long publishTime; private int id; private String synopsis; private String title; public int getInformFor() { return informFor; } public void setInformFor(int informFor) { this.informFor = informFor; } public long getPublishTime() { return publishTime; } public void setPublishTime(long publishTime) { this.publishTime = publishTime; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getSynopsis() { return synopsis; } public void setSynopsis(String synopsis) { this.synopsis = synopsis; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } }
3855c3493d70b9051adaccc6bb2523bbfcd2230a
c538bb08b4e5379556fcec89f10ea6eee116d3fc
/main/frc/src/main/java/frc/robot/subsystems/drive/DriveTrain.java
df8a61cdcc0a5e701bffaf3dbe9aabde2ad328ea
[]
no_license
vindang21/2020-code-2989
625f924d401138094bdb594780db13a9990312c2
7984658dd44f45fd25113ad38eca52c13b5dd89f
refs/heads/master
2021-02-11T10:02:33.452532
2020-03-02T21:59:01
2020-03-02T21:59:01
244,480,191
0
0
null
null
null
null
UTF-8
Java
false
false
2,023
java
package frc.robot.subsystems.drive; import edu.wpi.first.wpilibj.SpeedControllerGroup; import edu.wpi.first.wpilibj.drive.DifferentialDrive; import frc.robot.Robot; import frc.robot.RobotMap; import frc.robot.commands.TeleopDriveCommand; import frc.robot.model.StarSubsystem; import frc.robot.model.StarTalonSRX; public class DriveTrain extends StarSubsystem { private StarTalonSRX leftMotor1; private StarTalonSRX leftMotor2; private StarTalonSRX rightMotor1; private StarTalonSRX rightMotor2; private GTADrive drive; public DriveTrain() { loadSpeedControllers(); applySpeedControllerPreferences(); loadDrive(); } private void loadSpeedControllers() { leftMotor1 = new StarTalonSRX(RobotMap.DRIVETRAIN_MOTOR_LEFT_1); leftMotor2 = new StarTalonSRX(RobotMap.DRIVETRAIN_MOTOR_LEFT_2); rightMotor1 = new StarTalonSRX(RobotMap.DRIVETRAIN_MOTOR_RIGHT_1); rightMotor2 = new StarTalonSRX(RobotMap.DRIVETRAIN_MOTOR_RIGHT_2); } private void loadDrive() { drive = new GTADrive(new DifferentialDrive(new SpeedControllerGroup(leftMotor1, leftMotor2), new SpeedControllerGroup(rightMotor1, rightMotor2)), Robot.oi.getPrimaryJoystick(), RobotMap.OI_JOYSTICK_PRIMARY_LEFT_TRIGGER_PORT, RobotMap.OI_JOYSTICK_PRIMARY_RIGHT_TRIGGER_PORT, RobotMap.OI_JOYSTICK_PRIMARY_LEFT_Y_AXIS_PORT, RobotMap.OI_JOYSTICK_PRIMARY_RIGHT_X_AXIS_PORT); } private void applySpeedControllerPreferences() { leftMotor1.setMaxOutputFunction(() -> RobotMap.LEFT_MAX_OUTPUT); leftMotor2.setMaxOutputFunction(() -> RobotMap.LEFT_MAX_OUTPUT); rightMotor1.setMaxOutputFunction(() -> RobotMap.RIGHT_MAX_OUTPUT); rightMotor2.setMaxOutputFunction(() -> RobotMap.RIGHT_MAX_OUTPUT); } @Override protected void initDefaultCommand() { setDefaultCommand(new TeleopDriveCommand()); } public GTADrive getDrive() { return drive; } }
9a1419e105e908aa877e54409fc5e19eb90bc715
9ad413c25df4967a48ee162b61fbe737fe9e4521
/src/main/java/com/gilvano/statusservicosnfe/service/impl/ConsultaStatusServicosServiceImpl.java
c9d9d14b286344852657ad98942ea4568ebe5fdf
[]
no_license
gilvano/StatusServicosNfe
f858cbbf38ecb7cf8171133ec078c610e73f5152
4af604cf183ddf4da52fb1942ff3ef37931e8649
refs/heads/master
2023-08-21T16:54:46.135188
2021-10-07T17:40:10
2021-10-07T17:40:10
413,217,161
0
0
null
null
null
null
UTF-8
Java
false
false
2,254
java
package com.gilvano.statusservicosnfe.service.impl; import com.gilvano.statusservicosnfe.DTO.AutorizadorStatus; import com.gilvano.statusservicosnfe.model.StatusOffLineOnLine; import com.gilvano.statusservicosnfe.service.ConsultaStatusServicosService; import lombok.extern.log4j.Log4j2; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.springframework.stereotype.Service; import java.io.IOException; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Optional; @Service @Log4j2 public class ConsultaStatusServicosServiceImpl implements ConsultaStatusServicosService { private final String STATUS_ONLINE = "imagens/bola_verde_P.png"; private Document doc; private Element table; private Elements rows; @Override public Optional<List<AutorizadorStatus>> consultarStatusServicos() throws IOException { List<AutorizadorStatus> servicos = new ArrayList<>(); carregarSite(); carregarTabelaListagemDados(); carregarLinhas(); for (int i = 1; i < rows.size(); i++) { //first row is the col names so skip it. servicos.add(buscarStatusAutorizador(i)); } return Optional.of(servicos); } private AutorizadorStatus buscarStatusAutorizador(int i) { Element row = rows.get(i); Elements cols = row.select("td"); String status = cols.get(5).getElementsByTag("img").first().attr("src"); return AutorizadorStatus.builder() .autorizador(cols.get(0).text()) .status(status.equals(STATUS_ONLINE)? StatusOffLineOnLine.ON_LINE.getValue() : StatusOffLineOnLine.OFF_LINE.getValue()) .dataStatus(LocalDateTime.now()) .build(); } private void carregarSite() throws IOException { doc = Jsoup.connect("http://www.nfe.fazenda.gov.br/portal/disponibilidade.aspx") .timeout(30000) .get(); } private void carregarTabelaListagemDados() { table = doc.getElementsByClass("tabelaListagemDados").first(); } private void carregarLinhas() { rows = table.select("tr"); } }
1d7364253d786b0bf177b6192fb0398a4c33656c
2b930c69fbfb2f666f2868cfa25a739f6cc16e26
/src/main/java/com/cgi/uswest/chimpls/portalweb/objects/Episode.java
85cb4f3afcf158f3256f571406a230fcdc89189b
[]
no_license
cgi-uswest-chimpls/portalweb
c4d63f60fcbd93ea0c98313a4c7d6a609f08314f
c5e3f03a06008567e20cbb86f36278791ab0b8ad
refs/heads/master
2020-03-19T14:00:36.775281
2019-09-10T18:53:21
2019-09-10T18:53:21
136,604,560
0
0
null
null
null
null
UTF-8
Java
false
false
1,876
java
package com.cgi.uswest.chimpls.portalweb.objects; import java.math.BigDecimal; import java.sql.Timestamp; public class Episode { private String idepsd; private String idprsn; private BigDecimal amrate; private String idprvdorg; private Timestamp dtbgn; private Timestamp dtend; private Timestamp dtrmvl; private String flrmvl; private String idcase; Episode() {} public Episode(String idepsd, String idprsn, BigDecimal amrate, String idprvdorg, Timestamp dtbgn, Timestamp dtend, Timestamp dtrmvl, String flrmvl, String idcase) { super(); this.idepsd = idepsd; this.idprsn = idprsn; this.amrate = amrate; this.idprvdorg = idprvdorg; this.dtbgn = dtbgn; this.dtend = dtend; this.dtrmvl = dtrmvl; this.flrmvl = flrmvl; this.idcase = idcase; } public String getIdepsd() { return idepsd; } public void setIdEpsd(String idepsd) { this.idepsd = idepsd; } public String getIdprsn() { return idprsn; } public void setIdprsn(String idprsn) { this.idprsn = idprsn; } public BigDecimal getAmrate() { return amrate; } public void setAmrate(BigDecimal amrate) { this.amrate = amrate; } public String getIdprvdorg() { return idprvdorg; } public void setIdprvdorg(String idprvdorg) { this.idprvdorg = idprvdorg; } public Timestamp getDtbgn() { return dtbgn; } public void setDtbgn(Timestamp dtbgn) { this.dtbgn = dtbgn; } public Timestamp getDtend() { return dtend; } public void setDtend(Timestamp dtend) { this.dtend = dtend; } public Timestamp getDtrmvl() { return dtrmvl; } public void setDtrmvl(Timestamp dtrmvl) { this.dtrmvl = dtrmvl; } public String getFlrmvl() { return flrmvl; } public void setFlrmvl(String flrmvl) { this.flrmvl = flrmvl; } public String getIdcase() { return idcase; } public void setIdcase(String idcase) { this.idcase = idcase; } }
aa0de30e6c1a889d9bf6d7d859b493abd9fa2b5e
668a813cb3729a7e219657e9fa059691c1a1e78a
/src/accessModifiers/A.java
368d433fd954b83b1b6321cbfadca65711b2a8e1
[]
no_license
anilchitturi/Batch3
cfabb8cf1aa3e9a1158a38b7894d8df69c90d7b4
ae81ce362ab85135756b3a58073c51cbd08e1f08
refs/heads/master
2021-01-15T14:43:06.542678
2015-01-06T04:25:02
2015-01-06T04:25:02
28,699,466
0
0
null
null
null
null
UTF-8
Java
false
false
450
java
package accessModifiers; public class A { private int data=40; protected void msg(int xy){ System.out.println("Hello jzava"); } protected void msg(String xy){ System.out.println("Hello jzava"); } protected void msg(float xy){ System.out.println("Hello jzava"); } private void msg1(){ System.out.println("Hello msg1"); } void msg2(){ System.out.println("Hello msg2"); } protected void msg3(){ System.out.println("Hello msg3"); } }
dc11683e5f04d4100886893cd9a77e161754e7f4
2342b47d19a403f02699690de36d6dc21c0da56e
/client/android/androidapp/src/de/fu_berlin/inf/xmlprojectapp/info/PictureFragment.java
0f8df388e751427e3ac574e99a1ec4d7bb25097f
[]
no_license
fub-frank/ss14xml
e2295f5aff148808b8ea7dff8b5f088098e07a71
bd5409dbefa63042af28154c1ac3e3d1646e45bd
refs/heads/master
2016-09-02T01:38:41.190238
2014-07-21T16:54:58
2014-07-21T16:54:58
22,068,833
0
0
null
null
null
null
UTF-8
Java
false
false
7,244
java
package de.fu_berlin.inf.xmlprojectapp.info; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import android.app.Dialog; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Point; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.util.Base64; import android.view.Display; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.HorizontalScrollView; import android.widget.ImageView; import android.widget.LinearLayout; import de.fu_berlin.inf.xmlprojectapp.R; import de.fu_berlin.inf.xmlprojectapp.content.historic.HistoricContentDelivery; import de.fu_berlin.inf.xmlprojectapp.content.historic.serialisation.HistoricImage; import de.fu_berlin.inf.xmlprojectapp.content.historic.serialisation.HistoricMetadata; public class PictureFragment extends DialogFragment { private String flickerid; private String filename; private int imagecount; private boolean keep_activity_alive; public static PictureFragment newInstance(String flickerid, String filename, int imagecount) { PictureFragment f = new PictureFragment(); Bundle args = new Bundle(); args.putString("flickerid", flickerid); args.putString("filename", filename); args.putInt("imagecount", imagecount); f.setArguments(args); f.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.CustomDialog); return f; } @Override public void onDestroy() { super.onDestroy(); if(!keep_activity_alive) { this.getActivity().finish(); } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.flickerid = this.getArguments().getString("flickerid"); this.filename = this.getArguments().getString("filename"); this.imagecount = this.getArguments().getInt("imagecount"); this.keep_activity_alive = false; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = super.onCreateDialog(savedInstanceState); // dialog.setCanceledOnTouchOutside(true); return dialog; } private class MaximumSizedHorizontalScrollView extends HorizontalScrollView { private Point size; public MaximumSizedHorizontalScrollView(Context context) { super(context); size = new Point(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { WindowManager wm = (WindowManager) PictureFragment.this .getActivity().getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); display.getSize(size); widthMeasureSpec = MeasureSpec.makeMeasureSpec( (int) Math.floor(size.x * 0.8), MeasureSpec.AT_MOST); heightMeasureSpec = MeasureSpec.makeMeasureSpec( (int) Math.floor(size.y * 0.8), MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final HorizontalScrollView rootView = new MaximumSizedHorizontalScrollView( this.getActivity()); rootView.setLayoutParams(new FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT)); final LinearLayout scroll = new LinearLayout(this.getActivity()); scroll.setLayoutParams(new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); scroll.setOrientation(LinearLayout.HORIZONTAL); scroll.setAlpha(1.0f); rootView.addView(scroll); final HistoricContentDelivery content = new HistoricContentDelivery(); final ImageView[] images = new ImageView[PictureFragment.this.imagecount]; for(int i = 0; i < PictureFragment.this.imagecount; i += 1) { images[i] = (ImageView) new ImageView( PictureFragment.this.getActivity()); images[i].setLayoutParams(new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); scroll.addView(images[i]); content.getImageAsync( PictureFragment.this.filename, 1 + i, new HistoricContentDelivery.Callback<java.util.Map.Entry<Integer, HistoricImage>>() { @Override public void process( java.util.Map.Entry<Integer, HistoricImage> arg) { ByteArrayInputStream is = new ByteArrayInputStream( Base64.decode(arg.getValue().data, Base64.DEFAULT)); Bitmap bitmap = BitmapFactory.decodeStream(is); Point size = new Point(); PictureFragment.this.getActivity() .getWindowManager().getDefaultDisplay() .getSize(size); int j = arg.getKey() - 1; images[j].setAdjustViewBounds(true); images[j].setMaxWidth((int) Math .floor(size.x * 0.8)); images[j].setMaxHeight((int) Math .floor(size.y * 0.8)); images[j].setImageBitmap(bitmap); } }); images[i].setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { (new HistoricContentDelivery()) .getMetadataAsync( PictureFragment.this.flickerid, new HistoricContentDelivery.Callback<HistoricMetadata>() { @Override public void process(HistoricMetadata arg) { try { InputStream xsltStream = PictureFragment.this .getActivity() .getAssets() .open("xslt.xml"); java.util.Scanner scanner = new java.util.Scanner( xsltStream); scanner.useDelimiter("\\A"); String xslt = scanner.hasNext() ? scanner .next() : ""; scanner.close(); String xml = arg.xml; if(xml != null) { WebFragment web = WebFragment .newInstance(xml, xslt); web.show( PictureFragment.this .getActivity() .getSupportFragmentManager(), "info_activity"); } } catch(IOException e) { e.printStackTrace(); } } }); } }); } return rootView; } }
a958e7633756e9afac8c540bc5c911e269ba77de
efb9454dde5efcefba83984cd9cbaeebcecc83cc
/spring-dependency-injection/src/com/tcs/dao/TestDbNewApproach.java
163e6e6d2175c4f442edd986b150795a8871b0bd
[]
no_license
Rahul-S1/tcs-training-examples
8cf2cd4f5d3341161eaaf6df47e6627d433eaccf
42c4b932ad3d0de31c1805cf81bf5561da23d38f
refs/heads/master
2023-09-02T09:16:12.319057
2021-10-28T04:35:18
2021-10-28T04:35:18
419,964,874
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.tcs.dao; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class TestDbNewApproach { public static void main(String[] args) { // TODO Auto-generated method stub ApplicationContext context = new ClassPathXmlApplicationContext("spring-beans.xml"); Customerdao dao = (Customerdao)context.getBean("dao"); dao.connect(); ((ClassPathXmlApplicationContext)context).close(); ((ClassPathXmlApplicationContext)context).close(); } }
85063ada5880d81f60348b42f44c834e380adf94
e65f8735b6f38ce8d5d2a77f905a2331a1a4d646
/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
dd402e2c520da3af7dbdd37fb3331724079e6a5f
[ "Apache-2.0" ]
permissive
shenzhanwang/Spring-activiti
cad12a00c3f6a963b48f757392eb72150fb647e5
f3f367db8f87d04b78817377155ad758dbd75c56
refs/heads/master
2023-04-28T09:14:23.007736
2022-06-09T09:16:15
2022-06-09T09:16:15
65,695,641
607
289
Apache-2.0
2023-04-17T10:09:43
2016-08-15T01:39:51
JavaScript
UTF-8
Java
false
false
996
java
package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.SysNotice; /** * 公告 数据层 * * @author ruoyi */ public interface SysNoticeMapper { /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ public SysNotice selectNoticeById(Long noticeId); /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ public List<SysNotice> selectNoticeList(SysNotice notice); /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ public int insertNotice(SysNotice notice); /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ public int updateNotice(SysNotice notice); /** * 批量删除公告 * * @param noticeIds 需要删除的数据ID * @return 结果 */ public int deleteNoticeByIds(String[] noticeIds); }
74ffc7dc8f472d42a45b93d6235e1f4ee41c8b6b
3b564aea266b9c970df2b778b71f945280361f79
/android_ao-develop/domain/src/main/java/com/assetowl/domain/utils/exception/AssetOwlException.java
0abbb3bd8fa51c61b43a94e444ffae13cbb09aa7
[]
no_license
fazarei/AssetOwl
db1773808bcc18016270bae138d7fbecdae0b6f9
077bdcd7092dbbc386d5ef5387307f45dae6bb26
refs/heads/master
2021-01-15T22:23:48.705539
2017-08-10T08:59:29
2017-08-10T08:59:29
99,900,068
0
0
null
null
null
null
UTF-8
Java
false
false
929
java
package com.assetowl.domain.utils.exception; /** * Created by patrickyin on 15/3/17. */ public final class AssetOwlException extends Exception { private final int code; private int httpCode; public final static int AUTH_INVALID_USERNAME_OR_PASSWORD = 600; public final static int NETWORK_ISSUE = 601; public final static int NETWORK_TIME_OUT = 602; public AssetOwlException(String message, int code) { super(message); this.code = code; } public int getErrorCode() { return code; } public int getHttpCode() { return httpCode; } public void setHttpCode(int httpCode) { this.httpCode = httpCode; } public boolean isNetworkError() { return code == NETWORK_ISSUE || code == NETWORK_TIME_OUT; } public boolean isInvalidUsernameOrPasswordError() { return code == AUTH_INVALID_USERNAME_OR_PASSWORD; } }
1614c1e24522cdf9929deaec00684fc5f4e1fd7d
cb5f551df3c47554d4b76e9cc9ed45533dcae94e
/sources/sushimi-web/app/kz/sushimi/persistence/dictionaries/Department.java
82d029d63d5c133374914b945f4736e71c1ef5b8
[]
no_license
demart/sushimi
ecfc6a75ab1c84881814d64c7c42eba029de7415
009abaa00fef9cab1f2622330f0b7e607c14c51f
refs/heads/master
2021-03-24T12:22:56.187522
2016-01-25T19:37:35
2016-01-25T19:37:35
30,245,386
0
0
null
null
null
null
UTF-8
Java
false
false
2,237
java
package kz.sushimi.persistence.dictionaries; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * Рестораны и отделения * * @author Demart * */ @Entity @Table(name = "departments") public class Department { @Id @GeneratedValue @Column private int id; @Column private String name; @ManyToOne private City city; @Column private String address; @Column private String latitude; @Column private String longitude; @Column(name="start_work_hour") private int startWorkHour; @Column(name="end_work_hour") private int endWorkHour; @Column(name="published") private boolean isPublished; @Column(name="deleted") private boolean isDeleted; // ============== public boolean isPublished() { return isPublished; } public String getLatitude() { return latitude; } public void setLatitude(String latitude) { this.latitude = latitude; } public String getLongitude() { return longitude; } public void setLongitude(String longitude) { this.longitude = longitude; } public int getStartWorkHour() { return startWorkHour; } public void setStartWorkHour(int startWorkHour) { this.startWorkHour = startWorkHour; } public int getEndWorkHour() { return endWorkHour; } public void setEndWorkHour(int endWorkHour) { this.endWorkHour = endWorkHour; } public void setPublished(boolean isPublished) { this.isPublished = isPublished; } public boolean isDeleted() { return isDeleted; } public void setDeleted(boolean isDeleted) { this.isDeleted = isDeleted; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public City getCity() { return city; } public void setCity(City city) { this.city = city; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } }
5a67b96f7a7c22c92b229b833dcb452a51bd7aae
bdb99a712aa40b14fded905403910072ee353500
/app/src/main/java/com/test/my/testdatabase/dialogs/UserDialog.java
9070e5be8dd1508a75fbe5f27cfefca630456a44
[]
no_license
eugeneGoodwin/TestDataBase
662282930d81bfede3132903bcb635e7bd2622b8
5fbf6b457bcc50e502ef6c6910f4c67cc4d7f0f9
refs/heads/master
2021-01-11T00:44:46.619846
2016-10-10T14:39:09
2016-10-10T14:39:09
70,496,643
0
0
null
null
null
null
UTF-8
Java
false
false
2,287
java
package com.test.my.testdatabase.dialogs; import android.content.Context; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.EditText; import com.test.my.testdatabase.R; import com.test.my.testdatabase.entities.User; import butterknife.BindView; import butterknife.ButterKnife; public class UserDialog { final AlertDialog dialog; @BindView(R.id.name_edit) EditText mNameEditText; @BindView(R.id.username_edit) EditText mUserNameEditText; @BindView(R.id.email_edit) EditText mEmailEditText; @BindView(R.id.phone_edit) EditText mPhoneEditText; public OnAddListener mAddListener; public UserDialog(Context context, OnAddListener addListener) { mAddListener = addListener; View view = LayoutInflater.from(context).inflate(R.layout.dialog_add_user, null); ButterKnife.bind(this, view); Button button_cancel = (Button) view.findViewById(R.id.button1); button_cancel.setOnClickListener(new android.view.View.OnClickListener() { @Override public void onClick(View arg0) { dialog.dismiss(); } }); Button button_ok = (Button) view.findViewById(R.id.button2); button_ok.setOnClickListener(new android.view.View.OnClickListener() { @Override public void onClick(View arg0) { String name = mNameEditText.getText().toString(); String username = mUserNameEditText.getText().toString(); String email = mEmailEditText.getText().toString(); String phone = mPhoneEditText.getText().toString(); if(name.equals("")) return; User user = User.newUser(name, username, email, phone); if (mAddListener != null) { mAddListener.onAdd(user); dialog.dismiss(); } } }); dialog = new AlertDialog.Builder(context).setTitle("Add user").setView(view).create(); } public void show(){ dialog.show(); } public interface OnAddListener { void onAdd(User user); } }
3d442d95d31f34e7dfadba2ce62aef4e72237d2e
3e0d77eedc400f6925ee8c75bf32f30486f70b50
/CoreJava/src/com/techchefs/javaapps/learning/overloading/TestOverloading.java
47f4f473b14faeb77eda9f5024ec96c80ff086a2
[]
no_license
sanghante/ELF-06June19-TechChefs-SantoshG
1c1349a1e4dcea33923dda73cdc7e7dbc54f48e6
a13c01aa22e057dad1e39546a50af1be6ab78786
refs/heads/master
2023-01-10T05:58:52.183306
2019-08-14T13:26:12
2019-08-14T13:26:12
192,526,998
0
0
null
2023-01-04T07:13:13
2019-06-18T11:30:13
Rich Text Format
UTF-8
Java
false
false
227
java
package com.techchefs.javaapps.learning.overloading; public class TestOverloading { public static void main(String[] args) { MethodOverloading m = new MethodOverloading(); m.search(9); m.search("Chamundi"); } }
2dad2f7c8980d3ad506ee4235ba3b60224d72d00
3d814229ede91bc9a34dd2fe5e34de79c799d4b6
/app/src/main/java/com/mibtech/nirmalbakeryclient/Model/CommentModel.java
74f3a45c8129a5d6445b1cfbec88498d02339192
[]
no_license
pratham3012/AndroidEatItVfinalClient
fc1d8f3a51287b6b8a39fcbd786e1576d2422a0d
842abcf0067883285052221f2ec04a52e652cc0a
refs/heads/master
2022-12-17T17:43:01.404993
2020-09-09T05:00:21
2020-09-09T05:00:21
294,006,432
0
0
null
2020-09-09T04:53:56
2020-09-09T04:53:55
null
UTF-8
Java
false
false
1,055
java
package com.mibtech.nirmalbakeryclient.Model; import java.util.Map; public class CommentModel { private float ratingValue; private String comment, name, uid; private Map<String, Object> commentTimeStamp; public CommentModel() { } public float getRatingValue() { return ratingValue; } public void setRatingValue(float ratingValue) { this.ratingValue = ratingValue; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public Map<String, Object> getCommentTimeStamp() { return commentTimeStamp; } public void setCommentTimeStamp(Map<String, Object> commentTimeStamp) { this.commentTimeStamp = commentTimeStamp; } }
fe36867863e6365a6231bc234426d46b63b1933e
1f129b3b180d1a1eafc1cd307feb51084c3799f2
/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/bulldog/org/apache/jsp/home_jsp.java
41a534450a75aec417be289cc06fafa234e35650
[]
no_license
UnforgivenZZZ/bulldog
493f4ddc53a139127c8ab1cab5c38843bf1d8731
5517a32f4a3977d72aa1060d45503866e1334a48
refs/heads/master
2021-10-23T11:23:06.912422
2017-07-20T22:09:40
2017-07-20T22:09:40
96,368,980
0
1
null
null
null
null
UTF-8
Java
false
false
63,602
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/9.0.0.M21 * Generated at: 2017-07-20 22:08:28 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent, org.apache.jasper.runtime.JspSourceImports { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; private static final java.util.Set<java.lang.String> _jspx_imports_packages; private static final java.util.Set<java.lang.String> _jspx_imports_classes; static { _jspx_imports_packages = new java.util.HashSet<>(); _jspx_imports_packages.add("javax.servlet"); _jspx_imports_packages.add("javax.servlet.http"); _jspx_imports_packages.add("javax.servlet.jsp"); _jspx_imports_classes = null; } private volatile javax.el.ExpressionFactory _el_expressionfactory; private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public java.util.Set<java.lang.String> getPackageImports() { return _jspx_imports_packages; } public java.util.Set<java.lang.String> getClassImports() { return _jspx_imports_classes; } public javax.el.ExpressionFactory _jsp_getExpressionFactory() { if (_el_expressionfactory == null) { synchronized (this) { if (_el_expressionfactory == null) { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); } } } return _el_expressionfactory; } public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() { if (_jsp_instancemanager == null) { synchronized (this) { if (_jsp_instancemanager == null) { _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } } } return _jsp_instancemanager; } public void _jspInit() { } public void _jspDestroy() { } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final java.lang.String _jspx_method = request.getMethod(); if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) { response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD"); return; } final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\n"); out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"); out.write("<!--[if lt IE 7]><html class=\"no-js lt-ie9 lt-ie8 lt-ie7\" lang=\"en\"> <![endif]-->\n"); out.write("<!--[if IE 7]><html class=\"no-js lt-ie9 lt-ie8\" lang=\"en\"> <![endif]-->\n"); out.write("<!--[if IE 8]><html class=\"no-js lt-ie9\" lang=\"en\"> <![endif]-->\n"); out.write("<!--[if IE 9 ]><html class=\"ie9 no-js\"> <![endif]-->\n"); out.write("<!--[if (gt IE 9)|!(IE)]><!--> <html class=\"no-js\"> <!--<![endif]-->\n"); out.write("<head>\n"); out.write("\n"); out.write(" <!-- Basic page needs ================================================== -->\n"); out.write(" <meta charset=\"utf-8\">\n"); out.write(" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n"); out.write("\n"); out.write(" \n"); out.write(" <link rel=\"shortcut icon\" href=\"//cdn.shopify.com/s/files/1/0720/4459/files/favicon_32x32.png?v=1480350603\" type=\"image/png\" />\n"); out.write(" <!-- Latest compiled and minified CSS -->\n"); out.write("\n"); out.write(" <!-- Title and description ================================================== -->\n"); out.write(" <title>\n"); out.write(" Bliss - Pop Theme by Shopify\n"); out.write(" </title>\n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" <!-- Social meta ================================================== -->\n"); out.write(" \n"); out.write("<meta property=\"og:site_name\" content=\"Pop Theme by Shopify\">\n"); out.write("<!-- Index -->\n"); out.write("\n"); out.write(" <meta property=\"og:type\" content=\"website\">\n"); out.write(" <meta property=\"og:title\" content=\"Bliss - Pop Theme by Shopify\">\n"); out.write(" \n"); out.write(" <meta property=\"og:description\" content=\"\">\n"); out.write(" \n"); out.write("<!-- Product -->\n"); out.write("\n"); out.write(" \n"); out.write(" <!-- Helpers ================================================== -->\n"); out.write("<!-- <link rel=\"canonical\" href=\"https://poptheme-bone-promo.myshopify.com/\">\n"); out.write(" --> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n"); out.write("\n"); out.write(" \n"); out.write(" <!-- Ajaxify Cart Plugin ================================================== -->\n"); out.write(" <link href=\"/bulldog/css/ajaxify.scss.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"); out.write(" \n"); out.write("\n"); out.write(" <!-- CSS ================================================== -->\n"); out.write(" <link href=\"/bulldog/css/timber.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <link href=\"//fonts.googleapis.com/css?family=Raleway:500,800\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"); out.write("\n"); out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"main.css\">\n"); out.write(" \n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write(" \n"); out.write(" <script>\n"); out.write(" window.theme = window.theme || {};\n"); out.write(" \n"); out.write(" var theme = {\n"); out.write(" moneyFormat: \""); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${{amount}}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("\",\n"); out.write(" cartType: 'drawer'\n"); out.write(" }\n"); out.write(" </script>\n"); out.write("\n"); out.write(" <!-- Header hook for plugins ================================================== -->\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write("<!--[if lt IE 9]>\n"); out.write("<script src=\"//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js\" type=\"text/javascript\"></script>\n"); out.write("<script src=\"//cdn.shopify.com/s/files/1/0720/4459/t/4/assets/respond.min.js?16771221820700569719\" type=\"text/javascript\"></script>\n"); out.write("<link href=\"//cdn.shopify.com/s/files/1/0720/4459/t/4/assets/respond-proxy.html\" id=\"respond-proxy\" rel=\"respond-proxy\" />\n"); out.write("<link href=\"//poptheme-bone-promo.myshopify.com/search?q=69a98cef8dfa76c0a0cbf0c42d3215db\" id=\"respond-redirect\" rel=\"respond-redirect\" />\n"); out.write("<script src=\"//poptheme-bone-promo.myshopify.com/search?q=69a98cef8dfa76c0a0cbf0c42d3215db\" type=\"text/javascript\"></script>\n"); out.write("<![endif]-->\n"); out.write("\n"); out.write("\n"); out.write(" <!--[if (gt IE 9)|!(IE)]><!--><script src=\"//cdn.shopify.com/s/files/1/0720/4459/t/4/assets/theme.js?16771221820700569719\" defer=\"defer\"></script><!--<![endif]-->\n"); out.write(" <!--[if lte IE 9]><script src=\"//cdn.shopify.com/s/files/1/0720/4459/t/4/assets/theme.js?16771221820700569719\"></script><![endif]-->\n"); out.write("\n"); out.write(" \n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" <script src=\"//ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js\" type=\"text/javascript\"></script>\n"); out.write(" <script src=\"/bulldog/js/modernizr.min.js\" type=\"text/javascript\"></script>\n"); out.write(" \n"); out.write(" \n"); out.write("\n"); out.write("</head>\n"); out.write("\n"); out.write("<h1 style=\"z-index:20;\">sdhjskfhsdhs</h1>\n"); out.write("<body id=\"bliss-pop-theme-by-shopify\" class=\"template-index\" >\n"); out.write("\n"); out.write(" <div id=\"shopify-section-header\" class=\"shopify-section\">\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<style>\n"); out.write(".site-header {\n"); out.write(" \n"); out.write("}\n"); out.write("@media screen and (max-width: 1024px) {\n"); out.write(" .site-header {\n"); out.write(" height: 70px;\n"); out.write(" }\n"); out.write("}\n"); out.write("@media screen and (min-width: 1025px) {\n"); out.write(" .main-content {\n"); out.write(" margin: 90px 0 0 0;\n"); out.write(" }\n"); out.write(" .site-header {\n"); out.write(" height: 100%;\n"); out.write(" width: 250px;\n"); out.write(" overflow-y: auto;\n"); out.write(" left: 0;\n"); out.write(" position: fixed;\n"); out.write(" }\n"); out.write("}\n"); out.write(".nav-mobile {\n"); out.write(" width: 250px;\n"); out.write("}\n"); out.write(".page-move--nav .page-element {\n"); out.write(" left: 250px;\n"); out.write("}\n"); out.write("@media screen and (min-width: 1025px) {\n"); out.write(" .page-wrapper {\n"); out.write(" left: 250px;\n"); out.write(" width: calc(100% - 250px);\n"); out.write(" }\n"); out.write("}\n"); out.write(".supports-csstransforms .page-move--nav .page-element {\n"); out.write(" left: 0;\n"); out.write(" -webkit-transform: translateX(250px);\n"); out.write(" -moz-transform: translateX(250px);\n"); out.write(" -ms-transform: translateX(250px);\n"); out.write(" -o-transform: translateX(250px);\n"); out.write(" transform: translateX(250px);\n"); out.write("}\n"); out.write("@media screen and (min-width: 1025px) {\n"); out.write(" .supports-csstransforms .page-move--cart .page-element {\n"); out.write(" left: calc(250px / 2);\n"); out.write(" }\n"); out.write("}\n"); out.write("@media screen and (max-width: 1024px) {\n"); out.write(" .page-wrapper {\n"); out.write(" top: 70px;\n"); out.write(" }\n"); out.write("}\n"); out.write(".page-move--nav .ajaxify-drawer {\n"); out.write(" right: -250px;\n"); out.write("}\n"); out.write(".supports-csstransforms .page-move--nav .ajaxify-drawer {\n"); out.write(" right: 0;\n"); out.write(" -webkit-transform: translateX(250px);\n"); out.write(" -moz-transform: translateX(250px);\n"); out.write(" -ms-transform: translateX(250px);\n"); out.write(" -o-transform: translateX(250px);\n"); out.write(" transform: translateX(250px);\n"); out.write("}\n"); out.write("@media screen and (max-width: 1024px) {\n"); out.write(" .header-logo img {\n"); out.write(" max-height: 40px;\n"); out.write(" }\n"); out.write("}\n"); out.write("@media screen and (min-width: 1025px) {\n"); out.write(" .header-logo img {\n"); out.write(" max-height: none;\n"); out.write(" }\n"); out.write("}\n"); out.write(".nav-bar {\n"); out.write(" height: 70px;\n"); out.write("}\n"); out.write("@media screen and (max-width: 1024px) {\n"); out.write(" .cart-toggle,\n"); out.write(" .nav-toggle {\n"); out.write(" height: 70px;\n"); out.write(" }\n"); out.write("}\n"); out.write("</style>\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<div class=\"nav-mobile\">\n"); out.write(" <nav class=\"nav-bar\" role=\"navigation\">\n"); out.write(" <div class=\"wrapper\">\n"); out.write(" \n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<ul class=\"site-nav\" id=\"accessibleNav\"> \n"); out.write(" <li class=\"dropdown\" style=\"padding:10px;\">\n"); out.write(" <a href=\"#\" style=\"font-size:18px;\" class=\"dropdown-toggle text-info\" data-toggle=\"dropdown\">Sign In<b class=\"caret\"></b></a>\n"); out.write(" <ul class=\"dropdown-menu\">\n"); out.write(" <form id=\"signin\" class=\"navbar-form navbar-left\" role=\"form\" action=\"login\" method=\"post\">\n"); out.write(" <div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-user\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"email\" type=\"text\" class=\"form-control\" name=\"email\" placeholder=\"Email or user name\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t \t\t\t<div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-lock\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"password\" type=\"password\" class=\"form-control\" name=\"password\" placeholder=\"Password\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t\t\t<br> <hr class=\"hr\">\n"); out.write(" <input type=\"submit\" class=\"btn btn-primary\" value=\"log in\"/>\n"); out.write(" </form>\n"); out.write(" </ul>\n"); out.write(" </li>\n"); out.write("</ul>\n"); out.write("\n"); out.write("<ul class=\"site-nav\" id=\"accessibleNav\"> \n"); out.write(" <li class=\"dropdown\" style=\"padding:10px;\">\n"); out.write(" <a href=\"#\" style=\"font-size:18px;\" class=\"dropdown-toggle text-info\" data-toggle=\"dropdown\">Sign Up<b class=\"caret\"></b></a>\n"); out.write(" <ul class=\"dropdown-menu\">\n"); out.write(" <form id=\"signin\" class=\"navbar-form navbar-left\" role=\"form\" action=\"register\" method=\"post\">\n"); out.write("\t\t\t\t\t\t<div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-envelope\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"email\" type=\"text\" class=\"form-control\" name=\"contact\" placeholder=\"Email\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t\t\t<div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-user\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"user\" type=\"text\" class=\"form-control\" name=\"username\" placeholder=\"user name\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t \t\t\t<div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-lock\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"password\" type=\"password\" class=\"form-control\" name=\"pin\" placeholder=\"Password\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t\t\t\n"); out.write("\t\t\t\t\t\t<br> <hr class=\"hr\">\n"); out.write(" <input type=\"submit\" class=\"btn btn-primary\" value=\"sign up\"/>\n"); out.write(" </form>\n"); out.write(" </ul>\n"); out.write(" </li>\n"); out.write("</ul>\n"); out.write("\n"); out.write("\n"); out.write(" </div>\n"); out.write(" </nav>\n"); out.write("</div>\n"); out.write("\n"); out.write("<header class=\"site-header page-element\" role=\"banner\" data-section-id=\"header\" data-section-type=\"header\">\n"); out.write("\n"); out.write(" <div class=\"nav-bar grid--full large--hide\">\n"); out.write("\n"); out.write(" <div class=\"grid-item one-quarter\">\n"); out.write(" <button type=\"button\" class=\"text-link nav-toggle\" id=\"navToggle\">\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write(" <span class=\"icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-hamburger\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Menu</span>\n"); out.write(" </span>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </button>\n"); out.write(" </div>\n"); out.write("\n"); out.write(" <div class=\"grid-item two-quarters\">\n"); out.write("\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write("\n"); out.write(" \n"); out.write(" <h1 class=\"header-logo\" itemscope itemtype=\"http://schema.org/Organization\">\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" <a href=\"/\" itemprop=\"url\">\n"); out.write(" <img src=\"//cdn.shopify.com/s/files/1/0720/4459/files/logo_450x.png?v=1494273851\" alt=\"Pop Theme by Shopify\" itemprop=\"logo\">\n"); out.write(" </a>\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" </h1>\n"); out.write(" \n"); out.write("\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write("\n"); out.write(" </div>\n"); out.write(" \n"); out.write("<!-- nknow cart area -->\n"); out.write(" <div class=\"grid-item one-quarter\"> \n"); out.write(" <a href=\"/cart\" class=\"cart-toggle\">\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write(" <span class=\"icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-cart\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Cart</span>\n"); out.write(" </span>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </a> \n"); out.write(" </div>\n"); out.write(" <!-- nknow cart area -->\n"); out.write(" \n"); out.write("<br>\n"); out.write("\n"); out.write(" </div>\n"); out.write("\n"); out.write(" <div class=\"wrapper\">\n"); out.write("\n"); out.write(" \n"); out.write(" <div class=\"grid--full\">\n"); out.write(" <div class=\"grid-item medium-down--hide\">\n"); out.write(" \n"); out.write(" <h1 class=\"header-logo\" itemscope itemtype=\"http://schema.org/Organization\">\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" <a href=\"/\" itemprop=\"url\">\n"); out.write(" <img src=\"//cdn.shopify.com/s/files/1/0720/4459/files/logo_450x.png?v=1494273851\" alt=\"Pop Theme by Shopify\" itemprop=\"logo\">\n"); out.write(" </a>\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" </h1>\n"); out.write(" \n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"medium-down--hide\">\n"); out.write(" <ul class=\"site-nav\">\n"); out.write("<form action=\"/search\" method=\"get\" class=\"input-group search-bar\" role=\"search\">\n"); out.write(" \n"); out.write(" <input type=\"search\" name=\"q\" value=\"\" placeholder=\"Search our store\" class=\"input-group-field\" aria-label=\"Search our store\">\n"); out.write(" <span class=\"input-group-btn\">\n"); out.write(" <button type=\"submit\" class=\"btn icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-search\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Search</span>\n"); out.write(" </button>\n"); out.write(" </span>\n"); out.write("</form>\n"); out.write(" \n"); out.write(" </ul>\n"); out.write("\n"); out.write(" <hr class=\"hr--small\">\n"); out.write(" </div>\n"); out.write("\n"); out.write("\n"); out.write(" <div class=\"medium-down--hide\">\n"); out.write(" <ul class=\"site-nav\">\n"); out.write(" <li>\n"); out.write(" <a href=\"/cart\" class=\"cart-toggle site-nav__link\">\n"); out.write(" <span class=\"icon icon-cart\" aria-hidden=\"true\"></span>\n"); out.write(" Cart\n"); out.write(" <span id=\"cartCount\" class=\"hidden-count\">(0)</span>\n"); out.write(" </a>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" </ul>\n"); out.write("\n"); out.write(" <hr class=\"hr--small\">\n"); out.write(" </div>\n"); out.write("\n"); out.write(" </div>\n"); out.write("<nav class=\"medium-down--hide\" role=\"navigation\">\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<ul class=\"site-nav\" id=\"accessibleNav\">\n"); out.write("<li class=\"dropdown\">\n"); out.write(" <a href=\"#\" style=\"font-size:16px;\" class=\"dropdown-toggle text-info\" data-toggle=\"dropdown\">Sign In<b class=\"caret\"></b></a>\n"); out.write(" <ul class=\"dropdown-menu\">\n"); out.write(" <form id=\"signin\" class=\"navbar-form navbar-left\" role=\"form\" action=\"login\" method=\"post\">\n"); out.write(" <div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-user\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"email\" type=\"text\" class=\"form-control\" name=\"email\" placeholder=\"Email or user name\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t \t\t\t<div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-lock\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"password\" type=\"password\" class=\"form-control\" name=\"password\" placeholder=\"Password\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t\t\t<br> <hr class=\"hr\">\n"); out.write(" <input type=\"submit\" class=\"btn btn-primary\" value=\"log in\"/>\n"); out.write(" </form>\n"); out.write(" </ul>\n"); out.write(" </li>\n"); out.write("\n"); out.write(" \n"); out.write("</ul>\n"); out.write("\n"); out.write(" <hr class=\"hr--small\">\n"); out.write("\n"); out.write("\n"); out.write("<ul class=\"site-nav\" id=\"accessibleNav\">\n"); out.write(" <li class=\"dropdown\">\n"); out.write(" <a href=\"#\" style=\"font-size:16px;\" class=\"dropdown-toggle text-info\" data-toggle=\"dropdown\">Sign Up<b class=\"caret\"></b></a>\n"); out.write(" <ul class=\"dropdown-menu\">\n"); out.write(" <form id=\"signin\" class=\"navbar-form navbar-left\" role=\"form\" action=\"register\" method=\"post\">\n"); out.write("\t\t\t\t\t\t<div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-envelope\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"email\" type=\"text\" class=\"form-control\" name=\"contact\" placeholder=\"Email\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t\t\t<div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-user\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"user\" type=\"text\" class=\"form-control\" name=\"username\" placeholder=\"user name\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t \t\t\t<div class=\"input-group\">\n"); out.write(" \t\t\t\t\t\t<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-lock\"></i></span>\n"); out.write(" \t\t\t\t\t\t<input id=\"password\" type=\"password\" class=\"form-control\" name=\"pin\" placeholder=\"Password\">\n"); out.write(" \t\t\t\t\t</div>\n"); out.write(" \t\t\t\t\t\n"); out.write("\t\t\t\t\t\t<br> <hr class=\"hr\">\n"); out.write(" <input type=\"submit\" class=\"btn btn-primary\" value=\"sign up\" />\n"); out.write(" </form>\n"); out.write(" </ul>\n"); out.write(" </li>\n"); out.write("</ul>\n"); out.write(" \n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write(" </nav>\n"); out.write("\n"); out.write(" </div>\n"); out.write("</header>\n"); out.write("\n"); out.write("\n"); out.write("</div>\n"); out.write("\n"); out.write(" <div class=\"page-wrapper page-element\">\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write("<!-- top navgation bar --> \n"); out.write("\n"); out.write("<style>\n"); out.write(".topnav {\n"); out.write(" overflow: hidden;\n"); out.write(" background-color: #fff;\n"); out.write("}\n"); out.write(".topnav a {\n"); out.write(" float: left;\n"); out.write(" display: block;\n"); out.write(" color: black;\n"); out.write(" text-align: center;\n"); out.write(" padding: 14px 16px;\n"); out.write(" text-decoration: none;\n"); out.write(" font-size: 17px;\n"); out.write("}\n"); out.write(".topnav a:hover {\n"); out.write(" background-color: #ddd;\n"); out.write(" color: black;\n"); out.write("}\n"); out.write(".topnav .active {\n"); out.write(" background-color: orange;\n"); out.write(" color: white;\n"); out.write("}\n"); out.write("</style>\n"); out.write("\n"); out.write(" <meta charset=\"utf-8\">\n"); out.write(" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n"); out.write(" <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\">\n"); out.write(" <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js\"></script>\n"); out.write(" <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>\n"); out.write("\n"); out.write("<body>\n"); out.write("\n"); out.write("<!-- .................................................... --> \n"); out.write(" \n"); out.write("<div class=\"nav-bar grid--full large--hide\">\n"); out.write("<form action=\"/search\" method=\"get\" class=\"input-group search-bar\" role=\"search\">\n"); out.write(" \n"); out.write(" <input type=\"search\" name=\"q\" value=\"\" placeholder=\"Search our store\" class=\"input-group-field\" aria-label=\"Search our store\">\n"); out.write(" <span class=\"input-group-btn\">\n"); out.write(" <button type=\"submit\" class=\"btn icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-search\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Search</span>\n"); out.write(" </button>\n"); out.write(" </span>\n"); out.write("</form>\n"); out.write("</div>\n"); out.write(" <main class=\"main-content\" role=\"main\">\n"); out.write(" <div class=\"wrapper\">\n"); out.write("\n"); out.write(" <!-- BEGIN content_for_index --><div id=\"shopify-section-slideshow\" class=\"shopify-section index-section\">\n"); out.write(" \n"); out.write(" <div class=\"flexslider\" id=\"flexslider--slideshow\" data-section-id=\"slideshow\" data-section-type=\"slideshow-section\" data-autoplay=\"true\" data-speed=\"5000\" data-animation-type=\"slide\">\n"); out.write(" <ul class=\"slides\">\n"); out.write("\n"); out.write(" \n"); out.write(" \n"); out.write(" <li id=\"slide--slideshow-0\" data-flexslider-index=\"0\" >\n"); out.write(" <a href=\"/collections/all\" class=\"slide-link\">\n"); out.write(" <img src=\"//cdn.shopify.com/s/files/1/0720/4459/files/slide_1_1060x.jpg?v=1494273814\" alt=\"A young woman looking into the mirror while applying makeup\" />\n"); out.write(" </a>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <li id=\"slide--slideshow-1\" data-flexslider-index=\"1\" >\n"); out.write(" <a href=\"/collections/all\" class=\"slide-link\">\n"); out.write(" <img src=\"//cdn.shopify.com/s/files/1/0720/4459/files/slide_2_1060x.jpg?v=1494273833\" alt=\"Perfume bottles on a table with rose petals\" />\n"); out.write(" </a>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" </ul>\n"); out.write(" </div>\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("</div><div id=\"shopify-section-featured-collection\" class=\"shopify-section index-section\"><style>\n"); out.write("@media screen and (min-width: 769px) {\n"); out.write(" [data-section-id=\"featured-collection\"] .product__details {\n"); out.write(" \n"); out.write(" margin-top: 15px;\n"); out.write(" \n"); out.write(" z-index: 2;\n"); out.write(" }\n"); out.write("}\n"); out.write(" [data-section-id=\"featured-collection\"] .product__price {\n"); out.write(" margin-bottom: 0;\n"); out.write(" }\n"); out.write(" @include at-query($min, $large) {\n"); out.write(" .product:hover .product__price {\n"); out.write(" color: #d14800;\n"); out.write(" }\n"); out.write(" }\n"); out.write("</style>\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<div data-section-id=\"featured-collection\">\n"); out.write(" <div class=\"section-header text-center\">\n"); out.write(" \n"); out.write(" <h2 class=\"section-header--title\">Featured Products</h2>\n"); out.write(" \n"); out.write(" \n"); out.write(" </div>\n"); out.write("\n"); out.write(" \n"); out.write("<!-- product grid begin -->\n"); out.write("<!-- assume in server, get all product information and saved in to a arraylist: request.setAttribute(\"prods\",prod_list);-->\n"); out.write("\n"); /*ArrayList<product> prods = (ArrayList)request.getAttribute("prods"); for (....) {*/ out.write("\n"); out.write(" <div class=\"grid-uniform product-grid\">\n"); out.write(" \n"); out.write(" \n"); out.write("<div class=\"grid-item medium--one-third large--one-third\" >\n"); out.write(" <!-- snippets/product-grid-item.liquid -->\n"); out.write("<div class=\" on-sale\">\n"); out.write(" <div class=\"product-wrapper\">\n"); out.write(" <a href=\"/products/perfumeoil-garden\" class=\"product\">\n"); out.write(" \n"); out.write(" <img src=\"//cdn.shopify.com/s/files/1/0720/4459/products/parc-2_1d125ba9-c252-4484-bc91-1cf1ad81fb34_large.jpeg?v=1418331578\" alt=\"Perfume Oil- Garden\" class=\"product__img\">\n"); out.write(" \n"); out.write(" <div class=\"product__cover\"></div>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"product__details text-center\">\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write(" <p class=\"h4 product__title\">Perfume Oil- Garden</p>\n"); out.write(" <p class=\"product__price\">\n"); out.write(" \n"); out.write(" <span class=\"visuallyhidden\">Sale price</span>\n"); out.write(" \n"); out.write(" \n"); out.write(" $45.00\n"); out.write(" \n"); out.write(" \n"); out.write(" <span class=\"visuallyhidden\">Regular price</span>\n"); out.write(" <del>$60.00</del>\n"); out.write(" \n"); out.write(" </p>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" <div class=\"on-sale-tag text-center\">\n"); out.write(" <span class=\"tag\" aria-hidden=\"true\">Sale</span>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" </a>\n"); out.write(" </div>\n"); out.write("</div>\n"); out.write("\n"); out.write("</div>\n"); out.write(" <!-- product frid end -->\n"); out.write(" "); //} out.write(" \n"); out.write(" \n"); out.write(" <div class=\"grid-item medium--one-third large--one-third\" >\n"); out.write(" <!-- snippets/product-grid-item.liquid -->\n"); out.write("<div class=\"\">\n"); out.write(" <div class=\"product-wrapper\">\n"); out.write(" <a href=\"/products/perfumeoil-hunter\" class=\"product\">\n"); out.write(" \n"); out.write(" <img src=\"http://3i1e5d437yd84efcy34dardm.wpengine.netdna-cdn.com/wp-content/uploads/2017/01/chanel-chance-new-perfume-for-women-2017-2018-e1492949955651.jpg\" alt=\"Perfume Oil- Hunter\" class=\"product__img\">\n"); out.write(" \n"); out.write(" <div class=\"product__cover\"></div>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"product__details text-center\">\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write(" <p class=\"h4 product__title\">Perfume Oil- Hunter</p>\n"); out.write(" <p class=\"product__price\">\n"); out.write(" \n"); out.write(" <span class=\"visuallyhidden\">Regular price</span>\n"); out.write(" \n"); out.write(" \n"); out.write(" $45.00\n"); out.write(" \n"); out.write(" </p>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" </a>\n"); out.write(" </div>\n"); out.write("</div>\n"); out.write("\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" <div class=\"grid-item medium--one-third large--one-third\" >\n"); out.write(" <!-- snippets/product-grid-item.liquid -->\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<div class=\" on-sale\">\n"); out.write(" <div class=\"product-wrapper\">\n"); out.write(" <a href=\"/products/pinkclayfacialmask\" class=\"product\">\n"); out.write(" \n"); out.write(" <img src=\"http://betheme.muffingroupsc.netdna-cdn.com/be/perfume/wp-content/uploads/2016/04/home_perfume_pic2.jpg\" alt=\"Pink Clay Facial Mask\" class=\"product__img\">\n"); out.write(" \n"); out.write(" <div class=\"product__cover\"></div>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"product__details text-center\">\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write(" <p class=\"h4 product__title\">Pink Clay Facial Mask</p>\n"); out.write(" <p class=\"product__price\">\n"); out.write(" \n"); out.write(" <span class=\"visuallyhidden\">Sale price</span>\n"); out.write(" \n"); out.write(" \n"); out.write(" From $22.00\n"); out.write(" \n"); out.write(" \n"); out.write(" <span class=\"visuallyhidden\">Regular price</span>\n"); out.write(" <del>$30.00</del>\n"); out.write(" \n"); out.write(" </p>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" <div class=\"on-sale-tag text-center\">\n"); out.write(" <span class=\"tag\" aria-hidden=\"true\">Sale</span>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" </a>\n"); out.write(" </div>\n"); out.write("</div>\n"); out.write("\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" <div class=\"grid-item medium--one-third large--one-third\" >\n"); out.write(" <!-- snippets/product-grid-item.liquid -->\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<div class=\"\">\n"); out.write(" <div class=\"product-wrapper\">\n"); out.write(" <a href=\"/products/positive-seeds-2\" class=\"product\">\n"); out.write(" \n"); out.write(" <img src=\"//cdn.shopify.com/s/files/1/0720/4459/products/parc-27_abe410f2-9a27-4ae4-8d77-52b0918c0848_large.jpeg?v=1418331431\" alt=\"Soul Sunday Positive Seeds\" class=\"product__img\">\n"); out.write(" \n"); out.write(" <div class=\"product__cover\"></div>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"product__details text-center\">\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write(" <p class=\"h4 product__title\">Positive Seeds</p>\n"); out.write(" <p class=\"product__price\">\n"); out.write(" \n"); out.write(" <span class=\"visuallyhidden\">Regular price</span>\n"); out.write(" \n"); out.write(" \n"); out.write(" $16.00\n"); out.write(" \n"); out.write(" </p>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" </a>\n"); out.write(" </div>\n"); out.write("</div>\n"); out.write("\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" <div class=\"grid-item medium--one-third large--one-third\" >\n"); out.write(" <!-- snippets/product-grid-item.liquid -->\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<div class=\" sold-out\">\n"); out.write(" <div class=\"product-wrapper\">\n"); out.write(" <a href=\"/products/purifyfacialserum\" class=\"product\">\n"); out.write(" \n"); out.write(" <img src=\"//cdn.shopify.com/s/files/1/0720/4459/products/parc-36_63aea351-185f-4970-8d50-a15623a24fca_large.jpeg?v=1418331411\" alt=\"Purify Facial Serum\" class=\"product__img\">\n"); out.write(" \n"); out.write(" <div class=\"product__cover\"></div>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"product__details text-center\">\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write(" <p class=\"h4 product__title\">Purify Facial Serum</p>\n"); out.write(" <p class=\"product__price\">\n"); out.write(" \n"); out.write(" <span class=\"visuallyhidden\">Regular price</span>\n"); out.write(" \n"); out.write(" \n"); out.write(" $36.00\n"); out.write(" \n"); out.write(" </p>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" <div class=\"sold-out-tag text-center\">\n"); out.write(" <span class=\"tag\">Sold Out</span>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" </a>\n"); out.write(" </div>\n"); out.write("</div>\n"); out.write("\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" <div class=\"grid-item medium--one-third large--one-third\" >\n"); out.write(" <!-- snippets/product-grid-item.liquid -->\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<div class=\" last\">\n"); out.write(" <div class=\"product-wrapper\">\n"); out.write(" <a href=\"/products/realismrollerperfume\" class=\"product\">\n"); out.write(" \n"); out.write(" <img src=\"//cdn.shopify.com/s/files/1/0720/4459/products/parc-11_5de8f9c4-3562-40da-8cfc-fe543a466e23_large.jpeg?v=1418331389\" alt=\"Realism Roller Perfume\" class=\"product__img\">\n"); out.write(" \n"); out.write(" <div class=\"product__cover\"></div>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"product__details text-center\">\n"); out.write(" <div class=\"table-contain\">\n"); out.write(" <div class=\"table-contain__inner\">\n"); out.write(" <p class=\"h4 product__title\">Realism Roller Perfume</p>\n"); out.write(" <p class=\"product__price\">\n"); out.write(" \n"); out.write(" <span class=\"visuallyhidden\">Regular price</span>\n"); out.write(" \n"); out.write(" \n"); out.write(" $48.00\n"); out.write(" \n"); out.write(" </p>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" \n"); out.write(" </a>\n"); out.write(" </div>\n"); out.write("</div>\n"); out.write("\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" </div>\n"); out.write("</div>\n"); out.write("\n"); out.write("\n"); out.write("</div><div id=\"shopify-section-1480350289228\" class=\"shopify-section index-section\"><div class=\"grid\">\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("</div>\n"); out.write("\n"); out.write("\n"); out.write("</div><!-- END content_for_index -->\n"); out.write("\n"); out.write("\n"); out.write(" </div>\n"); out.write("\n"); out.write(" <div id=\"shopify-section-footer\" class=\"shopify-section\">\n"); out.write("\n"); out.write("\n"); out.write("<style>\n"); out.write(".site-footer {\n"); out.write(" padding: 0 0 30px;\n"); out.write(" \n"); out.write("}\n"); out.write("@media screen and (min-width: 1025px) {\n"); out.write(" .site-footer {\n"); out.write(" \n"); out.write(" padding: 60px 0;\n"); out.write(" }\n"); out.write("}\n"); out.write("</style>\n"); out.write("\n"); out.write("<footer class=\"site-footer small--text-center medium--text-center\" role=\"contentinfo\">\n"); out.write("\n"); out.write(" <!-- <div class=\"wrapper\">\n"); out.write("\n"); out.write(" <hr class=\"hr--clear large--hide\">\n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"grid\">\n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" <div class=\"grid-item large--two-thirds\">\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" <h3 class=\"h5 onboarding-header\">About us</h3>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"rte\">\n"); out.write(" <p>Pop is a responsive Shopify theme. This is a demo shop for the theme store and comes in two&nbsp;different styles which you can find on the Theme Store.</p>\n"); out.write("<p>Store location</p>\n"); out.write("<p>123 Blueberry Avenue, Blueberry ON., M6K 1Y3</p>\n"); out.write(" </div>\n"); out.write("\n"); out.write(" \n"); out.write(" </div>\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" <div class=\"grid-item large--one-third\">\n"); out.write(" \n"); out.write("\n"); out.write(" <hr class=\"hr--clear large--hide\">\n"); out.write("\n"); out.write(" <h3 class=\"h5\">Get Connected</h3>\n"); out.write("\n"); out.write(" \n"); out.write(" <div class=\"grid\">\n"); out.write(" <div class=\"grid-item medium--two-thirds push--medium--one-sixth\">\n"); out.write(" <label class=\"form-label--hidden\">\n"); out.write(" <span class=\"visuallyhidden\">Enter your email</span>\n"); out.write("</label>\n"); out.write("\n"); out.write(" <div class=\"form-vertical\">\n"); out.write(" <form method=\"post\" action=\"https://poptheme-bone-promo.myshopify.com/contact#contact_form\" id=\"contact_form\" class=\"contact-form\" accept-charset=\"UTF-8\"><input type=\"hidden\" value=\"customer\" name=\"form_type\" /><input type=\"hidden\" name=\"utf8\" value=\"✓\" />\n"); out.write(" \n"); out.write(" \n"); out.write(" <input type=\"hidden\" name=\"contact[tags]\" value=\"newsletter\">\n"); out.write(" <div class=\"input-group\">\n"); out.write(" <input type=\"email\" value=\"\" placeholder=\"[email protected]\" name=\"contact[email]\" id=\"Email\" class=\"input-group-field\" aria-label=\"[email protected]\" autocorrect=\"off\" autocapitalize=\"off\">\n"); out.write(" <span class=\"input-group-btn\">\n"); out.write(" <button type=\"submit\" class=\"btn icon-fallback-text\" name=\"commit\" id=\"subscribe\">\n"); out.write(" <span class=\"icon icon-chevron-right\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Subscribe</span>\n"); out.write(" </button>\n"); out.write(" </span>\n"); out.write(" </div>\n"); out.write(" \n"); out.write(" </form>\n"); out.write(" </div>\n"); out.write("\n"); out.write("\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" <ul class=\"inline-list social-icons\">\n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <a class=\"icon-fallback-text\" href=\"https://twitter.com/shopify\" title=\"Pop Theme by Shopify on Twitter\">\n"); out.write(" <span class=\"icon icon-twitter\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Twitter</span>\n"); out.write(" </a>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <a class=\"icon-fallback-text\" href=\"https://www.facebook.com/shopify\" title=\"Pop Theme by Shopify on Facebook\">\n"); out.write(" <span class=\"icon icon-facebook\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Facebook</span>\n"); out.write(" </a>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <a class=\"icon-fallback-text\" href=\"https://www.pinterest.com/shopify/\" title=\"Pop Theme by Shopify on Pinterest\">\n"); out.write(" <span class=\"icon icon-pinterest\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Pinterest</span>\n"); out.write(" </a>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <a class=\"icon-fallback-text\" href=\"https://instagram.com/shopify/\" title=\"Pop Theme by Shopify on Instagram\">\n"); out.write(" <span class=\"icon icon-instagram\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Instagram</span>\n"); out.write(" </a>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" </ul>\n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write(" </div>\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" </div>\n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" <hr class=\"hr--clear\">\n"); out.write("\n"); out.write(" \n"); out.write(" <div class=\"grid\">\n"); out.write(" <div class=\"grid-item medium--two-thirds push--medium--one-sixth large--one-half push--large--one-quarter nav-search\">\n"); out.write(" <h3 class=\"h5 text-center\">Search for products on our site</h3>\n"); out.write(" \n"); out.write("\n"); out.write("<label class=\"form-label--hidden\">\n"); out.write(" <span class=\"visuallyhidden\">Search our store</span>\n"); out.write("</label>\n"); out.write("<form action=\"/search\" method=\"get\" class=\"input-group search-bar\" role=\"search\">\n"); out.write(" \n"); out.write(" <input type=\"search\" name=\"q\" value=\"\" placeholder=\"Search our store\" class=\"input-group-field\" aria-label=\"Search our store\">\n"); out.write(" <span class=\"input-group-btn\">\n"); out.write(" <button type=\"submit\" class=\"btn icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-search\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">Search</span>\n"); out.write(" </button>\n"); out.write(" </span>\n"); out.write("</form>\n"); out.write("\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"text-center\">\n"); out.write(" \n"); out.write(" <ul class=\"inline-list nav-secondary\">\n"); out.write(" \n"); out.write(" <li><a href=\"/search\">Search</a></li>\n"); out.write(" \n"); out.write(" <li><a href=\"/pages/about-us\">About Us</a></li>\n"); out.write(" \n"); out.write(" <li><a href=\"/pages/contact-us\">Contact Us</a></li>\n"); out.write(" \n"); out.write(" </ul>\n"); out.write(" \n"); out.write(" </div>\n"); out.write("\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <ul class=\"inline-list payment-icons text-center\">\n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <span class=\"icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-visa\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">visa</span>\n"); out.write(" </span>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <span class=\"icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-master\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">master</span>\n"); out.write(" </span>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <span class=\"icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-american_express\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">american express</span>\n"); out.write(" </span>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <span class=\"icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-paypal\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">paypal</span>\n"); out.write(" </span>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <span class=\"icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-diners_club\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">diners club</span>\n"); out.write(" </span>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" <li>\n"); out.write(" <span class=\"icon-fallback-text\">\n"); out.write(" <span class=\"icon icon-discover\" aria-hidden=\"true\"></span>\n"); out.write(" <span class=\"fallback-text\">discover</span>\n"); out.write(" </span>\n"); out.write(" </li>\n"); out.write(" \n"); out.write(" \n"); out.write(" </ul>\n"); out.write(" \n"); out.write("\n"); out.write(" <div class=\"text-center\">\n"); out.write(" <small>\n"); out.write(" Copyright &copy; 2017 <a href=\"/\" title=\"\">Pop Theme by Shopify</a> | <a target=\"_blank\" rel=\"nofollow\" href=\"https://www.shopify.com\">Powered by Shopify</a><br>\n"); out.write(" </small>\n"); out.write(" </div>\n"); out.write("\n"); out.write(" </div>\n"); out.write("\n"); out.write("</footer> -->\n"); out.write("\n"); out.write("\n"); out.write("</div>\n"); out.write("\n"); out.write(" </main>\n"); out.write("\n"); out.write(" \n"); out.write(" \n"); out.write(" <script src=\"//cdn.shopify.com/s/files/1/0720/4459/t/4/assets/handlebars.min.js?16771221820700569719\" type=\"text/javascript\"></script>\n"); out.write(" \n"); out.write(" <script id=\"cartTemplate\" type=\"text/template\">\n"); out.write("\n"); out.write(" \n"); out.write(" </script>\n"); out.write(" <script id=\"drawerTemplate\" type=\"text/template\">\n"); out.write("\n"); out.write(" \n"); out.write(" </script>\n"); out.write(" <script id=\"modalTemplate\" type=\"text/template\">\n"); out.write("\n"); out.write(" \n"); out.write(" </script>\n"); out.write(" <script id=\"ajaxifyQty\" type=\"text/template\">\n"); out.write("\n"); out.write(" \n"); out.write(" </script>\n"); out.write(" <script id=\"jsQty\" type=\"text/template\">\n"); out.write("\n"); out.write(" \n"); out.write(" </script>\n"); out.write("<!-- cart detail-->\n"); out.write(" <script src=\"//cdn.shopify.com/s/files/1/0720/4459/t/4/assets/ajaxify.js?16771221820700569719\" type=\"text/javascript\"></script>\n"); out.write(" \n"); out.write("\n"); out.write(" \n"); out.write("\n"); out.write(" </div>\n"); out.write("\n"); out.write("</body>\n"); out.write("</html>"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
c0fe9000c4d13ee7f1e51ceec6f3db530809df44
fcded1abf96ad03a26b7bb87cdaa966009ff5c89
/src/Offer3.java
739c60b2ae0ae222c95bef3ba2cb89ecb0d5bd6e
[]
no_license
zhuyingtao/nowcoder
7ea5d66b1742973c088adbb335860b27fbc2bb30
28f047f8200dd42d965958efad12498c6de8eaf5
refs/heads/master
2021-03-02T05:24:32.110236
2020-03-30T11:17:43
2020-03-30T11:17:43
245,841,015
0
0
null
null
null
null
UTF-8
Java
false
false
677
java
import java.util.ArrayList; import java.util.Stack; /** * Created by zyt on 15/10/27 16:23. */ public class Offer3 { public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; } } public ArrayList<Integer> printListFromTailToHead(ListNode listNode) { Stack<Integer> stack = new Stack<>(); while (listNode != null) { stack.push(listNode.val); listNode = listNode.next; } ArrayList<Integer> array = new ArrayList<>(); while (!stack.isEmpty()) { array.add(stack.pop()); } return array; } }
c1c01f59149bfebbc189b54008ed292a7ced7608
232498461e1b8c474d3598903eaf512cbc1bc899
/src/Koneksi.java
7cb0f9c4dc20f86d8a89952a85255a2ef013f82c
[]
no_license
Amdh-sys/Rental_Mobil
91e4822284e72e177af0008f765912c9fbbb252a
d987aec00c0fe64a8ccedd4b3f37da015c6a7115
refs/heads/master
2022-12-07T21:32:31.578920
2020-09-02T01:50:34
2020-09-02T01:50:34
292,151,040
0
0
null
null
null
null
UTF-8
Java
false
false
1,353
java
import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import javax.swing.JOptionPane; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Adam */ public class Koneksi { public static Connection koneksi(){ try{ Class.forName("com.mysql.jdbc.Driver"); Connection koneksi = DriverManager.getConnection("jdbc:mysql://localhost/pmobil","root",""); return koneksi; }catch(Exception e){ JOptionPane.showMessageDialog(null, e); return null; } } public static Connection getConnection() throws SQLException { Connection connection = null; String driver = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://localhost:3306/pmobil"; //ganti dengan database mu String user = "root"; String password = ""; if (connection == null) { try { Class.forName(driver); connection = DriverManager.getConnection(url, user, password); } catch (ClassNotFoundException | SQLException error) { System.exit(0); } } return connection; } }
0ac661f1ca295047b0f8d14525480d17dd0a1cff
9e51a8528215d738307fd3ee6fe536a49433a632
/LBJ/src/produccion/vistas/AsignacionNueva.java
730371c7cfe0c27b80b554f344760981cc7a179e
[]
no_license
gvillarg/little-big-james-2
2c788fff28516dd9e03d0f16fa3dc5adc85004ae
8ded89ad9627ea0b28e368ac0da79552971ac08f
refs/heads/master
2021-01-02T08:56:59.298642
2013-12-23T14:30:01
2013-12-23T14:30:01
32,127,974
0
0
null
null
null
null
UTF-8
Java
false
false
29,503
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package produccion.vistas; import produccion.algoritmos.Algoritmo; import produccion.controlador.ControladorProduccion; import controlador.almacen.controladoralmacen; import controlador.configuracion.controladorconfiguracion; import java.awt.Cursor; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.List; import javax.swing.JOptionPane; import javax.swing.table.AbstractTableModel; import modelos.Actividad; import modelos.Empleado; /** * * @author Guti */ public class AsignacionNueva extends javax.swing.JInternalFrame { private final int numActividades = 4; private List<Empleado> listaEmpleados; private boolean[] listaSeleccion; private int[] numMaximoMaquinas; private boolean seleccionarTodo = false; private AbstractTableModel modeloTabla = new AbstractTableModel() { private String[] cabeceras = {"Código", "Nombres y Apellidos", "Seleccion"}; @Override public int getRowCount() { return listaEmpleados.size(); } @Override public int getColumnCount() { return cabeceras.length; } @Override public String getColumnName(int columna) { return cabeceras[columna]; } @Override public Object getValueAt(int rowIndex, int columnIndex) { int codigo; String nombre; if (columnIndex == 0) { codigo = listaEmpleados.get(rowIndex).getIdempleado(); return codigo; } else if (columnIndex == 1) { nombre = listaEmpleados.get(rowIndex).getNombre() + " "; nombre += listaEmpleados.get(rowIndex).getAppaterno() + " "; nombre += listaEmpleados.get(rowIndex).getApmaterno(); return nombre; } else if (columnIndex == 2) { return listaSeleccion[rowIndex]; } return null; } @Override public Class<?> getColumnClass(int columna) { if (columna == 2) { return Boolean.class; } else { return String.class; } } @Override public boolean isCellEditable(int row, int col) { return (col == 2); } @Override public void setValueAt(Object aValue, int rowIndex, int columnIndex) { if (columnIndex == 2) { listaSeleccion[rowIndex] = (boolean) aValue; fireTableCellUpdated(rowIndex, columnIndex); if (!seleccionarTodo) { btnDeseleccionar.setText("Seleccionar Todo"); seleccionarTodo = true; } } } }; public AsignacionNueva() { initComponents(); /////////////////// dpFechaInicio.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { // the docs of JDateChooser says that when the date is modified, a "date" property change is fired if (evt.getPropertyName().equals("date")) { dpFechaFin.setMinSelectableDate(dpFechaInicio.getDate()); modelos.Ordenproduccion orden=ControladorProduccion.buscarOrdenProduccionPorFecha(dpFechaInicio.getDate()); if(orden!=null){ dpFechaFin.setMaxSelectableDate(orden.getFechafin()); dpFechaFin.setEnabled(true); } else{ dpFechaFin.setDate(null); dpFechaFin.setEnabled(false); JOptionPane.showMessageDialog(null, "No se encuentra un plan de producción"); } } } }); dpFechaFin.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { // the docs of JDateChooser says that when the date is modified, a "date" property change is fired // if (evt.getPropertyName().equals("date")) { // dpFechaInicio.setMaxSelectableDate(dpFechaFin.getDate()); // } } }); //////////////////// controladorconfiguracion micontroladorconfiguracion = new controladorconfiguracion(); ControladorProduccion micontroladorProduccion = new ControladorProduccion(); listaEmpleados = micontroladorProduccion.seleccionarEmpleados(); listaSeleccion = new boolean[listaEmpleados.size()]; for (int i = 0; i < listaEmpleados.size(); i++) { listaSeleccion[i] = true; } tblTrabajadores.setModel(modeloTabla); controladoralmacen micontroladoralmacen = new controladoralmacen(); List<Actividad> listaActividades = micontroladoralmacen.sacaactividades(); numMaximoMaquinas = new int[numActividades]; for (int i = 0; i < numActividades; i++) { numMaximoMaquinas[i] = ControladorProduccion.buscarMaquinasPorIdactividad( listaActividades.get(i).getIdactividad()).size(); } lblHorneado.setText("(max " + numMaximoMaquinas[0] + ")"); txtHorneado.setText("" + numMaximoMaquinas[0]); lblRelleno.setText("(max " + numMaximoMaquinas[1] + ")"); txtRelleno.setText("" + numMaximoMaquinas[1]); lblDecorado.setText("(max " + numMaximoMaquinas[2] + ")"); txtDecorado.setText("" + numMaximoMaquinas[2]); lblEmpaque.setText("(max " + numMaximoMaquinas[3] + ")"); txtEmpaque.setText("" + numMaximoMaquinas[3]); //////////////////////// } public void RefrescarTabla() { ((AbstractTableModel) tblTrabajadores.getModel()).fireTableDataChanged(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); btnSiguiente = new javax.swing.JButton(); dpFechaInicio = new com.toedter.calendar.JDateChooser(); dpFechaFin = new com.toedter.calendar.JDateChooser(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); tblTrabajadores = new javax.swing.JTable(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); txtHorneado = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); txtRelleno = new javax.swing.JTextField(); txtDecorado = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); txtEmpaque = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); lblHorneado = new javax.swing.JLabel(); lblRelleno = new javax.swing.JLabel(); lblEmpaque = new javax.swing.JLabel(); lblDecorado = new javax.swing.JLabel(); btnDeseleccionar = new javax.swing.JButton(); setClosable(true); setIconifiable(true); setTitle("Nueva Asignacion"); jLabel7.setText("Fecha Inicio:"); jLabel8.setText("Fecha Fin:"); btnSiguiente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/next 2.png"))); // NOI18N btnSiguiente.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSiguienteActionPerformed(evt); } }); dpFechaInicio.setDateFormatString("dd/MM/yyyy"); dpFechaInicio.setMaxSelectableDate(dpFechaFin.getDate()); dpFechaInicio.setMinSelectableDate(new java.util.Date()); dpFechaFin.setDateFormatString("dd/MM/yyyy"); dpFechaFin.setEnabled(false); dpFechaFin.setMaxSelectableDate(new java.util.Date(253370786477000L)); dpFechaFin.setMinSelectableDate(dpFechaInicio.getDate()); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Empleados")); tblTrabajadores.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Codigo", "Nombres y Apellidos", "Seleccion" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.Boolean.class }; boolean[] canEdit = new boolean [] { false, false, true }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); tblTrabajadores.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { tblTrabajadoresMouseClicked(evt); } }); jScrollPane1.setViewportView(tblTrabajadores); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 0, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 236, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 0, Short.MAX_VALUE)) ); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Máquinas")); jLabel1.setText("Horneado"); jLabel2.setText("Relleno"); jLabel3.setText("Decorado"); jLabel4.setText("Empaque"); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .addContainerGap() .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel1) .add(jLabel2) .add(jLabel3) .add(jLabel4)) .add(59, 59, 59) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .add(txtEmpaque, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblEmpaque, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel2Layout.createSequentialGroup() .add(txtDecorado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblDecorado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel2Layout.createSequentialGroup() .add(txtRelleno, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblRelleno, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel2Layout.createSequentialGroup() .add(txtHorneado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblHorneado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel1) .add(txtHorneado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblHorneado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(txtRelleno, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel2)) .add(lblRelleno, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(txtDecorado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel3)) .add(lblDecorado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(txtEmpaque, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel4)) .add(lblEmpaque, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(0, 0, Short.MAX_VALUE)) ); btnDeseleccionar.setText("Deseleccionar Todo"); btnDeseleccionar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDeseleccionarActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(btnSiguiente, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(6, 6, 6) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(jLabel7) .add(18, 18, 18) .add(dpFechaInicio, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(27, 27, 27) .add(jLabel8) .add(18, 18, 18) .add(dpFechaFin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(0, 0, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap() .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(0, 0, Short.MAX_VALUE) .add(btnDeseleccionar))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jLabel7) .add(dpFechaInicio, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(dpFechaFin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel8)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(btnDeseleccionar) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 10, Short.MAX_VALUE) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(18, 18, 18) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(btnSiguiente, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private void btnSiguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSiguienteActionPerformed try { // 1. Validar los datos (falta implementar) if (datosValidos()) { ArrayList<modelos.Asignacion> listaAsignaciones = ControladorProduccion. buscarAsignacionesPorFechas(dpFechaInicio.getDate(), dpFechaFin.getDate()); if (!listaAsignaciones.isEmpty()) { JOptionPane.showMessageDialog(this, "Ya existen asignaciones registradas para las fechas seleccionadas"); } else { this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // 2. Obtener los datos del formulario int[] numMaquinas = new int[numActividades]; numMaquinas[0] = Integer.parseInt(txtHorneado.getText()); numMaquinas[1] = Integer.parseInt(txtRelleno.getText()); numMaquinas[2] = Integer.parseInt(txtDecorado.getText()); numMaquinas[3] = Integer.parseInt(txtEmpaque.getText()); ArrayList<Empleado> empleados = new ArrayList<>(); for (int i = 0; i < listaEmpleados.size(); i++) { if (listaSeleccion[i]) { empleados.add(listaEmpleados.get(i)); } } // 3. Realizar la asignacion Algoritmo.AsignacionAlgoritmo asignacionAlgoritmo = Algoritmo.ejecutar(dpFechaInicio.getDate(), dpFechaFin.getDate(), empleados, numMaquinas); if (asignacionAlgoritmo != null) { // 4. Mostrar ventana con el detalle for(int i=0;i<asignacionAlgoritmo.listaAsignacionxempleado.size();i++){ empleados.remove(asignacionAlgoritmo.listaAsignacionxempleado.get(i).getEmpleado()); } AsignacionDetalle asignacionDetalle = new AsignacionDetalle(asignacionAlgoritmo.asignacion, asignacionAlgoritmo.listaAsignacionxempleado, asignacionAlgoritmo.listaAsignacionxproducto, true,empleados); getDesktopPane().add(asignacionDetalle); asignacionDetalle.setVisible(true); } else { // 4. Mostrar dialogo de error JOptionPane.showMessageDialog(this, Algoritmo.getErrorMsg()); } } } } finally { this.setCursor(Cursor.getDefaultCursor()); } }//GEN-LAST:event_btnSiguienteActionPerformed private void tblTrabajadoresMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblTrabajadoresMouseClicked // TODO add your handling code here: if (evt.getClickCount() == 2) { int row = tblTrabajadores.getSelectedRow(); Empleado empleado = listaEmpleados.get(row); MuestraDesempeno muestraDesempeno = new MuestraDesempeno(empleado); getDesktopPane().add(muestraDesempeno); muestraDesempeno.setVisible(true); } }//GEN-LAST:event_tblTrabajadoresMouseClicked private void btnDeseleccionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeseleccionarActionPerformed if (seleccionarTodo) { for (int i = 0; i < listaSeleccion.length; i++) { listaSeleccion[i] = true; } btnDeseleccionar.setText("Deseleccionar Todo"); seleccionarTodo = false; } else { for (int i = 0; i < listaSeleccion.length; i++) { listaSeleccion[i] = false; } btnDeseleccionar.setText("Seleccionar Todo"); seleccionarTodo = true; } RefrescarTabla(); }//GEN-LAST:event_btnDeseleccionarActionPerformed public static boolean isNumeric(String str) { return str.matches("-?\\d+"); } private boolean datosValidos() { int cantidadTrabajadores = 0; for (int i = 0; i < listaSeleccion.length; i++) { if (listaSeleccion[i]) { cantidadTrabajadores++; } } if (dpFechaFin.getDate() != null && dpFechaInicio.getDate() != null && !txtHorneado.getText().equals("") && !txtDecorado.getText().equals("") && !txtEmpaque.getText().equals("") && !txtRelleno.getText().equals("") && isNumeric(txtHorneado.getText()) && isNumeric(txtDecorado.getText()) && isNumeric(txtEmpaque.getText()) && isNumeric(txtRelleno.getText()) && Integer.parseInt(txtHorneado.getText()) >= 0 && Integer.parseInt(txtDecorado.getText()) >= 0 && Integer.parseInt(txtEmpaque.getText()) >= 0 && Integer.parseInt(txtRelleno.getText()) >= 0 && cantidadTrabajadores > 0 && Integer.parseInt(txtHorneado.getText()) <= numMaximoMaquinas[0] && Integer.parseInt(txtRelleno.getText()) <= numMaximoMaquinas[1] && Integer.parseInt(txtDecorado.getText()) <= numMaximoMaquinas[2] && Integer.parseInt(txtEmpaque.getText()) <= numMaximoMaquinas[3]) { return true; } else { String error = ""; if (dpFechaInicio.getDate() == null) { error += "en el campo FechaInicio, "; } if (dpFechaFin.getDate() == null) { error += "en el campo FechaFin, "; } if (txtHorneado.getText().equals("")) { error += "en el campo Horneado, "; } else { if (isNumeric(txtHorneado.getText())) { if (Integer.parseInt(txtHorneado.getText()) < 0 || Integer.parseInt(txtHorneado.getText()) > numMaximoMaquinas[0]) { error += "en el campo Horneado, "; } } else { error += "en el campo Horneado, "; } } if (txtRelleno.getText().equals("")) { error += "en el campo Relleno, "; } else { if (isNumeric(txtRelleno.getText())) { if (Integer.parseInt(txtRelleno.getText()) < 0 || Integer.parseInt(txtRelleno.getText()) > numMaximoMaquinas[1]) { error += "en el campo Relleno, "; } } else { error += "en el campo Relleno, "; } } if (txtDecorado.getText().equals("")) { error += "en el campo Decorado, "; } else { if (isNumeric(txtDecorado.getText())) { if (Integer.parseInt(txtDecorado.getText()) < 0 || Integer.parseInt(txtDecorado.getText()) > numMaximoMaquinas[2]) { error += "en el campo Decorado, "; } } else { error += "en el campo Decorado, "; } } if (txtEmpaque.getText().equals("")) { error += "en el campo Empaque, "; } else { if (isNumeric(txtEmpaque.getText())) { if (Integer.parseInt(txtEmpaque.getText()) < 0 || Integer.parseInt(txtEmpaque.getText()) > numMaximoMaquinas[3]) { error += "en el campo Empaque, "; } } else { error += "en el campo Empaque, "; } } if (cantidadTrabajadores == 0) { error += "debe seleccionar trabajadores. "; } error = error.substring(0, error.length() - 2); JOptionPane.showMessageDialog(null, "Corrija lo ingresado, " + error + "."); return false; } // falta implementar: // -validacion de fechas // -validacion de numero de maquinas (no pasarse del máximo) } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnDeseleccionar; private javax.swing.JButton btnSiguiente; private com.toedter.calendar.JDateChooser dpFechaFin; private com.toedter.calendar.JDateChooser dpFechaInicio; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel lblDecorado; private javax.swing.JLabel lblEmpaque; private javax.swing.JLabel lblHorneado; private javax.swing.JLabel lblRelleno; private javax.swing.JTable tblTrabajadores; private javax.swing.JTextField txtDecorado; private javax.swing.JTextField txtEmpaque; private javax.swing.JTextField txtHorneado; private javax.swing.JTextField txtRelleno; // End of variables declaration//GEN-END:variables }
[ "[email protected]@d2fb4ea1-c673-223a-12b7-d629c895abf2" ]
[email protected]@d2fb4ea1-c673-223a-12b7-d629c895abf2
6c0c62af43738ea96fad64668c150811edad1f41
6da37d455474f985a063e77ca056bdbd00ed55ef
/src/main/java/br/com/zup/mercadolivre/produto/opiniao/Opiniao.java
76420e62a77e8d6186f64fd40c2ba97333548ddc
[ "Apache-2.0" ]
permissive
CaioRobertoAbreu/orange-talents-03-template-ecommerce
fb35c292f7f20d27eca3e47d3ad7a0a58e713740
d47f4bde37692cd9234b635fcde469caf2018106
refs/heads/main
2023-04-10T00:53:37.386076
2021-04-15T12:54:30
2021-04-15T12:54:30
355,217,789
0
0
Apache-2.0
2021-04-06T14:24:16
2021-04-06T14:24:16
null
UTF-8
Java
false
false
1,138
java
package br.com.zup.mercadolivre.produto.opiniao; import br.com.zup.mercadolivre.produto.Produto; import br.com.zup.mercadolivre.usuario.Usuario; import javax.persistence.*; import javax.validation.Valid; @Entity public class Opiniao { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false) private int nota; @Column(nullable = false) private String titulo; @Column(nullable = false, columnDefinition = "TEXT", length = 500) private String descricao; @ManyToOne @Valid private Usuario usuario; @ManyToOne @Valid private Produto produto; public Opiniao(int nota, String titulo, String descricao, Usuario usuario, Produto produto) { this.nota = nota; this.titulo = titulo; this.descricao = descricao; this.usuario = usuario; this.produto = produto; } @Deprecated public Opiniao() { } public int getNota() { return nota; } public String getTitulo() { return titulo; } public String getDescricao() { return descricao; } }
c4bcb4d2d36be7bd9d45b48cd8a14809b941e3f2
06abfc18f198bda9b1963e8653bdef228ad29186
/moneyService/mgm-domain/src/main/java/com/github/hqh/mgm/domain/message/DepositResultMessage.java
ebb71f9d674daa02dbf598830ec415b1a904ab7f
[ "Apache-2.0" ]
permissive
huqinghua/DOMA
3ac75ba527b7e5d72ecc9aeaf19f0b049b2ddeb1
b65de044983450822891e3aec9682486d7757058
refs/heads/main
2023-04-15T00:17:59.920769
2021-04-17T01:22:37
2021-04-17T01:22:37
315,949,007
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
package com.github.hqh.mgm.domain.message; import com.github.hqh.mgm.domain.moneyaccount.Money; import com.github.hqh.mgm.domain.user.UserId; import com.google.gson.Gson; import lombok.AllArgsConstructor; import lombok.Data; import lombok.ToString; /** * @author :huqinghua * @description: */ @Data @AllArgsConstructor @ToString public class DepositResultMessage { private Long id; private UserId userId; private Money money; private Boolean status; public static DepositResultMessage deserialize(String json) { Gson gson = new Gson(); return gson.fromJson(json, DepositResultMessage.class); } public static String serialize(DepositResultMessage depositResultMessage) { return new Gson().toJson(depositResultMessage); } }
4a431c7afab5caf2e7caeffad2ec0f1dba77ef28
99ea7386e27963fc8906c825e86594c1bd45a826
/src/main/java/cn/mcsj/demo/dto/req/ReqRegisterSendEmailBean.java
7f47f4a5e34f58680fa81ca49181274297128330
[]
no_license
leilecoffee/demo
607e88fd9bf9a77e4c864745eae034a0ad7ddd66
fd7fcbf191bc6b0aba1531a1110213ba73d4a310
refs/heads/master
2020-04-07T16:15:53.115764
2018-11-26T15:30:34
2018-11-26T15:30:34
158,521,926
0
0
null
null
null
null
UTF-8
Java
false
false
315
java
package cn.mcsj.demo.dto.req; /** * * @Description: TODO(描述类) * @author admin * @date 2018年11月21日 下午5:07:56 * */ public class ReqRegisterSendEmailBean { private String email; public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
6b0c976f95ce7b3bea37a3629d687ed43d837f2d
c61510aaed935ad0fb2088b1f9209300dea1cd85
/Indicators/src/main/java/org/cabr/stockmarket/utils/Quotes.java
8287f2ed968ab4463b727ce1716484ee424a6c77
[]
no_license
ged4/StockMarketProject
0da76543cae12eb31003916eea40773a2b140ee4
2dd95b88196ae373ad2bf933414b4b5e342ca2dd
refs/heads/master
2016-09-09T18:38:13.978954
2014-05-03T16:32:39
2014-05-03T16:32:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
991
java
package org.cabr.stockmarket.utils; public class Quotes { private String symbol; private Double opening; private Double closing; private Double minimal; private Double maximal; private Double volumen; public String getSymbol() { return symbol; } public Double getOpening() { return opening; } public Double getClosing() { return closing; } public Double getMinimal() { return minimal; } public Double getMaximal() { return maximal; } public Double getVolumen() { return volumen; } public void setSymbol(String symbol) { this.symbol = symbol; } public void setOpening(Double opening) { this.opening = opening; } public void setClosing(Double closing) { this.closing = closing; } public void setMinimal(Double minimal) { this.minimal = minimal; } public void setMaximal(Double maximal) { this.maximal = maximal; } public void setVolumen(Double volumen) { this.volumen = volumen; } }
18cefd347b1d71d29548295374cb0a0b40a2f1da
108542e93f7c9c1d2aa36a04d597c75e221ae463
/BSCCollect/SpringHibernateExample/src/main/java/com/bsc/collect/model/PasswordEncoder.java
72bf21064449e44b4841885f7acbe668bd19881b
[]
no_license
hasithalakmal/BSCCollect
36694fc8e1c04dba2a2cd4096fc0f719c51596de
2022ffba58b9e24e9531d57da76bec064034f336
refs/heads/master
2021-01-10T11:38:06.473290
2016-01-11T12:17:37
2016-01-11T12:17:37
43,597,815
0
0
null
null
null
null
UTF-8
Java
false
false
1,593
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.bsc.collect.model; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Hasitha */ public class PasswordEncoder { private SecureRandom random = new SecureRandom(); public String Encode(String pass) { try { String password = pass; MessageDigest md = MessageDigest.getInstance("MD5"); md.update(password.getBytes()); byte byteData[] = md.digest(); //convert the byte to hex format method 1 StringBuilder sb = new StringBuilder(); for (int i = 0; i < byteData.length; i++) { sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1)); } String newpass = (sb.toString()); return newpass; } catch (NoSuchAlgorithmException ex) { Logger.getLogger(PasswordEncoder.class.getName()).log(Level.SEVERE, null, ex); return "error"; } } public String nextPassword() { return new BigInteger(50, random).toString(32); } public static void main(String[] args) { PasswordEncoder pe = new PasswordEncoder(); String x = pe.Encode("massa"); System.out.println(x); } }
7898b046adc2c857e9f19141d4a7e6118159b2d5
eed16ff963e7f13918bd5a51b1549a3815eaca4c
/src/com/planet/SearchPlanetServlet.java
80118528b63b20fd4358832134de4d659982540c
[]
no_license
uthpala123/SearchPlanet
b489d5b9216f5c8d485691d65b6d1595c62fed2f
96380f3234eacffb0bce5b0ec043e33b97f06987
refs/heads/master
2021-01-17T06:39:48.889725
2013-07-30T20:05:43
2013-07-30T20:05:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
341
java
package com.planet; import java.io.IOException; import javax.servlet.http.*; @SuppressWarnings("serial") public class SearchPlanetServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); resp.getWriter().println("Hello, world"); } }
1b4ad3db8039767d5f7f486017a55ebbff7a7e19
e330fc04e61fa2d6f045abb5c861d7410f6ea33d
/09-11-selenium/src/test/java/de/trion/training/api/TrainingApiTest.java
0ccea78dbc0cc87a73a019e533918b71831b38d0
[]
no_license
atzomat/spring-boot
24bbd537728832642c23bead9b47a5388c5f3f93
24969eec55edbc1aaa20d57f6858b3e1326b1f6a
refs/heads/main
2023-08-11T12:22:29.802695
2021-10-11T20:17:14
2021-10-11T20:17:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,980
java
package de.trion.training.api; import de.trion.training.web.InstructorDto; import de.trion.training.web.TrainingDto; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.json.AutoConfigureJsonTesters; import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.json.BasicJsonTester; import org.springframework.boot.test.json.JacksonTester; import org.springframework.http.MediaType; import org.springframework.restdocs.RestDocumentationExtension; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.in; import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document; import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessResponse; import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; @ActiveProfiles("test") @SpringBootTest @AutoConfigureJsonTesters @AutoConfigureMockMvc @AutoConfigureRestDocs @ExtendWith(RestDocumentationExtension.class) public class TrainingApiTest { @Autowired private MockMvc mockMvc; @Autowired private BasicJsonTester jsonTester; @Autowired private JacksonTester<TrainingDto> jacksonTester; @Test public void get() throws Exception { String content = mockMvc.perform(MockMvcRequestBuilders.get("/api/trainings") .param("size", "7")) //.andDo(print()) .andDo(document("get", preprocessResponse(prettyPrint()))) .andReturn().getResponse().getContentAsString(); assertThat(jsonTester.from(content)) .extractingJsonPathArrayValue("$").hasSize(7); } @Test public void add() throws Exception { var training = new TrainingDto(); training.setTopic("Testing"); training.setLocation("Unit Test"); var instructor = new InstructorDto(); instructor.setName("Mr. Robot"); training.setInstructor(instructor); String content = mockMvc.perform(MockMvcRequestBuilders.post("/api/trainings") .contentType(MediaType.APPLICATION_JSON) .content(jacksonTester.write(training).getJson())) //.andDo(print()) .andReturn().getResponse().getContentAsString(); assertThat(jacksonTester.parseObject(content)) .extracting(TrainingDto::getTopic) .isEqualTo("Testing"); } }
2d852015fe6bfb005a02401f050f8d58a4aabc91
3ea49853699167c9de7f75bae954a64d49e634d8
/sm-core/src/main/java/com/salesmanager/core/business/modules/order/total/ManufacturerShippingCodeOrderTotalModuleImpl.java
29206f25cc6e0c63a5060472d51860e45fd22d80
[ "Apache-2.0" ]
permissive
smanasawala52/sams-ecommerce
323faaf608e5ecc0239c45fc32a3d2e1135ac034
d11014c90d6cb9eb26387d0f68ed5a15892a7c79
refs/heads/master
2022-12-27T11:39:44.475189
2020-10-10T20:14:34
2020-10-10T20:14:34
302,858,099
0
0
null
null
null
null
UTF-8
Java
false
false
4,300
java
package com.salesmanager.core.business.modules.order.total; import java.math.BigDecimal; import org.apache.commons.lang.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.salesmanager.core.business.constants.Constants; import com.salesmanager.core.business.services.catalog.product.PricingService; import com.salesmanager.core.model.catalog.product.Product; import com.salesmanager.core.model.catalog.product.price.FinalPrice; import com.salesmanager.core.model.customer.Customer; import com.salesmanager.core.model.merchant.MerchantStore; import com.salesmanager.core.model.order.OrderSummary; import com.salesmanager.core.model.order.OrderTotal; import com.salesmanager.core.model.order.OrderTotalType; import com.salesmanager.core.model.shoppingcart.ShoppingCartItem; import com.salesmanager.core.modules.order.total.OrderTotalPostProcessorModule; /** * Add variation to the OrderTotal * This has to be defined in sams-core-ordertotal-processors * @author carlsamson * */ @Component public class ManufacturerShippingCodeOrderTotalModuleImpl implements OrderTotalPostProcessorModule { private static final Logger LOGGER = LoggerFactory.getLogger(ManufacturerShippingCodeOrderTotalModuleImpl.class); private String name; private String code; //private StatelessKnowledgeSession orderTotalMethodDecision;//injected from xml file //private KnowledgeBase kbase;//injected from xml file //@Inject //KieContainer kieManufacturerBasedPricingContainer; PricingService pricingService; public PricingService getPricingService() { return pricingService; } public void setPricingService(PricingService pricingService) { this.pricingService = pricingService; } @Override public OrderTotal caculateProductPiceVariation(final OrderSummary summary, ShoppingCartItem shoppingCartItem, Product product, Customer customer, MerchantStore store) throws Exception { Validate.notNull(product,"product must not be null"); Validate.notNull(product.getManufacturer(),"product manufacturer must not be null"); //requires shipping summary, otherwise return null if(summary.getShippingSummary()==null) { return null; } OrderTotalInputParameters inputParameters = new OrderTotalInputParameters(); inputParameters.setItemManufacturerCode(product.getManufacturer().getCode()); inputParameters.setShippingMethod(summary.getShippingSummary().getShippingOptionCode()); LOGGER.debug("Setting input parameters " + inputParameters.toString()); /* KieSession kieSession = kieManufacturerBasedPricingContainer.newKieSession(); kieSession.insert(inputParameters); kieSession.fireAllRules();*/ //orderTotalMethodDecision.execute(inputParameters); LOGGER.debug("Applied discount " + inputParameters.getDiscount()); OrderTotal orderTotal = null; if(inputParameters.getDiscount() != null) { orderTotal = new OrderTotal(); orderTotal.setOrderTotalCode(Constants.OT_DISCOUNT_TITLE); orderTotal.setOrderTotalType(OrderTotalType.SUBTOTAL); orderTotal.setTitle(Constants.OT_SUBTOTAL_MODULE_CODE); //calculate discount that will be added as a negative value FinalPrice productPrice = pricingService.calculateProductPrice(product); Double discount = inputParameters.getDiscount(); BigDecimal reduction = productPrice.getFinalPrice().multiply(new BigDecimal(discount)); reduction = reduction.multiply(new BigDecimal(shoppingCartItem.getQuantity())); orderTotal.setValue(reduction); } return orderTotal; } /* public KnowledgeBase getKbase() { return kbase; } public void setKbase(KnowledgeBase kbase) { this.kbase = kbase; } public StatelessKnowledgeSession getOrderTotalMethodDecision() { return orderTotalMethodDecision; } public void setOrderTotalMethodDecision(StatelessKnowledgeSession orderTotalMethodDecision) { this.orderTotalMethodDecision = orderTotalMethodDecision; }*/ @Override public String getName() { return name; } @Override public void setName(String name) { this.name = name; } @Override public String getCode() { return code; } @Override public void setCode(String code) { this.code = code; } }
a2e3a768195905e4f6b6b66f0b887f87d0c526d5
c8e555ecc185529ba064d40b85f88dcd787acde2
/mobile/src/main/java/edu/umich/dpm/sensorgrabber/data/SensorDataHandlerToFile.java
fae84f7111bfdccd953a530762cf6135dec45218
[]
no_license
ahmed-shariff/sensor-grabber
ba9367b6775a1716df61e588e12d1bbcc51fd4a9
d8f5a809a1acd83a2535a0b5a2abe85c9f7de452
refs/heads/master
2021-03-16T15:10:44.761904
2015-11-16T00:06:43
2015-11-16T00:06:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,893
java
package edu.umich.dpm.sensorgrabber.data; import android.hardware.Sensor; import android.util.Log; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.Hashtable; import edu.umich.dpm.sensorgrabber.sensor.SensorQueue; public class SensorDataHandlerToFile implements SensorDataHandler { private static final String TAG = "SensorDataHandlerToFile"; private final Hashtable<Integer, FileHandler> mFileHandlers = new Hashtable<>(5); private String mFileNamePrefix = ""; private Date mSessionStartTime; @Override public void onStreamStarted() { Log.d(TAG, "onStreamStarted"); mSessionStartTime = Calendar.getInstance().getTime(); mFileNamePrefix = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(mSessionStartTime); } @Override public void onStreamStopped() { Log.d(TAG, "onStreamStopped"); for (FileHandler handler : mFileHandlers.values()) { handler.close(); } mFileHandlers.clear(); } @Override public void receiveData(Collection<SensorQueue> data) { Log.d(TAG, "Received " + data.size() + " queues"); for (SensorQueue queue : data) { Log.d(TAG, "Writing queue w/ starting timestamp = " + String.valueOf(queue.getReadings()[0].getTimestamp())); int sensor = queue.getSensorType(); FileHandler handler = mFileHandlers.get(sensor); try { if (handler == null) { String filename = makeFileName(sensor); Log.d(TAG, "Making new file handler: " + filename); handler = new FileHandler(filename, mSessionStartTime); mFileHandlers.put(sensor, handler); } handler.writeQueue(queue); } catch (IOException e) { Log.e(TAG, "Unable to decode data: " + e.getMessage()); e.printStackTrace(); } } } public static String sensorStringId(int sensor) { switch (sensor) { case Sensor.TYPE_ACCELEROMETER: return "Accelerometer"; case Sensor.TYPE_GYROSCOPE: return "Gyroscope"; case Sensor.TYPE_GYROSCOPE_UNCALIBRATED: return "GyroscopeUncalibrated"; case Sensor.TYPE_HEART_RATE: return "HeartRate"; case Sensor.TYPE_ROTATION_VECTOR: return "RotationVector"; case Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR: return "GeomagneticRotationVector"; case Sensor.TYPE_GAME_ROTATION_VECTOR: return "GameRotationVector"; case Sensor.TYPE_LINEAR_ACCELERATION: return "LinearAcceleration"; case Sensor.TYPE_GRAVITY: return "Gravity"; case Sensor.TYPE_MAGNETIC_FIELD: return "MagneticField"; case Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED: return "MagneticFieldUncalibrated"; case Sensor.TYPE_PROXIMITY: return "Proximity"; case Sensor.TYPE_SIGNIFICANT_MOTION: return "SignificantMotion"; case Sensor.TYPE_STEP_COUNTER: return "StepCounter"; case Sensor.TYPE_STEP_DETECTOR: return "StepDetector"; case Sensor.TYPE_AMBIENT_TEMPERATURE: return "AmbientTemperature"; case Sensor.TYPE_LIGHT: return "Light"; case Sensor.TYPE_PRESSURE: return "Pressure"; case Sensor.TYPE_RELATIVE_HUMIDITY: return "RelativeHumidity"; default: return "Unknown"; } } public static String sensorDisplayName(int sensor) { switch (sensor) { case Sensor.TYPE_ACCELEROMETER: return "Accelerometer"; case Sensor.TYPE_GYROSCOPE: return "Gyroscope"; case Sensor.TYPE_GYROSCOPE_UNCALIBRATED: return "Gyroscope (uncalibrated)"; case Sensor.TYPE_HEART_RATE: return "Heart rate"; case Sensor.TYPE_ROTATION_VECTOR: return "Rotation vector"; case Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR: return "Geomagnetic rotation vector"; case Sensor.TYPE_GAME_ROTATION_VECTOR: return "Game rotation vector"; case Sensor.TYPE_LINEAR_ACCELERATION: return "Linear acceleration"; case Sensor.TYPE_GRAVITY: return "Gravity"; case Sensor.TYPE_MAGNETIC_FIELD: return "Magnetic field"; case Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED: return "Magnetic field (uncalibrated)"; case Sensor.TYPE_PROXIMITY: return "Proximity"; case Sensor.TYPE_SIGNIFICANT_MOTION: return "Significant motion"; case Sensor.TYPE_STEP_COUNTER: return "Step counter"; case Sensor.TYPE_STEP_DETECTOR: return "Step detector"; case Sensor.TYPE_AMBIENT_TEMPERATURE: return "Ambient temperature"; case Sensor.TYPE_LIGHT: return "Light"; case Sensor.TYPE_PRESSURE: return "Pressure"; case Sensor.TYPE_RELATIVE_HUMIDITY: return "Relative humidity"; default: return "Unknown"; } } private String makeFileName(int sensor) { return mFileNamePrefix + "_" + sensorStringId(sensor); } }
b6684994d0b9f266ef569606666d8fb76244eea0
3617ffceef0b9d5f5773302fcfab21c23082dbe4
/app/src/main/java/plspray/infoservices/lue/plspray/MainActivity.java
58a45a990fdaac1d0248221e891a7ff5e54ed705
[]
no_license
Ritesh786/PlsPray
f9223ed08bd52bcb39eb2a7e9904c2a28b8a9560
f5a9d6f84335d4ef853134028f36e19150209b52
refs/heads/master
2021-01-01T16:53:32.269049
2017-07-31T11:55:59
2017-07-31T11:55:59
97,942,098
0
0
null
null
null
null
UTF-8
Java
false
false
8,641
java
package plspray.infoservices.lue.plspray; import android.*; import android.Manifest; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.util.Base64; import android.util.Log; import android.view.View; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; import com.mikhaellopez.circularimageview.CircularImageView; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.List; import plspray.infoservices.lue.plspray.databind.ContactList; import plspray.infoservices.lue.plspray.databind.User; import plspray.infoservices.lue.plspray.fragment.ContactListFragment; import plspray.infoservices.lue.plspray.fragment.GroupFragment; import plspray.infoservices.lue.plspray.fragment.GroupTwo; import plspray.infoservices.lue.plspray.utilities.AppConstants; import plspray.infoservices.lue.plspray.utilities.GlobalVariables; import plspray.infoservices.lue.plspray.utilities.MarshmallowPermission; import plspray.infoservices.lue.plspray.utilities.SharedPreferenceClass; import plspray.infoservices.lue.plspray.utilities.UtilityClass; public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener ,ContactListFragment.OnListFragmentInteractionListener,GroupFragment.OnListFragmentInteractionListener { TextView usernameText, emailText, phoneText; CircularImageView userImageVIew; View header; Context context; public static MainActivity mainActivity; String userid=""; String groupId=""; UserSessionManager session; public static List<ContactList> contactListList; String name; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); session = new UserSessionManager(getApplicationContext()); context = this; mainActivity = this; DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); header = navigationView.getHeaderView(0); initialize(); // Toast.makeText(getApplicationContext(), // "User Login Status: " + session.isUserLoggedIn(), // Toast.LENGTH_LONG).show(); if (session.checkLogin()) finish(); HashMap<String, String> user = session.getSaveUserDetail(); // get name name = user.get(UserSessionManager.KEY_name); usernameText = (TextView) header.findViewById(R.id.usernameText); usernameText.setText(name); Log.d("username1211","ljo;non"+name); } @Override public void onBackPressed() { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { super.onBackPressed(); } } private void initialize() { // usernameText = (TextView) header.findViewById(R.id.usernameText); // usernameText.setText(name); userImageVIew = (CircularImageView) header.findViewById(R.id.userImageVIew); phoneText = (TextView) header.findViewById(R.id.phoneText); setUserInfo(); // MarshmallowPermission permission = new MarshmallowPermission(this, Manifest.permission.READ_CONTACTS); // if (permission.result == -1 || permission.result == 0) { // try { replaceFragment(); // } catch (Exception e) { // e.printStackTrace(); // } // } else if (permission.result == 1) { // replaceFragment(); // } } public void setUserInfo() { User user = SharedPreferenceClass.getUserInfo(this); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); String name = preferences.getString("imageurl", ""); if (user != null) { // usernameText.setText(user.getFirst_name() + " " + user.getLast_name()); if (!user.getPhone().trim().equals("")) phoneText.setText(user.getPhone()); // UtilityClass.getImage(context, name, userImageVIew, R.drawable.praying_hands); userImageVIew.setImageBitmap(StringToBitMap(name)); Log.d("userpic0","uer141"+name); } } public Bitmap StringToBitMap(String encodedString) { try { byte[] encodeByte = Base64.decode(encodedString, Base64.DEFAULT); Bitmap bitmap = BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.length); return bitmap; } catch (Exception e) { e.getMessage(); return null; } } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.home) { ContactListFragment contactListFragment=new ContactListFragment(); FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.frame1,contactListFragment); fragmentTransaction.commit(); } else if (id == R.id.createGroup) { startActivity(new Intent(context, CreateGroupActivity.class)); } else if (id == R.id.profile) { startActivity(new Intent(context, ProfileActivity.class)); finish(); } else if (id == R.id.sendmsggroup) { GroupTwo groupFragment=new GroupTwo(); FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.frame1,groupFragment); fragmentTransaction.commit(); } else if (id == R.id.logout) { logOut(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } private void logOut() { // SharedPreferenceClass.setLogin(context, false); // SharedPreferenceClass.clearUserInfo(context); // GlobalVariables.profilePic = null; // startActivity(new Intent(context, LoginActivity.class)); session.logoutUser(); MainActivity.this.finish(); } @Override public void onListFragmentInteraction(ContactList item) { Intent i=new Intent(context,SendScheduleActivity.class); i.putExtra(AppConstants.GROUPID,groupId); if(!item.getName().trim().equals("")) i.putExtra(AppConstants.CONTACT_NAME,item.getName()); else i.putExtra(AppConstants.CONTACT_NAME,item.getNumber()); i.putExtra(AppConstants.USERID,item.getId()); startActivity(i); } @Override protected void onResume() { super.onResume(); } private void replaceFragment() { ContactListFragment contactListFragment=new ContactListFragment(); FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.frame1,contactListFragment); fragmentTransaction.commit(); } }
cc4e23407f7d86870075656676603e8bd3ab80eb
2a2d4decd96e78aaa2368ba4187f5e9a485af104
/src/main/java/com/algorithms/algorithms/searching/BaseSearchingExample.java
bfc3df45aa5502cd1e76908e2985ae0278621aa8
[]
no_license
CancerLiu/BasicAlgorithms
617c7260b619b23aa74185d9d088ae4e46522ca8
d5c2aa82faa8a0cb78c90e4c391c88aaa372fbce
refs/heads/master
2021-05-26T03:13:31.913702
2020-04-08T08:55:03
2020-04-08T08:55:03
254,029,491
0
2
null
null
null
null
UTF-8
Java
false
false
86
java
package com.algorithms.algorithms.searching; public class BaseSearchingExample { }
6d1624ca8cb25cd5a7dcdcfa232c22b018c7ca2b
72286efebc695d139fda1a69b6724dadbb486c14
/src/main/java/com/sun/syndication/io/impl/RSS093Generator.java
1e2a6561a7defa5878e6edb668abadce851de306
[]
no_license
kzn/rome-old
eea35a6c05a7eb9281f73257050847bc6ccab3e7
0133e80285184fa5af5b168cf9d9c64ef006f9c1
refs/heads/master
2021-01-10T21:24:56.241764
2013-03-19T10:23:41
2013-03-19T10:23:41
8,872,703
1
3
null
2020-06-10T23:52:38
2013-03-19T06:59:41
Java
UTF-8
Java
false
false
1,855
java
/* * Copyright 2004 Sun Microsystems, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.sun.syndication.io.impl; import com.sun.syndication.feed.rss.Enclosure; import com.sun.syndication.feed.rss.Item; import org.jdom2.Element; import java.util.Date; import java.util.List; /** * Feed Generator for RSS 0.93 * <p/> * * @author Elaine Chien * */ public class RSS093Generator extends RSS092Generator { public RSS093Generator() { this("rss_0.93","0.93"); } protected RSS093Generator(String feedType,String version) { super(feedType,version); } protected void populateItem(Item item, Element eItem, int index) { super.populateItem(item,eItem, index); Date pubDate = item.getPubDate(); if (pubDate != null) { eItem.addContent(generateSimpleElement("pubDate", DateParser.formatRFC822(pubDate))); } Date expirationDate = item.getExpirationDate(); if (expirationDate != null) { eItem.addContent(generateSimpleElement("expirationDate", DateParser.formatRFC822(expirationDate))); } } // Another one to thanks DW for protected int getNumberOfEnclosures(List<Enclosure> enclosures) { return enclosures.size(); } }
df716f27edaf878ba40449d6708ed75f422ef8fc
ac820e5362df4dc93cb27a3417302bd8d222f5e2
/To Do List/src/main/java/com/example/todolist/TaskItem.java
3e7fb28d723d6f22b7b239bd02775e20c29b6ed7
[]
no_license
Alif414/Android-To-Do-List
7efbf3504b2c22c3c3316d9d6c6a2f143006f5be
2bc6d97ef29541926ce2fb105ef5f67da3d06e7c
refs/heads/main
2023-06-19T04:20:15.977281
2021-07-10T18:17:04
2021-07-10T18:17:04
381,397,293
0
0
null
null
null
null
UTF-8
Java
false
false
2,834
java
package com.example.todolist; import android.os.Parcel; import android.os.Parcelable; public class TaskItem implements Parcelable { private int id; private String title; private String date; private String details; private String priority; private String complete; public TaskItem(String title, String date, String details, String priority, String complete) { this.title = title; this.date = date; this.details = details; this.priority = priority; this.complete = complete; } public TaskItem() { } public TaskItem(int id, String title, String date, String details, String priority, String complete) { this.id = id; this.title = title; this.date = date; this.details = details; this.priority = priority; this.complete = complete; } public int getId() { return id; } public String getTitle() { return title; } public String getDate() { return date; } public String getDetails() { return details; } public String getPriority() { return priority; } public String getComplete() { return complete; } public void setId(int id) { this.id = id; } public void setTitle(String title) { this.title = title; } public void setDate(String date) { this.date = date; } public void setDetails(String details) { this.details = details; } public void setPriority(String priority) { this.priority = priority; } public void setComplete(String complete) { this.complete = complete; } @Override public int describeContents() { return 0; } //Functions to make task parcelable @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(id); dest.writeString(title); dest.writeString(date); dest.writeString(details); dest.writeString(priority); dest.writeString(complete); } public TaskItem(Parcel parcel){ id = parcel.readInt(); title = parcel.readString(); date = parcel.readString(); details = parcel.readString(); priority = parcel.readString(); complete = parcel.readString(); } public static final Parcelable.Creator<TaskItem> CREATOR = new Parcelable.Creator<TaskItem>() { @Override public TaskItem createFromParcel(Parcel parcel) { return new TaskItem(parcel); } @Override public TaskItem[] newArray(int size) { return new TaskItem[0]; } }; }
a06c52f42f2c0653182bc873d84cfe8e9979cc41
f9afe93b7c482674c1f56cb2880a8d8611dcdc2b
/curso_Java_com_JUnit5/Tema5/src/main/java/Tema5/Interruptor.java
c388d83d9de6215374a3d4dbe9b7edc2a6f62472
[]
no_license
isabellavecchi/POO_Java
316e1f96e3b69ad6d6eb948b97ffc4bc467bb253
08b5ac5dfe42b3ad47419ae83b634ac6cf26bf1c
refs/heads/master
2023-03-15T13:26:14.222686
2023-03-11T14:07:14
2023-03-11T14:07:14
284,599,420
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
package Tema5; public class Interruptor { protected Lampada lampada; public Interruptor(Lampada lampada) { this.lampada = lampada; } public void switchState() { if (this.lampada.getEstado()) { this.lampada.off(); } else { this.lampada.on(); } } }
b551ea54bff34696cfed902879e7188d8e60ebef
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.browser-base/sources/org/chromium/chrome/browser/explore_sites/ExploreSitesBackgroundTask.java
b01ad9ba2121e7108df960e132eeded4730bea03
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
1,942
java
package org.chromium.chrome.browser.explore_sites; import J.N; import android.content.Context; import org.chromium.base.ContextUtils; import org.chromium.chrome.browser.profiles.Profile; /* compiled from: chromium-OculusBrowser.apk-stable-281887347 */ public class ExploreSitesBackgroundTask extends AbstractC4798sm0 { public AbstractC0804Ne f; public Profile g; public static void l(boolean z) { AbstractC2898hf.b().a(ContextUtils.getApplicationContext(), 100); C1416Xe1 xe1 = new C1416Xe1(); xe1.f9225a = 90000000; xe1.b = 7200000; xe1.c = true; C1477Ye1 a2 = xe1.a(); C1111Se1 se1 = new C1111Se1(101); se1.g = a2; se1.c = 1; se1.e = true; se1.f = z; AbstractC2898hf.b().b(ContextUtils.getApplicationContext(), se1.a()); } @Override // defpackage.AbstractC0865Oe public void c(Context context) { l(true); } @Override // defpackage.AbstractC4798sm0 public int e(Context context, C2046cf1 cf1, AbstractC0804Ne ne) { return C5222vE.d(context) == 6 ? 1 : 0; } @Override // defpackage.AbstractC4798sm0 public void f(Context context, C2046cf1 cf1, AbstractC0804Ne ne) { if (!(N.MwBQ$0Eq() == 0)) { AbstractC2898hf.b().a(ContextUtils.getApplicationContext(), 101); return; } this.f = ne; if (this.g == null) { this.g = Profile.b(); } N.MYfYpI3c(this.g, false, new C5753yM(this)); AbstractC3364kK0.g("ExploreSites.CatalogUpdateRequestSource", 2, 3); } @Override // defpackage.AbstractC4798sm0 public boolean g(Context context, C2046cf1 cf1) { return false; } @Override // defpackage.AbstractC4798sm0 public boolean h(Context context, C2046cf1 cf1) { return false; } public final /* synthetic */ void k() { this.f.a(false); } }
da768a71fc6e545b583e6b1d4c762bcc53a9d55c
f4e5bee30c072ccf6473dba7d6402c01f303c12c
/javaweb-showcase/javaweb-showcase-fullstack/src/test/java/org/javaweb/showcase/test/chaos/TransferBigFile.java
97fc073d4e26cde34a80fc0fc0765aa57692e976
[]
no_license
job2wd/javaweb
2091c14685bf4e8e2fc5ca3e3db2c96583826b9f
93c2bb021b84adc40a663516388c254e04d70e5b
refs/heads/master
2020-04-03T18:37:27.376732
2018-10-31T06:31:39
2018-10-31T06:31:39
155,491,140
0
0
null
null
null
null
UTF-8
Java
false
false
2,803
java
/** * $Id: TransferBigFile.java 80 2017-01-20 04:21:11Z job2wd $ */ package org.javaweb.showcase.test.chaos; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.net.ServerSocket; import java.net.Socket; /** * @author weidong_wang * @version $Revision: 80 $ $Date: 2017-01-20 12:21:11 +0800 (星期五, 20 一月 2017) $ */ public class TransferBigFile { public static final int BUFFER_SIZE = 1024 * 50; private byte[] buffer; /** * */ public TransferBigFile() { buffer = new byte[BUFFER_SIZE]; } private void startServer() throws Exception { long start = System.currentTimeMillis(); ServerSocket socket = new ServerSocket(9000); Socket client = socket.accept(); BufferedInputStream in = new BufferedInputStream(new FileInputStream("C:/TEMP/100m.rar")); BufferedOutputStream out = new BufferedOutputStream(client.getOutputStream()); int len = 0; while ((len = in.read(buffer)) > 0) { out.write(buffer, 0, len); // System.out.print("#"); } in.close(); out.flush(); out.close(); client.close(); socket.close(); System.out.println("\nDone!"); long end = System.currentTimeMillis(); System.out.println("Server send Take time: " + (end - start) / 1000 + " Seconds"); } private void startClient() throws Exception { long start = System.currentTimeMillis(); Socket socket = new Socket("localhost", 9000); BufferedInputStream in = new BufferedInputStream(socket.getInputStream()); BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream("C:/TEMP/100m_new.rar")); int len = 0; while ((len = in.read(buffer)) > 0) { out.write(buffer, 0, len); // System.out.print("#"); } in.close(); out.flush(); out.close(); socket.close(); System.out.println("\nDone!"); long end = System.currentTimeMillis(); System.out.println("Client accept Take time: " + (end - start) / 1000 + " Seconds"); } /** * @param args */ public static void main(String[] args) { final TransferBigFile transfer = new TransferBigFile(); // Server Send message Thread server = new Thread(new Runnable() { @Override public void run() { try { transfer.startServer(); } catch (Exception e) { e.printStackTrace(); } } }); // Client Accept message Thread client = new Thread(new Runnable() { @Override public void run() { try { transfer.startClient(); } catch (Exception e) { e.printStackTrace(); } } }); // Start Server and Client server.start(); client.start(); } }
936e79b5969aa77f708e51eb3c52415e472ea2a0
eaed2ad43b90608d353a234aefac19b557e93873
/RetrieveXML.java
2ccfabedcafee45c1286dfd00c596b66fef20c00
[]
no_license
joshboros/scDataBase
2f214dd048065941346a327a6a07ca7484231b4b
331768ea368ab69da954b6ef8f83b08dba207f60
refs/heads/master
2021-08-23T01:29:20.256744
2017-12-02T04:53:04
2017-12-02T04:53:04
107,589,875
1
1
null
2017-10-25T19:05:05
2017-10-19T19:34:49
Java
UTF-8
Java
false
false
6,738
java
import java.awt.List; import java.io.File; import java.io.IOException; import java.util.Arrays; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.*; import org.xml.sax.SAXException; public class RetrieveXML { /** * Default constructor */ private String dpath; public RetrieveXML(String path) { dpath = path; } /** * Function to return question IDs for later output processing. * @param section * @return List of integer values of questions that are of the given difficulty */ public List returnBySection(int section){ List questionsToReturn = new List(); try { DocumentBuilderFactory dBF = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = dBF.newDocumentBuilder(); Document database = docBuilder.parse(new File(dpath)); NodeList listOfQuestions = database.getElementsByTagName("question"); for(int i=0; i<listOfQuestions.getLength(); i++) { Node firstQuestion = listOfQuestions.item(i); Element firstQuestionE = (Element)firstQuestion; NodeList sectionlist = firstQuestionE.getElementsByTagName("section"); Element firstSectionElement = (Element)sectionlist.item(0); NodeList textSectionList = firstSectionElement.getChildNodes(); double sectionvalue = Double.valueOf(textSectionList.item(0).getNodeValue().trim()); if (sectionvalue == section) { NodeList idlist = firstQuestionE.getElementsByTagName("id"); Element firstIDElement = (Element)idlist.item(0); NodeList textIDList = firstIDElement.getChildNodes(); String questionID = textIDList.item(0).getNodeValue().trim(); questionsToReturn.add(questionID); } } }catch(ParserConfigurationException pce) { pce.printStackTrace(); }catch(SAXException se) { se.printStackTrace(); }catch(IOException ioe) { ioe.printStackTrace(); } return questionsToReturn; } /** * Function to return question IDs for later output processing. * @param sectionTopic * @return List of integer values of questions that are of the given difficulty */ public List returnByTopic(String sectionTopic){ List questionsToReturn = new List(); try { DocumentBuilderFactory dBF = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = dBF.newDocumentBuilder(); Document database = docBuilder.parse(new File(dpath)); NodeList listOfQuestions = database.getElementsByTagName("question"); for(int i=0; i<listOfQuestions.getLength(); i++) { Node firstQuestion = listOfQuestions.item(i); Element firstQuestionE = (Element)firstQuestion; NodeList topiclist = firstQuestionE.getElementsByTagName("subject"); Element firstTopicElement = (Element)topiclist.item(0); NodeList textTopicList = firstTopicElement.getChildNodes(); String topicvalue = textTopicList.item(0).getNodeValue().trim(); if (topicvalue.compareTo(sectionTopic)==0){ NodeList idlist = firstQuestionE.getElementsByTagName("id"); Element firstIDElement = (Element)idlist.item(0); NodeList textIDList = firstIDElement.getChildNodes(); String questionID = textIDList.item(0).getNodeValue().trim(); questionsToReturn.add(questionID); } } }catch(ParserConfigurationException pce) { pce.printStackTrace(); }catch(SAXException se) { se.printStackTrace(); }catch(IOException ioe) { ioe.printStackTrace(); } return questionsToReturn; } /** * Function to return question IDs for later output processing. * @param difficulty * @return List of integer values of questions that are of the given difficulty */ public List returnByDifficulty(int difficulty){ List questionsToReturn = new List(); try { DocumentBuilderFactory dBF = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = dBF.newDocumentBuilder(); Document database = docBuilder.parse(new File(dpath)); NodeList listOfQuestions = database.getElementsByTagName("question"); for(int i=0; i<listOfQuestions.getLength(); i++) { Node firstQuestion = listOfQuestions.item(i); Element firstQuestionE = (Element)firstQuestion; NodeList difficultylist = firstQuestionE.getElementsByTagName("difficulty"); Element firstDifficultyElement = (Element)difficultylist.item(0); NodeList textDifficultyList = firstDifficultyElement.getChildNodes(); double difficultyValue = Double.valueOf(textDifficultyList.item(0).getNodeValue().trim()); if (difficultyValue == difficulty) { NodeList idlist = firstQuestionE.getElementsByTagName("id"); Element firstIDElement = (Element)idlist.item(0); NodeList textIDList = firstIDElement.getChildNodes(); String questionID = textIDList.item(0).getNodeValue().trim(); questionsToReturn.add(questionID); } } }catch(ParserConfigurationException pce) { pce.printStackTrace(); }catch(SAXException se) { se.printStackTrace(); }catch(IOException ioe) { ioe.printStackTrace(); } return questionsToReturn; } /** * Function to return specified test data from a specific question. Any tag may be requested from the question element * @param questionID * @param tagname * @return String with the requested test data */ public String returnTestData(String questionID, String tagname) { String returnvalue = ""; try { DocumentBuilderFactory dBF = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = dBF.newDocumentBuilder(); Document database = docBuilder.parse(new File(dpath)); while(questionID.charAt(0)=='0') questionID = questionID.substring(1); NodeList listOfQuestions = database.getElementsByTagName("question"); for(int i=0; i<listOfQuestions.getLength(); i++) { Node firstQuestion = listOfQuestions.item(i); Element firstQuestionE = (Element)firstQuestion; NodeList sectionlist = firstQuestionE.getElementsByTagName("id"); Element firstIDElement = (Element)sectionlist.item(0); NodeList textIDList = firstIDElement.getChildNodes(); Integer IDvalue = Integer.valueOf(textIDList.item(0).getNodeValue().trim()); if (IDvalue.toString().compareTo(questionID)==0) { NodeList returnList = firstQuestionE.getElementsByTagName(tagname); Element ReturnElement = (Element)returnList.item(0); NodeList textReturnList = ReturnElement.getChildNodes(); returnvalue = textReturnList.item(0).getNodeValue().trim(); } } }catch(ParserConfigurationException pce) { pce.printStackTrace(); }catch(SAXException se) { se.printStackTrace(); }catch(IOException ioe) { ioe.printStackTrace(); } return returnvalue; } }
155fee14e67616653610924cce296e88199a899a
fbf92d6fb8904b57532b0a0f1d328b870031744a
/src/com/zch/safelottery/http/RequestHandle.java
0772ed53ad31665effa88427c3640da6ee6c1fb5
[]
no_license
liyq1406/safelottery
1960fa3cdc7337c654e6aa57818501134d8300ec
0cc02d92db5cc71489b708dc322afc6773630a62
refs/heads/master
2021-01-22T13:51:51.377253
2015-09-28T09:49:36
2015-09-28T09:49:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,489
java
package com.zch.safelottery.http; import java.lang.ref.WeakReference; /** * A Handle to an AsyncRequest which can be used to cancel a running request. */ class RequestHandle { private final WeakReference<AsyncHttpRequest> request; public RequestHandle(AsyncHttpRequest request) { this.request = new WeakReference(request); } /** * Attempts to cancel this request. This attempt will fail if the request has already completed, * has already been cancelled, or could not be cancelled for some other reason. If successful, * and this request has not started when cancel is called, this request should never run. If the * request has already started, then the mayInterruptIfRunning parameter determines whether the * thread executing this request should be interrupted in an attempt to stop the request. * <p>&nbsp;</p> After this method returns, subsequent calls to isDone() will always return * true. Subsequent calls to isCancelled() will always return true if this method returned * true. * * @param mayInterruptIfRunning true if the thread executing this request should be interrupted; * otherwise, in-progress requests are allowed to complete * @return false if the request could not be cancelled, typically because it has already * completed normally; true otherwise */ public boolean cancel(boolean mayInterruptIfRunning) { AsyncHttpRequest _request = request.get(); return _request == null || _request.cancel(mayInterruptIfRunning); } /** * Returns true if this task completed. Completion may be due to normal termination, an * exception, or cancellation -- in all of these cases, this method will return true. * * @return true if this task completed */ public boolean isFinished() { AsyncHttpRequest _request = request.get(); return _request == null || _request.isDone(); } /** * Returns true if this task was cancelled before it completed normally. * * @return true if this task was cancelled before it completed */ public boolean isCancelled() { AsyncHttpRequest _request = request.get(); return _request == null || _request.isCancelled(); } public boolean shouldBeGarbageCollected() { boolean should = isCancelled() || isFinished(); if (should) request.clear(); return should; } }
e56162e58e2b0f9a78d98f7a4112bb2c5bfa5179
2a558f40f6fb63e4313944f041e3f8e2e54f93c6
/WhereIsCage/app/src/main/java/com/supinfo/app/whereiscage/Utils/Gamemode.java
28e84dd5e12c96c9346f5d6105cc27467fb00d71
[]
no_license
Dramelac/WhereIsCage
8d22c5704c0feadd146faaf39f96c3948f92ea56
e8b357198bfba106cee3e75a2b3fd351fb1326f1
refs/heads/master
2021-03-19T09:06:36.587068
2017-10-01T11:58:24
2017-10-01T11:58:24
85,418,128
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package com.supinfo.app.whereiscage.Utils; public enum Gamemode { Normal(0), Chrono(1), Chrono_two(2); private final int value; Gamemode(int value) { this.value = value; } public int value(){ return this.value; } }
edf983291d1104799baa32fbf4acc2c640f83641
41ac36adbacb640bb5a34f2758b101d21a7fc1a2
/HTTP-Pseudo-Streaming/edu/cmu/ece/LRUCache.java
a91cf711783ce00a143b32d4f6840a9cb9c0ea3d
[]
no_license
Horacehxw/Computer-Networks
5b5a66737cc2c416d5e892958b44d7766c0f1e1a
b738a62541818b7e89b58934d2e64c0d1e80d8f9
refs/heads/master
2021-10-28T03:48:33.677096
2019-04-21T19:58:34
2019-04-21T19:58:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,693
java
package edu.cmu.ece; import java.util.*; import java.util.concurrent.ConcurrentHashMap; public class LRUCache<T1, T2> { class Node { Node prev; Node next; T1 key; T2 val; public Node(T1 key, T2 val) { this.key = key; this.val = val; } } Node head = new Node(null,null); Node tail = new Node(null,null); int capacity; Map<T1, Node> map = new ConcurrentHashMap<>(); public LRUCache(int capacity) { this.capacity = capacity; head.next = tail; tail.prev = head; } public T2 get(T1 key) { Node node = map.get(key); if (node == null) return null; delete(node); insert(node); return node.val; } public void put(T1 key, T2 value) { Node node = map.get(key); if (node != null) { node.val = value; delete(node); insert(node); } else { capacity--; Node newNode = new Node(key, value); if (capacity < 0) { evict(tail.prev); capacity++; } insert(newNode); map.put(key, newNode); } } private void insert(Node node) { Node oldNext = head.next; head.next = node; node.next = oldNext; node.prev = head; oldNext.prev = node; } private void delete(Node node) { Node oldPrev = node.prev; Node oldNext = node.next; oldPrev.next = oldNext; oldNext.prev = oldPrev; } private void evict(Node node) { map.remove(node.key); delete(node); } }
2810b6ca734301e8dd03d2669a6902ea80684949
47ed22af64f5258b49a416051473564e9a184080
/app/src/main/java/placeme/octopusites/com/placeme/modal/Certificates.java
e2214abe143a463123472041589e9f4294bfa7d2
[]
no_license
sandip-survase/DataApp
017d76a3c59de4e67c0e28cdc4a3bbf0ebec5899
c01dac7faf73c76754a3c46db39670f884086417
refs/heads/master
2020-03-14T15:59:46.628983
2018-02-12T11:30:00
2018-02-12T11:30:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,461
java
package placeme.octopusites.com.placeme.modal; import java.io.Serializable; /** * Created by admin on 18-Nov-17. */ public class Certificates implements Serializable { String title,issuer,license,startdate,enddate,willexpire; public Certificates(String title, String issuer, String license, String startdate, String enddate,String willexpire) { this.title=title; this.issuer=issuer; this.license=license; this.startdate=startdate; this.enddate=enddate; this.willexpire=willexpire; } public String getWillexpire() { return willexpire; } public void setWillexpire(String willexpire) { this.willexpire = willexpire; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getIssuer() { return issuer; } public void setIssuer(String issuer) { this.issuer = issuer; } public String getLicense() { return license; } public void setLicense(String license) { this.license = license; } public String getStartdate() { return startdate; } public void setStartdate(String startdate) { this.startdate = startdate; } public String getEnddate() { return enddate; } public void setEnddate(String enddate) { this.enddate = enddate; } }
8c8134d8d25150cbf4f06786f6de741485a0ff99
88bbe88c848cffd4918c85849db5d0cefe883cca
/src/main/java/com/beans/observables/properties/atomic/AtomicObservableDoubleProperty.java
7a6d71887cc581c8e75b35e9daf2e4150fd87ae0
[ "Apache-2.0" ]
permissive
tomtzook/JavaBeans
d7c3db0a3e46155d1af6c26f5f4970d2a28f5993
c000c98d0af44e4da5de2c52fbe42729e48a6cc2
refs/heads/master
2022-12-22T06:03:09.972302
2022-12-20T19:22:30
2022-12-20T19:22:30
145,975,734
2
0
Apache-2.0
2019-04-04T17:31:55
2018-08-24T10:04:25
Java
UTF-8
Java
false
false
2,566
java
package com.beans.observables.properties.atomic; import com.beans.observables.binding.AtomicPropertyBindingController; import com.beans.observables.binding.PropertyBindingController; import com.beans.observables.listeners.ObservableEventController; import com.beans.observables.properties.ObservableDoubleProperty; import com.beans.observables.properties.ObservableDoublePropertyBase; import com.notifier.EventController; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; /** * <p> * A <b>thread-safe</b> implementation of {@link ObservableDoubleProperty}, holding a * variable which is accessed for writing or reading through {@link #setAsDouble(double)} * and {@link #getAsDouble()}. * </p> * <p> * This implementation uses the <em>java.util.concurrent.atomic</em> package, to provide * a lock-free, atomic read and write operations. * </p> * <p> * In some cases, {@link AtomicLong} may old a lock, specifically, if the operating * system does not support 64-bit operations. * </p> * <p> * Depending on the {@link ObservableEventController} used, it is possible * that changes from multiple threads won't dispatch in the correct order. * </p> * * @since JavaBeans 1.0 */ public class AtomicObservableDoubleProperty extends ObservableDoublePropertyBase { private final AtomicLong mValue; public AtomicObservableDoubleProperty(Object bean, EventController eventController, double initialValue) { super(bean, eventController); mValue = new AtomicLong(Double.doubleToLongBits(initialValue)); } public AtomicObservableDoubleProperty(EventController eventController, double initialValue) { super(eventController); mValue = new AtomicLong(Double.doubleToLongBits(initialValue)); } @Override protected void setInternalDirect(Double value) { mValue.set(Double.doubleToLongBits(value)); } @Override protected void setInternal(double value) { long newLongValue = Double.doubleToLongBits(value); long oldLongValue = mValue.getAndSet(newLongValue); if (oldLongValue != newLongValue) { double oldValue = Double.longBitsToDouble(oldLongValue); fireValueChangedEvent(oldValue, value); } } @Override protected double getInternal() { return Double.longBitsToDouble(mValue.get()); } }
942159e02fc75c1ef0a238365cf716a1342befe9
397f9865f2cdccd7a339431ed3d81a589b900e37
/src/test/java/com/cc/driverFactory/driverManager.java
a6dbabe34d14fcc17c6bdf5ae3bf6e08837ad7b0
[]
no_license
aashna-patel/bddcc
85cb7523428c122bfc59490fcd38b21053379a96
68bb888945cc7e971a7e6b76d7289f029f63898e
refs/heads/master
2023-01-21T07:14:44.331706
2020-12-03T16:27:07
2020-12-03T16:27:07
318,252,638
0
0
null
null
null
null
UTF-8
Java
false
false
1,067
java
package com.cc.driverFactory; import io.github.bonigarcia.wdm.WebDriverManager; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import java.util.concurrent.TimeUnit; public class driverManager { public static WebDriver driver; public String browser = ""; public void openBrowser() { switch (browser) { case "ie": WebDriverManager.iedriver().setup(); driver = new InternetExplorerDriver(); break; default: WebDriverManager.chromedriver().setup(); driver = new ChromeDriver(); break; } } public void closeBrowser() { driver.quit(); } public void navigateTo(String url) { driver.get(url); } public void applyImplicitWait(){ driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } public void maximise(){ driver.manage().window().maximize(); } }
[ "Vedpatel19" ]
Vedpatel19
21fc7f070c3bed1d5accd6002d0434c8e427e82e
a99a15b1e53e6a247236dac4e8f35defaa007a88
/LezzetKitapKullanici/app/src/main/java/com/example/lezzetkitapkullanici/VideoIzlemeActivity.java
1e61a5e9f4bbd62e33c3857a9822b6759d7eaf89
[]
no_license
btlhtp/yemekKitabiKullanici
fd5b64d643129673c5a06083b3eb62994429c083
750b9ebb6ba3639015ba1765f4645be80e0db6d4
refs/heads/main
2023-06-05T03:26:04.259115
2021-06-29T10:52:19
2021-06-29T10:52:19
381,331,086
0
0
null
null
null
null
UTF-8
Java
false
false
2,648
java
package com.example.lezzetkitapkullanici; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.widget.Toast; import com.google.android.youtube.player.YouTubeBaseActivity; import com.google.android.youtube.player.YouTubeInitializationResult; import com.google.android.youtube.player.YouTubePlayer; import com.google.android.youtube.player.YouTubePlayerView; public class VideoIzlemeActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener { YouTubePlayerView youTubePlayerView; public static String API_KEY="AIzaSyAE8UPT-qKyM3aTGSb2bVcRzRyQmoVEAHg"; String VIDEO_ID=""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_video_izleme); youTubePlayerView=findViewById(R.id.player); youTubePlayerView.initialize(API_KEY,this); if(getIntent()!=null){ VIDEO_ID=getIntent().getStringExtra("Link"); } } @Override public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) { youTubePlayer.setPlayerStateChangeListener(playerStateChangeListener); youTubePlayer.setPlaybackEventListener(playbackEventListener); if(!b){ youTubePlayer.cueVideo(VIDEO_ID); } } @Override public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) { Toast.makeText(this,"Oynatma başarısız...",Toast.LENGTH_SHORT).show(); } private YouTubePlayer.PlayerStateChangeListener playerStateChangeListener= new YouTubePlayer.PlayerStateChangeListener() { @Override public void onLoading() { } @Override public void onLoaded(String s) { } @Override public void onAdStarted() { } @Override public void onVideoStarted() { } @Override public void onVideoEnded() { } @Override public void onError(YouTubePlayer.ErrorReason errorReason) { } }; private YouTubePlayer.PlaybackEventListener playbackEventListener= new YouTubePlayer.PlaybackEventListener() { @Override public void onPlaying() { } @Override public void onPaused() { } @Override public void onStopped() { } @Override public void onBuffering(boolean b) { } @Override public void onSeekTo(int i) { } }; }
4055475f1c7cfa8ea69862725fbe4e0179741776
d2f4b51a68bac6202802338b1bc5f0b23dec7ed1
/src/analisisnumerico/Biseccion.java
6751c1eb45b2e3996da5fc8d21db51cfd2ecee7c
[]
no_license
Pantnkrator/AnalisisNumerico
d468a072505983cd0429a15cb1abec8ad3bee6c9
60edf82e87910184fad61b03bf8cca345c709a13
refs/heads/master
2021-01-10T16:00:01.758470
2015-11-02T15:09:03
2015-11-02T15:09:03
43,400,532
0
0
null
null
null
null
UTF-8
Java
false
false
6,540
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package analisisnumerico; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /** * * @author toto */ public class Biseccion extends javax.swing.JPanel { /** * Creates new form Biseccion */ public Biseccion(Funcion F) { initComponents(); jButton1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { double lower=Double.parseDouble(jTextField1.getText().trim()); double upper=Double.parseDouble(jTextField2.getText().trim()); double eps=Double.parseDouble(jTextField3.getText().trim()); System.out.println("BISECCION "+F.getF()); BiseccionResultado sr=new BiseccionResultado(F, lower,upper,eps); removeAll(); sr.setBounds(0, 0, 780, 480); add(sr); sr.setVisible(true); updateUI(); } }); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); jLabel1.setText("Ingrese los limites:"); jLabel2.setText("Lower:"); jLabel3.setText("Upper:"); jLabel4.setText("Tolerancia:"); jButton1.setText("Encontrar Raiz"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(155, 155, 155) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel4) .addComponent(jLabel3))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGap(202, 202, 202) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1)))))) .addContainerGap(474, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(87, 87, 87) .addComponent(jLabel1) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(jButton1) .addContainerGap(218, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; // End of variables declaration//GEN-END:variables }
cc0d52289d123500992940de6cf9ae8abd7eb701
5ca035e4a777a16517abdce0cb76bb8905b58cf4
/getTogether/src/com/gt/gettogether/department/work/model/service/WorkCommentService.java
18a0e14ea2daeee78c5966fe26f90eb630a5ca07
[]
no_license
TeamGroupTwo/getTogether
2c089a1ad827b9bf83cea2e4e54c9ec72d33bf06
71ad936c209af157405980859ed8438bf6cb786c
refs/heads/master
2020-03-18T21:06:33.173104
2018-06-11T12:28:15
2018-06-11T12:28:15
135,259,784
2
1
null
2018-06-12T12:02:44
2018-05-29T07:43:07
Java
UTF-8
Java
false
false
1,033
java
package com.gt.gettogether.department.work.model.service; import java.sql.Connection; import java.util.ArrayList; import com.gt.gettogether.department.work.model.dao.WorkCommentDao; import com.gt.gettogether.department.work.model.vo.WorkComment; import static com.gt.gettogether.common.jdbc.JDBCTemplate.*; public class WorkCommentService { public ArrayList<WorkComment> selectWorkCommentList() { return null; } public int insertWorkComment(WorkComment wc) { Connection con = getConnection(); int result = new WorkCommentDao().insertWorkComment(con, wc); if(result > 0) commit(con); else rollback(con); close(con); return result; } public int updateWorkComment() { return 0; } public int deleteWorkComment() { return 0; } public int selectInsertOne(int eNo) { Connection con = getConnection(); int wcNo = new WorkCommentDao().selectInsertOne(con, eNo); close(con); return wcNo; } }
[ "user2@KH_H" ]
user2@KH_H
4047740bd392f65062dcce78c7582fac57ae1cdb
8f9b2efbd298f1b8f78275544da6ce21183716f5
/graphql/src/main/java/me/retrodaredevil/solarthing/rest/cache/CacheCalc.java
913241934b5cb71075e6ba3696916c41e6d99903
[ "MIT" ]
permissive
nimratbrar/solarthing
fff552fdd2da8fc023b7affd1bd557121d74adbb
995af54829a73ede2d6c3ffbc98143b793abdd8e
refs/heads/master
2023-07-05T15:20:06.256301
2021-08-17T03:17:25
2021-08-17T03:17:25
400,350,902
1
0
null
null
null
null
UTF-8
Java
false
false
6,386
java
package me.retrodaredevil.solarthing.rest.cache; import me.retrodaredevil.solarthing.annotations.UtilityClass; import me.retrodaredevil.solarthing.cache.packets.IdentificationCacheNode; import me.retrodaredevil.solarthing.cache.packets.data.IdentificationCacheData; import me.retrodaredevil.solarthing.packets.TimestampedPacket; import me.retrodaredevil.solarthing.packets.identification.Identifier; import me.retrodaredevil.solarthing.packets.identification.IdentifierFragment; import me.retrodaredevil.solarthing.solar.accumulation.*; import me.retrodaredevil.solarthing.solar.accumulation.value.AccumulationValue; import me.retrodaredevil.solarthing.solar.accumulation.value.AccumulationValueFactory; import me.retrodaredevil.solarthing.solar.common.DailyData; import java.time.Duration; import java.time.Instant; import java.util.List; import java.util.function.Function; @UtilityClass public final class CacheCalc { private CacheCalc() { throw new UnsupportedOperationException(); } /** * Ok, so this function may seem complex, and yeah, it is. The purpose of this is to find the total accumulation over a period of time. * This is designed with generics to be able to used for floats, or data types containing multiple floats, but can also work with other data * types that can be added or subtracted. The 4 generic type parameters have been given meaningful names to prevent confusion. * * @param identifierFragment The {@link IdentifierFragment} * @param timestampedPackets The list of timestamped packets * @param periodStart The start of the period * @param periodDuration The duration of the period * @param totalGetter Contains a function to get the desired data from a packet * @param accumulationValueFactory The factory for the {@link AccumulationValue} being used * @param converter A function to convert the {@link AccumulationValue} to the type used to create the {@link IdentificationCacheData} * @param dataCreator Contains a function to create the {@link IdentificationCacheData} * @param <DATA> The type data that will be cached * @param <PACKET> The type of packet that will be used to calculate the cache * @param <VALUE> The type of {@link AccumulationValue} that is used to accumulate the data * @param <ACCEPTED_VALUE> The type that {@code dataCreator} requires to create a {@code DATA} type. * @return A new {@link IdentificationCacheData} with data created using {@code dataCreator} */ public static <DATA extends IdentificationCacheData, PACKET extends DailyData, VALUE extends AccumulationValue<VALUE>, ACCEPTED_VALUE> IdentificationCacheNode<DATA> calculateCache( IdentifierFragment identifierFragment, List<TimestampedPacket<PACKET>> timestampedPackets, Instant periodStart, Duration periodDuration, TotalGetter<PACKET, VALUE> totalGetter, AccumulationValueFactory<VALUE> accumulationValueFactory, Function<VALUE, ACCEPTED_VALUE> converter, DataCreator<DATA, ACCEPTED_VALUE> dataCreator) { AccumulationConfig accumulationConfig = AccumulationConfig.createDefault(periodStart.toEpochMilli()); List<AccumulationPair<PACKET>> accumulationPairs = AccumulationUtil.getAccumulationPairs(timestampedPackets, accumulationConfig); List<AccumulationCalc.SumNode<VALUE>> sumNodes = AccumulationCalc.getTotals(accumulationPairs, totalGetter, timestampedPackets, accumulationValueFactory); long periodStartDateMillis = periodStart.toEpochMilli(); long previousPeriodStartDateMillis = periodStartDateMillis - periodDuration.toMillis(); long unknownCutOffDateMillis = periodStartDateMillis - CacheHandler.INFO_DURATION.toMillis(); long periodEndDateMillis = periodStart.toEpochMilli() + periodDuration.toMillis(); AccumulationCalc.SumNode<VALUE> lastDataBeforePreviousPeriodStart = null; AccumulationCalc.SumNode<VALUE> lastDataBeforePeriodStart = null; AccumulationCalc.SumNode<VALUE> firstDataAfterPeriodStart = null; AccumulationCalc.SumNode<VALUE> lastDataBeforePeriodEnd = null; for (AccumulationCalc.SumNode<VALUE> sumNode : sumNodes) { long dateMillis = sumNode.getDateMillis(); if (dateMillis >= periodEndDateMillis) { break; } if (dateMillis < unknownCutOffDateMillis) { // If we have data before this, we need to not use it because using it could yield different results depending on the amount of data // we have available to use -- We don't want that because the result of calculating a cache should be the same every time. continue; } if (dateMillis < previousPeriodStartDateMillis) { lastDataBeforePreviousPeriodStart = sumNode; } else if (dateMillis < periodStartDateMillis) { lastDataBeforePeriodStart = sumNode; } else { if (firstDataAfterPeriodStart == null) { firstDataAfterPeriodStart = sumNode; } lastDataBeforePeriodEnd = sumNode; } } final DATA data; if (firstDataAfterPeriodStart == null) { assert lastDataBeforePeriodEnd == null; data = dataCreator.create( identifierFragment.getIdentifier(), converter.apply(accumulationValueFactory.getZero()), null, null, converter.apply(accumulationValueFactory.getZero()), null ); } else { AccumulationCalc.SumNode<VALUE> firstData = lastDataBeforePeriodStart == null ? firstDataAfterPeriodStart : lastDataBeforePeriodStart; VALUE generation = lastDataBeforePeriodEnd.getSum().minus(firstData.getSum()); final VALUE unknownGeneration; final Long unknownStartDateMillis; if (lastDataBeforePeriodStart == null && lastDataBeforePreviousPeriodStart != null) { unknownGeneration = firstDataAfterPeriodStart.getSum().minus(lastDataBeforePreviousPeriodStart.getSum()); unknownStartDateMillis = lastDataBeforePreviousPeriodStart.getDateMillis(); } else { unknownGeneration = accumulationValueFactory.getZero(); unknownStartDateMillis = null; } data = dataCreator.create( identifierFragment.getIdentifier(), converter.apply(generation), firstData.getDateMillis(), lastDataBeforePeriodEnd.getDateMillis(), converter.apply(unknownGeneration), unknownStartDateMillis ); } return new IdentificationCacheNode<>(identifierFragment.getFragmentId(), data); } @FunctionalInterface public interface DataCreator<T, U> { T create(Identifier identifier, U mainData, Long firstDateMillis, Long lastDateMillis, U unknownData, Long unknownStartDateMillis); } }
559210bf7dafa234fe5758a0c3c3535d26a3b976
b327a374de29f80d9b2b3841db73f3a6a30e5f0d
/out/target/common/obj/APPS/FrameworksCoreTests_intermediates/src/src/android/os/IBinderThreadPriorityService.java
bd25fcbed79f70c6da77101fa06028c50176529b
[]
no_license
nikoltu/aosp
6409c386ed6d94c15d985dd5be2c522fefea6267
f99d40c9d13bda30231fb1ac03258b6b6267c496
refs/heads/master
2021-01-22T09:26:24.152070
2011-09-27T15:10:30
2011-09-27T15:10:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,495
java
/* * This file is auto-generated. DO NOT MODIFY. * Original file: frameworks/base/core/tests/coretests/src/android/os/IBinderThreadPriorityService.aidl */ package android.os; public interface IBinderThreadPriorityService extends android.os.IInterface { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements android.os.IBinderThreadPriorityService { private static final java.lang.String DESCRIPTOR = "android.os.IBinderThreadPriorityService"; /** Construct the stub at attach it to the interface. */ public Stub() { this.attachInterface(this, DESCRIPTOR); } /** * Cast an IBinder object into an android.os.IBinderThreadPriorityService interface, * generating a proxy if needed. */ public static android.os.IBinderThreadPriorityService asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = (android.os.IInterface)obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof android.os.IBinderThreadPriorityService))) { return ((android.os.IBinderThreadPriorityService)iin); } return new android.os.IBinderThreadPriorityService.Stub.Proxy(obj); } public android.os.IBinder asBinder() { return this; } @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { switch (code) { case INTERFACE_TRANSACTION: { reply.writeString(DESCRIPTOR); return true; } case TRANSACTION_getThreadPriority: { data.enforceInterface(DESCRIPTOR); int _result = this.getThreadPriority(); reply.writeNoException(); reply.writeInt(_result); return true; } case TRANSACTION_getThreadSchedulerGroup: { data.enforceInterface(DESCRIPTOR); java.lang.String _result = this.getThreadSchedulerGroup(); reply.writeNoException(); reply.writeString(_result); return true; } case TRANSACTION_callBack: { data.enforceInterface(DESCRIPTOR); android.os.IBinderThreadPriorityService _arg0; _arg0 = android.os.IBinderThreadPriorityService.Stub.asInterface(data.readStrongBinder()); this.callBack(_arg0); reply.writeNoException(); return true; } case TRANSACTION_setPriorityAndCallBack: { data.enforceInterface(DESCRIPTOR); int _arg0; _arg0 = data.readInt(); android.os.IBinderThreadPriorityService _arg1; _arg1 = android.os.IBinderThreadPriorityService.Stub.asInterface(data.readStrongBinder()); this.setPriorityAndCallBack(_arg0, _arg1); reply.writeNoException(); return true; } } return super.onTransact(code, data, reply, flags); } private static class Proxy implements android.os.IBinderThreadPriorityService { private android.os.IBinder mRemote; Proxy(android.os.IBinder remote) { mRemote = remote; } public android.os.IBinder asBinder() { return mRemote; } public java.lang.String getInterfaceDescriptor() { return DESCRIPTOR; } public int getThreadPriority() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getThreadPriority, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); } return _result; } public java.lang.String getThreadSchedulerGroup() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getThreadSchedulerGroup, _data, _reply, 0); _reply.readException(); _result = _reply.readString(); } finally { _reply.recycle(); _data.recycle(); } return _result; } public void callBack(android.os.IBinderThreadPriorityService recurse) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeStrongBinder((((recurse!=null))?(recurse.asBinder()):(null))); mRemote.transact(Stub.TRANSACTION_callBack, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } public void setPriorityAndCallBack(int priority, android.os.IBinderThreadPriorityService recurse) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(priority); _data.writeStrongBinder((((recurse!=null))?(recurse.asBinder()):(null))); mRemote.transact(Stub.TRANSACTION_setPriorityAndCallBack, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } } static final int TRANSACTION_getThreadPriority = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_getThreadSchedulerGroup = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_callBack = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_setPriorityAndCallBack = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); } public int getThreadPriority() throws android.os.RemoteException; public java.lang.String getThreadSchedulerGroup() throws android.os.RemoteException; public void callBack(android.os.IBinderThreadPriorityService recurse) throws android.os.RemoteException; public void setPriorityAndCallBack(int priority, android.os.IBinderThreadPriorityService recurse) throws android.os.RemoteException; }
c1f79ea84a33f54264daa636bf52a775f8fdab48
d7020683f821b8944ba16d861cf767e6faf517e8
/src/main/java/com/models/pack/FilterModel.java
54232b78a1f5813bf63df2a6b95d256aa4730353
[]
no_license
compscikaran/pocketchange
f2e5d672b78eb0c6a6ebd874fca473e9ba3c5c61
3964d88a418851dabca0543f11ef27c0b192e0ef
refs/heads/master
2022-12-25T21:11:01.988482
2019-12-29T06:01:42
2019-12-29T06:01:42
202,843,453
0
0
null
2022-12-16T05:24:26
2019-08-17T06:14:20
Java
UTF-8
Java
false
false
219
java
package com.models.pack; public class FilterModel { private Category category; public Category getCategory() { return category; } public void setCategory(Category category) { this.category = category; } }
b27795b7c5d02503480cdebf7fe6ef012fdaf2a7
c11585234899e604bd7bb3f717eb038083d90355
/src/main/java/com/example/bdd/service/DiscountService.java
a66b2fe7b9fd09de64edcda5c882e8960a602b7c
[]
no_license
bagabor/cucumber-example
c1d48d742e823ad49246f59655a6780da520217e
cd8d5c02103e1f6bf60a30720003180c238b5e2e
refs/heads/main
2023-08-11T19:29:05.249808
2021-10-03T11:13:01
2021-10-03T11:13:01
413,054,291
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.example.bdd.service; import org.springframework.stereotype.Service; @Service public class DiscountService { public String getDiscount(int amount) { if (amount > 5000 && amount < 10000) { return "10%"; } else if (amount > 10000) { return "15%"; } else { return "0%"; } } }
95557c96797d78761943c6ba0b2f7b3e5ccd3ce9
3a6ac8c528cb38c9014ba0d9dbe915c2959f33ce
/src/Today.java
8da4e3d281fa6c01eb37d8e3e0971023dad68b13
[]
no_license
yiss92/Project01
e0291d7b0d212a55c8fa026d316e9536db58d56a
d230800e87af75a238f5626bd3b8755b6fecccb4
refs/heads/master
2021-01-16T21:24:24.733429
2015-08-26T08:44:16
2015-08-26T08:44:16
40,687,438
4
0
null
null
null
null
UTF-8
Java
false
false
2,391
java
import java.util.Calendar; public class Today { private String title; protected String toDo; private String location; private String described; private String year; private String month; private String week; private String day; private String hours; private String either; private int count; private Calendar calendar; private final int scedulNumber = 24; public Today() { super(); } public Today(String title, String toDo, String location, String described, String year, String month, String week, String day, String hours, String either) { super(); this.title = title; this.toDo = toDo; this.location = location; this.described = described; this.year = year; this.month = month; this.week = week; this.day = day; this.hours = hours; this.either = either; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getToDo() { return toDo; } public void setToDo(String toDo) { this.toDo = toDo; } public int getScedulNumber() { return scedulNumber; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public String getDescribed() { return described; } public void setDescribed(String described) { this.described = described; } public String getDay() { return day; } public void setDay(String day) { this.day = day; } public Calendar getCalendar() { return calendar; } public void setCalendar(Calendar calendar) { this.calendar = calendar; } public String getYear() { return year; } public void setYear(String year) { this.year = year; } public String getWeek() { return week; } public void setWeek(String week) { this.week = week; } public String getHours() { return hours; } public void setHours(String hours) { this.hours = hours; } public String getEither() { return either; } public void setEither(String either) { this.either = either; } public String getMonth() { return month; } public void setMonth(String month) { this.month = month; } public int getCount() { return count; } public void setCount(int count) { this.count = count; } }
2092da402c8e01b3ce5e747d5c3d275125eb4806
9771919dc375f46cdaa9491302786ff1c2471587
/helloInte/src/test/java/com/test/mybatis/dao/UserDAOImplTest.java
225f248582bfd56e2e0deceb62f76e7d2a5f8684
[]
no_license
fridayhoho/javaBase
93eeb364e50f8ddec5839250a7cec94706379e18
90d8261618b19ca8b58b4a466d9f02bf4175794b
refs/heads/master
2022-10-17T17:00:05.952039
2020-03-06T03:24:33
2020-03-06T03:24:33
170,685,774
1
0
null
2022-10-05T19:25:12
2019-02-14T12:10:44
Java
UTF-8
Java
false
false
1,679
java
package com.test.mybatis.dao; import com.test.mybatis.mapper.PlayerQueryMapper; import com.test.mybatis.pojo.User; import lombok.extern.slf4j.Slf4j; import org.junit.Before; import org.junit.Test; import org.junit.internal.runners.JUnit4ClassRunner; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; import static org.junit.Assert.*; @Slf4j public class UserDAOImplTest { private ApplicationContext applicationContext; @Before public void setup() throws Exception { applicationContext = new ClassPathXmlApplicationContext("classpath:applicationContext.xml"); } @Test public void findUserById() { try { UserDAO userDAO = (UserDAO)applicationContext.getBean("userDAO"); User user = userDAO.findUserById(12); assertTrue(user.getRegion_id() == 12); } catch (Exception e) { e.printStackTrace(); } } @Test public void findUserByIdAno() { try { PlayerQueryMapper playerQueryMapper = (PlayerQueryMapper)applicationContext.getBean("playerQueryMapper"); List result = playerQueryMapper.doSomeSummary(); System.out.println(result); assertTrue(!result.isEmpty()); } catch (Exception e) { e.printStackTrace(); } } }
2de6cb0f460abe69fcc8006ea645dc38052569e8
6a9b0278c334277a8de6ee9a528a1c16213e5a30
/app/src/main/java/com/example/visioneh/englishhelper/activity/MainActivity.java
45dc0ae78b33fc6edfa776a50580863c7415c379
[]
no_license
visionEH/EnglishHelper
9f9dcd2096d8652a6d3c93e70205cb835b97ad46
79fb5865153d9fa47f3332e13a16df74a3270abe
refs/heads/master
2020-03-19T15:46:38.834672
2018-06-09T03:26:12
2018-06-09T03:26:12
136,685,202
0
0
null
null
null
null
UTF-8
Java
false
false
2,929
java
package com.example.visioneh.englishhelper.activity; import android.content.Intent; import android.os.Handler; import android.support.annotation.NonNull; import android.support.design.widget.BottomNavigationView; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MenuItem; import com.example.visioneh.englishhelper.bean.Constant; import com.example.visioneh.englishhelper.frag.HomeFragment; import com.example.visioneh.englishhelper.R; import com.example.visioneh.englishhelper.frag.WordFragment; public class MainActivity extends AppCompatActivity { private HomeFragment home; private WordFragment word; private BottomNavigationView bottom; private int uid=-1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent intent=getIntent(); Bundle bundle=intent.getExtras(); uid=bundle.getInt("uid"); bottom = (BottomNavigationView) findViewById(R.id.nav_bottom); bottom.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { int id = item.getItemId(); if (id == R.id.home) { SetFragment(Constant.Home_Fragment); } else if (id == R.id.word) { SetFragment(Constant.Word_Fragment); } return true; } }); getSupportActionBar().hide(); SetFragment(Constant.Home_Fragment); } public void SetFragment(int id){ //开启碎片的管理者,可以对其进行删除,添加等操作 FragmentTransaction transaction=getSupportFragmentManager().beginTransaction(); //影藏所有fragment HideFragment(transaction); switch (id){ case Constant.Home_Fragment: if(home==null){ home=new HomeFragment(); transaction.add(R.id.fl,home); } else{ transaction.show(home); } break; case Constant.Word_Fragment: if(word==null){ word=new WordFragment(); transaction.add(R.id.fl,word); } else{ transaction.show(word); } break; } transaction.commit(); } public void HideFragment(FragmentTransaction transaction){ if(home!=null) { transaction.hide(home); } if(word!=null){ transaction.hide(word); } } public int getUid() { return uid; } }
e0269974bfe1c612ddfbd47e60045f0df133816e
07ae48b345ed81725cd6d618b81215ed4cc93b7e
/src/Simulator/Simulator.java
49b620d63af9bcc75c4f23ffd54edbacd185eaa6
[]
no_license
ArchambaultVincent/ProjetBioreactor
1fa2bd6f64a577264bb3cdcbce678acd5e13e1b1
a26a3402227cb4bc0c4969c3ebaa95d3d30cd925
refs/heads/master
2022-11-03T01:55:05.234204
2020-06-19T16:34:55
2020-06-19T16:34:55
219,994,768
0
0
null
null
null
null
UTF-8
Java
false
false
9,238
java
package Simulator; import java.io.*; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; public class Simulator { private float Reactor_volume; private double biomass; private double substrate_concentration; private double product; private double growth_rate; private double biomass_rate; private double substrate_rate; private float product_rate; private float k1; private float k2; private Cells cells; private int simulationTime; private float Ph; private float Do2; private float Temp; private float Co2; private float debit_dair; private float vitesse_rotation=0; private int time=0; // on modifie les paramètres Senseur et réaction pour les cas d'erreur private Sensor ph_Sensor; private Sensor do2_Sensor; private Sensor temp_Sensor; private String simulationName; private ArrayList<SimulatorState> sim; private ArrayList<Event> events; double tempPh[][] = new double[40][10]; public Simulator(String simulationName, float quantities,float substrate_concentration, int simulationTime,float Ph,float Do2, float Temp,float debit_dair) { this.biomass = quantities; this.simulationTime=simulationTime; this.simulationName = simulationName; this.substrate_concentration=substrate_concentration; this.debit_dair=debit_dair; ph_Sensor = new Sensor(); do2_Sensor = new Sensor(); temp_Sensor = new Sensor(); sim = new ArrayList<SimulatorState>(); events = new ArrayList<Event>(); cells=new Cells(); this.Ph=Ph; this.Do2=Do2; this.Temp=Temp; grothRate_Init(); } public void grothRate_Init(){ StringBuilder sb = new StringBuilder(); int index=0; try (FileReader reader = new FileReader("./Simulation/TempPh.csv"); BufferedReader br = new BufferedReader(reader)) { // read line by line String line; while ((line = br.readLine()) != null) { String linesplit[] = line.split(";"); for(int index2=0;index2 < linesplit.length;index2++){ tempPh[index][index2]=Double.parseDouble(linesplit[index2]); } index++; } } catch (IOException e) { System.err.format("IOException: %s%n", e); } } /** * calcul la croissance specifique maximal */ private void grothRate_Calculation(){ double phget=Ph; float tempget=Temp; if(tempget>39){ tempget=39; } if(tempget < 0){ tempget = 0.0f; } if(phget > 9){ phget = 9; } if(phget < 0){ phget = 0; } double grothrateMax=tempPh[(int) Math.round(tempget)][(int)Math.round(phget)]; double Yell=0; if(Do2 < 0.1){ grothrateMax+=growth_rate*0.05; Yell=0.16; } else if(Do2 < 0.2){ grothrateMax+=growth_rate*0.048; Yell=0.19; } else if(Do2 < 0.4){ grothrateMax+=growth_rate*0.06; Yell=0.16; } else if(Do2 < 0.5){ grothrateMax+=growth_rate*0.03; Yell=0.16; } else if(Do2 < 0.7){ grothrateMax+=growth_rate*0.04; Yell=0.16; } else{ grothrateMax+=growth_rate*0.02; Yell=0.18; } cells.setGrothRate(grothrateMax); cells.setYield(Yell); } /** * */ public void Production(){ grothRate_Calculation(); growth_rate=(cells.getGrothRate()*substrate_concentration)/(cells.getSaturation()+substrate_concentration); biomass_rate=growth_rate*biomass; substrate_rate=-biomass_rate/cells.getYield(); //product_rate=(k1+k2*cells.getGrothRate())*biomass; biomass=biomass+biomass_rate*biomass; substrate_concentration=substrate_concentration+substrate_rate; if(substrate_concentration < 0) substrate_concentration=0; //product=product_rate*time; } /** * */ public void Simulation(){ for( time=0;time < simulationTime ; time++){ if(!events.isEmpty()) { while(!events.isEmpty() && events.get(0).getTimestamp() == time) { AnalyseEvent(events.get(0)); events.remove(0); } } Production(); ph_Sensor.setSensor_value(Ph); temp_Sensor.setSensor_value(Temp); do2_Sensor.setSensor_value(Do2); SimulatorState state=new SimulatorState(ph_Sensor.getSensor_value(),do2_Sensor.getSensor_value(),biomass,substrate_concentration,temp_Sensor.getSensor_value(),debit_dair,Co2); sim.add(state); } writeResult(); } /** * fonction permet */ public void SimulationStep(){ if(time < simulationTime){ if(!events.isEmpty()) { while(!events.isEmpty() && events.get(0).getTimestamp() == time) { AnalyseEvent(events.get(0)); events.remove(0); } } Production(); ph_Sensor.setSensor_value(Ph); temp_Sensor.setSensor_value(Temp); do2_Sensor.setSensor_value(Do2); SimulatorState state=new SimulatorState(ph_Sensor.getSensor_value(),do2_Sensor.getSensor_value(),biomass,substrate_concentration,temp_Sensor.getSensor_value(),debit_dair,Co2); sim.add(state); time++; } else{ //writeResult(); } } /** * * @param target * @param type * @param timestamp */ public void addEvent(String target, String type , int timestamp){ Sensor sensor=null; switch (target){ case "PH": sensor =ph_Sensor; break; case "TEMP": sensor = temp_Sensor; break; case "DO" : sensor=do2_Sensor; break; } Event e = new Event(sensor,type,timestamp); events.add(e); } public void AnalyseEvent(Event e){ String[] Event=e.getType().split(";"); switch(Event[0]){ case "PH": Ph=Float.parseFloat(Event[1]); break; case "TEMP": Temp=Float.parseFloat(Event[1]); break; case "DO": Do2=Float.parseFloat(Event[1]); break; case "BRUIT": e.getTarget().setstate("BRUIT"); e.getTarget().setBruit(Integer.parseInt(Event[1])); break; case "OFF": e.getTarget().setstate("OFF"); break; case "ON": e.getTarget().setstate("ON"); break; }; } public void writeResult(){ BufferedWriter writer = null; String data=" "; try { writer = new BufferedWriter(new FileWriter("./Simulation/result/"+simulationName+".csv")); for(SimulatorState state : sim){ data=data+state.toString(); } writer.write(data); writer.close(); } catch (IOException e) { e.printStackTrace(); } } public Cells getCells() { return cells; } public void setCells(Cells cells) { this.cells = cells; } public float getReactor_volume() { return Reactor_volume; } public void setReactor_volume(float reactor_volume) { Reactor_volume = reactor_volume; } public int getSimulationTime() { return simulationTime; } public void setSimulationTime(int simulationTime) { this.simulationTime = simulationTime; } public float getTemp() { return temp_Sensor.getSensor_value(); } public void setTemp(float temp) { Temp = temp; } public float getDo2() { return do2_Sensor.getSensor_value(); } public double getBiomass() { return biomass; } public void setDo2(float do2) { Do2 = do2; } public float getPh() { return ph_Sensor.getSensor_value();} public void setPh(float ph) { Ph = ph; } public double getSubstrat() { return substrate_concentration;} public float getCo2() { return Co2; } public void setCo2(float co2) { Co2 = co2; } public float getDebit_dair() { return debit_dair; } public void setDebit_dair(float debit_dair) { this.debit_dair = debit_dair; } public void calcul_CO2(){ Co2= (float) (biomass_rate/debit_dair); } public float getVitesse_rotation() { return vitesse_rotation; } public void setVitesse_rotation(float vitesse_rotation) { this.vitesse_rotation = vitesse_rotation; } }
b86b403f4117bb30ee211e00766c2366565cf7ac
3330a05b24c886c6eee0038aed70c94d15605b42
/app/src/main/java/com/example/change4change/CharitiesDO.java
83687106678e9f0bb544044d7b0e741f4b80eb8d
[ "Apache-2.0" ]
permissive
teamreadydbs/Change4Change-dbsp
79c6c28fb794ef4e43da40c97990e43f0da391fe
bc8a164b4caea3eeb5e16d01c69956b87a908dbf
refs/heads/master
2020-07-24T22:34:16.500532
2019-09-13T11:43:00
2019-09-13T11:43:00
208,070,814
0
0
null
null
null
null
UTF-8
Java
false
false
1,600
java
package com.example.change4change; import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBAttribute; import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBHashKey; import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBIndexHashKey; import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBIndexRangeKey; import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBRangeKey; import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBTable; import java.util.List; import java.util.Map; import java.util.Set; @DynamoDBTable(tableName = "changechange-mobilehub-2075487980-Charities") public class CharitiesDO { private String _userId; private Double _charityBalance; private String _charityDescription; @DynamoDBHashKey(attributeName = "userId") @DynamoDBAttribute(attributeName = "userId") public String getUserId() { return _userId; } public void setUserId(final String _userId) { this._userId = _userId; } @DynamoDBAttribute(attributeName = "charityBalance") public Double getCharityBalance() { return _charityBalance; } public void setCharityBalance(final Double _charityBalance) { this._charityBalance = _charityBalance; } @DynamoDBAttribute(attributeName = "charityDescription") public String getCharityDescription() { return _charityDescription; } public void setCharityDescription(final String _charityDescription) { this._charityDescription = _charityDescription; } }
daf052d8a5854e83b67750c7c8823e4d6c0fbf62
ee6ebabdfb76835bff39422fb1f6608b5662c3fb
/app/src/main/java/com/example/abehariz/bmicalculator/DBHandler.java
d03818d01f124b0bdf82e284fcc1eec66db26d75
[]
no_license
AbeHariz/BMICalculator
94e76353add046092be0ddf689a501bffaf79387
81f3cc86dd5baccf05525c453e9bc677c2c32138
refs/heads/master
2021-05-14T05:27:36.291475
2018-01-04T06:07:38
2018-01-04T06:07:38
116,221,303
0
0
null
null
null
null
UTF-8
Java
false
false
4,724
java
package com.example.abehariz.bmicalculator; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import java.util.ArrayList; import java.util.List; import static java.util.Calendar.DATE; public class DBHandler extends SQLiteOpenHelper { // Database Version public static final int DATABASE_VERSION = 20; // Database Name public static final String DATABASE_NAME = "RecordDB"; // Record table name public static final String TABLE_RECORD = "recordtable"; // Record Table Columns names public static final String KEY_ID = "id"; public static final String KEY_BMI = "bmi"; public static final String KEY_DATE = "date"; public DBHandler(Context context) { super( context, DATABASE_NAME, null, DATABASE_VERSION ); } @Override public void onCreate(SQLiteDatabase db) { String CREATE_RECORD_TABLE = "CREATE TABLE " + TABLE_RECORD + "(" + KEY_ID + " INTEGER PRIMARY KEY," + KEY_BMI + " TEXT, " + KEY_DATE + " TEXT)"; db.execSQL( CREATE_RECORD_TABLE ); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // Drop older table if existed db.execSQL( "DROP TABLE IF EXISTS " + TABLE_RECORD ); // Creating tables again onCreate( db ); } public void addBmi(Record record) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put( KEY_BMI, record.getBmi() ); // BMI value values.put( KEY_DATE, record.getDate() ); // Date // Inserting Row db.insert( TABLE_RECORD, null, values ); db.close(); // Closing database connection } public List<Record> getAllRecords() { List<Record> recordList = new ArrayList<Record>(); // Select All Query String selectQuery = "SELECT * FROM " + TABLE_RECORD; SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery( selectQuery, null ); // looping through all rows and adding to list if (cursor.moveToFirst()) { do { Record record = new Record(); record.setId( Integer.parseInt( cursor.getString( 0 ) ) ); record.setBmi( cursor.getString( 1 ) ); record.setDate( cursor.getString( 2 ) ); // Adding record to list recordList.add( record ); } while (cursor.moveToNext()); } // return record list return recordList; } /*public List<Record> getSelectedRecords(String s) { String month = "00"; if (s.equals( "January" )) { month = "01"; } else if (s.equals( "February" )) { month = "02"; } else if (s.equals( "March" )) { month = "03"; } else if (s.equals( "April" )) { month = "04"; } else if (s.equals( "May" )) { month = "05"; } else if (s.equals( "June" )) { month = "06"; } else if (s.equals( "July" )) { month = "07"; } else if (s.equals( "August" )) { month = "08"; } else if (s.equals( "September" )) { month = "09"; } else if (s.equals( "October" )) { month = "10"; } else if (s.equals( "November" )) { month = "11"; } else if (s.equals( "December" )) { month = "12"; } System.out.println( "GET " + s ); List<Record> recordList = new ArrayList<>(); String selectQuery = "SELECT * FROM " + TABLE_RECORD + "WHERE " + KEY_DATE + "LIKE '__/" + DATE + "/____';"; System.out.printf( selectQuery ); SQLiteDatabase db = getReadableDatabase(); Cursor cursor = db.rawQuery( selectQuery, null ); if (cursor.moveToFirst()) { do { Record record = new Record(); record.setId( Integer.parseInt( cursor.getString( 0 ) ) ); record.setBmi( cursor.getString( 1 ) ); record.setDate( cursor.getString( 2 ) ); // Adding record to list recordList.add( record ); } while (cursor.moveToNext()); } // return record list return recordList; } public void deleteAllBmi() { SQLiteDatabase db = this.getWritableDatabase(); String deleteQuery = "DELETE FROM " + TABLE_RECORD; db.execSQL(deleteQuery); db.close(); // Closing database connection }*/ }
0ee9a3c0dca01bc5cc16c797def99ff90ebe99bf
9515eb45851fab3d7d0aa768bb87e097871726b3
/src/main/java/threadlocal/ThreadLocalNormalUsage02.java
70c9fba4e5b508d5af7bc95fdb891f4d01c04cb4
[]
no_license
caibing1989/java-practise
884f5f561c8878cef68110c01fa429c0a5ebbb73
dbf47d08d4bb2d2bbde79a383020785527b91ca4
refs/heads/master
2022-12-25T20:58:55.455104
2020-10-09T02:29:04
2020-10-09T02:29:04
286,246,509
0
0
null
null
null
null
UTF-8
Java
false
false
1,102
java
package threadlocal; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @Description: SimpleDateFormat不用每次都调用,只生成一次,但是这样会有线程安全问题 * @Author: mtdp * @Date: 2020-07-27 */ public class ThreadLocalNormalUsage02 { private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); private static ExecutorService executorService = Executors.newFixedThreadPool(10); public static void main(String[] args) { for (int i = 0; i < 1000; i++) { int finalI = i; executorService.execute(() -> { String date = new ThreadLocalNormalUsage02().date(finalI); System.out.println(date); }); } executorService.shutdown(); } public String date(int seconds) { // 参数的单位为毫秒,从1970.01.01 00:00:00开始 Date date = new Date(1000 * seconds); return simpleDateFormat.format(date); } }
7bbf36cb2c50ad3e5d26c49e5937911a06d76473
dab8d9affcd176bd24420870149efabc72631ea9
/src/sample/Main.java
bff7906b00df93fead97ba9525c1da9de4c224fc
[]
no_license
tjtunait2/RPGGameTeam17
a327061f08fddf8d3a45fc8b6d644a2585cf197c
75df40cfb03c7daeda811504abbbfd50da213fff
refs/heads/master
2022-10-20T23:43:03.753016
2020-06-15T10:11:06
2020-06-15T10:11:06
268,785,660
1
0
null
null
null
null
UTF-8
Java
false
false
8,011
java
package sample; import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.KeyEvent; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage; import java.io.IOException; public class Main extends Application { static final double WIDTH = 700, HEIGHT = 600; int gameScore = 0; Text scoreText, scoreLabel; private Font scoreFont; private boolean up, down, left, right, aKey, dKey, sKey, wKey; Group root; VBox buttonContainer; MainCharacter main; Enemy iBeagle; Projectile iBullet, iCheese; Prop iPR0, iPR1, iPR2, iPR3, iPR4, iPR5, iPR6, iPR7, iPR8; private Scene scene, scene0; private Image iB0, iB1, iB2, iB3, iB4, iB5, iB6, iB7, iB8, iP0, iT0, iT1, iE0, iC0, iC1; private Image backgroundImage; private GamePlayLoop gamePlayLoop; CastingDirector castDirector; ImageView background; Button playGameButton, howToPlayButton, settingButton, exitButton; @Override public void start(Stage primaryStage) throws IOException { // create scene 0 Button playGameButton = new Button("PLAY GAME"); playGameButton.setFont(new Font("Candara Bold", 35.5)); Button howToPlayButton = new Button("How to Play"); howToPlayButton.setFont(new Font("Candara", 35.5)); Button settingButton = new Button("Settings"); settingButton.setFont(new Font("Candara", 35.5)); Button quitButton = new Button("Quit"); quitButton.setFont(new Font("Candara", 35.5)); buttonContainer = new VBox(); buttonContainer.getChildren().addAll(playGameButton, howToPlayButton, settingButton, quitButton); buttonContainer.setSpacing(50); buttonContainer.setAlignment(Pos.CENTER); //buttonContainer = FXMLLoader.load(getClass().getResource("sample.fxml")); scene0 = new Scene(buttonContainer, WIDTH, HEIGHT, Color.BROWN); primaryStage.setTitle("RPG Game Team 17"); playGameButton.setOnAction(actionEvent -> { primaryStage.setScene(scene); }); root = new Group(); scene = new Scene(root, WIDTH, HEIGHT, Color.GREEN); primaryStage.setScene(scene0); primaryStage.show(); createSceneEventHandling(); loadImageAssets(); createGameActors(); addGameActorNodes(); createCastingDirection(); createStartGameLoop(); } public static void main(String[] args) { launch(args); } public boolean isUp() { return up; } public void setUp(boolean up) { this.up = up; } public boolean isDown() { return down; } public void setDown(boolean down) { this.down = down; } public boolean isLeft() { return left; } public void setLeft(boolean left) { this.left = left; } public boolean isRight() { return right; } public void setRight(boolean right) { this.right = right; } public boolean isaKey() { return aKey; } public void setaKey(boolean aKey) { this.aKey = aKey; } public boolean isdKey() { return dKey; } public void setdKey(boolean dKey) { this.dKey = dKey; } public boolean issKey() { return sKey; } public void setsKey(boolean sKey) { this.sKey = sKey; } public boolean iswKey() { return wKey; } public void setwKey(boolean wKey) { this.wKey = wKey; } private void createSceneEventHandling() { scene.setOnKeyPressed((KeyEvent event) -> { switch (event.getCode()) { case W: wKey = true; break; case I: up = true; break; case S: sKey = true; break; case K: down = true; break; case A: aKey = true; break; case J: left = true; break; case D: dKey = true; break; case L: right = true; break; } }); scene.setOnKeyReleased((KeyEvent event) -> { switch (event.getCode()) { case W: wKey = false; break; case I: up = false; break; case S: sKey = false; break; case K: down = false; break; case A: aKey = false; break; case J: left = false; break; case D: dKey = false; break; case L: right = false; break; } }); } private void loadImageAssets() { iP0 = new Image("/proper1.png", 50, 50, false, false, true); iB0 = new Image("/pngegg_1.png", 50, 50, false, false, true); iB1 = new Image("/right2.png", 50, 50, false, false, true); iB2 = new Image("/right1.png", 50, 50, false, false, true); iB3 = new Image("/behind1.png", 50, 50, false, false, true); iB4 = new Image("/behind2.png", 50, 50, false, false, true); iB5 = new Image("/front1.png",50, 50, false, false, true); iB6 = new Image("/front2.png", 50, 50, false, false, true); iB7 = new Image("/sprite7.png", 50, 50, false, false, true); iB8 = new Image("/sprite8.png", 50, 50, false, false, true); iE0 = new Image("/enemy.png", 50, 50, false, false, true); iC0 = new Image("/bullet.png", 64, 24, false, false, true); iC1 = new Image("/cheese.png", 32, 29, false, false, true); backgroundImage = new Image("/background4.png", 700, 600, false, false, true); } private void createGameActors() { main = new MainCharacter(this, "M58,8 L58,8 43,24 32,28 32,41 18,41 28,54 40,61 35,73 41,79 45,54 55,39 65,40 69,25 Z", 0, 562, iB0, iB1, iB2, iB3, iB4, iB5, iB6, iB7, iB8); iPR0 = new Prop("M0,0 L0,32 72,32 72,0 Z", 50, 100, iP0); iPR1 = new Prop("M0,0 L0,32 72,32 72,0 Z", 100, 150, iP0); iPR2 = new Prop("M0,0 L0,32 72,32 72,0 Z", 0, 100, iP0); /// background = new ImageView(backgroundImage); iBeagle = new Enemy(this, "M0 6 L0 52 70 52 70 70 70 93 115 45 115 0 84 0 68 16 Z", 300, 481, iE0); iBullet = new Projectile("M0 4 L0 16 64 16 64 4 Z", -9, -9, iC0); //iCheese = new Projectile("M0 0 L0 32 32 32 32 0 Z", -32, 0, iC1); iCheese = new Projectile("M0 4 L0 16 64 16 64 4 Z", -96, -8, iC1); //iPV1 = new PropV("M150 0 L75 200 L225 200 Z", 0, -58, iP1); //iPR1 = new Prop("M150 0 L75 200 L225 200 Z", 0, -150, iP1); } private void addGameActorNodes() { // add background root.getChildren().add(background); // add prop root.getChildren().add(iPR0.spriteFrame); root.getChildren().add(iPR1.spriteFrame); root.getChildren().add(iPR2.spriteFrame); //.getChildren().add(iPR4.spriteFrame); //root.getChildren().add(iPR5.spriteFrame); //root.getChildren().add(iPR6.spriteFrame); // add main root.getChildren().add(iBeagle.spriteFrame); root.getChildren().add(main.spriteFrame); //root.getChildren().add(iCheese.spriteFrame); //root.getChildren().add(iBullet.spriteFrame); } private void createCastingDirection() { castDirector = new CastingDirector(); castDirector.addCurrentCast(iPR0, iPR1); } private void createStartGameLoop() { gamePlayLoop = new GamePlayLoop(this); gamePlayLoop.start(); } }
9ed534c002dfecb01f5f1784b3558dbc0cc231cf
f44358fe79faecd09d56f3801b679d2daa578e19
/app/src/main/java/kr/ds/login/GoogleLoginUtil.java
a47ce02b60e274482f2fbb557d2499e5d415275e
[]
no_license
chodongsuk/baselogin
719c254d19537d5ae1e7a98064f8b45d544133f4
92b6ebeeac325d0df252bd3ee79a4ed077385a34
refs/heads/master
2021-01-10T13:41:07.477045
2016-03-24T08:47:51
2016-03-24T08:47:51
48,210,418
0
0
null
null
null
null
UTF-8
Java
false
false
2,963
java
package kr.ds.login; import android.app.Activity; import android.content.IntentSender; import android.os.Bundle; import android.util.Log; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.plus.Plus; /** * Created by Administrator on 2016-03-24. */ public class GoogleLoginUtil implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{ private final String TAG = GoogleLoginUtil.class.getSimpleName(); private int RESULT_OK = 1; private static final int RC_SIGN_IN = 0; private boolean mIsResolving = false; private boolean msignedInClicked = false; private GoogleApiClient mGoogleApiClient; private Activity activity; public GoogleLoginUtil(Activity activity){ this.activity = activity; mGoogleApiClient = new GoogleApiClient.Builder(this.activity).addConnectionCallbacks(this) .addOnConnectionFailedListener(this).addApi(Plus.API) .addScope(Plus.SCOPE_PLUS_PROFILE).build(); } public GoogleApiClient getmGoogleApiClient() { return mGoogleApiClient; } public void signIn() { msignedInClicked = true; mGoogleApiClient.connect(); } @Override public void onConnected(Bundle arg0) { msignedInClicked = false; Toast.makeText(activity, "Login successful", Toast.LENGTH_SHORT).show(); } @Override public void onConnectionSuspended(int i) { } @Override public void onConnectionFailed(ConnectionResult connectionResult) { Log.i(TAG,"onConnectionFailed"); if (!mIsResolving && msignedInClicked) { if (connectionResult.hasResolution()) { try { Log.i(TAG,"connectionResult.hasResolution()"); connectionResult.startResolutionForResult(activity, RC_SIGN_IN); mIsResolving = true; } catch (IntentSender.SendIntentException e) { Log.i(TAG,"IntentSender.SendIntentException e"); mIsResolving = false; mGoogleApiClient.connect(); } }else{ Toast.makeText(activity, "connectionResult.hasResolution() not", Toast.LENGTH_SHORT).show(); } } } public void onResult(int requestCode, int resultCode) { Log.i(TAG,"onResult"); if (requestCode == RC_SIGN_IN) { if (resultCode != RESULT_OK) { msignedInClicked = false; } mIsResolving = false; if (!mGoogleApiClient.isConnecting()) { Log.i(TAG,"!mGoogleApiClient.isConnecting()"); mGoogleApiClient.connect(); } } else { Toast.makeText(activity, "Login failed", Toast.LENGTH_SHORT).show(); } } }
d542d810d5082bb043d03ddd84790755bac4f591
972692bb661df547870876ab2541c1e4740ce2db
/food_rating_service/src/main/java/food/ratings/service/RatingService.java
4390c8c6a5e30a2a5b131fc32d9612a5562c44d4
[]
no_license
yasiru-hasaranjala/Restaurent-Management-System
400fb0fa54c57917782e9a18145c8bf0a3fd400c
eb93475d93b83805196b883f78759a051fbef819
refs/heads/main
2023-07-12T19:46:09.457149
2021-08-24T03:04:36
2021-08-24T03:04:36
370,391,624
0
5
null
2021-08-24T03:04:36
2021-05-24T15:02:51
HTML
UTF-8
Java
false
false
1,425
java
package food.ratings.service; import food.ratings.dao.RatingRepository; import food.ratings.model.ComposidePrimaryKey; import food.ratings.model.Rating; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @Service public class RatingService { @Autowired private RatingRepository ratingRepository; public void saveRating( Rating rate ){ ratingRepository.save(rate); } public List<Rating> getAllRatings(String itemid) { return ratingRepository.findAll(itemid); } public List<Rating> getSingleRating(String itemid, String userid) { return ratingRepository.findSingle(itemid, userid); } public void updateRating(Rating rate, String itemid, String userid) { String a=rate.getRate(); String b=rate.getDescription(); ratingRepository.update(a,itemid,userid); } public void deleteRating(String itemid, String userid) { ComposidePrimaryKey deleteID=new ComposidePrimaryKey(); deleteID.setItemID(itemid); deleteID.setUserID(userid); ratingRepository.deleteById(deleteID); } }
b674c3a73a36bddeea31517223820b26c78c2f45
5a9bc3ebde821c09bc5864791d9162a3013237bb
/src/test/java/com/kellte/demo/DemoApplicationTests.java
734d65fc88723e3affed1eca5fda29e5e25bc5b7
[]
no_license
2390438889/kettle
773851b6808db2c2a9acbfe4260b586edc6cdc5b
7147c123567b0129a0d98571c7b201029dcbcbe9
refs/heads/master
2020-03-28T22:41:02.185646
2018-09-21T08:31:28
2018-09-21T08:31:28
149,250,445
0
0
null
null
null
null
UTF-8
Java
false
false
330
java
package com.kellte.demo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class DemoApplicationTests { @Test public void contextLoads() { } }
aeab480aa84bfa9ae64978af2a3857e60e786b7b
e7d5d1421d5c02c36ac382b5cdfeda439685e88c
/src/main/java/demo/pages/phptravels/PhptravelsPage.java
1e6306632370ecec86ca4a9421604496db02c042
[]
no_license
agungsusilo/SinbadSDETAssignment
d12fe87e643f8bef59a1b286cfe2d448b36fb23a
bc11ff42e8f099788f333c64de6c70f8f2623810
refs/heads/master
2022-12-20T00:50:04.452339
2020-10-16T02:59:30
2020-10-16T02:59:30
304,502,956
0
0
null
null
null
null
UTF-8
Java
false
false
8,862
java
package demo.pages.phptravels; import demo.webdriver.WebdriverInstance; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import static demo.webdriver.WebdriverInstance.webdriver; public class PhptravelsPage { public void openPage() { webdriver.get("https://www.phptravels.net/"); } public void inputDestination(String city){ WebElement namefield = WebdriverInstance.webdriver .findElement(By.cssSelector("#s2id_autogen16")); namefield.click(); namefield.sendKeys(city); } public void inputCheckIN(String date) { WebDriverWait wait = new WebDriverWait(webdriver, 10); String select = Keys.chord(Keys.CONTROL, "a"); WebElement checkinfield = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@id='checkin']"))); checkinfield.sendKeys(select); checkinfield.sendKeys(date); } public void inputCheckOUT(String date) { WebElement checkinfield = webdriver.findElement(By.xpath("//input[@id='checkout']")); String select = Keys.chord(Keys.CONTROL, "a"); checkinfield.sendKeys(select); checkinfield.sendKeys(date); } public void clickChildAmount() { webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/span[1]/button[1]")).click(); } public void clickSearchBTN() { webdriver.findElement(By.xpath("//button[contains(text(),'Search')]")).click(); } public boolean checkSearchResultDisplayed(){ WebDriverWait wait = new WebDriverWait(webdriver, 20); return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//h4[contains(text(),'Filter Search')]"))).isDisplayed(); } public void clickTopListHotel(){ webdriver.findElement((By.xpath("//body/div[2]/div[1]/div[1]/section[1]/div[1]/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/a[1]"))).click(); } public boolean checkHotelDetailsDisplayed(){ WebDriverWait wait = new WebDriverWait(webdriver, 10); return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/ul[1]/li[1]"))).isDisplayed(); } public void clickTopRoom(){ webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[5]/form[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[2]/h5[1]/div[1]/label[1]")).click(); } public void clickBookBTN(){ webdriver.findElement(By.xpath("//button[contains(text(),'Book Now')]")).click(); } public boolean checkPersonalDetailsFormDisplayed(){ WebDriverWait wait = new WebDriverWait(webdriver, 10); return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//span[contains(text(),'Personal Details')]"))).isDisplayed(); } public void inputFirstName(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/label[1]/input[1]")); field.sendKeys(data); } public void inputLastName(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[2]/label[1]/input[1]")); field.sendKeys(data); } public void inputEmail(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/form[1]/div[2]/div[1]/label[1]/input[1]")); field.sendKeys(data); } public void inputEmailConfirmation(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/form[1]/div[2]/div[2]/label[1]/input[1]")); field.sendKeys(data); } public void inputContactNumber(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/form[1]/div[3]/div[1]/label[1]/input[1]")); field.sendKeys(data); } public void inputAddress(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/form[1]/div[4]/div[1]/label[1]/input[1]")); field.sendKeys(data); } public void clickCountry(){ webdriver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/form[1]/div[5]/div[1]/div[2]/div[1]/ul[1]")).click(); } public void clickBookingFinal(){ webdriver.findElement(By.xpath("//button[contains(text(),'CONFIRM THIS BOOKING')]")).click(); } public boolean checkBookingDetailsPage(){ WebDriverWait wait = new WebDriverWait(webdriver, 10); return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//span[contains(text(),'Invoice Number')]"))).isDisplayed(); } public void clickMyAccount(){ webdriver.findElement(By.id("dropdownCurrency")).click(); } public void clickMyAccLogin(){ webdriver.findElement(By.xpath("//header/div[1]/div[1]/div[1]/div[2]/div[1]/ul[1]/li[2]/div[1]/div[1]/div[1]/a[1]")).click(); } public boolean seeLoginPage(){ WebDriverWait wait = new WebDriverWait(webdriver, 10); return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//title[contains(text(),'Login')]"))).isDisplayed(); } public void inputLoginEmail(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[2]/div[1]/section[1]/div[1]/div[1]/div[2]/form[1]/div[3]/div[1]/label[1]/input[1]")); field.sendKeys(data); } public void inputLoginPassword(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[2]/div[1]/section[1]/div[1]/div[1]/div[2]/form[1]/div[3]/div[2]/label[1]/input[1]")); field.sendKeys(data); } public void clickLOGINbutton(){ webdriver.findElement(By.xpath("//button[contains(text(),'Login')]")).click(); } public boolean seeMyAccountPage(){ WebDriverWait wait = new WebDriverWait(webdriver, 10); return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//a[contains(text(),'My Profile')]"))).isDisplayed(); } public void openVisaPage(String Origin, String Destination, String Date) { String urladdress = "https://www.phptravels.net/visa?nationality_country="+Origin+"&destination_country="+Destination+"&date="+Date+""; webdriver.get(urladdress); } public void inputvisafirstname(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/label[1]/input[1]")); field.sendKeys(data); } public void inputvisalastname(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/form[1]/div[1]/div[2]/label[1]/input[1]")); field.sendKeys(data); } public void inputvisaemail(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/form[1]/div[2]/div[1]/label[1]/input[1]")); field.sendKeys(data); } public void inputvisaconfirmemail(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/form[1]/div[2]/div[2]/label[1]/input[1]")); field.sendKeys(data); } public void inputvisacontactnumber(String data){ WebElement field = webdriver.findElement(By.xpath("//body/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/form[1]/div[3]/div[1]/label[1]/input[1]")); field.sendKeys(data); } public void clickBookingVISA(){ webdriver.findElement(By.xpath("//button[@id='sub']")).click(); } public void clickVIEWinvoice(){ webdriver.findElement(By.xpath("//a[contains(text(),'View Invoice')]")).click(); } public boolean checkVISAbookingdetails(){ WebDriverWait wait = new WebDriverWait(webdriver, 10); return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//span[contains(text(),'Booking Details')]"))).isDisplayed(); } }
a5fba843be35c14afcea028b177b740162c51555
081f7b347af5a1b3e953413c694d646f25035121
/redisCode/RedisClient-master/src/main/java/com/cxy/redisclient/integration/ConfigFile.java
6d56f97c7537b7d007ce8ea7ae87f6d8cb076a98
[]
no_license
phiepi/learning
8b9e48e8eb1e9a4273ed0cddc1f140536aca0e1e
32f2830407a0143efd519318448442f5b2cd368c
refs/heads/master
2021-09-05T03:59:46.847674
2018-01-24T02:08:13
2018-01-24T02:08:13
114,360,663
0
1
null
null
null
null
UTF-8
Java
false
false
4,560
java
package com.cxy.redisclient.integration; import java.io.IOException; import com.cxy.redisclient.domain.Language; public class ConfigFile extends PropertyFile { private final static String propertyFile = System.getProperty("user.home") + "\\.RedisClient.properties"; public static final String PORT = "port"; public static final String HOST = "host"; public static final String NAME = "name"; public static final String PASSWORD = "password"; public static final String SERVER_MAXID = "server_maxid"; public static final String FAVORITE = "favorite"; public static final String FAVORITE_NAME = "favorite_name"; public static final String FAVORITE_SERVER = "favorite_server"; public static final String FAVORITE_MAXID = "favorite_maxid"; public static final String LANGUAGE = "language"; public static final String FLATVIEW = "flat_view"; private static final String HIER = "hier"; private static final String FLAT = "flat"; public static final String TIMEOUT1 = "timeout1"; public static final String TIMEOUT2 = "timeout2"; private static final int TIMEOUT = 100; public static final String SEPARATOR = "separator"; public static final String SEP = ":"; public static final String PAGESIZE = "pagesize"; private static final int SIZE = 20; public static String readMaxId(String maxid) throws IOException { return readMaxId(propertyFile, maxid); } public static String read(String key) throws IOException { return read(propertyFile, key); } public static void write(String key, String value) throws IOException { write(propertyFile, key, value); } public static void delete(String key) throws IOException { delete(propertyFile, key); } public static Language getLanguage(){ try { String language = read(LANGUAGE); if(language == null) return Language.English; else if(language.equals(Language.English.toString())) return Language.English; else if(language.equals(Language.Chinese.toString())) return Language.Chinese; else return Language.English; } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } public static void setLanguage(Language language){ try { write(LANGUAGE, language.toString()); } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } public static boolean getFlatView(){ try { String flatView = read(FLATVIEW); if(flatView == null) return false; else if(flatView.equals(FLAT)) return true; else if(flatView.equals(HIER)) return false; else return false; } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } public static void setFlatView(boolean flatView){ String view; if(flatView) view = FLAT; else view = HIER; try { write(FLATVIEW, view); } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } private static void setTimeout(int timeout, String time){ try { write(time, Integer.toString(timeout)); } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } private static int getTimeout(String time){ try { String timeout = read(time); if(timeout == null) return TIMEOUT; else return Integer.parseInt(timeout); } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } public static void setT1(int timeout){ setTimeout(timeout, TIMEOUT1); } public static int getT1(){ return getTimeout(TIMEOUT1); } public static void setT2(int timeout){ setTimeout(timeout, TIMEOUT2); } public static int getT2(){ return getTimeout(TIMEOUT2); } public static void setPagesize(int size){ try { write(PAGESIZE, Integer.toString(size)); } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } public static int getPagesize(){ try { String size = read(PAGESIZE); if(size == null) return SIZE; else return Integer.parseInt(size); } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } public static void setSeparator(String separator){ try { write(SEPARATOR, separator); } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } public static String getSeparator(){ try { String separator = read(SEPARATOR); if(separator == null) return SEP; else return separator; } catch (IOException e) { throw new RuntimeException(e.getLocalizedMessage()); } } }
eb22fd2e7ed19d4e3c89e4afe21002ad49915115
53e1530d418dcda795cd140db4d736a65695f37b
/IdeaProjects/src/part1/chapter09/p2/Demo.java
595ec275646e5f17456f0f9d7ee96dbba186eca2
[]
no_license
Zed180881/Zed_repo
a03bac736e3c61c0bea61b2f81624c4bc604870b
6e9499e7ec3cfa9dc11f9d7a92221522c56b5f61
refs/heads/master
2020-04-05T18:57:47.596468
2016-11-02T07:51:30
2016-11-02T07:51:30
52,864,144
0
0
null
null
null
null
UTF-8
Java
false
false
194
java
package part1.chapter09.p2; public class Demo { public static void main(String[] args) { Protection2 ob1 = new Protection2(); OtherPackage ob2 = new OtherPackage(); } }
2a51944530d748bd22d80489322322e51a4b0549
eea6869665b8e39be7506b577a25a361b10f444e
/cloud-service-1/src/main/java/com/hoje/cloud/springcloud/service1/config/DynamicDataSource.java
72f0b34acd7941dbf93d45cc546fdb1cff3d5a11
[]
no_license
jack-ma-chen/springcloud
1f356bc2f63ea5c9416218e325a96a769e4e1290
9efd32f9b4182d807916e95d9fa06b57acab328f
refs/heads/master
2022-09-27T23:17:21.065820
2020-06-02T14:49:28
2020-06-02T14:49:28
264,946,149
0
0
null
null
null
null
UTF-8
Java
false
false
1,017
java
package com.hoje.cloud.springcloud.service1.config; import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; import javax.sql.DataSource; import java.util.Map; //动态创建数据源 public class DynamicDataSource extends AbstractRoutingDataSource { private static final ThreadLocal<String> contextHolder = new ThreadLocal<>(); public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object,Object> targetDataSources){ super.setDefaultTargetDataSource(defaultTargetDataSource); super.setTargetDataSources(targetDataSources); super.afterPropertiesSet(); } @Override protected Object determineCurrentLookupKey() { return getDataSource(); } public static void setDataSource(String dataSource){ contextHolder.set(dataSource); } public static String getDataSource(){ return contextHolder.get(); } public static void cleanDataSource(){ contextHolder.remove(); } }
840d248e9fe0ff2bf3fa3a7f356bf997b9290977
c7007ec2122ec06177689aebcc7ab9e90c1ebe6a
/jd1-homework/src/by/htp/hometask/array1d/Task20.java
78fada6a614f3dbc9ccb5039e3a8fefdbe905784
[]
no_license
VictorPetrakov/Arrays1dTask-app
abe8e104a4e24badd0bf55d1e917ff1e97c9fc32
6ed693395804a01f199cee91ab56c267284cdc10
refs/heads/master
2021-04-09T05:57:32.753346
2020-03-20T20:25:39
2020-03-20T20:25:39
248,845,367
0
0
null
null
null
null
UTF-8
Java
false
false
1,263
java
package by.htp.hometask.array1d; import java.util.Random; //20. Дан целочисленный массив с количеством элементов п. Сжать массив, выбросив из него каждый //второй элемент (освободившиеся элементы заполнить нулями). Примечание. //Дополнительный массив не использовать. public class Task20 { public static void main(String[] args) { int n = 10; int[] mas = new int[n]; Random rand = new Random(); for (int i = 0; i < mas.length; i++) { mas[i] = rand.nextInt(10); } System.out.println("Заданный массив: "); for (int i = 0; i < mas.length; i++) { System.out.print(mas[i] + "/"); } for (int k = 1; k < mas.length - 1; k++) { // сдвиг последующих элементов for (int m = k + 2; m < mas.length - 1; m++) { mas[m] = mas[m + 1]; } mas[k] = mas[k + 1]; } n = n - (n / 2);//сжатие массива System.out.println("\nПолученый массив "); for (int i = 0; i < n; i++) { System.out.print(mas[i] + "/"); } } }
e00d56cebbf387a2055b0b25ed25233eb7a3da23
9751b90eb9359b12d6e2d01f38f0d22ed09dc544
/webproject_shopping,mall/store2018/src/com/itheima/web/servlet/BaseServlet.java
c7fcc32db82deee1a4ce88454958186036d93a0b
[]
no_license
ZHI-QI/webCode
3c33d784da3e3b647563b92c0c9505380b98def6
1ba45800f89deee97016a11949ba8591566c9460
refs/heads/master
2021-04-09T03:55:00.451709
2018-05-28T10:49:08
2018-05-28T10:49:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
930
java
package com.itheima.web.servlet; import java.lang.reflect.Method; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class BaseServlet extends HttpServlet { protected void service ( HttpServletRequest request, HttpServletResponse response ) { try { //响应解码 response.setContentType("text/html;charset=UTF-8"); String methodStr = request.getParameter("method"); Class clazz = this.getClass(); Method method = clazz.getMethod(methodStr, HttpServletRequest.class, HttpServletResponse.class); String path = (String) method.invoke(this, request, response); if( path != null) { request.getRequestDispatcher(path).forward(request, response); } } catch (Exception e) { System.out.println("没有收到方法返回值"); e.printStackTrace(); } } }
06ec508fcfcd868c85e01dd6e815c2ab6ad86439
53292c69400aea30de582d4449969e801fcc0c40
/src/HashtableImpl.java
a9584e3b1eede502ad52d4a88d76d994d558f4fd
[]
no_license
Bhupendra124/HashTable_Implementation
aead8157c0b1de30f8362821a8c4405134b568c7
6a27d991bc06079c5b5e53f5d367358f0e657fdd
refs/heads/master
2023-07-01T07:57:47.636502
2021-07-31T01:37:26
2021-07-31T01:37:26
391,228,213
0
0
null
null
null
null
UTF-8
Java
false
false
3,233
java
import java.util.ArrayList; public class HashtableImpl<K, V> { Node head; Node tail; private final int numOfBuckets; ArrayList<Node<K,V>> myBucketArray; public HashtableImpl() { this.numOfBuckets = 10; this.myBucketArray = new ArrayList<>(); for (int i = 0; i < numOfBuckets; i++) this.myBucketArray.add(null); } public void add(K key, V value) { int index = this.getBucketIndex(key); Node<K,V> myNode= this.myBucketArray.get(index); if(myNode == null) { myNode = new Node<>(key , value); this.myBucketArray.set(index, myNode); } myNode = (Node<K, V>) searchNode(key); if(myNode == null) { myNode = new Node<>(key , value); this.append(myNode); } else { myNode.setValue(value); } } //Append the value in the linked list public void append(Node<K, V> myNode) { if(this.head == null) this.head = myNode; if(this.tail == null) this.tail = myNode; else { this.tail.setNext(myNode); this.tail = myNode; } } //Searching for the word in the linked list public Node<K, V> searchNode(K data) { Node<K, V> currentNode = head; int position = 0; while (currentNode != null) { position++; if (currentNode.getKey().equals(data)) { return currentNode; } currentNode = currentNode.getNext(); } return currentNode; } //Searching for the word and get the value from the linked list public V get(K word) { int index = this.getBucketIndex(word); if(this.myBucketArray.get(index) == null) return null; Node<K, V> myMapNode = searchNode(word); return (myMapNode == null) ? null : myMapNode.getValue(); } //hashcode to find the index private int getBucketIndex(K word) { int hashCode = Math.abs(word.hashCode()); int index = hashCode % numOfBuckets; //System.out.println("Key: "+word+" hashcode: "+hashCode+" index: "+index); return index; } //Remove "avoidable" from hashtable public void remove(K word) { Node currentNode = head; Node previousNode = null; while (currentNode != null && currentNode.getKey().equals(word)) { head = currentNode.getNext(); return; } while (currentNode != null && !(currentNode.getKey().equals(word))) { previousNode = currentNode; currentNode = currentNode.getNext(); } if (currentNode != null) { previousNode.next = currentNode.next; } if(currentNode == null) System.out.println("Word not found!"); } //Print the linked list @Override public String toString() { return "MyLinkedListNodes{" + head + "}"; } public void printNodes() { System.out.println("My nodes: " + head); } }
913f8eac3a3f6420b2de7fd9610a83abfc29ce7d
1415496f94592ba4412407b71dc18722598163dd
/doc/libjitisi/sources/org/jitsi/impl/neomedia/codec/audio/silk/LPVariableCutoff.java
a86ab4f821f0cd72ebfb86d20ad0cd0d17817082
[ "Apache-2.0" ]
permissive
lhzheng880828/VOIPCall
ad534535869c47b5fc17405b154bdc651b52651b
a7ba25debd4bd2086bae2a48306d28c614ce0d4a
refs/heads/master
2021-07-04T17:25:21.953174
2020-09-29T07:29:42
2020-09-29T07:29:42
183,576,020
0
0
null
null
null
null
UTF-8
Java
false
false
5,754
java
package org.jitsi.impl.neomedia.codec.audio.silk; import javax.media.Buffer; public class LPVariableCutoff { static final /* synthetic */ boolean $assertionsDisabled = (!LPVariableCutoff.class.desiredAssertionStatus()); static void SKP_Silk_LP_interpolate_filter_taps(int[] B_Q28, int[] A_Q28, int ind, int fac_Q16) { int i_djinn; int nb; int na; if (ind >= 4) { for (i_djinn = 0; i_djinn < 3; i_djinn++) { B_Q28[i_djinn] = TablesOther.SKP_Silk_Transition_LP_B_Q28[4][i_djinn]; } for (i_djinn = 0; i_djinn < 2; i_djinn++) { A_Q28[i_djinn] = TablesOther.SKP_Silk_Transition_LP_A_Q28[4][i_djinn]; } } else if (fac_Q16 <= 0) { for (i_djinn = 0; i_djinn < 3; i_djinn++) { B_Q28[i_djinn] = TablesOther.SKP_Silk_Transition_LP_B_Q28[ind][i_djinn]; } for (i_djinn = 0; i_djinn < 2; i_djinn++) { A_Q28[i_djinn] = TablesOther.SKP_Silk_Transition_LP_A_Q28[ind][i_djinn]; } } else if (fac_Q16 == SigProcFIX.SKP_SAT16(fac_Q16)) { for (nb = 0; nb < 3; nb++) { B_Q28[nb] = Macros.SKP_SMLAWB(TablesOther.SKP_Silk_Transition_LP_B_Q28[ind][nb], TablesOther.SKP_Silk_Transition_LP_B_Q28[ind + 1][nb] - TablesOther.SKP_Silk_Transition_LP_B_Q28[ind][nb], fac_Q16); } for (na = 0; na < 2; na++) { A_Q28[na] = Macros.SKP_SMLAWB(TablesOther.SKP_Silk_Transition_LP_A_Q28[ind][na], TablesOther.SKP_Silk_Transition_LP_A_Q28[ind + 1][na] - TablesOther.SKP_Silk_Transition_LP_A_Q28[ind][na], fac_Q16); } } else if (fac_Q16 == 32768) { for (nb = 0; nb < 3; nb++) { B_Q28[nb] = SigProcFIX.SKP_RSHIFT(TablesOther.SKP_Silk_Transition_LP_B_Q28[ind][nb] + TablesOther.SKP_Silk_Transition_LP_B_Q28[ind + 1][nb], 1); } for (na = 0; na < 2; na++) { A_Q28[na] = SigProcFIX.SKP_RSHIFT(TablesOther.SKP_Silk_Transition_LP_A_Q28[ind][na] + TablesOther.SKP_Silk_Transition_LP_A_Q28[ind + 1][na], 1); } } else if ($assertionsDisabled || Buffer.FLAG_SKIP_FEC - fac_Q16 == SigProcFIX.SKP_SAT16(Buffer.FLAG_SKIP_FEC - fac_Q16)) { for (nb = 0; nb < 3; nb++) { B_Q28[nb] = Macros.SKP_SMLAWB(TablesOther.SKP_Silk_Transition_LP_B_Q28[ind + 1][nb], TablesOther.SKP_Silk_Transition_LP_B_Q28[ind][nb] - TablesOther.SKP_Silk_Transition_LP_B_Q28[ind + 1][nb], Buffer.FLAG_SKIP_FEC - fac_Q16); } for (na = 0; na < 2; na++) { A_Q28[na] = Macros.SKP_SMLAWB(TablesOther.SKP_Silk_Transition_LP_A_Q28[ind + 1][na], TablesOther.SKP_Silk_Transition_LP_A_Q28[ind][na] - TablesOther.SKP_Silk_Transition_LP_A_Q28[ind + 1][na], Buffer.FLAG_SKIP_FEC - fac_Q16); } } else { throw new AssertionError(); } } static void SKP_Silk_LP_variable_cutoff(SKP_Silk_LP_state psLP, short[] out, int out_offset, short[] in, int in_offset, int frame_length) { int[] B_Q28 = new int[3]; int[] A_Q28 = new int[2]; if (!$assertionsDisabled && psLP.transition_frame_no < 0) { throw new AssertionError(); } else if ($assertionsDisabled || ((psLP.transition_frame_no <= 128 && psLP.mode == 0) || (psLP.transition_frame_no <= 256 && psLP.mode == 1))) { if (psLP.transition_frame_no > 0) { int fac_Q16; int ind; if (psLP.mode == 0) { if (psLP.transition_frame_no < 128) { fac_Q16 = psLP.transition_frame_no << 11; ind = fac_Q16 >> 16; fac_Q16 -= ind << 16; if (!$assertionsDisabled && ind < 0) { throw new AssertionError(); } else if ($assertionsDisabled || ind < 5) { SKP_Silk_LP_interpolate_filter_taps(B_Q28, A_Q28, ind, fac_Q16); psLP.transition_frame_no++; } else { throw new AssertionError(); } } else if (psLP.transition_frame_no == 128) { SKP_Silk_LP_interpolate_filter_taps(B_Q28, A_Q28, 4, 0); } } else if (psLP.mode == 1) { if (psLP.transition_frame_no < 256) { fac_Q16 = (256 - psLP.transition_frame_no) << 10; ind = fac_Q16 >> 16; fac_Q16 -= ind << 16; if (!$assertionsDisabled && ind < 0) { throw new AssertionError(); } else if ($assertionsDisabled || ind < 5) { SKP_Silk_LP_interpolate_filter_taps(B_Q28, A_Q28, ind, fac_Q16); psLP.transition_frame_no++; } else { throw new AssertionError(); } } else if (psLP.transition_frame_no == 256) { SKP_Silk_LP_interpolate_filter_taps(B_Q28, A_Q28, 0, 0); } } } if (psLP.transition_frame_no > 0) { BiquadAlt.SKP_Silk_biquad_alt(in, in_offset, B_Q28, A_Q28, psLP.In_LP_State, out, out_offset, frame_length); return; } for (int i_djinn = 0; i_djinn < frame_length; i_djinn++) { out[out_offset + i_djinn] = in[in_offset + i_djinn]; } } else { throw new AssertionError(); } } }
e9b1fabfeb34ebd5711713ef01d2101441de6f06
71aa797685c8625a6e6578f67b5bd8ffe7a61056
/src/something/something/repositories/client/ClientRepositoryContract.java
ddabb0ec677ea9de0e9efc922851ee1b3622dd69
[]
no_license
Pelozo/Lab3
5bbb410f9fbe0faabdecfab22dc77113deeb646c
3dfd8d526d758f92244508577ff562fc8f59d431
refs/heads/master
2022-11-06T09:01:12.005824
2020-06-22T20:02:13
2020-06-22T20:02:13
271,079,061
0
0
null
2020-06-20T08:35:15
2020-06-09T18:23:53
Java
UTF-8
Java
false
false
257
java
package something.something.repositories.client; import something.something.model.client.Client; import something.something.repositories.Repository; public interface ClientRepositoryContract extends Repository<Client> { void replace(Client client); }
50eb1e34836e2f4a41bb2f29948b21a7390cf406
a8e41db8bfbf7b21f652fd69bd735ef31bf1ca3c
/build/generated/src/org/apache/jsp/index_jsp.java
510fce24fcee7be5805d69890b5f37ff15ce9bcb
[]
no_license
YoguBellad/NotAndOr_NIITproject
d307a97a4960c333b4047f1d27febd631560e121
9f5e7940a7ec2156684210131523322c80cdaed1
refs/heads/main
2023-05-01T02:55:53.706620
2021-05-15T17:04:14
2021-05-15T17:04:14
367,685,528
0
0
null
null
null
null
UTF-8
Java
false
false
27,770
java
package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import db.db_interactor; public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { db_interactor tm=new db_interactor(); private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory(); private static java.util.Vector _jspx_dependants; private org.apache.jasper.runtime.ResourceInjector _jspx_resourceInjector; public Object getDependants() { return _jspx_dependants; } public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html;charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; _jspx_resourceInjector = (org.apache.jasper.runtime.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<!DOCTYPE html>\n"); out.write("<html>\n"); out.write("<head>\n"); out.write("<meta charset=\"utf-8\">\n"); out.write("<style type=\"text/css\">\n"); out.write("textarea { font-size: 13px }\n"); out.write("\n"); out.write("body,td,th {\n"); out.write("\tfont-size: 12px;\n"); out.write("\tfont-family: \"Comic Sans MS\", cursive;\n"); out.write("\tbackground-color: #C3C3C3;\n"); out.write("}\n"); out.write("</style>\n"); out.write("<table>\n"); out.write(" <tr>\n"); out.write(" <td>\n"); out.write("<div align=\"left\" >\n"); out.write(" <img src=\"!&O greybg.jpg\" width=\"500\" height=\"300\" alt=\"!&O grey\"/>\n"); out.write("</div></td>\n"); out.write("<td>"); out.print( " " ); out.write("</td>\n"); out.write("<td align=\"right\">\n"); out.write(" <h1 align=\"right\">\n"); out.write(" "); out.write("\n"); out.write(" "); out.print( tm.time("h").substring(0,10) ); out.write("\n"); out.write("\n"); out.write(" <p></p>\n"); out.write(" "); out.print( tm.time("h").substring(10,tm.time("h").length()-3) ); out.write("\n"); out.write(" </h1>\n"); out.write("<p>&nbsp;</p>\n"); out.write("<form action=\"hmsearch.jsp\" method=\"post\" name=\"search\">\n"); out.write(" <div align=\"center\">\n"); out.write(" <p>\n"); out.write(" <textarea name=\"searchtxtaera\" cols=\"45\" rows=\"2\" placeholder=\"Search\" ></textarea>\n"); out.write(" <input name=\"Search\" type=\"submit\" value=\"Search Web\">\n"); out.write(" </p>\n"); out.write(" <p>&nbsp;</p>\n"); out.write(" </div>\n"); out.write("</form>\n"); out.write("</td></tr>\n"); out.write("</table>\n"); out.write("<form name=\"login\" method=\"post\" action=\"search.jsp\">\n"); out.write("<div align=\"center\">\n"); out.write("<h3>Hav an ID already?</h3>\n"); out.write("<p>\n"); out.write(" <input name=\"uname\" type=\"text\" placeholder=\"Username / ID\" size=\"25\">\n"); out.write(" <select name=\"host\" size=\"1\">\n"); out.write(" <option value=\"@ notandor\">@ notandor</option>\n"); out.write(" <option value=\"@gmail\">@gmail</option>\n"); out.write(" <option value=\"@yahoo\">@yahoo</option>\n"); out.write(" <option value=\"@facebook\">@facebook</option>\n"); out.write(" <option value=\"@watsapp\">@watsapp</option>\n"); out.write(" <option value=\"others\">others</option>\n"); out.write(" </select>\n"); out.write(" <input name=\"password\" type=\"password\" Placeholder=\"password\" size=\"25\">\n"); out.write(" <input name=\"LogIn\" type=\"submit\" value=\"LogIn\"></p>\n"); out.write("</form>\n"); out.write("<p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p> <h3>Wanna Get In?</h3>\n"); out.write("</p>\n"); out.write("\n"); out.write("\n"); out.write("<form action=\"search.jsp\" method=\"post\" name=\"signup\">\n"); out.write(" <p>\n"); out.write(" <textarea name=\"fname\" cols=\"15\" rows=\"2\" id=\"fname\" Placeholder=\"1st NAME\"></textarea>\n"); out.write(" <textarea name=\"lastname\" cols=\"15\" rows=\"2\" id=\"lastname\" Placeholder=\"LAST NAME\"></textarea>\n"); out.write(" <textarea name=\"Adres\" cols=\"30\" Placeholder=\"Address\"></textarea>\n"); out.write(" <textarea name=\"uname\" cols=\"15\" Placeholder=\"Username / ID\"></textarea>\n"); out.write(" <select name=\"host\" size=\"1\">\n"); out.write(" <option value=\"@ notandor\">@ notandor</option>\n"); out.write(" <option value=\"@gmail\">@gmail</option>\n"); out.write(" <option value=\"@yahoo\">@yahoo</option>\n"); out.write(" <option value=\"@facebook\">@facebook</option>\n"); out.write(" <option value=\"@watsapp\">@watsapp</option>\n"); out.write(" <option value=\"others\">others</option>\n"); out.write(" </select>\n"); out.write("\n"); out.write(" </p>\n"); out.write("\n"); out.write(" <p>\n"); out.write(" <select name=\"Country\">\n"); out.write(" <option value=\"\" selected=\"selected\">Select Country</option>\n"); out.write(" <option value=\"United States\">United States</option>\n"); out.write(" <option value=\"United Kingdom\">United Kingdom</option>\n"); out.write(" <option value=\"Afghanistan\">Afghanistan</option>\n"); out.write(" <option value=\"Albania\">Albania</option>\n"); out.write(" <option value=\"Algeria\">Algeria</option>\n"); out.write(" <option value=\"American Samoa\">American Samoa</option>\n"); out.write(" <option value=\"Andorra\">Andorra</option>\n"); out.write(" <option value=\"Angola\">Angola</option>\n"); out.write(" <option value=\"Anguilla\">Anguilla</option>\n"); out.write(" <option value=\"Antarctica\">Antarctica</option>\n"); out.write(" <option value=\"Antigua and Barbuda\">Antigua and Barbuda</option>\n"); out.write(" <option value=\"Argentina\">Argentina</option>\n"); out.write(" <option value=\"Armenia\">Armenia</option>\n"); out.write(" <option value=\"Aruba\">Aruba</option>\n"); out.write(" <option value=\"Australia\">Australia</option>\n"); out.write(" <option value=\"Austria\">Austria</option>\n"); out.write(" <option value=\"Azerbaijan\">Azerbaijan</option>\n"); out.write(" <option value=\"Bahamas\">Bahamas</option>\n"); out.write(" <option value=\"Bahrain\">Bahrain</option>\n"); out.write(" <option value=\"Bangladesh\">Bangladesh</option>\n"); out.write(" <option value=\"Barbados\">Barbados</option>\n"); out.write(" <option value=\"Belarus\">Belarus</option>\n"); out.write(" <option value=\"Belgium\">Belgium</option>\n"); out.write(" <option value=\"Belize\">Belize</option>\n"); out.write(" <option value=\"Benin\">Benin</option>\n"); out.write(" <option value=\"Bermuda\">Bermuda</option>\n"); out.write(" <option value=\"Bhutan\">Bhutan</option>\n"); out.write(" <option value=\"Bolivia\">Bolivia</option>\n"); out.write(" <option value=\"Bosnia and Herzegovina\">Bosnia and Herzegovina</option>\n"); out.write(" <option value=\"Botswana\">Botswana</option>\n"); out.write(" <option value=\"Bouvet Island\">Bouvet Island</option>\n"); out.write(" <option value=\"Brazil\">Brazil</option>\n"); out.write(" <option value=\"British Indian Ocean Territory\">British Indian Ocean Territory</option>\n"); out.write(" <option value=\"Brunei Darussalam\">Brunei Darussalam</option>\n"); out.write(" <option value=\"Bulgaria\">Bulgaria</option>\n"); out.write(" <option value=\"Burkina Faso\">Burkina Faso</option>\n"); out.write(" <option value=\"Burundi\">Burundi</option>\n"); out.write(" <option value=\"Cambodia\">Cambodia</option>\n"); out.write(" <option value=\"Cameroon\">Cameroon</option>\n"); out.write(" <option value=\"Canada\">Canada</option>\n"); out.write(" <option value=\"Cape Verde\">Cape Verde</option>\n"); out.write(" <option value=\"Cayman Islands\">Cayman Islands</option>\n"); out.write(" <option value=\"Central African Republic\">Central African Republic</option>\n"); out.write(" <option value=\"Chad\">Chad</option>\n"); out.write(" <option value=\"Chile\">Chile</option>\n"); out.write(" <option value=\"China\">China</option>\n"); out.write(" <option value=\"Christmas Island\">Christmas Island</option>\n"); out.write(" <option value=\"Cocos (Keeling) Islands\">Cocos (Keeling) Islands</option>\n"); out.write(" <option value=\"Colombia\">Colombia</option>\n"); out.write(" <option value=\"Comoros\">Comoros</option>\n"); out.write(" <option value=\"Congo\">Congo</option>\n"); out.write(" <option value=\"Congo, The Democratic Republic of The\">Congo, The Democratic Republic of The</option>\n"); out.write(" <option value=\"Cook Islands\">Cook Islands</option>\n"); out.write(" <option value=\"Costa Rica\">Costa Rica</option>\n"); out.write(" <option value=\"Cote D'ivoire\">Cote D'ivoire</option>\n"); out.write(" <option value=\"Croatia\">Croatia</option>\n"); out.write(" <option value=\"Cuba\">Cuba</option>\n"); out.write(" <option value=\"Cyprus\">Cyprus</option>\n"); out.write(" <option value=\"Czech Republic\">Czech Republic</option>\n"); out.write(" <option value=\"Denmark\">Denmark</option>\n"); out.write(" <option value=\"Djibouti\">Djibouti</option>\n"); out.write(" <option value=\"Dominica\">Dominica</option>\n"); out.write(" <option value=\"Dominican Republic\">Dominican Republic</option>\n"); out.write(" <option value=\"Ecuador\">Ecuador</option>\n"); out.write(" <option value=\"Egypt\">Egypt</option>\n"); out.write(" <option value=\"El Salvador\">El Salvador</option>\n"); out.write(" <option value=\"Equatorial Guinea\">Equatorial Guinea</option>\n"); out.write(" <option value=\"Eritrea\">Eritrea</option>\n"); out.write(" <option value=\"Estonia\">Estonia</option>\n"); out.write(" <option value=\"Ethiopia\">Ethiopia</option>\n"); out.write(" <option value=\"Falkland Islands (Malvinas)\">Falkland Islands (Malvinas)</option>\n"); out.write(" <option value=\"Faroe Islands\">Faroe Islands</option>\n"); out.write(" <option value=\"Fiji\">Fiji</option>\n"); out.write(" <option value=\"Finland\">Finland</option>\n"); out.write(" <option value=\"France\">France</option>\n"); out.write(" <option value=\"French Guiana\">French Guiana</option>\n"); out.write(" <option value=\"French Polynesia\">French Polynesia</option>\n"); out.write(" <option value=\"French Southern Territories\">French Southern Territories</option>\n"); out.write(" <option value=\"Gabon\">Gabon</option>\n"); out.write(" <option value=\"Gambia\">Gambia</option>\n"); out.write(" <option value=\"Georgia\">Georgia</option>\n"); out.write(" <option value=\"Germany\">Germany</option>\n"); out.write(" <option value=\"Ghana\">Ghana</option>\n"); out.write(" <option value=\"Gibraltar\">Gibraltar</option>\n"); out.write(" <option value=\"Greece\">Greece</option>\n"); out.write(" <option value=\"Greenland\">Greenland</option>\n"); out.write(" <option value=\"Grenada\">Grenada</option>\n"); out.write(" <option value=\"Guadeloupe\">Guadeloupe</option>\n"); out.write(" <option value=\"Guam\">Guam</option>\n"); out.write(" <option value=\"Guatemala\">Guatemala</option>\n"); out.write(" <option value=\"Guinea\">Guinea</option>\n"); out.write(" <option value=\"Guinea-bissau\">Guinea-bissau</option>\n"); out.write(" <option value=\"Guyana\">Guyana</option>\n"); out.write(" <option value=\"Haiti\">Haiti</option>\n"); out.write(" <option value=\"Heard Island and Mcdonald Islands\">Heard Island and Mcdonald Islands</option>\n"); out.write(" <option value=\"Holy See (Vatican City State)\">Holy See (Vatican City State)</option>\n"); out.write(" <option value=\"Honduras\">Honduras</option>\n"); out.write(" <option value=\"Hong Kong\">Hong Kong</option>\n"); out.write(" <option value=\"Hungary\">Hungary</option>\n"); out.write(" <option value=\"Iceland\">Iceland</option>\n"); out.write(" <option value=\"India\">India</option>\n"); out.write(" <option value=\"Indonesia\">Indonesia</option>\n"); out.write(" <option value=\"Iran, Islamic Republic of\">Iran, Islamic Republic of</option>\n"); out.write(" <option value=\"Iraq\">Iraq</option>\n"); out.write(" <option value=\"Ireland\">Ireland</option>\n"); out.write(" <option value=\"Israel\">Israel</option>\n"); out.write(" <option value=\"Italy\">Italy</option>\n"); out.write(" <option value=\"Jamaica\">Jamaica</option>\n"); out.write(" <option value=\"Japan\">Japan</option>\n"); out.write(" <option value=\"Jordan\">Jordan</option>\n"); out.write(" <option value=\"Kazakhstan\">Kazakhstan</option>\n"); out.write(" <option value=\"Kenya\">Kenya</option>\n"); out.write(" <option value=\"Kiribati\">Kiribati</option>\n"); out.write(" <option value=\"Korea, Democratic People's Republic of\">Korea, Democratic People's Republic of</option>\n"); out.write(" <option value=\"Korea, Republic of\">Korea, Republic of</option>\n"); out.write(" <option value=\"Kuwait\">Kuwait</option>\n"); out.write(" <option value=\"Kyrgyzstan\">Kyrgyzstan</option>\n"); out.write(" <option value=\"Lao People's Democratic Republic\">Lao People's Democratic Republic</option>\n"); out.write(" <option value=\"Latvia\">Latvia</option>\n"); out.write(" <option value=\"Lebanon\">Lebanon</option>\n"); out.write(" <option value=\"Lesotho\">Lesotho</option>\n"); out.write(" <option value=\"Liberia\">Liberia</option>\n"); out.write(" <option value=\"Libyan Arab Jamahiriya\">Libyan Arab Jamahiriya</option>\n"); out.write(" <option value=\"Liechtenstein\">Liechtenstein</option>\n"); out.write(" <option value=\"Lithuania\">Lithuania</option>\n"); out.write(" <option value=\"Luxembourg\">Luxembourg</option>\n"); out.write(" <option value=\"Macao\">Macao</option>\n"); out.write(" <option value=\"Macedonia, The Former Yugoslav Republic of\">Macedonia, The Former Yugoslav Republic of</option>\n"); out.write(" <option value=\"Madagascar\">Madagascar</option>\n"); out.write(" <option value=\"Malawi\">Malawi</option>\n"); out.write(" <option value=\"Malaysia\">Malaysia</option>\n"); out.write(" <option value=\"Maldives\">Maldives</option>\n"); out.write(" <option value=\"Mali\">Mali</option>\n"); out.write(" <option value=\"Malta\">Malta</option>\n"); out.write(" <option value=\"Marshall Islands\">Marshall Islands</option>\n"); out.write(" <option value=\"Martinique\">Martinique</option>\n"); out.write(" <option value=\"Mauritania\">Mauritania</option>\n"); out.write(" <option value=\"Mauritius\">Mauritius</option>\n"); out.write(" <option value=\"Mayotte\">Mayotte</option>\n"); out.write(" <option value=\"Mexico\">Mexico</option>\n"); out.write(" <option value=\"Micronesia, Federated States of\">Micronesia, Federated States of</option>\n"); out.write(" <option value=\"Moldova, Republic of\">Moldova, Republic of</option>\n"); out.write(" <option value=\"Monaco\">Monaco</option>\n"); out.write(" <option value=\"Mongolia\">Mongolia</option>\n"); out.write(" <option value=\"Montserrat\">Montserrat</option>\n"); out.write(" <option value=\"Morocco\">Morocco</option>\n"); out.write(" <option value=\"Mozambique\">Mozambique</option>\n"); out.write(" <option value=\"Myanmar\">Myanmar</option>\n"); out.write(" <option value=\"Namibia\">Namibia</option>\n"); out.write(" <option value=\"Nauru\">Nauru</option>\n"); out.write(" <option value=\"Nepal\">Nepal</option>\n"); out.write(" <option value=\"Netherlands\">Netherlands</option>\n"); out.write(" <option value=\"Netherlands Antilles\">Netherlands Antilles</option>\n"); out.write(" <option value=\"New Caledonia\">New Caledonia</option>\n"); out.write(" <option value=\"New Zealand\">New Zealand</option>\n"); out.write(" <option value=\"Nicaragua\">Nicaragua</option>\n"); out.write(" <option value=\"Niger\">Niger</option>\n"); out.write(" <option value=\"Nigeria\">Nigeria</option>\n"); out.write(" <option value=\"Niue\">Niue</option>\n"); out.write(" <option value=\"Norfolk Island\">Norfolk Island</option>\n"); out.write(" <option value=\"Northern Mariana Islands\">Northern Mariana Islands</option>\n"); out.write(" <option value=\"Norway\">Norway</option>\n"); out.write(" <option value=\"Oman\">Oman</option>\n"); out.write(" <option value=\"Pakistan\">Pakistan</option>\n"); out.write(" <option value=\"Palau\">Palau</option>\n"); out.write(" <option value=\"Palestinian Territory, Occupied\">Palestinian Territory, Occupied</option>\n"); out.write(" <option value=\"Panama\">Panama</option>\n"); out.write(" <option value=\"Papua New Guinea\">Papua New Guinea</option>\n"); out.write(" <option value=\"Paraguay\">Paraguay</option>\n"); out.write(" <option value=\"Peru\">Peru</option>\n"); out.write(" <option value=\"Philippines\">Philippines</option>\n"); out.write(" <option value=\"Pitcairn\">Pitcairn</option>\n"); out.write(" <option value=\"Poland\">Poland</option>\n"); out.write(" <option value=\"Portugal\">Portugal</option>\n"); out.write(" <option value=\"Puerto Rico\">Puerto Rico</option>\n"); out.write(" <option value=\"Qatar\">Qatar</option>\n"); out.write(" <option value=\"Reunion\">Reunion</option>\n"); out.write(" <option value=\"Romania\">Romania</option>\n"); out.write(" <option value=\"Russian Federation\">Russian Federation</option>\n"); out.write(" <option value=\"Rwanda\">Rwanda</option>\n"); out.write(" <option value=\"Saint Helena\">Saint Helena</option>\n"); out.write(" <option value=\"Saint Kitts and Nevis\">Saint Kitts and Nevis</option>\n"); out.write(" <option value=\"Saint Lucia\">Saint Lucia</option>\n"); out.write(" <option value=\"Saint Pierre and Miquelon\">Saint Pierre and Miquelon</option>\n"); out.write(" <option value=\"Saint Vincent and The Grenadines\">Saint Vincent and The Grenadines</option>\n"); out.write(" <option value=\"Samoa\">Samoa</option>\n"); out.write(" <option value=\"San Marino\">San Marino</option>\n"); out.write(" <option value=\"Sao Tome and Principe\">Sao Tome and Principe</option>\n"); out.write(" <option value=\"Saudi Arabia\">Saudi Arabia</option>\n"); out.write(" <option value=\"Senegal\">Senegal</option>\n"); out.write(" <option value=\"Serbia and Montenegro\">Serbia and Montenegro</option>\n"); out.write(" <option value=\"Seychelles\">Seychelles</option>\n"); out.write(" <option value=\"Sierra Leone\">Sierra Leone</option>\n"); out.write(" <option value=\"Singapore\">Singapore</option>\n"); out.write(" <option value=\"Slovakia\">Slovakia</option>\n"); out.write(" <option value=\"Slovenia\">Slovenia</option>\n"); out.write(" <option value=\"Solomon Islands\">Solomon Islands</option>\n"); out.write(" <option value=\"Somalia\">Somalia</option>\n"); out.write(" <option value=\"South Africa\">South Africa</option>\n"); out.write(" <option value=\"South Georgia and The South Sandwich Islands\">South Georgia and The South Sandwich Islands</option>\n"); out.write(" <option value=\"Spain\">Spain</option>\n"); out.write(" <option value=\"Sri Lanka\">Sri Lanka</option>\n"); out.write(" <option value=\"Sudan\">Sudan</option>\n"); out.write(" <option value=\"Suriname\">Suriname</option>\n"); out.write(" <option value=\"Svalbard and Jan Mayen\">Svalbard and Jan Mayen</option>\n"); out.write(" <option value=\"Swaziland\">Swaziland</option>\n"); out.write(" <option value=\"Sweden\">Sweden</option>\n"); out.write(" <option value=\"Switzerland\">Switzerland</option>\n"); out.write(" <option value=\"Syrian Arab Republic\">Syrian Arab Republic</option>\n"); out.write(" <option value=\"Taiwan, Province of China\">Taiwan, Province of China</option>\n"); out.write(" <option value=\"Tajikistan\">Tajikistan</option>\n"); out.write(" <option value=\"Tanzania, United Republic of\">Tanzania, United Republic of</option>\n"); out.write(" <option value=\"Thailand\">Thailand</option>\n"); out.write(" <option value=\"Timor-leste\">Timor-leste</option>\n"); out.write(" <option value=\"Togo\">Togo</option>\n"); out.write(" <option value=\"Tokelau\">Tokelau</option>\n"); out.write(" <option value=\"Tonga\">Tonga</option>\n"); out.write(" <option value=\"Trinidad and Tobago\">Trinidad and Tobago</option>\n"); out.write(" <option value=\"Tunisia\">Tunisia</option>\n"); out.write(" <option value=\"Turkey\">Turkey</option>\n"); out.write(" <option value=\"Turkmenistan\">Turkmenistan</option>\n"); out.write(" <option value=\"Turks and Caicos Islands\">Turks and Caicos Islands</option>\n"); out.write(" <option value=\"Tuvalu\">Tuvalu</option>\n"); out.write(" <option value=\"Uganda\">Uganda</option>\n"); out.write(" <option value=\"Ukraine\">Ukraine</option>\n"); out.write(" <option value=\"United Arab Emirates\">United Arab Emirates</option>\n"); out.write(" <option value=\"United Kingdom\">United Kingdom</option>\n"); out.write(" <option value=\"United States\">United States</option>\n"); out.write(" <option value=\"United States Minor Outlying Islands\">United States Minor Outlying Islands</option>\n"); out.write(" <option value=\"Uruguay\">Uruguay</option>\n"); out.write(" <option value=\"Uzbekistan\">Uzbekistan</option>\n"); out.write(" <option value=\"Vanuatu\">Vanuatu</option>\n"); out.write(" <option value=\"Venezuela\">Venezuela</option>\n"); out.write(" <option value=\"Viet Nam\">Viet Nam</option>\n"); out.write(" <option value=\"Virgin Islands, British\">Virgin Islands, British</option>\n"); out.write(" <option value=\"Virgin Islands, U.S.\">Virgin Islands, U.S.</option>\n"); out.write(" <option value=\"Wallis and Futuna\">Wallis and Futuna</option>\n"); out.write(" <option value=\"Western Sahara\">Western Sahara</option>\n"); out.write(" <option value=\"Yemen\">Yemen</option>\n"); out.write(" <option value=\"Zambia\">Zambia</option>\n"); out.write(" <option value=\"Zimbabwe\">Zimbabwe</option>\n"); out.write(" </select>\n"); out.write("\n"); out.write("\n"); out.write(" <input name=\"city\" type=\"text\" Placeholder=\"City\" size=\"20\">\n"); out.write(" <input name=\"postalcode\" type=\"text\" Placeholder=\"Postal Code\" size=\"10\">\n"); out.write(" <input name=\"password\" type=\"password\" Placeholder=\"password\" size=\"25\">\n"); out.write(" <input type=\"text\" name=\"y\" Placeholder=\"yyyy\" size=\"4\"/>/<input type=\"text\" name=\"m\" size=\"2\" Placeholder=\"mm\" />/<input type=\"text\" name=\"d\" Placeholder=\"dd\" size=\"2\" />\n"); out.write(" </p>\n"); out.write(" <p>\n"); out.write(" <input name=\"LogIn\" type=\"submit\" value=\"Get In\">\n"); out.write(" </p>\n"); out.write("\n"); out.write("</form>\n"); out.write("<div align=\"center\"><h5> !&O Prashanth Yogu </h5></div>\n"); out.write("\n"); out.write("\n"); out.write("</body>\n"); out.write("</html>\n"); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
6a67a6a5fcf4f8cc96046f8c75804ab4ab87fc19
5cbd544c05df013b12003c206a2f3c24a1d52d4a
/Meera has passed her exam or not/Main.java
c25ca338397a8339ec3a24eeab25c80ece9adb73
[]
no_license
pritipanna/Playground
38aa991bcaf82f73ddd68855198b6c0d78602aa3
287197d37906fd80ee8090b7da3aebfdcf5e06e2
refs/heads/master
2022-10-23T08:43:56.582219
2020-06-13T15:23:46
2020-06-13T15:23:46
261,709,082
2
0
null
null
null
null
UTF-8
Java
false
false
494
java
#include<iostream> using namespace std; int search(int x[], int size, int reg) { int flag=0; for(int i=0;i<size;i++) { if(reg==x[i]) { flag=1; break; } else continue; } return(flag); } int main() { int reg; int size; cin>>size; int x[size]; for(int i=0;i<size;i++) { cin>>x[i]; } cin>>reg; int flag=search(x,size,reg); if(flag==1) cout<<"She passed her exam"; else cout<<"She failed"; }
29fa6f484d8833bfbb16ba62a7dfb90ffc0b311a
3b91ed788572b6d5ac4db1bee814a74560603578
/com/tencent/mm/plugin/sns/storage/AdLandingPagesStorage/AdLandingPageComponent/component/widget/a$2.java
d5ab53638fb2121b0c66a2d7f4158b62151c211e
[]
no_license
linsir6/WeChat_java
a1deee3035b555fb35a423f367eb5e3e58a17cb0
32e52b88c012051100315af6751111bfb6697a29
refs/heads/master
2020-05-31T05:40:17.161282
2018-08-28T02:07:02
2018-08-28T02:07:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
581
java
package com.tencent.mm.plugin.sns.storage.AdLandingPagesStorage.AdLandingPageComponent.component.widget; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; class a$2 implements Runnable { final /* synthetic */ a nGD; final /* synthetic */ double ncU; a$2(a aVar, double d) { this.nGD = aVar; this.ncU = d; } public final void run() { x.i("MicroMsg.SightPlayController", "SeekToFrame %f %s", new Object[]{Double.valueOf(this.ncU), bi.cjd().toString()}); a.a(this.nGD, this.ncU); } }
0a2054007669cb43ea4c37ef6ba36820777ce836
cb7c73a31ceea22d2045cc4547b3bdfd68e9256b
/1. semester projekt/1Sem_Projekt_4_Eclipse/src/model/Order.java
c8e1c9486ac2d7483996286005215141bcde78fb
[ "MIT", "Apache-2.0" ]
permissive
akhegr/Skoleprojekter
4d22e43a2742c3dec44e958bd1c905d8df8dccd8
f66d5e0179df21fcf85b443b3f2ffdb6e1ebb6ea
refs/heads/develop
2023-06-07T12:17:48.409700
2023-05-26T18:01:33
2023-05-26T18:01:33
189,046,190
0
0
Apache-2.0
2023-05-26T18:01:34
2019-05-28T14:37:28
C#
UTF-8
Java
false
false
2,612
java
package model; import java.util.Map; import java.util.HashMap; public class Order { private int oliId; private Map<Integer, OrderLineItem> orderLineItems; private String date; private Employee employee; private Customer customer; private boolean isPayed; private double total; private CustomerContainer customerContainer; public Order(String date, Employee employee) { customerContainer = CustomerContainer.getInstance(); oliId = 0; orderLineItems = new HashMap<Integer, OrderLineItem>(); setDate(date); setEmployee(employee); setIsPayed(false); setTotal(0); } // Get and set methods public String getDate() { return date; } public void setDate(String date) { this.date = date; } public Customer getCustomer() { return customer; } public void setCustomer(Customer customer) { this.customer = customer; } public Employee getEmployee() { return employee; } public void setEmployee(Employee employee) { this.employee = employee; } public boolean getIsPayed() { return isPayed; } public void setIsPayed(boolean isPayed) { this.isPayed = isPayed; } public double getTotal() { return total; } public void setTotal(double total) { this.total = total; } public void addCustomer(int customerPhone) throws exceptions.PersonNotExistException { customer = customerContainer.findCustomer(customerPhone); } /** * Calculation of the total price for OrderLineItem * * @param amount The amount of that product * @param product The specific product * @return The total price of the product */ public double productPrice(int amount, Product product) { return product.getPrice() * amount; } /** * Add an OrderLineItem to the order * * @param amount The amount of that product * @param product The specific product */ public void addOli(int amount, Product product) { OrderLineItem oli = new OrderLineItem(amount, product); orderLineItems.put(oliId, oli); oliId++; total += productPrice(amount, product); } /** * Returns the purchased items * * @return Map A Map of the purchased goods */ public Map<Integer, OrderLineItem> getOli() { return orderLineItems; } }
857373a119695906942ae5d43436e09e1fcaf50e
e9361dfcdcfb9889053d0db1b577244f4aa0bb7a
/src/main/java/com/example/test/synchronizedtest/SyncStaticThread.java
38878c1de9693b7e4509add2832e6f326aad9919
[]
no_license
Code-God/test
896fd965df6af40245e367dc7d3982980761b5b0
41c66455e8c31044046b6528fb6e6418bf01230f
refs/heads/master
2020-03-19T07:45:33.588899
2018-06-27T09:13:02
2018-06-27T09:13:02
136,146,049
0
0
null
null
null
null
UTF-8
Java
false
false
2,255
java
package com.example.test.synchronizedtest; /** * @Author: wuxiaobiao * @Description: * @Date: Created in 2018/6/20 * @Time: 14:49 * I am a Code Man -_-! */ public class SyncStaticThread implements Runnable { private static int count; public SyncStaticThread() { count = 0; } public synchronized static void method() { for (int i = 0; i < 5; i++) { try { System.out.println(Thread.currentThread().getName() + ":" + (count++)); Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } @Override public synchronized void run() { method(); } /** * syncThread1和syncThread2是SyncThread的两个对象,但在thread1和thread2并发执行时却保持了线程同步。 * 这是因为run中调用了静态方法method,而静态方法是属于类的,所以syncThread1和syncThread2相当于用了同一把锁。 * * @param args */ public static void main(String args[]) { SyncStaticThread syncThread1 = new SyncStaticThread(); SyncStaticThread syncThread2 = new SyncStaticThread(); Thread thread1 = new Thread(syncThread1, "线程1"); Thread thread2 = new Thread(syncThread2, "线程2"); thread1.start(); thread2.start(); } //给class加锁和上例的给静态方法加锁是一样的,所有对象公用一把锁 /** * 同步线程 */ // class SyncThread implements Runnable { // private static int count; // // public SyncThread() { // count = 0; // } // // public static void method() { // synchronized (SyncThread.class) { // for (int i = 0; i < 5; i++) { // try { // System.out.println(Thread.currentThread().getName() + ":" + (count++)); // Thread.sleep(100); // } catch (InterruptedException e) { // e.printStackTrace(); // } // } // } // } // public synchronized void run() { // method(); // } // } }
ae90fedbe4814e8b4d8e804a2ae975a6647a5936
d187a91531b67cbc51f3d81f9888d6d5fa8cbead
/library/src/com/markchung/library/ConverterActivity.java
ba608109e6c6b9e605e79dbaf2abacecf8973488
[]
no_license
mark3049/HouseAssist
4f9ff940c6e4da01627e1992ee8f4606c7fd00ef
eaf201eeca140485dd48ba1ee6245f514104933f
refs/heads/master
2016-09-05T09:12:55.844511
2014-08-24T13:59:15
2014-08-24T13:59:15
null
0
0
null
null
null
null
BIG5
Java
false
false
4,591
java
package com.markchung.library; import java.text.NumberFormat; import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.Toast; public class ConverterActivity extends Activity implements OnClickListener { static double nornal_rate[] = { 0.00001, // 平方公里 0.0001, // 公頃 0.000103, // 甲 0.000247, // 英畝 0.01, // 公畝 0.3025, // 坪 1, // 平方公尺 10.7639, // 平方呎 1550, // 平方吋 10000 // 平方公分 }; static final double[][] rate = { { 1, 100, 103, 247, 10000, 302500, 1000000, -1, -1, -1 }, { 0.01, 1, 1.03, 2.47, 100, 3025, 10000, 107639, 15500000, 100000000 }, { 0.0097, 0.97, 1, 2.396, 96.99, 2934, 9699, 104399.07, 15033450, 96990000 }, { 0.004, 0.405, 0.417, 1, 40.47, 1224.12, 4046.87, 43560, 6272640, -1 }, { 0.0001, 0.01, 0.0103, 0.02471, 1, 30.25, 100, 1076.39, 155000, 10000 }, { 0.00003, 0.00033, 0.00034, 0.00082, 0.0331, 1, 3.31, 35.63, 5130.2, 33100 }, { 0.00001, 0.0001, 0.000103, 0.000247, 0.01, 0.3025, 1, 10.7639, 1550, 10000 }, { -1, 0.000009, 0.000009, 0.000022, 0.000928, 0.0281, 0.092899, 1, 144, 928.993 }, { -1, -1, -1, -1, 0.000006, 0.00019, 0.000645, 0.006944, 1, 6.452 }, { -1, -1, -1, -1, 0.000001, 0.00003, 0.0001, 0.001076, 0.155, 1 } }; private EditText m_result; private Spinner m_target; private Spinner m_source; private EditText m_input; private Button m_btn; private AdRequest adView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_converter); adView = MainTabActivity.getAdRequest(); adView.CreateAdRequest(this, (LinearLayout) findViewById(R.id.adview)); m_input = (EditText) findViewById(R.id.editText1); m_result = (EditText) findViewById(R.id.conver_result); m_target = (Spinner) findViewById(R.id.spinner_target); m_source = (Spinner) findViewById(R.id.spinner_source); m_btn = (Button) findViewById(R.id.button_calculate); m_btn.setOnClickListener(this); if (savedInstanceState == null) { SharedPreferences settings = getSharedPreferences(MainTabActivity.TAG, 0); m_input.setText(settings.getString("ConverInput", "")); m_target.setSelection(settings.getInt("ConverTargetUnit", 5)); m_source.setSelection(settings.getInt("ConverSourceUnit", 6)); } } @Override protected void onDestroy() { adView.Destroy(); super.onDestroy(); } @Override protected void onStop() { SharedPreferences settings = getSharedPreferences(MainTabActivity.TAG, 0); SharedPreferences.Editor edit = settings.edit(); edit.putInt("ConverTargetUnit", m_target.getSelectedItemPosition()); edit.putInt("ConverSourceUnit", m_source.getSelectedItemPosition()); edit.putString("ConverInput", m_input.getText().toString()); edit.commit(); super.onStop(); } @Override public void onClick(View v) { String buf = m_input.getText().toString(); try { int i = m_source.getSelectedItemPosition(); int j = m_target.getSelectedItemPosition(); double value = Double.parseDouble(buf); double mm; if (rate[i][j] < 0) { mm = (value * nornal_rate[j]) / nornal_rate[i]; } else { mm = value * rate[i][j]; } m_result.setText(NumberFormat.getNumberInstance().format(mm)); Toast.makeText(this, this.getString(R.string.msgCalculated), Toast.LENGTH_SHORT).show(); } catch (Exception e) { Toast.makeText(this, this.getString(R.string.msgEdit_field_isNull), Toast.LENGTH_SHORT).show(); return; } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.option_conver, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); int tmp; if(id == R.id.menu_item_clear){ m_result.setText(""); m_input.setText(""); }else if( id == R.id.menu_item_swap){ tmp = m_target.getSelectedItemPosition(); m_target.setSelection(m_source.getSelectedItemPosition()); m_source.setSelection(tmp); }else if(id == R.id.menu_item_calculate){ onClick(m_btn); } return true; } }
3318f9797211590bb115dffed193862dd3750b68
e5a045a060df2e6431993890b185b1ad0860b3fb
/src/main/java/com/exam/model/entity/Introduce.java
a37173d5bd3231228d61057cd5faa19a76827923
[]
no_license
hayhay19911103/yonkerServer
babdd470e848c9a8ed06314ab5f52b7c5cfb2e7b
1dd90d4d9f8192eac36e835911e0fde613f893f9
refs/heads/master
2021-01-20T14:36:07.969500
2017-05-08T14:20:12
2017-05-08T14:20:12
90,636,578
0
0
null
null
null
null
UTF-8
Java
false
false
881
java
package com.exam.model.entity; import javax.persistence.Basic; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; /** * Created by mac on 2017/3/21. */ @Entity public class Introduce { private Integer sectionId; private String imagePath; private String sectionText; @Id @GeneratedValue public Integer getSectionId() { return sectionId; } public void setSectionId(Integer sectionId) { this.sectionId = sectionId; } @Basic public String getImagePath() { return imagePath; } public void setImagePath(String imagePath) { this.imagePath = imagePath; } @Basic public String getSectionText() { return sectionText; } public void setSectionText(String sectionText) { this.sectionText = sectionText; } }
07b0040f1ee5f125d558d3a814615e2219367e67
37b941cf2688066a3b5142263a159d8ee8f77762
/githubproject/src/githubproject/HelloGit.java
415f234057ab9fc5ab35d6dc768dcc4307a3c2f8
[]
no_license
studentcse12345/myfirstproject
0477add96d94e5f4211f97fe403e9f50aad9fe41
cda439c52e35a1ba053df7fe619b01c2e7f00cdb
refs/heads/master
2023-01-24T06:28:34.026529
2020-11-16T17:12:57
2020-11-16T17:12:57
313,373,912
0
0
null
null
null
null
UTF-8
Java
false
false
179
java
package githubproject; public class HelloGit { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Welcome to Git Hub"); } }
d53d50ff79e522498c3601f2334544c231bc3a42
be451e398d0df6a96ca7d034a4ba11d8fe958e53
/lims/src/main/java/com/fh/service/system/instrument/InstrumentRecordMapper.java
221a3ba9bbd5628dbfe09af265b545d5a58d708a
[]
no_license
ShiroYui/limsRepository
0de511c36ecc8b979b34f779e1109db51a156064
d88e44c3ad66eb6685499cc04a472f5f7f311a50
refs/heads/master
2020-05-20T12:29:38.681249
2019-05-08T08:13:34
2019-05-08T08:13:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,247
java
package com.fh.service.system.instrument; import com.fh.entity.Page; import com.fh.entity.system.instrument.InstrumentRecord; import com.fh.util.PageData; import java.util.List; /** * @Author: Wangjian * @Description:仪器管理使用记录 * @Date: $time$ $date$ **/ public interface InstrumentRecordMapper { /** *@Desc 查询全部数据 *@Author Wangjian *@Date 2018/10/31 14:22 *@Params * @param null */ List<PageData> findAll(Page page) throws Exception ; /** *@Desc 新增仪器使用记录 *@Author Wangjian *@Date 2018/11/2 17:09 *@Params * @param null */ public void saveRecordMessage(PageData pd) throws Exception; /** *@Desc 根据id删除使用记录 *@Author Wangjian *@Date 2018/11/2 17:41 *@Params * @param null */ public void deleteRecordById(PageData pd) throws Exception; /** *@Desc 更新数据 *@Author Wangjian *@Date 2018/11/2 17:48 *@Params * @param null */ public void updateMessage(PageData pd) throws Exception; /** *@Desc 查询单条数据 *@Author Wangjian *@Date 2018/11/2 17:53 *@Params * @param null */ public PageData findById(PageData pd) throws Exception; }
4c898d887f70e5442db13a89afb8f1929bb9db4d
d10dd5272b8291dafa5c3ca907534c4846947db5
/src/domain/AccountBean.java
ee32e54ff68c52760e5b079cc6f02258e63dd998
[]
no_license
asa1374/java_HOME_BITSHOP
6c9846a025cec9aeaae1893611a340a97a1f6071
097736f9534d6e4eda92d5124e91d8a04a83515b
refs/heads/master
2020-04-13T22:23:12.221412
2019-01-01T01:42:21
2019-01-01T01:42:21
163,477,574
2
0
null
null
null
null
UTF-8
Java
false
false
597
java
package domain; public class AccountBean { private String accountNum, today; private int money; public String getAccountNum() { return accountNum; } public void setAccountNum(String accountNum) { this.accountNum = accountNum; } public String getToday() { return today; } public void setToday(String today) { this.today = today; } public int getMoney() { return money; } public void setMoney(int money) { this.money = money; } @Override public String toString() { return "AccountBean [accountNum=" + accountNum + ", today=" + today + ", money=" + money + "]"; } }
6453bf760d6f645d5b270b9ef9bbbc16c9ff55de
b31120cefe3991a960833a21ed54d4e10770bc53
/modules/org.llvm.analysis/src/org/llvm/analysis/bfi_detail/TypeMapBasicBlock.java
949123b3c2a7a70e2434a5c1369d5e4da9ca71de
[]
no_license
JianpingZeng/clank
94581710bd89caffcdba6ecb502e4fdb0098caaa
bcdf3389cd57185995f9ee9c101a4dfd97145442
refs/heads/master
2020-11-30T05:36:06.401287
2017-10-26T14:15:27
2017-10-26T14:15:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,645
java
/** * This file was converted to Java from the original LLVM source file. The original * source file follows the LLVM Release License, outlined below. * * ============================================================================== * LLVM Release License * ============================================================================== * University of Illinois/NCSA * Open Source License * * Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign. * All rights reserved. * * Developed by: * * LLVM Team * * University of Illinois at Urbana-Champaign * * http://llvm.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal with * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimers. * * * Redistributions in binary form must reproduce the above copyright notice * this list of conditions and the following disclaimers in the * documentation and/or other materials provided with the distribution. * * * Neither the names of the LLVM Team, University of Illinois at * Urbana-Champaign, nor the names of its contributors may be used to * endorse or promote products derived from this Software without specific * prior written permission. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE * SOFTWARE. * * ============================================================================== * Copyrights and Licenses for Third Party Software Distributed with LLVM: * ============================================================================== * The LLVM software contains code written by third parties. Such software will * have its own individual LICENSE.TXT file in the directory in which it appears. * This file will describe the copyrights, license, and restrictions which apply * to that code. * * The disclaimer of warranty in the University of Illinois Open Source License * applies to all code in the LLVM Distribution, and nothing in any of the * other licenses gives permission to use the names of the LLVM Team or the * University of Illinois to endorse or promote products derived from this * Software. * * The following pieces of software have additional or alternate copyrights, * licenses, and/or restrictions: * * Program Directory * ------- --------- * Autoconf llvm/autoconf * llvm/projects/ModuleMaker/autoconf * Google Test llvm/utils/unittest/googletest * OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} * pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} * ARM contributions llvm/lib/Target/ARM/LICENSE.TXT * md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h */ package org.llvm.analysis.bfi_detail; import org.clank.java.*; import org.clank.support.*; import org.clank.support.aliases.*; import org.clank.support.JavaDifferentiators.*; import static org.clank.java.built_in.*; import static org.clank.support.Casts.*; import static org.clank.java.io.*; import static org.clank.java.std.*; import static org.clank.java.std_pair.*; import static org.llvm.adt.ADTAliases.*; import static org.llvm.support.llvm.*; import static org.clank.support.NativePointer.*; import static org.clank.support.NativeType.*; import static org.clank.support.Native.*; import static org.clank.support.Unsigned.*; import org.clank.support.NativeCallback.*; import org.llvm.support.*; import org.llvm.adt.*; import org.llvm.adt.aliases.*; import org.llvm.ir.*; import org.llvm.pass.*; import static org.llvm.ir.PassManagerGlobals.*; //<editor-fold defaultstate="collapsed" desc="llvm::bfi_detail::TypeMap<BasicBlock>"> @Converted(kind = Converted.Kind.AUTO_NO_BODY, source = "${LLVM_SRC}/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h", line = 505, FQN="llvm::bfi_detail::TypeMap<BasicBlock>", NM="_ZN4llvm10bfi_detail7TypeMapINS_10BasicBlockEEE", cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.analysis/llvmToClangType ${LLVM_SRC}/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp -nm=_ZN4llvm10bfi_detail7TypeMapINS_10BasicBlockEEE") //</editor-fold> public class/*struct*/ TypeMapBasicBlock { // JAVA: typedef BasicBlock BlockT // public final class BlockT extends BasicBlock{ }; // JAVA: typedef Function FunctionT // public final class FunctionT extends Function{ }; // JAVA: typedef BranchProbabilityInfo BranchProbabilityInfoT // public final class BranchProbabilityInfoT extends BranchProbabilityInfo{ }; // JAVA: typedef Loop LoopT // public final class LoopT extends Loop{ }; // JAVA: typedef LoopInfo LoopInfoT // public final class LoopInfoT extends LoopInfo{ }; @Override public String toString() { return ""; // NOI18N } }
373c4428616a4cf1a133db25dd17c0b70956abe1
d5b1744af35e1ac1214f1b20132fc0b7b7f9c5f7
/core/src/main/java/ma/glasnost/orika/impl/generator/CompilerStrategy.java
0cd85dc5bc1711584a912efeed0ea904fdfd1da9
[]
no_license
deepika087/orika
c8ecab88cd810cea9527bcfa9faebb517731f267
40d3f593ef0d0f1f3680f40304b9f2603ac6a199
refs/heads/master
2020-04-06T06:27:53.231554
2016-01-12T08:48:02
2016-01-12T08:48:02
49,481,320
0
0
null
2016-01-12T06:57:15
2016-01-12T06:57:14
null
UTF-8
Java
false
false
4,375
java
/* * Orika - simpler, better and faster Java bean mapping * * Copyright (C) 2011 Orika authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ma.glasnost.orika.impl.generator; import java.io.File; import java.io.IOException; import ma.glasnost.orika.OrikaSystemProperties; /** * Defines a standard compiler profile for use in generating mapping objects. * * @author [email protected] * */ public abstract class CompilerStrategy { /** * Compile and return the (generated) class; this will also cause the * generated class to be detached from the class-pool, and any (optional) * source and/or class files to be written. * * @return the (generated) compiled class * @throws SourceCodeGenerationException */ public abstract Class<?> compileClass(SourceCodeContext sourceCode) throws SourceCodeGenerationException; /** * Verify that the Class provided is accessible to the compiler/generator. * * @param type * @throws SourceCodeGenerationException * if the type is not accessible */ public abstract void assureTypeIsAccessible(Class<?> type) throws SourceCodeGenerationException; protected final boolean writeSourceFiles; protected final boolean writeClassFiles; protected final String pathToWriteSourceFiles; protected final String pathToWriteClassFiles; protected static final String WRITE_RELATIVE_TO_CLASSPATH = "classpath:"; protected CompilerStrategy(String writeSourceByDefault, String writeClassByDefault) { this.writeSourceFiles = Boolean.valueOf(System.getProperty( OrikaSystemProperties.WRITE_SOURCE_FILES, System.getProperty("ma.glasnost.orika.GeneratedSourceCode.writeSourceFiles", writeSourceByDefault))); this.writeClassFiles = Boolean.valueOf(System.getProperty( OrikaSystemProperties.WRITE_CLASS_FILES, System.getProperty("ma.glasnost.orika.GeneratedSourceCode.writeClassFiles", writeClassByDefault))); this.pathToWriteSourceFiles = (String)System.getProperty(OrikaSystemProperties.WRITE_SOURCE_FILES_TO_PATH, WRITE_RELATIVE_TO_CLASSPATH + "/"); this.pathToWriteClassFiles = (String)System.getProperty(OrikaSystemProperties.WRITE_CLASS_FILES_TO_PATH, WRITE_RELATIVE_TO_CLASSPATH + "/"); } /** * Prepares the output path for a given package based on the provided base path string. * If the base path string begins with "classpath:", then the path is resolved relative * to this class' classpath root; otherwise, it is treated as an absolute file name. * * @param basePath * @param packageName * @return * @throws IOException */ protected File preparePackageOutputPath(String basePath, String packageName) throws IOException { String packagePath = packageName.replaceAll("\\.", "/") ; String path = null; if (basePath.startsWith(WRITE_RELATIVE_TO_CLASSPATH)) { path = getClass().getResource(basePath.substring(WRITE_RELATIVE_TO_CLASSPATH.length())) .getFile().toString(); } else { path = basePath; if (!path.endsWith("/")) { path+= "/"; } } File parentDir = new File(path + packagePath); if (!parentDir.exists() && !parentDir.mkdirs()) { throw new IOException("Could not create package directory for " + packageName ); } return parentDir; } public static class SourceCodeGenerationException extends Exception { private static final long serialVersionUID = 1L; public SourceCodeGenerationException(String message, Throwable cause) { super(message, cause); } public SourceCodeGenerationException(Throwable cause) { super(cause); } public SourceCodeGenerationException(String message) { super(message); } } }
446fa99db3676a64261407a8738898e5ab802af1
fc9cddc474478845b15343c30aa892e54a80da83
/app/src/test/java/com/android/ct7liang/animator/ExampleUnitTest.java
568649942b6106d340e33606f2333741c1b573d1
[]
no_license
Ct7Liang/AndroidAnimation
c8af0b32bbceb38993d0f6af31caf63f32b2d74c
e536fbe55d0860ada0e06bbaaf774299237ec7f0
refs/heads/master
2020-07-16T08:11:42.675272
2019-09-21T08:41:42
2019-09-21T08:41:42
205,752,823
0
0
null
null
null
null
UTF-8
Java
false
false
390
java
package com.android.ct7liang.animator; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
116e539377939dffb02cab07bfb08f0c0c0cf76c
8a607bd91419882cf8605552a43a6acaa2444bb0
/boluo-projects/boluo-task/src/main/java/com/boluo/notification/push/PushTaskReplySave.java
1ebb26e93b44c417c87b87fcfd9fb40df550a761
[]
no_license
yikeshangshou/boluo
f9b943dd3ecf2d21cd6dcfa422a35418c6611ce3
e3da0fdf666a575e7acedd4f58010c47822821a3
refs/heads/master
2021-01-19T21:55:00.082948
2017-02-28T13:32:36
2017-02-28T13:32:36
82,542,280
0
0
null
null
null
null
UTF-8
Java
false
false
2,488
java
package com.boluo.notification.push; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import com.boluo.dao.EntityDao; import com.boluo.dao.mapper.DiscussionRowMapper; import com.boluo.dao.mapper.EntityRowMapper; import com.boluo.model.Discussion; import com.boluo.model.Entity; import com.boluo.task.TaskScheduler; /** * @author zzw * @since Jun 30, 2016 */ @Service public class PushTaskReplySave extends AbstractPushTask { public PushTaskReplySave(EntityDao entityDao) { this.entityDao = entityDao; } public PushTaskReplySave() { TaskScheduler.register(getClass().getCanonicalName(), this, 23, 30); } @Override protected String getPushType(){ return "replySave"; } @Override public int getBusinessType() { return 4; } protected List<String> getRegistrationIds(Entity entity){ List<String> ids = new ArrayList<String>(); Map<String, Object> condition = new HashMap<String, Object>(); condition.put("discussionId", entity.getLong("objectId")); condition.put("status", 1); List<Entity> entities = entityDao.find("discussion_follow", condition, EntityRowMapper.getInstance()); if (entities != null) { for (Entity discussion : entities) { String fromUser = entity.getString("fromUserId"); if (StringUtils.isEmpty(fromUser) || !discussion.getString("userId").equals(fromUser)) { Map<String, Object> conditionTemp = new HashMap<String, Object>(); conditionTemp.put("userId", discussion.getString("userId")); conditionTemp.put("status", 1); Entity userDevice = entityDao.findOne("user_device", conditionTemp); if (userDevice != null) { ids.add(userDevice.getString("registrationId")); } } } } return ids; } @Override public String getPushContent(Entity entity) throws Exception { Discussion discussion = entityDao.findOne("discussion", "id", entity.getLong("objectId"), DiscussionRowMapper.getInstance()); StringBuilder sb = new StringBuilder(); sb.append("你关注的讨论: \""); sb.append(discussion.getTitle()); sb.append("\" 有了新观点 :\""); sb.append(entity.getString("content")); sb.append("\""); return sb.toString(); } @Override public String getTaskTableName() { return "notification_user_text"; } }
70d78b3c02267111004528a07449a4eb65a438e9
f0f0772646366739ec7c74d59a9c4f8e0139d0b2
/src/pseudocode/LogoutServlet.java
3841bb2aa7d05cafec0b64f8b4860bbc28a9c07a
[]
no_license
mittal-amit/Student-Mate
d774530af7af84ce9653d3899713b923a9e73370
f9faa3d1144c0d537801a7b4094af603da6ce64f
refs/heads/main
2023-07-17T06:51:22.480409
2021-09-06T20:06:02
2021-09-06T20:06:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,469
java
package pseudocode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * * */ public class LogoutServlet extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { /* TODO output your page here. You may use following sample code. */ out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet LogoutServlet</title>"); out.println("</head>"); out.println("<body>"); HttpSession s = request.getSession(); s.removeAttribute("username"); // Message m = new Message("Logout Successfully", "success", "alert-success"); s.setAttribute("msg", "Logout Successfully"); response.sendRedirect("login.jsp"); out.println("</body>"); out.println("</html>"); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
dd4d5e23d5974a68bf2dcf55cac95255b65d2ff1
19e8dabcc89fa0138faf520bae8b34ff4f160d38
/DragNDrop_v2_20160917/src/blogic/DnDData.java
236eb2bff5796a1a14ebb9bf473f3e136bf840c6
[]
no_license
nickhammerk20/hammer
ccb9c293ef2d9fffe34f1cdbadb6cf55170ca006
39676e702ef0ed6510cbcd7a50ef084ba612bb1a
refs/heads/master
2020-05-21T17:39:33.193237
2017-02-11T11:50:22
2017-02-11T11:50:22
61,361,207
0
0
null
null
null
null
UTF-8
Java
false
false
194
java
package blogic; import java.awt.Color; public class DnDData { Color color = Color.black; byte width = 1; byte type = 1; // 1 - square; 2 - round square; 3 - sircle ; 4 - line }
93c9d2be931d2144dcaf9635610a5093065a58b9
e57083ea584d69bc9fb1b32f5ec86bdd4fca61c0
/sample-project-5400/src/main/java/com/example/project/sample5400/domain/sample2/Entity2_12.java
59626e43c67a17811c5b8f7367ed28a8c4b1c0b6
[]
no_license
snicoll-scratches/test-spring-components-index
77e0ad58c8646c7eb1d1563bf31f51aa42a0636e
aa48681414a11bb704bdbc8acabe45fa5ef2fd2d
refs/heads/main
2021-06-13T08:46:58.532850
2019-12-09T15:11:10
2019-12-09T15:11:10
65,806,297
5
3
null
null
null
null
UTF-8
Java
false
false
466
java
package com.example.project.sample5400.domain.sample2; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Entity2_12 { @Id @GeneratedValue private long id; private String description; public long getId() { return this.id; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } }
dd1222196774866a46287e1f81b89d87a4524c75
f5192dcb2d64424c1bebcbb567b3476273f5f5e1
/app/src/main/java/com/example/zixtal/ejemploactivity/MainActivity.java
b8ffa6889a68dfd32a405091cd19a8ec2f9ba94c
[]
no_license
Zixtal/EjemploActivity
fe9adb68c515640a52524a654014e1e9442b3630
42590bf830e0beff1ec4dbaa6298ac199fc7a69f
refs/heads/master
2021-01-23T02:54:35.829060
2015-09-09T01:37:04
2015-09-09T01:37:04
42,149,040
0
0
null
null
null
null
UTF-8
Java
false
false
1,580
java
package com.example.zixtal.ejemploactivity; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { private Button enviar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button enviar=(Button)findViewById(R.id.enviar); enviar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i =new Intent(getApplicationContext(),SegundoActivity.class); startActivity(i); } }); } @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_main, menu); 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(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
c4da35188fa403619b4df97422627b9c4abeaded
2fdd61dfa94752ca80a58ed86947427867aa578f
/src/main/java/com/userfront/dao/SavingsAccountDao.java
beedf3bb2e51a73105897a6693ff566a7a0713d2
[]
no_license
winra001/UserFront
e3221862e4fcf87345be93c5bee96ecb6dd08e3a
29a2e6961775ddfae9e8195a7e378d0efa75b04a
refs/heads/master
2021-01-13T03:39:17.947805
2016-12-29T09:24:22
2016-12-29T09:24:22
77,256,569
0
0
null
null
null
null
UTF-8
Java
false
false
275
java
package com.userfront.dao; import org.springframework.data.repository.CrudRepository; import com.userfront.domain.SavingsAccount; public interface SavingsAccountDao extends CrudRepository<SavingsAccount, Long> { SavingsAccount findByAccountNumber(int accountNumber); }
6e96324a964b2be06114bc9e48ebb272c89c0219
78bd0e05b8b35aca2099e449c744c5ad507f0216
/Deque.java
630e60fab8a86f0b5865657c310f8f05a717bdfc
[]
no_license
braca51e/Algorithms
d55f3d20e3b80a2581c816b2a2c2eb0b6688d1d0
2fb2cb667e10ce90b5348abb432f5b4f882642b9
refs/heads/master
2020-06-27T05:09:37.639475
2017-07-20T20:22:50
2017-07-20T20:22:50
97,049,834
0
0
null
null
null
null
UTF-8
Java
false
false
3,341
java
import java.lang.IllegalArgumentException; import java.util.Iterator; import java.util.NoSuchElementException; public class Deque<Item> implements Iterable<Item>{ private Node first; private Node last; private int count; private class Node{ Item item; Node next; Node prev; } private boolean validItem(Item item){ if(item == null){ throw new IllegalArgumentException("Ilegal argument!"); } return true; } public Deque(){ this.first = null; this.last = null; this.count = 0; } public boolean isEmpty(){ boolean ret_val = false; if(this.size() == 0){ ret_val = true; } return ret_val; } public int size(){ return this.count; } public void addFirst(Item item){ if(validItem(item)){ //Case only one or zeros nodes in queue if(this.size() == 0){ this.first = new Node(); this.first.item = item; this.last = this.first ; } else{ Node temp = this.first; this.first = new Node(); this.first.item = item; this.first.next = temp; temp.prev = this.first; while(temp.next != null){ temp = temp.next; } this.last = temp; } this.count += 1; } } public void addLast(Item item){ if(validItem(item)){ if(this.size() == 0){ this.last = new Node(); this.last.item = item; this.first = this.last; } else{ Node temp = this.last; this.last = new Node(); this.last.item = item; temp.next = this.last; this.last.prev = temp; } this.count += 1; } } public Item removeFirst(){ if(isEmpty()){ throw new NoSuchElementException(); } Item ret; ret = this.first.item; if(this.first.next != null){ this.first = this.first.next; } this.first.prev = null; this.count -= 1; //if(this.size() == 0){ // this.first = null; // this.last = null; //} return ret; } public Item removeLast(){ if(isEmpty()){ throw new NoSuchElementException(); } Item ret; ret = this.last.item; if(this.last.prev != null){ this.last = this.last.prev; } this.last.next = null; this.count -= 1; return ret; } public Iterator<Item> iterator() { // TODO Auto-generated method stub return new ListIterator(); } private class ListIterator implements Iterator<Item>{ private Node current = first; public boolean hasNext() { // TODO Auto-generated method stub return this.current != null; } public Item next() { // TODO Auto-generated method stub Item item = current.item; current = current.next; return item; } } public static void main(String[] args) { // TODO Auto-generated method stub Deque<Integer> test = new Deque<Integer>(); test.addLast(1); test.addLast(2); test.addLast(3); test.addLast(4); for(Integer i : test) System.out.println(i); System.out.println("Size: " + test.size()); System.out.println("Remove: " + test.removeLast()); System.out.println("Size: " + test.size()); System.out.println("Remove: " + test.removeFirst()); System.out.println("Size: " + test.size()); System.out.println("Remove: " + test.removeLast()); System.out.println("Size: " + test.size()); System.out.println("Remove: " + test.removeFirst()); System.out.println("Size: " + test.size()); } }
15ad4f9f974a9c52fc7bf678af45d4ff0fec99b9
451fff6f5824d758d330d6ef975afbad98373815
/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterByFilterAggregator.java
eaa35d5fe9c1b8792a44dd3ad5638342dfde5031
[ "Elastic-2.0", "Apache-2.0", "SSPL-1.0", "LicenseRef-scancode-other-permissive" ]
permissive
msdalp/elasticsearch
f875eefc7b4a0a57cee741490390cf462426c258
e3dc86fd33296dbdf7eb4edc53e60c42ee6e3f9e
refs/heads/master
2022-09-01T10:11:12.850458
2022-08-17T06:29:20
2022-08-17T06:29:20
37,817,318
0
0
Apache-2.0
2022-08-17T06:29:25
2015-06-21T17:01:40
Java
UTF-8
Java
false
false
14,147
java
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ package org.elasticsearch.search.aggregations.bucket.filter; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.LeafCollector; import org.apache.lucene.search.Query; import org.apache.lucene.search.Scorable; import org.apache.lucene.util.Bits; import org.elasticsearch.common.CheckedSupplier; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.search.aggregations.AdaptingAggregator; import org.elasticsearch.search.aggregations.AggregationExecutionContext; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.CardinalityUpperBound; import org.elasticsearch.search.aggregations.LeafBucketCollector; import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.runtime.AbstractScriptFieldQuery; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.BiConsumer; /** * Collects results by running each filter against the searcher and doesn't * build any {@link LeafBucketCollector}s which is generally faster than * {@link Compatible} but doesn't support when there is a parent aggregator * or any child aggregators. */ public class FilterByFilterAggregator extends FiltersAggregator { /** * Builds {@link FilterByFilterAggregator} when the filters are valid and * it would be faster than a "native" aggregation implementation. The * interface is designed to allow easy construction of * {@link AdaptingAggregator}. */ public abstract static class AdapterBuilder<T> { private final String name; private final List<QueryToFilterAdapter> filters = new ArrayList<>(); private final boolean keyed; private final AggregationContext aggCtx; private final Aggregator parent; private final CardinalityUpperBound cardinality; private final Map<String, Object> metadata; private final Query rewrittenTopLevelQuery; private boolean valid = true; public AdapterBuilder( String name, boolean keyed, String otherBucketKey, AggregationContext aggCtx, Aggregator parent, CardinalityUpperBound cardinality, Map<String, Object> metadata ) throws IOException { this.name = name; this.keyed = keyed; this.aggCtx = aggCtx; this.parent = parent; this.cardinality = cardinality; this.metadata = metadata; this.rewrittenTopLevelQuery = aggCtx.searcher().rewrite(aggCtx.query()); this.valid = parent == null && otherBucketKey == null; } /** * Subclasses should override this to adapt the * {@link FilterByFilterAggregator} into another sort of aggregator * if required. */ protected abstract T adapt(CheckedFunction<AggregatorFactories, FilterByFilterAggregator, IOException> delegate) throws IOException; public final void add(String key, Query query) throws IOException { if (valid == false) { return; } if (query instanceof AbstractScriptFieldQuery) { /* * We know that runtime fields aren't fast to query at all * but we expect all other sorts of queries are at least as * fast as the native aggregator. */ valid = false; return; } add(QueryToFilterAdapter.build(aggCtx.searcher(), key, query)); } final void add(QueryToFilterAdapter filter) throws IOException { if (valid == false) { return; } QueryToFilterAdapter mergedFilter = filter.union(rewrittenTopLevelQuery); if (mergedFilter.isInefficientUnion()) { /* * For now any complex union kicks us out of filter by filter * mode. Its possible that this de-optimizes many "filters" * aggregations but likely correct when "range", "date_histogram", * or "terms" are converted to this agg. We investigated a sort * of "combined" iteration mechanism and its complex *and* slower * than the native implementations of the aggs above. */ valid = false; return; } if (filters.size() == 1) { /* * When we add the second filter we check if there are any _doc_count * fields and bail out of filter-by filter mode if there are. _doc_count * fields are expensive to decode and the overhead of iterating per * filter causes us to decode doc counts over and over again. */ if (aggCtx.hasDocCountField()) { valid = false; return; } } filters.add(mergedFilter); } /** * Build the the adapter or {@code null} if the this isn't a valid rewrite. */ public final T build() throws IOException { if (false == valid) { return null; } class AdapterBuild implements CheckedFunction<AggregatorFactories, FilterByFilterAggregator, IOException> { private FilterByFilterAggregator agg; @Override public FilterByFilterAggregator apply(AggregatorFactories subAggregators) throws IOException { agg = new FilterByFilterAggregator(name, subAggregators, filters, keyed, aggCtx, parent, cardinality, metadata); return agg; } } AdapterBuild adapterBuild = new AdapterBuild(); T result = adapt(adapterBuild); if (adapterBuild.agg.scoreMode().needsScores()) { /* * Filter by filter won't produce the correct results if the * sub-aggregators need scores because we're not careful with how * we merge filters. Right now we have to build the whole * aggregation in order to know if it'll need scores or not. * This means we'll build the *sub-aggs* too. Oh well. */ return null; } return result; } } /** * Count of segments with "live" docs. This is both deleted docs and * docs covered by field level security. */ private int segmentsWithDeletedDocs; /** * Count of segments with documents have consult the {@code doc_count} * field. */ private int segmentsWithDocCountField; /** * Count of segments this aggregator performed a document by document * collection for. We have to collect when there are sub-aggregations * and it disables some optimizations we can make while just counting. */ private int segmentsCollected; /** * Count of segments this aggregator counted. We can count when there * aren't any sub-aggregators and we have some counting optimizations * that don't apply to document by document collections. * <p> * But the "fallback" for counting when we don't have a fancy optimization * is to perform document by document collection and increment a counter * on each document. This fallback does not increment the * {@link #segmentsCollected} counter and <strong>does</strong> increment * the {@link #segmentsCounted} counter because those counters are to * signal which operation we were allowed to perform. The filters * themselves will have debugging counters measuring if they could * perform the count from metadata or had to fall back. */ private int segmentsCounted; /** * Build the aggregation. Private to force callers to go through the * {@link AdapterBuilder} which centralizes the logic to decide if this * aggregator would be faster than the native implementation. */ private FilterByFilterAggregator( String name, AggregatorFactories factories, List<QueryToFilterAdapter> filters, boolean keyed, AggregationContext aggCtx, Aggregator parent, CardinalityUpperBound cardinality, Map<String, Object> metadata ) throws IOException { super(name, factories, filters, keyed, null, aggCtx, parent, cardinality, metadata); } /** * Instead of returning a {@link LeafBucketCollector} we do the * collection ourselves by running the filters directly. This is safe * because we only use this aggregator if there isn't a {@code parent} * which would change how we collect buckets and because we take the * top level query into account when building the filters. */ @Override protected LeafBucketCollector getLeafCollector(AggregationExecutionContext aggCtx, LeafBucketCollector sub) throws IOException { assert scoreMode().needsScores() == false; if (filters().size() == 0) { return LeafBucketCollector.NO_OP_COLLECTOR; } Bits live = aggCtx.getLeafReaderContext().reader().getLiveDocs(); if (false == docCountProvider.alwaysOne()) { segmentsWithDocCountField++; } if (subAggregators.length == 0) { // TOOD we'd be better off if we could do sub.isNoop() or something. /* * Without sub.isNoop we always end up in the `collectXXX` modes even if * the sub-aggregators opt out of traditional collection. */ segmentsCounted++; collectCount(aggCtx.getLeafReaderContext(), live); } else { segmentsCollected++; collectSubs(aggCtx, live, sub); } return LeafBucketCollector.NO_OP_COLLECTOR; } /** * Gather a count of the number of documents that match each filter * without sending any documents to a sub-aggregator. This yields * the correct response when there aren't any sub-aggregators or they * all opt out of needing any sort of collection. */ private void collectCount(LeafReaderContext ctx, Bits live) throws IOException { Counter counter = new Counter(docCountProvider); for (int filterOrd = 0; filterOrd < filters().size(); filterOrd++) { incrementBucketDocCount(filterOrd, filters().get(filterOrd).count(ctx, counter, live)); } } /** * Collect all documents that match all filters and send them to * the sub-aggregators. This method is only required when there are * sub-aggregators that haven't opted out of being collected. * <p> * This collects each filter one at a time, resetting the * sub-aggregators between each filter as though they were hitting * a fresh segment. * <p> * It's <strong>very</strong> tempting to try and collect the * filters into blocks of matches and then reply the whole block * into ascending order without the resetting. That'd probably * work better if the disk was very, very slow and we didn't have * any kind of disk caching. But with disk caching its about twice * as fast to collect each filter one by one like this. And it uses * less memory because there isn't a need to buffer a block of matches. * And its a hell of a lot less code. */ private void collectSubs(AggregationExecutionContext aggCtx, Bits live, LeafBucketCollector sub) throws IOException { class MatchCollector implements LeafCollector { LeafBucketCollector subCollector = sub; int filterOrd; @Override public void collect(int docId) throws IOException { collectBucket(subCollector, docId, filterOrd); } @Override public void setScorer(Scorable scorer) throws IOException {} } MatchCollector collector = new MatchCollector(); filters().get(0).collect(aggCtx.getLeafReaderContext(), collector, live); for (int filterOrd = 1; filterOrd < filters().size(); filterOrd++) { collector.subCollector = collectableSubAggregators.getLeafCollector(aggCtx); collector.filterOrd = filterOrd; filters().get(filterOrd).collect(aggCtx.getLeafReaderContext(), collector, live); } } @Override public void collectDebugInfo(BiConsumer<String, Object> add) { super.collectDebugInfo(add); add.accept("segments_counted", segmentsCounted); add.accept("segments_collected", segmentsCollected); add.accept("segments_with_deleted_docs", segmentsWithDeletedDocs); add.accept("segments_with_doc_count_field", segmentsWithDocCountField); } CheckedSupplier<Boolean, IOException> canUseMetadata(LeafReaderContext ctx) { return new CheckedSupplier<Boolean, IOException>() { Boolean canUse; @Override public Boolean get() throws IOException { if (canUse == null) { canUse = canUse(); } return canUse; } private boolean canUse() throws IOException { if (ctx.reader().getLiveDocs() != null) { return false; } docCountProvider.setLeafReaderContext(ctx); return docCountProvider.alwaysOne(); } }; } }
1ebfb8e7c939bf29d8519984189c3a6ab7392e37
03faa67f8468b522d6c0ebc3966f61c5769d5496
/src/main/java/com/eaw1805/www/shared/orders/Order.java
c37d3b7b107612714623c117748291413ac3a708
[ "MIT" ]
permissive
EaW1805/www
c6d5cf11211bdae56658249b9a9271ab74ef176e
1c85636e7e19c524a383881c40f4e08a4954974b
refs/heads/master
2020-12-25T16:57:42.325264
2016-08-28T10:30:31
2016-08-28T10:30:31
29,938,380
1
0
null
null
null
null
UTF-8
Java
false
false
107
java
package com.eaw1805.www.shared.orders; public interface Order { public int execute(int unitId); }
2c9010906e064b8179abf1e1f39b29a74d12365c
4f4ddc396fa1dfc874780895ca9b8ee4f7714222
/src/java/com/gensym/com/beans/office20/MsoExtraInfoMethod.java
5568d12cc1fbb59412c1c0ab321c7df92e2991bf
[]
no_license
UtsavChokshiCNU/GenSym-Test2
3214145186d032a6b5a7486003cef40787786ba0
a48c806df56297019cfcb22862dd64609fdd8711
refs/heads/master
2021-01-23T23:14:03.559378
2017-09-09T14:20:09
2017-09-09T14:20:09
102,960,203
3
5
null
null
null
null
UTF-8
Java
false
false
1,246
java
package com.gensym.com.beans.office20; import com.gensym.com.ActiveXModes; import com.gensym.com.ActiveXProxy; import com.gensym.com.ActiveXException; import com.gensym.com.ActiveXCastException; import com.gensym.com.Guid; import com.gensym.com.ActiveXDefaultComponentImpl; import com.gensym.com.ActiveXDispatchable; import com.gensym.com.ActiveXDispatchableImpl; import com.gensym.com.NativeMethodBroker; import com.gensym.com.Variant; import com.gensym.com.Hwnd; import java.awt.Color; import java.util.Date; import java.util.Vector; public interface MsoExtraInfoMethod { public static final Guid classID = new Guid(0x0, 0x0, 0x0, (short) 0x0, (short) 0x0, (short) 0x0, (short) 0x0, (short) 0x0, (short) 0x0, (short) 0x0, (short) 0x0); // Library name is: Office // DocString is: Microsoft Office 8.0 Object Library // Help file is: C:\Program Files\Microsoft Office\Office\vbaoff8.hlp // There are 121 TypeInfos in the library /* Type info #57 An enumeration type. Type info name is: MsoExtraInfoMethod Help file is: C:\Program Files\Microsoft Office\Office\vbaoff8.hlp */ public static final int MSO_METHOD_GET = 0; public static final int MSO_METHOD_POST = 1; }