Changing axes units

I have plotted a graph in mathematica, where the x axis is in seconds. I want to scale the axis so it displays years instead.

My plotting function is as follows:

Plot[sol1[t], {t, 0, 1 * 10^(16)},    PlotRange -> All    FrameLabel -> {"Time (s)", "Velocity (ms-1)"},    PlotStyle -> {Red, Thickness[0.01]}] 

Any help would be appreciated.

How to manage page caching to serve different AdSense units for Mobile and Desktop

I’m trying to cache the pages of my website, which are responsive and show the same contents for Desktop and for Mobile, with the exception of the location of the AdSense units if the visit is from Desktop or from Mobile:

  • for Desktop, I place the first ad (a 728×90 banner) just under the page title
  • for Mobile, the first ad is a below-the-fold 300×250 unit

The rest of the HTML contents are identical, except the AdSense code for the first ad. So I cannot cache the pages and I must query the database with the consequent load increment.

I wondered if any of you had similar experiences. Would you place the same AdSense code (e.g. responsive units) for the first ad (for both Desktop and Mobile), just in the below-the-fold of the mobile pages?

Plotting data from a list of rules, infer axis titles from the rules with units

I have data, with units, organized as a list of rules; this is so I can slice the data in different ways based on the variables represented.

I’m trying to find the most direct way to plot this and get axis titles with both the variable from the rule and unit from the values. I don’t want to manually label the plots each time, so if Plot doesn’t have a built-in then how can I write a function to do the inference? I’m looking for the most DRY approach possible.

This gives me the units, but not the variable names, in the labels:

data = {    y -> {0, 33.2} (Quantity[1, ("KipsForce")/("Inches")^2]),    x -> {0, 6} 10^-4    }; ListLinePlot[Transpose@({x, y} /. data), AxesLabel -> Automatic] 

On the same example, is it possible to retain units like "in/in"? I’ve done this by manually specifying the labels and using HoldForm to avoid evaluating the cancellation, but I can’t get that to work with automatic labels as above.

Comparison of tagged units

Consider this data set:

BNikkei = {{10.0032, 27 Days}, {10.0527, 22 Days}, {10.1283, 18 Days}} 

from a recent question, “More effective way to apply a function in one member of a pair ..”

How to get Select[ to work for #[[2]] < 22 Days? I tried:

Select[BNikkei, #[[2]] < (22 Days) &] (* {} *) 

Units in MMA are a great convention. I can’t seem to find too much in manuals, on this situation. Unless, I have to derive comparison functions, for my own types??? Thanks in advance.

RTS Pathfinding without collision between units Options

Ever since I made my units move to a certain location a problem has popped up that of course if I try to make two or more units go to the same place they fight for the same spot. Am I just being stupid and unity already has a way around this or do I need to do something specific? I have looked into flow field path finding but no way on how to implement it. I dont want to have to use a ready made script but some pointers and other options are more than welcome.

AdSense units don’t respect CSS margin rules

I just noticed that on sites with “auto ads” enabled, auto-placed AdSense units don’t follow CSS rules regarding margin or padding in mobile view. They display across the entire viewport instead of allowing margin. The issue is not really applicable on desktop because ads rarely run border to border down to the pixel. But it does interfere with the design of mobile pages. See example below.

html{     padding:15px; }  body{     margin:15px;   } 

https://i.imgur.com/7FdOyc8.png

As you can see, the ad is sticking out outside the allowable margin on the left and the right, unlike the element above it. All elements on the page obey these rules except Google’s AdSense units. Again, these ads are in “auto” mode, which means you place one line of javascript in the <head> section of your HTML, and Google’s algorithms choose the sizing and placement of the ad units.

Is there a way to force margins on these units?

AdSense units don’t respect CSS margin rules

I just noticed that on sites with "auto ads" enabled, auto-placed AdSense units don't follow CSS rules regarding margin or padding in mobile view. They display across the entire viewport instead of allowing margin. The issue is not really applicable on desktop because ads rarely run border to border down to the pixel. But it does interfere with the design of mobile pages. See example below.

    html{         padding:15px;     }      body{         margin:15px;       }
Code (markup):

AdSense units don't respect CSS margin rules

Does is break SRP to keep incompatible physical units and quantities together in the same class, where quantities describe an object?

I want to design a Crate object. A crate is a wooden box that stores things. I need to be able to keep track of of the following things in regards to this crate:

  • length in inches
  • width in inches
  • height in inches
  • weight in pounds
  • price of crate in dollars

My question

can I store all of the above in the same class? Does it break SRP if I store the quantities in the same class?

An alternative, for example will be to break up the class into 3:

  • CrateDimensions (length, width, height)
  • CrateWeight (weight)
  • CratePrice (price)

My specific use case is as follows: I have various many products that can be put into the crate. Based on those products I have code that creates the crate – sets up initial dimensions and weight of the product inside the crate, and if more product is added, the crate dimensions are adjusted, as well as the weight. Price is something that is not currently added, but will be added later.

Less adsense units for better revenue?

Hello folkssss

I want to ask and to see what you people think,about one or more adsense ads on website. Is it true if i put example 3 ads on page that i will earn less then with only one ad?
I am testing this days about this thing. I have before 2 days example 3 ads on my page but clicks are small amount,when i put only one click is much better. What is your experience people did is better to have one Ad unit or more,i mean what is the best combination.

Now i am little bit confused how to…

Less adsense units for better revenue?

In Tomasulo’s algorithm, how do reservation stations recognise which results are directed to them, especially where functional units are pipelined?

I am currently researching instruction level parallelism in CPUs and have come across Tomasulo’s algorithm for dynamic scheduling.

As I understand it so far, once a functional unit computes a result, it is sent on the CDB from which it can be received by reservation stations waiting for this result. How do these reservation stations recognise that the result is one they are waiting for? I assume results sent on the CDB are tagged with the ID of the reservation station involved in computing them, but then how is this implemented where the functional units are pipelined or there are multiple reservation stations per functional unit? Is the ID of the reservation station corresponding to the instruction being executed passed through the functional unit’s pipeline to be used as a tag when the result is sent?