Most voted questions
150,413 questions
Sort by count of
-
6
votes2
answers194
viewsWhat are database model migrations?
Some MVC frameworks (Rails, Laravel and others) provide database model migrations. What they are, how they work and what are the advantages / disadvantages of using them?
-
6
votes3
answers6578
viewsHow to resolve the SLF4J failure in Maven?
Problem with Maven install: When I spin in the eclipse Run As > Maven install I always get that message: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to…
-
6
votes2
answers13323
viewsEntitymanager.merge() persisting instead of updating
Update method: public void update(T u) { EntityManagerFactory f = Persistence.createEntityManagerFactory("crud"); EntityManager em = f.createEntityManager(); em.getTransaction().begin();…
-
6
votes2
answers1084
viewsHow to write a string in a stream using physical files?
When inserting in a text file the characters of a string in C, blank spaces are ignored. How should I make long sentences within a string have separate words? Follows the code: #include…
-
6
votes3
answers17265
viewsHow to sort a column-by-column data.frame in R?
Suppose a data.frame with numerical values and strings: set.seed(1) dados <- data.frame(w=rep(c("A", "B"), 2), x= rep(c("D", "C"), 2), y= rnorm(4), z=rnorm(4), stringsAsFactors=FALSE) dados w x y…
-
6
votes1
answer682
viewsHow to produce JSON in the format that Highcharts expects?
I have the following code in C#: Dictionary<string, object> dataResult = new Dictionary<string, object>(); dataResult["data"] = new List<object[]>(); dataResult["name"] = i;…
-
6
votes2
answers241
viewsHow to repurpose code in two similar projects
It concludes one project and I need to do another with the same context. The problem is that I know I will find bugs and I will evolve the code when I am developing the second. How do I make a way…
-
6
votes3
answers331
viewsUnknown cause error: "Syntaxerror: invalid range in Character class"
Situation: I have a page that contains a <iframe> another, on this other page, I have a simple HTML element input: <input type="text" required="" pattern="[a-Z]{2,35}" tabindex="6"…
-
6
votes2
answers1602
viewsDisplay "longblob" field content containing PDF file
I have a question about the data longblob which are stored in the Database. I currently have so for the other data: echo "<tr><td>Email:</td>"; echo "<td>"; if…
-
6
votes1
answer1265
viewsGood practices for Asp.Net MVC 4 - 5
I need to know how to organize my project in the question of CRUD's in case there is more than one Model in my application. For example, I have the student model and the teacher model. I create a…
-
6
votes1
answer2288
viewsMysql falling due to lack of memory
I have a dedicated server Linux Ubuntu 12.04 LTS with Mysql/Apache/Wordpress, Only since he has only 1Gb of RAM, sometimes he falls for lack of memory. No syslog marks with the message Out of…
-
6
votes2
answers1556
viewsHow to add a file extension to the list of extensions supported by Adobe Brackets?
I’m using the files with html extension.echo in my WEB project and I am trying to edit in Adobe Brackets, but I cannot specify that it should treat these files as HTML sources. I would like Brackets…
-
6
votes1
answer1322
viewsHow to configure . htaccess to accept a hyphen in the URL?
I’m customizing the Urls on my site, but the .htaccess does not accept hyphens Urls, for example: postagem/1/criando-efeito-fadeout-com-javascript When I write the title without the hyphens it…
-
6
votes1
answer1992
viewsHow to schedule an event in Javascript?
Information: I would like to know how to accomplish a Agendamento of an event, that is a function that I would pass as a parameter, that would perform such a dia/mês/ano such hora:minuto that I…
-
6
votes2
answers830
viewsHow to allocate program memory and storage before running my application in Wince?
I am reprogramming a C# application to run on Windows CE, but my machine has little memory. Therefore, I need to allocate the appropriate amount of processing memory (program memory) and storage…
-
6
votes1
answer889
viewsUpload multiple files in PHP
I am developing an application in PHP where NF-e will be imported into the format XML. The problem is that the client will import multiple files at the same time, and I will have to take the data of…
-
6
votes2
answers944
viewsMock Static method with Demoiselle and Powermock/Mockito
I’m trying to mock a Static method, but Powermock requires the use of a specific Runner (Powermockrunner) for the Static mock to work! And for Demoiselle to work, you need to start Weld with…
-
6
votes1
answer213
viewsHow to implement 'check in' in tfs 2012 only approved by the reviewer?
I would like to know if it is possible and how do I stop the Check In so that only the reviewer can upload the code, or that it is not possible without your permission. To ensure that cases in which…
-
6
votes4
answers2553
viewsDatabase structure for multi-language system
I already have a system developed, using several tables in the database. I have to start migrating the same to the english and spaniard. The development part I have an idea already (not total), but…
-
6
votes2
answers2560
viewsAccessing another controller’s variable - Cakephp
How do I access variables from another controller? For example: I have a controller X, and in action index, I create a variable (or a constant). Of controller Y, I want to access the value of the…
cakephpasked 11 years ago morphinduction 473 -
6
votes1
answer857
viewsWhy doesn’t Visual Studio 2013 let you use version 4 of the Entity Framework?
I don’t know why, but whenever I try to update Object Model from an old project we have, Visual Studio 2013, asks if we want to keep version 4 of EF, but even marking the right version it updates…
-
6
votes2
answers4039
viewsWhy use Bytes instead of Image? What is the best practice?
I would like to know why to use the data type Bytes instead of using one’s own Image. If the SQL Server database has the Image data type, then it should be easier and more practical to enter in mode…
-
6
votes1
answer401
viewsIs it possible to use timestamp without having to convert to String on Oracle?
I have a query that one of your filters is a date, it is possible to filter in Oracle with something like below? SELECT * FROM tabela WHERE campoData = '2014-02-10 15:56:00.000' Or we always have to…
-
6
votes2
answers982
viewsIs it possible to perform an assignment and comparison in if clauses in Java?
It is possible to assign and at the same time perform a comparison in an if clause in Java? For example: String linha = leitor.readLine(); String saida = ""; if (linha = leitor.readLine()) { saida…
-
6
votes2
answers3255
viewsHow to perform object persistence in Delphi database?
I work with Delphi, but always in a procedural way and using Data-Aware components. I recently started reading some things about working with POO at Delphi, and did some fairly basic examples, my…
-
6
votes2
answers1085
viewsSave image after upload
I am trying to save a cut image after the user uploads the image. The upload works well and I can save the image cropped too, but something strange is happening. The image is only cropped and saved…
-
6
votes2
answers654
viewsPointer logic
In C++, you can do the following: int variavel[10][10]; int** variavel; But when I want to create an array 2d, where I can have the first part "unlimited" and the second part with limit? tipo…
-
6
votes2
answers942
viewsFunction returns pointer to trash, and free locks the terminal
Could someone explain to me the reason when I give free in the pontaux Windows terminal stops responding? And why when I allocate pontmaior my result comes as memory junk? The function returns a…
-
6
votes1
answer1417
viewsAccess permissions on Laravel 4
I’m developing a system in Laravel 4 based on official Laravel tutorials and documentation. I haven’t seen anything related to access permissions (ACL) in Laravel. Knowing that my system will have…
-
6
votes1
answer208
viewsjQuery validate - skip_or_fill_minimum rule does not fire if used more than once
I have a form that consists of four inputs and they are grouped in pairs. The rule for this form is very simple, if I fill in one of the pair’s inputs, I have to fill in the other as well or fill…
-
6
votes4
answers30736
viewsPermission error when trying to access database
I took a little project already ready to study, only that is giving this error, recently migrated to the Ubuntu and I do not know what to do. Error: SQLSTATE[28000] [1045] Access denied for user…
-
6
votes2
answers1256
viewsMake a site with multiple pages offline
Assuming I have a site with multiple pages - for example a blog - I want to put an option for those who visit it to have access to it without internet. Since not every device has constant internet…
-
6
votes1
answer730
viewsCreate a method in an involved function
The javascript allows you to create involve functions as can be seen in that SOEN response and in that reply. With the help of these answers I managed to involve a function spy, as in the code…
javascriptasked 11 years ago Felipe Avelar 9,507 -
6
votes4
answers7584
viewsHow to use AJAX with Laravel?
I have a select that when I change its value it should reorder a list, e.g.: by id, name, etc. without Laravel I would use a function onchange and pass the sorting pattern to a PHP page that would…
-
6
votes3
answers5281
viewsNavigation without a refresh!
I’m developing a website that has a div where I have a script that lists results of an SQL query. These are images, in this case. The site was developed on just one page, so by clicking on the…
-
6
votes1
answer130
viewsHow to document in code a hack, Hotfix and any potentially problematic outline situation
Hacks, emergency fixes and any potentially problematic contouring situation are a necessary evil. Although it can be considered personal opinion, when working in a team, a minimum of care is assumed…
-
6
votes7
answers2949
viewsHow to use multiple SQL commands (in the case delete on ORACLE) in one line only on C#?
I made a command because of Foreign Keys, only to plug hole, but it is not working for an invalid character error, I believe it is the ";". I know I’m doing this the wrong way, so I accept…
-
6
votes1
answer1120
viewsHow to prevent the List.size() method from running lazyload with Hibernate and JPA
When I make a query in the bank and an object is returned, in this object has a collection, which by default is Lazyload, if I do object.getColecao().size() ai is run the lazyload to bring the…
-
6
votes3
answers838
viewsCustom tool Warning: Cannot import wsdl:portType
I can’t use the ServiceReference after successfully importing. After performing the import, write the class and use your methods in the build occur the Warnings: Warning 1 Custom tool warning:…
-
6
votes2
answers299
viewsWhat is a "tick Event" in PHP?
I was looking at some functions in PHP.net, and I came across a function called declare, and in the example, there’s something like: declare(ticks=1); Below is another example: declare(ticks=1); //…
phpasked 11 years ago Calebe Oliveira 4,527 -
6
votes1
answer12372
viewsHow to compile C file using Sublime Text on Windows 8.1 64 bit?
I installed the Sublime Text in Windows 8.1 64 bit. How to compile a *.c file through Sublime on Windows? Is it necessary to install a compiler and/or another program to alert code errors and create…
-
6
votes1
answer674
viewsHow to define the culture in a WCF Webservice?
I have a plea WCF rotating in the IIS where the server language/culture is all defined in English. There is no possibility for me to change the server settings so that I could change the culture or…
-
6
votes2
answers42348
viewsHow to update/sync my repository master on github with the original master
Using the command line, how can I update/sync my master with the original master from where I did the fork. What are the different ways and their options, what is best, and how history is…
-
6
votes1
answer82
viewsHow to add customElements support for Opera 12?
I’m working with customElements, but I’ve been having problems with Opera 12. So far the best I could do is use x-tags but the same of support only to the document.register and this differs a little…
-
6
votes1
answer2385
viewsLoad content dynamically with AJAX
I have the following HTML code: <label id="meuTemplate" for="criaAssoc" class="instAssoc" style="display:none"> <strong>ID:</strong> <input name="idInstrucao" type="text">…
-
6
votes2
answers765
viewsHow to configure the Doctrine terminal together with a Codeigniter project?
I’m doing the integration of Doctrine in Codeigniter but I’m having problems configuring the line. First of all it is important to mention that I followed the guide available on the Doctrine…
-
6
votes5
answers12657
viewsHow do I protect PHP code from theft and piracy after deploying?
Well, I’m working on a system Saap (PHP/Codeigniter + Mysql). Initially the idea would be to effect the deploy of the system in the client’s choice hosting. The entire "installation" process would…
-
6
votes1
answer2008
viewsWhat is the best way to email with HTML in Django?
I’m a beginner in Python and Django and in the project I’m doing for study, I send an email, which has an HTML template. I was able to send an HTML email using EmailMessage: msg =…
-
6
votes7
answers19609
viewsHow to catch an element inside an iframe?
Why doesn’t it work .contents()? How to catch an element inside an iframe as in the jQuery API example <!doctype html> <html lang="en"> <head> <meta charset="utf-8">…
-
6
votes4
answers1904
viewsHow to control when localstorage data expires?
I’m storing some data on localstorage browser and would like to set an expiration date for that data, but I do not find a way to control when these data expire. These data have some control over…