anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
IsComment return true if content is comment
func (c *Content) IsComment() bool { return c.Type == CONTENT_TYPE_COMMENT }
WithHTTPMethod returns an HTTPCheckerOption that specifies the method for HTTP requests. The default method is "GET" which works in most of the cases, but another popular choice is "HEAD".
func WithHTTPMethod(method string) HTTPCheckerOption { return func(c *HTTPChecker) { c.method = method } }
GetVPCS returns the list of AWS VPC's.
func GetVPCS(accessKeyID, secretAccessKey, region string) ([]*ec2.Vpc, error) { client, err := GetClientSet(accessKeyID, secretAccessKey, region) if err != nil { return nil, err } vpcOut, err := client.EC2.DescribeVpcs(&ec2.DescribeVpcsInput{}) if err != nil { if awsErr, ok := err.(awserr.Error); ok && awsEr...
NewWatchPolicyV1beta1PodSecurityPolicyUnauthorized creates WatchPolicyV1beta1PodSecurityPolicyUnauthorized with default headers values
func NewWatchPolicyV1beta1PodSecurityPolicyUnauthorized() *WatchPolicyV1beta1PodSecurityPolicyUnauthorized { return &WatchPolicyV1beta1PodSecurityPolicyUnauthorized{} }
Set a PUT request handler for the route.
func (r *Route) Put(h http.Handler) *Route { r.Add("PUT", h) return r }
addGrant merges a new clawback vesting grant into an existing ClawbackVestingAccount.
func (va *ClawbackVestingAccount) addGrant(ctx sdk.Context, sk StakingKeeper, grantStartTime int64, grantLockupPeriods, grantVestingPeriods []Period, grantCoins sdk.Coins) { // how much is really delegated? bondedAmt := sk.GetDelegatorBonded(ctx, va.GetAddress()) unbondingAmt := sk.GetDelegatorUnbonding(ctx, va.GetA...
archiveContext makes a tar.gz stream consists of files.
func archiveContext(ctx context.Context, root string, writer io.Writer) (err error) { // Create a buffered writer. bufWriter := bufio.NewWriter(writer) defer bufWriter.Flush() // Create a zipped writer on the bufferd writer. zipWriter, err := gzip.NewWriterLevel(bufWriter, gzip.BestCompression) if err != nil { ...
Contains checks whether rh.Hierarchy contains orh.Hierarchy
func (rh ResourceHierarchy) Contains(orh ResourceHierarchy) bool { rhh := buildResourceHierarchy(rh) orhh := buildResourceHierarchy(orh) if rhh.size > orhh.size { return false } for i := range orhh.hierarchy { if i >= len(rhh.hierarchy) { return false } if rhh.hierarchy[i] == "*" { return true } ...
NewSalt generates a random salt for use in account passwords
func NewSalt() ([]byte, error) { key := make([]byte, 60) _, err := rand.Read(key) if err != nil { return nil, err } return key, nil }
hasDataCite returns 'true' if a repository includes a file called 'datacite.yml' in its root. No checks are made to determine if the file is valid. If any error occurs, for example due to an uninitialised repository or missing repository root, it returns 'false' without error.
func hasDataCite(c *Context) bool { commit, err := c.Repo.GitRepo.BranchCommit(c.Repo.Repository.DefaultBranch) if err != nil { log.Trace("Couldn't get commit: %v", err) return false } _, err = commit.Blob("/datacite.yml") log.Trace("Found datacite? %t", err == nil) return err == nil }
Code implements the Frame interface.
func (f *CreateBundleReply) Code() FrameCode { return FrameCreateBundle }
Function to sort strings using slices?
func Sort_String(str string) string { newStr := strings.Split(str, "") sort.Strings(newStr) return strings.Join(newStr,"") }
DeleteTransitKey : Delete a transit key from Vault
func (v *Vault) DeleteTransitKey(key string) { p := make(map[string]interface{}) p["deletion_allowed"] = "true" _, err := v.Client.Logical().Write("transit/keys/"+key+"/config", p) if err != nil { log.Fatalf("Vault error: %v", err) } _, err = v.Client.Logical().Delete("transit/keys/" + key) if err != nil { ...
Handle success response from salesforce.
func (op *OpQuery) Handle(resp *http.Response) error { if resp.StatusCode != http.StatusOK { return fmt.Errorf("get operator can't handle response with code %d, expect %d", resp.StatusCode, http.StatusOK) } return json.NewDecoder(resp.Body).Decode(&op.result) }
Inc increases the counter by one.
func (g *Gorc) Inc() { g.Lock() g.count++ g.Unlock() }
GetAndLock Get and lock the server.
func (impl *Server) GetAndLock(ID string) (bool, base.ModelInterface) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) // Transaction start. tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "error": err}). Warn("DB get and lock ...
SetupServer : This function initializes a datasending server that lies outside of the Blink Node System. It responds to a HelloOracle message (sent by the server) by setting up a SessionID as well as an initial series of hops for the session. The oracle then sends the SessionID and the first blink node's address to the...
func SetupServer(serverAddr *net.UDPAddr, conn *net.UDPConn, buf []byte) { destAddr := ExtractFinalDestAddr(buf) fmt.Println("Dest Addr:", destAddr.String()) SID := "1001100110011001" decisionTable := make(map[string][]string) decisionTable[SID] = []string{nodesTable[0], nodesTable[2], destAddr.String()} Decisio...
NewRemoveUserGroupParamsWithHTTPClient creates a new RemoveUserGroupParams object with the ability to set a custom HTTPClient for a request.
func NewRemoveUserGroupParamsWithHTTPClient(client *http.Client) *RemoveUserGroupParams { return &RemoveUserGroupParams{ HTTPClient: client, } }
SelectFromPostByID return one row by Id
func SelectFromPostByID(id int) *Post { db := MysqlConnect() defer db.Close() var post Post err := db.QueryRow("SELECT * FROM post where id = ?", id).Scan(&post.ID, &post.Title, &post.Description, &post.Post, &post.Date, &post.Author, &post.Thumbnail, &post.Categories) if err != nil { panic(err.Error()) ...
SetSensitivityPolicySettings sets the sensitivityPolicySettings property value. The sensitivityPolicySettings property
func (m *InformationProtection) SetSensitivityPolicySettings(value SensitivityPolicySettingsable)() { err := m.GetBackingStore().Set("sensitivityPolicySettings", value) if err != nil { panic(err) } }
CreateUser indicates an expected call of CreateUser.
func (mr *ClientMockRecorder) CreateUser(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*Client)(nil).CreateUser), arg0, arg1) }
NewIntentsDeviceManagementIntentItemRequestBuilderInternal instantiates a new DeviceManagementIntentItemRequestBuilder and sets the default values.
func NewIntentsDeviceManagementIntentItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IntentsDeviceManagementIntentItemRequestBuilder) { m := &IntentsDeviceManagementIntentItemRequestBuilder{ BaseRe...
NewFeedURL sets itunes:newfeedurl of given feed.
func NewFeedURL(newURL string) func(f *Feed) error { return func(f *Feed) error { u, err := url.Parse(newURL) if err != nil { return err } if !u.IsAbs() { return ErrInvalidURL } f.Channel.NewFeedURL = newURL return nil } }
calculateDigit calculates the next digit for the given document.
func calculateDigit(doc string, position int) string { var sum int for _, r := range doc { sum += toInt(r) * position position-- if position < 2 { position = 9 } } sum %= 11 if sum < 2 { return "0" } return strconv.Itoa(11 - sum) }
NewPutTravelExpensePassengerIDParamsWithTimeout creates a new PutTravelExpensePassengerIDParams object with the default values initialized, and the ability to set a timeout on a request
func NewPutTravelExpensePassengerIDParamsWithTimeout(timeout time.Duration) *PutTravelExpensePassengerIDParams { var () return &PutTravelExpensePassengerIDParams{ timeout: timeout, } }
EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.
func (m *DiseaseMutation) EdgeCleared(name string) bool { switch name { case disease.EdgeEmployee: return m.clearedemployee case disease.EdgeSeverity: return m.clearedseverity case disease.EdgeDiseasetype: return m.cleareddiseasetype case disease.EdgeDiagnosis: return m.cleareddiagnosis } return false }
GetVestingCoins returns the total number of vesting coins. If no coins are vesting, nil is returned.
func (pva PeriodicVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins { return pva.OriginalVesting.Sub(pva.GetVestedCoins(blockTime)) }
A label query over a set of resources, in this case pods.
func (o PgbenchSpecPodConfigPodSchedulingAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermOutput) LabelSelector() PgbenchSpecPodConfigPodSchedulingAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorPtrOutput { return o.ApplyT(func(v Pgb...
AddAggregate is a mock implementation
func (f *FakeWatchPrefixes) AddAggregate(paths []string, peer string) watchstream.WatchEventQ { f.AddAgg++ if f.AddAggFn != nil { return f.AddAggFn(paths, peer) } return nil }
Cinder represents a cinder volume attached and mounted on kubelets host machine More info:
func (o IopingSpecVolumeVolumeSourcePtrOutput) Cinder() IopingSpecVolumeVolumeSourceCinderPtrOutput { return o.ApplyT(func(v *IopingSpecVolumeVolumeSource) *IopingSpecVolumeVolumeSourceCinder { if v == nil { return nil } return v.Cinder }).(IopingSpecVolumeVolumeSourceCinderPtrOutput) }
HasClonedFrom returns a boolean if a field has been set.
func (o *WorkflowWorkflowDefinitionAllOf) HasClonedFrom() bool { if o != nil && o.ClonedFrom != nil { return true } return false }
SetConstraintNil sets the value for Constraint to be an explicit nil
func (o *HyperflexServerFirmwareVersionEntryAllOf) SetConstraintNil() { o.Constraint.Set(nil) }
DutyCleared returns if the "duty" field was cleared in this mutation.
func (m *OrgUnitPositionMutation) DutyCleared() bool { _, ok := m.clearedFields[orgunitposition.FieldDuty] return ok }
Deprecated: Use DownstreamTlsWrapperContext.ProtoReflect.Descriptor instead.
func (*DownstreamTlsWrapperContext) Descriptor() ([]byte, []int) { return file_cilium_api_tls_wrapper_proto_rawDescGZIP(), []int{1} }
EncodeX509Chain will encode a list of x509.Certificates into a PEM format chain. Selfsigned certificates are not included as per Certificates are output in the order they're given; if the input is not ordered as specified in RFC5246 section 7.4.2, the resulting chain might not be valid for use in TLS.
func EncodeX509Chain(certs []*x509.Certificate) ([]byte, error) { if len(certs) == 0 { return nil, errors.New("no certificates in chain") } certPEM := bytes.NewBuffer([]byte{}) for _, cert := range certs { if cert == nil { continue } if cert.CheckSignatureFrom(cert) == nil { // Don't include self-si...
GetUsersHandler lista todos los usuarios
func GetUsersHandler(w http.ResponseWriter, r *http.Request) { var users []User for _, v := range Listusers { users = append(users, v) } w.Header().Set("Content-Type", "application/json") j, err := json.Marshal(users) if err != nil { panic(err) } w.WriteHeader(http.StatusOK) w.Write(j) }
CloseTheCloser closes the closer
func CloseTheCloser(c io.Closer) { _ = c.Close() }
Request returns a new Request instance. Arguments are similar to NewRequest. After creating request, all builders attached to Expect instance are invoked. See Builder.
func (e *Expect) Request(method, path string, pathargs ...interface{}) *Request { opChain := e.chain.enter("Request(%q)", method) defer opChain.leave() req := newRequest(opChain, e.config, method, path, pathargs...) for _, builder := range e.builders { builder(req) } for _, matcher := range e.matchers { re...
WithStreamServerChain is a grpc.Server config option that accepts multiple stream interceptors. Basically syntactic sugar.
func WithStreamServerChain(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption { return grpc.StreamInterceptor(ChainStreamServer(interceptors...)) }
Show runs the show action.
func (c *TrackerController) Show(ctx *app.ShowTrackerContext) error { return application.Transactional(c.db, func(appl application.Application) error { t, err := appl.Trackers().Load(ctx.Context, ctx.ID) if err != nil { switch err.(type) { case remoteworkitem.NotFoundError: log.Printf("not found, id=%s",...
Deprecated: Do not use.
func (m *TracingZipkinConfig) GetResources() *Resources { if m != nil { return m.Resources } return nil }
ReadMask sets the optional parameter "readMask": Required. The specific fields to return. Use "" to include all fields. Repeated field items cannot be individually specified.
func (c *LocationsLodgingGetGoogleUpdatedCall) ReadMask(readMask string) *LocationsLodgingGetGoogleUpdatedCall { c.urlParams_.Set("readMask", readMask) return c }
Version returns the version of the content.
func (o SparseEnforcerReportsList) Version() int { return 1 }
NewTimer return an instance of delay queue
func NewTimer(name string, redis *RedisInstance, interval, checkBackupInterval time.Duration) (*Timer, error) { timer := &Timer{ name: name, redis: redis, interval: interval, checkBackupInterval: checkBackupInterval, shutdown: make(chan struct{}), } // Pr...
ok fails the test if an err is not nil.
func ok(tb testing.TB, err error) { if err != nil { _, file, line, _ := runtime.Caller(1) fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error()) tb.FailNow() } }
Stop terminates the sink manager.
func (sm *SinkManager) Stop() { sm.stopOnce.Do(func() { close(sm.doneChannel) sm.metrics.Stop() sm.sinks.DeleteAll() }) }
1) Directly test is use the server side completed policies to test 2) Partial policies test is only using the policies that are related with the subject to test. This is a simulation for frontend, since the user can only get policies that relate to him/her.
func directlyAndRebuildWithPartialPoliciesTest(oldEnforcer Enforcer, sub string, fn func(e Enforcer, helperMessage string)) { // directly test fn(oldEnforcer, "directly test") // create a new enforcer with abbreviated policies policies := oldEnforcer.GetCompletePoliciesFor(sub) policyAdapter := NewStringPolicyAda...
ListView Clicked item index
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { try { int itemPosition = position; switch (itemPosition) { case 0: ...
Read in the JSON from the example resources
@Test public void testTradesAdapter() throws IOException { InputStream is = CryptopiaAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/cryptopia/dto/marketdata/example-trades.json"); // Use Jackson to parse it ObjectMapper mapper = new ObjectMapper(); CryptopiaBaseRespon...
Convertimos la lista de generos
public MovieDetails transform(Movie movie){ String genres = ""; for (int i = 0; i < movie.getMovieGenres().size(); i++) genres += movie.getMovieGenres().get(i).getName() + ", "; genres = genres.substring(0,genres.length() - 2); String originalTitle = movie.getOriginalTitle...
Proveedores mas solicitados (de todos los tiempos) (Grafica Barras => Proveedor vs NumeroCompras)
public String estadisticasFinancieras(String anio) { String html = ""; DefaultTableModel dtm1 = venta.estadisticaFinancierasMeseVsIngresoGasto(anio); DefaultTableModel dtm2 = venta.estadisticaFinancierasIngresosGastosUtilidades(anio); html = Utils.dibujarGraficasHTMLLineasYTorta...
This method populates Entity To Deletet List.
private void populateEntityToDeletetList() { entityNameListDelete = new ArrayList<String>(); entityNameListDelete.add("edu.wustl.catissuecore.domain.Quantity"); entityNameListDelete .add("edu.wustl.catissuecore.domain.SpecimenCollectionRequirementGroup"); }
Finds all airports in provided txt file, with corresponding city with comments in database. Airport that does not have active city in database is not part of resulting HashMap.
@Override public HashMap<String, Airport> findAll() { List<City> cities = cityDao.findAll(0); airportFile = new File(AirportDao.class.getClassLoader().getResource("airports.txt").getPath()); try { FlightFileReader.consumeNonEmptyLinesFromFile(airportFile, line -> { ...
Do a traversal of the list and print it out
public void printList(TernaryTreeNode head) { // System.out.println(" head :: " + head.right.right.data); TernaryTreeNode current = head; while (true) { System.out.print(current.data + " "); current = current.right; if...
attempt to parse an integer
public static boolean tryParse(String str) { try { Integer.parseInt(str); return true; } catch (NumberFormatException ex) { return false; } catch (Exception ex) { logError(ex); return false; } }
Returns a string specifying the message to display when there is no row to display.
public String getNoPagedMessage() { return getNoPagedMessage(null); }
TODO Autogenerated method stub
@Override public BaseResponse testResponse() { return setResultSuccess(); }
get comment to see
public static List<Comment> getCommentByMB(int idtargetmicroblog) throws SQLException { List<Comment> comments = new ArrayList<Comment>(); Connection c = DriverManager.getConnection(connectionString,dbUsername, dbPassword); PreparedStatement ps = null; ResultSet rs = null; try { /*List focusingIdusers = ge...
/ returns a string of its children types (nonJavadoc)
public Object visitReturnStmt(GoIRReturnStmtNode node) { return node.getChild().accept(this); }
Activity wird beendet BroadcastReceiver deregistrieren
@Override protected void onDestroy() { super.onDestroy(); if(mReceiver != null) unregisterReceiver(mReceiver); }
creates new user with null fields
public User(){ this(null, null); }
Test distributed ack transactions that consist only of data from loaded values
@Test public void testDACKLoadedMessage() throws Exception { final CacheTransactionManager txMgr = getCache().getCacheTransactionManager(); final String rgnName = getUniqueName(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(fals...
Combining two array list into one
public static ArrayList<Integer> union(ArrayList<Integer> list1, ArrayList<Integer> list2) { ArrayList<Integer> union = new ArrayList<>(); //adding elements from first array list to the new array list for (int i = 0; i < list1.size(); i++) { union.add(list1.get(i)); } //adding elements from...
Sets the defaultPricebookAccess value for this Organization.
public void setDefaultPricebookAccess(java.lang.String defaultPricebookAccess) { this.defaultPricebookAccess = defaultPricebookAccess; }
private boolean accepted = false;
public Packet1Login () { }
Use the current date as the default date in the picker
public Dialog onCreateDialog(Bundle savedInstanceState) { final Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); // Create a new instance of DatePickerDialog and return it Dat...
Gets the cloud event attribute key without the preceding prefix.
@Override protected String toCloudEventsKey(final String key) { return key.substring(AmqpConstants.CE_PREFIX.length()); }
JimpleLocal local = (JimpleLocal) v;
private int getIncrement(Value v) { if (v instanceof IntConstant) { return ((IntConstant) v).value; } else { return 0; } }
Invoked from the GUI because it's easier this way
public void executeFromGui(Player target) { removeTrail(target); }
Inaccessible tiles always have all 4 walls since you can't get to them
public InaccessibleTile(int x, int y) { super(true, true, true, true, x, y); }
TODO Autogenerated method stub
@Override public boolean getElemento(T elemento) { return false; }
The type of the id.
@JsonIgnore public void setType(URI type) { this.type = type == null ? null : new TypeReference<AlternateIdType>(type); }
End of variables declaration//GENEND:variables
private void initInfo(Map<String, String> _info) { this.jlCPU.setText(_info.get("Model"));// FIXME may be very long name this.jlCores.setText(_info.get("TotalCores")); this.jlVendor.setText(_info.get("Vendor")); this.jlFrequency.setText(_info.get("Mhz") + " MHz"); this.jlRAM.setT...
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() { jPanel1 = new javax.swing.JPanel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel2 = new javax.swing.JPanel(); jLabel1 ...
read Reads the next Object from this piped stream. If no Object is available because the end of the stream has been reached, the value null is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. If a thread was providing Objects to the connected pipe...
public synchronized Object read() throws PipeException { if (!connected) { throw new PipeException("Pipe not connected"); } else if (closedByReader) { throw new PipeException("Pipe closed"); } else if (writeSide != null && !writeSide.isAlive() && !closedByWriter && (in < 0)) ...
String s=" My name is Sayantika Ghosh "; String reverseString=reverse(s); System.out.println(reverseString);
public static void main(String[] args) { int [] a={5,10,90}; int [] b={4,7,9,10}; List <Integer> l1=new ArrayList<>(); l1=mergeSorted(a,b); System.out.println(l1); Map <Integer,Integer> se=new HashMap<>(); se.put(4,6); se.putIfAbsent(4,7); se.put(...
Test that an asynchronous request will eventually return the right offset
@Test public void testBlocking() throws Exception { FutureRecordMetadata future = new FutureRecordMetadata(asyncRequest(baseOffset, null, 50L), relOffset, RecordBatch.NO_TIMESTAMP, 0, 0, Time.SYSTEM); assertEquals(baseOffset + relOffset, future.get().offset()); }
Remove the filter from service
public void destroy() { }
To Get All the recipes with the username same as the one that is logged in
@GetMapping public List<Recipe> get(HttpSession httpSession){ List<Recipe> recipes = new ArrayList<>(); String username = (String) httpSession.getAttribute("username"); //recipeRepository.findByAcess("PUBLIC").iterator().forEachRemaining(x -> recipes.add(x)); if(username != null){ ...
get node based from value
public Node<E> getPresentNode(E data){ for(Node<E> node: nodes.keySet()){ if(node.data.equals(data)){ return node; } } return null; }
Gets the name of this Settlement.
public String getName() { return name; }
retorna todos os funcionario atraves de uma lista
List<Seller> findByDepartment(Department department);
Creates new form VistaCrearPedidoAbonado
public VistaCrearPedidoAbonado() { initComponents(); errorLabel.setVisible(false); controlador = new CtrlVistaCrearPedidoAbonado(this); }
Format current time to GMT string presentation.
public static String gmtFormat(String $formatString) { return gmtFormat($formatString, 0); }
Registers the administratives that come from the file that is imported.
public void registerAdministrative(String[] fields) throws BadEntryException{ int id = Integer.parseInt(fields[1]); if(_persons.get(id) != null){ throw new BadEntryException(fields[0]); } Administrative _administrative = new Administrative(id, fields[2], fields[3]); _administratives.put(id, ...
Methode qui permet changer l'argrandissement du monde
public void setleZoom( double valeur) { zoomMonde = valeur; }
The LocalDate represents a date in ISO format (yyyyMMdd) without time.
public static void main(String[] args) { LocalDate localDate = LocalDate.now(); System.out.println("LocalDate: " + localDate); System.out.println(LocalDate.of(2019, 04, 16)); System.out.println(LocalDate.parse("2019-04-16")); //////////////////////////////////////////////////////// LocalDate tomorrow =...
/ By default, OpenGL enables features that improve quality but reduce performance. One might want to tweak that especially on software renderer.
public void onSurfaceCreated(GL10 gl, EGLConfig config) { gl.glDisable(GL10.GL_DITHER); /* * Some one-time OpenGL initialization can be made here * probably based on features of this particular context */ gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, ...
Checks whether the given IP address meets a set of IP range requirements.
private boolean isAuthenticated(@Nonnull final InetAddress address, @Nonnull @NonnullElements final Collection<IPRange> ranges) { final byte[] resolvedAddress = address.getAddress(); for (final IPRange range : ranges) { if (range.contains(resolvedAddress)) { retu...
Style of the scrollbar, specified using one of the constants from Titanium.UI.iPhone.ScrollIndicatorStyle. Default: Titanium.UI.iPhone.ScrollIndicatorStyle.DEFAULT
public native void setScrollIndocatorStyle(double value) /*-{ var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()(); jso.scrollIndicatorStyle = value; }-*/;
Metodo que devuelve los permisos segun el tipo de usuario
public PermisosPyS obtenerPermisos(String user) { try { PreparedStatement pstm = null; ResultSet rs = null; String query = "SELECT * FROM permisos WHERE ID_permiso IN (SELECT ID_permisos FROM Roles as r INNER JOIN Usuario as u ON r.ID_Rol = u.ID_Rol WHERE u.username...
The interface for the vcms discussion remote service. This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
@JSONWebService @Transactional(isolation = Isolation.PORTAL, rollbackFor = { PortalException.class, SystemException.class}) public interface VcmsDiscussionService { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this interface directly. Always use {@link VcmsDiscussionServiceUtil} to access the vcms d...
todo trabajar aqui para mostrar los elementos en el adapter tasksTotales=new ArrayList();
public void fetchTasks() { tasksTotales.clear(); for (String taskId : taskList) { databaseTaskReference.child(taskId).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { ...
Constructor for primary key
public BaseStoreGrnM (java.lang.Integer id) { this.setId(id); initialize(); }
comment.setUserId((Long) request.getSession().getAttribute("userId")); //TODO looks ugly, need learn best practice
@RequestMapping(value = "/flood/addComment", method = RequestMethod.POST) public String addCommentPost(@ModelAttribute("newComment") Comment comment, HttpServletRequest request, Model model) { comment.setUserId(1L); model.addAttribute...
doubles array length and rehash items whenever the load factor is reached
private void rehash() { int oldSize = this.size; int newSize = size * 2; while (!isPrime(newSize)) newSize++; this.size = newSize; DataItem[] newHashArray = new DataItem[newSize]; String temp; this.collision = 0; Boolean repeatValue; for (int i = 0; i < oldSize; i++) { if (hashArray[i] != null &...
Constructor for creating an instance that will parse a set of String arguments with respect to a set of command line options. Option switches are required to be a single character. By default switches are assumed to be boolean unless followed by a colon. example : &nbsp;&nbsp;&nbsp "cvf:" In this example "c" and "v" ar...
public GetOpt(String [] sargs, String flags) throws BadOptException { int size = sargs.length; try { StringReader sreader = new StringReader(flags); for (int i = 0; i < flags.length(); i++) { int opt = sreader.read(); if (opt == ':') ((OptPair) optlist.elementAt(optlist.size() - 1)).bool = fals...
Returns the value of the 'Wiki' attribute. If the meaning of the 'Wiki' attribute isn't clear, there really should be more of a description here...
String getWiki();
compares two Person objects by their pay grades.
@Override public int compare(Person o1, Person o2) { return o1.payGrade - o2.payGrade; }
Interswitch.ENV_SANDBOX, is for sandbox environment Interswitch.ENV_PROD, is for production environment
public static void main(String[] args) { FundsTransfer transfer = new FundsTransfer(clientId, clientSecret, Interswitch.ENV_DEV); try { BankResponse response = transfer.fetchBanks(); // makes network call Bank[] bank = response.getBanks(); // a bank array of all banks ...