w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to turn a Linux application in C/C++ into a Desktop Enviroment for a Linux distro?
You either want to create a boot loader, or you want to replace the 'shell'. This would be governed by per-user or global xinit and Xsession files.

Categories : C

How to turn silent mode on during a specific time period in Android? and turn back to normal after the whole duration?
You can use the android FrameWork class AudioManager as follow : AudioManager manager = (AudioManager)getSystemService(AUDIO_SERVICE); manager.setRingerMode(AudioManager.RINGER_MODE_SILENT); Hope it helps :)

Categories : Android

Tween Multiple object turn by turn in tweenlite
Usually I'd do it like this: for (var i:int = 0; i < 5; i++) { TweenLite.to(object, duration, {delay: duration * i}); } It will create all the Tweens at once, but they won't really effect your performance since only the active tweens are really noticeable. I did that with over 200 objects and had no lag at all.You might however want to pool the TweenLite object on mobile platforms, but again - you probably won't see the difference up to 800+ objects.

Categories : Actionscript

Android app: how to turn off listener and turn it back on again?
Instead of inline creating the SeekBar.OnSeekBarChangeListener, create a member variable of type SeekBar.OnSeekBarChangeListener. When you want it to turn it on, you can pass the variable to it. When you want to turn it off, you can pass it the null. private SeekBar sbt; //Not sure where this gets initialized in your code. private SeekBar.OnSeekBarChangeListener mListener = new SeekBar.OnSeekBarChangeListener() { int progressChanged = 0; @Override public void onStopTrackingTouch(SeekBar seekBar) { // Toast.makeText(ProductDetailsInfoActivity.this,"seek bar progress:"+progressChanged, // Toast.LENGTH_SHORT).show(); // TODO Auto-generated method stub } @Override public void onStartTrackingTouch(SeekBar seekBar) { // TOD

Categories : Android

Exec(Linux). How it functions internally? Linux executable attributes(rlimit)
The RLIMIT_CORE is used to place a limit on the amount of info that coredump is allowed to produce, before it is aborted. Once this limit is hit, no more info is logged and the message Aborting Core is logged to the console. From the man page of core : A process can set its soft RLIMIT_CORE resource limit to place an upper limit on the size of the core dump file that will be produced if it receives a "core dump" signal. Use setrlimit() to configure RLIMIT_CORE to a larger value to obtain complete coredumps. The most common format of executables/shared-objects is ELF. On Linux, the dynamic loading and linking of these shared-objects is performed by ld.so ld.so is loaded in the address space of a newly created process (by exec in this case) and executed first. This is possible as

Categories : Android

Linux users', specifically Apache, permissions settings, [Linux noob :]
usually any daemon will need to access a number of ressources. it is therefore good practice to run each daemon under a special user:group, rather than nobody:nogroup. traditionally (e.g. on Debian systems) apache runs as www-data:www-data. finally, user permissions take precedence over group permissions (which in turn take precedence over other permissions). this means that a directory where the user does not have write perms but the user's group can write is effectively r/o for that user (but not for other members of the group)

Categories : Linux

Purpose of Curly Brace Usage of C Code found in Linux (include/linux/list.h)?
This is a GNU language extension known as a statement expression; it's not standard C.

Categories : C

Write C++ on Windows but use Linux System calls through a Linux emulator
You've already tagged your question with Cygwin. That seems like the best solution for what you want. Cygwin is basically a collection of programs which emulate a GNU/LInux environment through the use of a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality. Here's the link to the documentation for its API Edit: Most of the Cygwin source code that I've looked at is written in C++ and makes system calls using MS Windows API to do provide the *nix emulation. The source is well written and very readable (even to to a non-C++ programmer such as myself). I think using Cygwin would be a good transition from programming on Windows to a GNU/Linux environment.

Categories : C++

What's a good way to set up Closure Compiler on Linux? Or, where should Java .jar's live on a Linux?
If you using the java command directly, then you'll have to provide a path to the jar in question. It's probably easier to place the jar in one place and create a shell script that handles the invocation and jar path.

Categories : Java

Do i need to install mono on every Linux PC to run .NET application on Linux platform?
"can I run a mono application on a machine that doesn't have mono installed": no; the same as you can't run a java application on a machine that doesn't have java installed. And at the same time (to both): yes. There are tools that attempt to make this work, but they tend to be fiddly and a bit unreliable. However, it should also be noted that several (not all, by any means) distros ship with mono by default.

Categories : Dotnet

fedora linux --- compiling first linux module
As guido said, you have to match your current kernel and the kernel-devel package. To get your kernel version run uname -r I get 3.6.10-4.fc18.x86_64, download that kernel-devel version sudo yum install kernel-devel-3.6.10-4.fc18 Or update your system and boot with the new kernel, I believe those two will automatically match.

Categories : Linux

How to fix TPM in Redhat Linux? RedHat Linux hang on first time to boot after installing
After all my search I found out that in Redhat 6 there is a problem tboot and best way to fix it is to remove tboot package (it is located in System Base>Base>tboot.6) For more info about tboot you can check these links: enter link description here

Categories : Linux

How to turn on 3G?
From your description, it sounds as though you want to turn the 3G device's radio on. You can do this in C# or C++ via Windows Mobile Broadband IMbnRadio and IMbnRadioEvents interfaces. I had a quick look on Google for a Windows setting that would tell the OS not to deactivate the device at shutdown, but didn't find anything. EDIT: MbnApi does let you do a lot of things. It consists of many interfaces, and the two that I linked to above are specifically for switching the radio off and on. You don't need the rest. The 3G module can either be software disabled (radio off/on) or hardware disabled (a switch on the computer). The exact implementation of these two things, is up to the individual manufacturer. They don't work exactly the same on machines from different manufacturers. So

Categories : Windows

Turn value into 2value
So, short answer: What you're looking for is a left shift. in C and many other languages, your particular wish would be served by 1 << 8. You could do it in x86 assembler with shl but there's really no sane reason to do so since pretty much any compiler you come across is going to compile the code into the native shift instruction.

Categories : Algorithm

Turn On GPS using NDK
In general, the Android NDK interface is much more limited than the SDK interface. To supplement it, you are able to access Java functions through the JNI interface. There is no extra functionality in the NDK that does not already exist in the Java SDK.

Categories : Android

Turn "abc" to "[97, 98 99]"
You can use list comprehension and ord. >>> nums = str([ord(char) for char in "abc"]) >>> nums "[97, 98, 99]"

Categories : Python

How to turn off cache?
There's any research effort…… Here's your answer for perfect no-cached content using HTML: <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> ==> from this post: http://stackoverflow.com/a/2068407/2213706. And here's something about If-Modified-Since header: ==> http://stackoverflow.com/a/1192640/2213706

Categories : Http

how to turn on vpn in ios app ? ( public api )
even astrill is an app available for ios (iPhone VPN connect app).. it provides a toggle to switch vpn on and off from the app directly... so my guess is it used some third party api.. right now.. there is no public api available to toggle vpn from an app.. urlscheme could have been used to atleast open vpn setting from ur app .. but even that was deprecated.. so no chance for now

Categories : IOS

for every value which in-turn is a key is put in one-line
from collections import OrderedDict with open('abc') as f: dic = OrderedDict() seen = set() for line in f: spl = line.split() + [""] key ,v = spl[:2] if v in dic and dic[v] == [""]: del dic[v] for k1,v1 in dic.items(): if key in v1: dic[k1].append(v) break else: dic[key] = [v] with open('ouput.txt', 'w') as f: for k,v in dic.items(): f.write("{} {} ".format(k," ".join(v))) Output: 344670 332807 353314 353311 338169 334478

Categories : Python

Turn Flash On/Off
It looks like you can't retrieve the acquisition device twice (I'm not sure why), so you should store it in a property: protected AudioVideoCaptureDevice Device { get; set; } private async void ButtonTurnOn_Click(object sender, RoutedEventArgs e) { var sensorLocation = CameraSensorLocation.Back; try { if (this.Device == null) { // get the AudioViceoCaptureDevice this.Device = await AudioVideoCaptureDevice.OpenAsync(sensorLocation, AudioVideoCaptureDevice.GetAvailableCaptureResolutions(sensorLocation).First()); } // turn flashlight on var supportedCameraModes = AudioVideoCaptureDevice .GetSupportedPropertyValues(sensorLocation, KnownCameraAudioVideoProperties.VideoTorchMode); if (

Categories : C#

What is Fiddler and how do I turn it off?
Fiddler is a data monitoring tool that allows you to see incoming and outgoing HTTP(s) traffic from your computer. http://fiddler2.com/ It is a desktop app, so if you haven't got it installed on your PC - then you don't need to turn it off

Categories : C#

Turn a slug into an id
In your routing file: your_route_name: pattern: /my_app/{category}/{subcategory}/{page} defaults: { _controller: YourBundle:YourController:FindPost } In your controller: public function FindPostAction($category, $subcategory, $page) { //...use $category, $subcategory, $page here }

Categories : PHP

How to turn these N queries to one
The way that you would get 10 words around "rivolgimento": select lt.* from lemmatized_text ltr join lemmatized_text lt on ltr.lemma = 'rivolgimento' and lt.position between ltr.position - 10 and ltr.position + 10; If you want the words in one row, per appearance of 'rivolgimento', then something like: select ltr.position, group_concat(lt.lemma separator ' ') from lemmatized_text ltr join lemmatized_text lt on ltr.lemma = 'rivolgimento' and lt.position between ltr.position - 10 and ltr.position + 10 group by ltr.position;

Categories : Mysql

Can you turn NumLock on in XNA?
I don't know if this is that you are looking for, but I found this article. In order to know whether or not Caps Lock, Num Lock or Scroll Lock keys are on, we need to make use of the Win32 API through a call to an unmanaged function. Since we'll make a call to an unmanaged function, the following using statement is in order: using System.Runtime.InteropServices; The following is the definition for the unmanaged function we'll be using, GetKeyState(): // An unmanaged function that retrieves the states of each key [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true, CallingConvention = CallingConvention.Winapi)] public static extern short GetKeyState(int keyCode); // Get they key state and store it as bool bool NumLock = (((ushort)GetKeyState(0x90

Categories : C#

QuickFix C++ how do I turn on SSL?
Thanks for the config file. I have never used then switch SocketUseSSL=Y Instead, in our production environment, in order to encrypt data over SSL we are using a free software: sTunnel It's quite straightforward to install and config, and run over many different platforms. Hope this can help.

Categories : C++

How do you turn a .gif into a byte[][]?
If you're using standard image io, you could do the following: BufferedImage image = ImageIO.read( <your image file> ); ByteArrayOutputStream baos=new ByteArrayOutputStream(); int width=image.getWidth(null); int height=image.getHeight(null); BufferedImage bi=new BufferedImage(width,height,BufferedImage.TYPE_BYTE_GRAY); bi.getGraphics().drawImage(image,0,0,null); ImageIO.write(bi,"RAW",baos); baos.flush(); byte[] resultImageAsRawBytes = baos.toByteArray(); baos.close(); What this basically does is: it reads the image into a BufferedImage, renders it into a grayscale images and writes the result to a ByteArrayOutputStream which allows you to access the raw bytes. A few notes though: - You'd need to add exception handling yourself - I'm not 100% sure about the "RAW" format (unfor

Categories : Java

Changing player's turn
try this: change your code to this: var player = 'RED'; function bindDrag(){ $(whosturn(player)).draggable({ revert: true, stop: function() { player = 'BLUE'; bindDrag(); } }); } $(function() { bindDrag(); }); function whosturn(player) { if(player == 'RED') { return '.red'; } else if(player == 'BLUE') { return '.blue'; } } working fiddle here: http://jsfiddle.net/euTwT/3/ I hope it helps.

Categories : Javascript

Turn float into string
If it is acceptable to print as 1.d1d2d3d4d5…*2^e1e2e3, then converting a floating-point number to decimal(-ish) representation can be simple. An implementation can be found here. If you need a scientific 1.d1d2…*10^e1e2e3 representation, then the naïve approach to repeatedly divide by 10 and extract digits from the number that you have in floating-point format. You will need some sort of multi-precision integer library. (Repeatedly multiply by 10 to extract the digits after the point.)

Categories : String

How to turn a div into an image using Javascript
Here is some stuff that you can use in your project. See the examples, it can be help. That script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. I hope you make it. http://html2canvas.hertzen.com/ and here some examples http://experiments.hertzen.com/jsfeedback/

Categories : Javascript

How to turn off a subscription in meteor
Meteor.subscribe() returns a handle which you can call the stop method on. //subscribe roomSubscription = Meteor.subscribe("rooms"); //stop subscription roomSubscription.stop(); more info on this here: http://docs.meteor.com/#meteor_subscribe

Categories : Meteor

How to turn folder into jar - Code
Given that you want to create the JAR through code; you can use JarOutputStream for that. There is an example at this link that contains code to create a JAR file given a File[] containing all the input files. As for creating the list of files given a starting input path, see Recursively list files in Java. You could either build a list of files then just use code like in the above example, or you could recursively scan files and add them to the JAR as you go. If you are using Java 7 and you know your users are too you can also use Files.walkFileTree() with a FileVisitor that adds entries to the JAR as it visits files. Original answer before OP clarified: Is there something wrong with: jar cf my-application.jar folder1 folder2 folder3 etc The JDK comes with a jar utility to creat

Categories : Java

How to turn a jp2 image to a jpg file?
You can't. GD2 doesn't support JP2 (JPG 2000) format. You will have to use Imagick library. I had 1.4million image files in jp2 format, and I used IrfanView batch function. It event let me re-cosntruct the directory structure, which consisted of three levels, like [0-f]/[0-f]/[0=f]/image.jpg

Categories : PHP

How to get zoom working with turn.js
Your code isn't showing everything (e.g. where ".fullscreen" or the "zoom button" is in your HTML), so my answer may not be precise. Looking at the sample, you should find the code: $('.magazine-viewport').zoom('zoomIn', pos); This seems to differ from turn('zoom', ...), and appears to be undocumented. This is a function that will zoom in the element defined as a turn object. I believe, for you, this is your "#flipbook" element, instead of ".magazine-viewport". The parameters are "zoomIn" and pos, which may be a different functionality that what you're using currently. The "pos" appears to be a JS object that contains "x" and "y" properties, meant to define where you clicked on the magazine. These coordinates are relative to the magazine, not the whole screen, so keep that in mind

Categories : Javascript

Turn on or off Android remotely
Take a look at PowerManager. I imagine you can use PowerManager#newWakeLock with FULL_WAKE_LOCK to turn the screen on and PowerManager#goToSleep to turn the screen off in response to on/off command.

Categories : Android

How to turn off screen using xset?
#!/bin/bash export DISPLAY=:0.0 if [ $# -eq 0 ]; then echo usage: $(basename $0) "on|off|status" exit 1 fi if [ $1 = "off" ]; then echo -en "Turning monitor off..." xset dpms force off echo -en "done. Check:" xset -q|grep "Monitor is" elif [ $1 = "on" ]; then echo -en "Turning monitor on..." xset dpms force on echo -en "done. Check:" xset -q|grep "Monitor is" elif [ $1 = "status" ]; then xset -q|sed -ne 's/^[ ]*Monitor is //p' else echo usage: $(basename $0) "on|off|status" fi From here: http://systembash.com/content/how-to-turn-off-your-monitor-via-command-line-in-ubuntu/

Categories : Linux

Turn private sub into function
You could add handlers to this sub. Private Sub btnRptEmployeePayToMarket_MouseDown(ByValsender As Object, ByVal myButton As System.Windows.Forms.MouseEventArgs) Handles btnRptEmployeePayToMarket.MouseDown, btnAnotherone.MouseDown, etc...

Categories : Vb.Net

hashlib md5 doesn't actually turn into md5?
6adf97f83acf6453d4a6a4b1070f3754 is actually md5 value of "None", so maybe you get something wrong elsewhere. Let's say you didn't actually get the passw from request.forms, and parse the None to str(), then gives it to md5().hexdigest(), you'll just get the result.

Categories : Python

How to turn DateTime to last day of the month?
Well you can use: DateTime date = ...; var endOfMonth = new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month)); Note that that will create a DateTime with a Kind of Unspecified. You should consider what Kind you really want. (Or use my Noda Time library, where you'd use a LocalDate instead.)

Categories : C#

Turn all my Views to Strings (MVC 4)
There's a recent post from Rick Strahl showing how to render views outside the Asp.NET. Given the post, its seen very simple and you could write a file, or string for searching purpouse. Take a look!

Categories : C#

Is there a way in C# to turn the property into a string containing it's name?
I think this could be helpfull: // This method is called by the Set accessor of each property. // The CallerMemberName attribute that is applied to the optional propertyName // parameter causes the property name of the caller to be substituted as an argument. private void NotifyPropertyChanged([CallerMemberName] String propertyName = "") { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } Source and more explanation: http://msdn.microsoft.com/de-de/library/system.componentmodel.inotifypropertychanged.aspx And here: http://msdn.microsoft.com/de-de/library/system.runtime.compilerservices.callermembernameattribute.aspx

Categories : C#



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