This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Counts IPv4 addresses in MaxMind's GeoLite2 database ### | |
### It does the summation of how many IPs are in each CIDR range ### | |
### https://dev.maxmind.com/geoip/geolite2-free-geolocation-data ### | |
echo "Warning: the execution of this script can take many hours!" | |
param=0 # $param contains the summation | |
skip='true' # we use $skip to skip the first row, containing the CSV header row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form hi = new Form("Test swipe on tabs", BorderLayout.absolute()); | |
Tabs tabs = new Tabs(); | |
ButtonGroup btnGroup = new ButtonGroup(); | |
Button swipeXBtn = RadioButton.createToggle("Swipe on X-Axis", btnGroup); | |
Button swipeYBtn = RadioButton.createToggle("Swipe on Y-Axis", btnGroup); | |
btnGroup.setSelected(0); | |
swipeXBtn.addActionListener(l -> { | |
tabs.setSwipeOnXAxis(true); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR=~/Projects | |
cd $DIR | |
# Contare classi: | |
a=`find . -name \*.java -print | wc -l` | |
echo "" | |
echo "Number of Java classes: $a" | |
# Conteggio complessivo: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.http.HttpEntity; | |
import org.apache.http.client.methods.CloseableHttpResponse; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.impl.client.CloseableHttpClient; | |
import org.apache.http.impl.client.HttpClients; | |
import org.apache.http.util.EntityUtils; | |
[...] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form hi = new Form("Test UIID", BoxLayout.y()); | |
Button button = new Button("Generate 10 UIID"); | |
hi.add(button); | |
hi.show(); | |
button.addActionListener(l -> { | |
String myId = "myUsername"; // do not exceed 12 characters | |
Preferences.set("CustomDeviceId__$", Long.parseLong(myId, 36)); | |
hi.add(new SpanLabel("10 Random UUID")); | |
for (int i = 0; i < 10; i++) { | |
hi.add(new SpanLabel(Util.getUIID())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.codename1.components.SpanLabel; | |
import com.codename1.components.ToastBar; | |
import static com.codename1.ui.CN.*; | |
import com.codename1.ui.Display; | |
import com.codename1.ui.Form; | |
import com.codename1.ui.Dialog; | |
import com.codename1.ui.Label; | |
import com.codename1.ui.plaf.UIManager; | |
import com.codename1.ui.util.Resources; | |
import com.codename1.io.Log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# REMEMBER TO REPLACE THE FOLLOWING VALUES | |
YOUR_TESTING_SERVER="mydomain.net" | |
SERVERCODE_DIR="MyServer" | |
SERVERCODE_DIR_PATH="/home/francesco/NetBeansProjects/" | |
JAR="MyServer-1.0.0-SNAPSHOT.jar" | |
SERVERCODE_FULLPATH=$SERVERCODE_DIR_PATH$SERVERCODE_DIR | |
echo "Server code full path: $SERVERCODE_FULLPATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form hi = new Form("Hi World", BoxLayout.y()); | |
Button cameraBtn = new Button("Open Camera"); | |
Button galleryBtn = new Button("Open Gallery"); | |
Label imageLbl = new Label(); | |
hi.addAll(cameraBtn, galleryBtn, FlowLayout.encloseCenter(imageLbl)); | |
hi.show(); | |
SuccessCallback<String> callback = (String capturedPhoto) -> { | |
String rotatedPhoto = FileSystemStorage.getInstance().getAppHomePath() + "rotatedPhoto.jpg"; | |
if (capturedPhoto != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.informaticalibera.test.imagescaling; | |
import com.codename1.capture.Capture; | |
import com.codename1.components.SpanLabel; | |
import com.codename1.io.FileSystemStorage; | |
import static com.codename1.ui.CN.*; | |
import com.codename1.ui.Form; | |
import com.codename1.ui.Dialog; | |
import com.codename1.ui.Label; | |
import com.codename1.ui.plaf.UIManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final EasyThread countTime = EasyThread.start("countTime"); | |
public void start() { | |
if (current != null) { | |
current.show(); | |
return; | |
} | |
Form hi = new Form("Recording audio", BoxLayout.y()); | |
hi.add(new SpanLabel("Example of recording and playback audio using the Media, MediaManager and MediaRecorderBuilder APIs")); | |
hi.add(recordAudio((String filePath) -> { |
NewerOlder