w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Logrotate appending file name with a ".1"
If you look at the copy of the settings file from /etc/logrotate.d/", you will find there is this option extension .log. This option means you are trying to append the .log extension to rotated files. If you remove this option and run logrotate again, you will find that by default the extension will be *.log.1 , *.log.2, and so on for the rotated files. In a nutshell, remove the option extension .log. Because the rotated files will take .log as extension.

Categories : Misc

Logrotate - String of junk at top of log files
I had this same problem. I found the issue was that I was outputting to the log instead of appending. For example: ./application > logfile.log when it should be: ./application >> logfile.log What happens is the copytruncate on logrotate moves the file, output then seems to try to write to the same position and fills the file with a lot of hex fluff. This changes the file to be detected as a binary file instead of a text file. After changing to append, I have not had this issue again.

Categories : Linux

How to set the rights of a python-generated file, executed by logrotate
import os import pwd admdetails = pwd.getpwnam('adm') rootdetails = pwd.getpwnam('root') for fname in ['name1', ,,,]: os.chown(fname, rootdetails.pw_uid, admdetails.pr_gid) Or something like it should be adaptable to the job. N.B. You will probably need to run as root or sudo as changing ownership away from root without being root is discouraged.

Categories : Python

Chrome cannot apply filter:hue-rotate() and transform:rotate() at the same time in an animation
I took a stab in the dark and created two key-frame animations and then declared both for the element, which is working in Chrome 28: http://jsfiddle.net/3QGWY/1/ #subject { ... -webkit-animation:5s multi_rotate1 linear infinite,5s multi_rotate2 linear infinite; } @-webkit-keyframes multi_rotate1 { 0% { -webkit-filter:hue-rotate(0deg); } 100% { -webkit-filter:hue-rotate(360deg); } } @-webkit-keyframes multi_rotate2 { 0% { -webkit-transform:rotate(0deg); } 100% { -webkit-transform:rotate(360deg); } }

Categories : CSS

KinectJS: Rotate an image about an absolute rotate point per drag and drop
You can move an image around a fixed rotation point using some trigonometry Calculate the angle of the mouse position relative to the rotation point using Math.atan2: var dx=mouseX-rotationPointX; var dy=mouseY-rotationPointY; var radianAngle=Math.atan2(dy,dx); Move the image around the rotationPoint using Math.cos and Math.sin: var x=rotationPointX+radius*Math.cos(radianAngle)-imgWidth/2; var y=rotationPointY+radius*Math.sin(radianAngle)-imgHeight/2; image.setPosition(x,y); Here's working example code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Prototype</title> <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> <script src="http://d3lp1msu

Categories : Javascript

css transform:rotate, rotate forwards not backwards
I have choose to do that using a class for the rotation and another for the transition. And to make it easier in the script, using 2 divs nested so that you have only one class in each. The HTMl <div id="pie" class="rotate"> <div id="pos" class="rot0"> <div class="rot0" onclick="myFunction(0)">1</div> <div class="rot6" onclick="myFunction(1)">2</div> <div class="rot5" onclick="myFunction(2)">3</div> <div class="rot4" onclick="myFunction(3)">4</div> <div class="rot3" onclick="myFunction(4)">5</div> <div class="rot2" onclick="myFunction(5)">6</div> <div class="rot1" onclick="myFunction(6)">7</div> The CSS #pie { width: 200px; height: 200px; left: 35px; top: 35px; position: absolute; backgrou

Categories : CSS

android animated-rotate won't rotate ccw
I think the point is if you use <animated-rotate> it is a non public API. I can't find any official documentation about it. and it is actually ignoring whatever values you put in fromDegrees and toDegrees. You can remove both attributes and it will still spin. You said you don't want to use rotate, but that is the only other simple XML answer I can find: <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@android:drawable/ic_lock_power_off" android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0" android:toDegrees="-360" /> What is the reason for wanting <animated-rotate> and not <rotate> ? If you want to set a slower or faster frame count, you should check this answer here: http://stackoverflow.com/a/1499

Categories : Android

How to rotate SVG by PHP
I searched for quite awhile and finally put this together. Hope it helps. You can use the SimpleXML Library to access the nodes as needed. My solution works, but could probably simplified. First, I added this class (found in the comments here): class ExSimpleXMLElement extends SimpleXMLElement { public function _construct($xml){ parent::_construct($xml); } /** * Add SimpleXMLElement code into a SimpleXMLElement * @param SimpleXMLElement $append */ public function appendXML($append) { if ($append) { if (strlen(trim((string) $append))==0) { $xml = $this->addChild($append->getName()); foreach($append->children() as $child) { $xml->appendXML($child);

Categories : PHP

Rotate css3 bug
Problem This is because when you move the mouse up/down, whilst moving left/right and clicking it will reside to the up/down action. Current Strucutre I benchmarked the update of x co-ords. For both left and right directions, x 0, doesn't seem relative. The xAngle, yAngle, zAngle increment, but do not reset to 0. Suggestion I suggest making some changes to the structure of cubePointerMove(). Make each direction their own stack. That way, there will be no forthcoming problems with the 4 directions. The way it's set out now, is with duplicate up/down actions in the left/right blocks. Current // Left if( xMove < 0) { // Up if( yMove < 0 ) { if(xMove < yMove){ } } // Down else { } } // Right else { } Revised // Up if( yMove < 0 ) { } // Down e

Categories : CSS

Rotate 2D texture XNA
It is because the rotation is in radians. You can use MathHelper.ToRadians() to easily convert degrees to radians: see here spriteBatch.Draw(TexTiro, Position, null, Color.White, MathHelper.ToRadians(180), new Vector2(), Vector2.One, SpriteEffects.None, 0f);

Categories : C#

THREE.js can not rotate object
The problem is that you use the variable "object" in the animate function before it is initialized. Also the variable "object" has a scope limited to the callback function of the loader. You might want to read something about javascript variable scope. http://www.mredkj.com/tutorials/reference_js_intro_ex.html To solve your problem you might to change a few things. 1) Make the variable "object" global // Make object a global variable var camera, scene, renderer, object; 2) Do not call the animate function before the object is initialized init(); //animate(); 3) Do not use "var" inside callback function of the loader var loader = new THREE.OBJLoader(); loader.addEventListener( 'load', function ( event ) { //var object = event.content; object = event.content; var geom

Categories : Three Js

How to rotate gmaps?
Ok. This is not supported yet: http://code.google.com/p/gmaps-api-issues/issues/detail?id=2515 So I think I have to use Google Maps Android API v2.

Categories : Android

Something like Collections.rotate for map
There are 3 main, non-specialised, implementations of the Map interface in the JDK: HashMap which is not ordered - that is not going to help you TreeMap which is ordered based on some comparator - probably not easy to adapt to your use case LinkedHashMap which is ordered either by insertion order or by access order In your case, you could use a LinkedHashMap using access order (you create one with a special construtor with the parameter accessOrder set to true) and every time you access one of the items it will get reordered automatically to the tail of the map. A full iteration cycle will keep the order unchanged.

Categories : Java

How do I rotate an NSTextField on OS X?
You could use the underlying layer and rotate that myView.wantsLayer = YES; myView.layer.transform = CATransform3DMakeRotation(angle, 0, 0, 1); p.s. Remember to import QuartzCore

Categories : IOS

CSS3 Rotate from 0 to 90 then 90 to 180
If you just want it to stop after it rotates just remove the infinite modifier: http://jsfiddle.net/Ugc5g/30/ .image { position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; margin:-60px 0 0 -60px; -webkit-animation:spin 4s ease-in-out; // No more infinite -moz-animation:spin 4s linear; animation:spin 4s linear; } @-moz-keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } If you want to stop the animation at the increments it is a little harder: http://jsfiddle.net/Ugc5g/31/ .image { position: ab

Categories : CSS

rotate my ios app using UIInterfacOrientation
Here are macros UIDeviceOrientationIsLandscape and UIDeviceOrientationIsPortrait so rather checking separately you can do it like this ... if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) { // code for landscape orientation } OR if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)) { // code for Portrait orientation } After check the orientation. you can apply condition. and also please read autosizing

Categories : Iphone

A way to rotate plot in R
Just apply a rotation matrix to your data. angle <- pi/3 M <- matrix( c(cos(angle), -sin(angle), sin(angle), cos(angle)), 2, 2 ) plot( as.matrix(cars[,c("speed","dist")]) %*% M ) What happens may be clearer on a different example: library(mlbench) d <- mlbench.smiley()$x op <- par(mfrow=c(1,2)) plot(d, asp=1) plot(as.matrix(d) %*% M, col="red", asp=1) par(op)

Categories : R

How do you programmatically - or from CLI - rotate a PDF?
You can use pdfpages LaTeX package documentclass{article} usepackage{pdfpages} egin{document} includepdf[angle=45]{document.pdf} end{document} The LaTeX document above, compiled via pdflatex, produces a document rotated 45 degrees. There are also tools (wrappers of pdfpages) like pdfjam that can be used directly from command line: $ pdfjam --suffix rotated45 --angle 45 --fitpaper true document.pdf

Categories : PHP

How can I rotate different cards using CSS?
Your problem is you're using the same ID on the three inputs and labels. As per W3C spec, IDs must be unique on a page. And that's what the for attribute is expecting. So change your code to look like this: http://jsfiddle.net/GYatesIII/GZ8zr/4/

Categories : CSS

Rotate a PDF from InAppBrowser
I created a rotate button then added this below, .h //header - add 'int counter' @interface CDVInAppBrowserViewController : UIViewController <UIWebViewDelegate>{ @private NSString* _userAgent; NSString* _prevUserAgent; NSInteger _userAgentLockToken; CDVWebViewDelegate* _webViewDelegate; int counter; } .m //Add this to the top of the .m file #define DegreesToRadians(X) ((X) * M_PI / 180.0) ... //reference - (id)initWithUserAgent:(NSString*)userAgent prevUserAgent:(NSString*)prevUserAgent { counter = 0; ... //create Rotate Button NSString* rotateString = @"Rotate"; self.RotateButton = [[UIBarButtonItem alloc] initWithTitle:rotateString style:UIBarButtonItemStylePlain target:self action:@selector(goRotate:)]; self.RotateButton.enabled = YES; self.Rota

Categories : IOS

Rotate Element Within H2
Just like Christopher was suggesting, display: inline-block is the way to go: http://jsfiddle.net/X85b6/ <h2>Join<span>with<br />your</span>Family</h2> h2 { font-size: 60px; text-transform: uppercase; } h2 span { font-size: 15px; line-height: 16px; display: inline-block; position: relative; bottom: 5px; -webkit-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -ms-transform: rotate(-90deg); -o-transform: rotate(-90deg); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -ms-filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); }

Categories : CSS

Rotate a UIView in 2D, not 3D
Here's the answer from an Apple employee: When you set a transform the frame becomes less well-defined, to the point that you should no longer use it to size or position a view. Try using the center property instead, your probably not getting a 3D rotation, but a distortion due to the compounding effect of setting the frame and trnsform.

Categories : IOS

CSS Rotate in Not Working in IE
Try using this: -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')"; filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand');

Categories : CSS

How to rotate rows in sql
Is it that you want to set the value for row 1 to be the # of rows and all the other rows is simply one less than the current value? Seems like a couple of queries would be my suggestion. Update the row with the number - 1 first, and then fix the value for one by taking the count of the order numbers. Alternatively, you could set the value for 1 to be the max order number + 1, and then run the query to decrement all the values by one to get it to the right spot.

Categories : SQL

How to rotate GLSurfaceView?
Contrary to your expectation, methods of View doesn't work well. GLSurfaceView punches a hole to display underneath surface. Actually it has only transparent pixels. If you want to rotate your image, you have to use OpenGL operations.

Categories : Android

How to Rotate foscam in iOS application?
What you need is to use the decoder_control.cgi: Name: decoder_control.cgi Permission: operator Syntax: /decoder_control.cgi?command=[&next_url=] Parameters value description 0 up 1 Stop up 2 down 3 Stop down 4 left 5 Stop left 6 right 7 Stop right … Reserved 25 center 26 Vertical patrol 27 Stop vertical patrol 28 Horizon patrol 29 Stop horizon patrol … Reserved 94 IO output high 95 IO output low

Categories : IOS

IOS Need to rotate a Image and keep it there, with animation
I prefer to cover all my bases with CoreAnimation. Set the final value before the animation, set the fill mode, and set do not remove. - (void) runSpinAnimationOnView:(UIView*)view duration:(CGFloat)duration rotations: (CGFloat)rotations repeat:(float)repeat; { NSString * animationKeyPath = @"transform.rotation.z"; CGFloat finalRotation = M_PI * 2.0f * rotations; [view.layer setValue:@(finalRotation) forKey:animationKeyPath]; CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:animationKeyPath]; rotationAnimation.fromValue = @0.0f; rotationAnimation.toValue = @(finalRotation); rotationAnimation.fillMode = kCAFillModeBoth; rotationAnimation.removedOnCompletion = NO; rotationAnimation.duration = duration; rotatio

Categories : IOS

Rotate Between divs in javascript
Quick 'n' mucky solution using jQuery: function toggleDiv() { $('.slider div:last').show(); var $firstElement = $('.slider div:first').hide(); $('.slider').append( $firstElement ); } Best off using one of the myriad of carousels out there though as they will give you nice animations as well.

Categories : Javascript

How to rotate a compass after the last one is finished?
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { // [manager stopUpdatingHeading]; double rotation = newHeading.magneticHeading * 3.14159 / 180; [_compass_image setTransform:CGAffineTransformMakeRotation(-rotation)]; }

Categories : Iphone

Kivy how to rotate a picture
I think they are two ways of doing this. I'll post two answers and let others decide what is the right approach. I personally prefer this method because I think it's computational lighter. However, it is not that intuitive This method uses a RelativeLayout and two context instructions (Rotate and Translate). 1 - You need to embed the Image inside the RelativeLayout. Why? Because the way Rotate works is similar to putting a nail in the (0,0) coordinate, i.e. bottom-left corner. The RelativeLayout sets the 0,0 to the position of the Widget. 2- You will need to use the canvas 3- As I said before, the Rotate instruction is equivalent to put a nail in the (0,0) coordinate. Think about a piece of paper. If you put a nail in the corner the rotation is going to end on the left. So, before the

Categories : Python

Svg Rotate and Resize issue
The centre of the small rect is at a different position from the large rect. The small rect is effectively the left half of your big rect because you are only changing the width. When you resize the rect, you also need to reposition them so that their centres coincide. function decreaseRectsize() { var newRectWidth = 50; rectangle.setAttribute('width', newRectWidth); rectangle.setAttribute('x', 75); } function RestoreRectsize() { var newRectWidth = 100; rectangle.setAttribute('width', newRectWidth); rectangle.setAttribute('x', 50); }

Categories : Javascript

Rotate UIView while dragging
I must admit that I have very little experience working with UIPanGestureRecognizer, but I assume that it won't affect the answer. Nevertheless one solution could be to create a timer and make it run while the UIView is being dragged, the timer action would then make sure to update the rotation of the UIView properly and as often as possible. Another solution could be to subclass UIView and overwrite the drag-function (I do not know what it is called) and simply make it self adjust its rotation if any pivot point is given.

Categories : Iphone

Gradually rotate towards a direction
I would go with Marty's suggestion, use the smallestAngle function to determine which direction you should be rotating. Basically you can move some percentage of the smallestAngle during every frame update until the percentage of that smallestAngle is below some threshold (and have it "snap" the rest of the way). Something like //each time this is called it will get 1/4 closer, but never get to 0, hence the need for a threshold avoid paradoxes //http://en.wikipedia.org/wiki/Zeno's_paradoxes#Dichotomy_paradox var angleToMove:Number = smallestAngle()/4; //the divide by 4 here means get 1/4 of the angle gap closer each time this function is called, I assume this is on a timer or frame handler, making the 4 greater will make it follow more slowly, making it lower will make it follow more qu

Categories : Actionscript

rotate 3d pictures using javascript
http://www.uize.com/examples/3d-rotation-viewer.html Googled rotate 3d image javascript. View Source and copy Uize.js

Categories : Javascript

DIV listening to rotate once then nothing jQuery
So once you click, it runs your changetop function, which sets it to be rotated to 360 degrees. When you click it again, it runs the function again and sets it to be rotated to 360 degrees... but it's already rotated to 360 degrees! So it won't actually move anywhere. You'll need to reset it back to 0 degrees after it's spun. Or you could use CSS keyframing to describe a 360 degree rotation animation.

Categories : Javascript

Why does IE8 and below rotate the container but not the content?
Are you searching for the ms-writing-mode property? This should have support for at least IE8. I'm not quite sure about 7 and I don't have a browser to test it on.

Categories : CSS

Firemonkey Rotate Text
I assume this is because the text will rotate around the rectangle's TopLeft position No, the rotation is centered around the current origin of the canvas. By default, that is coordinate 0, 0, but could be altered by the currently set deformation matrix. The typical way to go is: choose a rotation center, move the origin to that center, rotate, move back to the changed origin, and then draw. See TControl.MatrixChanged for reference. But there are many other ways. Hereby an example of how to paint text from the lower left to the upper right within a form: procedure TForm1.FormPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); var Angle: Single; R: TRectF; S: String; H: Single; Matrix: TMatrix; begin Canvas.Fill.Color := TAlphaColors.Black; Angle := -ArcTa

Categories : Delphi

How do I rotate cols<->rows?
Something like this should work: var mydata = new IEnumerable<int>[] { Enumerable.Range(2, 3), Enumerable.Range(5, 5), Enumerable.Range(7, 6), Enumerable.Range(3, 2) }; var maxLength = mydata.Max(l => l.Count()); var rotated = from i in Enumerable.Range(0, maxLength) select from list in mydata select list.Skip(i).DefaultIfEmpty(-1).First(); Or in fluent syntax: var rotated = Enumerable.Range(0, maxLength) .Select(i => mydata.Select(l => l.Skip(i).DefaultIfEmpty(-1).First())); Now, this is not terribly efficient because it requires iterating each list numerous times. If you convert the input data to a list of arrays first, it should be a bit faster: var myarray = mydata.Select(l => l.ToArray()); var maxLength = myarray.Max(l => l.Len

Categories : Dotnet

Rotate TextButton with libgdx
The rotation methods on existing Actors should work. Probably worth asking another question to track that issue down. I see at least two problems: the default batch transorm matrix probably isn't the identity matrix. Maybe initialize rotationMatrix as a copy of oldMatrix? You're rotating around a really arbitrary vector (draw a line from the origin -- in the bottom left to the top-left corner of your button). Try Vector3(0, 1, 0).

Categories : Android

How to rotate a RelativeLayout by 180 degrees?
Very interesting question! You could perhaps try to create two partly transparant Activity-s, showing their own copy of the same layout xml and then switching the "z-order" of the active Activity depending on whos turn it is to make a move. Activity A would be "your own" activity and it would have a transparent top half and the RelativeLayout as it's bottom half. It would also have a normal screen orientation, like: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT). Activity B would be "your opponents activity". It would also have a transparent top half and a copy of the very same RelativeLayout as it's bottom part. It would however have an inverted screen orientation, like: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT). This would mean that t

Categories : Java



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