text:
Q: Error creating bean . Unsatisfied dependency expressed through constructor parameter 0; Now get this error:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-06-24 15:55:37.651 ERROR 6924 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deliveryController' defined in file [D:\Max\JavaWorks\Diplom\OnlineShop\target\classes\com\maximmalikov\onlineshop\rest\DeliveryController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deliveryService' defined in file [D:\Max\JavaWorks\Diplom\OnlineShop\target\classes\com\maximmalikov\onlineshop\service\DeliveryService.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ordersRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract com.maximmalikov.onlineshop.domain.Orders com.maximmalikov.onlineshop.repository.OrdersRepository.getByUserId(com.maximmalikov.onlineshop.domain.Users)! No property userId found for type Orders! Did you mean 'users'?
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:732) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
    at...

Process finished with exit code 0

My pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.maximmalikov</groupId>
    <artifactId>onlineshop</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>onlineshop</name>
    <description>Onlineshop project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

The main class, the class of service and the class of the controller with the repository:
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, WebMvcAutoConfiguration.class})
@SpringBootApplication
public class OnlineshopApplication {

    public static void main(String[] args) {
        SpringApplication.run(OnlineshopApplication.class, args);
    }

}

@Repository
public interface OrdersRepository extends JpaRepository<Orders,Long> {

    Orders getByOrderNumber(long orderNumber);

    Orders getByOrderDate(Date orderDate);

    Orders getByGoodsProductId(Goods productId);

    Orders getByGoodsProductName(Goods productName);

}

   @Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrdersService {

    private final OrdersRepository ordersRepository;

    private final GoodsRepository goodsRepository;

    private final UsersRepository usersRepository;

    private final DeliveryRepository deliveryRepository;

    private OrdersDTO fromOrders(Orders order) {
        if (order != null) {
            return OrdersDTO.builder()
                    .orderNumber(order.getOrderNumber())
                    .orderDate(order.getOrderDate())
                    .orderTime(order.getOrderTime())
                    .orderStatus(order.getOrderStatus())
                    .paymentMethod(order.getPaymentMethod())
                    .goods(order.getGoods() != null
                            ? order.getGoods().stream()
                            .map(Goods::getProductId)
                            .collect(Collectors.toList())
                            : null)
                    .users(order.getUsers() != null
                            ? order.getUsers().stream()
                            .map(Users::getUserId)
                            .collect(Collectors.toList())
                            : null)
                    .delivery(order.getDelivery().getOrderNumber())
                    .build();
        }
        return null;
    }

    private Orders fromDTO(OrdersDTO ordersDTO) {
        if (ordersDTO != null) {
            return Orders.builder()
                    .orderNumber(ordersDTO.getOrderNumber())
                    .orderDate(ordersDTO.getOrderDate())
                    .orderTime(ordersDTO.getOrderTime())
                    .orderStatus(ordersDTO.getOrderStatus())
                    .paymentMethod(ordersDTO.getPaymentMethod())
                    .goods(ordersDTO.getGoods() != null
                            ? goodsRepository.findAllById(ordersDTO.getGoods())
                            : null)
                    .users(ordersDTO.getUsers() != null
                            ? usersRepository.findAllById(ordersDTO.getUsers())
                            : null)
                    .delivery(ordersDTO.getDelivery() > 0L
                            ? deliveryRepository.getOne(ordersDTO.getDelivery())
                            : null)
                    .build();
        }
        return null;
    }

    public List<OrdersDTO> getAllOrders() {
        return ordersRepository.findAll().stream()
                .map(this::fromOrders)
                .collect(Collectors.toList());
    }

    @Transactional
    public OrdersDTO addOrder(OrdersDTO ordersDTO) {
        if (!ordersRepository.existsById(ordersDTO.getOrderNumber())) {
            return fromOrders(ordersRepository.saveAndFlush(fromDTO(ordersDTO)));
        }
        return null;
    }

    @Transactional
    public void deleteByOrderNumber(long orderNumber) {
        if (ordersRepository.existsById(orderNumber)) {
            ordersRepository.deleteById(orderNumber);
        }
    }

    @Transactional
    public OrdersDTO updateOrder(OrdersDTO ordersDTO) {
        if (ordersRepository.existsById(ordersDTO.getOrderNumber())) {
            Orders ordersTemp = ordersRepository.getOne(ordersDTO.getOrderNumber());
            ordersTemp.setOrderDate(ordersDTO.getOrderDate());
            ordersTemp.setOrderTime(ordersDTO.getOrderTime());
            ordersTemp.setOrderStatus(ordersDTO.getOrderStatus());
            ordersTemp.setPaymentMethod(ordersDTO.getPaymentMethod());
            return fromOrders(ordersRepository.saveAndFlush(ordersTemp));
        }
        return null;
    }

    public OrdersDTO getByOrderNumber(long orderNumber) {
        if (ordersRepository.existsById(orderNumber)) {
            return fromOrders(ordersRepository.getByOrderNumber(orderNumber));
        }
        return null;
    }

    public OrdersDTO getByOrderDate(Date orderDate) {
        return fromOrders(ordersRepository.getByOrderDate(orderDate));
    }

    public OrdersDTO getByProductId(Goods product) {
        return fromOrders(ordersRepository.getByGoodsProductId(goodsRepository.getByProductId(product.getProductId())));
    }

    public OrdersDTO getByProductName(Goods product) {
        return fromOrders(ordersRepository.getByGoodsProductName(goodsRepository.getByProductName(product.getProductName())));
    }

}

   @RestController
@RequestMapping("/orders")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrdersController {

    private final OrdersService ordersService;
    private final GoodsRepository goodsRepository;

    @GetMapping
    public List<OrdersDTO> getAll() {
        return ordersService.getAllOrders();
    }

    @PostMapping
    public ResponseEntity<OrdersDTO> addOrder(@RequestBody OrdersDTO ordersDTO) {
        OrdersDTO ordersDTO1 = ordersService.addOrder(ordersDTO);
        return ResponseEntity.ok(ordersDTO1);
    }

    @DeleteMapping("/{order_number}")
    public ResponseEntity<Void> deleteOrder(@PathVariable(value = "order_number") long orderNumber) {
        try {
            ordersService.deleteByOrderNumber(orderNumber);
            return ResponseEntity.ok().build();
        } catch (Exception e) {
            return ResponseEntity.badRequest().build();
        }
    }

    @PutMapping
    public ResponseEntity<OrdersDTO> updateOrder(@RequestBody OrdersDTO ordersDTO) {
        OrdersDTO ordersDTO1 = ordersService.updateOrder(ordersDTO);
        return ResponseEntity.ok(ordersDTO1);
    }

    @GetMapping("/{order_number}")
    public ResponseEntity<OrdersDTO> getOrderByNumber(@PathVariable(value = "order_number") long orderNumber) {
        return ResponseEntity.ok(ordersService.getByOrderNumber(orderNumber));
    }

    @GetMapping("/{order_date}")
    public ResponseEntity<OrdersDTO> getOrderByDate(@PathVariable(value = "order_date") Date orderDate) {
        return ResponseEntity.ok(ordersService.getByOrderDate(orderDate));
    }

    @GetMapping("/goods/{product_id}")
    public ResponseEntity<OrdersDTO> getOrderByProductId(@PathVariable(value = "product_id") long productId) {
        return ResponseEntity.ok(ordersService.getByProductId(goodsRepository.getByProductId(productId)));
    }

    @GetMapping("/goods/{product_name}")
    public ResponseEntity<OrdersDTO> getOrderByProductName(@PathVariable(value = "product_name") String productName) {
        return ResponseEntity.ok(ordersService.getByProductName(goodsRepository.getByProductName(productName)));
    }

}

Configuring the Database Connection in application.properties:
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/onlineshopbd?useSSL=false
spring.datasource.username=root
spring.datasource.password=malikovmaxim1997

spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
spring.jpa.open-in-view = true

The project was configured with Spring-Boot, and the configurations are all configured solely by means of annotations, that is, I've seen a lot of same problems on the Internet, but all the bin settings are configured in xml files.  This approach is not suitable for this project.  Help to understand this error, and how to adjust in that case bins, without using xml.

A: Looking at you pom.xml I noticed you have spring-boot-starter-data-jpa as well as hibernate-entitymanager version 5.2.17.Final
spring-boot-starter-data-jpa will pull in all the hibernate dependencies you need
So remove this dependency from pom.xml and it should work
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>5.2.17.Final</version>
    </dependency>

Edit 1:
Change this
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CharacteristicsService {

    private final GoodsRepository goodsRepository;

to
 @Service
 public class CharacteristicsService {

      @AutoWired
      private final GoodsRepository goodsRepository;

and also
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, WebMvcAutoConfiguration.class})
@SpringBootApplication
public class OnlineshopApplication {

I don't know why you have excluded @EnableAutoConfiguration but you can try this

A: Everything worked, thank you all for your help.  I solved the problem by removing the @EnableAutoConfiguration exceptions.  And in OrdersRepository there was an incorrectly written method, which needed to be removed from the service and the controller, respectively.

A: dude, it looks like ur missing some spring annotation, in my case it was a simple @Repository marker on my repository class...
I have found some information here:
https://www.baeldung.com/spring-unsatisfied-dependency
have another situation when u have more than one bean that satisfy an operation..
for this case u can add this annotation in ur application class:
@SpringBootApplication
@ComponentScan(basePackages = {"com.example.demo.yourpackage"}) //this line**
public class SpringDependenciesExampleApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringDependenciesExampleApplication.class, args);
    }
}


text:
Q: Geometric rotation of font character in canvas I have this codepen, and what i would like to do is to smoothly rotate each font character on its centerpoint while it translate. I'm very new to the canvas world and i don't really know how to achieve that.
I tried like this, but its seems to act strangely :
Draw: function () {
                //tried to add this line :
               context.rotate(Math.PI / 4);

                context.font = this.size + "px FontAwesome";
                context.fillStyle = this.color;
                context.strokeStyle = this.color;
                if (this.id % 2 == 0) {
                    context.fillText(this.icon, this.x, this.y);
                } else {
                    context.strokeText(this.icon, this.x, this.y);
                }
            }

Any ideas ? Is it possible for each character to have its own rotation speed too ?

A: By default, text is drawn with textAlign='start' and textBaseline='alphabetic'.  So fillText("g",20,50) draws your single character flush left (at x=20) and allows character descenders to drop below y=50.
If you want to draw your text centered at a specified [x,y] you can set textAlign and textBaseline.
// text will be horizontally centered around the specified x in filltext
textAlign='center';

// text will be vertically centered around the specified y in filltext
textBaseline='middle';

To rotate a character:

*

*context.translate to the desired center x,y.

*context.rotate to the desired angle.

*context.fillText(yourCharacter,0,0) to draw the character on the canvas. You draw at 0,0 because you've already moved the origin to x,y with the context.translate command.

You can use requestAnimationFrame to animate the rotation of your character.
Put the code that rotates your character into a function: function rotateCharacter(). Send in arguments needed to center and rotate the character: character, centerX, centerY, radianAngle.
Then create another function that animates your character's rotation: function animate()
Inside the animation function:

*

*Clear the canvas: context.clearRect,

*Call the rotation function to draw the rotated character,

*Update the rotation angle for the next animation frame

*Request that the animation continue: requestAnimationFrame
Here's example code and a Demo:

// canvas vars
var canvas=document.getElementById("canvas");
var ctx=canvas.getContext("2d");
var cw=canvas.width;
var ch=canvas.height;

// set canvas text styling
ctx.font='30px verdana';
ctx.textAlign='center';
ctx.textBaseline='middle';

// character vars
var character='M';
var centerX=50;
var centerY=50;
var radianAngle=0;

// start animating
requestAnimationFrame(animate);

function rotateCharacter(text,centerX,centerY,radianAngle){
    // translate to the centerpoint you desire to rotate around
    ctx.translate(20,50);
    // rotate by the desired angle
    ctx.rotate(radianAngle);
    // draw the text on the canvas
    ctx.fillText('M',0,0);
    // always clean up -- reset transformations to default
    ctx.setTransform(1,0,0,1,0,0);
}

function animate(time){
    // clear the canvas
    ctx.clearRect(0,0,cw,ch);
    // draw the character rotated & centered at centerX,centerY
    rotateCharacter(character,centerX,centerY,radianAngle);
    // update the rotation angle for next time
    radianAngle+=Math.PI/45;
    // request another animation frame
    requestAnimationFrame(animate);
}
body{ background-color: ivory; }
#canvas{border:1px solid blue; margin:0 auto; }

A character rotating around a specified centerpoint

<canvas id="canvas" width=300 height=300></canvas>

redpajama_set_name: RedPajamaStackExchange


text:
Q: arc4random() efficiency breaks? Kind of an oddball question here but should be pretty basic for someone familiar with the implementation of arc4random.
Does it use an appropriate integer based on the number you use after the modulo? Example it would use int for a number |255| or a long int for a number |2147483647| or does it just use something completely different implementation?
I don't really need a huge number but I wouldn't mind using as large of pool as I can without a hit to performance. So that's my reason for asking about this.

A: arc4random() and arc4random_uniform(UInt32) both return UInt32, so the size of the number you'll get is limited by that.  I think that's actually something over 2 billion.


text:
Q: Puppet: Making a custom function depend on a resource I have a Puppet custom function that returns information about a user defined in OpenStack's Keystone identity service.  Usage is something along the lines of:
$tenant_id = lookup_tenant_by_name($username, $password, "mytenant")

The problem is that the credentials used in this query ($username) are supposed to be created by another resource during the Puppet run (a Keystone_user resource from puppet-keystone). As far as I can tell, the call to the lookup_tenant_by_name function is being evaluated before any resource ordering happens, because no amount of dependencies in the calling code is able to force the credentials to be created prior to this function being executed.
In general, it is possible to write custom functions -- or place them appropriately in a manifest -- such that they will not be executed by Puppet until after some specified resource has been instantiated?

A: Short answer: You cannot make your manifest's behavior depend on resources declared inside of it.
Long answer: Parser functions are called during the compilation phase (on the master if you use one, or the agent if you use puppet apply). In neither case can it ever run before any resource is synced, because that will happen after the compiler has done all its work (including invocation of your functions).
To query information from the agent machine, you generally want to use custom facts. Still, those will be populated before even the compiler run.
Likely the best approach in this situation is to make the manifest tolerate the absence of the information, so that anything that depends on the value that your lookup_tenant_by_name function returns will only be evaluated if that value is available. This will usually be during the second Puppet run.
if $tenant_id == "" {
  notify { "cannot yet find tenant $username": }
}
else {
  # your code using the tenant ID
}


text:
Q: How to change default downloader on Firefox I want to change default downloader of Firefox because it is very slow. I want to set uGet. I installed uGet downloader, but when I click some download link it start with Firefox's own downloader. What do I have to do?

A: The following info is outdated, please see "Update" at the bottom
You may use the "uGet Integration" extension by Gobinath to replace the default download manager by uGet.
This extension requires "uGet Chrome Wrapper" package to be installed. To install the package from Gobinath's PPA run the following commands first:
sudo add-apt-repository ppa:slgobinath/uget-chrome-wrapper
sudo apt update
sudo apt install uget-chrome-wrapper

Then install the extension from here. Once it is installed, click on the uGet icon and toggle on "Interrupt downloads":

(screenshot source: uGet Integration's homepage at addons.mozilla.org)

Update:
In 2018, uget-chrome-wrapper has been adopted by uGet team as an official add-on and renamed uget-integrator and so uget-chrome-wrapper is discontinued. Therefore, uninstall uget-chrome-wrapper and install uget-integrator.
To remove uget-chrome-wrapper, run
sudo apt remove uget-chrome-wrapper

To remove Gobinath's old PPA, run
sudo add-apt-repository --remove ppa:slgobinath/uget-chrome-wrapper
sudo apt update

Then add the new PPA for uGet Team by running
sudo add-apt-repository ppa:uget-team/ppa
sudo apt update

Finally, install uget-integrator by running
sudo apt install uget-integrator

Also update the Firefox add-on to version 2.1.2 or later.

A: Just install DownloadThemAll Firefox AddOn and enjoy!!!!
is the fastest and easiest way to download high speed with more segments
I even use it on My Mac rather than other downloads software


text:
Q: WP7 Music+Video hub integration possibilities Is there currently a way for my WP7 app to:

*

*Scan for available audio files, that have been transferred to the phone via Zune?

*Start a playback of a selected audio file from within my app's UI, but still have an ability to "record to a file" the point, at which the playback was ended (or paused), so I would be able to allow the user to resume at the same point?

A: *

*You can use the MediaLibrary to find the songs/albums that's available on the phone.

*You'll use the integrated player for playing music, so if the user pauses the play, the user can simply use the standard music interface to resume play. It's not the task of your application.


text:
Q: Using "If" statements in Python 3 and other rows from other columns to produce value of other column Regards,
Forgive me if this question appears to be a duplicate, but I couldn't find an answer to existing questions that matches my exact requirements:
I would like to use the row values from other columns to produce the row value of a column. To do this, I have produced a helper function, "f":
def f(row):

    if row['column1'] == 3:
        val = 0

    if row['column2'] <= 5:
        if row['column3'] <= 4:
            if row['column4'] >= 3:
                val = 3

    if row['column5'] == 2:
        val = 5

    if row['column6'] == 0:
        if row['column7'] <= 0:
            if row['column8'] <= -1:
                val = 4

    else:
        val = 9

    return val

I applied my helper function to my dataframe as follows:
df['column12'] = df.apply(f, axis=1)

This produced the error code:

UnboundLocalError: ("local variable 'val' referenced before
  assignment", 'occurred at index 0')

Where am I going wrong?

A: These two ifs are failing after entering once and hence your val value never gets initiliazed and hence the error.
if row['column2'] <= 5:
        if row['column3'] <= 4:
            if row['column4'] >= 3:
                val = 3

if row['column6'] == 0:
        if row['column7'] <= 0:
            if row['column8'] <= -1:
                val 4

For this to fix, declare and initialize  val in the beginning of the function.


text:
Q: Remove the space between bars and axis I am using pgfplots to create a y bar chart.
I would like to remove the space marked in red, between the bars and the axis/the right border. These are stacked bar charts which are "clustered" using a trick I found here.
I thought by setting the bar width to 6pt it would remove the spaces, but it doesn't, it just overlaps every bar.
Also, any idea, on how to make a nice looking grid to improve clarity?
This is the code:
\documentclass{article}
\usepackage{pgfplots}
\usepackage{color}
\usepackage{pdflscape}
\definecolor{amber}{rgb}{1.0, 0.75, 0.0}%
\definecolor{bluegray}{RGB}{1, 171, 170}%
\definecolor{neuesrot}{RGB}{207, 103, 102}%
\definecolor{ultramarin}{RGB}{40, 109, 168}%
\definecolor{hellesgrau}{RGB}{216, 216, 216}%
\begin{document}
\begin{landscape}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[height=9cm, bar shift=-3pt, width=20cm, bar width=5pt, ybar stacked, ymax=47, ymin=1, xtick=data, ytick={5,10,15,20,25,30,35,40,47}, x tick label style={font=\tiny, rotate=75, anchor=east}, legend style={at={(0.5,-0.50)},anchor=north}, legend columns=-1, symbolic x coords={BGH\_0.65\_1\_160 B-1,
BGH\_0.65\_1\_160 B-2,
BGH\_0.65\_1\_190 B-3,
BGH\_0.65\_1\_190 B-4,
BGH\_0.8\_1\_160 B-5,
BGH\_0.8\_1\_160 B-6,
BGH\_0.8\_1\_190 B-7,
BGH\_0.8\_1\_190 B-8,
BGH\_0.65\_2.2\_160 B-9,
BGH\_0.65\_2.2\_160 B-10,
BGH\_0.65\_2.2\_190 B-11,
BGH\_0.65\_2.2\_190 B-12,
BGH\_0.8\_2.2\_160 B-13,
BGH\_0.8\_2.2\_160 B-14,
BGH\_0.8\_2.2\_190 B-15,
BGH\_0.8\_2.2\_190 B-16,
BGH\_0.65\_2.2\_160\_2.V B-20,
BGH\_0.65\_2.2\_190\_2.V B-21,
BGH\_0.65\_2.2\_190\_2.V B-22,
BGH2\_0.65\_1\_190 B2-01,
BGH2\_0.65\_1\_190 B2-02,
BGH2\_0.65\_1\_160 B2-03,
BGH2\_0.65\_1\_160 B2-04,
BGH2\_0.8\_1\_190 B2-05,
BGH2\_0.8\_1\_190 B2-06,
BGH2\_0.8\_1\_160 B2-07,
BGH2\_0.8\_1\_160 B2-08,
DEW\_0.65\_1\_160 D-02,
DEW\_0.65\_1\_190 D-03,
DEW\_0.65\_1\_190 D-04,
DEW\_0.8\_1\_160 D-05,
DEW\_0.8\_1\_160 D-06,
DEW\_0.8\_1\_190 D-07,
DEW\_0.8\_1\_190 D-08,
DEW\_0.65\_2.2\_160 D-09,
DEW\_0.65\_2.2\_160 D-10,
DEW\_0.65\_2.2\_190 D-11,
DEW\_0.65\_2.2\_190 D-12,
DEW\_0.8\_2.2\_160 D-13,
DEW\_0.8\_2.2\_160 D-14,
DEW\_0.8\_2.2\_190 D-15,
DEW\_0.8\_2.2\_190 D-16,
DEW\_0.65\_1\_160 D-17,
DEW\_0.65\_2.2\_160\_2.V D-19,
DEW\_0.65\_2.2\_190\_2.V D-21,
DEW\_0.65\_2.2\_190\_2.V D-22,
},
    legend entries={Schädigungsstufe A,Schädigungsstufe B,Schädigungsstufe D,Schädigungsstufe E}
]
\addplot +[fill=bluegray, draw=black] coordinates {(BGH\_0.65\_1\_160 B-1,18)
(BGH\_0.65\_1\_160 B-2,14)
(BGH\_0.65\_1\_190 B-3,20)
(BGH\_0.65\_1\_190 B-4,18)
(BGH\_0.8\_1\_160 B-5,10)
(BGH\_0.8\_1\_160 B-6,8)
(BGH\_0.8\_1\_190 B-7,4)
(BGH\_0.8\_1\_190 B-8,5)
(BGH\_0.65\_2.2\_160 B-9,0)
(BGH\_0.65\_2.2\_160 B-10,2)
(BGH\_0.65\_2.2\_190 B-11,3)
(BGH\_0.65\_2.2\_190 B-12,3)
(BGH\_0.8\_2.2\_160 B-13,1)
(BGH\_0.8\_2.2\_160 B-14,2)
(BGH\_0.8\_2.2\_190 B-15,2)
(BGH\_0.8\_2.2\_190 B-16,2)
(BGH\_0.65\_2.2\_160\_2.V B-20,2)
(BGH\_0.65\_2.2\_190\_2.V B-21,1)
(BGH\_0.65\_2.2\_190\_2.V B-22,1)
(BGH2\_0.65\_1\_190 B2-01,0)
(BGH2\_0.65\_1\_190 B2-02,6)
(BGH2\_0.65\_1\_160 B2-03,8)
(BGH2\_0.65\_1\_160 B2-04,5)
(BGH2\_0.8\_1\_190 B2-05,1)
(BGH2\_0.8\_1\_190 B2-06,2)
(BGH2\_0.8\_1\_160 B2-07,5)
(BGH2\_0.8\_1\_160 B2-08,3)
(DEW\_0.65\_1\_160 D-02,23)
(DEW\_0.65\_1\_190 D-03,24)
(DEW\_0.65\_1\_190 D-04,28)
(DEW\_0.8\_1\_160 D-05,16)
(DEW\_0.8\_1\_160 D-06,9)
(DEW\_0.8\_1\_190 D-07,10)
(DEW\_0.8\_1\_190 D-08,12)
(DEW\_0.65\_2.2\_160 D-09,4)
(DEW\_0.65\_2.2\_160 D-10,5)
(DEW\_0.65\_2.2\_190 D-11,8)
(DEW\_0.65\_2.2\_190 D-12,2)
(DEW\_0.8\_2.2\_160 D-13,1)
(DEW\_0.8\_2.2\_160 D-14,2)
(DEW\_0.8\_2.2\_190 D-15,5)
(DEW\_0.8\_2.2\_190 D-16,3)
(DEW\_0.65\_1\_160 D-17,20)
(DEW\_0.65\_2.2\_160\_2.V D-19,2)
(DEW\_0.65\_2.2\_190\_2.V D-21,2)
(DEW\_0.65\_2.2\_190\_2.V D-22,2)
};
\addplot +[fill=amber, draw=black] coordinates  {(BGH\_0.65\_1\_160 B-1,10)
(BGH\_0.65\_1\_160 B-2,16)
(BGH\_0.65\_1\_190 B-3,12)
(BGH\_0.65\_1\_190 B-4,25)
(BGH\_0.8\_1\_160 B-5,6)
(BGH\_0.8\_1\_160 B-6,0)
(BGH\_0.8\_1\_190 B-7,5)
(BGH\_0.8\_1\_190 B-8,7)
(BGH\_0.65\_2.2\_160 B-9,4)
(BGH\_0.65\_2.2\_160 B-10,3)
(BGH\_0.65\_2.2\_190 B-11,44)
(BGH\_0.65\_2.2\_190 B-12,1)
(BGH\_0.8\_2.2\_160 B-13,2)
(BGH\_0.8\_2.2\_160 B-14,5)
(BGH\_0.8\_2.2\_190 B-15,3)
(BGH\_0.8\_2.2\_190 B-16,4)
(BGH\_0.65\_2.2\_160\_2.V B-20,1)
(BGH\_0.65\_2.2\_190\_2.V B-21,1)
(BGH\_0.65\_2.2\_190\_2.V B-22,2)
(BGH2\_0.65\_1\_190 B2-01,14)
(BGH2\_0.65\_1\_190 B2-02,7)
(BGH2\_0.65\_1\_160 B2-03,8)
(BGH2\_0.65\_1\_160 B2-04,9)
(BGH2\_0.8\_1\_190 B2-05,25)
(BGH2\_0.8\_1\_190 B2-06,10)
(BGH2\_0.8\_1\_160 B2-07,10)
(BGH2\_0.8\_1\_160 B2-08,11)
(DEW\_0.65\_1\_160 D-02,8)
(DEW\_0.65\_1\_190 D-03,16)
(DEW\_0.65\_1\_190 D-04,7)
(DEW\_0.8\_1\_160 D-05,7)
(DEW\_0.8\_1\_160 D-06,12)
(DEW\_0.8\_1\_190 D-07,10)
(DEW\_0.8\_1\_190 D-08,14)
(DEW\_0.65\_2.2\_160 D-09,5)
(DEW\_0.65\_2.2\_160 D-10,8)
(DEW\_0.65\_2.2\_190 D-11,2)
(DEW\_0.65\_2.2\_190 D-12,2)
(DEW\_0.8\_2.2\_160 D-13,5)
(DEW\_0.8\_2.2\_160 D-14,4)
(DEW\_0.8\_2.2\_190 D-15,4)
(DEW\_0.8\_2.2\_190 D-16,5)
(DEW\_0.65\_1\_160 D-17,10)
(DEW\_0.65\_2.2\_160\_2.V D-19,2)
(DEW\_0.65\_2.2\_190\_2.V D-21,1)
(DEW\_0.65\_2.2\_190\_2.V D-22,2)
};
\addplot +[fill=neuesrot, draw=black] coordinates {(BGH\_0.65\_1\_160 B-1,15)
(BGH\_0.65\_1\_160 B-2,12)
(BGH\_0.65\_1\_190 B-3,11)
(BGH\_0.65\_1\_190 B-4,0)
(BGH\_0.8\_1\_160 B-5,4)
(BGH\_0.8\_1\_160 B-6,0)
(BGH\_0.8\_1\_190 B-7,16)
(BGH\_0.8\_1\_190 B-8,9)
(BGH\_0.65\_2.2\_160 B-9,6)
(BGH\_0.65\_2.2\_160 B-10,4)
(BGH\_0.65\_2.2\_190 B-11,0)
(BGH\_0.65\_2.2\_190 B-12,4)
(BGH\_0.8\_2.2\_160 B-13,10)
(BGH\_0.8\_2.2\_160 B-14,6)
(BGH\_0.8\_2.2\_190 B-15,8)
(BGH\_0.8\_2.2\_190 B-16,7)
(BGH\_0.65\_2.2\_160\_2.V B-20,2)
(BGH\_0.65\_2.2\_190\_2.V B-21,2)
(BGH\_0.65\_2.2\_190\_2.V B-22,9)
(BGH2\_0.65\_1\_190 B2-01,11)
(BGH2\_0.65\_1\_190 B2-02,19)
(BGH2\_0.65\_1\_160 B2-03,19)
(BGH2\_0.65\_1\_160 B2-04,8)
(BGH2\_0.8\_1\_190 B2-05,16)
(BGH2\_0.8\_1\_190 B2-06,15)
(BGH2\_0.8\_1\_160 B2-07,32)
(BGH2\_0.8\_1\_160 B2-08,16)
(DEW\_0.65\_1\_160 D-02,16)
(DEW\_0.65\_1\_190 D-03,7)
(DEW\_0.65\_1\_190 D-04,12)
(DEW\_0.8\_1\_160 D-05,16)
(DEW\_0.8\_1\_160 D-06,26)
(DEW\_0.8\_1\_190 D-07,15)
(DEW\_0.8\_1\_190 D-08,21)
(DEW\_0.65\_2.2\_160 D-09,15)
(DEW\_0.65\_2.2\_160 D-10,2)
(DEW\_0.65\_2.2\_190 D-11,5)
(DEW\_0.65\_2.2\_190 D-12,2)
(DEW\_0.8\_2.2\_160 D-13,6)
(DEW\_0.8\_2.2\_160 D-14,0)
(DEW\_0.8\_2.2\_190 D-15,12)
(DEW\_0.8\_2.2\_190 D-16,5)
(DEW\_0.65\_1\_160 D-17,17)
(DEW\_0.65\_2.2\_160\_2.V D-19,6)
(DEW\_0.65\_2.2\_190\_2.V D-21,2)
(DEW\_0.65\_2.2\_190\_2.V D-22,5)
};
\addplot+[fill=hellesgrau, draw=black] coordinates{(BGH\_0.65\_1\_160 B-1,4)
(BGH\_0.65\_1\_160 B-2,5)
(BGH\_0.65\_1\_190 B-3,4)
(BGH\_0.65\_1\_190 B-4,4)
(BGH\_0.8\_1\_160 B-5,27)
(BGH\_0.8\_1\_160 B-6,0)
(BGH\_0.8\_1\_190 B-7,22)
(BGH\_0.8\_1\_190 B-8,26)
(BGH\_0.65\_2.2\_160 B-9,37)
(BGH\_0.65\_2.2\_160 B-10,38)
(BGH\_0.65\_2.2\_190 B-11,0)
(BGH\_0.65\_2.2\_190 B-12,39)
(BGH\_0.8\_2.2\_160 B-13,34)
(BGH\_0.8\_2.2\_160 B-14,34)
(BGH\_0.8\_2.2\_190 B-15,34)
(BGH\_0.8\_2.2\_190 B-16,34)
(BGH\_0.65\_2.2\_160\_2.V B-20,42)
(BGH\_0.65\_2.2\_190\_2.V B-21,43)
(BGH\_0.65\_2.2\_190\_2.V B-22,35)
(BGH2\_0.65\_1\_190 B2-01,22)
(BGH2\_0.65\_1\_190 B2-02,15)
(BGH2\_0.65\_1\_160 B2-03,12)
(BGH2\_0.65\_1\_160 B2-04,25)
(BGH2\_0.8\_1\_190 B2-05,5)
(BGH2\_0.8\_1\_190 B2-06,20)
(BGH2\_0.8\_1\_160 B2-07,0)
(BGH2\_0.8\_1\_160 B2-08,17)
(DEW\_0.65\_1\_160 D-02,0)
(DEW\_0.65\_1\_190 D-03,0)
(DEW\_0.65\_1\_190 D-04,0)
(DEW\_0.8\_1\_160 D-05,8)
(DEW\_0.8\_1\_160 D-06,0)
(DEW\_0.8\_1\_190 D-07,12)
(DEW\_0.8\_1\_190 D-08,0)
(DEW\_0.65\_2.2\_160 D-09,23)
(DEW\_0.65\_2.2\_160 D-10,32)
(DEW\_0.65\_2.2\_190 D-11,32)
(DEW\_0.65\_2.2\_190 D-12,41)
(DEW\_0.8\_2.2\_160 D-13,35)
(DEW\_0.8\_2.2\_160 D-14,41)
(DEW\_0.8\_2.2\_190 D-15,26)
(DEW\_0.8\_2.2\_190 D-16,34)
(DEW\_0.65\_1\_160 D-17,0)
(DEW\_0.65\_2.2\_160\_2.V D-19,37)
(DEW\_0.65\_2.2\_190\_2.V D-21,42)
(DEW\_0.65\_2.2\_190\_2.V D-22,38)
};

\end{axis}
\begin{axis}[height=9cm, width=20cm, bar shift=2pt, bar width=5pt, ybar stacked, ymax=47, ymin=1, xtick=data, ytick={5,10,15,20,25,30,35,40,47}, x tick label style={font=\tiny, rotate=75, anchor=east},
          symbolic x coords={BGH\_0.65\_1\_160 B-1,
BGH\_0.65\_1\_160 B-2,
BGH\_0.65\_1\_190 B-3,
BGH\_0.65\_1\_190 B-4,
BGH\_0.8\_1\_160 B-5,
BGH\_0.8\_1\_160 B-6,
BGH\_0.8\_1\_190 B-7,
BGH\_0.8\_1\_190 B-8,
BGH\_0.65\_2.2\_160 B-9,
BGH\_0.65\_2.2\_160 B-10,
BGH\_0.65\_2.2\_190 B-11,
BGH\_0.65\_2.2\_190 B-12,
BGH\_0.8\_2.2\_160 B-13,
BGH\_0.8\_2.2\_160 B-14,
BGH\_0.8\_2.2\_190 B-15,
BGH\_0.8\_2.2\_190 B-16,
BGH\_0.65\_2.2\_160\_2.V B-20,
BGH\_0.65\_2.2\_190\_2.V B-21,
BGH\_0.65\_2.2\_190\_2.V B-22,
BGH2\_0.65\_1\_190 B2-01,
BGH2\_0.65\_1\_190 B2-02,
BGH2\_0.65\_1\_160 B2-03,
BGH2\_0.65\_1\_160 B2-04,
BGH2\_0.8\_1\_190 B2-05,
BGH2\_0.8\_1\_190 B2-06,
BGH2\_0.8\_1\_160 B2-07,
BGH2\_0.8\_1\_160 B2-08,
DEW\_0.65\_1\_160 D-02,
DEW\_0.65\_1\_190 D-03,
DEW\_0.65\_1\_190 D-04,
DEW\_0.8\_1\_160 D-05,
DEW\_0.8\_1\_160 D-06,
DEW\_0.8\_1\_190 D-07,
DEW\_0.8\_1\_190 D-08,
DEW\_0.65\_2.2\_160 D-09,
DEW\_0.65\_2.2\_160 D-10,
DEW\_0.65\_2.2\_190 D-11,
DEW\_0.65\_2.2\_190 D-12,
DEW\_0.8\_2.2\_160 D-13,
DEW\_0.8\_2.2\_160 D-14,
DEW\_0.8\_2.2\_190 D-15,
DEW\_0.8\_2.2\_190 D-16,
DEW\_0.65\_1\_160 D-17,
DEW\_0.65\_2.2\_160\_2.V D-19,
DEW\_0.65\_2.2\_190\_2.V D-21,
DEW\_0.65\_2.2\_190\_2.V D-22,
}
]

\addplot  +[fill=bluegray, draw=black]coordinates {(BGH\_0.65\_1\_160 B-1,21)
(BGH\_0.65\_1\_160 B-2,14)
(BGH\_0.65\_1\_190 B-3,17)
(BGH\_0.65\_1\_190 B-4,22)
(BGH\_0.8\_1\_160 B-5,10)
(BGH\_0.8\_1\_160 B-6,4)
(BGH\_0.8\_1\_190 B-7,5)
(BGH\_0.8\_1\_190 B-8,8)
(BGH\_0.65\_2.2\_160 B-9,0)
(BGH\_0.65\_2.2\_160 B-10,3)
(BGH\_0.65\_2.2\_190 B-11,3)
(BGH\_0.65\_2.2\_190 B-12,2)
(BGH\_0.8\_2.2\_160 B-13,1)
(BGH\_0.8\_2.2\_160 B-14,2)
(BGH\_0.8\_2.2\_190 B-15,1)
(BGH\_0.8\_2.2\_190 B-16,5)
(BGH\_0.65\_2.2\_160\_2.V B-20,2)
(BGH\_0.65\_2.2\_190\_2.V B-21,1)
(BGH\_0.65\_2.2\_190\_2.V B-22,2)
(BGH2\_0.65\_1\_190 B2-01,0)
(BGH2\_0.65\_1\_190 B2-02,8)
(BGH2\_0.65\_1\_160 B2-03,13)
(BGH2\_0.65\_1\_160 B2-04,6)
(BGH2\_0.8\_1\_190 B2-05,0)
(BGH2\_0.8\_1\_190 B2-06,1)
(BGH2\_0.8\_1\_160 B2-07,11)
(BGH2\_0.8\_1\_160 B2-08,2)
(DEW\_0.65\_1\_160 D-02,20)
(DEW\_0.65\_1\_190 D-03,30)
(DEW\_0.65\_1\_190 D-04,29)
(DEW\_0.8\_1\_160 D-05,12)
(DEW\_0.8\_1\_160 D-06,9)
(DEW\_0.8\_1\_190 D-07,14)
(DEW\_0.8\_1\_190 D-08,13)
(DEW\_0.65\_2.2\_160 D-09,3)
(DEW\_0.65\_2.2\_160 D-10,5)
(DEW\_0.65\_2.2\_190 D-11,5)
(DEW\_0.65\_2.2\_190 D-12,1)
(DEW\_0.8\_2.2\_160 D-13,3)
(DEW\_0.8\_2.2\_160 D-14,2)
(DEW\_0.8\_2.2\_190 D-15,2)
(DEW\_0.8\_2.2\_190 D-16,3)
(DEW\_0.65\_1\_160 D-17,20)
(DEW\_0.65\_2.2\_160\_2.V D-19,2)
(DEW\_0.65\_2.2\_190\_2.V D-21,2)
(DEW\_0.65\_2.2\_190\_2.V D-22,2)

};
\addplot  +[fill=amber, draw=black] coordinates {(BGH\_0.65\_1\_160 B-1,11)
(BGH\_0.65\_1\_160 B-2,20)
(BGH\_0.65\_1\_190 B-3,16)
(BGH\_0.65\_1\_190 B-4,12)
(BGH\_0.8\_1\_160 B-5,2)
(BGH\_0.8\_1\_160 B-6,10)
(BGH\_0.8\_1\_190 B-7,10)
(BGH\_0.8\_1\_190 B-8,4)
(BGH\_0.65\_2.2\_160 B-9,0)
(BGH\_0.65\_2.2\_160 B-10,4)
(BGH\_0.65\_2.2\_190 B-11,6)
(BGH\_0.65\_2.2\_190 B-12,5)
(BGH\_0.8\_2.2\_160 B-13,4)
(BGH\_0.8\_2.2\_160 B-14,1)
(BGH\_0.8\_2.2\_190 B-15,6)
(BGH\_0.8\_2.2\_190 B-16,4)
(BGH\_0.65\_2.2\_160\_2.V B-20,2)
(BGH\_0.65\_2.2\_190\_2.V B-21,3)
(BGH\_0.65\_2.2\_190\_2.V B-22,2)
(BGH2\_0.65\_1\_190 B2-01,10)
(BGH2\_0.65\_1\_190 B2-02,12)
(BGH2\_0.65\_1\_160 B2-03,11)
(BGH2\_0.65\_1\_160 B2-04,9)
(BGH2\_0.8\_1\_190 B2-05,20)
(BGH2\_0.8\_1\_190 B2-06,24)
(BGH2\_0.8\_1\_160 B2-07,9)
(BGH2\_0.8\_1\_160 B2-08,20)
(DEW\_0.65\_1\_160 D-02,15)
(DEW\_0.65\_1\_190 D-03,14)
(DEW\_0.65\_1\_190 D-04,10)
(DEW\_0.8\_1\_160 D-05,10)
(DEW\_0.8\_1\_160 D-06,15)
(DEW\_0.8\_1\_190 D-07,10)
(DEW\_0.8\_1\_190 D-08,34)
(DEW\_0.65\_2.2\_160 D-09,6)
(DEW\_0.65\_2.2\_160 D-10,5)
(DEW\_0.65\_2.2\_190 D-11,5)
(DEW\_0.65\_2.2\_190 D-12,6)
(DEW\_0.8\_2.2\_160 D-13,4)
(DEW\_0.8\_2.2\_160 D-14,2)
(DEW\_0.8\_2.2\_190 D-15,4)
(DEW\_0.8\_2.2\_190 D-16,7)
(DEW\_0.65\_1\_160 D-17,8)
(DEW\_0.65\_2.2\_160\_2.V D-19,3)
(DEW\_0.65\_2.2\_190\_2.V D-21,5)
(DEW\_0.65\_2.2\_190\_2.V D-22,6)
};
\addplot  +[fill=neuesrot, draw=black]coordinates {(BGH\_0.65\_1\_160 B-1,13)
(BGH\_0.65\_1\_160 B-2,6)
(BGH\_0.65\_1\_190 B-3,7)
(BGH\_0.65\_1\_190 B-4,12)
(BGH\_0.8\_1\_160 B-5,1)
(BGH\_0.8\_1\_160 B-6,33)
(BGH\_0.8\_1\_190 B-7,20)
(BGH\_0.8\_1\_190 B-8,19)
(BGH\_0.65\_2.2\_160 B-9,0)
(BGH\_0.65\_2.2\_160 B-10,8)
(BGH\_0.65\_2.2\_190 B-11,5)
(BGH\_0.65\_2.2\_190 B-12,10)
(BGH\_0.8\_2.2\_160 B-13,10)
(BGH\_0.8\_2.2\_160 B-14,2)
(BGH\_0.8\_2.2\_190 B-15,2)
(BGH\_0.8\_2.2\_190 B-16,11)
(BGH\_0.65\_2.2\_160\_2.V B-20,7)
(BGH\_0.65\_2.2\_190\_2.V B-21,11)
(BGH\_0.65\_2.2\_190\_2.V B-22,0)
(BGH2\_0.65\_1\_190 B2-01,37)
(BGH2\_0.65\_1\_190 B2-02,20)
(BGH2\_0.65\_1\_160 B2-03,14)
(BGH2\_0.65\_1\_160 B2-04,25)
(BGH2\_0.8\_1\_190 B2-05,27)
(BGH2\_0.8\_1\_190 B2-06,21)
(BGH2\_0.8\_1\_160 B2-07,27)
(BGH2\_0.8\_1\_160 B2-08,25)
(DEW\_0.65\_1\_160 D-02,12)
(DEW\_0.65\_1\_190 D-03,3)
(DEW\_0.65\_1\_190 D-04,8)
(DEW\_0.8\_1\_160 D-05,25)
(DEW\_0.8\_1\_160 D-06,23)
(DEW\_0.8\_1\_190 D-07,23)
(DEW\_0.8\_1\_190 D-08,0)
(DEW\_0.65\_2.2\_160 D-09,15)
(DEW\_0.65\_2.2\_160 D-10,16)
(DEW\_0.65\_2.2\_190 D-11,6)
(DEW\_0.65\_2.2\_190 D-12,15)
(DEW\_0.8\_2.2\_160 D-13,15)
(DEW\_0.8\_2.2\_160 D-14,0)
(DEW\_0.8\_2.2\_190 D-15,5)
(DEW\_0.8\_2.2\_190 D-16,15)
(DEW\_0.65\_1\_160 D-17,19)
(DEW\_0.65\_2.2\_160\_2.V D-19,1)
(DEW\_0.65\_2.2\_190\_2.V D-21,13)
(DEW\_0.65\_2.2\_190\_2.V D-22,11)
};
\addplot  +[fill=hellesgrau, draw=black] coordinates {(BGH\_0.65\_1\_160 B-1,2)
(BGH\_0.65\_1\_160 B-2,7)
(BGH\_0.65\_1\_190 B-3,7)
(BGH\_0.65\_1\_190 B-4,1)
(BGH\_0.8\_1\_160 B-5,34)
(BGH\_0.8\_1\_160 B-6,0)
(BGH\_0.8\_1\_190 B-7,12)
(BGH\_0.8\_1\_190 B-8,16)
(BGH\_0.65\_2.2\_160 B-9,0)
(BGH\_0.65\_2.2\_160 B-10,32)
(BGH\_0.65\_2.2\_190 B-11,33)
(BGH\_0.65\_2.2\_190 B-12,30)
(BGH\_0.8\_2.2\_160 B-13,32)
(BGH\_0.8\_2.2\_160 B-14,42)
(BGH\_0.8\_2.2\_190 B-15,38)
(BGH\_0.8\_2.2\_190 B-16,27)
(BGH\_0.65\_2.2\_160\_2.V B-20,36)
(BGH\_0.65\_2.2\_190\_2.V B-21,32)
(BGH\_0.65\_2.2\_190\_2.V B-22,0)
(BGH2\_0.65\_1\_190 B2-01,0)
(BGH2\_0.65\_1\_190 B2-02,7)
(BGH2\_0.65\_1\_160 B2-03,9)
(BGH2\_0.65\_1\_160 B2-04,7)
(BGH2\_0.8\_1\_190 B2-05,0)
(BGH2\_0.8\_1\_190 B2-06,1)
(BGH2\_0.8\_1\_160 B2-07,0)
(BGH2\_0.8\_1\_160 B2-08,0)
(DEW\_0.65\_1\_160 D-02,0)
(DEW\_0.65\_1\_190 D-03,0)
(DEW\_0.65\_1\_190 D-04,0)
(DEW\_0.8\_1\_160 D-05,0)
(DEW\_0.8\_1\_160 D-06,0)
(DEW\_0.8\_1\_190 D-07,0)
(DEW\_0.8\_1\_190 D-08,0)
(DEW\_0.65\_2.2\_160 D-09,23)
(DEW\_0.65\_2.2\_160 D-10,21)
(DEW\_0.65\_2.2\_190 D-11,31)
(DEW\_0.65\_2.2\_190 D-12,25)
(DEW\_0.8\_2.2\_160 D-13,25)
(DEW\_0.8\_2.2\_160 D-14,43)
(DEW\_0.8\_2.2\_190 D-15,36)
(DEW\_0.8\_2.2\_190 D-16,22)
(DEW\_0.65\_1\_160 D-17,0)
(DEW\_0.65\_2.2\_160\_2.V D-19,41)
(DEW\_0.65\_2.2\_190\_2.V D-21,27)
(DEW\_0.65\_2.2\_190\_2.V D-22,28)

};
\end{axis}
\end{tikzpicture}
\caption{Ergebnisse der Einschätzung der Nitalätzung}
\label{nitaldata1}
\end{figure}
\end{landscape}
\end{document}

A: As was already written in the comments below the question, you need to reduce the value for enlarge x limits exactly, but unfortunately you cannot do it with absolute (axis) coordinates when symbolic coordinates are used. (That means currently one is not allowed to write something like bar width=[normalize]0.5 or bar shift=[normalize]0.25.)
To circumvent this problem I don't use symbolic coordinates directly. I first create an inline/temporary data table from your data given to the \addplot commands and secondly use xticklabels from table to simulate the symbolic x coords feature. By doing this I can now normally use the absolute bar with and bar shift options.
Last I simply provide -- also in absolute (axis) coordinates -- a suitable absolute value for enlarge x limits.
For more details please have a look at the comments in the code.
% used PGFPlots v1.14
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
% needed to store an inline table
\usepackage{pgfplotstable}
    \pgfplotsset{
        % use this `compat' level or higher to use relative (axis) coordinates
        % for `bar width' and `bar shift'
        compat=1.7,
        % created a style for the stuff that is common in both axis
        my axis style/.style={
            height=9cm,
            width=20cm,
            % give an absolute (axis) coordinate value for the `bar width'
            bar width=0.5,
            ybar stacked,
            ymax=47,
            ymin=1,
            % give an absolute (axis) coordinate value to enlarge the x limits
            enlarge x limits={abs=0.5},
        },
    }
    % store the data as inline table
    % (here I used a comma as column separator, because there are spaces in the
    %  x column)
    \pgfplotstableread[col sep=comma]{
        x,y1,y2,y3,y4,z1,z2,z3,z4
        BGH\_0.65\_1\_160 B-1,18,10,15,4,21,11,13,2
        BGH\_0.65\_1\_160 B-2,14,16,12,5,14,20,6,7
        BGH\_0.65\_1\_190 B-3,20,12,11,4,17,16,7,7
        BGH\_0.65\_1\_190 B-4,18,25,0,4,22,12,12,1
        BGH\_0.8\_1\_160 B-5,10,6,4,27,10,2,1,34
        BGH\_0.8\_1\_160 B-6,8,0,0,0,4,10,33,0
        BGH\_0.8\_1\_190 B-7,4,5,16,22,5,10,20,12
        BGH\_0.8\_1\_190 B-8,5,7,9,26,8,4,19,16
        BGH\_0.65\_2.2\_160 B-9,0,4,6,37,0,0,0,0
        BGH\_0.65\_2.2\_160 B-10,2,3,4,38,3,4,8,32
        BGH\_0.65\_2.2\_190 B-11,3,44,0,0,3,6,5,33
        BGH\_0.65\_2.2\_190 B-12,3,1,4,39,2,5,10,30
        BGH\_0.8\_2.2\_160 B-13,1,2,10,34,1,4,10,32
        BGH\_0.8\_2.2\_160 B-14,2,5,6,34,2,1,2,42
        BGH\_0.8\_2.2\_190 B-15,2,3,8,34,1,6,2,38
        BGH\_0.8\_2.2\_190 B-16,2,4,7,34,5,4,11,27
        BGH\_0.65\_2.2\_160\_2.V B-20,2,1,2,42,2,2,7,36
        BGH\_0.65\_2.2\_190\_2.V B-21,1,1,2,43,1,3,11,32
        BGH\_0.65\_2.2\_190\_2.V B-22,1,2,9,35,2,2,0,0
        BGH2\_0.65\_1\_190 B2-01,0,14,11,22,0,10,37,0
        BGH2\_0.65\_1\_190 B2-02,6,7,19,15,8,12,20,7
        BGH2\_0.65\_1\_160 B2-03,8,8,19,12,13,11,14,9
        BGH2\_0.65\_1\_160 B2-04,5,9,8,25,6,9,25,7
        BGH2\_0.8\_1\_190 B2-05,1,25,16,5,0,20,27,0
        BGH2\_0.8\_1\_190 B2-06,2,10,15,20,1,24,21,1
        BGH2\_0.8\_1\_160 B2-07,5,10,32,0,11,9,27,0
        BGH2\_0.8\_1\_160 B2-08,3,11,16,17,2,20,25,0
        DEW\_0.65\_1\_160 D-02,23,8,16,0,20,15,12,0
        DEW\_0.65\_1\_190 D-03,24,16,7,0,30,14,3,0
        DEW\_0.65\_1\_190 D-04,28,7,12,0,29,10,8,0
        DEW\_0.8\_1\_160 D-05,16,7,16,8,12,10,25,0
        DEW\_0.8\_1\_160 D-06,9,12,26,0,9,15,23,0
        DEW\_0.8\_1\_190 D-07,10,10,15,12,14,10,23,0
        DEW\_0.8\_1\_190 D-08,12,14,21,0,13,34,0,0
        DEW\_0.65\_2.2\_160 D-09,4,5,15,23,3,6,15,23
        DEW\_0.65\_2.2\_160 D-10,5,8,2,32,5,5,16,21
        DEW\_0.65\_2.2\_190 D-11,8,2,5,32,5,5,6,31
        DEW\_0.65\_2.2\_190 D-12,2,2,2,41,1,6,15,25
        DEW\_0.8\_2.2\_160 D-13,1,5,6,35,3,4,15,25
        DEW\_0.8\_2.2\_160 D-14,2,4,0,41,2,2,0,43
        DEW\_0.8\_2.2\_190 D-15,5,4,12,26,2,4,5,36
        DEW\_0.8\_2.2\_190 D-16,3,5,5,34,3,7,15,22
        DEW\_0.65\_1\_160 D-17,20,10,17,0,20,8,19,0
        DEW\_0.65\_2.2\_160\_2.V D-19,2,2,6,37,2,3,1,41
        DEW\_0.65\_2.2\_190\_2.V D-21,2,1,2,42,2,5,13,27
        DEW\_0.65\_2.2\_190\_2.V D-22,2,2,5,38,2,6,11,28
    }{\loadedtable}
    \definecolor{amber}{rgb}{1.0, 0.75, 0.0}
    \definecolor{bluegray}{RGB}{1, 171, 170}
    \definecolor{neuesrot}{RGB}{207, 103, 102}
    \definecolor{ultramarin}{RGB}{40, 109, 168}
    \definecolor{hellesgrau}{RGB}{216, 216, 216}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[
        % apply previously defined style here
        my axis style,
        % provide the shift of the bar, which should be half of the `bar width'
        bar shift=-0.25,
        % just use `data' for the `xtick's ...
        xtick=data,
        % ... and label them with the values from the `x' column of the loaded table
        xticklabels from table={\loadedtable}{x},
        ytick={5,10,15,20,25,30,35,40,47},
        x tick label style={
            font=\tiny,
            rotate=75,
            anchor=east,
        },
        legend style={
            at={(0.5,-0.50)},
            anchor=north,
        },
        legend columns=-1,
        legend entries={
            Schädigungsstufe A,
            Schädigungsstufe B,
            Schädigungsstufe D,
            Schädigungsstufe E,
        },
    ]
        % then simply add the plots by using the `\coordindex' as x values
        % and the corresponding y columns for the "left" stacked ybars
        \addplot+ [fill=bluegray, draw=black]   table [x expr=\coordindex,y=y1] {\loadedtable};
        \addplot+ [fill=amber, draw=black]      table [x expr=\coordindex,y=y2] {\loadedtable};
        \addplot+ [fill=neuesrot, draw=black]   table [x expr=\coordindex,y=y3] {\loadedtable};
        \addplot+ [fill=hellesgrau, draw=black] table [x expr=\coordindex,y=y4] {\loadedtable};
    \end{axis}
    \begin{axis}[
        % same as before
        my axis style,
        % same as before but this time the positive value
        bar shift=0.25,
        % we don't need to draw the x and y ticks again
        xtick=\empty,
        ytick=\empty,
    ]
        % same as before, but this time with the columns for the "right" stacked ybars
        \addplot+ [fill=bluegray, draw=black]   table [x expr=\coordindex,y=z1] {\loadedtable};
        \addplot+ [fill=amber, draw=black]      table [x expr=\coordindex,y=z2] {\loadedtable};
        \addplot+ [fill=neuesrot, draw=black]   table [x expr=\coordindex,y=z3] {\loadedtable};
        \addplot+ [fill=hellesgrau, draw=black] table [x expr=\coordindex,y=z4] {\loadedtable};
    \end{axis}
\end{tikzpicture}
\end{document}

A: Okay, I got it. I had to add enlarge x limits={abs=6pt} to both of the axis options, to help the issue with the bar shift. Thanks to Bobyandbob for pointing me in the right direction.


text:
Q: Micro-Controller Operating System with GUI I'm looking for embedded OS for w micro-controller, it's not clear until now for me what'll be  the controller type, but my first priority is to found an OS with GUI can be written in C# or any .NET family or JAVA. I found some good operating system like:
emWIN, easyGUI, PEG
but all of them could be customized in C++, Any help please about same OSs but not in C++.
and due to I'm new in embedded systems developing and until now not clear with the main structure, is it possible to let developers create applications and install it on my embedded system or the main structure only allow to customize the software and burn it to micro-controller, or in other words.. in advanced mood. Can I create SDKs for my embedded system or the only way to create a software on an embedded system is to customize my OS with my applications and burn it.. Thanks and sorry if am not clear with that field but am trying to collect a lot about it.

A: Basically, this question is not capable of being answered. You don't need to consider what OS you're going to use at first. First, you need to consider what kind of micro-controller you're going to be using.
Various ARM CPUs will be perfectly capable of running a "OS" in .Net
However, AVR and PIC and such will not be able to use even the most micro of .Net frameworks.
Second, you need to consider why you're needing to use .Net. The .Net micro framework will have a lot more overhead than a direct native program. If using .Net is only a priority because you don't want to learn C++, you probably just need to man up and learn C or C++.
And what kind of OS are you looking for? An RTOS, or a more general purpose OS, such as Linux? You're going to have a hard time finding an OS of much complexity implemented in C#, because of the reason I said above.

A: If you like C# you can use Netduino

It has a Free IDE supported by Microsoft you can download here.

Netduino is an open source electronics platform using the .NET Micro
  Framework.
Featuring a 32-bit microcontroller and a rich development environment.
  Suitable for engineers and hobbyists alike

*

*Atmel 32-bit microcontroller

*Speed: 48MHz, ARM7

*Code Storage: 128 KB

*RAM: 60 KB

It is cheap but some accessories can be expensive (But you can make your own cheaper)

A: How about a $35 computer?

The Raspberry Pi is the latest viral trend for cheap but extremely powerful "Micro Controller" The supported OS is a special version of Debian for ARM6 but it can run almost anything the normal Debian does and also has Input/Output pins.
Most of software is also Free

The Raspberry Pi is a credit-card sized computer that plugs into your
  TV and a keyboard. It's a capable little PC which can be used for many
  of the things that your desktop PC does, like spreadsheets,
  word-processing and games. It also plays high-definition video. We
  want to see it being used by kids all over the world to learn
  programming.

*

*CPU, 700 MHz ARM (ARM11)

*GPU, VideoCore IV, OpenGL ES 2.0, 1080p30 h.264/MPEG-4 AVC

*RAM 256mb (depends on model too)

*Storage, Unlimited (Whatever you connect to it) (Priamry SD-Card, USB and Network)

Ask the dedicated Raspberry Pi Stack Exchange Community for more questions...

A: ARIA ARM9 SoM

A very similar product to the Raspberry Pi but runs on an ARM architecture that is fully supported by many Linux distributions. The nice thing about this is that you make the rest of the circuit- SO you can embedd a 2GB flash and run your own build of linux with API's on it while offering LAN, SPI, GPIO,I2C etc.

Aria G25 is a small SoM (System-on-Module) thought of for hardware
  designers who want to reduce the development time of OEM Linux
  embedded devices. Aria G25 can be used either as a SMD module on a PCB
  or as stand-alone module to wire directly to other modules.

*

*ARM9 @ 400Mhz

*128 or 255 ram

*USB and LAN

*0.3 watt power consumption

*24 Euro's

*Fully expendable for you design!

A: If your target is an embedded Linux ARM board, then you can use CodeTyphon to cross compile to it, or fpGUI to have an on board compiler. Both use FPC compiler, so not your priority.


text:
Q: Limit Proof Check: $\lim _{x \to a} x^4 = a^4$ Reviewing limits and I'm afraid I may be making mistakes, just looking for a quick proof check.
$f(x)=x^4$, prove that $\lim _{x \rightarrow a}f(x)=a^4$ by showing how to find $\delta$ .
This is my work. $|x^4 - a^4 | < \epsilon$ and $0<|x-a|<\delta$
Factoring: $|x^2 +a^2||x-a||x+a|< \epsilon$ next we set $|x-a|<1$ which means $-1+a<|x|<1+a$ so that
\begin{align}
 |x^2 +a^2||x-a||x+a|& =((-1+a)^2 +a^2 )((1+a)+a)(x-a))\\
 & = |2a(1+2a^2 -2a)||x-a|\\
 & <\epsilon \\
\end{align}
We then have $$\delta =\min\lbrace 1, \frac{\epsilon}{ |2a(1+2a^2 -2a)|} \rbrace$$
How's it look?

A: Alternate Solution.
Need to find a bound for $|x^2 + a^2||x + a|$. Take for instance, $|x - a| < 1$ then
$$|x^2 + a^2||x + a| = |x^2 - a^2 + 2a^2 ||x - a + 2a| = (|x^2 - a^2 + 2a^2 |)(|x - a + 2a|)$$
This does not change the expression since $a^2 - a^2 = 0$ and $a - a = 0$
Using the triangle inequality $|x + y| \le |x| + |y|$
$$(|x^2 - a^2 + 2a^2 |)(|x - a + 2a|)$$
$$\le (|x^2 - a^2| + |2a^2 |)(|x - a| + |2a|)$$
$$\le (|x - a||x + a| + |2a^2 |)(|x - a| + |2a|)$$
$$\le (|x - a||x -a + 2a| + |2a^2 |)(|x - a| + |2a|)$$
$$\le (|x - a| \cdot (|x -a| + |2a|) + |2a^2 |)(|x - a| + |2a|)$$
$$|x - a| < 1$$
$$< (1 \cdot (1 + 2|a|) + 2|a^2|)(1 + 2|a|)$$
$$< (1 + 2|a| + 2|a^2|)(1 + 2|a|)$$
Therefore
$$|x^2 + a^2||x + a| < (1 + 2|a| + 2|a^2|)(1 + 2|a|)$$
Therefore
$$|x^2 + a^2||x + a||x - a| < (1 + 2|a| + 2|a^2|)(1 + 2|a|)|x - a| < \epsilon$$
$$|x - a| < \frac{\epsilon}{(1 + 2|a| + 2|a^2|)(1 + 2|a|)}$$
Take $$\delta = min \lbrace 1, \frac{\epsilon}{(1 + 2|a| + 2|a^2|)(1 + 2|a|)} \rbrace$$

A: A different factorization
works for all powers
$x^n$.
This is
$x^n-a^n
=(x-a)\sum_{k=0}^{n-1} x^ka^{n-1-k}
$.
If
$|x-a| < 1$,
then
$\begin{array}\\
|x^n-a^n|
&=|x-a||\sum_{k=0}^{n-1} x^ka^{n-1-k}|\\
&<|x-a||\sum_{k=0}^{n-1} (a+1)^ka^{n-1-k}|\\
&\le|x-a|n(|a|+1)^{n-1})\\
\end{array}
$
Therefore,
to make
$|x^n-a^n| < \delta$,
it is enough if
$|x-a|n(|a|+1)^{n-1}
 < \delta$
or
$|x-a|
< \dfrac{\delta}{n(|a|+1)^{n-1}}
$.
Inserting the restriction
$|x-a| < 1$,
this becomes
$|x-a|
< \min(1,\dfrac{\delta}{n(|a|+1)^{n-1}})
$.


text:
Q: setting tab index for nested forms and canvas in smartgwt I have a smart gwt application which includes VLayouts, HLayouts, DynamicForms, Canvas, etc in a nested fashion.
One form comes inside of another in many places across the application.
But the tab order (Navigation using Tab and Shift+Tab) is behaving in a random order in many places.
Can anyone provide some suggestions for overall archetecture of the application?
For example

*

*Which method should be used vLaout.addMember(myPanel) or
vLayout.addChild(myPanel)?

*How to properly nest the components?

*should globalTabIndex be used ?

*If two forms are added to a VLaoyout, how can I specify the TabIndex to specify which form's components should be focused first ?

I didnt find any proper documentaion in smartgwt website. Please help me. Any kind of suggestions will be helpful.

A: *

*addMember(Widget widget) shall be used - at least in most cases.

*Organize them in logical panels (all components of a form in a form container, all the forms in a layout container and all the layout containers in higher order layout containers)

*Depends on your case. You are not very clear on what you want to achieve with it.

*DynamicForm is a Canvas. Use focus() at the form you want to be shown firstly focused to the user.

The http://www.smartclient.com/smartgwt/javadoc if very useful to find out about the objects supported methods and actions.


text:
Q: How to Globally Use wp_localize_script() Ajax URL I have added this to my functions.php and need to use ajaxURL in all of enqueued scripts in the template (instead of enqueuing only one script here
add_action( 'wp_enqueue_scripts', 'ajaxify_enqueue_scripts' );
function ajaxify_enqueue_scripts() {
   wp_localize_script( 'ajaxify', 'ajaxURL', array('ajax_url' => get_template_directory_uri() . '/app/login.php' ));
}
add_action( 'wp_ajax_nopriv_set_ajaxify', 'set_ajaxify' );
add_action( 'wp_ajax_set_ajaxify', 'set_ajaxify' );

but when I try to call an ajax method I am getting this error
Uncaught ReferenceError: ajaxURL is not defined

Is there any way to add  the ajaxURL to all scripts?

A: Try this code
add_action( 'wp_enqueue_scripts', 'ajaxify_enqueue_scripts' );

function ajaxify_enqueue_scripts() {
    wp_enqueue_script('ajaxify', get_template_directory_uri() . '/test.js');
    wp_localize_script( 'ajaxify', 'ajaxURL', array('ajax_url' => admin_url('admin-ajax.php')));

}

A: Put This Code :
function your_function_name() {

  wp_register_script('ajaxify', get_template_directory_uri() . '/your-jsname.js', array('jquery'), '', true);
  wp_enqueue_script('ajaxify');

  wp_localize_script('ajaxify', 'ajaxURL', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ),'siteurl' => site_url() ) );

}
add_action( 'wp_enqueue_scripts', 'your_function_name' );


text:
Q: jQuery functions inside click events The following works fine:
    classes_tab.click(function(evt){
        evt.preventDefault();
        h_c.filter(':visible').fadeOut(fast, function(){
            disactive.removeClass('active');
            classes_tab.addClass('active');
            classes.fadeIn(fast);
        });
    });

    contacts_tab.click(function(evt){
        evt.preventDefault(evt);
        h_cl.filter(':visible').fadeOut(fast, function(){
            disactive.removeClass('active');
            contacts_tab.addClass('active');
            contacts.fadeIn(fast);
        });
    });

    home_tab.click(function(evt){
        evt.preventDefault();
        c_cl.filter(':visible').fadeOut(fast, function(){
            disactive.removeClass('active');
            home_tab.addClass('active');
            home.fadeIn(fast);
        });
    });

Is there a way of writing a function before this click events without repeating every time what is happening inside the click event?
Say I have something like:
function tabs(x, y){
    x.fadeOut(fast);
            y.fadesIn(fast);
        }

than inside each click event I just call this function by changing parameters

A: yes.. u can do that.. here is the example...
Click function  (home_tab for this example)..
...click(function(event){
     evt.preventDefault();
    functionName('c_cl','home_tab','home');
});

Function
function functionName(x,y,z)
{
        var x = $(#x)|| var y = $(#y)|| var z=$(#z) //add your selector here(this is just and examplr)
        x.filter(':visible').fadeOut(fast, function(){
        disactive.removeClass('active');
        y.addClass('active');
        z.fadeIn(fast);
    });
}

like wise u can call the click function for two others.. with the parameters..

A: Create a new Function
function myFunc(evt, active_tab, container){
        evt.preventDefault(evt);
        h_cl.filter(':visible').fadeOut(fast, function(){
            disactive.removeClass('active');
            active_tab.addClass('active');
            container.fadeIn(fast);
        });
}

Bind the new function to the click event of an element
home_tab.click(function(evt){
      myFunc(evt,home_tab, home);
    });
});

classes_tab.click(function(evt){
      myFunc(evt,classes_tab, classes);
    });
});

contacts_tab.click(function(evt){
      myFunc(evt,contacts_tab, contacts);
    });
});

A: You can pass data to your handlers:
function tabsHandler(evt){
    evt.preventDefault();
    evt.data.x.fadeOut(fast);
    evt.data.y.fadesIn(fast);
}
$('.home_tab').on('click', {x : $foo, y : $bar}, tabsHandler);
// where $foo and $bar are references to jQuery objects

Or you can do:
function tabsHandler(x, y){
    x.fadeOut(fast);
    y.fadesIn(fast);
}
$('.home_tab').on('click', function(evt){
    evt.preventDefault();
    tabsHandler($foo, $bar);
});

Or you could store references to other objects in data first and then use them in handlers. Try something like this:
// Your class names are my assumption
var $home_tab = $('.home_tab');
var $classes_tab = $('.classes_tab');
// I'm also assuming c_cl, h_c, disactive and home are existing jQuery objects
$home_tab.data({
    'cl' : c_cl,
    'disactive' : disactive,
    'objectToFadeIn': home
});

$classes_tab.data({
    'cl' : h_c,
    'disactive' : disactive,
    'objectToFadeIn': classes
});

function tabsHandler(evt){
    evt.preventDefault();
    var $tab = $(this);
    $tab.data('cl').filter(':visible').fadeOut(fast, function(){
        $tab.data('disactive').removeClass('active');
        $tab.addClass('active');
        $tab.data('objectToFadeIn').fadeIn(fast);
    });
}

$home_tab.click(tabsHandler);
$classes_tab.click(tabsHandler);

Or for the last bit:
$(document).on('click', '.home_tab, .classes_tab', tabsHandler);


text:
Q: How do i use the AllowHtml attribute with the entity framework How would i go about adding the [AllowHtml] attribute to an entity framework generated class without the attribute being overwritten the next time the code is generated?
I am looking to simply allow CKEditor to post information back to my MVC4 application using Razor without having to use [ValidateReuqest(false)] on my Content entity class.

A: You can use the [MetadataType] attribute to add metadata/attributes to your classes permanently without having to edit the original classes.
For the class Content create a new cs file in your project and replace the empty class with:
[MetadataType(typeof(ContentMetadata))]
public partial class Content
{

}

public class ContentMetadata
{
    [AllowHtml]
    public string ContentHtml { get; set; }
}

The partial class name must match the class name of the entity class exactly, and the attribute must match the definition of the attribute in the entity class exactly.
After a rebuild, this will now work as if you put the attribute within the entity class, but with the added bonus of not being overwritten every time.

A: Add a new C# partial class file to the model folder with the same name as your entity class and apply the attribute there.
Ensure that the namespaces for the partial classes match up, otherwise they are seen as different classes.
You can use the same partial class to set other attributes like [Display(Name="xxx")] for other properties.


text:
Q: Ionic app and Access-Control-Allow-Headers on Nginx I have a Ionic app that use a API hosted on a site and with ionic serve and chrome cors plugin I'm able to use the app.
When I try it on the ios emulator with ionic cordova run ios the app starts but no content is displayed.
Using safari as debugger I have found the issue:

Failed to load resource: Request header field User-Agent is not
  allowed by Access-Control-Allow-Headers.

The problem is that in my site, which is a Wordpress installation, I have this code:
function add_cors_http_header(){
    header("Access-Control-Allow-Origin: *");
    header('Access-Control-Allow-Methods: GET, POST, OPTIONS, DELETE, PUT');
    header('Access-Control-Allow-Headers: Origin, User-Agent, Content-Type, Accept, Authorization, X-Request-With, X-CLIENT-ID, X-CLIENT-SECRET');
    header('Access-Control-Allow-Credentials: true');
}
add_action('init','add_cors_http_header');

and as you can see the User-Agent is allowed in headers.
How can I solve this issue?

A: You should use the service proxy configuration for Ionic instead of randomly granting these permissions.
Add this to your ionic.config.json:
...
proxies: [
    {path: "/path/to/resource", proxyUrl: "http://myserver.com/path/to/resource"}
]
...

See this link: https://ionicframework.com/docs/cli/configuring.html
I usually put these URLs in a config file. I maintain two files for development and production use. Once you deploy the app to a device you can use the regular URLs again (production config file) because cross origin requests aren't prohibited within embedded WebViews.


text:
Q: Convert same time to different time zone I am trying to convert times to different time zones, but not the way you're thinking. I need to convert a DateTime that is 9am EST to 9am CST on the UTC for example. The timezones are variable so just adding/subtracting hours doesn't seem correct way to do it with NodaTime
Fri, 21 Feb 2014 21:00:00 EST = 1393034400 Epoch Timestamp
convert to
Fri, 21 Feb 2014 21:00:00 CST = 1393030800 Epoch Timestamp

A: If I understand the question correctly, it sounds like you're trying to convert a date/time in one time zone to another one that has the same local time and a different time zone; that is, a different point in time.
You can do this with Noda Time by combining the LocalDateTime with the new zone.  For example, given something like the following:
Instant now = SystemClock.Instance.Now;
DateTimeZone eastern = DateTimeZoneProviders.Tzdb["America/New_York"];
ZonedDateTime nowEastern = now.InZone(eastern);

nowEastern is the time now in the America/New_York time zone.  If we print nowEastern directly to the console, we'll see something like 2014-02-22T05:18:50 America/New_York (-05).
As an aside, "EST" and "CST" aren't time zones: they're non-unique abbreviations for a particular offset within a time zone; America/New_York and America/Chicago are probably representative of what we think of as "Eastern" and "Central", though (or you could use something like UTC-05:00 if you really wanted EST even when daylight savings time was in effect).
Given a ZonedDateTime in any time zone, we can convert it to a ZonedDateTime with the same local time and a specified time zone as follows:
DateTimeZone central = DateTimeZoneProviders.Tzdb["America/Chicago"];
ZonedDateTime sameLocalTimeCentral = nowEastern.LocalDateTime.InZoneStrictly(central);

This gives us a ZonedDateTime with the same local time, but a different time zone.  With the input above, the result would be 2014-02-22T05:18:50 America/Chicago (-06).
Note that I'm using InZoneStrictly. This will throw an exception if the local time is ambiguous or invalid (for example, during daylight savings transitions).  If that's unacceptable, you could use InZoneLeniently, which picks the earliest valid ZonedDateTime on or after the given local time, or InZone, which allows you to specify your own rules in those cases.

A: On Msdn website you can find all you need.
Small example:
DateTime dateNow = DateTime.Now;
Console.WriteLine("The date and time are {0} UTC.",
               TimeZoneInfo.ConvertTimeToUtc(dateNow));

Go to the link for more details on what you want, I can't give you more with that small description


text:
Q: GNUPLOT : Plot sum of distributions given by parameters in text file Suppose I have a text file with an arbitrary number of rows where each row gives some set of parameters that define a function (say the (x,y) location and sigmas (possibility unequal) of a 2D Gaussian). For example, in that case, the text file might contain:
100 112  3 4
97   38  8 9
88   79  3 9
    ...
    ...
102  152 9 5

I would like to plot (using pm3d) the SUM of all the distributions defined by the text file. How can that be done?

A: I would like to plot (using pm3d) the SUM of all the distributions defined by the text file. How can that be done?
I think that cannot be done in native gnuplot, at least not in any sane way that I know.  That kind of number crunching is not really what gnuplot is designed to do.
Python, however, makes it pretty doable...
#!/usr/bin/env python2

import math
import numpy
import os

class Gaussian(object):
    '''A 2D gaussian function (normalized), defined by
    mx: x mean position
    my: y mean position
    sx: sigma in x
    sy: sigma in y'''

    def __init__(self, mx, my, sx, sy):
        self.mx = float(mx)
        self.my = float(my)
        self.sx = float(sx)
        self.sy = float(sy)

    def value(self,x,y):
        '''Evaluates the value of a Gaussian at a certain point (x,y)'''
    prefactor = (1.0/(self.sx*self.sy*2*math.pi))
    ypart = math.exp(-(x - self.mx)**2/(2*self.sx**2))
    xpart = math.exp(-(y - self.my)**2/(2*self.sy**2))
    return prefactor*ypart*xpart

    def getLimits(self, devs):
        '''Finds the upper and lower x and y limits for the distribution,
        defined as points a certain number of deviations from the mean.'''
        xmin = self.mx - devs*self.sx
        xmax = self.mx + devs*self.sx
        ymin = self.my - devs*self.sy
        ymax = self.my + devs*self.sy

        return (xmin, xmax, ymin, ymax)

def readGaussians(filename):
    '''reads in gaussian parameters from an input file in the format
    mx my sx sy

    This makes some assumptions about how perfect the input file will be'''
    gaussians = []
    with open(filename, 'r') as f:
        for line in f.readlines():
            (mx, my, sx, sy) = line.split()
            gaussians.append(Gaussian(mx, my, sx, sy))

    return gaussians

def getPlotLimits(gaussians, devs):
    '''finds the x and y limits of the field of gaussian distributions.
    Sets the boundary a set number of deviations from the mean'''
    # get the limits from the first gaussian and work from there
    (xminlim, xmaxlim, yminlim, ymaxlim) = gaussians[0].getLimits(devs)
    for i in range(1, len(gaussians)):
        (xmin, xmax, ymin, ymax) = gaussians[i].getLimits(devs)
        if (xmin < xminlim):
            xminlim = xmin
        if (xmax > xmaxlim):
            xmaxlim = xmax
        if (ymin < yminlim):
            yminlim = ymin
        if (ymax > ymaxlim):
            ymaxlim = ymax

    return (xminlim, xmaxlim, yminlim, ymaxlim)

def makeDataFile(gaussians, limits, res, outputFile):
    '''makes a data file of x,y coordinates to be plotted'''
    xres = res[0]
    yres = res[1]

    # make arrays of x and y values
    x = numpy.linspace(limits[0], limits[1], xres)
    y = numpy.linspace(limits[2], limits[3], yres)
    # initialize grid of z values
    z = numpy.zeros((xres, yres))

    # compute z value at each x, y point
    for i in range(len(x)):
        for j in range(len(y)):
            for gaussian in gaussians:
                z[i][j] += gaussian.value(x[i], y[j])

    # write out the matrix
    with open(outputFile, 'w') as f:
        for i in range(len(x)):
            for j in range(len(y)):
                f.write('%f %f %f\n' % (x[i], y[j], z[i][j]))
            f.write('\n')

def makePlotFile(limits, outputFile):
    '''makes a plot file for gnuplot'''
    with open('plot.plt', 'w') as f:
        f.write("#!/usr/bin/env gnuplot\n")
        f.write("set terminal png font 'Courier'\n")
        f.write("set output 'gaussians.png'\n")
        f.write("set xr [%f:%f]\n" % (limits[0], limits[1]))
        f.write("set yr [%f:%f]\n" % (limits[2], limits[3]))
        f.write("set pm3d map\n")
        f.write("plot '%s' with image\n" % outputFile)

    # make plot file executable
    os.system('chmod 755 plot.plt')

    # plot
    os.system('./plot.plt')

# name of input file
inputFile = 'data.dat'
# name of output (processed data)
outputFile = 'gaussians.dat'
# number of x and y points in plot
res = (100, 100)
# deviations from the mean by which to define Gaussian limits
devs = 3

# read in the gaussians from the data file
print 'reading in data...'
gaussians = readGaussians(inputFile)

# find the plot limits
limits = getPlotLimits(gaussians, devs)

# make the gaussian data file
print 'computing data for plotting...'
makeDataFile(gaussians, limits, res, outputFile)

# make the plot file
print 'plotting...'
makePlotFile(limits, outputFile)

This script produces the following output when run on your example data.


text:
Q: Перебор массива объектов js Не хватает знаний, чтобы решить задачу. Необходимо перебрать массив из объектов и получить из него другой массив, с результатом обработки.
Дан массив объектов, вида:
    [
  {
    Method: 'BankCard',
    Destination: '4111111111111111',
    Description: 'Банковская карта 16 знаков',
    Amount: 11,
    Account: 'RUB'
  },
  {
    Method: 'BankCard',
    Destination: '411111111111111111',
    Description: 'Банковская карта 18 знаков',
    Amount: 12,
    Account: 'RUB'
  },
  {
    Method: 'BankCard',
    Destination: '4222222222222222;CARDHOLDER NAME',
    Description: 'Банковская карта 16 знаков, Cardholder Name',
    Amount: 13,
    Account: 'RUB'
  },
  {
    Method: 'BankCard',
    Destination: '4333333333333333;',
    Description: 'Банковская карта 16 знаков, пустой Cardholder Name',
    Amount: 14,
    Account: 'RUB'
  },
  {
    Method: 'Mobile',
    Destination: '72131231231',
    Description: 'Телефон 11 знаков, 7 без плюса',
    Amount: 15,
    Account: 'RUB'
  },
  {
    Method: 'WMR',
    Destination: 'R123456789101',
    Description: 'WMR',
    Amount: 16,
    Account: 'RUB'
  },
  {
    Method: 'YandexMoney',
    Destination: '12313123132131200000',
    Description: 'YandexMoney',
    Amount: 17,
    Account: 'RUB'
  }
]

Массив может иметь другие значения. Задача обработать массив таким образом, чтобы получить результат обработки с суммарными данными. Нужно узнать какое количество операций и какая сумма по каждому Method. Например метод BankCard имеет 4 операции и общую сумму 50. Метод WMR имеет 1 операцию и общую сумму 16. Результат обработки записать в массив, вида:
[
  {
    Method: 'name',
    Length: length,
    Amount: summ
  },
  {
    Method: 'name',
    Length: length,
    Amount: summ
  }
]

A:

let aaaa =  [  {Method: 'BankCard',    Destination: '4111111111111111',    Description: 'Банковская карта 16 знаков',    Amount: 11,    Account: 'RUB'  },  {    Method: 'BankCard',    Destination: '411111111111111111',    Description: 'Банковская карта 18 знаков',    Amount: 12,    Account: 'RUB'  },  {    Method: 'BankCard',    Destination: '4222222222222222;CARDHOLDER NAME',    Description: 'Банковская карта 16 знаков, Cardholder Name',    Amount: 13,    Account: 'RUB'  },  {    Method: 'BankCard',    Destination: '4333333333333333;',    Description: 'Банковская карта 16 знаков, пустой Cardholder Name',    Amount: 14,    Account: 'RUB'  },  {    Method: 'Mobile',    Destination: '72131231231',    Description: 'Телефон 11 знаков, 7 без плюса',    Amount: 15,    Account: 'RUB'  },  {    Method: 'WMR',    Destination: 'R123456789101',    Description: 'WMR',    Amount: 16,    Account: 'RUB'  },  {    Method: 'WMR',    Destination: 'R123456789101',    Description: 'WMR',    Amount: 111,    Account: 'RUB'  }]

function countMethods(a){
  let b = {};
  a.forEach(p => {
    if( b.hasOwnProperty(p.Method) ){
      b[p.Method].Amount += p.Amount;
      b[p.Method].Length ++;
    }else{
      b[p.Method] = {"Method": p.Method, "Length":1, "Amount": p.Amount}
    }
  });
  return Object.values(b);
}

console.log(countMethods(aaaa));

A:

var originalData = [
  { Method: 'BankCard',      Destination: '4111111111111111',                   Description: 'Банковская карта 16 знаков',                           Amount: 11,   Account: 'RUB' },
  { Method: 'BankCard',      Destination: '411111111111111111',                 Description: 'Банковская карта 18 знаков',                           Amount: 12,   Account: 'RUB' },
  { Method: 'BankCard',      Destination: '4222222222222222;CARDHOLDER NAME',   Description: 'Банковская карта 16 знаков, Cardholder Name',          Amount: 13,   Account: 'RUB' },
  { Method: 'BankCard',      Destination: '4333333333333333;',                  Description: 'Банковская карта 16 знаков, пустой Cardholder Name',   Amount: 14,   Account: 'RUB' },
  { Method: 'Mobile',        Destination: '72131231231',                        Description: 'Телефон 11 знаков, 7 без плюса',                       Amount: 15,   Account: 'RUB' },
  { Method: 'WMR',           Destination: 'R123456789101',                      Description: 'WMR',                                                  Amount: 16,   Account: 'RUB' },
  { Method: 'YandexMoney',   Destination: '12313123132131200000',               Description: 'YandexMoney',                                          Amount: 17,   Account: 'RUB' },
]

var newData = Object.create(null)

for (let { Method, Amount } of originalData) {
  if (newData[Method]) {
    ++newData[Method].Count
    newData[Method].Amount += Amount
  } else {
    newData[Method] = { Method, Count: 1, Amount }
  }
}

newData = Object.values(newData)

console.log(newData)
.as-console-wrapper.as-console-wrapper { max-height: 100vh }

A: function calculate (data) {
    let result = {};

  for (let i = 0, j = data.length; i < j; i++) {
    if (!(data[i].Method in result)) {
        result[data[i].Method] = {
        Method: data[i].Method,
        Length: 0,
        Amount: 0
      };
    }
    result[data[i].Method].Length++;
    result[data[i].Method].Amount += data[i].Amount;
  }

  return Object.values(result)
}

A: Есть метод массива reduce. С ним задача решается следующим образом:
const reducer = (arr) => {
    return arr.reduce((last, now)=>{
         for (let item of last) {
              if (item.Method === now.Method) {
                  item.Length++;
                  item.Amount += now.Amount;
                  return last;
              }
         };
         last.push({Method: now.Method, Amount: now.Amount, Length: 1});
         return last;
    }), []);
}

Reduce работает так: в каждой итерации доступна переменная last - ее возвращает предыдущая итерация или, если цикл только начался, это значение по умолчанию (в данном случае пустой массив), - а также переменная now - непосредственно элемент массива, на котором сейчас цикл. Так, можно с каждой итерацией сокращать, видоизменять, редуцировать массив, возвращая новое значение last. В конце концов именно оно и будет возвращено из функции.

А вообще, почему здесь свойства с большой буквы?..

A: Нагляднее всего в таких случаях использовать Array.reduce, по крайней мере это сразу говорит читающему код, что вы каким-то образом сжимаете массив, группируете его, так что для понимая кода это проще.

const data = [{Method:'BankCard',Destination:'4111111111111111',Description:'Банковская карта 16 знаков',Amount:11,Account:'RUB'},{Method:'BankCard',Destination:'411111111111111111',Description:'Банковская карта 18 знаков',Amount:12,Account:'RUB'},{Method:'BankCard',Destination:'4222222222222222;CARDHOLDER NAME',Description:'Банковская карта 16 знаков, Cardholder Name',Amount:13,Account:'RUB'},{Method:'BankCard',Destination:'4333333333333333;',Description:'Банковская карта 16 знаков, пустой Cardholder Name',Amount:14,Account:'RUB'},{Method:'Mobile',Destination:'72131231231',Description:'Телефон 11 знаков, 7 без плюса',Amount:15,Account:'RUB'},{Method:'WMR',Destination:'R123456789101',Description:'WMR',Amount:16,Account:'RUB'},{Method:'YandexMoney',Destination:'12313123132131200000',Description:'YandexMoney',Amount:17,Account:'RUB'}];

let result = data.reduce(function(acc,v){
           if(!acc[v.Method]){
               acc[v.Method] = {
                   method: v.Method,
                   sum: 0,
                   count: 0
               };
           }
           acc[v.Method].count++;
           acc[v.Method].sum += v.Amount;
           return acc;
       }, {});

console.log(result);


text:
Q: Exponential equation, variable on both sides I need help with solving the following equation for t
$Re^{vht}=v_1t$ where $R,v,h,v_1$ are constants. Any suggestions appreciated.

A: Rewrite this as
$$
-\frac{Rvh}{v_1} = -vht\cdot e^{-vht}
$$
Applying the Lambert $W$ function we get
$$
W\left(-\frac{Rvh}{v_1}\right) = -vht\\
t = -\frac{W\left(-\frac{Rvh}{v_1}\right)}{vh}
$$
Using the $W$ function isn't much more than a rewriting, but there is nothing else that can be done when we have $t$ both in the exponent and outside it.

A: $\textbf{Note this is beyond pre-calc}$
Apart from the Lambert Function which @Arthur has mentioned, lets play with some cases where we can assume $vht<<1$ then we can approximate our equation as
$$
R(1+vht) = v_1t \implies t = \frac{R}{v_1-vhR}
$$
we obviously require $v_1 > vhR$.
But beyond this you would have to apply a numerical scheme to solve this
$$
R\mathrm{e}^{vht} - v_1t = f(t) = 0
$$
which is a classic root-finding problem.


text:
Q: Elliptic regularity Schauder estimates with Dirichlet/Neumann boundary conditions Consider the linear elliptic equation $Lu = 0$, where $L$ is a second degree elliptic operator with smooth coefficients on a bounded domain $\overline{\Omega} \subset \mathbb{R}^n$, where $\Omega$ is open. We also apply the Dirichlet boundary condition on $\partial \Omega$. Let us say that apriori $u$ is known to be in $L^2(\Omega)$.
Consider a ball $B_{2r}(x)$, where $x \in \overline{\Omega}$ and call $B_2 = B_{2r}(x) \cap \overline{\Omega}$. Also call $B_1 = B_{r}(x) \cap \overline{\Omega}$. Do we have estimates of the form
$$\Vert u\Vert_{C^{2, \alpha}(B_1)} \leq C\Vert u\Vert_{L^2(B_2)}?$$
Do we have analogous estimates for Neumann boundary conditions? I will be very grateful for a reference.
Edit: Is $u \in L^2$ enough to start with, or do we need stronger apriori conditions on $u$?

A: *

*One needs to start with a 'energy-weak solutions', i.e. $u \in W^{1,2}$, in the general case, even for interior regularity. If $L$ is the Laplacian, you can use Weyl's lemma to first prove that $u \in L^2$ implies $u \in W_{loc}^{1,2}$.

*Although the estimate you are looking for looks like a local estimate ( as you are only asking for estimate on $B_{1}$ to be controlled by quantities on $B_{2}$ ), since you are not assuming $B_{1}$ is not compactly contained in $\Omega,$ what you need is actually a boundary estimate and as such does not hold without more assumption on the boundary traces of $u$.

*Since as I mentioned in (2), it is a boundary estimate, one needs to start with at least $u \in W^{1,2}$ so that the Dirichlet and Neumann traces are defined ( in $W^{\frac{1}{2},2}(\partial\Omega)$ and $W^{-\frac{1}{2},2}(\partial\Omega)$ respectively ). But to obtain such an estimate, you need the traces to be $C^{2,\alpha},$ since otherwise $u$ can never be $C^{2,\alpha}$ up to the boundary, as mentioned by Andrews comment above.

*Now if you assume the boundary traces of $u$ are at least $C^{2,\alpha}$, the coefficients of $L$ are at least $C^{2,\alpha}$ and $\partial\Omega$ is at least of class $C^{2,\alpha},$ then one can obtain an estimate $$\lVert u \rVert_{C^{2,\alpha}(B_{1})} \leq C \left( \lVert u \rVert_{L^{2}(B_{2})} + \lVert u_{0} \rVert_{C^{2,\alpha}(\partial\Omega \cap B_{2})}\right), $$ where $u_{0} = u|_{\partial \Omega \cap B_{2}}$ and the constant $C$ depends on the dimension $n,$ the $C^{2,\alpha}$ norm of the coefficients of $L$ and the $C^{2,\alpha}$ norm of the mapping that locally gives the boundary $\partial\Omega.$ The same estimate holds for Neumann BVP ( one needs Neumann trace to be only $C^{1,\alpha}$ ).

*Thus by (4), you would obtain your estimate if the boundary values are 0.
In Gianquinta and Martinazzi's book:
http://www.springer.com/gp/book/9788876424427
You can read section 5.4 on Schauder estimates there. Specifically Theorem 5.19 and 5.20. These give the gradient estimates, but can easily be iterated to give hessian estimates.
On the other hand, the estimate in Theorem 5.20 is somewhat misleading, as it does not have the $\lVert u \rVert_{L^{2}}$ term. The term in general can not be dropped, unless you have uniqueness of solutions. If $L$ has lower order terms, uniqueness might not be ensured.
Remark about my previous answer:
I do not know if the question has been edited in the meantime, but as the question stands now, my previous answer seems flat out wrong. I can not remember what I was thinking when I wrote this. May be I missed that you assumed smooth coefficients of $L$. Just for the sake of records, I keep it here unchanged.
" If the coefficients are not constant, such an estimate can not be expected to hold even with Dirichlet boundary data for domains with smooth boundary... for constant coefficient equations, they certainly hold for the Dirichlet BC on a smooth enough domain. You can see Gianquinta and Martinazzi's book:
http://www.springer.com/gp/book/9788876424427 "


text:
Q: Using ggplot2 to create a line chart showing spread between two variables in each observation Here's my data:
   Assignment first Stage  Grade Type
1        PA06  98.5 final  98.50   PA
2        PA06  98.5 final  98.50   PA
3        PA06  83.0 final  83.00   PA
4        PA06 100.0 final 100.00   PA
5        PA06 100.0 final 100.00   PA
6        PA06  98.5 final  98.50   PA
7        PA06  86.0 final  86.00   PA
8        PA06 100.0 final 100.00   PA
9        PA06  84.5 final  88.00   PA
10       PA06  95.0 final  95.00   PA
11       PA06  83.0 final  90.00   PA
12       PA06   0.0 final   6.75   PA

I am thinking that I want a chart with observations along the x axis, showing a vertical line starting at "first" and ending at "Grade".
Notice that often first and Grade will be equal and in that case I get just a dot. Otherwise I get a line with dots at each end. And I want no labels on the x axis.
This may be a little odd, but I am experimenting with my data. I think it should be "easy" but I can't seem to get it.  Here's what I've tried so far:
ggplot(x2, aes(x=first, y=Grade)) + geom_line()
ggplot(x2, aes(x=email)) + geom_point(aes(y=Grade, col="blue")) + geom_point(aes(y=first, col="red"))

A: Using geom_dumbbell() from the ggalt package:
mydf$case <- 1:nrow(mydf)

library(ggplot2)
library(ggalt)

ggplot(mydf, aes(first, case, xend = Grade)) +
   geom_dumbbell(size_x = 2, size_xend = 2) +
   coord_flip() +
   theme(axis.ticks.x = element_blank(),
         axis.text.x = element_blank(),
         axis.title.x = element_blank())

Data:
mydf <- read.table(text="Assignment first Stage  Grade Type
1        PA06  98.5 final  98.50   PA
2        PA06  98.5 final  98.50   PA
3        PA06  83.0 final  83.00   PA
4        PA06 100.0 final 100.00   PA
5        PA06 100.0 final 100.00   PA
6        PA06  98.5 final  98.50   PA
7        PA06  86.0 final  86.00   PA
8        PA06 100.0 final 100.00   PA
9        PA06  84.5 final  88.00   PA
10       PA06  95.0 final  95.00   PA
11       PA06  83.0 final  90.00   PA
12       PA06   0.0 final   6.75   PA", header = TRUE)

A: # Load package
library(tidyverse)
library(data.table)

# Create example data frame
dt <- fread("Assignment first Stage  Grade Type
PA06  98.5 final  98.50   PA
            PA06  98.5 final  98.50   PA
            PA06  83.0 final  83.00   PA
            PA06 100.0 final 100.00   PA
            PA06 100.0 final 100.00   PA
            PA06  98.5 final  98.50   PA
            PA06  86.0 final  86.00   PA
            PA06 100.0 final 100.00   PA
            PA06  84.5 final  88.00   PA
            PA06  95.0 final  95.00   PA
            PA06  83.0 final  90.00   PA
            PA06   0.0 final   6.75   PA")

# Preprocess the data
dt2 <- dt %>%
  # Add ID
  mutate(ID = 1:n()) %>%
  # Reshape the data
  gather(Class, Score, first, Grade)

# Plot the data
dt2 %>%
  ggplot(aes(x = factor(ID), y = Score)) +
  geom_point(aes(colour = Class)) +
  geom_line(aes(group = ID)) +
  scale_x_discrete(name = "")


text:
Q: How to implement android.media.Image? I have data regarding all the image planes required for media.Image but as its abstract and default constructor is intentionally not exposed, How can I create an instance?
My other libraries take Image as a parameter and I have data from NDK(AImage) which has all required information.


text:
Q: How to read two sheet from CSV file I have two sheets in CSV excel file which I upload using the following code. But from this code it reads only the first sheet. Even httpRequest.Files.Count returns only 1. How to read both sheet of the file
var httpRequest = HttpContext.Current.Request;
            if (httpRequest.Files.Count > 0)
            {
                foreach (string file in httpRequest.Files)
                {
                    long dataSourceId = 1;
                    var postedFile = httpRequest.Files[file];
                    var filePath = HttpContext.Current.Server.MapPath("~/" + postedFile.FileName);
                    //postedFile.SaveAs(filePath);
                    Stream stream = postedFile.InputStream;
                    byte[] fileData = null;
                    using (var binaryReader = new BinaryReader(postedFile.InputStream))
                    {
                        fileData = binaryReader.ReadBytes(postedFile.ContentLength);
                    }
                    Stream strrr = new MemoryStream(fileData);

                }
            }

A: From what I can tell CSV files aren't workbooks like Excel files, so you won't be about to read CSV file with two sheets as two entities on a single file. This is why I came to that conclusion:
http://network.ubotstudio.com/forum/index.php/topic/3236-save-in-multiple-sheets-in-a-csv-file/
You have two options: 1) Create multiple CSV files with the needed data and read from them individually OR 2) Use an Excel file that is formatted to handle these multiple sheet features.


text:
Q: Can you open a Direct Message on Instagram's browser via a URL that uses Instagram ID or Username? I am sending multiple Instagram direct messages and would like to pre-populate URLs that open up a direct message between me and my follower. I have the Instagram ID and usernames of each follower.
Currently, Instagram has its "inbox" at https://www.instagram.com/direct/inbox/.
When I manually create a direct message, it follows the following format: https://www.instagram.com/direct/t/[long numeric slug that seems randomly generated]
I'm curious if there's some other URL that would open up a chat initially, such as:
https://www.instagram.com/direct/[Instagram ID]
OR
https://www.instagram.com/direct/[Instagram Username]
Has anyone figured out a solution?

A: As far as I know, there currently is no way to open a chat with someone using an url.

A: Now you can create direct link to Instagram Inbox. Use link like this
https://ig.me/m/username

A: Use the link
https://instagram.com/m/username

and replace username as appropriate.


text:
Q: QtCreator no debugger set up (Windows) I am trying to use Qt creator on Windows, and when I try to Start Debugging, it says "No debbuger set up". How do I configure it?

A: This is documented in the Qt Reference Documentation on Setting up the Debugger.
You'll need to install the Debugging tools for Windows (installing the Windows SDK provides this) which will give you the cdb.exe debugger. You may or may not encounter an issue when installing the Windows SDK and require this work around: Error when installing windows SDK 7.1
Now, start Qt Creator and go to Tools -> Build & Run -> Debuggers, verify that you now see Auto-detected CDB. Then go to the Kits tab select  Manual -> Desktop and change the Debugger value to the Auto-detected CDB.
Now start your project in Debug mode (F5).

A: Go to Extras -> Properties -> Compile & Run Section. See on tab Compiler if there is a compiler selected. If not select an compiler and set the corresponding debugger. Else you eventually have to manually add a compiler and locate your path to your debugger (MSVC and CDB for example).

A: When we are going to debug a program in Qt Creator by pressing F5, F10 or F11, we need to have cdb.exe installed on the system or it shows the following message:

"Unable to create a debugging engine"

To install cdb.exe on Windows, we need to do the following steps:
• Go to https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/
• Click get the Windows SDK here, download the installer and run it
• Uncheck all boxes but "Debugging Tools for Windows" and wait until it installs
• Go to Qt Creator setting and click Manage Kits
• Select auto detected kit and find the debugger at its property section
• Click on the manage and specify to the path C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe
• Everything works well now
Arman Arefi


text:
Q: Cypher: find a path which takes the maximum valued step each time I am trying to write a cypher query that finds a path between nodes a and b such that each step has the maximum timestamp value out of all available alternatives that is less than 15.
Here is my query so far, it does everything except for select the maximum possible timestamp at each step. How do I express this condition?
MATCH path=(a:NODE)-[rs:PARENT*]->(b:NODE)
WHERE a.name = 'SOME_VALUE' and b.name = 'SOME_OTHER_VALUE' AND ALL (r IN rs
  WHERE r.timestamp < 15)
RETURN path

This is just awful sudo code but I think it expresses what I am looking for
MATCH path=(a:NODE)-[rs:PARENT*]->(b:NODE)
WHERE a.name = 'SOME_VALUE' and b.name = 'SOME_OTHER_VALUE' AND ALL (r IN rs
  WHERE r.timestamp < 15 AND r.timestamp = max(allPossibleRsForThisStep))
RETURN path

Can this kind of query be written in cypher?

A: It won't be fast in cypher, it's possible to compute all maximum values first and then do what you want to do by compare the max value in a list with the current value.
Something like this (not sure if it works)
WITH range(1,10) as max_vals // a list with 10 values (actual values are not that important)
MATCH (a:NODE)-[rs:PARENT*..10]->(b:NODE)
WHERE a.name = 'SOME_VALUE' and b.name = 'SOME_OTHER_VALUE'
WITH a,b,
      map(idx in range(0,size(rs)) |
        max_vals[idx] = case when max_vals[idx]<rs[idx].timestamp then rs[idx].timestamp else max_vals[idx] end ), max_vals

MATCH path=(a)-[rs:PARENT*..10]->(b)
 AND ALL (idx in range(0,size(rs)  WHERE rs[idx].timestamp < 15 AND rs[idx].timestamp = max_vals[idx])
RETURN path


text:
Q: OpenLayers: How can I add multiple KML files to the same vector layer? I'm trying to add some KML files to a vector layer using this code:
            var map = new OpenLayers.Map('map');
            map.addLayer(new OpenLayers.Layer.OSM());
            var kml = ['kml/file1.kml','kml/file2.kml' ... 'kml/fileN.kml'];

            function createFeatures() {
                var features = [];
                for (var i=0; i<kml.length; i++) {
                        features.push(new OpenLayers.Feature.Vector(
                            new OpenLayers.Protocol.HTTP({
                                url: 'kml/file'+i+'.kml',
                                format: new OpenLayers.Format.KML()
                            }
                        )));
                }
                return features;
            }

            var vectors1 = new OpenLayers.Layer.Vector("Vector Layer 1", {
                isBaseLayer: false,
                style: { strokeWidth: 3, strokeColor: "#FF0000", fillOpacity: 0.50, fillColor: "#FF0000" }
            });
            map.addLayer(vectors1);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            vectors1.addFeatures(createFeatures());

I get this error:
Uncaught TypeError: a.geometry.getBounds is not a function

A: new OpenLayers.Feature.Vector creates a single feature from a geometry, which explains the error.  You would need to load each kml, which would be an asynchronous operation, and when loaded read the features and add them to the layer.  Here's some very basic code:
        var map = new OpenLayers.Map('map');
        map.addLayer(new OpenLayers.Layer.OSM());
        var kml = ['kml/file1.kml','kml/file2.kml' ... 'kml/fileN.kml'];

        var vectors1 = new OpenLayers.Layer.Vector("Vector Layer 1", {
            isBaseLayer: false,
            style: { strokeWidth: 3, strokeColor: "#FF0000", fillOpacity: 0.50, fillColor: "#FF0000" }
        });
        map.addLayer(vectors1);
        map.addControl(new OpenLayers.Control.LayerSwitcher());

        var format = new OpenLayers.Format.KML({
            externalProjection: new OpenLayers.Projection('EPSG:4326'),
            internalProjection: new OpenLayers.Projection('EPSG:900913')
        });

        function loadKML(url) {
            var xhr = new XMLHttpRequest();
            xhr.onload = function() {
                var features = format.read(xhr.responseText);
                console.log(features);
                vectors1.addFeatures(features);
            }
            xhr.open("GET", url, true);
            xhr.send();
        }

        for (var i=0; i<kml.length; i++) {
            loadKML(kml[i]);
        }


text:
Q: Errors when Validation function is in use with other function This is more of a continuation of my last question, I created a validation function for use with code I was given by a friend, here's the validation function which works fine(?):
def validation(goodNum,score):
goodNum = False
while goodNum == False:
    score = raw_input("Please enter a valid score between 1 and 10 ")
    try:
        score = int(score)
    except:
        continue
    if score > 1 and score < 11:
        goodNum = True
    else:
        print "Invalid input"
return score

The issue I have is implementing this into the other function, which looks like this:
def scoreCalculator(finalists):
scores = []
sortedScores = []
for number in range(5):
    print ("Please enter a score for ", finalists[number])
    print ("---------------------------------------------------------------------------------------------------------------")
    for number in range(5):
        scores.append(validation(0,10))
        maxScore = scores[0]
        minScore = scores[0]
        for number in scores:
            if number > maxScore:
                maxScore = number
            elif number < minScore:
                minScore = number
                scores.remove[minScore]
                scores.remove[maxScore]
                sumScore = sum[scores]
                sortedScores.append(sumScore)

When attempting to run the program I receive the error:
line 57, in <module>
scoreCalculator(finalists)
line 44, in scoreCalculator
scores.remove[minScore]
TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'

As a beginner to python I've never really seen this before, I've searched for a solution, but those I could find talked about indexes, which I don't have here(?), and things being called wrongly with a misuse of either () or [], but I'm not sure where I should correct if that is the case. Any tips?

A: As stated by Eolmar:
The error is at line 44: scores.remove[minScore]. As said in the error message. You have to use () when calling function.


text:
Q: Oracle duplicate entries bases on Two columns i need a query to get duplicate entries from table A on bases of two columns (Acol2 and Acol3) and Bcol3 from Table b where A.Acol4= B.Bcol2.
theefore two crequirements
1-select duplicats entries( on basis of columns Acol2 & Acol3)  and Bcol3 from table A and table B
2- where A.Acol4= B.Bcol2
I am able to write query to get duplicate entries but unable to get bcol3 with condition 2.

A: create the join and then group by to find duplicates
  SELECT a.acol2, a.acol3, b.bcol3
    FROM a, b
   WHERE a.acol4 = b.bcol2
GROUP BY a.acol2, a.acol3, b.bcol3
  HAVING COUNT (*) > 1


text:
Q: Run a command when a disk is inserted (Linux) I would like to automatically run my own command any time a drive is inserted under Linux (including USB drives, for example). Obviously the simplest solution would be to regularly poll and check for changes to /proc/partitions or to /dev/disk, but I was hoping for something a little more elegant than that.
EDIT
I know this is possible, because GNOME does this very thing; any time a new drive is inserted, GNOME runs it's own "autoplay" mechanism to take some action. ("Would you like to view the pictures on this SD card?")
I can come up with two uses for this: the first is in an Amazon EC2 cluster I manage, to detect and initialize newly attached EBS storage volumes automatically.
The other usage is on a Linux-based home file-server device; when I insert an SD card into the device, it should mount the card, move the pictures from the card onto the internal hard drive, unmount the card, and then beep to let me know it's done.

A: I found a pretty good link here.
http://linlog.skepticats.com/content/udevautorun/
Basically you can place scripts in /etc/udev for all block devices or specific ones.

A: Udev rules are what you are looking for. From the man page itself:

... If udev receives a device event, it
  matches its configured rules against
  the available device attributes
  provided in sysfs to identify the
  device. Rules that match may provide
  additional device information or
  specify a device node name and
  multiple symlink names and instruct
  udev to run additional programs as
  part of the device event handling. ...

Emphasis mine.
The rules files are in /etc/udev/rules.d/ and their documentation is in udev(7). Oh, and they work for practically everything.

A: Autorun ( http://linux.die.net/man/1/autorun ) takes care of CDs, but I don't think something like that exists for other media. I'm really not of the opinion that it /should/, either.
You might be able to craft autorun into looking at dmesg on occasion, but chances are good that it will only work for your pet system.
What is your overall goal? Maybe there's a better way?