w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Concentric circles texture on RingGeometry
Go here http://jsfiddle.net/theo/VsWb9/ and replace geometry = new THREE.CubeGeometry(200, 200, 200); material = new THREE.MeshNormalMaterial(); mesh = new THREE.Mesh(geometry, material); with geometry = new THREE.TorusGeometry( 100, .5 , 50 ,50); material = new THREE.MeshNormalMaterial(); mesh = new THREE.Mesh( geometry, material ); If you want to change the ring color to say black for instance change material = new THREE.MeshNormalMaterial(); to material = new THREE.MeshBasicMaterial({color:0x000}); Stick any other material changes in that array input argument to the constructor function THREE.MeshBasicMaterial({arguments here})

Categories : Three Js

How to create concentric triangles with Cairo?
I think you need to calculate the vertices of new triangle whose sides are equidistant from the sides of the old triangle. Find unit vectors for adjacent triangle sides BD = BA / |BA|, BE = BC / |BC| ... (|BA| is length of vector BA) Find unit bisector BF = (BD + BE) / |BD + BE| Find final position of F point (bisector of needed length) BF = BF * NeededDistance / (BF x BE) ...(denominator is cross product, it is equal to Sin(ABC/2) Do the same for G and H vertices. Delphi code and result: var P, V: array[0..2] of TPoint; i, inext, iprev: Integer; nx, ny, px, py, mx, my, coeff: Double; distance: Integer; procedure NormalizeVector(var dx, dy: Double); var revlen: Double; begin revlen := 1.0 / Hypot(dx, dy); dx := dx * revlen; dy := dy * revlen; en

Categories : C

Creating Concentric Circles with JavaScript/jQuery
First off you are modifying your only existing circle repeatedly once per for loop. Second, every iteration you are setting the height and width to 40px. Third, you may want to use SVG graphics which offer native support for stuff like this. Here is an example with SVG: http://jsfiddle.net/5c6zy/1/ //HTML <svg id='circles' xmlns="http://www.w3.org/2000/svg" version="1.1"></svg> //Javascript var centerX = 250; var centerY = 250; for(var count = 0; count < 20; count++){ var radius = count * 10; makeAndPlaceCircle(radius); }; function makeAndPlaceCircle(r){ // thx m93a: http://stackoverflow.com/a/16489845/1380669 var circles = document.getElementById('circles'); //Get svg element var newElement = document.createElementNS("http://www.w3.org/2000/svg", 'circ

Categories : Javascript

Using JQuery .click and .toggle to contract and expand a concentric circle
According to the documentation, jquery.toggle() is used to show/hide elements, it does not work by toggling between two functions as you seem to intend (so what you were doing was toggling the visibility of the element, toggle comes with a shrinking animation before it hides and that is what you were seeing). Also, jquery.transition() doesn't exist, you probably wanted jquery.animate() instead. I've made an update to your code here http://jsfiddle.net/Ue9pu/4/. I've changed it so the toggling is done internally via a boolean value that alternates instead. Now you just need to get the animation right. var tog = false; $("#inner-circle").click(function () { if (tog) { $(this).animate({ "height": '1.0em', "width": '1.0em', "margin-t

Categories : Jquery

sin() cos() ring formula
sin and cos take radians as input, not degrees. You'll need to convert your angles to radians before passing them into sin and cos: X1 = WhSz * cos(a * 3.141592654 / 180.0);

Categories : C++

Cassandra ring configuration
Did you previously use any DSE components? If you did and are using the same data directory on any of your nodes, it may find old column families that were created with this compaction strategy. If you have no data you want in the data directories on all your nodes, you should clear them by stopping all nodes, deleting the directories, then starting the nodes. Or if you have any DSE nodes still up, they may be joining the new cluster and propagating their schema, so creating column families with this compaction strategy. You can find out by looking in the logs and seeing which nodes try to connect. If any aren't from your 1.2.8 ring then this is probably the cause.

Categories : Cassandra

Where is guest ring-3 code run in VM environment?
Let's talk about VMX, which is Intel VT-x's design. Intel VT-x introduces two new modes to solve this problem: VMX root mode and VMX non-root mode, which are for host and guest respectively. Both modes have ring 0~3, which means the host and guest will not share the same ring level. A hypervisor running in ring 3 of VMX root mode, when it decides to transfer the CPU control to a guest, the hypervisor lanuch VMLAUNCH instruction, which allows transfer to VMX non-root mode from VMX root mode. Then guest ring 3 code now is able to automatically executing in VMX non-root mode. All of this is supported by Intel VT-x. No binary translation or instruction emulation is needed for running guest. Of course ring 3 of VMX non-root mode has less privilege and power. For example, when a guest ring 3

Categories : Windows

Cassandra 1.2: new node does not want to joing the ring
This question seems to have been answered on Cassandra mailing list

Categories : Amazon

Static files with clojure and ring
I think what's happening here is that there's some code in wrap-resources here, specifically this line: (or ((head/wrap-head #(resource-request % root-path)) request) (handler request)))) What happens is that when built as a war file, it doesn't understand that WEB-INF/classes/ is the root of the path it should be using to serve up the static content. So it's looking for public/test.html somewhere else (perhaps the root of the .war?) and so this "or" is false so it falls through to calling the handler directly. I am not sure of a fix for this as I am not totally sure the internal working of how tomcat is handling this internally... that is, I dont know where it is looking to find the base path.

Categories : Clojure

Using LevelDB in a ring/compojure webapp
If you want a single global descriptor in your app, the simplest option might be to store a promise or delay in a top-level Var: (def level-db-descriptor (promise)) (defn open [...] ... (deliver level-db-descriptor ...)) (open ...) ;; or (def level-db-descriptor (delay (open ...))) Then say @level-db-descriptor when you need to get at it. This is not that great if you need to replace the descriptor occasionally; you can, however, support that too while preserving the @level-db-descriptor pattern of usage: (defprotocol PDescriptorBox (put-descriptor! [this d]) (get-descriptor [this])) (defn make-descriptor-box [] (let [box (clojure.lang.Box. nil)] (reify clojure.lang.IDeref (deref [this] (get-descriptor this)) PDescriptorBox (get-descriptor [t

Categories : Clojure

Create CSS3 ring with 60% a different colour
It seems to me that you almost have your answer. You could use pseudo-element and rotate to hide/show portion of borders to draw in between 0,25,50,75 and 100% overlapping borders by borders. http://codepen.io/gcyrillus/pen/JzmiE div { height:200px; width:200px; border:solid 5px black; background:#159; border-radius:100%; display:inline-block; margin:1em; position:relative; text-align:center; line-height:200px; color:white; font-size:2em; } div:before,div:after { content:''; position:absolute; top:-5px; left:-5px; border:solid 5px transparent; height:inherit; width:inherit; border-radius:inherit; } .c30, .c40, .c50 { border-left-color:tomato; border-bottom-color:tomato; } .c30:before { border-left-color:black; transform:rotate(18deg) } .

Categories : CSS

clojure, ring, tomcat and JSESSIONID
Ring uses its own session store. However, if you are using a Servlet container, Ring will populate the request map with the various Servlet objects. In this case, the :servlet-request key refers to the HttpServletRequest object. It's worth noting that Ring is an abstraction over HTTP, and doesn't necessarily rely on the Servlet specification. So as long as you use a Servlet container underneath, you should be able to use your Servlet sessions

Categories : Tomcat

Donut chart with partial ring around
I managed to get it working! I used startAngle, endAngle, innerRadius and outerRadius. Only the centering around the parent element isn't done yet. I just place the submenu always on top now. This is the result: Thanks for the help everyone!

Categories : D3 Js

Escalating to Ring 0 in Linux application
It is not possible to get a ring0 from user-space with standard linux kernel. And it's preferable to write a kernel module to do thinks you want. But if you really want to have a ring0 at user-space, I'll give you a start point. x86 processors stores Current Privilege Level in the two least significant bits of cs register. When new thread is created, Linux kernel checks whether this thread is user thread or kernel one and stores appropriate cs value for this task. (Proof: copy_thread() in arch/x86/kernel/process_32.c). So, you are able to get pointer to task registers with task_pt_regs() (arch/x86/include/asm/processor.h) macro and alter cs to set ring to 0 with regs->cs &= ~0x3; or something similar. But again, I strongly recommend you, don't do it.

Categories : Security

C# - Dictionary with Behaviour of a Ring List?
You won't find anything built-in I think but you can easily implement one using OrderedDictionary OrderedDictionary maintains items in order which they are inserted. Whenever you reach the limit/capacity you can remove the first item.

Categories : C#

Consistent hashing: Where is the data-structure of ring kept
I have found an answer to the question No 1. Answer 1: All the approaches are written in my blog: http://ivoroshilin.com/2013/07/15/distributed-caching-under-consistent-hashing/ There are a few options on where to keep ring’s data structure: Central point of coordination: A dedicated machine keeps a ring and works as a central load-balancer which routes request to appropriate nodes. Pros: Very simple implementation. This would be a good fit for not a dynamic system having small number of nodes and/or data. Cons: A big drawback of this approach is scalability and reliability. Stable distributed systems don’t have a single poing of failure. No central point of coordination – full duplication: Each node keeps a full copy of the ring. Applicable for stable networks. This option is us

Categories : Misc

Android ring shape for radio button
Here is some code for you..You can do something like this. If you have any problem then I can mail you whole project..Hope this helps you and others. !! res/drawable/red_ring.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerRadiusRatio="3" android:shape="ring" android:thickness="10dp" android:useLevel="false" > <solid android:color="#FF0000" /> <size android:height="30dp" android:width="30dp" /> </shape> res/drawable/blue_ring.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerRadiusRatio="3" android:shape="ring" android:thickness="5dp" android:useLevel="false" >

Categories : Android

Better codes for ring-finding program in python
You are trying to find cycles of size N in an undirected graph. You may find all cycles and then select the ones with right size. See this answer. Finding all cycles in undirected graphs

Categories : Python

keypress, keyup or keydown only work on the first ring in JQM
You are retrieving incorrectly the length of the user input. Use this: var tam = $(this).val().length; Here a working demo.

Categories : Javascript

how do i mock a json post request in ring?
tldr: (-> (session app) (request "/test/json" :request-method :post :content-type "application/json" :body (.getBytes ""hello"" "UTF-8"))) When peridot generates a request map it will default to application/x-www-form-urlencoded for the content-type for a :post request. With the app as specified wrap-params (which is included by compojure.handler/site) will attempt to read the :body in order to parse any form-urlencoded parameters. Then json-post attempts to read the :body again. However InputStreams are designed to be read once, and that causes the exception. There are basically two ways to solve the issue: Remove compojure.handler/site. Add a content type to the request (as done in the tldr)

Categories : Clojure

How to use ring buffer in embedded applications and guarantee integrity
Just disable the receive interrupt when you access protected variables (like the ringbuffer, the read and write position) outside the interrupt, so in your case when you need the number of bytes in the input buffer or you need to pop a byte: int GetBytesAvailable() { int result; DisableReceiveInterrupt(); result = writePos - readPos; EnableReceiveInterrupt(); if (result < 0) result += RINGBUFFER_SIZE; return result; } int GetNextByte() { int result = -1; DisableReceiveInterrupt(); if (readPos != writePos) { result = RingBuffer[readPos++]; readPos %= RINGBUFFER_SIZE; } EnableReceiveInterrupt(); return result; } When the microcontroller receives a byte while the interrupt is disabled. The interrupt han

Categories : C

Animate Android Ring Shape's sweep angle
Useful material: Android: looking for a drawArc() method with inner & outer radius Using PorterDuff Clear mode the inner can be "removed", leaving a doughnut shape. You can then use the Arc's sweep angle by redrawing through extending the Animation class.

Categories : Java

Ring buffer: Disadvantages by moving through memory backwards?
Does marching backwards through memory have a negative effect on the execution time due to cache misses (since memory cannot simply be read forward) Why do you think that you will have a cache miss? You will have a cache miss if you try to access outside the cache (forward or backward).

Categories : C++

Modal Indeterminate Progress Ring implementation in winjs
The progress bar does not force a "modal state" automatically. It's up to you to create a user experience that is "modal" and then uses the indeterminate progress ring to show the user that the application is busy and cannot be used right now. As shown in the documentation: Disable interaction during the task by disabling controls in the app bar and ignoring input in the content area. Your code is responsible for "disabling" the application appropriately during the busy state.

Categories : HTML

Generating PGP key ring using Bouncy Castle (C#) results in key ID FFFFFFFF
In case someone else finds this useful for using BouncyCastle with C# (I just needed to do the same as above, but the code sample above was incomplete so I whipped up my own amateurish edited version). NOTE: This code was compiled and tested with LinqPad void Main() { String Password = "hello world!"; String Identity = "Slim Shady"; PgpKeyRingGenerator krgen = generateKeyRingGenerator(Identity, Password); // Generate public key ring, dump to file. PgpPublicKeyRing pkr = krgen.GeneratePublicKeyRing(); BufferedStream pubout = new BufferedStream(new FileStream(@"c: empdummy.pkr", System.IO.FileMode.Create)); pkr.Encode(pubout); pubout.Close(); // Generate private key, dump to file. PgpSecretKeyRing skr = krg

Categories : C#

how draw ring with transparent internal background (corona sdk)
Try this local circle = display.newCircle (100,100,200) circle:setFillColor(0,0,0,0) --This will set the fill color to transparent circle.strokeWidth = 3 --This is the width of the outline of the circle circle:setStrokeColor(255,0,0) --This is the color of the outline

Categories : Lua

How Can I run more than one cassandra server in single machine and form one cluster ring?
I would like know is there any way to run the cassandra servers in a single machine ? There's always a way! There is an excellent tool available that allows you to configure a multi-node cluster locally, but it's currently not supported under windows. When you build a cluster and start it, it will configure the ring for you. You can check out the ring using ./nodetool -h 127.0.0.1 -p 7100 ring after it has started. *Just a side-note, the ccm tool starts the cluster as a background process.

Categories : Cassandra

Retrieve Timestamp of Deadlock in Extended Events Session Ring Buffer
Change this CAST(event_data.value('(event/@timestamp)', 'nvarchar(500)') AS datetime) AS [time], with this SELECT event_data.value('(/event/@timestamp)[1]','VARCHAR(50)') AS TS1, event_data.value('(/event/@timestamp)[1]','DATETIMEOFFSET') AS TS2, ... Results: TS1 TS2 ------------------------ ---------------------------------- 2013-07-23T17:49:46.072Z 2013-07-23 17:49:46.0720000 +00:00

Categories : SQL

jQuery Animation Triggered By User Interaction Depends on Previous Animation Completion
Hm... what about: stop(true,true)? See: http://api.jquery.com/stop/ var self = this; ... this.zoomIn = function() { var offset = $("#scrollable").stop(true,true).scrollTop(); self.increaseZoomLevel(); // Assume this sets the correct zoom level var newOffset = offset * self.zoomLevel(); $("#scrollable").animate({ scrollTop: newOffset }); };

Categories : Javascript

Should I animate a three dots loading animation using Core Animation or should I find a way to show a gif of the same operation?
For a simple animation you can use a UIImageView animation to animate a set of images (i.e. use the images as frames in the animation). UIImageView* dotsImageView= [[UIImageView alloc] initWithFrame:dotsFrame]; // load all the frames of your animation dotsImageView.animationImages = @[[UIImage imageNamed:@"image1.png"], [UIImage imageNamed:@"image2.png"], [UIImage imageNamed:@"image3.png"]]; // set how long it will take to go through all images dotsImageView.animationDuration = 1.0; // repeat the animation forever dotsImageView.animationRepeatCount = 0; // start the animation [dotsImageView startAnimating]; // add it to the view [self.view addSubview:dotsImageView]; If you don't want to use preset images for the dots

Categories : Iphone

[javascript, jQuery]How to wait for the animation to complete entirely before continuing another animation without callbacks
You cant do it without callback, but here a work arround. When calling the function, send selfCall as parameter: f[c].call(null, selfCall); c++; //null = this in function, but you don't use this. Then, in the go function, do this : function go(callback) { $("#foo").html("GO"); $("#foo").show("drop", 750).hide("explode", 500, callback); } Fiddle : http://jsfiddle.net/jmztZ/1/

Categories : Javascript

CALayer opacity animation works but bounds animation doesn't
Not knowing Ruby, I would suggest adjusting the frame rather than the bounds. The bounds are in the CALayers own coordinate system, and have no bearing on how the layer itself is displayed in the parent.

Categories : IOS

Changing Push ViewController animation to look like a "pop" animation, come in from left to right
You can create Segue type "Custom" on your stroyboard and create a new UIStoryboardSegue class named "popSegue" In the popSegue.m file add this: -(void)perform{ UIViewController *sourceViewContreoller = [self sourceViewController]; CATransition *animation = [CATransition animation]; [animation setType:kCATransitionFromLeft]; //or kCATransitionFromRight [animation setDuration:0.25]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseIn]]; [sourceViewContreoller.navigationController.view.layer addAnimation:animation forKey:@"animateOpacity"]; //or key=@"fadeTransition" [sourceViewContreoller.navigationController popViewControllerAnimated:YES]; [CATransaction commit]; } In the storyboard editor Select the s

Categories : Iphone

I have a php header for my site, with a css animation in it, but I don't want to animation to occur on certain pages
You could set a var in your main files which is picked up in the include. eg in index.php/pagetwo.php etc: $AnimateOrNot = 'yes'; include_once('header.php'); in header.php: if ($AnimateOrNot == 'yes) { // show animate } (This is how I set the meta title and keywords throughout sites I make) EDIT: Obviously check if the variables are set first, and anything else you need to do...etc ie if (isset($AnimateOrNot) && $AnimateOrNot == 'yes) { // show animate } This will mean if for any reason the var is not set there will be no PHP errors. It also means the default action in this case if it's not set or != to "Yes" will be not to show animation. Switch this if you want the default to show in case of missing var data etc. up to you.

Categories : PHP

Simple raphael.js animation which uses "animation.repeat" eats 100% cpu
I solved the problem by making two functions and using callbacks to call each other , thus creating an infinite loop. I suppose anim.repeat(Infinity) was going on creating many copies of the animations, thus slowing down the CPU.

Categories : Javascript

animation options not respected/error in second animation block
Don't chain animations like that. Use the lower-level CoreAnimation API to specify an animation with keyframes. Here's an example that mimics the way a UIAlertView appears on screen: CAKeyframeAnimation* bounceAnim = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; bounceAnim.duration = 0.4f; bounceAnim.values = @[ @0.01f, @1.1f, @0.9f, @1.f ]; bounceAnim.keyTimes = @[ @0.f, @0.5f, @0.75f, @1.f ]; bounceAnim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; bounceAnim.fillMode = kCAFillModeBoth; bounceAnim.removedOnCompletion = YES; [dialog.layer addAnimation:bounceAnim forKey:@"bounce"]; You'll want to modify it so that it loops, also tweak the values and timing to your liking. Check out the CAKeyframeAnimation documentation.

Categories : IOS

Stop previous animation before start of next animation in JQuery
Use .stop( [clearQueue ] [, jumpToEnd ] ) $(".pull_down").mouseover(function(){ $(this).stop(true, true).animate({top:'20px'}); }); $(".pull_down").mouseout(function(){ $(this).stop(true, true).animate({top:'-20px'}); });

Categories : Javascript

how to create sequential animation using AnimationDrawable and animation-list
Why didn't you use animation list for this? 4 dots as 1 image and each item in animation list as one frame in animation? Like this http://android-er.blogspot.com/2012/01/create-frame-animation-with.html

Categories : Java

UIView Flip Animation with Core Animation
A quick tip about the flip animation in iOS -- the system needs time to render the back view (the one that will be flipped to) before you start the flip animation. So if you try to change the contents of that view, and trigger off the flip animation in the same method, you will have problems. To get around this, I've had success with code like this: - (void)flipView { // Setup the view for the back side of the flip [self performSelector:@selector(performFlip) withObject:nil afterDelay: 0.1]; } - (void)performFlip { [UIView transitionWithView: tileToFlip duration: 0.5 options: UIViewAnimationOptionTransitionFlipFromLeft animations:^{ // My flip specific code }

Categories : IOS

toggleClass animation not working? or need help toggling animation
toggleClass can be used to add / remove a class / classes on a toggle. is margin-left260 a class in your css i.e. .margin-left260 { margin-left:260px; } also looking at your code, i think you are not implementing toggleClass correctly. see : http://api.jquery.com/toggleClass/ are you trying to animate the movement? I think the correct code would be use the animate function - see : http://api.jquery.com/animate/

Categories : Jquery



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