text:
Q: ERROR 404 con un FORM POST pasando objeto MVC SPRING espero que me puedan ayudar, desde el index de mi proyecto el usuario va al boton "agregar vuelo" que usar el primer metodo que especifico en el controlador, ya desde esta vista, el usuario introduce datos del vuelo, este formulario esta con post y lo que quiero es enviar el vuelo en si y al enviarlo al controlador por el metodo post me salta el error -> Estado HTTP 400 – Bad Request El requerimiento enviado por el cliente era sintácticamente incorrecto. Les dejo el codigo. Gracias!
VISTA registroDeVuelo.jsp
        <form:form action="procesoCrearVuelo" method="POST" modelAttribute="vuelo">

            Fecha y hora de Despegue:
            <form:input path="fechaDeDespegue" type="datetime-local"
                id="fechaDeDespegue" name="fechaDeDespegue" />

            Fecha y hora de Arribo:
            <form:input path="fechaDeArribo" type="datetime-local"
                id="fechaDeArribo" name="fechaDeArribo" />

                Origen:
                <form:select path="origenAeropuerto" class="custom-select"
                    name="origenAeropuerto">
                    <c:forEach items="${aeropuertos}" var="aeropuerto">
                        <form:option value="${aeropuerto}">${aeropuerto.id_aeropuerto}
                            (${aeropuerto.nombre})</form:option>
                    </c:forEach>
                </form:select>

                Destino:
                <form:select path="destinoAeropuerto" class="custom-select"
                    name="destinoAeropuerto">
                    <c:forEach items="${aeropuertos}" var="aeropuerto">
                        <option value="${aeropuerto}" selected>${aeropuerto.id_aeropuerto}
                            (${aeropuerto.nombre})</option>
                    </c:forEach>
                </form:select>

                Aeronave del vuelo:
                <form:select path="aeronaveDeVuelo" class="custom-select"
                    name="aeronaveDeVuelo">
                    <c:forEach items="${aeronaves}" var="aeronave">
                        <option value="${aeronave}" selected>${aeronave.nombre}-
                            ${aeronave.matricula}</option>
                    </c:forEach>
                </form:select>

                <button class="btn btn-outline-secondary" type="submit">Sumar
                    vuelo</button>

        </form:form>

Controlador
**ESTE METODO LLEVA A LA VISTA PARA INGRESAR EL VUELO, POR ESO ESTA EL OBJETO VACIO**
@RequestMapping("/direccionCrearVuelo")
    public ModelAndView irASumarNuevoVuelo() {

        Set<Aeropuerto> aeropuertos = servicioAeropuerto.obtenerAeropuertos();
        Set<Aeronave> aeronaves = servicioAeronave.obtenerAeronaves();
        Vuelo vuelo = new Vuelo();
        ModelMap modelo = new ModelMap();
        modelo.put("aeropuertos", aeropuertos);
        modelo.put("aeronaves", aeronaves);
        modelo.put("vuelo", vuelo);

        return new ModelAndView("registroDeVuelo", modelo);
    }

**ESTE METODO ES EL QUE RECIBE EL FORMULARIO**
    @RequestMapping(path="procesoCrearVuelo", method = RequestMethod.POST)
    public ModelAndView procesoCrearVuelo(@ModelAttribute("vuelo") Vuelo vuelo) {

        ModelMap modelo = new ModelMap();
        modelo.put("vuelo", vuelo);

        Long instanciado = servicioVuelo.persistirVuelo(vuelo);

        return new ModelAndView("registroDeVuelo", modelo);
    }

MODEL VUELO
@Entity
public class Vuelo {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long nro_vuelo;
    @ManyToOne
    private Aeropuerto origenAeropuerto;
    @ManyToOne
    private Aeropuerto destinoAeropuerto;
    @ManyToOne
    private Aeronave aeronaveDeVuelo;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime fechaDeDespegue;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime fechaDeArribo;

    private Double horasDiurnas;
    private Double horasNocturnas;

    private Estacion estacion;

    public Vuelo() {
    }

Tengo q agregar texto jejejejeeje

redpajama_set_name: RedPajamaStackExchange


The role of the chief information officer has changed in recent years in just about every field. Innovations such as the cloud and BYOD have made it possible for CIOs to spend more time on strategic planning and fewer hours keeping systems up and running. In the insurance industry this fundamental shift is empowering IT leaders to focus on the new and burgeoning practice of data analytics. Executives and analysts who are used to actuarial tables and Excel spreadsheets will look to their CIOs as ambassadors from the strange new world of big data—and will expect them to deliver a swift and painless marriage of legacy systems and digital power.
As an insurance CIO, it's your job to leverage the robust potential of analytics to drive revenue, control costs, and mitigate risk—and to do it better than your peers at competing payers. To achieve operational excellence you need to know how to harness new innovations to gather broader, smarter, and more precise data. If analytics is all about predicting trends, executives who can see the potential in new tools like the cloud, smart wearables, and the Internet of Things (IoT) to enhance data analysis will have the best chance of guiding the insurance industry into the future.
The field of analytics is already overflowing with data (according to data expert John Bates, humanity is collecting enough information to fill the Library of Congress every 14 minutes). But until just recently, this has mostly been gathered by tracking, browsing, shopping, and usage information, essentially tracking results rather than causes, analyzing results, not roots. In health care alone, the advent of smart wearables like the Fitbit has opened up whole new ways to gather information on wearers' moment-to-moment health to proactively monitor vital signs and encourage healthy living while gathering absolutely enormous quantities of data. This lets payers gather a much more complete image of the healthcare habits of both individual wearers and populations. 20 percent of Americans own at least one wearable device, and the number will only climb worldwide over time, drastically increasing the breadth and depth of collectible data.
"People often wonder what would happen if "these walls could talk," but thanks to innovations like Siri and Alexa we are pretty close to that becoming a reality"
The amount of data to be gleaned from a user's wearables is limited only by how much information can be monitored and collected. Referring once more to healthcare, an item like a smartwatch could be enhanced to keep tabs on heart rate, blood glucose levels, blood pressure, body temperature, and more, including how various readings fluctuate throughout the day. And this doesn't even account for cutting-edge items like smart ingestibles to monitor organ function or smart contact lenses. Consumers will use these kinds of devices for the added safety and aid they provide, and the data that is collected will help form a clear and actionable body of data to improve insurance practice worldwide.
People often wonder what would happen if "these walls could talk," but thanks to innovations like Siri and Alexa we are pretty close to that becoming a reality. What would the items we use every day say about us if they could? As our world becomes more and more interconnected and everything goes online, this question is swiftly ceasing to be rhetorical. The Internet of Things is transforming how we link the items we use to better track, automate, and regulate the tasks those items perform. We are only a few years from the science-fiction dream of the smart house that knows everything about its occupants' routines and creature comforts (it's no accident that Google spent billions of dollars acquiring Nest, a smart thermostat), and we're already past the birth of the self-driving car.
But connecting devices online does more than allow parents to automatically order juice boxes after the kids have raided the fridge or record their favorite TV shows. As our appliances, computers, phones, toys and other household items gather data on their users, they aggregate information that can easily be sent to the users' insurers to perform the sort of data mining that can easily create an ideal insurance plan and help payers develop new programs to help control costs and improve health outcomes.
Take those self-driving cars and even their smart-car cousins. A vehicle can collect millions of bytes of information, from the speed of traffic to the frequency of police on the roads to the condition of the roads themselves. A smart car can track the driver's habits and help their insurers customize plans that enhance safety and reward responsible driving. By 2020, the IoT will include 25 billion connected items and soon 92 percent of everything we do will be in the cloud, creating an embarrassment of riches for CIOs who stay ahead of the data curve.
Insurers should absolutely make data mining a conscious opt-in where users reap benefits for their participation without intrusive and illegal information collection protocols. A homeowner who uses their appliances responsibly has every reason to let their property insurer know it. A healthcare insurance buyer can use their wearable to lead a healthier lifestyle, improving their quality of life while justifying lower monthly payments.
Payers who offer these kinds of programs will drive revenues as they attract policyholders who want coverage that maps to their personal habits rather than a statistical mean. There's a big difference between a 45-year-old man who runs 20 miles a week and a 45-year-old man with the local KFC on speed dial. Data gathered—and personalized—this way will drastically lower risk as CIOs develop systems that recognize widespread patterns and use this information to improve their key processes and improve overall results.
The most important thing to understand about all of these innovations is that they have already arrived and are already being used by forward-thinking CIOs who are looking for every possible advantage to improve outcomes. Just as the companies that first embraced big data had a noticeable edge over their competition, payers that figure out how to best integrate wearables, the IoT, and whatever wonderful new invention our digital age rolls out next will have a clear advantage in the crowded and competitive insurance industry.


Game Server BASIC – Unbeatable Game Server for an Unbeatable Price!
Our Game Server BASIC is THE solution for small clan servers or those in need of inexpensive but still powerful public servers. Starting at just €0.39 per server slot, the BASIC product line meets all the requirements of small clans and is also appropriate for league play in the ESL. Voice server, MySQL databases as well as Hlstats and Fastdownload can be booked as well. You can switch between games at any time in seconds – for free!


Shopping centres are designed to provide consumers with a pleasant environment to purchase everything they need in one convenient location, and to make shopping an enjoyable experience. Well-designed lighting plays a crucial role in this scenario.
The idea behind shopping centres is to make shopping a pleasant experience rather than a stressful chore. Since most shopping centres today are primarily accessed by car, their integrated car-parking facilities play an essential role in the overall architectural concept. Proper lighting, often a combination of daylight and artificial light, serves the important purpose of guiding drivers to and from the parking spaces while ensuring the safety of pedestrians, especially those pushing fully-loaded shopping trolleys or being accompanied by children. OSRAM Lighting Solutions has equipped many car-parking facilities, including their access lanes, with energy-saving, low-maintenance LED illumination which ensures visibility, enhances safety, and contributes to a smooth and trouble-free flow of vehicles and people.
The main traffic areas ‒ corridors, passageways, escalators, lifts and stairs ‒ are the essence of every shopping centre, interconnecting the individual levels and shops. With resting areas, open spaces, skylights, fountains, plants, art exhibitions, information boards and terminals and many other architectural features they create the unique atmosphere and appeal of the complex. Light is an integral design element of all this, and OSRAM Lighting Solutions is your full-service provider of illumination technology and expertise to make your architectural concept spring to life. Smart lighting management combines daylight with artificial light to ensure adequate illumination levels at all times while keeping the energy bill under control. State-of-the-art luminaires by OSRAM Lighting Solutions are available for virtually any lighting purpose, from general lighting to information booths, from resting zones to food courts, and from green zones with live plants through to playgrounds for children. A flexible lighting architecture is key in shopping centres where tenants, brands, seasonal needs and decoration tend to change often and spaces are repurposed from time to time.
In a shopping centre where one shop sits next to the other, individuality and branding are essential differentiators. Naturally every tenant has specific design and illumination ideas for his or her shopfront, including illumination intensity, incident angles and colours, so centre owners are well advised to design their facilities with utmost lighting flexibility. OSRAM Lighting Solutions offers a wide range of luminaires and computer-controlled lighting management hardware and software to accommodate the varied needs of shops and stores, restaurants and service providers, supermarkets and department stores forming the business community of the shopping centre, plaza or mall. Advanced LED technology offers a great way to bring brilliance into your facility while cutting your energy bill.
From fruits and vegetables to clothing and footwear, from household supplies to toys, and from doctor's offices to telecommunications providers, a shopping centre reflects the enormous spectrum of goods and services available to consumers today. Lighting needs are as diverse as the vendors, and tenants tend to change, so light installations must be highly flexible to accommodate changing requirements. Designers want to highlight specific areas and create zones within shops and stores using lighting effects. Specific products call for specialised lighting, whether fresh produce, shoes or jewellery. All this can be made possible by installing lighting technology made by OSRAM Lighting Solutions, backed by our solid know-how and experience gained in countless successful projects.
Whatever it is that needs to be stored ‒ supplies, decorative items, equipment, furniture or merchandise, ‒ orderliness and clarity are key. Your personnel needs to be able to find what they need quickly to get the job done. Use energy-efficient LED luminaires, combine artificial light with daylight where available, and use motion detectors to switch the lights on and off as needed to get the best light on demand for workplace safety, unobstructed manoeuvring and easy identification of items. OSRAM Lighting Solutions has the lighting technology you need to bring light into every space of your facility.


text:
Q: PHP If/Else Statements I have a mysql table called users with the following fields:
username - password - role

The role consists of normal user and admin.
What I want is so when an admin logs in it gets redirected to another page and not the same page a normal user would log in. My code is as follows:
<?php
include("../includes/db.php");

$username=$_POST['username'];
$password=$_POST['password'];

$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);

$sql="SELECT * FROM Users WHERE username='$username' and password='$password' And role = 'normaluser'";
$result=mysql_query($sql);

$count=mysql_num_rows($result);

if($count==1){
session_register("username");
session_register("password");
header("location:myaccount.php");
}
?>

I have the code working for the normal user but I just don't know how to write the code for the admin part.

A: Retrieve role from the query, check to see what it is, then set the header location accordingly.

A: I'd say
$sql="SELECT role FROM Users WHERE username='$username' and password='$password'";
$result=mysql_query($sql);
while ($row = mysql_fetch_object($result)) {
    //one hit i hope?!
    //DONT save your apssword in the session!!!!
    //session_register("username");
    //session_register("password");

    $role = $row->role;

}
if($role == "user"){
    redirect1
}elseif($role == "admin"){
   redirect2;
}else{
  redirect panic
}

A: $sql = "SELECT * FROM Users WHERE username='$username' and password='$password'";
// ...
if($count == 1){
   $user = mysql_fetch_array($result);
   if ($user['role'] === 'normaluser')
   {
      session_register("username");
      session_register("password");
      header("location:myaccount.php");
   }
   if ($user['role'] === 'admin')
   {
      header("location:admin.php");
   }
}

A: define some constants like below or use the bitmasking algoritim. (php_manual).
index.php or if your using a framework check the docs.
define('USER_ADMIN', 'a');
define('USER_USER', 'u');

build a permissions table with type text set to null
`permissions` text null

to build your user_permissions row in your views use the checkbox's
<input type="checkbox" name="permissions[]" value="u" selected />
<input type="checkbox" name="permissions[]" value="a" selected />

assigning data
$user='';

$user = (isset($_SESSION['uid'])) ? User::find($_SESSION['uid']) : '';

if(isset($user) && in_array(USER_ADMIN, $user['permissions']))
{
   //i am an admin
}
else
{
  //i am NOT an admin
}


text:
/* TestFilePath:testdata/b/perfectString  */
#include <stdio.h>
#include "clib/b/perfectString.h"

#define MAXLEN 10000
char str[MAXLEN];
int main(int argc,char * argv[])
{
    scanf("%s\n",str);
    printf("%d\n",perfectString(str));
    return 0;
}

redpajama_set_name: RedPajamaGithub