text:
Q: java persistance memory leaks I have 1M rows in a mysql table and I am java persistence api when I execute following code then I get java heap error:
int counter = 0;
while (counter < 1000000) {
   java.util.Collection<MyEntityClass> data = myQuery.setFirstResult(counter)
       .setMaxResults(1000).getResultList();
   for(MyEntityClass obj : data){
       System.out.println(obj);
   }
   counter += 1000;
}

A: I'd wonder if JTable is really hanging onto all those old references when you click "next".  I don't believe it's a persistence problem.  Whatever backing data structure you have behind the JTable, I'd make sure that I cleared it before adding the next batch of records.  That way the old values can be GC'd.
Your JTable shouldn't have a ResultSet.  It'd be better to have a persistence tier that hid such details from clients.  Make the query for a batch of values (not the entire data set), load it from the ResultSet into a data structure, and close the ResultSet and Statement in a finally block.  You need to close those resources in the scope of the method in which they were created or you're asking for trouble.

A: The problem is almost certainly that your resultSet object is caching the entire result set, which will eat up a lot of memory for such a large query.
Rather than resetting the index on the resultSet as you do at present - which doesn't clear the cached result, I would suggest you write a query that retrieves the appropriate rows for the given page, and execute that each time the page changes. Thow away the old result set each time to ensure you're not caching anything.
Depending on the database you are using, you would either use the rownum pseudo-column (Oracle), the row_number() (DB2, MSSQL) function or the limit x offset y syntax (MySql).

A: *

*Is this a Java EE or Java SE application?

*How are you handling your entity
manager?

The entity manager is typically associated with a context. During a transaction every entity that you recover is going to be placed in it, and it will be a cache for all entities, when the transaction commits, JPA will search for modifications in the context and commit the changes to the database.
This implies that if you recover 1 million rows you will have 1 million entities in your context, and they will not be garbage collectable until you close your entity manager.
Since you are referring to a JTable I can only assume this is a JSE application. In this type of application you are in total control of the context. In this type of application there is a one-to-one relationship between context and the entity manager (which is not always the case in Java EE environment).
This implies that you can either create an entity manager per request (i.e. transaction or conversation) or an entity manager for the entire life of the application.
If you are using the second approach, you context is never garbage collected, and the more objects you read from the database the bigger it becomes, until you may eventually reach a memory problem like the one you describe.
I am not saying this is the cause of your problem, but it could certainly be a good lead on finding the root cause, don't you think?

A: Looks like your resultSet is not subject for GC in his particular case. Inspect your code and see, where the link to this resultSet really goes so that memory leak occurs.


text:
Q: phonegap iphone digitalcompass update accuracy I am in the process of developing an augmented reality iphone app in javascript using the phonegap library and it's turning out quite well.  I put a low pass filter to calm down the accelerometer readings used on tilt of the device which works very nicely.  However, I can't get a smooth left/right moving.  It seems that my magentometer will only update everytime it moves a whole
degree.  Onload, I'm looking at a value of 196.721054, and then rotating it left, it doesn't budge until it gets to 195.721054 (one degree difference). Surely, this device has to be more precise than one degree of rotation.
Does anybody know if there's a setting to lower the threashold of this to get more frequent updates?  FYI, here's my code:
var magneticHeading;//global variable
function startCollectingData() {
       magneticHeadingWatchID = navigator.compass.watchHeading(function(heading){
               magneticHeading=heading.magneticHeading;//save it as a global variable
       }, function(){/*don't do anything onFail*/},
       { frequency: 100});
}

I read somewhere that in the options, I can do something like headingFilter:.01, but that doesn't seem to help much.
Thoughts?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Why do my Unity3D sprites look pixelated when rendered on my iPhone? I'm a newbie in Unity3D, I'm making a 2D game, but, I'm making the menu, and it's all pixelated! Om my PC it looks fine, but when I run it on my iPhone, it pixelates.
I have the "compress assets on import" option turned off, and the image's original size is bigger than the size that have in Unity!
This is how it looks on my iPhone:

And this is how it looks on my PC:

PS: All of the components are buttons with PNG images; I don't know if that affects anything.

A: In your sprite import settings, change "Filter Mode" to "Point".

I believe this prevents the blurring on small screens as displayed items are enlarged and let things stay sharp (pixelated).

A: one thing you can try is to set your font-size up high, then scale your objects up,and then reduce the size back down (Not from scaling). Use point for images.


text:
Q: How to perform concatination in a template in angular js I have a template which I need to show the path of a template dynamically.

$scope.templateUrl = "text";

But the link is not mapped as :
app/templates/text.html

Can any one please help me. Thanks.

A: Try this way. Make a string by concatenating the parts.


text:
Q: Search Excel file for a string I'm basically looking to write a script that checks if a certain string exists on a specific file on the network, and return 0 or 1.
So basically:
If "C:\myfile.xls" exists THEN
  If "C:\myfile.xls" contains string "no data found" THEN
    Return 0
  ELSE
    Return 1
ELSE
  Return 0
END

Is this possible?  Much appreciated in advance!!
I believe I am running v2.0
Name                           Value
----                           -----
CLRVersion                     2.0.50727.5466
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

A: You shouldn't ask yes/no questions unless you expect the answer to be either "yes" or "no". In your case it's "yes", but you need Excel installed on the host:
function Check-File($filename) {
  $found = 0

  if ( Test-Path -LiteralPath $filename ) {
    $xl = New-Object -COM "Excel.Application"
    $wb = $xl.Workbooks.Open($filename)
    if ( [bool]$xl.Cells.Find("no data found") ) { $found = 1 }
    $wb.Close()
    $xl.Quit()
  }

  $found
}

Check-File "C:\myfile.xls"


text:
Q: How to find out if a Lucene query has at least one result efficiently? I need to find out if my BooleanQuery has at least one matching document. I don't care about the total number of matching documents -- only that there is at least one match. Currently I'm using IndexSearcher.Search(...) with n = 1, but I would like to know if there is a more efficient way.
If I set n = 1, TotalHits will still be set to the correct value (i.e. it may be higher than 1), so I'm suspecting that Lucene does extra work that I don't need.
Is there a better way of doing this?
P.S. I'm using Lucene .NET 3.0.3.

A: Lucene doesn't search through each document to determine the number of hits. It searches through the index, which refers back to the matching documents. Think about a book's index:
Cats . . . . . 5, 8, 9, 10
Dogs . . . . . 5, 6, 11, 12
Horses . . . . 5, 8, 12, 13, 14

If I'm searching for "Cats AND Horses", there isn't really a significant difference in the amount of work required to tell me "1 or more hits" vs "2 hits".

As far as short circuiting in a boolean query full of "should" clauses, I'm not aware of any query class that does this. If you have a query like field:simpleterm field:*slowwildcardquery*, and don't want to evaluate the big slow wildcard query if there is a match on the simple term query, you should just run them as separate searches. If the first doesn't return any hits, then run the second.


text:
Q: Python 2.7 - Adding values from a table field (Score) up to a maximum total based on another field (Category)? I have tables in ArcGIS containing rows for items that have fields for "Score" and "Category". I am attempting to write a function that adds the total score from the "Score" field for all rows, but takes user-provided variables for the maximum contribution limits per category.
So the function needs to check each row for what "Category" it belongs to, check if the "Category" is maxed out, and if not maxed out, add the "Score" value to the Total Score Value.
This part would be simple, but the more difficult part for me is that the categories are not standardized... so each time the function is run, it would need to read all possible field values within "Categories" in the input table, read the user-input for the category limits, and limit the score contribution of each category as each row is tallied up.
This is what I have so far...
# Set Total Score Variable
totalScore = 0

# Read table "Category" field for possible categories
categories = [row[0] for row in arcpy.da.SearchCursor("Input_Table", "CategoryID")]
uniqueCategories = set(categories)
print(uniqueCategories)

print "Found " + len(uniqueCategories) + "unique categories in table."

# TODO: Read user input to designate category limits somehow...
category_A =
category_B =
category_C =

category_A_Limit =
category_B_Limit =
category_C_Limit =

with arcpy.da.SearchCursor("Input_Table", ["CategoryID", "Score"]) as cursor:
   for row in cursor:
       if row[0] == category_X:

           if row[0] < category_X_Limit:
               # Read the Score Field for that row
               totalScore += row[1]
       else:
           print "Category "+str(row[0])+" maxed out. This item's score cannot contribute to the total."

There must be much more elegant ways to handle this... perhaps a specific module that someone knows about? Any assistance would be EXTREMELY appreciated!

A: I have read arcGIS documentation and found out some ways to do so:

*

*Execute SQL statement which explains here:
http://resources.arcgis.com/en/help/main/10.1/index.html#/Executing_SQL_using_an_ArcSDE_connection/002z00000021000000/

*arcpy.da.SearchCursor("Input_Table", "CategoryID"), sql_clause=(None, "GROUP BY Input_Table, CategoryID")]. It shoud sum.
values.
http://resources.arcgis.com/en/help/main/10.1/index.html#/SearchCursor/018v00000050000000/
http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000011000000
Explanations here https://gis.stackexchange.com/a/73300
Hope this help. Next time, please leave your question on this section https://gis.stackexchange.com/


text:
Q: Explanation of mongo query with OR condition I have this data in my db
{ "_id" : ObjectId("5c89da093180684aba34c5b7"), "name" : "Allen", "age" : 24, "nicknames" : [ "kanky" ], "siblings" : [ ] }
{ "_id" : ObjectId("5c89da4b3180684aba34c5b8"), "name" : "Sonata", "age" : "30" }
{ "_id" : ObjectId("5c89da8f3180684aba34c5b9"), "name" : "Kaushik", "age" : "20" }
{ "_id" : ObjectId("5c89da8f3180684aba34c5ba"), "name" : "Stuart", "age" : "24" }
{ "_id" : "5c89da093180684aba34c5b7", "name" : "Allen", "age" : 24 }

When I run this query db.people.find({$or: [{name:"Allen"}, {age:24}]}), it doesn't give the entry with name : Stuart which has age : 24.
But if I run this query db.people.find({$or: [{name:"Stuart"}, {age:24}]}), it works as intended.
Can anyone explain how does this work? I am starting with mongodb, so mightbe a very basic question.
Thanks

A: You have different schema types for age in different documents. For Allen you are using a number data type for age and for Stuart you are using a string to store age. I think thats the problem.
Try running this:-
db.people.find({$or: [{name:"Allen"}, {age: "24" }]})

You will get Stuart with this query. I don't see anything else wrong here except for different data types.


text:
Q: How to use LAG and NUMTOYMINTERVAL in PARTITION? I have a dataset with 3 columns, id, date, value, here date has this format DDMMYYYY:
id    date            value
1     19/11/2020       10
1     19/10/2020       90
1     19/09/2020       87
1     19/07/2020       50
1     19/06/2020       17

I'm trying to use PARTITION to create partitions by id and order the value by date, and then create a new column with the LAG function, the issue is that there are missing dates that's why I'm trying to use  NUMTOYMINTERVAL, something like this:
SELECT ID, DATE, VALUE, LAG(VALUE, 1) OVER (PARTITION BY ID ORDER BY DATE RANGE NUMTOYMINTERVAL(1, 'MONTH') PRECEDING) AS VALUE_LAG
FROM TABLE

and the result I want is like this
id    date            value      value_lag
1     19/11/2020       10            90
1     19/10/2020       90            87
1     19/09/2020       87            NULL
1     19/07/2020       50            17
1     19/06/2020       17            NULL

A: Instead, use max() with a range window frame:
select t.*,
       max(value) over (partition by id range between interval '1' day preceding and interval '1' day preceding) as pre_value
from t;

If your dates have slop in them (i.e. time components), you might want a more approximate solution:
select t.*,
       max(value) over (partition by id range between interval '36' hour preceding and interval '12' hour preceding) as pre_value
from t;

A: I coudn't use lag function on date with range between clause, here's another solution using with clause, lag () and months_between
with sub as (
SELECT ID, some_DATE, some_VALUE
, LAG(some_DATE)
          over (partition by id order by some_DATE) prev_date
  FROM lag_num_test )
select s.id, s.some_date,
  case
    when (months_between(some_DATE, prev_date) = 1)
      then lag(some_VALUE, 1) over (partition by id order by some_DATE)
  end value_lag from sub s
order  by s.some_DATE desc;

And here's the table structure with inserts:
create table lag_num_test (
 id number,
 some_date date,
 some_value number
);

insert into lag_num_test(id, some_date, some_value) values (1, to_date('19/11/2020', 'dd/mm/yyyy'), 10);
insert into lag_num_test(id, some_date, some_value) values (1, to_date('19/10/2020', 'dd/mm/yyyy'), 90);
insert into lag_num_test(id, some_date, some_value) values (1, to_date('19/09/2020', 'dd/mm/yyyy'), 87);
insert into lag_num_test(id, some_date, some_value) values (1, to_date('19/07/2020', 'dd/mm/yyyy'), 50);
insert into lag_num_test(id, some_date, some_value) values (1, to_date('19/06/2020', 'dd/mm/yyyy'), 17);

A:  SELECT
    t.*,
    MAX(t.some_value) OVER(
        PARTITION BY t.id
        ORDER BY
            t.some_date
        RANGE BETWEEN INTERVAL '1' MONTH PRECEDING AND INTERVAL '1' MONTH PRECEDING
    ) AS pre_value
FROM
    lag_num_test t
ORDER BY
    t.some_date DESC;

this solution by @Gordon Linoff also works fine;
btw. @mathguy oracle will raise an exception (ORA-00905: missing keyword 00905. 00000 -  "missing keyword) when interval value is left without single quotes;


text:
Q: Why is my POST route not found in MERN stack? i'm currently having two problems with a MERN stack app:
i) Axios was not sending the form body data to the server even when the POST route was working. After each submission, a new entry is made but MongoDB only shows default field values
ii) My POST route was initially working but isn't anymore. Can't seem to hit a POST route now. I get a 404 Not Found error
The webapp has a super basic function to create & list students & their data via a form & table respectively. It uses the material-ui library for component templates
My code:
Server-
import express from 'express'
import cors from 'cors'
import mongoose from 'mongoose'
import dotenv from 'dotenv'
dotenv.config()
const app = express()
//ALWAYS use CORS middleware before defining ROUTES!
app.use(cors());
//import routes
import studentRoutes from './routes/student_routes.js'
//middleware to use routes
app.use('/students' , studentRoutes)

app.use(express.json())
const URI = process.env.DB_URI
const port = process.env.PORT || 5000

mongoose.connect(URI, {
    useNewUrlParser: true, useUnifiedTopology: true
}).then( () => app.listen(port, () =>
console.log(`Listening on Port ${port}`)))
.catch( (err) => console.log(err))

Routes-
import express from 'express'
import { getStudents } from '../controllers/student_controller.js'
import { createStudent } from "../controllers/student_controller.js";

import Student from '../models/student_model.js'

const router = express.Router()

//list out all students
router.get('/', getStudents)
//adding new student
router.post('/', createStudent)

export default router

controller-
  import StudentData from '../models/student_model.js'

    export const getStudents = async (req, res) => {
        try {
        const allStudents = await StudentData.find()
        res.status(200).json(allStudents)

    } catch (err) {
    res.status(404).json( {message: err.message} )
    }};

    export const createStudent = async (req, res) => {
            const student = req.body
        const newStudent = new StudentData(student);
        try {
            await newStudent.save()
            res.status(201).json(newStudent)
            console.log('Student Created!')
        } catch (err) {
            res.status(404).json( {message: err.message})

        }

    }

model-
import mongoose from 'mongoose'

//model variable names must match the frontend useState's variables
const studentSchema = mongoose.Schema({
    regNo: Number,
    sutdentName: String,
    grade: String,
    section: {
        type: Number,
        default: 'A'
    },
    subjects: [String]

})

const StudentData = mongoose.model('StudentData', studentSchema)
export default StudentData

form to create student-
import * as React from "react";
import {useState} from 'react'
import Box from "@mui/material/Box";
import TextField from "@mui/material/TextField";
import Button from "@mui/material/Button";
import axios from 'axios'

export default function CreateStudent() {
    //state hook to dynamically update displayed data
    const [student, setStudent] = useState({
        regNo: '',
        studentName: '',
        grade: '',
        section: ''
    })

    //using axios to transfer data from front to backend
    const createStudent = () => {
        axios.post('http://localhost:5000/students', student)
        console.log(`  ${student.studentName}`)
    }
    return (

      <>

Create New Student

        <Box
          component="form"
          sx={{
            "& > :not(style)": { m: 1, width: "25ch" },
          }}
          noValidate
          autoComplete="off"
        >
                <TextField id="outlined-basic" label="Registration No." variant="outlined" value={student.regNo} onChange={(event) => {
                    setStudent({ ...student, regNo: event.target.value })
                }} />
                <TextField id="outlined-basic" label="Name" variant="outlined" value={student.studentName} onChange={(event) => {
                    setStudent({ ...student, studentName: event.target.value })
                }} />
                <TextField id="outlined-basic" label="Grade" variant="outlined" value={student.grade} onChange={(event) => {
                    setStudent({ ...student, grade: event.target.value })
                }}/>
                <TextField id="outlined-basic" label="Class Section" variant="outlined" value={student.section} onChange={(event) => {
                    setStudent({ ...student, section: event.target.value })
                }}/>

          <Button variant="contained" onClick = {createStudent}>Submit</Button>
        </Box>
      </>
    );
}

Thank you in advance to anyone who lends a hand!

A: Your middlewares are in the wrong order:
//middleware to use routes
app.use('/students' , studentRoutes)

app.use(express.json())

The JSON body parser was mounted after the router. When a request reaches the route handler, the req.body will still be undefined because the body-parser has not parsed the JSON request body yet. Move the JSON body parser before the router.

A: app.use(express.json()) should be above your routes.
Because when you make post request you work with json data and it requires
body parser to parse that json data so just take that line above your all routes.


text:
Q: how to use dynamic names for webpack 2 import() statements? I'm trying to create a library that exposes a function that dynamically imports other libraries based on parameters it gets passed. Something like:
export function foo(deps){
  deps.forEach(dep => import(dep).then(doSomething))
}
//usage:
foo(['bar', 'baz']);

the library should not know about the deps in advance, but the app using it definitely will and will import foo and any deps.
When i try to create something like this, I get an error saying "module bar not found". I know that webpack uses static analysis to bundle dynamic imports, but I know it can have variables in imports.
If there is a way to list the dependencies ahead of time, that would be fine. I tried something like this (from the app where I use foo)
function doNotRun(){
   import('bar');
   import('baz');
}
foo(['bar', 'baz'])

in the hopes that webpack would figure out at runtime that it had already bundled this module, but it doesn't seem to match up the module ids. I see bar and baz bundled into chunks, but the actual import uses a different module id.
I also tried making foo aware of all possible deps (by name, but not importing them), and it failed because it needed to know about them at build time. like this:
function getImportPromise(subapp){
  switch(subapp){
    case 'baz':
      return import('baz');
    case 'bar':
      return import('bar');
    default:
      return Promise.reject(dep + ' is not known');
  }
}

export function foo(deps){
  deps.forEach(dep => getImportPromise(dep).then(doSomething))
}

Is it possible to do what I'm asking?
edit:
I just realized that something like my last idea could work, it just feels odd. And more generally, I thought import() could take variables.
export function foo(deps, getImportPromise){
  deps.forEach(dep => getImportPromise(dep).then(doSomething))
}

//usage
function getImportPromise(subapp){
  switch(subapp){
    case 'baz':
      return import('baz');
    case 'bar':
      return import('bar');
    default:
      return Promise.reject(dep + ' is not known');
  }
}
foo(['bar', 'baz'], getImportPromise);

if this is the recommended solution though, it's not so bad. I was just hoping there was a way to have foo do the import itself.


text:
Q: Issue starting video on iPhone with jQuery im using the following piece of code to start a video with jQuery:
$('#game-video')[0].play();

This works fine in desktop browsers and most Android browsers, but the video does not start on iPhones. I have tried on different iOS versions with browserstack and they all fail to play the video?
Does anyone have an idea how to fix this?


text:
Q: como evitar que mysql interprete el punto como un decimal quiero meter este dato en una base de datos mysql: 114.239, pero solo me mete 114. El tipo de datos esta definido como un int. El numero en cuestion no es decimal simplemente son 114 mil 239. Al sacar los datos de otra pagina web que vienen en este formato me resulta muy incomodo andar quitandole  el punto. Me vendria bien saber un metodo para que no interprete el punto como decimal.
un saludo.

A: Un dato numérico, no se guarda con formato en la base de datos...
Ahora mismo dice que quieres guardar 114.239, lo cuál es un error...
El tipo de dato a guardar es INT, y el valor de este es: 114239, asi, sin comas, números, ni nada.
Al momento de querer mostrar el dato, es cuando le das un formato, por que de estos, existen muchos...
Es un número básico ? Es un numero con divisores decimales ? Es un numero con divisores de Miles ? Es un número que debe mostrar 2 decimales ?? etc.
Es decir, que para el mismo valor, puedes tener todos esos formatos (y quizás más):

*

*114239

*114.239

*114.239,00

*114239,00

Aún así, cada uno de ellos, es el mismo valor básico que guardas en la base de datos... el mismo 114239.

A: El error aquí es precisamente querer reflejar el formato en los datos que estás guardando.
El formato es algo circunstancial, por tanto debes reflejarlo en el contexto, no en la realidad misma de los datos. Como podrás entender, en algunos lugares el separador de miles es el punto y en otros es la coma. Si tú decides guardar el dato con un separador, aparte de que tendrás que forzar un cambio del tipo de dato, luego tendrás que vértelas si el contexto cambia.
Guarda el dato tal cual: 114239 y formatea en la salida. Aquí lo más importante es que elijas el tipo de dato adecuado para esa columna. Por ejemplo, si esa columna va a representar un precio o un valor monetario, lo propio es que la declares como DECIMAL, sobre todo para las posibles fracciones y para evitar errores de redondeo.
Sea como sea, si ese número debe ser INT o DECIMAL será muy fácil formatear en la salida, que es donde correspende.
Veamos un ejemplo donde tu número es guardado así, sin más: 114239
Ahora, si te piden un reporte donde en una columna se presenten los datos para Alemania, y en otra columna para los EEUU, con esto lo resuelves:
SELECT
    FORMAT(114239,0,'de_DE') AS de,
    FORMAT(114239,0,'en_US') AS us;

Salida:
   de           us
----------------------
114.239       114,239

Creo que con este ejemplo contextual se entiende la importancia de respetar la realidad de los datos al momento de declararlos y de guardalos. Si no respestas eso, te pasarás la vida parcheando, y cuando otro herede la base de datos que diseñaste te pitarán los oídos el resto de tu vida :)
Espero te sirva.


text:
Q: Scrollview not working in layout injected into AlertDialog I am injecting a layout into an AlertDialog.
In this layout, I have a group of views and below this group, I have a TextView.
I need this last TextView to be still. But the group of previous views should be scrollable.
So I added a ScrollView before the first view and right before the TextView (because I don't want to include it).
Also, in my group of views, I have two views "gone" and they are only visible when I click on a button (which is working perfectly).
But my scrollview barely moves never lets me see the whole group of view when needed.
Could anyone let me know what I am doing wrong please?
EDIT:
I tried using this post Issue when using Scrollview inside Dialog but even if my scrollview is working, I don't see my last TextView (the one outside the scrollview) anymore.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activityCameraParentCL"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="10dp">

    <ScrollView
        android:id="@+id/activityCameraParametersSV"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent" >

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/activityCameraMainLL"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:scrollbarAlwaysDrawVerticalTrack="true">

            <LinearLayout
                android:id="@+id/activityCameraSerialNumberLL"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingBottom="10dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="@id/activityCameraMainLL">

                <TextView
                    android:id="@+id/activityCameraSerialNumberTV"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/activityCameraParametersSerialNumber"
                    android:textStyle="bold" />

                <EditText
                    android:id="@+id/activityCameraSerialNumberET"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="5" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/activityCameraModelNameLL"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingBottom="10dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/activityCameraSerialNumberLL">

                <TextView
                    android:id="@+id/activityCameraModelNameTV"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/activityCameraParametersModelName"
                    android:textStyle="bold" />

                <EditText
                    android:id="@+id/activityCameraModelNameET"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="5" />
            </LinearLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/activityCameraMarkerLL"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingBottom="10dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/activityCameraModelNameLL">

                <TextView
                    android:id="@+id/activityCameraMarkerTV"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:text="@string/activityCameraParametersMarker"
                    android:textStyle="bold"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <ImageButton
                    android:id="@+id/activityCameraMarkerInfoIB"
                    android:layout_width="20dp"
                    android:layout_height="30dp"
                    android:layout_marginTop="5dp"
                    android:backgroundTint="@color/black"
                    android:src="@drawable/ic_action_info"
                    app:layout_constraintStart_toEndOf="@id/activityCameraMarkerTV"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/activityCameraMarkerYesButton"
                    android:layout_width="80dp"
                    android:layout_height="40dp"
                    android:gravity="center"
                    android:text="@string/yes"
                    android:textColor="@color/white"
                    app:layout_constraintEnd_toStartOf="@+id/activityCameraMarkerNoButton"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/activityCameraMarkerNoButton"
                    android:layout_width="80dp"
                    android:layout_height="40dp"
                    android:layout_marginEnd="10dp"
                    android:gravity="center"
                    android:text="@string/no"
                    android:textColor="@color/white"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/activityCameraMarkerInfoTV"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:text="@string/activityCameraParametersMarkerInfo"
                    android:visibility="gone"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/activityCameraMarkerTV" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <TextView
                android:id="@+id/activityCamera15CreditTV"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingBottom="10dp"
                android:text="@string/activityCameraParameters15Credits"
                android:textAlignment="center"
                android:textColor="@android:color/holo_red_dark"
                android:textSize="12sp"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/activityCameraMarkerLL" />

            <EditText
                android:id="@+id/activityCameraParametersDescriptionET"
                android:layout_width="match_parent"
                android:layout_height="100dp"
                android:hint="@string/edittext_hint"
                android:inputType="textMultiLine"
                android:minLines="2"
                android:overScrollMode="always"
                android:paddingBottom="10dp"
                android:scrollbarStyle="insideInset"
                android:scrollbars="vertical"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/activityCamera15CreditTV" />

            <LinearLayout
                android:id="@+id/activityCameraSpecimenLanguageLL"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:orientation="horizontal"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/activityCameraParametersDescriptionET">

                <TextView
                    android:id="@+id/activityCameraSpecimenLanguageTV"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/activityCameraParametersSpecimenLanguage"
                    android:textStyle="bold" />

                <Spinner
                    android:id="@+id/activityCameraSpecimenLanguageSpinner"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" />

            </LinearLayout>

        </androidx.constraintlayout.widget.ConstraintLayout>

    </ScrollView>

    <TextView
        android:id="@+id/activityCameraValidationTV"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:text="@string/validationBeforePursue"
        android:textAlignment="center"
        android:textStyle="bold"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/activityCameraParametersSV" />

</androidx.constraintlayout.widget.ConstraintLayout>

A: Try using NestedScrollView instead of the regular ScrollView ?


text:
Q: What are all things that do/can happen when a user enters in a web page's URL? I am trying to break into web development. I have taken a basic intro to OS, intro to Networking as part of my bachelors degree several years ago. I cannot say that we went into things deeply, beyond academic assignments.
I would like to understand things much better regarding to this specific task (e.g what goes on in at the OS level, at networking level, what are other computers involved, where do proxy servers and hackers come in). Again, at the very basic level this has been covered, but I would like to review this specific thing better.
Are there chapter(s) OS a specific book, or specific SHORT reading that you recommend? I have nothing against your list of 20 favorite books, but I want to understand this one thing better in 2-3 weeks of reading after work / on the weekends (realistically 5-10 hrs per week, so I am looking for about 15-20 hrs of reading material, NO MORE).

A: Well, as with most things in computers, it's a lot of relatively simple concepts stitched together. To understand it fairly deeply (but not EE-deep, since I don't go there), you could start by learning these networking concepts:

*

*TCP/IP - since it's how the various players will talk to each other; you could learn Ethernet too - since you are likely on an Ethernet network, but that falls further into EE world. The OSI model may be a useful primer if you're not familiar with it already.

*DNS - since it's how what the user types in gets translated to IP addresses for the TCP/IP calls. Circularly enough, it's also implemented in IP - which is why it's second. It's the application layer in the OSI model.

*HTTP - since it's the application layer (there's that OSI model again) that will be used between the client and the web server.

*HTTP variations and standards, for the proxy server and hacker issues

*

*Cookies - An easily understood, common attach point

*Proxy servers

*SSL/TLS - This can get complicated, since you're dealing with cryptography. You may want to start with Wikipedia's TLS entry
For things like these (general Internet standards), the actual RFCs are gold. They can be dry, they can be vague, and they may not 100% reflect shipping products - but they are the best general technical resource IMO.
As usual, Wikipedia is a great first-level resource for all of this as well. It'll tell you the basics, and generally link you to the correct RFCs (RFCs have a habit of being updated, superseded, not implemented, etc. so the quick Google searches I did are likely to be somewhat incorrect).
The OS side is a bit harder. Since it's not a "standard", there's no published reference to any of it. And, even better, different OS will do things slightly differently. I'm mainly a Windows guy - I learn this type of stuff from blogs; Mark Russinovich and Raymond Chen are the 2 best guys I know of to give you this seriously technical stuff.

*

*OS execution - terribly complicated, you could spend years on this topic. For the purpose of web apps, it's probably enough to know the basics of memory models and maybe a little bit of assembly language to understand how the web server and browser will do their jobs.

*Pick a webserver, and it's processing model. I'm a Windows guy, so here's IIS. Since every webserver will have an extension model, it's likely that what's happening after the initial request is that it's passed to another program. So, you'll have the transfer of the request, and then you can dive into the extensions processing model. At the end of the day, they'll all buffer up a string of HTML to send back over HTTP to the client.

Speaking of HTML, now you need to know the rules for that (and CSS) so that you know what the browser does to parse it into visual elements. Oh - and since this all shows in a GUI program, you can now start down the road of message loops and input handling. It really never ends - one of the greatest (and worst) things about this profession.

A: To answer the specific question in your title, the term you're looking for is "web page life cycle".
The ASP.NET Page Life Cycle Overview page on MSDN describes the cycle for an ASP.NET page. The terms are general (for the most part), but the details of the actions are specific for ASP.NET.
The MSDN goes into the full detail, but the page life-cycle has 7 stages:

*

*Page request

*Start

*Initialization

*Load

*Postback event handling

*Rendering

*Unload

and the page goes through them all and finishes at stage 7 when it's viewed.
At each stage events are fired that allow the developer to run their own code appropriate to that stage.

A: "Web development" is a very broad term, as I think you understand by breaking down some of the layers. Given your background, I think you should look at this page. It should give you more vocabulary to find out what you want to study next. That covers the "web" portion. As you find out more, the "development" portion will become clearer. A little more than half-way down that page is a line answering your question.
Basically:

When you type a URL into a web browser, this is what happens:

*

*If the URL contains a domain name, the browser first connects to a domain name server and retrieves the corresponding IP address for the web server.

*The web browser connects to the web server and sends an HTTP request (via the protocol stack) for the desired web page.

*The web server receives the request and checks for the desired page. If the page exists, the web server sends it. If the server cannot find the requested page, it will send an HTTP 404 error message. (404 means 'Page Not Found' as anyone who has surfed the web probably knows.)

*The web browser receives the page back and the connection is closed.

*The browser then parses through the page and looks for other page elements it needs to complete the web page. These usually include images, applets, etc.

*For each element needed, the browser makes additiona
  l connections and HTTP requests to the server for each element.

*When the browser has finished loading all images, applets, etc. the page will be completely loaded in the browser window.


text:
Q: What is a noun for "nice revenge"? If I get revenge on someone, it means payback, but with negative connotations.
Now let's say someone does a good deed for me, and I repay their kindness in some way. Is there a noun along the lines of, "I have got revenge on them, but good for good"?

A: Reciprocation is the word you're looking for. In simple words, reciprocation is the act of reciprocating.

Reciprocation: the fact of feeling or behaving towards someone else in the same way as they feel or behave towards you. [CED]

Reciprocation often has positive connotations. Retaliation is often used in the same contexts with negative connotations.
You could also say return the favour.
For example, if someone does you a favour, you can reciprocate by doing the same thing (good for good) or you return the favour.

A: "requital" is a noun not often used but exact in this context.

*

*I made them (a) requital.

It is used here for instance: Google Books.

Addition
Here are a few examples showing how the word is combined with the verb "make" or a similar one (from vocabulary.com among a great many instances of use to be found there).

*

*For all the wrong of slavery requital must be made, submissively, ungrudgingly, repentantly.

*This was worth a requital, and they got it.

*A splendid monument was raised to his memory, on which was inscribed his own epitaph, that no friend ever did him a kindness, and no enemy a wrong, without receiving a full requital.

*Ever since the visit paid to her home by the imperial consort, he fulfilled his official duties with additional zeal, for the purpose of reverently making requital for the grace shown him by the Emperor.

A: Since we are talking about usage, we are also talking about what people might  actually say.  Irony is a popular characteristic in British English.  So someone might say to a friend who just paid for a meal they shared:

I'll retaliate next time

or

Next time we eat, I'll have my own back


text:
Q: JQuery Function Do something - Pause - Do something else I am creating a function where I could execute some jquery code ...then pause for say... 5 secs and then execute something else..
Something like this:
function myFunc() {
    var str1 = 'This is the starting text';
        var str2 = 'This is the ending text';
          $("#label").html(str1);

        //I need a pause here (5000 ms) ---

          $("#label").html(str2);

}

How can I get a pause in there?

A: This can be done sequentially using jQuery's queue method
The jQuery way:
$('#label')
    .queue(function (n) {
        ...your code here...
        n(); //dequeue the next item in the queue
    })
    .delay(5000)
    .queue(function (n) {
        ...your second bit of code here...
        n(); //dequeue the next item in the queue
    });

Although it's good to understand how to use setTimeout as well.
The advantage to queue is that it works by default along with the fx queue, although you could choose to specify a different queue name.
The non-jQuery way:
function first() {
    ...your code here...
    setTimeout(second, 5000);
}
function second() {
    ...your second bit of code here...
}
first();

A: You could use a timeout to handle your pause
function myFunc() {
    var str1 = 'This is the starting text';
        var str2 = 'This is the ending text';
          $("#label").html(str1);
          var plzwait=setTimeout(function(){  $("#label").html(str2);  }, 5000);

A: Not sure what you want to accomplish, but you should probably not try to make it synchronus and pause it, that would freeze the application. Instead i suggest you use a timeout, that execute the code you want after a given amount of time.
function myFunc() {
    var str1 = 'This is the starting text';
        var str2 = 'This is the ending text';
          $("#label").html(str1);

          setTimeout(function() {
             // Do what you want to do after a certain time in here
             $("#label").html(str2);
          }, 5000);

}

A: jQuery has delay() which accepts milliseconds and works with effects.
This is an example giving a fade in when the text changes to bring attention to it.
var str1 = "I am the first string";
var str2 = "This is the second string!";
var label = $("#label")
    label.html(str1).delay(5000).fadeOut("fast",function(){label.html(str2)}).fadeIn("slow");

jsFiddle Example

A: Use setTimeout();
function myFunc() {
    var str1 = 'This is the starting text';
        var str2 = 'This is the ending text';
          $("#label").html(str1);

        //I need a pause here (5000 ms) ---
        setTimeout(function(){
         $("#label").html(str2);
        },5000);

}


text:
Q: Which word should i use in this sentence? I want to say;
'Breathing the dewy air of flowers and fresly cut grass scent'
Or
'Breathing the moist scent of flowers and freshly cut grass'
I think the second one is the correct one because for flowers, using the word scent instead of air, and using the word moist instead of dewy would be more meaningful. But I'm not sure. Can someone help me? Also if there's a better way to describe it please englighten me. Thank you!

A: Both sentences you presented read as poetic. 'Breathing the {adjective phrase} air' is a common pattern of expression in English language poetry, as is using 'air' to describe a smell.
In the first sentence, 'freshly cut grass scent' sounds odd, it would be more typical to say 'Breathing the dewy air of flowers and the scent of freshly cut grass.'
In terms of 'dewy' versus 'moist', 'dewy' is a much rarer word, essentially only used in poetry or other 'artful' language. You wouldn't use it in day-to-day speech. Moist is a more common word. Dewy has a positive connotation of fresh. Moist has a neutral-to-negative connotation of damp or slimy (like moss or mold), though this might vary depending on dialect.
So I guess to summarize:
If you want to sound poetic, use either
Breathing the dewy air of flowers and the scent of freshly cut grass
or
Breathing the moist scent of flowers and freshly cut grass
and if you want to use a phrase people would use in casual speech, try
Smelling the wet smell of flowers and fresh-cut grass.


text:
Q: reproducing the jackson vulnerability CVE-2017-7525 using spring boot and custom java class I read about the ongoing jackson vulnerability(CVE-2017-7525) which allows for remote code execution, as explainedhere.
I did some modifications to the example class given on that page and wrote something like this:
import java.io.*;
import java.net.*;

public class Exploit extends com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet {
  private static String urlString = "https://sv443.net/jokeapi/category/any?blacklistFlags=nsfwreligiouspolitical";
  public Exploit() throws Exception {
    StringBuilder result = new StringBuilder();
    URL url = new URL(urlString);
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("GET");
    BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
      result.append(line);
    }
    rd.close();
    //Lets see the joke in the logs
    System.out.println(result);
  }

  @Override
  public void transform(com.sun.org.apache.xalan.internal.xsltc.DOM document, com.sun.org.apache.xml.internal.dtm.DTMAxisIterator iterator, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler) {
  }

  @Override
  public void transform(com.sun.org.apache.xalan.internal.xsltc.DOM document, com.sun.org.apache.xml.internal.serializer.SerializationHandler[] handler)  {
  }
}

Compiled the .java file and opened the generated .class file and passed its contents as part of the sample api request body provided, however it appears the the custom code may not have been executed (or so I think), I am expecting to see something on the application logs, printing the output of the request. However I do not see anything being printed.
Does anyone have a simple example that showcases this vulnerability using spring boot and jackson, through an api call using bogus jackson?
I understand this is an unusual question, but I am looking into this interesting topic hoping there is someone out there who has come across the need to demo this issue.
In short I am looking to demo this java deserialization vulnerability while using spring boot, jackson by making an api call and passing a Json document which contains the compiled java code to be executed.


text:
Q: How to get data from the html input after the user has pressed enter or clicked elsewhere? Js has a built-in function that allows you to retrieve data from an input when a user enters something into it: input.addEventListener("input", myFunction()).
But it does not suit me, because it is executed every time the user enters at least one character. Instead, I need an approach in which the function would be called only when the user typed something and then pressed enter or clicked on a page in different place.

A: You can use the focusout event which fires when an element is about to lose focus and for the enter key you could check the event.key within the keypress event which is fired when a key that produces a character value is pressed down. like so:
input.addEventListener("keypress", function (e) {
   if (e.key === 'Enter') {
     // code for enter
   }
});

focusout  - https://developer.mozilla.org/en-US/docs/Web/API/Element/focusout_event
keypress - https://developer.mozilla.org/en-US/docs/Web/API/Document/keypress_event

A: You can use the following methods for this:

*

*use onblur for the input elements. This will trigger once the user clicks anywhere outside of that input box.

*use onsubmit for the form. This will trigger when the user presses enter or submits the form in anyway.


text:
Q: Jqgrid is showing blank fields I have a piece of code the purpose of the code is to use entityframework and generate jqgrid.I am successful in doing this task but jqgrid is showing blank fields. Please help. Please see the attached images.
Jqgrid is showing blank:

$(function () {
$("#ListGrid").jqGrid({
    url: "/TodoList/GetTodoLists",
    datatype: 'json',
    mtype: 'Get',
    colNames: ['FirstName', 'Gender', 'Id', 'Lastname', 'Salary'],
    colModel: [
        { key: false, name: 'FirstName', index: 'FirstName', editable: true },
        { key: false, name: 'Gender', index: 'Gender', editable: true },
        { key: true, hidden: true, name: 'Id', index: 'Id', editable: true },
        { key: false, name: 'Lastname', index: 'Lastname', editable: true },
        { key: false, name: 'Salary', index: 'Salary', editable: true }],
    pager: jQuery('#pager'),
    rowNum: 10,
    rowList: [10, 20, 30, 40],
    height: '100%',
    viewrecords: true,
    caption: 'Todo List',
    emptyrecords: 'No records to display',
    jsonReader: {
        root: "rows",
        page: "page",
        total: "total",
        records: "records",
        repeatitems: false,
        Id: "0"
    },
    autowidth: true,
    multiselect: false
}).navGrid('#pager', { edit: true, add: true, del: true, search: false, refresh: true },
    {
        // edit options
        zIndex: 100,
        url: '/TodoList/Edit',
        closeOnEscape: true,
        closeAfterEdit: true,
        recreateForm: true,
        afterComplete: function (response) {

            if (response.responseText) {
                alert(response.responseText);
            }
        }
    },
    {
        // add options
        zIndex: 100,
        url: "/TodoList/Create",
        closeOnEscape: true,
        closeAfterAdd: true,
        afterComplete: function (response) {
            if (response.responseText) {
                alert(response.responseText);
            }
        }
    },
    {
        // delete options
        zIndex: 100,
        url: "/TodoList/Delete",
        closeOnEscape: true,
        closeAfterDelete: true,
        recreateForm: true,
        msg: "Are you sure you want to delete this task?",
        afterComplete: function (response) {
            if (response.responseText) {
                alert(response.responseText);
            }
        }
    });

});


text:
Q: Search value in textBox so it finds it in the data located in gridView Curently i am opening a .xls file, by entering the file location in a text box and i want to search a certain value by entering it in a text box and delete the row in which the value resides in.
Here is the code for Form1, that contains the dataGridView:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;

namespace Plan_de_lucru_1._0
{
    public partial class frPlanMain : Form
    {
        public frPlanMain()
        {
            InitializeComponent();
        }

        private void frPlanMain_Load(object sender, EventArgs e)
        {

        }

        private void GoButton_Click(object sender, EventArgs e)
        {
            string constr = "Provider = MicroSoft.Jet.OLEDB.4.0; Data Source=" + locTBox.Text + "; Extended Properties =\"Excel 8.0; HDR=Yes;\";";
            OleDbConnection con = new OleDbConnection(constr);
            OleDbDataAdapter sda = new OleDbDataAdapter("Select * From [" + shTBox.Text + "$]", con);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            dGVPlan.DataSource = dt;
            new SearchWindow().Show();
            this.Show();
        }
    }
}

This is Form2 that contains the textBox and button in which i want to enter the search value.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Plan_de_lucru_1._0
{
    public partial class SearchWindow : Form
    {
        public SearchWindow()
        {
            InitializeComponent();
        }

        private void SearchButtonW_Click(object sender, EventArgs e)
        {
            String str = "select * from searchBox where ( Name like '%' + @search + '%')";
            BindingSource bs = new BindingSource();

        }
    }
}

Thank you for your help.

A: I have a DataTable declared as at the class level.
protected static DataTable dtSearch = null;

Then I have a button click that searches the DataTable to filter down based on the value that I have typed in a Textbox.Text field.
protected void btnSrch_Click(object sender, EventArgs e)
{
    if (txtSearch.Text.Length > 0)
    {
        dtSearch = dtInitialDatable;//the datatable that was bound to my DatagridView
        dv = new DataView(dtSearch);
        dv.RowFilter = "Data_Column_Name LIKE '%" + txtSearch.Text.ToUpper() + "%'";
        //bind the DataGridView to dv
        myDataGridView.DataSource = dv;
        //myDataGridView.DataBind();//uncomment if you are doing this in webform
    }
    else
    {
        dtSearch = null;
        dv = null;
    }
}

A: This worked for me :
namespace Plan_de_lucru_1._0
{
    public partial class SearchWindow : Form
    {
        public frPlanMain refTofrPlanMain;

        public SearchWindow(frPlanMain f) //<<Edit made here
        {
            refTofrPlanMain = f;
            InitializeComponent();
        }

        private void SearchButtonW_Click(object sender, EventArgs e)
        {
            {
                (refTofrPlanMain.dGVPlan.DataSource as DataTable).DefaultView.RowFilter = string.Format("Vodic = '{0}'", searchTBoxW.Text);
                foreach (DataGridViewRow item in refTofrPlanMain.dGVPlan.Rows)
                {
                    if (item.Visible)
                    {
                        item.Selected = true;
                        break;


text:
Q: Windows routes through wrong interface I'm using Windows 10 21H1. There are several networks connected to my machine. I've noticed I cannot ping hosts in 192.168.3.* network. Here's my routing table:
          0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.126     25
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      192.168.0.0    255.255.255.0         On-link     192.168.0.126    281
    192.168.0.126  255.255.255.255         On-link     192.168.0.126    281
    192.168.0.255  255.255.255.255         On-link     192.168.0.126    281
      192.168.1.0    255.255.255.0         On-link      192.168.1.80    281
     192.168.1.80  255.255.255.255         On-link      192.168.1.80    281
    192.168.1.255  255.255.255.255         On-link      192.168.1.80    281
      192.168.3.0    255.255.255.0         On-link      192.168.3.86    281
     192.168.3.86  255.255.255.255         On-link      192.168.3.86    281
    192.168.3.255  255.255.255.255         On-link      192.168.3.86    281
    192.168.117.0    255.255.255.0         On-link     192.168.117.1    291
    192.168.117.1  255.255.255.255         On-link     192.168.117.1    291
  192.168.117.255  255.255.255.255         On-link     192.168.117.1    291
    192.168.232.0    255.255.255.0         On-link     192.168.232.1    291
    192.168.232.1  255.255.255.255         On-link     192.168.232.1    291
  192.168.232.255  255.255.255.255         On-link     192.168.232.1    291
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link     192.168.232.1    291
        224.0.0.0        240.0.0.0         On-link     192.168.117.1    291
        224.0.0.0        240.0.0.0         On-link      192.168.1.80    281
        224.0.0.0        240.0.0.0         On-link      192.168.3.86    281
        224.0.0.0        240.0.0.0         On-link     192.168.0.126    281
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link     192.168.232.1    291
  255.255.255.255  255.255.255.255         On-link     192.168.117.1    291
  255.255.255.255  255.255.255.255         On-link      192.168.1.80    281
  255.255.255.255  255.255.255.255         On-link      192.168.3.86    281
  255.255.255.255  255.255.255.255         On-link     192.168.0.126    281

This is the output of tracert -d 192.168.3.19:
  1    <1 ms    <1 ms    <1 ms  192.168.0.1
  2    33 ms    14 ms    24 ms  192.168.8.1
  3  ^C

As you can see, it's routing through the wrong interface. Why does it happen and how can I fix it?
UPD. I expect it to route the packet directly to 192.168.3.19 because of this line in the routing table:
192.168.3.0    255.255.255.0         On-link      192.168.3.86    281
Doesn't it say "for all nodes of 192.168.3.0 network, route packets to them directly"? 192.168.3.86 is the IP address of my machine.


text:
Q: PHP equivalent to pythons slots I'm not really sure how to sum this up as a google question but maybe explaining it in detail will get me better help.
I'm trying to find the equivalent to setting up slots in python in PHP
Python:
class Node:
    slots = ('name','desc','blah')
    def __init__(self, name, desc, blah):
        self.name = name
        self.desc = desc
        self.blah = blah

Running through an array and I hate trying to remember what position somethings at and doing array[3] or what ever so doing array.blah would be much easier. Is this possible in PHP.

A: Use an associative array:
$slots = array(
    'name' => $name,
    'desc' => $desc,
    'blah' => $blah
);

Then you can do echo $slots['name'];
Cheers

A: There is only one issue with the approach above and thats it that in an array you can add new values on the fly. I am not sure how slots work exactly since im not familiar with python but looking at the example the keys name, desk and blah should be constant and they are pre-defined. The best approach in that case would be to use class members in my opinion such as
      Class Node{
    private $name;
    private $desc;
    private $blah;

    public function __construct($name, $desc, $blah){
    $this->name = $name;
    $this->desc = $desk;
    $this->blah = $blah;
    }
}

You could of course make the variables public but its not the best approach, instead you should probably implement getters and setters for each variable.


text:
Q: Consistent text size for one line I have an element with 1 line of text and I don't want it to overlap the border or start a new line. So I was considering using a limit on the length of text allowed, do all characters use an equal amount of space across browsers?

A: Not all letters are the same size, it is dependant on the font type. Individual settings on browsers also play a factor.
To see a list of fonts with the same size see:
http://en.wikipedia.org/wiki/Monospaced_font
and
http://en.wikipedia.org/wiki/Samples_of_monospaced_typefaces


text:
Q: Default Filename for GetOpenFilename I'm looking to set a default filename in GetOpenFilename.  I'm using GetOpenFilename because it was in an example for using UNC paths (which I require) and from what I've read you cannot do that with ChDir or ChDrive using FileDialog.  Is there anything that exists that will allow presetting of the filename and work with UNC paths?
I've tried sticking the filename into the FileFilter section of GetOpenFilename and that does not work.  From what I have found it looks like this may not be possible but my limited knowledge of VBA may be the issue as well.
I'm stuck with using UNC because the data is located on a network and not everyone maps it to the same drive or even maps it at all.

A: In Excel if you look in Application.Dialogs() you'll find a long list of predefined dialog boxes used in Excel that you can call upon. GetOpenFilename is the same situation, because it is predefined, the customization options are minimal.
To use the generic file dialog box (i.e. not custom within Excel) you can use Application.FileDialog(msoFileDialogOpen), this will allow for further customisation including the initial filename text.
Public Sub Sample()
Dim Dlg As FileDialog

Set Dlg = Application.FileDialog(msoFileDialogOpen)
    Dlg.InitialFileName = "Sample"
    Dlg.Show
Set Dlg = Nothing

End Sub


text:
Q: How to do multiline search and replace with a script? I'm trying to replace every multiline import inside a Python source file.. So, the source goes like
from XXX import (
   AAA,
   BBB,
)
from YYY import (
   CCC,
   DDD,
   EEE,
   ...
)
...other instructions...

and I'd like to get something like
from XXX import AAA, BBB
from YYY import CCC, DDD, EEE, ...
...other instructions...

I tried to use sed but it looks like it doesn't support non-greedy matching of the closing parenthesis, so it "eats" the second import.. :(
Any hint? Is this impossible with sed? Should I try with another tool?

A: This might work for you:
sed '/^from/,/^)/{H;//{x;/)/{s/[\n()]//g;s/  */ /g;s/,$//;p;x}};d}' source
from XXX import AAA, BBB
from YYY import CCC, DDD, EEE, ...
...other instructions...

A: Ummm... what's wrong with Python?
lineIter= iter(aFile)
for aLine in lineIter:
    if aLine.startswith("import"):
        if aLine.endswith("("):
            for aModule in lineIter:
                if aModule.endwith(")"):
                    break
                print "import", aModule.strip()
        else:
            print aLine.stri()
    else:
        print aLine.strip()

A: For posterity, here is a somewhat polished version of S.Lott's script (I'd have posted it as a comment, but it's too long ^^; ).. This version preserves indentation and produces a result closer to my example.

lineIter=iter(aFile)
for aLine in lineIter:
    s = aLine.strip()
    if s.startswith("from ") and s.endswith("("):
        complete = s[:-1]
        for aModule in lineIter:
            m = aModule.strip()
            if m.endswith(")"):
                break
            complete += m.strip()
        print complete
    else:
        print aLine,


text:
Q: Swapping Two GameObjects on Keypress When I press Space, the player and the dummy are supposed to swap places. This doesn't just happen once, it needs to happen everytime I press the Space bar so they can swap back and forth. However, sometimes it works and sometimes it doesn't. When it doesn't work, the dummy teleports to the player and then the player teleports inside of the dummy (as that is where its last position is). This just kind of pushes the player about.
Here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerSwap : MonoBehaviour
{
    public GameObject player;
    public GameObject dummy;
    public GameObject cameraAnchor;

    public Transform playerLastPos;
    public Transform dummyLastPos;

    public bool haveSwapped;
    public bool canSwap;

    public float swapRadius;
    public LayerMask dummyInRadius;

    // Update is called once per frame
    void Update()
    {
        canSwap = Physics.CheckSphere(player.transform.position, swapRadius, dummyInRadius);

        SwapTransforms();

        if (canSwap)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                haveSwapped = !haveSwapped;
                Swapping();
            }
        }
        else
        {
            Debug.Log("Can't Swap");
        }
        cameraAnchor.transform.position = player.transform.position;
    }

    public void SwapTransforms()
    {
        if (haveSwapped)
        {
            dummyLastPos.position = player.transform.position;
            playerLastPos.position = dummy.transform.position;
        }
        else
        {
            dummyLastPos.position = dummy.transform.position;
            playerLastPos.position = player.transform.position;
        }
    }

    public void Swapping()
    {
        if (haveSwapped)
        {
            player.transform.position = dummyLastPos.position;
            dummy.transform.position = playerLastPos.position;
        }
        else
        {
            player.transform.position = playerLastPos.position;
            dummy.transform.position = dummyLastPos.position;
        }
    }

    public void OnDrawGizmos()
    {
        Gizmos.color = Color.white;
        Gizmos.DrawWireSphere(player.transform.position, swapRadius);
    }
}

A: I've solved it. After cleaning up most of the code and realsing I had to turn off movement and the character controller on the player (Link:Unity Answers), I came up with this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerSwap : MonoBehaviour
{
    public ThirdPersonMovement playerMove;

    public GameObject player;
    public GameObject dummy;
    public GameObject cameraAnchor;

    public Transform playerLastPos;
    public Transform dummyLastPos;

    public bool canSwap;

    public float swapRadius;
    public LayerMask dummyInRadius;

    // Update is called once per frame
    void Update()
    {
        canSwap = Physics.CheckSphere(player.transform.position, swapRadius, dummyInRadius);

        if (canSwap)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                playerMove.canMove = false;
                player.GetComponent<CharacterController>().enabled = false;

                SetTransforms();
            }
        }
        else
        {
            Debug.Log("Can't Swap");
        }
        cameraAnchor.transform.position = player.transform.position;
    }

    public void SetTransforms()
    {
        dummyLastPos.position = dummy.transform.position;
        playerLastPos.position = player.transform.position;
        Debug.Log("Set Transforms");

        Swapping();
    }

    public void Swapping()
    {
        player.transform.position = dummyLastPos.position;
        dummy.transform.position = playerLastPos.position;
        dummy.transform.rotation = player.transform.rotation;
        Debug.Log("Swap");

        playerMove.canMove = true;
        player.GetComponent<CharacterController>().enabled = true;
    }

    public void OnDrawGizmos()
    {
        Gizmos.color = Color.white;
        Gizmos.DrawWireSphere(player.transform.position, swapRadius);
    }
}


text:
Q: How to remove records based on frequency of three way interaction using awk How to remove records when the frequency of three-way interaction of the factors (V2*V3*V4) is below 5.
original data
ID V2 V3 V4
101 2012 5 1
101 2012 5 1
101 2012 5 1
101 2012 5 1
102 2010 12 2
102 2012 12 2
102 2012 12 2
102 2012 12 2

A: Since "V2" is over 2,000 and no other columns are below 1, the product of those columns will always be greater than five given your sample data.  However:
awk '($2*$3*$4) > 5 { print } NR==1 { print }' /path/to/data

A: I don't know the math for frequency, but I do like awk! Here is a script that iterates through every record of your test file and performs multiplications on the numbers, and compares them to see if they are less than 5. If less than 5, don't print. Otherwise print.
#!/usr/bin/awk -f
BEGIN {
  print "ID V2 V3 V4 = PRODUCT";
}
{
  TOTAL = int($1 * $2 * $3);
  if(TOTAL < 5)
  {
    # Don't print
  }
  else
  {
    print $1,"",$2,"",$3,"=",TOTAL;
  }
}

A: Since the ID could vary for the same factors, you could read the file twice - first to count how many times you have V2_V3_V4 and then again to check each line and print only if the count from the 1st pass was greater than or equal to n (in this case 5):
awk -vn=5 'NR==FNR{++z[$2"_"$3"_"$4];next};
FNR==1{print;next};z[$2"_"$3"_"$4]>=n' infile infile


text:
Q: Are there limits to file length piped from find to xargs or using find -exec + In question [ Find and delete all the directories named "test" in linux ] on this site, the best answer talks about using these two commands:
find . -name test -type d -print0|xargs -0 rm -r --
find . -name test -type d -exec rm -r {} +

because they will call rm with a list of directory instead of invoking it many times individually.
Since I cannot comment there due to low reputation, I ask here in a new question:
Is there any limit on the number of files that can be passed to rm using these techniques (aside from realistic system resource bounds)?
From the shell, a command like 'rm *' can exceed the shell's maximum command-line length, but do limits like that apply to this usage of find + or via a pipe to xargs?

A: In short, no.
The long answer:
- Find will run the command specified by exec for every match, so if your find turns up 20 files, it will run 20 seperate instances of rm.
- xargs will determine the maximum command length for your shell and add arguments within these limits as you can see with the output of xargs --show-limits

mtak@frisbee:~$ xargs --show-limits
Your environment variables take up 4050 bytes
POSIX upper limit on argument length (this system): 2091054
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2087004
Size of command buffer we are actually using: 131072


text:
Q: Azure App Service Java Web App Url Home Page Path Redirect I deployed a java webapp onto App Service. App service has a default url
(ntpqe-nprd--tots-as.azurewebsites.net) provided but when I enter it, it says Http 404 , No resources Found.
When I add paths after the default url:
ntpqe-nprd--tots-as.azurewebsites.net/MLT-0.0.1-SNAPSHOT/migration
The webapp landing page opens up and I can access web app.
What I want to know is how to access the web app landing page with just the app service default URL: ntpqe-nprd--tots-as.azurewebsites.net
Without the subsequent paths after it.

A: I was able to resolve it. I can use the default Root Domain to access my landing page by writing the following line of code into my pom.xml file.
ROOT
This turns war file into ROOT.war
This will in turn allow you to access war file and subsequent landing page straight from root domain url instead of with root domain url + war package + landing page name


text:
Q: python getopt throws GetoptError option --mode must not have an argument GetOpt seems doesn't work when I specify a command line option, throws exception, this file named o.py:
import getopt
import sys
opts,args = getopt.getopt(sys.argv[1:], "m:p:", ['mode', 'perf'])
for opt_name,opt_value in opts:
    if opt_name in ('--mode'):
        print opt_name
        continue
    if opt_name in ('--perf'):
        print opt_name
        continue

Then I get runtime exception when:
python o.py --mode=a
Traceback (most recent call last):
File "o.py", line 3, in <module>
    opts,args = getopt.getopt(sys.argv[1:], "m:p:", ['mode', 'perf'])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/getopt.py", line 88, in getopt
    opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/getopt.py", line 159, in do_longs
    raise GetoptError('option --%s must not have an argument' % opt, opt)
getopt.GetoptError: option --mode must not have an argument
opts, args = do_longs(opts, args[0][2:], longopts, args[1:])

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/getopt.py", line 159, in do_longs
    raise GetoptError('option --%s must not have an argument' % opt, opt)
getopt.GetoptError: option --mode must not have an argument
So where did I get wrong and how to fix it?

A: Your long option names are missing a trailing =. See docs, namely:

longopts, if specified, must be a list of strings with the names of the long options which should be supported. The leading '--' characters should not be included in the option name. Long options which require an argument should be followed by an equal sign ('=')...

I.e.
opts,args = getopt.getopt(sys.argv[1:], "m:p:", ['mode=', 'perf='])


text:
Q: Python: convert string column to a date time column ('%d/%m/%YT%H:%M:%S') I want to convert a string column in a pandas dataframe to a date time column. The elements in the string column look like '1/07/2020T10:10:00'.
df = pd.DataFrame({"date":['1/07/2020T10:10:00', '1/08/2020T10:10:00', '1/09/2020T10:10:00']})
print(df)
                 date
0  1/07/2020T10:10:00
1  1/08/2020T10:10:00
2  1/09/2020T10:10:00

A: Since the year is with century, it should be %Y not %y.

A: Just try:
Sample DataFrame:
df = pd.DataFrame({"date":['1/07/2020T10:10:00', '1/08/2020T10:10:00', '1/09/2020T10:10:00']})
print(df)
                 date
0  1/07/2020T10:10:00
1  1/08/2020T10:10:00
2  1/09/2020T10:10:00

Solution:
First, you need to convert the Dated to Datetime ..
df['date'] = pd.to_datetime(df['date'])
print(df)
                 date
0 2020-01-07 10:10:00
1 2020-01-08 10:10:00
2 2020-01-09 10:10:00

now use dt.strftime to get your choice ..
df['date'] = pd.to_datetime(df["date"].dt.strftime('%d/%m/%YT%H:%M:%S'))
print(df)
                 date
0 2020-07-01 10:10:00
1 2020-08-01 10:10:00
2 2020-09-01 10:10:00


text:
Q: "java.lang.IllegalStateException: Location is not set" in JavaFX application I am making an application for an accounting firm using JavaFX. I am getting a strange error when clicking a button I have set via FXML.
java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2434)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)

Here is my Main.java code:
    package tech.faraaz.zoforo;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getResource("gui/SplashScreen.fxml"));

        Scene scene = new Scene(root);

        stage.setTitle("Zoforo");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Here is my splash screen code:
    <?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>

<AnchorPane maxHeight="410.0" maxWidth="410.0" minHeight="410.0" minWidth="410.0" prefHeight="400.0" prefWidth="401.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="tech.faraaz.zoforo.gui.SplashScreenController">
   <children>
      <ImageView fitHeight="150.0" fitWidth="200.0" layoutX="24.0" layoutY="23.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../assets/logo.png" />
         </image>
      </ImageView>
      <ListView layoutX="24.0" layoutY="158.0" prefHeight="200.0" prefWidth="200.0" />
      <Button layoutX="248.0" layoutY="172.0" mnemonicParsing="false" onMouseClicked="#openAccountWindow" prefHeight="27.0" prefWidth="139.0" text="Open Account" />
      <Button layoutX="248.0" layoutY="209.0" mnemonicParsing="false" prefHeight="27.0" prefWidth="139.0" text="New Account" />
      <Button layoutX="248.0" layoutY="313.0" mnemonicParsing="false" prefHeight="27.0" prefWidth="139.0" text="Scan Statement" />
      <Button layoutX="248.0" layoutY="276.0" mnemonicParsing="false" prefHeight="27.0" prefWidth="139.0" text="Open Statement" />
      <Label layoutX="24.0" layoutY="374.0" text="Copyright Zoforo 2017 | zoforo.com" />
      <TextField layoutX="24.0" layoutY="122.0" promptText="Search Profiles..." />
   </children>
</AnchorPane>

Here is the code in SplashScreenController.java. I am using "Event" instead of "ActionEvent".
    @FXML
public void openAccountWindow(Event event) throws Exception {

    try {
        FXMLLoader loader = new FXMLLoader(getClass().getResource("gui/OpenAccountScreen.fxml"));
        Parent root = (Parent) loader.load();

        Stage stage = new Stage();
        stage.setScene(new Scene(root));
        stage.show();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Here is the code for OpenAccountScreen.java.
    <?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="384.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
   <children>
      <ImageView fitHeight="71.0" fitWidth="169.0" layoutX="14.0" layoutY="14.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../assets/logo.png" />
         </image>
      </ImageView>
      <TableView layoutX="14.0" layoutY="137.0" prefHeight="200.0" prefWidth="572.0">
        <columns>
          <TableColumn prefWidth="204.0" text="Account Name" />
          <TableColumn minWidth="0.0" prefWidth="218.0" text="Account Number" />
            <TableColumn minWidth="8.0" prefWidth="149.0" text="Statements" />
        </columns>
      </TableView>
      <Button layoutX="480.0" layoutY="346.0" mnemonicParsing="false" text="Open Account" />
      <TextField layoutX="14.0" layoutY="101.0" promptText="Search Accounts..." />
   </children>
</AnchorPane>

Any help is appreciated. Thanks.

A: In your Main class, your package and class name is:
tech.faraaz.zoforo.Main

In SplashScreenController it is:
tech.faraaz.zoforo.gui.SplashScreenController

So these classes are in different packages.
Yet you try to get the resource using the same relative location.
In Main:
getClass().getResource("gui/SplashScreen.fxml")

In SplashScreenController:
getClass().getResource("gui/OpenAccountScreen.fxml")

So relative to the location of the SplashController, then OpenAccountScreen.fxml would need to be in the following location for it to be found:
tech/faraaz/zoforo/gui/gui/OpenAccountScreen.fxml

I bet it's not there...
Probably, rather than accessing the FXML relative to the current class, you should access it relative to a given class (e.g. always Main) or via absolute references.  That might help prevent your confusion.
For example, write:
Main.class.getResource("gui/SplashScreen.fxml");
Main.class.getResource("gui/OpenAccountScreen.fxml");

OR:
getClass().getResource("/tech/faraaz/zoforo/gui/SplashScreen.fxml")
getClass().getResource("/tech/faraaz/zoforo/gui/OpenAccountScreen.fxml")

Note, to debug stuff like this, you can always just run:
System.out.println(getClass().getResource("gui/OpenAccountScreen.fxml"));

If it prints null, then you know the resource is not in the location you expect, then you can troubleshoot from there.


text:
Q: How mask z-index absolute position image for work backward link? I have a img with link on backward and overlayered img (position: absolute; top:0px; left: 10px;) with -webkit-clip-path: polygon(0px 150px,200px 150px,100px 0px);.
But: link under img.clip-path in visible area not work.
How solved this problem? May be creale another layout with SVG?
PS: z-index and position:relative for link not work. SVG+clipPath not work.
Demo: http://jsfiddle.net/9fjv4wbr/

img { width: 220px;  margin: 20px; }
img:hover { opacity: 0.5; }

.absolute { position: absolute; top:0px; left: 10px; }
.back { width: 600px; }

.clip-polygon {
  -webkit-clip-path: polygon(0px 150px,200px 150px,100px 0px);
}

body {
  background: linear-gradient(
    to bottom,
    #999,
    #eee
  );
}

body, html {
  height: 100%;
}


text:
Q: Parse Error and unrecognized media only css validation Css wont validate and I keep getting these errors. I have an ending bracket, so I'm not sure what the problem is. There's a parse error on line 39. Unrecognized media only on lines 79 and 81. Then on lines 79 and 89 those have the parse error. If anyone could help that would be greatly appreciated.
39.    nav a:{text-decoration:none;
    font-weight: bold;  }

nav a:link {color: #ffffff;}
nav a:visited {color: #808080;}
nav a:hover {color: #ff0000; }

h1 {text-align: center;
color: #ffffff;
font-family: CustomHeaderFont}
h2 { text-align: center;
color: #ffffff;
font-family: CustomHeaderFont}
h3 {text-align: center;
    color: #ffffff;
    font-family: CustomHeaderFont}
p { font-family: CustomFont;
color: #ffffff;
text-align: center;}

ul li { padding: 5px 0px; }

footer { font-size: 90%;
text-align: center;
clear: right;
padding: 15px;
color: #ffffff;
font-family: CustomFont;
}

70.   @media only screen and (max-width: 1024px){
body { margin: 0; }
#wrapper { width: auto; }
main {margin-left: 0;}
nav {float: none; width: auto; }
nav li { display: inline-block; padding: 0.5em; }
nav ul { text-align: center; }
nav a { border-style: none; }
h1, h2,h3 { font-size: 120%; }
79.    p { font-size: 90%; } }

81.    @media only screen and (max-width: 768px) {
h1, h2, h3{ font-size: 100%; }
p { font-size: 90%; }
main { margin: 0.5%;
   width: auto ;}
nav, nav ul, nav li { padding: 0;}
nav li { display: block; }
aside { display: none; }
89.    }

@font-face {
font-family: CustomFont;
src: url(Font/GlacialIndifference-Regular.otf); }

@font-face {
font-family: CustomHeaderFont;
src: url(Font/BLURRYFACE.ttf);
}

form { background-color: #000000;
        font-family: CustomFont;
        padding: 10px;
        }
fieldset{ width: 320px;
          border: 2px ridge #ff0000;
          padding: 10px;
          margin-bottom: 10px;
          }
legend {  font-family: CustomHeaderFont;
            font-weight: bold;
        }
label { float: left;
        width: 100px;
        clear: left;
        text-align: right;
        padding-right: 10px;
        margin-top: 10px;
        font-family: CustomFont;
    }
textarea, submit {margin-top: 10px;
                 display: block;
                 }
input checkbox {display: inline;
margin-bottom: 60px;}

table { border: 5px solid #ff0000;
        width: 600px;
        margin: auto;
        }
td, th {border: 1px solid #ff0000;
        padding: 0.5em;
        font-family: CustomFont;}

caption { font-family: CustomHeaderFont;
          font-weight: bold;
          font-size: 1.2em;
          padding-bottom: 0.5em;
          }

A: there is a : after a on line 39


text:
Q: Overlapping trees in L-system forest I created an a program using python's turtle graphics that simulates tree growth in a forest. There's 3 tree patterns that are randomly chosen, and their starting coordinates and angles are randomly chosen as well. I chose some cool looking tree patterns, but the problem I'm having is that many of the trees are overlapping, so instead of looking like a forest of trees, it looks like a bad 5 year old's painting.
Is there a way to make this overlapping less common? When you look at a forest, some trees and their leaves do overlap, but it definitely doesn't look like this:

Since there's a lot of randomization involved, I wasn't sure how to deal with this.
Here's my code:
import turtle
import random

stack = []

#max_it = maximum iterations, word = starting axiom such as 'F', proc_rules are the rules that
#change the elements of word if it's key is found in dictionary notation, x and y are the
#coordinates, and turn is the starting angle

def createWord(max_it, word, proc_rules, x, y, turn):

    turtle.up()
    turtle.home()
    turtle.goto(x, y)
    turtle.right(turn)
    turtle.down()

    t = 0
    while t < max_it:
        word = rewrite(word, proc_rules)
        drawit(word, 5, 20)
        t = t+1

def rewrite(word, proc_rules):

   #rewrite changes the word at each iteration depending on proc_rules

    wordList = list(word)

    for i in range(len(wordList)):
        curChar = wordList[i]
        if curChar in proc_rules:
            wordList[i] = proc_rules[curChar]

    return "".join(wordList)

def drawit(newWord, d, angle):

    #drawit 'draws' the words

    newWordLs = list(newWord)
    for i in range(len(newWordLs)):
        cur_Char = newWordLs[i]
        if cur_Char == 'F':
            turtle.forward(d)
        elif cur_Char == '+':
            turtle.right(angle)
        elif cur_Char == '-':
            turtle.left(angle)
        elif cur_Char == '[':
            state_push()
        elif cur_Char == ']':
            state_pop()

def state_push():

    global stack

    stack.append((turtle.position(), turtle.heading()))

def state_pop():

    global stack

    position, heading = stack.pop()

    turtle.up()
    turtle.goto(position)
    turtle.setheading(heading)
    turtle.down()

def randomStart():

    #x can be anywhere from -300 to 300, all across the canvas
    x = random.randint(-300, 300)

    #these are trees, so we need to constrain the 'root' of each
    # to a fairly narrow range from -320 to -280
    y = random.randint(-320, -280)

    #heading (the angle of the 'stalk') will be constrained
    #from -80 to -100 (10 degrees either side of straight up)
    heading = random.randint(-100, -80)

    return ((x, y), heading)

def main():

    #define the list for rule sets.
    #each set is iteration range [i_range], the axiom and the rule for making a tree.
    #the randomizer will select one of these for building.

    rule_sets = []
    rule_sets.append(((3, 5), 'F', {'F':'F[+F][-F]F'}))
    rule_sets.append(((4, 6), 'B', {'B':'F[-B][+ B]', 'F':'FF'}))
    rule_sets.append(((2, 4), 'F', {'F':'FF+[+F-F-F]-[-F+F+F]'}))

    #define the number of trees to build
    tree_count = 50

    #speed up the turtle
    turtle.tracer(10, 0)

    #for each tree...
    for x in range(tree_count):

        #pick a random number between 0 and the length
        #of the rule set -1 - this results in selecting
        #a result randomly from the list of possible rules.

        rand_i = random.randint(0, len(rule_sets) - 1)
        selected_ruleset = rule_sets[rand_i]

        #unpack the tuple stored for this ruleset
        i_range, word, rule = selected_ruleset

        #pick a random number inside the given iteration_range to be the
        #iteration length for this command list.
        low, high = i_range
        i = random.randint(low, high)

        #get a random starting location and heading for the tree
        start_position, start_heading = randomStart()

        #unpack the x & y coordinates from the position
        start_x, start_y = start_position

        #build the current tree
        createWord(i, word, rule, start_x, start_y, start_heading)

if __name__ == '__main__': main()

A: From my understanding of an L-system there's a whole grammar that isn't randomly chosen. Could you provide details as to how your grammars work? I would imagine that you can somewhat restrict which directions your trees grow into by making a limited, closed-ended set of productions that go anywhere more than 90 degrees from the starting angle.
But then you can't totally randomize the starting angle... You probably need to just randomize it within a certain range? Of course if you have an L-system that just generates everything randomly, it's just gonna look like a bunch of noise. There's a purpose to putting a restriction on your initial conditions; every grammar has a start symbol, and you need to take advantage of your start symbol to generate stuff that makes sense. I'd imagine that you want your start symbol to always point up.
But I haven't studied L-systems in a long time, so take my answer with a grain of salt.
Edit:
That's an interesting restriction to impose, in that it sound like something that trees do naturally. In nature I think it happens because only a certain amount of sunlight can get through to a given patch of ground, so if a tree is already growing somewhere, nothing else can do so.
Being an AI guy, I love turning real-world solutions into interesting heuristics. What kind of a heuristic are we looking for here? Well, a "patch of ground" in a 2-d coordinate system is just a range of x-coordinates. Maybe have something that makes growth lose impetus if there's too much stuff within some arbitrary x range of a growing leaf? (not a python xrange, but a range of x-coordinates, some "delta" value if you will.)

A: I think the problem lies more in the regularity of features among the trees themselves, rather than their placement per se.
A possible solution would be to add mutations. For a global control of "stunted growth", you could suppress say 5% of the production applications. This should give sparser trees that follow the model more loosely.
For finer control, you can suppress each production with a different weight.
Check out The Algorithmic Beauty of Plants section 1.7 Stochastic L-systems for more. They use probability to select among several variants of single rule.


text: Q: Head First Servlets and JSP and the Java EE 6 Web Component Developer exam im considering doing the Java EE 6 Web Component Developer Certified exam, but frankly cannot afford the course that is associated with it. The "Head First Servlets and JSP: Passing the Sun Certified Web Component Developer Exam" book claims to serve as sufficient material for learning and passing the material in the above exam. It does however relate to the J2EE 1.5 Sun Certified Web Component Developer (SCWCD) exam. Does anyone know whether the coverage would be sufficient for the aforementioned exam, or at least serve a coverage for the vast bulk of the assessable content?


text:
Q: Find the recurrence relation I'm new to recurrence relations and I'm having trouble figuring out this problem:
Find a recurrence relation for the number of ways to make a stack of green, yellow, and orange napkins so that no two green napkins are next to each other.
I've come up with a(n)=2a(n-1)+2a(n-2) but I'm not sure if that's right/ on the right track.
Any help would be great!

A: First of all, your answer is correct:

*

*If the n'th napkin are green then n-1'th napkin could be yellow or orange and other n-2 napkin could be anything so it is 2*an-2.

*If n'th napkin is not green it could be yellow or orange and other n-1 napkin could be anything so it is 2*an-1.
So the final answer is an = 2*an-2 + 2*an-1.


text:
Q: Create office 365 user with PHP API I followed this tutorial to set up a laravel enviroment to work with the Microsoft Graph API. I want to do CRUD operations on Office 365 users, but in the documentation, there is no PHP sample code provided.
This is what the request body should look like:
POST https://graph.microsoft.com/v1.0/users
 Content-type: application/json

 {
   "accountEnabled": true,
   "displayName": "displayName-value",
   "mailNickname": "mailNickname-value",
   "userPrincipalName": "upn-value@tenant-value.onmicrosoft.com",
   "passwordProfile" : {
   "forceChangePasswordNextSignIn": true,
   "password": "password-value"
  }
 }

However, How do I translate that to a PHP call?

A: You need to post that as a PHP Curl request.
Here is the basic idea to get you started.
$jsonStr = json_encode(Array(
    "param1"=>"val1",
    "param2"=>"val2",
    "param3"=>Array(
                "param1"=>"val1",
                "param2"=>"val2"
    )
));
$headers = Array("Content-Type: application/json","Content-Length:".strlen($jsonStr));

$ch = curl_init("https://graph.microsoft.com/v1.0/users");
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonStr);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST,"POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);


text:
Q: Modeling what should be a logistic regression but has no negative responses I have a data set of reported food-borne illnesses and we're trying to determine what environmental conditions during food cultivation led to high bacterial counts in the food, and thus caused the illnesses. Unfortunately, I only have data of foods that caused confirmed illnesses. I requested that we go back and "randomly" sample from food tags that did not cause a reported illness but am not allowed to do so for various reasons. Even that would have had problems (because just because an illness is not reported doesn't mean it didn't occur), but at least this would have given me some negative observations.
I was originally planning to model these data using a logistic regression but I am stuck at what to do now. Without negative observations, I can only really provide univariate descriptive statistics, right? I'm hoping that someone else has had this problem and perhaps there's some model I haven't heard of before that can handle this. Thank you.

A: Do you have any other information available?  previous studies of similar cases? number and types of foods that were not measured? guesses about the process from biologists?
If you can find other existing information then possibly your best bet (other than the simple descriptives) is a Bayesian analysis.  But be very careful in how you create your priors and the relationships, without a lot of data it can be easy to over interpret results that are more a reflection of the prior than the data.