Monday, August 5, 2019

Error with Conversion to Dalvik format failed and multidex in android?

Whenever I try to import lib-c2callsdkres Library then Give the error like this,
[2015-01-05 18:29:30 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536
[2015-01-05 18:29:30 - TestApp] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536 and sometimes give me error for multidex.



How to solve this error.please suggest me.




Thank you.

php - file_get_contents shows unexpected output while reading a file



I want to output an inline jpg image as a base64 encoded string, however when I do this :



$contents = file_get_contents($filename);
print "";



Where $filename is a local text file with the base64 image. The output is as follows :






And obiously the image is not rendered, but where does  come from ? It is not in the text file. If removed, the image is displayed properly.


Answer



It's a Unicode Byte-Order Mark. The file was saved with an editor that added the BOM to indicate the file is encoded as UTF-8. So those bytes actually are in the file, but a text editor just won't show it since it's not text. For storing this kind of data you'll want to remove the BOM. Easiest way would be to configure your editor not to add the BOM, but if you don't have influence over the creation process of the file you could to it on-the-fly in your script too:




print "";

node.js - Pass additional parameter to Javascript callback function





I need to watch a small number of directories in a Node.JS application:



function updated(event, filename){
log("CHANGED\t/share/channels/" + filename);
}
for(i in channels)
fs.watch('share/channels/' + channels[i], {persistent: false}, updated);


The problem is that fs.watch only passes the filename to the callback function, without including the directory it's in. Is there a way I can somehow pass in an extra parameter to the updated() function so it knows where the file is?




I think I'm looking for something similar to Python's functools.partial, if that helps any.


Answer



You can use Function.bind:



function updated(extraInformation, event, filename) {
log("CHANGED\t/share/channels/" + extraInformation + filename);
}

for(i in channels)

fs.watch('share/channels/' + channels[i], {persistent: false},
updated.bind(null, 'wherever/it/is/'));

multiple monitors - Can my PC cope with this screen?


I hope this isn't an abuse of everyone's helpfulness but can anyone work out if my 5-year-old Sony Vaio can cope with this new monitor I want to buy (to use as a second monitor). My laptop is a VGN-FJ3S. It has a VGA output.


Here are screen shots of what I think are the graphics card outputs (one for the built in monitor, one for the output):


alt text


alt text


Many thanks for any help you can offer.


Answer



According to this datasheet (which can be found by googling for "915GM") your graphics controller can work with a maximum resolution of 2048x1536 which is enough for controlling a 1920x1080 monitor like the one you would like to buy.


mbr - Broken boot manager bootmgr Windows 10 SSD bootrec

takes a deep breath
My System:
Windows 10 Home Version 1703
OS build 15063.966
Trying to update to version 1803 (KB4340917)




The updates continually failed. I literally had the windows 10 upgrade assistant annoying me every time I used my PC. It would automatically try to update and fail during the restart every time. Eventually I went to fix it... the following was the nightmare to the resolution.



Put the computer into safe mode and tried removing recent windows updates.
Restart and PC won’t boot.
Use WIndows Recovery Environment (WRE) from a genuine DVD.
Try the startup repair, fails. I forget the error. Also just to add, trying a refresh or reset throws a device is locked message from the WRE.
Try command prompt.
Run:
bootrec /fixmbr - works
bootrec /fixboot - works

bootrec /rebuildbcd - fails
Error is “The requested system device cannot be found”
When searching this error forums/others say this is because of USB WRE. Not my issue.
Try using Diskpart to set active partition, try to move boot files.. always fails. Try to from System file checker (sfc) running "sfc /scannow" Error :There is a system repair pending which requires a reboot to complete.
A reboot does not resolve this.
Tried dism.exe /image:C:\ /cleanup-image /revertpendingactions
I forget the error but something along the lines of disk not available.
However when trying to write new directories to the disk in command prompt, I am able to do so. As well as confirm through Diskpart that the drive isn’t read only.
I’ve left out a ton of other troubleshooting and commands as I’m writing this after the incident and can’t remember all the commands and errors I recieved, I wish I could to help others more.




Eventually the solution was to remove the drive from my PC, connect it to a friends PC and execute the following commands.



Reformatted the NTFS system reserved 100mb boot partition. This might have been the whole issue as it appeared to be full but only using 26 MB... ?!? But shown as full in disk management.
Ran bcdboot.exe {driveletter}:\windows /s {e}: where driveletter is you main partition with windows files/programs/all your data and where e: is the system reserved boot partition. Also the { } are not included in the actual command.



My questions is this:



Why wasn’t I able to execute the commands within WRE using the genuine Win 10 MS DVD connected to my mobo/PC? Some type of bios issue?

Sunday, August 4, 2019

windows 7 - Share laptop's Wi-Fi with a LAN connection and a mobile device

OS: Windows 7 64bit


I want to share my laptop's internet connection between my PC and my Android device.
But I can only do one of them at a time.



  1. The laptop is connected to internet wirelessly.

  2. The PC is connected to the laptop using a Ethernet cable and internet is shared between them.

  3. I want to connect my mobile device to my laptop by making the laptop into a Wi-Fi hotspot.


PC (Ethernet) ==> Laptop (connected to net by Wi-Fi) <== Mobile device (Wi-Fi hotspot)


I have 3 connections in my laptop:



  • Wireless Network Connection (internet - shared)

  • Local area connection (PC)

  • Wireless Network Connection 2 (Wi-Fi hotspot)


Every time I have to disable either the LAN to get the Wi-Fi hotspot working, or disable the Wi-Fi hotspot to get LAN working.


How can I share so I can use both at the same time?

macos - I can't get XAMPP to start automatically in OS X


I can't get XAMPP to start when OS X boots. I've been researching this for some time but with no luck. XAMPP needs to be started as root, and I don't want to store the password for root in a script somewhere and use the "login items" of the accounts pref pane to start xampp. Yes, that will work, but it's not the right way.


I'm trying to launch it using launchd / users damons / LaunchDaemons. That includes creating a plist file in the "/Library/LaunchDaemons" directory.


I created a file called xampp.startapache.plist and put this inside:







EnableTransactions

Label
xampp.startapache
ProgramArguments

/Applications/XAMPP/xamppfiles/xampp
startapache

RunAtLoad

WorkingDirectory
/Applications/XAMPP/xamppfiles



That was outlined here as well as on several other similar help pages. I've tried editing the files manually, and I've also tried using Lingon. But it just dosen't work! I've even tried doing a similar entry for a script file located in the same directory, which would echo the time to a log file. The log file is just blank - like the script is not being run.


How can I make this work?


Answer



Here's what ended up working for me:


Create these two files:



/Library/LaunchDaemons/xampp.sql.startapache.plist
/Library/LaunchDaemons/xampp.startapache.plist

Inside the first one, add this code:







EnableTransactions

Label
xampp.startapache.mysql
ProgramArguments

/Applications/XAMPP/xamppfiles/xampp
startmysql

RunAtLoad

WorkingDirectory
/Applications/XAMPP/xamppfiles
KeepAlive

AbandonProcessGroup




In the second one add this code:







EnableTransactions

Label
xampp.startapache
ProgramArguments

/Applications/XAMPP/xamppfiles/xampp
startapache

RunAtLoad

WorkingDirectory
/Applications/XAMPP/xamppfiles
KeepAlive

AbandonProcessGroup




I had to have two because when I didn't have the sql one specifically mysql wasn't starting but apache was. This may be because I have SSL enabled or something weird like that. Anyhow, having both of them solved the problem for me, and I did use the Console.app to check for error messages when starting apache - that was helpful, too.


hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...