w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
git - dual boot ubuntu and windows with separate data partition
I'm guessing there's an issue with line endings. You probably have commited your code with windows line endings and when you checked out the code in ubuntu git converted those to unix style line endings. Take a look at this page Dealing with line endings

Categories : Windows

Start Bluetooth from ADB or at boot?
If it works for you, an app can easily change the bluetooth state. The code is very simple, I'm sure you're familiar with it: BluetoothAdapter.getDefaultAdapter().enable() This could be a "headless" application with a service only that listens for a specific intent. You could install it and then broadcast the activator intent. If you want the application to not appear in the app "drawer" (only in the Settings->Apps) then remove the launcher and main intent filters from the AndroidManifest.xml file. That is, delete these: <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> From this time on you can start the app/service with the intent you define for it in th

Categories : Android

How do I start MariaDB on boot on Mac OS X?
You need to use launchd. See $ man launchd. Additionally, Nathan wrote a good article on launchd.

Categories : Osx

How do I start gerrit automatically in OS X on boot?
So far the best solution I was able to come up with was this, which does the job: Create a wrapper script: /opt/gerrit2/bin/gerrit.sh start Put a .command extension to the wrapper script - "start_gerrit.command" and make it executable In System Preferences -> User & Groups -> Login Items, add the wrapper script. Now gerrit starts automatically whenever I log in. I really wanted to make it run at system start-up using launchd plist, but I couldn't get it to work. Also, if I just do "sudo gerrit.sh start", it always ends up taking me to root prompt for some reason, which I have to "exit" out of: Mac:~ me$ sudo /opt/gerrit2/bin/gerrit.sh start Starting Gerrit Code Review: Mac:~ root# Mac:~ root# Mac:~ root# exit logout FAILED Mac:~ me$ If someone has a better solution, please

Categories : Osx

Android how to start activity on Boot-up
Add this into Manifest. <receiver android:name=".Bootupclass" android:enabled="true" android:permission="android.permission.RECEIVE_BOOT_COMPLETED" > </receiver> Bootupclass public class Bootupclass extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { //write intent here } }

Categories : Android

WinService sometimes fails to start after boot
Please see my answer from the duplicate. A windows service typically shouldn't have access to the desktop for security reasons. But it certainly should have a good amount of logging in it. You probably have a race condition. The only thing you could do about this in WiX would be to express a dependency on another service to get the service control manager to wait awhile before starting the service. But it really would be better if your code was more robust. An example would be the OnStart event fire up a background worker process and then return success. The background thread could then keep attempting to host the WCF endpoint and everything do a fair amount of logging in the process.

Categories : C#

AlarmManager doesn't start after boot is complete
Use LogCat to examine the Java stack trace associated with your "stopped Error". In this case, the problem is probably that you have android:permission="android.permission.RECEIVE_BOOT_COMPLETED", which is incorrect. It requires that whoever sends that broadcast have that permission, which is not necessarily true.

Categories : Android

Android start app at boot after waiting for 1 minute
You can use handler int duration = 1000; // milliseconds new Handler().postDelayed(new Runnable() { @Override public void run() { Intent i = new Intent(context, MainActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); } }, duration);

Categories : Android

Have BroadcastReceiver run as Service in the background + Auto Start after boot
To start your service on BOOT_COMPLETED event and to receive SMS intent continuously. AndroidManifest.xml: <receiver android:name="BootReceiver" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> BootReceiver.java: public class BootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Intent service = new Intent(context, SMSService.class); context.startService(service); } } SMSService.java: public class SMSService extends IntentService { @Override protected void onHandleIntent(Intent intent) { String action = intent.getAction(); if (Intent.BOOT_COMPLETED.equals(action)) {

Categories : Android

Service start at boot that doesn't work correctly
Is BootService called? For BootService to be triggered when boot completes you need to add in your manifest: 1) <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 2) <receiver android:name="BootService" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver>

Categories : Java

Error in linux cross compilation u-boot
The distclean target is used to undo/clear any changes made to the local working directory by selecting any board/device-specific config. The error System not configured -see readme Error[1] indicates that the current u-boot working-directory is NOT yet configured for any device/board and hence the distclean target to make is redundant at this point.

Categories : Misc

Error on creating Rails new project (../config/boot (LoadError)
Similar question has already been answered here: no such file to load -- rubygems (LoadError) I hope it will help you.

Categories : Ruby On Rails

How to start init.d script on bootup in embedded linux. I dont have update-rc.d. Is there any other way to start init.d script on linux boot?
You can edit the /etc/inittab file. Also, there are 2 other alternatives to update-rc.d: Rcconf - Rcconf allows you to control which services are started when the system boots up or reboots. It displays a menu of all the services which could be started at boot. The ones that are configured to do so are marked and you can toggle individual services on and off.This tool configures system services in connection with system runlevels. It turns on/off services using the scripts in /etc/init.d/. File-rc - Alternative boot mechanism using a single configuration file This package provides an alternative mechanism to boot the system, to shut it down and to change runlevels. The /etc/rc?.d/* links will be converted into one single configuration file /etc/runlevel.conf inste

Categories : Linux

WPF Window Cold Start - showing black screen
You should perform any long running process in a background Thread... this will free up your UI. If you are not familiar with multi-threaded applications, take a look at the BackgroundWorker Class page at MSDN, as it features code examples. Another thing to note it that you should add IsAsync="True" property to your Binding declaration on the DataGrid.ItemsSource to let it know that it must wait for data. In this way, your DataGrid will be displayed empty and then when the data is ready, it will populate.

Categories : C#

What is boot.js (dart)
In a nutshell, the boot.js script makes it possible to load and run a polymer.dart app without needing to compile your app using build.dart. You can still run build.dart as a lint tool, but there is no required compile step anymore. Internally, boot.js looks for the imported files with <polymer-element>s, collects them, and initializes each <polymer-element> for you. Read the description at the top of file if you want to know more about the internals. You can find it under packages/polymer of any polymer app.

Categories : Dart

try or tryCatch with boot R
This is not an answer with your specific code, but a more general demonstration of tryCatch for the situation you describe. If you want to simply remove entries that cause errors, have the function return nothing on error and then remove NULL values from the results: testfun <- function(i) { tryCatch({ d <- rbinom(1,1,.3) # generate an error 30% of the time if(d==1) error("test stop") else return(1:10) # return your actual values }, error = function(err) {return()} # return NULL on error ) } x <- sapply(1:20, FUN=testfun) # run demo 20 times x <- x[-(which(sapply(x,is.null),arr.ind=TRUE))] # when errors happen, x is shorter than 20 The final line removes NULL entries from the list (based on this: http://stackoverflow.com/a/3336726/2338862).

Categories : R

U-Boot. Where does it all begin?
On u-boot-2013.04, board_mmc_init gets called from drivers/mmc/mmc.c, function mmc_initialize(...). To find this, "grep -r" (recursive) is your friend. "Where do I look to see where everything 'starts' ?" Not sure, but look for ENTRY(_start) lines.

Categories : Misc

Ruby script on ec2 boot
in your script put a "lock"file somewhere (e.g. /etc/couchbase-config-done) and in the beginning of your script only continue the script if this file is not found. however i do not understand who calls your script and why you cannot simply call it less often/only during/after instance creation not on every boot...

Categories : Ruby On Rails

Running code at boot?
You can create a Launch Daemon and install it. You should go through the following procedure: Create your program (a normal executable with main() etc.) and put it into one of the standard executable paths. I suggest you use /usr/libexec/ for this purpose. Create a property list in /System/Library/LaunchDaemons/ of which the name is an arbitrary bundle ID (e. g. com.mycompany.NastyLaunchDaemon.plist), and its contents are the following: <plist> <dict> <key>Label</key> <!-- this needs to match the file name without the .plist extension! --> <string>com.mycompany.NastyLaunchDaemon</string> <key>Program</key> <string>/usr/libexec/mynastylaunchd</string> <key>RunAtLoad</key> <true

Categories : IOS

How to get Windows key from disk that cannot boot?
Just for anyone having the same problem, I found this program http://www.nirsoft.net/utils/product_cd_key_viewer.html , that can find the keys also for external drives, choosing as source the WindowsSystem32configSOFTWARE file.

Categories : Misc

Android app crashes on boot
Change like this in your manifest and try it: <receiver android:enabled="true" android:name=".Autostart" android:permission="android.permission.RECEIVE_BOOT_COMPLETED"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver>

Categories : Java

SEandroid Boot Up Problems
Rookie mistake. Forgot to add in Google's proprietary drivers for the Nexus 7. Available here for who ever needs them! https://developers.google.com/android/nexus/drivers thanks all

Categories : Android

Boot Debian with Android
You can use Script Manager (https://play.google.com/store/apps/details?id=os.tools.scriptmanager) to run script with the following contents at boot: #!/system/bin/sh deb s Use your own parameters to "deb" to launch whatever service you need. In this case I've started the ssh server.

Categories : Android

how does u-boot maps peripheral memory?
Welcome to Stackoverflow. The registers are mapped to RAM memory address space at hardware level using different type of interconnects in the SoC. e.g Lets take the example of OMAP 35x series and see how UART registers are mapped to the RAM memory address space of the SoC and how we may access them in U-Boot. In the Technical Reference Manual for OMAP 35x, Table 2-3. L4-Core Memory Space Mapping, we see that base address for UART1 is 0x4806A000 and the size (of RAM that it occupies) is 4KB. It means that registers for UART1 are mapped to RAM the memory space in a 4KB region starting at this address. To access a register of UART1, we need to know its offset from the base address to get its actual address. These offsets can be found in Table 17-39 UART IrDA CIR Register Summary. Once we

Categories : Misc

Decrease rails boot time
RUBY_HEAP_MIN_SLOTS (default 10_000) - the initial number of heap slots and minimum number of slots at all times. One heap slot can hold one Ruby object. RUBY_HEAP_FREE_MIN (default 4_096) - the number of free slots that should be present after the garbage collector finishes running. If there are fewer than those defined, it allocates new ones according to RUBY_HEAP_SLOTS_INCREMENT and RUBY_HEAP_SLOTS_GROWTH_FACTOR parameters RUBY_HEAP_SLOTS_INCREMENT (default 10_000) - the number of new slots to allocate when all initial slots are used. The second heap. RUBY_HEAP_SLOTS_GROWTH_FACTOR (default 1.8) - multiplication factor used to determine how many new slots to allocate (RUBY_HEAP_SLOTS_INCREMENT * multiplication factor). For heaps #3 and onward. RUBY_GC_MALLOC_LIMIT (default 8_000_

Categories : Ruby On Rails

Boot AngularJS + Cloud Endpoints
This sorted out my boot sequence: function customerInit(){ angular.element(document).ready(function() { window.init(); }); } The ng-cloak directive prevents me from seeing a flash of unparsed angular directives.

Categories : Angularjs

Raw read the boot sector with fstream
File stream operations are written to access files. The CPP Reference does not further specify what a 'file' is in this context -- and maybe they are right. After all, it highly depends on the OS what's considered a 'file'. However: under none of these interpretations is the boot sector a file. You cannot see or read the boot sector in Windows Explorer or OS X Finder -- it's "above and beyond" the level of files. Your test program fails because "G:" is not interpreted as 'a flash drive', but merely as 'a full path specification'. When working on the level of "boot sectors", there are no paths and drive letter assignments. You are working with physical objects instead: actual disks, and actual sectors. See http://www.codeproject.com/Articles/28314/Reading-and-Writing-to-Raw-Disk-Sectors

Categories : C++

Starting Vagrant VM on host boot
Cron job doesn't fit into this use case, it is for scheduled jobs. As you are running Ubuntu as host, I'd recommend using /etc/rc.local, place the commands in the rc.local script which is executed at the end of the init process. It'll look like this #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. cd /path/to/vagrant_vm1 && vagrant up cd /path/to/vagrant_vm2 && vagrant up exit 0 NOTE: There will be port conflicts on the host if you start more than 1 Vagrant boxes with the same networking mode - NAT (default), which by de

Categories : Ubuntu

Android early boot console over usb
It is indeed possible to setup a serial console to capture the boot-loader and Linux-kernel console messages over the USB port of a Nexus S. Essentially one needs to setup a USB-to-UART converter modified to fit the micro-USB port of the Nexus S. Detailed instructions with screenshots are available in this article.

Categories : Android

Android boot image format
No. You are right. mkbootimg cross-compiled for ARM will run into issues as described in this question.

Categories : Android

Setting Time on AlarmManager after Boot
You just need to calculate the time remaining until the notification is to fire within your BootBroatcastReceiver. For example private long getNextNotificationTime() { long value = // calculate milliseconds until next notification return value; } Now, use this value in your receiver. long nextAlarmTime = this.getNextNotificationTime(); Intent notificationIntent = new Intent(this, BQBroadcastReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, notificationIntent, 0); AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, nextAlarmTime, 24HOURS, pendingIntent); This means your alarm will ONLY need to recalculate on boot and the

Categories : Android

How to check if my BroadcastReceiver receives the BOOT?
Assuming BOOT means BOOT_COMPLETED then you could use the following: public class BootCompleteReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { //Do a Log or, less likely, a Toast or start your application here. } } }; You would register this in the manifest like such: <receiver android:name="com.example.yourAppName.BootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> </intent-filter> </receiver>

Categories : Android

Scala app on Heroku - Boot Timeout
Does this happen all the time? It happens to me too, occasionally. Seems it started after I moved my app from US to EU region. Which region is your app in? It doesn't necessarily means there is something wrong with your app. Might just be that the Dyno it self takes a while to start, if you look at the log you should be able to see how long it takes from the app enters starting to when it starts the JVM. If that time is considerable and it keeps happening, you should contact Heroku support.

Categories : Scala

X Error of failed request: GLXBadFBConfig (opengl 4.3 - ubuntu)
glxinfo is your friend. It's a command line tool which will report the version numbers and extensions supported for server side GLX, client side GLX, and OpenGL itself. Do you have the NVIDIA binary (proprietary) driver installed? You'll need it if you want to take advantage of OpenGL versions 3 or 4. Like every software product there are occasional glitches, but over the years I think most 3D programmers / users would agree that the NVIDIA drivers for Linux have been very solid, much better than the alternatives.

Categories : C++

File systems and the boot parameter block:
I asked Mike Saunders ( the author of Mike-OS) in an email and his answer was no. I can't use this table for FAT32 just by changing that (acFSType: ascii “FAT16 “)part. To get a boot parameter block for the FAT32 file-system he sent me this link to the Microsoft website.

Categories : Misc

how to edit initramfs to add a new partition after boot in CentOs
I'm gonna go on a guess here. If I understand what you want to do correctly, what you want to do is to make another ext3 partition visible in CentOS. If so, you want to make sure that the partition exists. Maybe you have a disk called /dev/sda it might have 2 partiotions sda1 ext3 mounted at /boot and sda2 ext3 mounted at / To view this use "sudo blkid" fdisk-l or similar. These partitions are loaded at boot from the list found in /etc/fstab say you still have space left on the disk. use fdisk/gparted to create a new ext3 partition sda3. add a line for that disk in /etc/fstab now it should be accessible after a reboot or after "sudo mount -a" I might have completely misunderstood your question. Edit: I think I understand what you want to do now, and you probably want to edit

Categories : Linux

Stop Raspberry Pi from running program at boot
Update: Looks like I failed to get that you want to interrupt the running bootprocess and stop the script. The simplest idea would be to turn of the pi, unplug the sd card and plug it into your desktop, (re)move the script and boot again. Processes spawned during are stored in scripts in /etc/init.d/.... These scripts are called by the init process, the first process on a Linux machine (PID:1) But init starts not all scripts in /etc/init.d. This depends on the run level. On a debian system there are 7 run levels. For every run level there is a folder called like: /etc/rc0.d ... /rc6.d in which are softlinks to scripts from /etc/init.d are stored. To remove a script from being executed on every boot you'll delete all links from that folders. Usually on debian systems this is don

Categories : Linux

Unable to boot rails server using mysql2
you have to read the error message carefully, it's in there ;) Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.) (LoadError) just add gem 'mysql2' to your Gemfile, and run bundle install.

Categories : Misc

U-Boot: Unexpected problems porting code
Indeed, the code was a little bit too complex to be executed at this point of boot time. At this time there is ne real CRT and I only have a minimal stack. Thus, I moved the code to board_init_f() which is still part of the SPL. It gave more stable results and my algorithm now works as expected.

Categories : C

Reading boot Sector of the hard disk
The boot sector of the disk contains not ASCII data, but code. With high probability, one of the first bytes will be NULL and remaining possibly not printable codes (such as CR, LF, etc.). Trying to print the buffer by INT 10h, which prints ascii codes, and ending on 0 will result probably with nothing displayed at all. You should convert every byte of the buffer to hexadecimal string and then print these strings to the display. This way you will get simple hex dump of the boot sector.

Categories : Assembly



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.