Showing posts with label Technology. Show all posts
Showing posts with label Technology. Show all posts

Tuesday, June 29, 2021

YouTube Picture in Picture on iPhone using Bing

Ever since the release of iOS 14, people have been struggling to get YouTube to work on the iPhone as Picture in Picture. YouTube's policy is to only allow paying customers to use this feature. So you'll need to buy a YouTube Premium subscription if you want to be able to watch for example your favorite show or music in YouTube and in the meanwhile to be able to browse the internet or do whatever other thing you want on your iPhone.

The methods currently available are more or less hit and miss -- you never know if they still work, or if the method applies to the current version of iOS, whether you need to install third party applications, or create custom shortcuts. I definitely don't like installing another app, just to be able to use the Picture in Picture feature that YouTube is actively trying to block. At the same time I feel I am taken hostage and forced to pay ransom in order to use a feature that was designed to be free in the first place.

A very simple way to watch YouTube picture in picture without any other apps or tricks is to watch a video in Bing. Yes, good old Bing the search engine. In Safari on iPhone, if you search for the YouTube video on bing.com, and you play it on bing.com, then it will allow you to activate Picture in Picture.

I just found out this today, 29 June 2021, so I have no idea how long this has been on for or for how long from now on will this work. I tried this successfully on iPhone Xs Max running iOS 14.6.

These are the detailed steps on how to get a YouTube video to play in Picture in Picture mode with Bing:

1. Open Safari on iPhone

2. Go to bing.com

3. Search for the video you want to see

4. Click on the YouTube video in the Bing search results page

5. Click the play button and the video starts playing in full-screen mode (browser is still on bing.com)

6. Activate Picture in Picture mode from full-screen mode

Et voilà!

Let me know below if it works for you and which iPhone and iOS you have...



Monday, January 2, 2012

Garmin Nuvi 1350 Lost Maps

Today, my father's brand new (1 week old) Garmin Nuvi 1350 lost all its internals. This included the internal maps, voices, keyboards, vehicles, favorites, etc...

This is what I did to fix it:

1. The following will make sure you can communicate with the Nuvi device directly from the garmin.com website and also the Nuvi software is up to date:
  • Registered Nuvi device on garmin.com website
  • Installed Garmin Communicator Plugin (worked well in Firefox 8, but not in Chrome 16)
  • Installed software update on the Nuvi device

2. Install the maps:
  • Download and install Garmin Map Updater from garmin.com
  • Run the map updater and through it, download, prepare and install the maps you are entitled to on the Nuvi device

3. Install missing voices, vehicles, keyboards:
  • Download and install Garmin Web Updater from the garmin.com website
  • Run the Web Updater and select all keyboards, vehicles, voices, updates, FM traffic databases, etc that you need

Tuesday, August 16, 2011

VMware (Player) Port Forwarding

As I said in one of my previous posts, I _love_ VMWare Player (much more than its Workstation brother). There is no surprise, I want to have some neat port forwarding (from HOST machine to VMWare).

I found the following information on http://asunix.tufts.edu/howto/vmware/portforwardingWin7:

Step 0: If using VMware Workstation, continue to Step 1. However, if using VMware Player, you need to extract the `Virtual Network Editor' from the installer via the following command:

$> VMware-player-setup.exe /e .\extract

Go into `extract' -> `network' and copy `vmnetcfg' into the VMware Player directory before you use this tool. Once `vmnetcfg' is in the VMware Player folder, you can launch this tool to configure the NAT port forwarding.

Step 1: Open the Virtual Network Editor ( either from Workstation or launch `vmnetcfg' )

Step 2: Choose `VMnet8' from the interface list, change the Subnet IP at the bottom of the panel to `192.168.192.0' then and choose `NAT Settings...' from the VMnet Information panel.

Step 3: Ensure that the Gateway IP is set to `192.168.192.2' and then choose `Add' under the Port Forwarding panel.

Step 4: Fill in the port map information with the following data:

Host Port: 22

Type: TCP

Virtual machine IP address: 192.168.192.100

Virtual machine port: 22

Description: SSH

Step 5: Apply all settings and close out of the Virtual Network Editor.

Thursday, June 23, 2011

How to Increase VMWare Partition

My latest hack is the following: I ran out of space on the C: partition on my VMWare image. Needed to add a few GB extra. My issue was that I only had VMWare Player and not the Workstation.

VMWare Player cannot perform the partition increase by default, so it needs to be helped (note that VMWare Player and VMWare Workstation cannot coexist on the same machine). I needed the following files from a VMWare Workstation installation:
  • vmware-vdiskmanager.exe
  • vmcryptolib.dll
Run vmware-vdiskmanager.exe inside VMWarePlayer folder (e.g. C:\Program Files (x86)\VMware\VMware Player)

From here the steps were straight forward:
  • Convert the partition to be ‘single growable virtual disk’:
vmware-vdiskmanager.exe -r "C:\My Virtual Machines\Image\hdd1.vmdk" -t 0 "C:\My Virtual Machines\Image\hdd1Converted.vmdk"
  • Resize the virtual disk to new size (15GB max):
vmware-vdiskmanager.exe -x 15GB "C:\My Virtual Machines\Image\hdd1Converted.vmdk"
  • Launch the VMWare Image
  • Use a hard disk manager tool (e.g. “Paragon Hard Disk Manager 8.5 Server Edition”) to re-allocate all unused space in the partition to the given disk

Sunday, March 6, 2011

Romanian Radio on iPhone

Although I have an iPhone for couple years, I just realized recently that I can use my iPhone to listen to Internet radio stations. Doh!

The search for an app began. I started googling for "Interet Radio" or "tune in radio", but the results were not all that good. I wanted a FREE app, simple and customizable. There are some really cool looking apps out there, like TuneIn Radio or Spark Radio, but they are either not free, or coming with a predefined list of thousand of stations that can't be modified. I didn't like that! Who is going to listen to 35,000 stations? I just have a dozen of stations or so that I listen to and I want to be able to specify them myself.

There comes FStream (AppStore link here), which is just what I wanted. It has a very simple interface, which I like, but the major features are:
  • customizable station list: the user specifies the URL of each station, it name and position in the list;
  • web interface: the user can access, modify, reorder, etc the station list from a web browser. The iPhone needs to be connected the a WIFI network. Then user can access the FStream built-in website from any computer/browser on the network.
Combine this with the Motorola MOTOROKR T505 and you got yourself a cool solution to listen to your favorite Internet radio while on the move. Mind you, you will need the following to have this working:
  • 3G connection available, subscription to data
  • Audio device with Bluetooth A2DP file support (e.g. iPhone 3Gs+ / iOS 3+)
  • FM car radio (yes, this is mandatory ;-> )
The following is a list of Romanian Internet radio stations I usually listen to:
Netherlands:

Friday, October 22, 2010

Move iTunes library and preserve ALL data

This little blog refers to the following case:
  • iTunes library (music, etc) was copied from computer A to computer B;
  • the path of the library on computer A is not the same with path on computer B;
  • iTunes does not manage the library automatically;
  • use iTunes 10
  • don't want to lose the 'Date Added' property on each song
I got a new laptop with Windows 7 while the old one was XP. Of course, My Music folder path changed from something like C:\Documents and Settings\username\My Document\My Music to the Windows 7 format C:\Users\username\Music.

I do not let iTunes manage my music library, so I was on my own and I was about to corrupt the iTunes Library.itl file and edit/replace the iTunes Music Library.xml file. You can find a very good blog about this here.

The drawback of the above method is that, after being cumbersome and hacky -- not that I mind that, it also results in the loss of 'Date Added' property of each song.

Lucky for me, I found out that iTunes 10 will try and search for your misplaced library songs upon locating one item in the library.

Here is what I did:
  1. Start iTunes
  2. In your Music library, try to play a song
  3. iTunes will complain that it cannot find the song: "The song 'xxx' could not be used because the original file could not be found. Would you like to locate it?"
  4. Click 'Locate'
  5. A file selector dialog comes up and prompts you to select/locate the song file. Provided that you have an idea where the song is, go ahead and locate it. (If you don't know the location, you can search for it on your computer)
  6. Once found, select the song, press Open.
  7. iTunes will now prompt you with another dialog: "Would you like iTunes to use the location of 'xxx' to find other missing files in your library?"
  8. Click 'Find Files'
  9. BINGO! iTunes will now go through your library and match the other songs to their new paths. In my case it took only a few seconds to 'find' about 2000 songs. All songs properties were preserved!
Let me know if this was helpful or whether it worked for you...

Friday, September 18, 2009

Java Read/Write Files in UTF-8

Even after several years of Java experience, there still can be confusion reagarding handling of files with different encodings.

One thing that is unclear most of the times is that encoding only makes sense if you are trying to read/write character data. For this Java created the Readers and Writers. They only handle textual content and they bridge byte streams to character streams by encoding/decoding the bytes using a specified encoding (char set). For binaries (or for textual content not actually represented as text) one can use normal input/output byte streams.

Reading textual content from a file using UTF-8 encoding:
public static String getContents(File aFile) {
StringBuffer result = new StringBuffer();
BufferedReader br = null;

try {
int len = 0;
char[] buffer = new char[8192];
br = new BufferedReader(new InputStreamReader(
new FileInputStream(aFile), "UTF-8"));
while ((len = br.read(buffer)) != -1) {
result.append(buffer, 0, len);
}
} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {
if (br != null) {
br.close();
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
}

return result.toString();
}

Writing textual content from a file using UTF-8 encoding:
public static void saveContent(String content, String fileName) {
String directoryName = fileName.substring(0,
fileName.lastIndexOf(File.separatorChar));
if (directoryName.length() > 0) {
File outputFile = new File(directoryName);
outputFile.mkdirs();
}

BufferedWriter writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(fileName), "UTF-8"));
writer.write(content);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (writer != null) {
writer.close();
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}

Thursday, May 7, 2009

Transforming XML with XSLT using JSTL

Example is using JSTL 1.1 and EL:

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>

<c:import var="xml" url="/sample.xhtml"/>
<c:import var="xsl" url="/stlyesheet.xsl"/>

<x:transform xml="${xml}" xslt="${xsl}">
<x:param name="request" value="${pageContext.request}" />
<x:param name="response" value="${pageContext.response}" />
</x:transform>

Check also the other JSTL related blogs:
- The JSTL Fine Print
- JSTL request attribute

Monday, April 20, 2009

Can't download Firefox from IE

Internet Explorer 7 will not let you download Firefox with error message "You are attempting to download from a site that is not part of the Trusted Sites."

The stupid part is that after you the site to the trusted domains, the download does not continue, so you have to click again on the link. This time of course, the mozilla.com will start the download from a different mirror, which is not in your trusted sites... so the process continues.

I got really annoyed with this and the stupid IE. Problem is, how do I trigger the download?

Finally I used FTP to releases.mozilla.com, or alternatively ftp://releases.geo.mozilla.com/ with user 'anonymous' and empty password.

IE sucks bad!

Friday, April 17, 2009

JSTL request attribute

The following is an example to set/get a request attribute using JSTL 1.1 and EL:

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:set var="pageURI" value="tcm:1-2-3" scope="request"/>
PageURI1: <c:out value="${requestScope['pageURI']}"><br/>

<% request.setAttribute("a_b_c_pageURI", "tcm:4-5-6"); %>
PageURI2: ${a_b_c_pageURI}

Wednesday, April 15, 2009

The JSTL Fine Print

There are subtle differences between JSTL 1.0 and 1.1. For example at the EL level.

For JSTL 1.0:
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<html>
<head>
<title>test</title>
</head>
<body>
<h1>JSTL here</h1>
<c:set var="bla" value="${param.aaa}">
Parameter "aaa": <c:out value="${bla}">
<br/><br/>
Empty: <c:out value="${empty bla}">
<br/><br/>
<c:set var="browser" value="${header['User-Agent']}">
Browser user agent: <c:out value="${browser}">
</body>
</html>

For JSTL 1.1:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>Test</title>
</head>
<body>
<c:set var="bla" value="${param.aaa}"/>
${bla}: ${!empty bla}
<br/><br/>
<c:set var="browser" value="${header['User-Agent']}"/>
${browser}
</body>
</html>

JSP/Servlet Specifications

I never actually remember these things, so it's time to blog about it...

JSP/Servlet Version

Servlet VersionJSP VersionJSTL VersionJava EE Version
2.5 2.1 1.2 5
2.4 2.0 1.1 1.4
2.3 1.2 1.0 1.3
2.2
1.1
1.0
1.2

In order to use Servlet 2.2, the web.xml needs to require it:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD
Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
...

For Servlet 2.3, the web.xml starts with:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD
Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
...

For Servlet 2.4, the web.xml starts with:
<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
...

For Servlet 2.5, the web.xml starts with:
<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xsi="http://www.w3.org/2001/XMLSchema-instance"
schemalocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
version="2.5">
...

Wednesday, April 8, 2009

How to construct a JSP PageContext outside a JSP

I think it's the third time I was asked how to get a JSP servlet PageContext when you are not on a JSP. The solution is the following:

JspFactory jspxFactory = JspFactory.getDefaultFactory();
PageContext pageContext = jspxFactory.getPageContext(this, request, response, null, true, 8192, true);


Tip: I got this from the decompiled servlet that is always generated from a JSP. Just look in the belly of Tomcat (work folder) and you'll find the actual Java/class file.

Wednesday, December 10, 2008

JAD Command Line

These are the parameters I normally use with JAD:

jad -r -b -dead -ff -i -o -space -nonlb -s java com\**\*.class

Tuesday, December 9, 2008

Caseta 1 - Traducere automată

Programele automate de traducere mă distrează de foioioi. Înţeleg şi respect efortul făcut pentru a ajunge la acest nivel tehnologic, dar mă şi umflă râsul când văd ce formulări scoate "robo-traducătorul".

Deci, ceea ce urmează este o traducere automată a postului anterior "Box 1", realizată de Google translator.

Dixtraţi-vă:

Caseta 1

Acesta poate fi un pas mic pentru omenire, dar cu siguranţă un mare pas pentru noi: am trimis prin e-mail de la prima caseta de California.

Am fost scris într-un post mai devreme, că suntem pe cale de a muta, până la coasta occidentală a SUA în ianuarie 2009. În ziua de vin este destul de rapid, asa ca am inceput de ambalare. Să sperăm că nu va fi prea multe cutii, de când l-am lăsa noastre de mobila si toate lucrurile în apartament din Amsterdam.

Oricum, TNT Post - (în limba olandeză de servicii poştale) taxele de 54.95 de Euro pentru o economie de transport în America de până la un maxim de 20 de kg. Parcelă de până se termină pe o navă şi estimările de la TNT Post ajungă în 4-6 săptămâni. Voi blog despre durata efectiva atunci când / dacă sosesc. Nu jinxing!

Sunday, December 7, 2008

Şurub prins cu sârmă

Duminică dimineaţă mă trezesc şi observ că nu mai merge netul. De vreo 2 săptămâni se lucrează la greu şi pică netul de vreo 10 ori pe zi. Le adresez nişte urale originale (adică legate de origine) şi mă duc să resetez modemul.

Spre surprinderea mea, modemul mergea, clipocea şi în general se simţea foarte bine. Lângă el, însă era pauză... gaură neagră. Şi anume routerul era completamente în întuneric. Foarte interesant, întrucât atât routerul cât şi modemul sunt alimentate din aceeaşi priză.

Verific priza, avea curent. Pun transformatorul routerului în altă priză, nu mergea. Se bulise. Am prin casă tot felul de încărcătoare. Le verific. Îmi trebuia 5V şi 2.5A stabilizat. Cam mulţi amperi... Tot ce aveam eu prin casă erau vreo 300mA nestabilizat la 4.5V sau 6V. Îmi bag picioarele şi le încerc pe ambele. Nu merge... Ledurile de pe router clipeau la nebunie, dar nu era accesibil. Bine măcar că nu s-a ars! Aşa că nu am ce face şi mă împac cu idea -- voi sta o Duminică întreagă fără internet. Şi dacă tot nu aveam ce face, mă apuc de reparat închizătorul la geamul din baie.

Peste vreo 4 ore mă apucă fibrilaţiile. Nu am net... nu se poate să stau o zi întreagă fără net. Suntem în secolul 21. Totuşi, e Duminică. Magazine nema. Suntem într-o ţară socialistă unde programul oamenilor se respectă. Deci Duminica mumu, totul e închis.

Mă loveşte o idee... ia să conectez laptopul direct în modem. Zis şi făcut. Uraaa! Merge. Am net măcar pe laptop. Încep să gugăluiesc... "power supply failure D-Link AirPlus". Bineînţeles, oamenii avuseseră şi ei probleme, aşa că găsesc rapid nişte nevoiaşi la fel ca mine.

Văd rapid nişte trasformatoare adecvate: 5V şi 2.5A stabilizat, dar numai Luni... Duminică nema. Până când îmi pică ochii pe un post: "if you need a 5V source, you can get it directly from your computer's power supply". Atunci îmi aduc aminte că doar pe USB ies 5V. Aşa că, fără să mai stau pe gânduri, masacrez cu cablu de USB şi cablul de alimentare al routerului şi încropesc un cablu de alimentare direct din USB.

Imagine cablu USB intrind la alimentarea routeruluiVerific de 10 ori să nu fie vreun scurt pe fir, că îmi bulesc placa de bază. Verific să fie plusul pe interiorul mufei si minus la exterior. Finalmente, fie ce-o fi, îl conectez. Am fost convins că nu va merge. Iniţial speram măcar să nu îmi ard placa de bază. Bag mufa în USB. Computerul încă merge. Bag apoi mufa şi în router. Mă aşteptam la acelaşi spectacol de lumini ca mai devreme. În schimb, routerul îşi face iniţializările, porneşte LAN, porneşte WLAN şi se aprinde frumos LEDul de ready status. Incredibil, dar merge. Laptopul găseşte reţaua wireless, se conectează, primeşte IP. Uraaa! Nu îmi vine să cred. Am reuşit! Sunt conectat...

Sunt online, deci exist!

Friday, December 5, 2008

PHP: How to execute a command in the background on Windows?

So the problem is: how to fire and forget a command/batch etc in PHP asynchronously (or in the background)? That is, the calling PHP script should not wait for the command to finish. Rather the PHP script would launch the command, then terminate. Meanwhile the command is running in the background.

There are many examples and techniques on the Internet on how to execute a command in *NIX. It could be as simple as appending an ampersand (&) to the command.

However, since I am running Windows, I needed one that works for Windows... duh :) right?
After much testing, trying, looking around, the only way I found to achieve this is the following:

pclose(popen("start cmd", "r"));

Some variations of this approach are presented here...

All the variations of PHP function exec() will result in synchronous execution (i.e. the PHP script hangs until the command terminates).

PHP Snoopy: How to make it work with HTTPS?

Recently I came across the requirement to read the response of a URL using a secure connection. Since I have been using Snoopy for several years already, I just fired a snoopy->fetch() to the HTTPS URL. To my surprise, nothing happened.

After some investigation, it turned out you need to have cURL installed and configured in Snoopy. Basically just set the Snoopy $curl_path member variable to the full path of the executable. In my case, since I’m running Windows, it was something like C:\curl\curl.exe

Read the rest only if you are running Snoopy 1.2.3.
First of all, update asap – there is a vulnerability in Snoopy 1.2.3.
Second, if you still use v1.2.3 and access sites which don’t use trusted certificates, you will need to add the –k option in the command line of cURL. This basically tells cURL to ignore that the server can’t be verified.

You would have to edit the Snoopy.class.php and modify the following line to also include a –k among the parameters of curl_path:

exec($this->curl_path." -k -D \"$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$results,$return);