All Questions

1
answer

Android - Different ways to "set" a listener on objects

Is there a different way ("syntax") to "set" a listener on an object in Android? For example, I only know this form: btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { activit...
asked on 04.02.2015 / 17:06
3
answers

Change the first character of a string by the last character in python

I have the following function: def troca(s): letra1 = s[0] letra2 = s[-1] s = s.replace(s[0], letra2) s = s.replace(s[-1], letra1) return s troca ('bar') As you can see, I provide as an argument to my function troca...
asked on 31.03.2015 / 22:14
2
answers

Sort by day of the week, starting with today

I want to sort the results by the days of the week I have 7 events, 1 event for each day, and you have to sort it as follows:   Sunday, Monday, Tuesday, Wednesday , Thursday, Friday, Saturday Assuming that today is Wednesday it will ha...
asked on 15.02.2015 / 02:28
1
answer

Format text in Crystal report

Well I need to print a bank slip with following. Our number should be like this. 15 / 200020-3. This same number is saved in the DB like this: 152000203. How do I put the bar in the 3rd house, and the 10th hand?     
asked on 28.02.2015 / 19:08
1
answer

Field SUM of two Subqueries in MSSQL

I'm needing a field derived from two subqueries that gives the sum of values based on a field. Here's an example: SQL: SELECT CodCliente ,DataVenda ,Vendedor ,Valor ,DataPagamento ,TotalCliente --> SOMA DE [Valor]...
asked on 09.02.2015 / 12:54
1
answer

Change field unique collection mongodb

Good morning, I have a collection in mongodb with a unique:true field. I would like to change this field to false. If I change the code and delete the entire collection it works, but if I make the change in the code and do not dele...
asked on 27.02.2015 / 12:38
1
answer

How to name the foreign key in the Entity framework

public class Lancamento { // Colunas e métodos omitidos [Column("IdContaBancaria")] public virtual ContaBancaria ContaBancaria { get; set; } } public class ContaBancaria { [Key] // PK [DatabaseGenerated(Database...
asked on 23.02.2015 / 16:46
1
answer

Vertical Sidebar Menu using Bootstrap 3.3.2

My problem is to replicate something like this. I'm having a hard time solving this: link The difference is: without words. When I hover over the entire bar, the rest of the width appears telling what each page is (on the bottom what eac...
asked on 18.02.2015 / 12:45
1
answer

Insert "Watermark" on video at upload

I'm currently uploading videos with basic php. I do not use very complex code, I'm only in the basics! And this basics is pretty much as follows: $mp4 = $_FILES['mp4']; $mpname = $mp4['mpname']; $mptmp = $mp4['tmp_name']; $mpsize = $mp4['s...
asked on 21.02.2015 / 01:50
2
answers

Handling data output from the database in PHP

In many cases we have data in the database that is not in the format that we want them to be displayed. As an example, let's say I have a table called users and in this table a field called role that will store a user's access level. Let'...
asked on 20.02.2015 / 17:40