w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
iOS Alarm Clock
You don't need to assign a sound name to scheduled notification, just invoke the playPause method and get the name of sound file from notification, as shown below and just assign it to NSString and set property to it in appDelegate and access it to play that file. AppDelegate.h @property (nonatomic,strong) NSString *nsStr_soundFile; AppDelegate.m @synthesize nsStr_soundFile; - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { //Give call to play sound method. self.nsStr_soundFile=notification.soundName; VOID *obj=[VOID alloc]init]; [obj playPause]; }

Categories : Iphone

Alarm Clock for iOS
Your app must not be running in foreground when the notification fires. If you want to play sound in foreground,you can use combination of UIAlertView and 'AvAudioPlayer'. You can setup this code in -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification delegate method of AppDelegate.m. Feel free to ask further.

Categories : IOS

Alarm Clock application help (AI)
so you are creating a WPF application? If you do so, you could try this Speech Recognition MSDN. When you have the whole sentence (you can use Regex to get the time) or the time you want, your AI can speek with this Speech Synthesizer MSDN.

Categories : C#

Alarm Clock from GIT - Gives error - Android
I think that maybe it's a problem of the imports. Try checking the imports of your class. Sometimes Eclipse imports the R.java class from the android package and stop using yours. Remove imports like import android.R

Categories : Android

Launching the Xperia Z alarm clock
After some search i managed to find corresponding Activity: { "Sony Ericsson Xperia Z", "com.sonyericsson.organizer", "com.sonyericsson.organizer.Organizer_WorldClock" } As alternative com.sonyericsson.organizer also contains - com.sonyericsson.alarm.SetAlarm

Categories : Android

Alarm Clock notification not working in android
Error is NullPointerException at line 35. There's nothing at line 35 in your code. may be it was because of this line Bundle extras = getIntent().getExtras(); String ename = extras.getString("ename"); You can resolve it by using this Bundle extras = getIntent().getExtras(); String ename; if(extras == null){ ename = "some default name"; } else{ ename = extras.getString("ename"); }

Categories : Android

Android Alarm Clock - Remove alarms programmatically
call method cancel(...) from AlarmManager, using the same PendingIntent you used to set the alarm. Example: mAlarmPendingIntent = PendingIntent.getActivity(this, requestCode, intent, flags); this.getAlarmManager().cancel(mAlarmPendingIntent); this refers to the Activity or the Service from which you are cancelling the alarm

Categories : Android

Making Alarm Clock; How do I make single digit numbers have 0 before in JComboBox
Change ArrayList<Integer> minute to ArrayList<String> minute. Also, change JComboBox<Integer> t3 to JComboBox<String> t3 and add minutes like this: minute = new ArrayList<String>(); for (int i = 01; i <= 60; ++i) { if (i < 10) { minute.add("0" + String.valueOf(i)); } else { minute.add(String.valueOf(i)); } }

Categories : Java

I want to run exe programs with a bat file. "Alarm Clock.exe" the bat file will be a basic short cut
There's not so much to learn... to run a program with a batch file you just write its name (usually without extension), prepended by its path if it's not in the batch file's working directory or in the PATH.

Categories : Windows

I am trying to set alarm on specific time using alarm manager but alarm intiated instantly?
the problem here is, that the value from TP seems to be the current time. It would be helpful if You show more of Your code. Let me give You an example for setting alarm time with a delay of 5 seconds. Please try out this one, it´s a dirty way, I just want to explain. This is what You did: calnow.set(Calendar.HOUR_OF_DAY,TP.getCurrentHour()); calnow.set(Calendar.MINUTE,TP.getCurrentMinute()); alarmManager.set(AlarmManager.RTC_WAKEUP, calnow.getTimeInMillis(),pendingintent); to get a delay of five seconds, change it to alarmManager.set(AlarmManager.RTC_WAKEUP, calnow.getTimeInMillis()+5000,pendingintent); like I said, this is only to show which value You have to set to alarmManager. It has to be the time in milliseconds, when You want to start th

Categories : Android

compare client device clock with server clock exactly upto milliseconds
It looks like that they simply ignore problem of the network lag in their description. I notice their (vague) phrasing: (...) based on the determination that the matching [delta of time] parameter falls within the selected range (...) This could account for network lag variations. Over a large, busy network such as the Internet, it is not possible to bring the accuracy "down to the millisecond". Other network types (I'm thinking Token Ring or networks with very, very strict QoS policies) might allow this level of precision.

Categories : PHP

Javascript clock, change day in advance when clock hits hour
Because it was hard to understand your code, so I created a new counter: <html> <head> <script type="text/javascript"> var counterIntervalVar; var howManyDaysAhead = 0; var finishHours = 16; var finishMinutes = 0; var finishSeconds = 0; function ShowTimes() { var str = ""; var now = new Date();//Use current time as start time //Creating the target time var dayIncreasion = 1000 * 3600 * 24 * howManyDaysAhead; var targetDateInMilliSeconds = now.getTime(); var targetDate = new Date(targetDateInMilliSeconds + dayIncreasion); targetDate.setHours(finishHours); targetDate.setMinutes(finishMinutes); targetDate.setSeconds(finishSeconds); targetDateInMilliSeconds = targetDate.getTime(); //Calculate and show the

Categories : Javascript

Can I set an invalid value to hardware clock (Real Time Clock) on Linux
Depending on your hardware, this might be impossible. One way to make it work is to overwrite the function that you use to read the hardware clock. If you have enough tests to make sure the function itself works (and the same is true for the code which uses the function), then you can use the C preprocessor to point your code to a mock implementation that returns illegal values. That means you need to compile and link a special binary that doesn't call the actual function and run the test with that.

Categories : Linux

Repeat alarm everyday at specific time (Alarm manager)
Try this alarmMgr0 .setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + AlarmManager.INTERVAL_DAY, AlarmManager.INTERVAL_DAY, intent); refer this

Categories : Android

Bulk convert log file date time format from 12 hour clock to 24 hour clock for mySQL database
If you want to do that on db side and you use MySql you can read it with STR_TO_DATE() and either use it as a datetime value INSERT INTO log (`Site_Name`, `number_of_clicks`, `date`, `Interaction_Type`) SELECT 'site1', 10, STR_TO_DATE('10/05/2013_2:00PM', '%d/%m/%Y_%l:%i%p'), 1; or UPDATE log SET date = STR_TO_DATE(str_date, '%d/%m/%Y_%l:%i%p'); assuming that date column is of type datetime, and str_date column contains string values in 12h format. or if for some reason you store it as VARCHAR and really need to format it as DD/MM/YYYY_14:00 then you can use DATE_FORMAT() DATE_FORMAT(STR_TO_DATE('10/05/2013_2:00PM', '%d/%m/%Y_%l:%i%p'), '%d/%m/%Y_%k:%i') which will produce | NEWDATE | -------------------- | 10/05/2013_14:00 | To update in-place UPDATE log SET

Categories : PHP

Eclipse, Macos 10.8 and C++11
Rather than using g++, one can use clang++. I used the answers Error when compiling some simple c++ code, clang 3.1 can't see unique_ptr? and How to compile a C++0x code on Eclipse CDT on mac? as guides to come up with the following steps: change the compiler in the Project->Properties->C/C++ Build -> Settings -> Gcc C++ Compiler -> Command (change g++ to clang++). in Project->Properties->C/C++ Build -> Settings -> Gcc C++ Compiler -> Miscellaneous, append -std=c++11 -stdlib=libc++ to the flags. do the same as one for the linker under C/C++ Build -> Settings -> Gcc C++ Linker -> Command in Properties->C/C++ Build -> Settings -> Gcc C++ Linker -> Miscellaneous, add -stdlib=libc++ to the Linker flags. in Properties->C/C++ General -> Preprocessor Include Paths, Macros,etc -> Providers

Categories : Eclipse

MacOS Terminal: how to use a seccond ssh key?
The way to use several ssh keys is to use a ~/.ssh/config Host serverKey1 Hostname server1 # or ip address of server1 User serverUser IdentityFile ~/.ssh/id_rsa Host serverKey2 Hostname server1 # or ip address of server1 User serverUser IdentityFile ~/.ssh/id_rsa.gitlab You then need to use an scp-syntax for your ssh url: git clone serverKey1:/my/repo git clone serverKey2:/my/repo serverKey1 and serverKey2 are entries in your ~/.ssh/config file in order to pass to ssh the right server, user and identify file (public and private keys) If those private keys are password-protected, you would still need to add them. You can see more at this atlassian help page: "Configure multiple SSH identities for GitBash, Mac OSX, & Linux".

Categories : Osx

pop-up message on macos programing
The class you're looking for is NSAlert. Information on this class can be found in its class reference here. And here is an example of its usage: NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:@"Some awesome message text"]; [alert addButtonWithTitle:@"OK"]; [alert runModal];

Categories : Xcode

Printing a document on macos
you should search for "print apple event" when looking up the internet about your problem. As far as I understand you have to open the document in default application and send this application this event. This can be done with apple script or osascript in bash. regards, Robert

Categories : Osx

How to change JRE for PhpStorm on MacOs
Quoting from the "Selecting the JDK version the IDE will run under" article in the Knowledge Base posted on March 27, 2013 Mac OS X At the moment all our products require Apple JDK 1.6 to be installed in order to run on Mac. JDK 1.7 from Oracle is not officially supported yet and has known problems that stop us from using it by default. Oracle JDK 1.7.0_40 has added support for Retina and works much better than previous versions on Mac. You are welcome to give it a try in case you have any problems with Apple JDK. To force running under JDK 1.7 edit /Applications/.app/Contents/Info.plist file, change JVMVersion from 1.6* to 1.7* : <key>JVMVersion</key> <string>1.7*</string> See this answer for the known problems with JDK 1.7. IDEA_JDK envir

Categories : Osx

All uniform locations are "-1" on MacOS X
First thanks to @umlum for debug help.I managed to pin down the issue.It has to do with multiple OpenGL context.My program is plugin in Adobe AfterEffect(AE).AE during runtime spawns its own contexts at will.In my code each time I render OpenGL stuff I was enabling my context like this (MaxOS X): _context = CGLGetCurrentContext() ; CGLSetCurrentContext(_context); Calling the first line appeared to be grave mistake!What happens (probably) is that at the time I am trying to access the (supposedly mine) current context, it is already not my context but one of AE contexts which the program manages independently. _context = CGLGetCurrentContext() - I commented this line and it seems to be working now. I figured it all out by using glGetActiveUniform() Running it I found that m

Categories : Osx

How can I eject a CD from MacOS with Python?
Have you tried using a system call? Mac OS X Eg. Try this in your Terminal python -c 'import os; os.system("drutil tray open")' I just tried this on my MacBook Pro, let me know if this helps! Code: import os os.system("drutil tray open") Source: http://osxdaily.com/2007/03/26/quick-tip-eject-media-from-the-command-line/ Linux import os os.system("eject -t cdrom") Source: http://opentechlab.blogspot.com/2009/06/play-with-cdrom-in-linux.html Windows Using "cytpes" module: import ctypes, time # open the CD tray ctypes.windll.winmm.mciSendStringW("set cdaudio door open", None, 0, None) # try closing the tray ctypes.windll.winmm.mciSendStringW("set cdaudio door closed", None, 0, None) Source: http://www.daniweb.com/software-development/python/threads/72834/handling-cd-dri

Categories : Python

Launching app in foreground with Qt under MacOS X
Use QProcess instead, but make sure that rather than using the path to the executable as the object to run, pass it to the open command as an argument. Something like this: - QString cmd = QString("open %1").arg(fullpath); // may need QUrl::fromLocalFile(fullpath) QProcess::startDetached(cmd); Without using 'open', it will also open up behind other applications. Note that you could also use the execute function, if you want to wait for the program to finish. Also, with the open command, I think you only need to pass the path to the app bundle, rather than full path to its executable in Contents/MacOS. Either should work.

Categories : Osx

SDL framework include on MacOS Qt
I don't know why it had previously worked, but let's note the following: Addition of the framework to the LIBS only takes care of linking, not compilation. You don't need the INCLUDEPATH, it's not necessary. You need to add the frameworks path for both the linker and the compiler: // The directory where some frameworks are installed. There must // exist SDL.framework as a subdirectory of that directory. // It's simply to avoid typing the path twice. // It's a user variable, not interpreted by qmake SDL = -F/Library/Frameworks // Let the C/C++ compiler know where to find the frameworks. // This is so that when you include <xyz/foo>, it'll be replaced // by $$SDL/xyz.framework/Headers/foo // $$var is replaced by qmake by the contents of var QMAKE_CFLAGS += $$SDL QMAKE_CXXFLAGS += $$

Categories : Qt

Error with new gcc48 on macos
As suggested in the hints, I got rid of all the outdated -I/'s and set up the clang++ compiler as in Eclipse, Macos 10.8 and C++11 There were some clashes with between my code and the stl, but they were easy to hunt down from the console output.

Categories : Osx

How to use command "at" to execute shell in MacOS
Using at Your use of at appears correct. The command is executed at 2 minutes in the future. The command is not executed repeatedly so that is why the file is not touched at any time other than the time that now + 2 minutes evaluates to. If you are having problems getting at to run commands make sure you have the atrun Launch Control agent enabled and runing. See man atrun for more information about that. Better Scheduled Command Execution If you just want something executed when you log in then System Preferences > Users > Login Items is a good place. Rename your shell scripts with .command as their extension though if you do that. I'm not sure if it is required but it's what the OS seems to prefer for such scripts. Otherwise try cron to provide more control over job execution or use

Categories : Osx

MacOS dot file delete for MS-DOS devices
Here is my clumsy answer to the Question posted above. The main drawbacks are lack of much error handling or commenting, and the complexity level for non-technical users who need to learn about making shell scripts executable. If it could all be done in an AppleScript, it might be much more useful for a wide range of users baffled by the dotfile problem. Here's the Readme.txt file I've shared with the two scripts below: noMacOSdots.app -Introduction- Sometimes you may want to share files with an MS-DOS or Microsoft Windows user, or a non-Apple product such as a TV or media player. The problem is that all disk devices including USB sticks that have been attached to a MacOS computer or other Apple device will have files placed on them by MacOS that are invisible to MacOS u

Categories : Linux

Spawned process limit in MacOS X
Just to answer my own question here. This appears to be related to how MacOS X will dynamically expand a pipe from 16K to 32K to 64K (and so on). My basic workaround was to prevent the pipe from expanding. It appears that whenever you fill the pipe completely the OS will expand it. So, when the kqueue triggers that I can write into the pipe, and indicates that I have 16384 bytes available to write, I simply write 16384 - 1 bytes. Basically, whatever it tells me I have available, I write at most (available - 1) bytes. This prevents the pipe from expanding, and is preventing my code from encountering the condition where a write() to the pipe would block (even though the pipe is non-blocking).

Categories : Osx

MacOS kernel, .kext and devices in /dev
To create a /dev entry a Kext would normally use IOxxxBSDClient (e.g. Serial, Media, etc). You can use ioreg -l, and look for it, like so: ... (this would be the parent class) ... | +-o IOSerialBSDClient <class IOSerialBSDClient, id 0x100000385, registered, matched, active, busy 0 (0 ms), retain 5> | | { | | "IOClass" = "IOSerialBSDClient" | | "CFBundleIdentifier" = "com.apple.iokit.IOSerialFamily" | | "IOProviderClass" = "IOSerialStreamSync" | | "IOTTYBaseName" = "Bluetooth-Serial-1" | | "IOSerialBSDClientType" = "IORS232SerialStream" | | "IOProbeScore" = 1000 | | "IOCalloutDevice" = "/dev/cu.Bluetooth-Serial-1" | | "IODialinDevice" = "/dev/tty.Bluetooth-Se

Categories : Osx

Need to move a limited # of files on MacOs
Your ls command is failing because the shell expands your file pattern to so many matching files that their names in aggregate exceed the limit of a single command line. But do not despair, because you can simply replace your use of ls with find: find unprocessed -name '*.pdf' | head -n 99 > flist

Categories : Linux

Java errors on MacOS 10.8.4 using MatLab2013a
A Java update last month ago pretty much destroyed most Java based programs on Macs (including Matlab for me). The update at this link fixed it for me. http://support.apple.com/kb/DL1572 (OS X 10.7, 10.8+)

Categories : Java

Fail to install lxml in MacOS 10.8.4
Turn out xmlversion.h is not included in compilation path even though it is in PATH. Modify the C_INCLUDE_PATH env fix the error for me: C_INCLUDE_PATH=/usr/local/Cellar/libxml2/2.9.1/include/libxml2:$C_INCLUDE_PATH

Categories : Python

gcc on MacOS: Strange threading error
I found the solution: If I create the pthread with a larger stack it no longer crashes. I must say that the gdb-warning was very unclear and didn't seem to point at running out of stack space at all (a debugger should be able to detect this right?) Anyway, this code solves it: size_t stacksize = 0; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_getstacksize(&attr, &stacksize); pthread_attr_setstacksize(&attr, max(stacksize, 1024 * (1024 + 512)); pthread_t wxmt; pthread_create(&wxmt, &attr, mainThread, NULL); As it turns out, the default stack size for pthreads on a Mac is only 512 kB (on Linux it's 8 MB!) - this code increases it to 1.5 MB (1 would probably have sufficed, but since the errors that occur are really strange and I want to avoid havin

Categories : C++

Advantages of CFNetwork over BSD sockets & GCD on iOS and MacOS?
If you don't need cellular or VPN-on-demand, then I can't really think of a reason you'd have to use CFNetwork, but a wise man once told me: "Use the highest level abstraction that gets the job done." CFNetwork is a higher level API than BSD sockets, and GCD dispatch_io. On the other hand, "Go with what ya know." If you're more comfortable working in the BSD sockets or GCD dispatch_io idioms, by all means, go forth and prosper.

Categories : Sockets

macos statically linking libstdc++ with g++ 4.7.2
I think exceptions are a bit broken with GCC on Mac OS X: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45486 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42159

Categories : Osx

previous correct radio buttons disappearing when i miss a radio button in the middle
You could simply change: onclick="validate()" to: onclick="return validate()" and it will have the desired behavior. I think this is what you were trying to do, but the onclick() call never returned the value from validate().

Categories : Javascript

Radio buttons do not show database info, and also do not disable when another radio button is selected
The name attribute of the radio buttons must match that of the other radio buttons for them to pair up correctly; I don't know ruby's syntax, but I see you using 4 different names everywhere except the class, so I suspect you're setting choice_one, choice_two, etc as the name :)

Categories : HTML

If Radio Button is Selected Show Div - 8 Radio Buttons / 8 Divs - Can this be simplified?
Firstly put shared classes on both the radio buttons and the div elements which show the content. In my example I've used trigger and content respectively. Then add a data attribute to the radio to identify which div should be shown on click. Shortened example: <form id='group'> <label> <input type="radio" name="group1" class="sim-micro-btn trigger" data-rel="sim-micro-desktop" /> </label> </form> <div class="billpay-internet-add-ons"> <div class="sim-micro-desktop content">sim-micro</div> </div> Then you only need 1 click handler like this: $(document).ready(function(){ $('.trigger').click(function() { $('.content').hide(); $('.' + $(this).data('rel')).show(); }); }); You can also the

Categories : Javascript

How to set dynamic inputValue and boxlabel for radio button in radio group in extjs4.1
Maybe you could use a listener like this example on sencha wiki. Panel with radio group: Ext.create('Ext.form.Panel', { title: 'RadioGroup Example', width: 300, height: 125, bodyPadding: 10, renderTo: Ext.getBody(), items:[{ xtype: 'radiogroup', fieldLabel: 'Two Columns', // Arrange radio buttons into two columns, distributed vertically columns: 2, vertical: true, items: [ { boxLabel: 'Item 1', name: 'rb', inputValue: '1', listeners: { change: function (e, t, eOpts) { ... } } }, { boxLabel: 'Item 2', name: 'rb', inputValue: '2' checked: true}, { boxLabel: 'Item 3', name: 'rb', inputValue:

Categories : Extjs

Create a radio button group without the radio buttons and custom CSS styling
Yes and no. If you build your form with input and labels, it will do, else, you have to. :) the idea is : input[type=radio] { position:fixed; left:-9999px; } As being fixed and of the screen, your input radio won't be in the flow anymore. If labels are well formed and link to theme with attribute for, you just need to clikc the label to checked your invisible radio input. To style your form, don't mind those imputs, style your labels as wished. <input type="radio" name="r-lang" id="r1"><label for="r1"> EN </label> Cheers

Categories : HTML



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