Posts by Tony • 2,478 points
79 posts
-
1
votes1
answer83
viewsA: Syntax Highlighting no textview Android
1: There is an open-source project called Shader Editor: https://github.com/markusfisch/ShaderEditor/blob/master/src/de/markusfisch/android/shadereditor/ShaderEditor.java 2: You can use HTML +…
-
1
votes2
answers257
viewsA: Pick up messages sent and received from Mysql
Consider using the clause UNION of SQL. In Mysql the UNION keyword is used to match the result of multiple SELECT commands in a single result. Example: example: (SELECT * FROM clientes WHERE…
-
25
votes2
answers2760
viewsA: What is a memoization?
memoization is a term used by Donald Michie in 1968 and is derived from the Latin word memorandum (to be remembered). Practically speaking: It is the result cache of a function, based on the input…
-
0
votes4
answers267
viewsA: Windows Phone, error saving text (Isolatedstorage)
Try this code, watch Fileaccess.Read, Fileshare.Read: using (var isoStream = new IsolatedStorageFileStream("Notes.xml", FileMode.Open, FileAccess.Read, FileShare.Read, isolatedStorage) { //... }…
-
1
votes1
answer60
viewsA: Check if the screen is unlocked android service
Try the Keyguardmanager: KeyguardManager myKM = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); if( myKM.inKeyguardRestrictedInputMode()) { //it is locked } else { //it is not…
-
5
votes2
answers1879
viewsA: What are the differences between background and foreground threads?
Background threads are identical to foreground threads with one exception: a background thread does not keep the managed execution environment running. That is: the difference is that one¹ does not…
-
3
votes3
answers99
viewsA: Placing a vector in decreasing order
Changes your for and takes out the variable aux of the loop. Leave the code like this: public int[] vetor_dec (int n) { int[]vetor = new int[n]; for(int i=n-1;i>=0;i--) { vetor[i]=i+1; } return…
-
0
votes2
answers272
viewsA: Create Database with Fluentnhibernate
The solution would be to use the Schemaexport(). Execute() Test the code similar to this one below: public FluentConfiguration GetConfig() { return Fluently.Configure() .Database(…
-
1
votes1
answer381
viewsA: Enable/disable an Actionbutton on a given page
Check the URL value, tabs.activeTab.url, and if whatever you want, you can disable the button by setting the disabled property to true; var tabs = require("sdk/tabs"); function onOpen(tab) {…
-
1
votes5
answers7954
viewsA: Removing the " n" from a string read using fgets()
To remove ' n' from the end of the string, try this: size_t ln = strlen(input) - 1; if (name[ln] == '\n') name[ln] = '\0'; Source: https://stackoverflow.com/a/2693827/194717 or this: char *pos; if…
-
2
votes3
answers6609
viewsA: Print without confirmation window in PHP, Javascript or Ajax
Looks like you missed the start of the print job. Example: <?php //$handle = printer_open("HP Deskjet 930c"); // http://php.net/manual/en/function.printer-open.php $handle = printer_open();…
-
1
votes3
answers6609
viewsA: Print without confirmation window in PHP, Javascript or Ajax
Try the jzebra (Qz-print), to send direct commands to the printer. https://code.google.com/p/jzebra/ Example of use: <input type=button onClick="print()" value="Print"> <applet id="qz"…
-
0
votes1
answer94
viewsA: Social Networks in my app
As a suggestion, HTML, Javascript, Phonegap might solve: Use the Phonegap (http://build.phonegap.com) and the Facebook Connect Plugin (https://build.phonegap.com/plugins/257) Example in:…
-
0
votes1
answer149
viewsA: showimagepreview does not work on safari
Try using this library, which solves the lack of support for Filereader in the Safari: https://github.com/Jahdrien/FileReader…
-
2
votes3
answers1080
viewsA: Audio API to calculate the duration of multiple songs
The loademetadata It’s an event, so you almost got it: it will be called and you need to increment a variable to store the Total Time and update the user interface each time the event occurs.…
-
1
votes1
answer596
viewsA: How to Create a Web Forms User Control Component
Use the Toolboxitemattribute: http://msdn.microsoft.com/en-us/library/system.componentmodel.toolboxitemattribute.aspx Source: https://stackoverflow.com/a/3829373/194717…
-
1
votes2
answers1264
viewsA: Measure time the user is logged in to the system
Maybe a code like this in Login: //if(session["LogadoDesde"]==null) session["LogadoDesde"] = DateTime.Now();
-
1
votes1
answer704
views -
1
votes1
answer421
viewsA: How to make video 360º
Try the Valiant 360º. It is available on Github. https://github.com/flimshaw/Valiant360
javascriptanswered Tony 2,478 -
1
votes1
answer360
viewsA: How to observe user inactivity and enable or disable the lock screen on Windows Phone 8.1
Use DisplayRequest.RequestActive Documentation and Example on: http://msdn.microsoft.com/en-us/library/windows/apps/br241816.aspx Source: https://stackoverflow.com/a/23654493/194717…
-
-2
votes1
answer579
viewsQ: How to read this text and separate the names of each person using Artificial Intelligence?
I have this text, I would like to read the names of each of the players. What would be the best way to read? Is there a tool/language or extension for C# that allows me to read this structure? Not a…
-
6
votes1
answer601
viewsA: Is there any way to compress data stored in byte[]?
Try something like the following code: (Do your tests and make sure everything is correct.) public static byte[] Compress(byte[] data) { // Fonte: http://stackoverflow.com/a/271264/194717 using (var…
-
10
votes1
answer343
viewsA: HTML5 video without context menu
Try the following code: $('body').on('contextmenu', '#nome', function(e){ return false; }); Original source: https://stackoverflow.com/a/10864321/194717…
-
0
votes4
answers6360
views -
2
votes3
answers593
viewsA: Find string in more than one SQL table
Try to use the UNION clause Check the syntax of your database, using UNION SELECT * FROM TB_1 WHERE NOME LIKE '%' + @PRODUTO + '%' UNION SELECT * FROM TB_2 WHERE NOME LIKE '%' + @PRODUTO + '%'"…
-
9
votes3
answers34761
viewsA: Error: "You have an error in your SQL syntax"
Field names do not need or can carry quotes, only VALUES: $query = " INSERT INTO orcamento (nome, quantidade, codigo) VALUES ('$nome', '$quantidade', '')"; If you need to use a reserved name, then…
-
5
votes2
answers2520
viewsA: How to create an autorun?
Create a autorun.inf in the Root folder of the CD containing content similar to this: [autorun] open=programa\programa\bin\Debug\programa.exe icon=Autorun.ico Explanation: "open=" shows Windows the…
-
1
votes2
answers4563
viewsA: Virtual machine does not share folder
To make it work, Install the Guest Additions https://www.virtualbox.org/manual/ch04.html This will enable this form of integration of the Operating System that is running inside the Virtual Machine,…
-
6
votes4
answers3235
viewsA: Is there a Website/API to host photos on the web?
You can use the Flickr API https://www.flickr.com/services/api/ Upload https://www.flickr.com/services/api/upload.api.html Photos should be posted in the following URL:…