text:
Q: Page background with transparency colours Take a look at this page layout

I would like to achieve a result like the above in the booklet I am writing. Here is what I have so far
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[lmargin=0.7cm, rmargin=1cm, vmargin=1.5cm]{geometry}
\renewcommand{\qedsymbol}{$\blacklozenge$}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{eulervm}
\usepackage{esint}

\usepackage{fontawesome}
\renewcommand{\thefootnote}{\faDatabase}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{Mathematical Analysis ... }
\chead{... \textit{A collection of problems}}
\rhead{Version 6}
\cfoot{Page \@ \thepage \@ of 24}
\lfoot{Typesetting \LaTeX }
\rfoot{\textbf{Editor:} Tolaso J. Kos}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{0.5pt}

\usepackage{tcolorbox}

\usepackage{tikz}
\usetikzlibrary{intersections,backgrounds}
\usepackage{pgfplots}
\usepgfplotslibrary{colormaps}

\usepackage[shortlabels]{enumitem}
\usepackage{bigints}
\usepackage{cancel}
\usepackage{multicol}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0.5pt}%
\usepackage{xcolor}

%definition of dark red
\definecolor{DarkBlue}{RGB}{102, 153, 255}
\definecolor{LightBlue}{RGB}{51, 102, 255}
\usepackage{afterpage}

\makeatletter
% Macro \changepagecolor has the same syntax as \pagecolor or \color
% with an optional argument and a mandatory argument.
\newcommand*{\changepagecolor}{%
  \@ifnextchar[\@changepagecolor@i\@changepagecolor@ii
}
% Case: \changepagecolor[...]{...}
\def\@changepagecolor@i[#1]#2{%
  \@changepagecolor@do{[{#1}]{#2}}%
}
% Case: \changepagecolor{...}
\newcommand*{\@changepagecolor@ii}[1]{%
  \@changepagecolor@do{{#1}}%
}
\newcommand*{\@changepagecolor@do}[1]{%
  % Fill the remaining space with a colored rule
  \begingroup
    \offinterlineskip
    \hbox to 0pt{%
      \kern-\paperwidth
      \vtop to 0pt{%
        \color#1%
        \hrule width 5\paperwidth height \paperheight
        \vss
      }%
      \hss
    }%
  \endgroup
}
\makeatother

\usepackage{pagecolor}
\usepackage{atbegshi} % for '\AtBeginShipout' macro
% Make page color "light red" *after* page 2
\AtBeginShipout{\ifnum\value{page}=1\pagecolor{white}\fi}

%the title of this project

\newcommand{\mytitle}{\textbf{Mathematical Analysis}}
\newcommand{\mydescription}{\textbf{A collection of problems}}
\newcommand{\mytiny}{\textbf{Real \& Complex Analysis - General Topology - Multivariable Calculus  - Integrals and Series}}

%font for name

\usepackage{pbsi}

\begin{document}
\begin{flushleft}

\thispagestyle{empty}

\pagecolor{DarkBlue}

\begin{center}
{\Huge \mytitle}

{\Large \mydescription}

{\tiny \mytiny}
\end{center}

\topskip0pt
\vspace*{\fill}

\changepagecolor{LightBlue}

\begin{multicols}{2}
    \begin{tikzpicture}
    \begin{axis}[
    view={120}{40},
    grid=major,
    xmin=-4,xmax=4,
    ymin=-4,ymax=4,
    zmin=-1,zmax=10,
    enlargelimits=upper,
    colormap/bone,
    trig format plots=rad,
    ]
    \addplot3 [ surf, domain=-4:4, domain y=-4:4,
    samples=20, samples y=20,
    variable=\u, variable y=\v,
    point meta=u*v ]
    ( {u}, {v}, {cos(u) + cos(v)} );
    \end{axis}
    \end{tikzpicture}

    \begin{tikzpicture}
    %axis
    \draw (-.5,0) -- (6.5,0);

    %curve
    \draw[yshift=1cm,name path=curve] (-.5,0) %vertically shiftable
    to[out=70,in=180] (.7,1.5)
    to[out=0,in=180] (2,.5)
    to[out=0,in=180] (4.5,2.5)
    to[out=0,in=160] (6.5,1);

    %rectangles
    \begin{scope}[on background layer]
    \foreach \x in {0,1,2,3, 4,5}{
        \path[name path=line \x] (\x,0) -- (\x,4);
        \path[name intersections={of=curve and line \x, by={isect \x}}];
        \draw[fill=gray!50] (isect \x) rectangle (\x+1,0);
        \draw[fill] (isect \x) circle [radius=2pt];
    }
    \end{scope}
    \end{tikzpicture}
\end{multicols}
\vspace*{\fill}

\begin{center}

    {\Huge {\color{white}{Version 6 }}}
\end{center}

\vfill

\begin{center}
    {\Huge \textbf{\textbsi{Tolaso J. Kos}}}
\end{center}

\end{flushleft}
\end{document}

and produces

which is not that bad . But I would like to have a result like the above. I have read some topics here in TeX SE but I find it quite complicated. I would really appreciate your help.

A: Just a starting point, from Titlepage with tikz:
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{calc,positioning, shadings}% [0]

\begin{document}
\begin{titlepage}
\begin{tikzpicture}[overlay,remember picture]
    % set a new origin [1]
    \coordinate (O) at (current page.south west);
    % bg
    \fill [left color=orange!60!yellow, right color=red!50!black]
        (current page.south west) rectangle (current page.north east) ;
    % inset; position coordinates
    \coordinate (A) at ($(O)+(0.2\paperwidth,0.7\paperheight)$);
    \coordinate (B) at ($(O)+(0.2\paperwidth,0.3\paperheight)$);
    % maybe you need to do tricks if you want best color merging
    % note that I store the position of the rigth-lower point of the inset
    \fill [red!60!black, ]
        (A) rectangle ($(B)+(0.6\paperwidth,0)$) coordinate(C);
    % the last coordinate is the point reached horizontally from A and
    % vertically from C
    \draw[white] (C) -- (B) -- (A) -- (A -| C);
    % next node will be midway between A and C, anchored at the center
    \node at ($(A)!0.5!(C)$) [%
        anchor = center,
        ] {\includegraphics[width=5cm]{example-image}};
    % white framed box
    \node at (current page.south) [%
        draw=red,
        inner sep=15pt,
        fill=white,
        above=5cm,
        font=\sffamily\bfseries\Huge
    ] {The book title};
\end{tikzpicture}
\end{titlepage}
\end{document}

...which you can change to adapt to your style, I think, quite easily.


text:
Q: Spring Boot role validation controller using aspect I have several controller functions separated by role, and instead of doing role validation in each controller method, I found that it seems to be able to get done by using Aspect, however something isn't right in my implementation as the code in Aspect never runs
Annotation:
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ForMerchantOnly {}

Aspect:
@Aspect
@Configuration
public class ForMerchantOnlyAspect {
    private static final Logger logger = LogManager.getLogger(ForMerchantOnlyAspect.class);

    @Before("@annotation(com.example.api.annotation.ForMerchantOnly) && args(request)")
    public void before(HttpServletRequest request) throws ServiceException {
        if (!(request instanceof HttpServletRequest)) {
            throw new RuntimeException("request should be HttpServletRequesttype");
        }

        String domain = request.getServerName();
        System.out.println("Aspect showing domain " + domain);
        // -- other code
    }
}

Controller
@ForMerchantOnly
@GetMapping("/list")
public ResponseEntity<ApiResp> list() {
    System.out.println("Show something");
    return ResponseEntity.ok().body();
}

I'm assuming when i call controller /list method via chrome browser, it would hit the code in ForMerchantOnlyAspect but it just went into the controller method directly. Am I missing something?

A: The Aspect was not working as it could not find a matching joinpoint . There are no controller methods that has annotation @ForMerchantOnly and has an argument of type HttpServletRequest
From the documentation :

args: Limits matching to join points (the execution of methods when
  using Spring AOP) where the arguments are instances of the given
  types.

Following aspect may be used for the requirement . Scoping designator within will set the scope to advice.
@Before("@annotation(com.example.api.annotation.ForMerchantOnly) && within(com.example.api..*)")
  public void before() {
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes())
                .getRequest();

        System.out.println("Aspect showing domain " + request.getServerName());
    }

Also note that an Aspect is better annotated with @Component and @Configuration be used for configurations.
You may also have a look at Method Security of Spring security framework , which lets to secure a method with annotations.
From the documentation

From version 2.0 onwards Spring Security has improved support
  substantially for adding security to your service layer methods. It
  provides support for JSR-250 annotation security as well as the
  framework's original @Secured annotation. From 3.0 you can also make
  use of new expression-based annotations. You can apply security to a
  single bean, using the intercept-methods element to decorate the bean
  declaration, or you can secure multiple beans across the entire
  service layer using the AspectJ style pointcuts.

redpajama_set_name: RedPajamaStackExchange


text:
Q: DOB and Age field as blank using SQL I am running a SQL query where I am trying to get both the DOB and Age field as blank (' ') as opposed to NULL.
I have managed to use the ISNULL function to change the DOB from 1900-01-01 to ' '. Originally my DOB was
SELECT isnull(DOB,'') DOB

which was bring back 1900-01-01 instead of NULL
With the code below the Age field is appearing as '0' rather then ' '. I'm not sure how to use the ISNULL function, as the Age field does not exist in the db table.
SELECT ISNULL(CASE WHEN CONVERT(DATE, DOB) = '1900-01-01' THEN ''
                   ELSE CONVERT(CHAR(10), DOB, 103) END, '') AS DOB,
       ISNULL (DATEDIFF(hour,dob,GETDATE())/8766,'')Age,

Any help will be much appreciated, thanks :)
Some dummy data of the table:
ID | Name |Address |DOB         | Gender | Email        |
---------------------------------------------------------
01 | Max  |Abc Road| 2000-12-19 | Male   |Max@mail.net  |
02 | Sam  |TBH Road| null       | Male   |Sam@mail.net  |

This is what im getting with my query
ID | Name |Address |DOB        | Age  | Email        |
---------------------------------------------------------
01 | Max  |Abc Road|2000-12-19 | 15   |Max@Gmail.net |
02 | Sam  |TBH Road|           | 0    |Sam@Gmail.net |

What I want to get however is:
ID | Name |Address |DOB        | Age  | Email        |
---------------------------------------------------------
01 | Max  |Abc Road|2000-12-19 | 15   |Max@Gmail.net |
02 | Sam  |TBH Road|           |      |Sam@Gmail.net |

A: You could use a simple CASE statement.
case
    when dob = ''
        then ''
    else datediff(hour, dob, getdate())/8766
end as [Age]

There's probably a more elegant way to do it though.

A: You need to convert the other to varchar because it is coming as int then all other cases for that column will come as int if u have'nt mention anything it will default takes 0
so need to change the all output to varchar()
SELECT ISNULL(CASE WHEN CONVERT(DATE, DOB) = '1900-01-01' THEN ''
                   ELSE CONVERT(CHAR(10), DOB, 103) END, '') AS DOB,

IIf((DATEDIFF(hour,DOB,GETDATE())/8766) is null,'',
cast((DATEDIFF(hour,DOB,GETDATE())/8766) as nvarchar(3))) Age

A: This is your age:
DATEDIFF(hour,dob,GETDATE())/8766

It is a number.  To make it a string, do this:
cast(DATEDIFF(hour,dob,GETDATE())/8766 as varchar (15))

Then you can use isnull because your datatypes are the same
isnull(cast(DATEDIFF(hour,dob,GETDATE())/8766 as varchar (15)), '')

A: You can use nullif and cast for this
 select ISNULL(CONVERT(CHAR(10), nullif(DOB,'1900-01-01'), 103),'')  as DOB,
 isnull(cast(DATEDIFF(hour,nullif(DOB,'1900-01-01'),GETDATE())/8766 as varchar),'') Age


text:
Q: Non-Query storedprocedure in EF core 3 I am new to ASP.net core and want to create an MVC website that shows the student data and changes their status from out-of-school to new when the user clicks on the change-status button. Below are the classes ,the DB table and SP.
The change status method in contoller:
public async Task<IActionResult> ChangeStatus(long? id)
    {
         if (id == null)
        {
            return NotFound();
        }

        var students = await _db.Students
            .FirstOrDefaultAsync(m => m.Id == id);
        if (students == null)
        {
            return NotFound();
        }
        var Id = new SqlParameter
        {
            ParameterName = "@Id",
            SqlDbType = System.Data.SqlDbType.BigInt,
            Direction = System.Data.ParameterDirection.Input,
            Value = student.Id
        };

        _db.Students.FromSqlInterpolated($" EXECUTE [dbo].[usp_changeStatus] @Id = {Id}").AsEnumerable().FirstOrDefault();
        await _db.SaveChangesAsync();
        return View(student);
    }

The Model class:
 public class Student
    {
            [Key]
            public Int64 Id { get; set; }
            public string Name { get; set; }
            public string Address { get; set; }
            public string Age { get; set; }
    }

DBContext:
public DbSet<Student> Students{ get; set; }

In Database:
Table:
   CREATE TABLE [dbo].[Students](
    [Id] [bigint] IDENTITY(1,1) NOT NULL,
    [Name] [nvarchar](100) NOT NULL,
    [Address] [nvarchar](100) NOT NULL,
    [Age] [nvarchar](100) NOT NULL);

StoredProcedure:
  Create PROCEDURE [dbo].[usp_changeStatus]
    @Id bigint
AS
BEGIN
    SET NOCOUNT ON;
    update [dbo].[Students] set [Status] = 'New'
    where Id = @Id;
END

Problem:
After clicking  change-status button the SP runs and the status changed in DB table but the error in the following image appears:


text:
Q: school assignment regarding inverting Dictionary with Tuple[Keys] and string[values], writing to text file inverting Dictionary with Tuple[Keys] and string[values], writing dictionary to a text file, then reading the text file, and inverting the keys-values back to original order.
I'm just <json - .dumps/.loads> to convert the data to a string to save, and then back into a dictionary.  The problem is that I'm getting an error code trying to invert the values and keys back... my error is
TypeError: string indices must be integers

Here is my code:
import json

def invert_roster(d):
     inverse = dict()
     for key in d:
          val = d[key]
          if val not in inverse:
               inverse[val] = [key]
          else:
               inverse[val].append(key)
     return inverse

a = 0
def choice(c):
    a = ' '
    choice = input('Enter <add> to add to file, or <view> to view file.')
    if choice == 'add':
        add(a)
    elif choice == 'view':
        view_file(a)

def add(a):
    rf = 0
    choice2 = input('<new> File or <old> File?')
    if choice2 == 'new':
        new_file()
    elif choice2 =='old':
        read_file(rf)
    roster = dict()
    name = ' '
    print('Enter <stop> to exit.')
    while name != 'stop':

        name = input('Enter first and last name of patient: ')
        if name == 'stop':
            write_file(roster)
        diagnosis = input('Enter Diagnosis of patient: ')
        first,last  = name.split(' ')
        roster[last, first] = (diagnosis)

def write_file(roster):
    print(roster)
    file = open('journal8.txt', 'w')
    ir = invert_roster(roster)
    print(ir)
    wf = json.dumps(ir)
    file.write(wf)
    file.close()
    choice()

def view_file(a):
    file = open('journal8.txt', 'r+')
    vf = (read_file(file))
    print(vf)
    keys = vf.keys()
    print(keys)
    print(type(vf))
    for c in vf:
        print(c, vf[c])
    for c in vf:
        vf[c] = tuple(vf[c])
    print(vf)
    ta = json.dumps(vf)
    invert = invert_roster(ta)
    file.close()
    return()

def read_file(rf):
    line = rf.readline()
    fin = line.strip()
    rf = json.loads(fin)
    return(rf)

def new_file():
    file = open('journal8.txt', 'w')
    return()

choice(a)

The issue seems to be in f(x)=view_file and f(x)=invert_roster. I'm able to convert to string and write to file, read the file and manipulate data from the file, but I can't invert the darn thing.


text:
Q: Parse JSON into Object I have a User class defined as:
User.java
package model;

import java.util.List;
import java.util.Map;

public class User {
    private final Map<String, List<String>> accountTransactionsMap;

    public User(final Map<String, List<String>> accountTransactionsMap) {
        this.accountTransactionsMap = accountTransactionsMap;
    }

    public Map<String, List<String>> getAccountTransactionsMap() {
        return accountTransactionsMap;
    }
}

I am calling a REST API that returns the following response:
{
   "username1":{
      "456":[

      ],
      "123":[

      ],
      "789":[

      ]
   },
   "username2":{
      "123":[

      ],
      "456":[

      ],
      "789":[

      ]
   },
   "username3":{
      "789":[

      ],
      "123":[

      ],
      "456":[
         "transaction10",
         "transaction6",
         "transaction9",
         "transaction3"
      ]
   }
}

I would like to be able to parse through the response and store it in a User object.
I have tried the following:
Test.java
public class Test {
    public static void main(final String[] args) {
        final String response = "{\"username1\":{\"456\":[],\"123\":[],\"789\":[]},\"username2\":{\"123\":[],\"456\":[],\"789\":[]},\"username3\":{\"789\":[],\"123\":[],\"456\":[\"transaction10\",\"transaction6\",\"transaction9\",\"transaction3\"]}}";
        final Gson gson = new Gson();
        final Type map = new TypeToken<Map<String, User>>(){}.getType();
        final Map<String, User> result = gson.fromJson(response, map);
        System.out.println(result);

        if (result != null) {
            for (final Map.Entry<String, User> entry : result.entrySet()) {
                System.out.println("username: " + entry.getKey());
                final User user = entry.getValue();
                System.out.println("transactions: " + user.getAccountTransactionsMap());
            }
        }
    }
}

This yields output:
{username1=model.User@80ec1f8, username2=model.User@1445d7f, username3=model.User@6a396c1e}
username: username1
transactions: null
username: username2
transactions: null
username: username3
transactions: null

I expect output:
{username1=model.User@80ec1f8, username2=model.User@1445d7f, username3=model.User@6a396c1e}
username: username1
transactions: {123=[],456=[],789=[]}
username: username2
transactions: {123=[],456=[],789=[]}
username: username3
transactions: {123=[],456=["transaction10", "transaction6", "transaction9", "transaction3"],789=[]}

How can I parse the accountId and the list of transactionIds into its own map as a variable in my User class?
Edit: I suppose the question really becomes, how can I create a custom TypeToken for my User class?

A: Instead of User class you need to use Map<String, Map<String, List<String>>>:
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.io.File;
import java.io.FileReader;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

public class GsonApp {

    public static void main(String[] args) throws Exception {
        File jsonFile = new File("./resource/test.json").getAbsoluteFile();

        final Gson gson = new Gson();
        final Type map = new TypeToken<Map<String, Map<String, List<String>>>>(){}.getType();
        final Map<String, Map<String, List<String>>> result = gson.fromJson(new FileReader(jsonFile), map);
        System.out.println(result);

        if (result != null) {
            for (final Map.Entry<String, Map<String, List<String>>> entry : result.entrySet()) {
                System.out.println("username: " + entry.getKey());
                final Map<String, List<String>> user = entry.getValue();
                System.out.println("transactions: " + user);
            }
        }
    }
}

Above code prints:
{username1={456=[], 123=[], 789=[]}, username2={123=[], 456=[], 789=[]}, username3={789=[], 123=[], 456=[transaction10, transaction6, transaction9, transaction3]}}
username: username1
transactions: {456=[], 123=[], 789=[]}
username: username2
transactions: {123=[], 456=[], 789=[]}
username: username3
transactions: {789=[], 123=[], 456=[transaction10, transaction6, transaction9, transaction3]}

If you really need, you can create User object after parsing.


text:
Q: Microsoft.Azure.Cosmos.Tables to Azure.Data.Tables migration: TableEntity Inheritance I am trying to migrate some legacy code from Microsoft.AzureCosmos.Tables to Azure.Storage.Tables. The TableEntity class is sealed in Azure.storage.Tables, so how do I fix this?
    public class HistoricalValues : TableEntity
    {
        public string tName { get; set; }
        public double tValue { get; set; }
        public int fTagId { get; set; }
        public string date { get; set; }
    }

Do I just add the PartitionKey, RowKey, eTag, etc properties? Eg public string PartitionKey { get; set; }?
I don't really understand inheritance, so pointing me at a decent explanation/sample code would also be appreciated.

A: I've been migrating some legacy code myself. Azure.Storage.Tables follows a slightly different albeit improved paradigm for working with CosmosDB and Azure tables. Instead of inheriting TableEntity, your table entity classes implement ITableEntity, which as you mentioned requires you to add the RowKey, PartitionKey, ETag and Timestamp properties.
There are other changes besides the table entity implementation. This article has some good information with a walkthrough using ITableEntity.
The Microsoft information on this is a little less helpful, especially for migrating existing code from TableEntity to ITableEntity. Here's that documentation.


text:
Q: Error while creating react native project using yarn "Error: Command failed: yarn init -y" Facing this issue ever since I installed yarn don't know what the problem is as creating my react native project using npm  npx react-native init SomePoject --npm  works just fine.
Whereas when i try it without specifying to use npm  npx react-native init SomeProject it gives this error:
Link to screen shot of error it will tell all its story


text:
Q: Program run under x64dbg goes immediately to completion I'm using the x64dbg debugger from SourceForge under Windows 10, and I've been having a problem with it that I think is probably due to my own stupidity somehow, but so far I can't pin it down.
I'm using the MASM assembler, and when I'm working on a problem I will typically write a program consisting of only a few instructions, and then trace it with debugger to see exactly what's happening in a simple context.
I've been using a program called temp1 for a few weeks, and now suddenly when I run this program with the debugger, the debug data flashes for a fraction of a second on the x64dbg screen, and then the program runs to completion, as if I had clicked Debug → Run with no breakpoints.
I tried adding more instructions to the program, but the result was still the same. So then I renamed the program to bozo, and assembled and linked it under that name, with only two instructions in it. When I run bozo.exe under x64dbg, it stops on the first instruction with no problem.
What could be going on here? How can just using a different program name change the way the debugger behaves?

A: Go to Options → Preferences (Settings), and in the Events tab make sure to have entry breakpoint selected, so x64dbg breaks at the entry of your program, before it does anything.

A: x64dbg saves settings, breakpoints, comments, etc. on the debugee file name basis - in the so-called "database".
For example, if your debugee was bozo.exe 64-bit executable, its database is saved in the bozo.exe.dd64 file to keep your setting for future work with the same (bozo.exe) file.
The full path is something as
c:\Program Files\x64dbg\x64\db\bozo.exe.dd64

but it is not important as it is loaded automatically after opening / attaching the debugee bozo.exe.
It explains why the simple file-name change (which creates a new database with the default settings) may change the behavior of the debugger.
(The rest of the explanation is in the Alicia's answer.)


text:
Q: Is it possible to see a remote ubuntu server throught a gui? I have some ubuntu (version 13.10) servers which I can access throught ssh.
It is all fine, but I'd like to access them with a gui, so to handle some operations more efficiently.
Of course I'd like to NOT install any desktop environment on the server itself, I'd just like a way to see what there is on that server with a gui on client side...don't know if I explained myself well.
Would it be possible?
I am currently using kubuntu 13.10.

A: If you need to manage files and folders, you can use sftp:
1. Open File Manager and press Ctrl+L
2. Type: sftp://remoteip/

If you want to view the remote ubuntu desktop (like teamviewer), you can use remmina:
sudo apt-get remmina

to install remmina remote desktop client

A: It depends on the applications you want to manage, some applications have web clients you can use.  mdadm and deluge-d come to mind.
Otherwise you're best off writing few scripts to handle your common operations. If you set them up right you could execute them from your ubuntu machine

A: The actual answer you want is yes it can.
I would recommend using xrdp/vnc, or teamviewer.


text:
Q: php mysql if else update database and display different links based on database I am learning php and I am trying to add some buttons that modify the status of a project. I managed to make my code do this and it's working but I am sure it can be written better and I wonder if this can be done without refreshing the page? Any ideas will be appreciated.
Thanks.
if (isset($_GET['status'])) {
$id = (int)$_GET['id'];
$status = (int)$_GET['status'];
$statusSql = "UPDATE projects SET status = '$status' WHERE id ='$id'";
$db->query($statusSql);
header('Location: projects.php');
}
........
<?php
      if(($project['status']) == 0 ) {
         echo "

           &nbsp New Project";
      }elseif(($project['status']) == 1 ){
         echo "

          &nbsp In Progress &nbsp

           ";
      }elseif(($project['status']) == 2 ){
        echo "

         &nbsp On Hold
          ";
      }elseif(($project['status']) == 3 ){
        echo "

         &nbsp Finished
          ";
      };

?>


text:
Q: Reload page if navigation fail in WebView Flutter I'm trying to figure out how can I reload page automatically if WebView fail to reach URL. I don't know if onWebResourceError can help me.
Thanks in advance!

A: I found that onWebResourceError was the key.
here is the solution:
onWebResourceError: (WebResourceError error) {
  _myController.loadUrl("http://connectivitycheck.gstatic.com/generate_204");
},


text:
Q: Iterate a list without next() I have a list called current_month_list which is populated each month with Mondays in the month. ie for June it would be:
current_month_list = 6, 13, 20, 27

Im using
next_rubbish_day = next(x for x in current_month_list if x > todays_date.day)

to return the next Monday in the list i.e. 20 as todays the 16
This has worked well but im trying to convert over to Pyscript it use this in a different environment and apparently (quoted on another site) '

pyscript includes an async python interpreter and doesn't implement
certain features that are particularly difficult in an interpreter.
That includes generators.

The error im getting is

not implemented ast ast_generatorexp

So my question is, is there another way to code this. Im not to good with python so would appreciate some help. Thank you in anticipation.

A: Probably do something like this (you'll have to set or import the todays_date.day).  There are bunch of ways to do this with for, while, break, return, etc.  Really just depends on what you want!  Good luck!
def main():
    print(date_fun())

def date_fun():
    current_month_list = [6, 13, 20, 27]
    for y in current_month_list:
        if y > todays_date.day:
            return y

main()

A: Since generators are forbidden, just fall back to a regular loop. next() will return the next item in that generator expression, and since you just created the generator, that will be the first item. So just break out of your loop once you have your first item:
for x in current_month_list:
    if x > todays_date.day:
        next_rubbish_day = x
        break

Now, this code will not throw any errors if none of x > todays_date.day in current_month_list; your original code would throw a StopIteration exception. To implement this functionality, all you need is to use the for..else form:
for x in current_month_list:
    if x > todays_date.day:
        next_rubbish_day = x
        break
else:
    # This code runs only if the loop finishes without being broken
    raise StopIteration()

This snippet behaves identically as far as I know to your next(...) statement.


text:
Q: How to deploy a React web app to the Fiori Launchpad? I have a React web application which I created with the ui5-webcomponents-react library from SAP https://github.com/SAP/ui5-webcomponents-react.I wish to make this application available via the SAP Fiori Launchpad (as a tile).
How can I make this happen?
I've successfully uploaded the 'built' app (contents of the build folder) to SAP via the method outlined here:
https://blogs.sap.com/2019/11/27/how-to-run-reactjs-web-apps-in-sap/
(Essentially created a bespoke Z BSP application in SE80 and manually uploaded & linked all of the relevant 'minified' files)
And I can access the application via the open web service in SAP.
But I'm unsure how to continue?
Is the above method even the right thing to do? There has to be a much easier way of doing this?
I'm on the latest version of S/4 HANA and don't wish to use Eclipse or the WebIDE (primarily because I'm on the on-premise version and because I'm not a huge fan of the Eclipse IDE as it's considerably slower and more resource heavy compared with VSCode).

A: I'm not 100% this is what you were looking for, but you can add your app as a URL App in the Portal. This will create a tile for the specific app your linking it to.
This might help, Marius Obert wrote a great article on how to add a React app to your LP.
https://blogs.sap.com/2020/02/03/cloudfoundryfun-11-integrate-a-react-app-in-the-fiori-launchpad/


text:
Q: What's the complexity of sum i=0 -> n (n_i*i)) This is a test I failed because I thought this complexity would be O(n), but it appears i'm wrong and it's O(n^2). Why not O(n)?

A: First, notice that the question does not ask what is the time complexity of a function calculating f(n), but rather the complexity of the function f(n) itself. you can think about f(n) as being the time complexity of some other algorithm if you are more comfortable talking about time complexity.
This is indeed O(n^2), when the sequence a_i is bounded by a constant and each a_i is at least 1.
By the assumption, for all i, a_i <= c for some constant c.
Hence, a_1*1+...+a_n*n <= c * (1 + 2 + ... + n). Now we need to show that 1 + 2 +... + n = O(n^2) to complete the proof.
1 + 2 + ... + n <= n + n + ... + n = n * n = n ^ 2

and
1 + 2 + ... + n >= n / 2 + (n / 2 + 1) + ... + n >= (n / 2) * (n / 2) = n^2/4

So the complexity is actually Theta(n^2).
Note that if a_i was not constant, e.g., a_i = i then the result is not correct.
in that case, f(n) = 1^2 + 2^2 + ... + n^2 and you can show easily (using the same method as before) that f(n) = Omega(n^3), which means it's not O(n^2).

A: Preface, not super great with complexity-theory but I'll take a stab.
I think what is confusing is that its not a time complexity problem, but rather the functions complexity.
So for easy part i just goes up to n ie. 1,2,3 ...n , then for ai all entries must be above 0 meaning that a could be something like this 2,5,1... for n times. If you multiply them together n*n = O(n2).
The best case would be if a is 1,1,1 which drop the complexity down to O(n) but the average case will be n so you get squared.

A: Unless it's mentioned that a[i] is O(n), it's definitely O(n)

A: Here an another try to achieve O(n*n) if sum should be returned as result.
int sum = 0;
for(int i = 0; i<=n; i++){
   for(int j = 0; j<=n; j++){
        if(i == j){
            sum += A[i] * j;
        }
    }
return sum;


text:
Q: Hide NSTouchBar button I'm working on a personal project in swift (for macOS app) and I want to make a NSbutton (Touch Bar button) and hide it.
Is there a possible way to do this?

A: I found the answer!
Just write:
<button_name>.isHidden = true

or if you want to disable and not hide:
<button_name>.isEnabled = false

In my case I had button that called "submitButton" so I wrote:
submitButton.isHidden = true

and when I wanted it to appear I wrote:
submitButton.isHidden = false


text:
Q: Call function to set D3 SVG rect attributes just once for each datum I have this D3 code snippet that draws a table from data.
self.displayStateTable = function (stateTable) {
    d3.select('#VisualizationSVG')
    .selectAll('rect').data(stateTable).enter().append('rect')
    .attr({
        x: function (d, i) { return self.positionStateTableTile(d).x; },
        y: function (d, i) { return self.positionStateTableTile(d).y; },
        width: self.stateTableConfig.TileWidth,
        height: self.stateTableConfig.TileHeight,
        fill: function (d, i) { return self.positionStateTableTile(d).fill; }
    });
};

The function positionStateTableTile which works out the x position, the y position, and the fill for each datum's tile is run three times for each datum when it only needs to be run once. How can I change this so that D3 only calls positionStateTableTile once for each datum instead of three times?

A: Typical - no sooner had  posted the question than the answer seemed obvious!
I can run the function once for each datum first and store the results in an array and use that to set the attributes in D3.
self.displayStateTable = function (stateTable) {
    var i = 0, stateTableTilePositions = [];
    for (i = 0; i < stateTable.length; i++) {
        stateTableTilePositions[i] = self.positionStateTableTile(stateTable[i]);
    }
    d3.select('#VisualizationSVG')
    .selectAll('rect').data(stateTable).enter().append('rect')
    .attr({
        x: function (d, i) { return stateTableTilePositions[i].x; },
        y: function (d, i) { return stateTableTilePositions[i].y; },
        width: self.stateTableConfig.TileWidth,
        height: self.stateTableConfig.TileHeight,
        fill: function (d, i) { return stateTableTilePositions[i].fill; }
    });
};


text:
Q: Non trivial boundaries for laplacian equation on rectangle 1) Can this Laplace equation, with its non trivial boundaries (on a
rectangular domain), be solved analytically?
$$\frac{d^2U}{dx^2}+\frac{d^2U}{dy^2}=0$$
$$U_x(0,y)=0\quad,\quad U_x(a,y)=f(y)$$
$$U_y(x,0)=0\quad,\quad U(x,b)=0$$
$f(y)$ is a function described as a vector (discrete values) which I cant describe as a continuous function.
2) If the answer to (1) is no, is there an easy procedure to solve
it numerically (I don't have much experience with numerics or time to
study it deeply)
The difficulty arises because $b>>>a$
$$b=0.1\quad,\quad a=1e-5$$
Thanks.


text:
Q: ¿Cómo separo los números pares de un arreglo bidimensional en Java? Estoy haciendo un programa que genere números de manera aleatoria en una matriz de 5x5. Los genera y los muestra correctamente, pero tengo problemas al tratar de separar los números que son pares, también tengo que calcular el promedio de todos los números pares que haya encontrado.
Aquí dejo lo que llevo hasta ahora:

A: No sé muy bien lo que pretendes y no programo en Java, pero veo en el Método Pares() que declaras dos arrays de int con cero elementos. No obstante creo que la sintaxis sería:
int[] par = new int[n];  // Donde n será el tamaño de tu array unidimensional.
Yo lo dimensionaría en 25 que es el número máximo de pares que puede contener la matriz inicial y lo enfocaría así:
public void Pares()
{
// La matriz 'mat' es de 5x5 por lo que 25 es el número maximo de elementos.
int[] NumeroClase = new int[25];

for(int ren = 0; ren < 5; ren++)
{
    for (int col = 0; col < 5; col++)
    {
        // Si el número es par guardo un cero en el array NumeroClase
        // y si es impar guardo un uno.
        NumeroClase[ren * 5 + col] = (mat[ren][col] % 2) ? 0 : 1;
    }
}

// Imprime resultados.
for (int ren = 0; ren < 5; ren++)
{
     for (int col = 0; col < 5; col++)
     {
     // Miro si el número era par y de serlo lo imprimo
     if (NumeroClase[ren * 5 + col] == 0)
         system.out.print(mat[ren][col] + "\t");
     else
         system.out.print("\t");
    }
    system.out.println("");
}

}

A: el problema está a la hora de crear los arrays para almacenar los números pares e impares. Los generas con valor 0 y eso te impide almacenar algo en el array.
Te pongo el código que he generado yo con comentarios por si te pueden aclarar mejor el funcionamiento:
public class SepararNumerosParesImparesArrayBidimensional {

private static int[][] matrizBidimensionalDeNumeros;
private static int[] arrayNumerosPares;
private static int[] arrayNumerosImpares;

public static void main(String[] args) {

    inicializarArrays(5, 5);
    llenarMatrizConNumerosAleatorios(500);
    creaArrayDeParesEImpares();

    mostarArray(arrayNumerosPares);
    mostarArray(arrayNumerosImpares);

    mostrarPromedioArray(arrayNumerosPares);
    mostrarPromedioArray(arrayNumerosImpares);
}

// Inicializamos el array bidimensional asignándole el valor de las filas
// i el valor de las columnas
// Aprovechamos para inicializar los arrays para los números pares y los números impares.
// el tamaño de estos arrays será igual al tamaño total del array bidimensional.
public static void inicializarArrays(int valorFilas, int valorColumnas) {
    matrizBidimensionalDeNumeros = new int[valorFilas][valorColumnas];
    arrayNumerosPares = new int[valorFilas*valorColumnas];
    arrayNumerosImpares = new int[valorFilas*valorColumnas];
}

// llenamos el array bidimensional con números aleatorios
// con el límite de rango que queramos
// si queremos números aleatorios hasta el numero 500, el limite de rango será de 0 a 500
// si quieres que el rango de números no incluya el 0 añadele +1 al métodp
// (Math.random() * limiteDeRango + 1)
public static void llenarMatrizConNumerosAleatorios (int limiteDeRango) {
    for (int i = 0; i < matrizBidimensionalDeNumeros.length; i++) {
        for (int j = 0; j < matrizBidimensionalDeNumeros[i].length; j++) {
            matrizBidimensionalDeNumeros[i][j] = (int) (Math.random() * limiteDeRango);
        }
    }
}

// creamos los arrays de número pares e impares
// recorremos el array bidimensional y vamos separando los números
// según sean pares o impares
// para asegurarnos de que no hay espacios vacíos en los arrays creados
// utilizamos el medoto eliminarIndicesVaciosArray() para eliminar dichos índices
public static void creaArrayDeParesEImpares() {

    int contadorIndicesArrayDePares = 0;
    int contadorIndicesArrayDeImpares = 0;

    for (int i = 0; i < matrizBidimensionalDeNumeros.length; i++) {
        for (int j = 0; j < matrizBidimensionalDeNumeros[i].length; j++) {
            if (matrizBidimensionalDeNumeros[i][j] % 2 == 0) {
                arrayNumerosPares[contadorIndicesArrayDePares] = matrizBidimensionalDeNumeros[i][j];
                contadorIndicesArrayDePares++;
            }else {
                arrayNumerosImpares[contadorIndicesArrayDeImpares] = matrizBidimensionalDeNumeros[i][j];
                contadorIndicesArrayDeImpares++;
            }
        }
    }

    arrayNumerosPares = eliminaIndicesVaciosArray(arrayNumerosPares, contadorIndicesArrayDePares);
    arrayNumerosImpares = eliminaIndicesVaciosArray(arrayNumerosImpares, contadorIndicesArrayDeImpares);
}

// el método retorna un array con los índices vacíos eliminados
// en este caso los arrays para número pares e impares tienen un tamaño de 25,
// con este metodo eliminamos los valores vacios.
// Ojo! vacio no significa valor 0. Por eso el valor de indiceFinalValido es igual
// al contador de índices utilizados en el método creaArrayDeParesEImpares()
public static int[] eliminaIndicesVaciosArray(int[] arrayAModificar, int indiceFinalValido) {

    int[] arrayTemporal = new int[indiceFinalValido];

    for (int i = 0; i < indiceFinalValido; i++) {
        arrayTemporal[i] = arrayAModificar[i];
    }

    return arrayTemporal;

}

//mostramos un array
public static void mostarArray(int[] arrayAMostrar) {

    System.out.println("Valores del array " + tipoDeValoresArray(arrayAMostrar) + ": ");
    System.out.print("|");
    for (int i = 0; i < arrayAMostrar.length; i++) {
        System.out.print(arrayAMostrar[i] + "|");
    }

    System.out.println();
}

//calcula y retorna el promedio de un array de enteros
public static double calcularPromedioArray(int[] arrayAProcesar) {
    int sumaNumeros = 0;

    for (int i =  0; i < arrayAProcesar.length; i++) {
        sumaNumeros += arrayAProcesar[i];
    }

    return (double) sumaNumeros / arrayAProcesar.length;
}

// muestra el promedio de un array de enteros
// con printf (%.2f) limitamos el numero a mostrar a 2 decimales
public static void mostrarPromedioArray(int[] arrayAProcesar) {
    System.out.printf("El promedio del array %s es %.2f \n", tipoDeValoresArray(arrayAProcesar), calcularPromedioArray(arrayAProcesar));

}

// genera un String con el tipo de array
public static String tipoDeValoresArray(int[] arrayAProcesar) {
    String tipoArray = "Impar";
    if (arrayAProcesar[0] % 2 == 0) {
        tipoArray = "Par";
    }

    return tipoArray;
}

}
Otra cosa que te quería comentar es que a la hora de crear variables, arrays, instancias, clases, métodos, etc... elijas un nombre que identifique claramente la función o el valor de dicha variable, método, clase...
El código que tu has puesto, aún siendo bastante sencillo, me ha costado interpretarlo por culpa de los nombres que has elegido para los arrays, variables y métodos.
No tengas miedo en llamar a una variable: contadorDeNumerosPares, este tipo de nombre te indica claramente la finalidad de dicha variable.
No me enrrollo más, un saludo y espero haberte ayudado.


text:
Q: Working with wxpython NoteBook event I have a NoteBook in wxpython as follows:
self.a = wx.Notebook(self, -1, style=0)

self.x= firstpanel(self.a,None)
self.y= secondpanel(self.a,None)

self.a.AddPage(self.x,_("firstPage"))
self.a.AddPage(self.y,_("secondPage"))

self.a.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED,self.ChangedTab)

In ChangedTab I want to change a Button named bttn in the screen. if secondPage tab was clicked then button will be clickable (bttn.Enabled() )  if any other tab was clicked button will be unclickable (bttn.Disable()).
What I have so far is:
def ChangedTab(self, event):
     index = event.GetIndex()

My problem is how do I know which tab was clicked?
I know the tabs by their names firstPage and secondPage etc.. how do I get them from the event? The GetIndex() doesn't seem to help me in this case. or there is another way to do what?

A: You can use GetPage to get the selected page object, then you can compare it with the second page object (self.y) to check if the second tab is selected:
def ChangedTab(self, event):
    index = self.a.GetSelection()
    if self.a.GetPage(index) is self.y: # second page
        # Enable button
    else:                               # other pages
        # Disable button


text:
Q: Run notepad.exe from a html-button using Awesomium I've been looking for an example on how to open a process like notepad.exe from a html-element using WPF and Awesomium 1.7.5. The idea is that clicking a html element triggers a C# method using javascript as far as I understand the Awesomium API. However, all examples I can find refer to an earlier version that now uses obsolete functions...
Can anyone please provide me with an example on how to execute C#-code when openNotepad() is triggered?
HTML:

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <button onclick="app.openNotepad()">This button will open Notepad</button>
</body>
</html>

C#:
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        webControl.Source = new Uri("index.html");
    }

    private void webControl_DocumentReady(object sender, DocumentReadyEventArgs e)
    {
        BindMethods(webControl);
    }

    private void BindMethods(IWebView _webView)
    {
        JSValue result = webControl.CreateGlobalJavascriptObject("app");
        if (result.IsObject)
        {
            JSObject appObject = result;
            appObject.Bind("openNotepad", openNotepad);
        }
    }

    private JSValue openNotepad(object obj, JavascriptMethodEventArgs jsMethodArgs)
    {
        Process.Start("notepad.exe");
        return null;
    }
}

XAML:
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:awe="http://schemas.awesomium.com/winfx" x:Class="Omega.MainWindow"
        Title="Omega" Height="350" Width="525" WindowStartupLocation="CenterScreen" WindowState="Maximized" ResizeMode="NoResize" Topmost="True" WindowStyle="None">
    <Grid>

        <awe:WebControl x:Name="webControl" DocumentReady="webControl_DocumentReady" />

    </Grid>
</Window>

A: According to Awesomium documentation to Bind and JavascriptMethodHandler, methods of handling Javascript events has changed in version 1.7.5.
JavascriptMethodEventHandler now obsolete, and new Bind overload should be used.
Now your code could look like
private void BindMethods(IWebView _webView)
{
    JSValue result = webControl.CreateGlobalJavascriptObject("app");
    if (result.IsObject)
    {
        JSObject appObject = result;
        appObject.Bind("openNotepad", openNotepad);
    }
}

private JSValue openNotepad(object obj, JavascriptMethodEventArgs jsMethodArgs)
{
    Process.Start("notepad.exe");
    return null;
}

Note, there is example of using new overload at the end of Bind documentation page.
Also note that javascript method in your sample actually not calling app.openNotepad() method, but alert("Run Notepad");

A: WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/windows/system32/notepad.exe", 1, false);


text:
Q: How to set the delimiter of csv file as ; instead of default coma(,) in a shell script I am running the below shell script
awk -F ' *[[:alnum:]_]*: *' 'BEGIN         {h="bla;blaa;blaaa;blaaaaa;blaaaaa1;bla111;bla2;bla3;blaaa3;bla4"; print h; n=split(h,F,/;/)}
                         function pr() {if(F[1] in A) {for(i=1;i<=n;i++)printf "%s%s",A[F[i]],(i<n)?";":RS}}
                         /insert_job/  {pr(); delete A}
                                       {for(i in F){if($0~"^"F[i])A[F[i]]=$2}}
                         END           {pr()}' infile > outfile.csv

The output file is output.csv, where coma is delimiter.Since one of the column contains values where coma is also there, the output.csv gets messed up.Please help me to understand how can i set the delimiter as ;(semicolon)


text:
Q: How to use intent in fragment? (Xamarin & MVVMCROSS) I am try to call Activity of LoginView class from fragment, but I am facng some error.
My code
Intent intent = new Intent(getActivity (), LoginView);
StartActivity(intent);

the error on getActivity and on LoginView please suggest what I use so that it works.

A: Use this
Intent intent = new Intent(Activity, typeof(LoginActivity));
StartActivity(intent);


text:
Q: How can I deploy code changes in AWS in a CircleCI 1.0 project? CircleCI is requiring everyone to migrate to version 2.0 of their configuration format, but I have not had time to move away. I plan to migrate away from the platform anyway, so I do not now wish to migrate to 2.0.
Even after the EOL of 1.0, I was still able to deploy minor code changes, which was all that was necessary to maintain my system at this time.
However, a minor code change I tried to deploy earlier this week failed.
I don't want to migrate to 2.0, but want to deploy the code change (it's 2 lines).
I'm using Github and deploying to AWS.
How I can "circumvent" CircleCI to push this minor code change in Github to AWS?

A: The 1.0 version was officially "sunsetted" on August 31st, 2018, but I think they might have unofficially given an extension to folks still on 1.0, and it is only now fully being turned off. However, 2.0 has been available for more than a year now, which should have been long enough to do the migration.
My experience of CircleCI support is that if you have a bug, they will help on their forum. Paying customers can log a ticket (and that is a more reliable way to contact them). Of course, if your support issue is to re-enable 1.0, or to do the migration for you, then you do not have a reasonable request.
The trade-off with hosted CI, which will have saved you maintenance time and costs over the long term, is that sometimes migrations will be necessary. Engineering teams should schedule upgrade time into their diary so that these things can be tackled in good time.
Direct answer
For your deployment now, I suggest you run your tests locally and deploy from a development machine. After that, I would suggest upgrading to 2.0 (or move to a different provider) is a high priority for your team.
In other words, I do not believe there is a way in which you can do a deployment using a 1.0 configuration file. However, if you won't move to 2.0, and you do not wish to do a deployment from your own dev machine, you could try asking tech support whether you (or they) can do a special 1.0 run. It is conceivable they still have the capacity to do so.


text:
Q: Дизайн двух кнопок Всем привет, посмотрел на одном сайте американском прикольную фишку и решил сделать подобное. Чтобы сделать как-бы одну кнопку, но одна синяя, а другая прозрачная но с цветом кнопки. Решил сделать немного костыльно, а именно две кнопки поставить на одну позицию, но столкнулся с проблемой. Как убрать конец кнопки, или как это будет все правильно реализовать

.acbutton {
 position: relative;
 width: 140px;
 top: 150px;
 height: 40px;
 border: none;
 border-radius: 25px;
 font-family: 'Webnar';
 background: linear-gradient(to right, rgba(41, 182, 246,1.0),rgba(66, 165, 245,1.0));
 color: white;
 outline: none;
 cursor: pointer;
}

.video {
  position: relative;
 width: 190px;
 top: 150px;
 right: 300px;
 height: 40px;
 border: none;
 border-radius: 25px;
 font-family: 'Webnar';
 background: rgba(1,1,1,0);
 box-shadow: 0 0 5px 0 rgba(1,1,1,0.5);
 color: white;
 outline: none;
 cursor: pointer;
}
<button class="acbutton">Скачать античит</button>
   <button class="video" style="color: rgba(41, 182, 246,1.0)">Посмотреть видео</button>

Вот так должно быть

A: Намудрили вы со стилями, конечно, особенно с позиционированием, трогать не буду, выполню только вашу проблему с наложением

.acbutton {
 position: relative;
 width: 140px;
 top: 150px;
 height: 40px;
 border: none;
 border-radius: 25px;
 font-family: 'Webnar';
 background: linear-gradient(to right, rgba(41, 182, 246,1.0),rgba(66, 165, 245,1.0));
 color: white;
 outline: none;
 cursor: pointer;
        z-index: 10;
}

.video {
  position: relative;
 width: 190px;
 top: 150px;
 right: 300px;
 height: 40px;
 border: none;
 border-radius: 25px;
 font-family: 'Webnar';
 background: rgba(1,1,1,0);
 box-shadow: 0 0 5px 0 rgba(1,1,1,0.5);
 color: white;
 outline: none;
 cursor: pointer;
}
<button class="acbutton">Скачать античит</button>
   <button class="video" style="color: rgba(41, 182, 246,1.0)">Посмотреть видео</button>

A: Размер картинки у примера очень маленький, но пытался сделать максимально похоже.

.two-button {
  display: block;
  width: auto;
}

.two-button a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 50px;
  text-decoration: none;
  box-sizing: border-box;
}

.two-button a:nth-child(1) {
  min-width: 250px;
  background: #fff;
  color: #757575;
  box-shadow: 0 0 3px 1px rgba(0,0,0,.15), 0 0 15px 3px rgba(0,0,0,.05);
}

.two-button a:nth-child(2) {
  background: #4a90e1;
  color: #fff;
  box-shadow: 0 0 3px 1px rgba(0,0,0,.1) inset;
  margin-left: -32px;
}

  Смотреть видео
  Скачать античит


text:
Q: Java homework help, Error  expected Help with java homework
this is my assignment that I have, this assignment code I've tried. But when I try to compile it I keep getting errors which I cant seem to find soloutions too:
Error says <identifier> expected for Line 67 public static void ()
Assignment brief
To write a simple java classMobile that  models a mobile phone.
Details the information stored about each mobile phone will include
•   Its type e.g.  "Sony ericsson x90" or  "Samsung Galaxy S";
•   Its screen size in inches;
You may assume that this a whole number from the scale 3 to 5 inclusive.
•   Its memory card capacity in gigabytes
You may assume that this a whole number
•   The name of its present service provider
You may assume this is a single line of text.
•   The type of contract with service provider
You may assume this is a single line of text.
•   Its camera resolution in megapixels;
You should not assume that this a whole number;
•   The percentage of charge left on the phone e.g. a fully charged phone will have a charge of 100.
You may assume that this a whole number
•   Whether the phone has GPS or not.

Your class will have fields corresponding to these attributes .
Start by opening BlueJ, creating a new project called myMobile which has a classMobile and set up the fields that you need,
Next you will need to write a Constructor for the class. Assume that each phone is manufactured by creating an object and specifying its type, its screen size, its memory card capacity, its camera resolution and whether it has GPS or not. Therefore you will need a constructor  that allows you to pass arguments to initialise these five attributes. Other fields should be set to appropriate default values.  You may assume that a new phone comes fully charged.
When the phone is sold to its owner, you will need to set the service provider and type of contract with that provider so you will need mutator methods
•   setProvider ()  - - to set service provider.
•   setContractType - - to set the type of contract
These methods will be used when the phones provider is changed.
You should also write a mutator method ChargeUp () which simulates fully charging the phone.
To obtain information about your mobile object you should  write
•   accessor methods corresponding to four of its fields:
•   getType () – which returns the type of mobile;
•   getProvider () – which returns the present service provider;
•   getContractType () – which returns its type of contract;
•   getCharge () – which returns its remaining charge.

An accessor method to printDetails () to print, to the terminal window, a report about the phone e.g.
This mobile phone is a sony Erricsson X90 with Service provider BigAl and type of contract PAYG. At present it has 30% of its battery charge remaining.
Check that the new method works correctly by for example,
•   creating a Mobile object and setting its fields;
•   calling printDetails () and t=checking the report corresponds to the details you have just given the mobile;
•   changing the service provider and contract type by calling setprovider () and setContractType ();
•   calling printDetails () and checking the report now prints out the new details.
Challenging excercises
•   write a mutator methodswitchedOnFor ()  =which simulates using the phone for a specified period.  You may assume the phone loses 1% of its charge for each hour that it is switched on .
•   write an accessor method checkcharge () whichg checks the phone remaing charge. If this charge has a value less than 25%, then this method returns a string containg the message Be aware that you will soon need to re-charge your phone, otherwise it returns a string your phone charge is sufficient.
•   Write a method changeProvider () which simulates changing the provider (and presumably also the type of service contract).
Finally you may add up to four additional fields, with appropriate methods, that might be required in a more detailed model.

above is my assignment that I have, this assignment code I've tried. But when I try to oompile it I keep getting errors which I cant seem to find soloutions too:
Error says <identifier> expected for Line 67 public static void ()
    /**
 * to write a simple java class Mobile that models a mobile phone.
 *
 * @author (Lewis Burte-Clarke)
 * @version (14/10/13)
 */
public class Mobile

{
    // type of phone
    private String phonetype;
    // size of screen in inches
    private int screensize;
    // menory card capacity
    private int  memorycardcapacity;
    // name of present service provider
    private String serviceprovider;
    // type of contract with service provider
    private int typeofcontract;
    // camera resolution in megapixels
    private int cameraresolution;
    // the percentage of charge left on the phone
    private int checkcharge;
    // wether the phone has GPS or not
    private String GPS;
    // instance variables - replace the example below with your own
    private int x;

    // The constructor method

    public Mobile(String mobilephonetype, int mobilescreensize,
            int mobilememorycardcapacity,int mobilecameraresolution,String mobileGPS, String newserviceprovider) {
        this.phonetype =  mobilephonetype;
        this.screensize = mobilescreensize;
        this.memorycardcapacity = mobilememorycardcapacity;
        this.cameraresolution = mobilecameraresolution;
        this.GPS = mobileGPS;

        // you do not use this ones during instantiation,you can remove them if you do not need or assign them some  default values
        //this.serviceprovider = newserviceprovider;
        //this.typeofcontract = 12;
        //this.checkcharge = checkcharge;

        Mobile samsungPhone = new Mobile("Samsung", "1024", "2", "verizon", "8", "GPS");
        1024 = screensize;
        2 = memorycardcapacity;
        8 = resolution;
        GPS = gps;
       "verizon"=serviceprovider;
        //typeofcontract = 12;
        //checkcharge = checkcharge;

    }

    // A method to display the state of the object to the screen
    public void displayMobileDetails() {
        System.out.println("phonetype: " + phonetype);
        System.out.println("screensize: " + screensize);
        System.out.println("memorycardcapacity: " + memorycardcapacity);
        System.out.println("cameraresolution: " + cameraresolution);
        System.out.println("GPS: " + GPS);
         System.out.println("serviceprovider: " + serviceprovider);
        System.out.println("typeofcontract: " + typeofcontract);
}

      /**
 * The mymobile class implements an application that
 * simply displays "new Mobile!" to the standard output.
 */
public class mymobile {
    public static void main(String[] args) {
        System.out.println("new Mobile!"); //Display the string.
    }
}
    public static void buildPhones(){
    Mobile Samsung = new Mobile("Samsung", "3.0", "4gb", "8mega pixels",
                "GPS");
        Mobile Blackberry = new Mobile("Blackberry", "3.0", "4gb",
                "8mega pixels", "GPS");
        Samsung.displayMobileDetails();
        Blackberry.displayMobileDetails();
}
    public static void main(String[] args) {
        buildPhones();
}

}

any answers.replies and help would be greatly appreciated as I really lost!

A: public static void() need an identifier (i.e a name).
Change it with (per example) :
public static void buildPhones(){
   //your code goes here
}

If you want to run your program, you need a main method in your class mymobile.
public static void main(String [] args){
    buildPhones();
}

The main method is similar to the main function in C and C++; it's the
  entry point for your application and will subsequently invoke all the
  other methods required by your program.

You can take a look at this for more informations.
Looking at the code you wrote on this method, I suggest you to read how to assign values to an object's parameters. Read this section about objects.

A: Updated code:

sorry guys pasted the wrong code, it did compile before, but now with the additions it wont compile, UPDATED CODE

When you had
public static void main(String[] args) {

This compiled fine but when you changed it to
public static void () {

It complained the identifier was missing.  I suggest you change it back to the line which worked.

It compiles and runs fine for me. I get
phonetype: 0
screensize: 0
memorycardcapacity: 0
cameraresolution: 0
GPS: 0
phonetype: 0
screensize: 0
memorycardcapacity: 0
cameraresolution: 0
GPS: 0

BTW Your constructor does do anything because you don't use any of the arguments passed to it.
public Mobile(String Mobilephonetype, String Mobilescreensize,
              String Mobilememorycardcapacity, String Mobilecameraresolution,
              String MobileGPS) {
    this.phonetype = phonetype;
    this.screensize = screensize;
    this.memorycardcapacity = memorycardcapacity;
    this.cameraresolution = cameraresolution;
    this.GPS = GPS;

}

All your parameter names are different so they are not used.


text:
Q: Ref. Request -- Tautological Bundle over $G_{k,n}(\mathbb{R})$ I'm interested right now to learn more about the tautological bundle over the Grassmann manifold $G_{k,n}(\mathbb{R})$, but I'm currently having trouble finding the appropriate texts to check out.  There's obviously Wikipedia, and I've also found a link to John Milnor's Characteristic Classes, but I'm looking for something that's a little more pointed and directed (an article or two would be ideal).
My main interest in this stemmed from Milnor's lecture (go to 27:00) at Cornell where he described how this bundle space can be used as a classification space for tangent bundles.

A: Longer than an article, but still a good point of reference, is Hirsch's "Differential Topology".  Chapter 4 on vector bundles includes classification theorems relating vector bundles to maps into Grassmannians.
Be warned, this book has tons of insidious errata.  A partial list has been compiled here.


text:
Q: How to remove white space at the end of an Rmarkdown HTML output Is there a common culprit for white space at the end of a markdown? Here's what the end of my HTML output looks like. And my options:
```
{r }
knitr::opts_chunk$set(fig.width=6, fig.asp=.618, fig.align="center",
fig.path='Figs/', warning=FALSE, message=FALSE, cache=TRUE)
```

While I do not have a reprex handy, I did try several reruns, and found that the YAML is causing the white space, specifically the toc_float: true.
date: "`r format(Sys.time(), '%B, %d %Y')`"
output:
  html_document:
    theme: united
    highlight: textmate
    code_folding: show
    toc: true
    toc_float: true
editor_options:
  chunk_output_type: inline
always_allow_html: yes

Edit: Here's a reproducible example:
---
date: "`r format(Sys.time(), '%B, %d %Y')`"
output:
  html_document:
    theme: united
    highlight: textmate
    code_folding: show
    toc: true
    toc_float: true
editor_options:
  chunk_output_type: inline
always_allow_html: yes
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r cars}
summary(cars)
```

## Including Plots

You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```

A: This seems to be caused by the tocify script included in HTML output. The script is included if toc_float is set to true (or if it contains more options).
The option to add the white space is configurable in principle through the tocify extendOffset option.  However, it appears that R Markdown does not expose a way to set the option through YAML. Currently, the only way to get rid of it is to unset toc_float.

A: According to https://community.rstudio.com/t/floating-table-of-contents-and-plots-produce-extra-whitespace-at-bottom/12606/8 you can keep toc_float and remove the extra white space by inserting the following html code at the bottom of the .Rmd file:

Worked for me!


text:
Q: Erro de sintaxe socket-python   except socket.error, (errno, msg):
            if errno == 1:
                # Operation not permitted
                msg = msg + (
                    " - Note that ICMP messages can only be sent from processes"
                    " running as root."
                )
                raise socket.error(msg)

Traceback (most recent call last):
File "", line 1, in    File
  "/usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py",
  line 699, in runfile
      execfile(filename, namespace)   File "/usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py",
  line 88, in execfile
      exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)   File "/home/epamos/Downloads/Gping2(1).py", line 78
      except socket.error, (errno, msg):
                         ^ SyntaxError: invalid syntax

Estou usando o python 3.5, ao retirar a vírgula há o desencadeamento de 7 erros envolvendo GPing.

A: Esta sintaxe do Except não é válida em Python 3-  essa é a sintaxe antiga do Python 2, e mesmo em código novo feito para rodar em Python 2 ainda é recomendado que se use o novo estilo:
try:
   ...
except NomeDoErro as variavel:
   ...

Nesse caso:
except socket.error as error:
    # codigo usando a variável error

(Nota, eu sugiro que você arrume a identação do seu código Python para usar 4 espaços por bloco, sempre - e não identação variada - vai perceber que fica bem mais fácil de ler)


text:
Q: What are the rules around instantiation of template types (class/function) when taking an address? In answering this question, I came across this difference in behaviour with respect to template instantiation.
Initially there is a function template
template <typename T> void my_callback(void* data) { … }

Now something requires the address of this - specifically a void*, so the obvious approach is
bar(reinterpret_cast<void*>(&my_callback<int>));

However, with compiler versions pre gcc 4.5, this fails with a not-enough context... error. Fine - so the fix is to "cast" first - which forces instantiation, i.e:
void (*callback)(void*) = my_callback<int>;
bar(reinterpret_cast<void*>(callback));

This works fine.
Now the second scenario, rather than being a free function, it's a static member of a class template, i.e.
template <typename T>
struct foo
{
  static void my_callback(void* data) {
    T& x = *static_cast<T*>(data);
    std:: cout << "Call[T] with " << x << std::endl;
  }
};

Now, the original reinterpret_cast works fine.
bar(reinterpret_cast<void*>(&foo<int>::my_callback));

So my question is - why this apparent difference in behaviour?

A: From n3290, 14.7.1 Implicit instantiation [temp.inst]

2 Unless a function template specialization has been explicitly
  instantiated or explicitly specialized, the function template
  specialization is implicitly instantiated when the specialization is
  referenced in a context that requires a function definition to exist.

There are similar rules in paragraph 1 for class template specializations. Notice that the Standard speaks in terms of specialization because a specialization is implicitly declared when a template is used an no user-provided specialization is here, at least for function templates (paragraph 8).
Combined with paragraph 10,

10 An implementation shall not implicitly instantiate a function
  template, a member template, a non-virtual member function, a member
  class, or a static data member of a class template that does not
  require instantiation.

I think the rule of thumb is: as soon as an object/class member/function is needed or to make the program otherwise work (speaking informally), the template is implicitly instantiated but no sooner. This include taking the address of a function.
As to the question you linked, some uses of reinterpret_cast may make the program non-conformant, by which time it's irrelevant to mention instantiations -- I invite you to see my answer there</shameless>.


text:
Q: Cannot resolve symbol 'BCrypt' I am trying to add BCrypt to my code, but my program won't import the dependency. All I get is the message "Cannot resolve symbol 'BCrypt'" and if I try to look at the informationsymbol, my only alternatives are:

*

*"Create class 'BCrypt'"

*"Create field 'BCrypt' in 'JavaclassName'"

*"Create local variable 'BCrypt'"
and so on...

I tried adding dependency in the pom.xml-file:
<dependency>
   <groupId>org.springframework.security</groupId>
   <artifactId>spring-security-core</artifactId>
   <version>5.4.6</version>
</dependency>

but it did not help.
I also tried:
<dependency>
    <groupId>org.mindrot</groupId>
    <artifactId>jbcrypt</artifactId>
    <version>0.4</version>
</dependency>

but this just gave me red warnign-signs.
I use Intellij, and started a Spring project with SDK java version 11.
Hope someone is able to help :)

A: Could you try with
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
<version>5.4.6</version>

A: The following dependency works for me.
Try adding this, refreshing maven dependencies and restarting your IDE.
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>


text:
Q: How to get the parameter values of a stored procedure that's in the middle of execution? Is there a way to get the values of the parameters that were passed in to a stored procedure while the stored procedure is in the middle of execution? (I'm trying to debug an actively running stored procedure.)
I know I can see the queries of the stored procedure that are currently being executed using the sys.dm_exec_requests and sys.dm_exec_sql_text DMVs but they don't show the values of the parameters being used.

A: For SQL Server 2016 you need to have the query profiling infrastructure enabled in advance with trace flag 7412 or an extended events session capturing query_thread_profile (and be on at least  SQL Server 2016 SP1) but then can use
WITH XMLNAMESPACES
   (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan')
select query_plan.query('//ParameterList')
from sys.dm_exec_query_statistics_xml(@session_id)

and see the ParameterRuntimeValue and ParameterCompiledValue from the execution plan of the statement being executed.
For SQL Server 2019+ the infrastructure is enabled by default so the above will just work.
This might not be all the parameters of the stored proc however as it will only include params used by the execution plan.


text:
Q: Transaction fails due to foreign key Mysql error 1452 I have a transaction that inserts data into three tables. This transaction has been failing, but I have found, that if I remove the relation in phpmyadmin, the transaction completes successfully.
To re-add the relation I need to remove all the data in the tables!
The three tables consit of: 'User_Account' (which has a primary key) ,
 'Item' which also has a primary key
'User_Account' and 'Item' are related by a joining table called 'User_Item' with a compound key. The images for the item are referenced by a table called 'Image_Items' which is referenced by the foreign key from the 'Item' table.
I cannot see why this should not work? As only one table seems to use the key at one time?Any suggestions as to why this could be happening? Or what I am doing wrong!
CREATE TABLE IF NOT EXISTS `user_item` (
  `account_id` int(10) unsigned NOT NULL COMMENT 'Foreign key from account',
  `item_id` int(10) unsigned NOT NULL COMMENT 'Foreign key from item',
  `status` enum('active','deleted') NOT NULL COMMENT 'Is item active or been deleted',
  `date_added` varchar(50) NOT NULL COMMENT 'Date item was added',
  UNIQUE KEY `account_id` (`account_id`,`item_id`),
  KEY `item_id` (`item_id`)
)

CREATE TABLE IF NOT EXISTS `item` (
  `item_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'primary key for item',
  `item_name` varchar(20) NOT NULL COMMENT 'title name of the item',
     `catagory`enum('accessories','jackets','coats','footwear','legwear','jeanswear','dresses','s     hirts','tops','t-shirts','knitwear','skirts','shorts') NOT NULL COMMENT 'item  catagory',
  `brand` varchar(20) NOT NULL COMMENT 'brand of product',
  `store` varchar(20) NOT NULL COMMENT 'store the item was purchased',
  `location` varchar(20) NOT NULL COMMENT 'location the item was purchased',
  `month`  enum('January','February','March','April','May','June','July','August','September','October'      ,'November','December') NOT NULL COMMENT 'month the item was purchased',
  `year` int(2) NOT NULL COMMENT 'year the item was purchased',
  `details` varchar(500) NOT NULL COMMENT 'details about the item description',
  `date` varchar(50) NOT NULL COMMENT 'date item created',
  PRIMARY KEY (`item_id`),
  UNIQUE KEY `item_id` (`item_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 COMMENT='holds data about the item'     AUTO_INCREMENT=20 ;

CREATE TABLE IF NOT EXISTS `user_account` (
  `account_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'unique account ID',
  `user_id` int(10) unsigned NOT NULL COMMENT 'foreign key from user table',
  `username` varchar(50) NOT NULL COMMENT 'users username default emailaddress',
  `account_status` enum('active','online','frozen','offline','hidden') NOT NULL COMMENT    'status of account, online offline frozen hidden active',
  `account_type` enum('admin','user') NOT NULL COMMENT 'type of account user or admin',
  `account_created` varchar(50) NOT NULL COMMENT 'date the account was created',
  `account_modified` varchar(50) NOT NULL COMMENT 'date account was last modified',
  `salt` int(10) unsigned NOT NULL COMMENT 'encryption',
  `password` char(40) NOT NULL COMMENT 'users password',
  PRIMARY KEY (`account_id`),
  UNIQUE KEY `user_id` (`user_id`,`username`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 COMMENT='details of the users account'      AUTO_INCREMENT=56 ;

And the query
$mysql = "INSERT INTO user_item(account_id,item_id,status,date_added)
            VALUES('$accountId','$itemId','$status','$date')";
            $mysqlResult = $this->conn->query($mysql)or   die(mysql_error());

Thanks


text:
Q: unrecognized selector sent to instance I have added a tabbarcontroller on window and a button on view respective to first tab.
As I run the app and press the button, the app is crashing with this msg:
2011-05-20 18:56:46.258 FeatureList[3395:207] -[UIViewController barButtonPressed:]: unrecognized selector sent to instance 0x4b22520
2011-05-20 18:56:46.262 FeatureList[3395:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController barButtonPressed:]: unrecognized selector sent to instance 0x4b22520'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00da9be9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x00efe5c2 objc_exception_throw + 47
    2   CoreFoundation                      0x00dab6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x00d1b366 ___forwarding___ + 966
    4   CoreFoundation                      0x00d1af22 _CF_forwarding_prep_0 + 50
    5   UIKit                               0x002b2a6e -[UIApplication sendAction:to:from:forEvent:] + 119
    6   UIKit                               0x003411b5 -[UIControl sendAction:to:forEvent:] + 67
    7   UIKit                               0x00343647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
    8   UIKit                               0x003421f4 -[UIControl touchesEnded:withEvent:] + 458
    9   UIKit                               0x002d70d1 -[UIWindow _sendTouchesForEvent:] + 567
    10  UIKit                               0x002b837a -[UIApplication sendEvent:] + 447
    11  UIKit                               0x002bd732 _UIApplicationHandleEvent + 7576
    12  GraphicsServices                    0x016dfa36 PurpleEventCallback + 1550
    13  CoreFoundation                      0x00d8b064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    14  CoreFoundation                      0x00ceb6f7 __CFRunLoopDoSource1 + 215
    15  CoreFoundation                      0x00ce8983 __CFRunLoopRun + 979
    16  CoreFoundation                      0x00ce8240 CFRunLoopRunSpecific + 208
    17  CoreFoundation                      0x00ce8161 CFRunLoopRunInMode + 97
    18  GraphicsServices                    0x016de268 GSEventRunModal + 217
    19  GraphicsServices                    0x016de32d GSEventRun + 115
    20  UIKit                               0x002c142e UIApplicationMain + 1160
    21  FeatureList                         0x000024fc main + 102
    22  FeatureList                         0x0000248d start + 53
    23  ???                                 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Program received signal:  "SIGABRT".
kill
quit

The Debugger has exited with status 0.(gdb)

A: This happens when you try to call a method that doesn't exist. It looks like you've set up your button to send a message to the view controller (barButtonPressed:), but you may not have implemented the method if your view controller. Or you may have misspelled the method name or not included the argument in the method implementation.
Post your view controller code.

A: It looks like the button is trying to call barButtonPressed: on the view controller, but that method doesn't exist.  Are you sure you don't get warnings during compilation regarding missing methods?  My guess is you're not setting the view controller class correctly in a nib file.

A: Have you implemented barButtonPressed:? Are you sure you need the colon? Try barButtonPressed as the selector name instead.

A: This is an old question, but I think I know what happened. Notice how the error message says UIViewController instead of TodayDeal; he needed to change the Xib's file owner from a default UIViewController to TodayDeal


text:
Q: Querying for words ending with, with the ReversedWildcardFilterFactory and KeywordTokenizerFactory I have the "text_general_rev" filed type declared in my Solr schema(.xml) like so:
<fieldType
    name="text_general_rev"
    class="solr.TextField"
    positionIncrementGap="100">
    <analyzer type="index">
       <tokenizer class="solr.KeywordTokenizerFactory" />
       <filter
            class="solr.ReversedWildcardFilterFactory"
            withOriginal="true"
            maxPosAsterisk="2"
            maxPosQuestion="2"
            maxFractionAsterisk="1.0" />
        <filter class="solr.LowerCaseFilterFactory" />
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory" />
        <filter class="solr.LowerCaseFilterFactory" />
    </analyzer>
</fieldType>

I have 2 Solr documents with the "artist" field set as "text_general_rev" like so:
Document1 artist is "Jimmy Jones Tim Coco Mimi"
Document2 artist is "Jones Jimmy Tim Bobo Mimi"
If I do searches of the kind "start with something" they work as I want to:
+artist:(J*) returns Document 1 and 2
+artist:(Jim*) returns Document 1
+artist:(Jimmy Jo*) returns Document 1
On the other hand, similar queries, but of type "ends with something don't work similarly:
+artist:(*Mimi) returns Document 1 and 2  (which is ok)
+artist:(*Coco Mimi) return 0 results (which is not ok)
+artist:("*Coco Mimi") return 0 results (which is not ok)
+artist:(*co Mimi) return 0 results (which is not ok)
+artist:("*co Mimi") return 0 results (which is not ok)
My question is why is this happening? Is it normal, and if so what am I missing? I've tried multiple values for maxFractionAsterisk (like 0, 0.5, 1, etc. This is the only config param of the ReversedWildcardFilterFactory which I don't fully understand).


text:
Q: How to check/tick a CheckBox in the item renderer? I have a grid table that contains ship objects(data provider accepts a array collection of ships objects) and displays just the name of ship and date in the grid table. My ship object has a property called checkList a boolean value, To be used as data binding in my checkbox item renderer.(To make the check box ,tick and untick)
I want to check my checkbox when I add a Image object in to a container. The Image object that is being added to the container has a id. I want to match that Image id to my shipId in the data grid table and check the check box for that particular record.
So my Image object listens to the add event and so when the Image object is added to a container. It calls the addHandler() function where it gets the id of the image and the loops though the data grid table to find the matching id and check the CheckBox. My looping works nicely.Using Alert.show() I can see that it matches the id and sets the boolean value to, true for the check box to be ticked. However the check box is not ticked.
These are my codes. Even though the checkList property for that particular record is set to true. The check box is not ticked. I dont Know whats the problem is. I am a student and new to flex.Can some one pls help me ?
My MXML view: My Grid Table
<s:DataGrid id="arrivalTable" x="-1" y="-1" width="302" height="205" requestedRowCount="4"
                dataProvider="{myArrivalShips}" >
        <s:columns>
            <s:ArrayList>
                <s:GridColumn dataField="shipName" headerText="Arrival Ships" itemRenderer="DesignItemRenderer.myCustomToolTipRenderer" width="130" ></s:GridColumn>
                <s:GridColumn dataField="ETA" headerText="ETD" itemRenderer="DesignItemRenderer.myCheckBoxRenderer"></s:GridColumn>
            </s:ArrayList>
        </s:columns>
    </s:DataGrid>

My Image object listens add event.
displayImg.addEventListener(FlexEvent.ADD,addHandler);

This is my addHandler() event Function:
protected function addHandler(event:FlexEvent):void
{
    var ImageShipId:String = Image(event.currentTarget).id;
    var destination:BorderContainer = Image(event.currentTarget).owner as BorderContainer;
    var destinationId:String = destination.id;

    if( destinationId == "bct_HoldingArea" ){

        for(var j:int = 0; j<arrivalTable.dataProvider.length; j++){

            var myShip:Ship = arrivalTable.dataProvider.getItemAt(j) as Ship;
            var myShipId:String = myShip.shipID.toString();

            if(StringUtil.trim(myShipId) == StringUtil.trim(ImageShipId)){
                myShip.checkList = true;
                Alert.show("The ship name : " + myShip.shipName +"\n" + "The Ship selected : " + myShip.checkList);
            }
        }
    }
}

My check Box Item renderer :
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true">
<s:HGroup>
    <s:Label text="{data.ETD}"  paddingTop="8"/>
    <s:CheckBox id="myCheckBox" enabled="false" selected="{data.checkList}"  />
</s:HGroup>

A: You should use "refresh" method of the dataprovider after updating an object:
(arrivalTable.dataProvider as ArrayCollection).refresh();

So your function will look like this:
protected function addHandler(event:FlexEvent):void
{
var ImageShipId:String = Image(event.currentTarget).id;
var destination:BorderContainer = Image(event.currentTarget).owner as BorderContainer;
var destinationId:String = destination.id;

if( destinationId == "bct_HoldingArea" ){

    for(var j:int = 0; j<arrivalTable.dataProvider.length; j++){

        var myShip:Ship = arrivalTable.dataProvider.getItemAt(j) as Ship;
        var myShipId:String = myShip.shipID.toString();

        if(StringUtil.trim(myShipId) == StringUtil.trim(ImageShipId)){
            myShip.checkList = true;

            (arrivalTable.dataProvider as ArrayCollection).refresh();

            Alert.show("The ship name : " + myShip.shipName +"\n" + "The Ship selected : " + myShip.checkList);
        }
    }
}
}

//EDIT
The issue with the row in the middle seems to be a so called "middle row bug". I have found some info here.
To avoid this strange thing try to change your Renderer code in this way:
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true">
<fx:Script>
    <![CDATA[
        import mx.utils.ObjectUtil;

        [Bindable]override public function get data():Object
        {
            return ObjectUtil.copy(super.data);;
        }

        override public function set data(value:Object):void
        {
            super.data = value;
        }

    ]]>
</fx:Script>

<s:HGroup>
    <s:Label text="{data.ETD}"  paddingTop="8"/>
    <s:CheckBox id="myCheckBox" enabled="false" selected="{data.checkList}"/>
</s:HGroup>
</s:GridItemRenderer>

//EDIT
A short explanation of this trick: I have found that data update occurs for every row except the middle one.  I have tried to follow the source code of the data grid. I think the code line responsible for this action is:
renderer.data = dataItem;

in the GridLayout.as class.
This line causes data update for each row except the middle one. Why? Flex compares both sides of this expression and does nothing if they are equal. In our case they are not equal but it seems to be a real bug. Whatever... We need to wait till Flex team correct the issue.
As a temporary workaround I have changed the left side of the expression brutally by clonning the Object in the "get" function. So the comparison should now return FALSE in any case and the data property should be updated for each row.
The set function could be deleted, but it is a good place for debugging of same issues.
It is not a good approach but it is better than nothing.


text:
Q: WH and Banshee interaction I was a Witch Hunter in mcw-001 and had marked the banshee as a witchcraft user before they were lynched. Later they possessed a body and the mark to kill showed on the possessed body. What happens when a Witch Hunter kills the body that has been possessed by a banshee they had previous marked?

A: This seems like a UI Inconsistency due to the ordering of events.
I believe what is occurring here is that the "marks shown to witchhunter" event occurs before the "banshee reverted back to the dead player" event.
You're seeing the mark because that's where the player you've marked (Remember that all abilities target the player not the identity) was at that time. However they immediately then swapped back into the grave after that event was sent.
If you were to then click on your night action button next to that identity you would actually be checking the real player who is in that identity (not the banshee) as they will have returned from the grave.


text:
Q: Symfony form type display ManyToOne entity information I'm creating a form type to update options for accounts the user have.
I have 3 entities User, UserHasAccount and Account.
Here are the relations between them:
User (OTM) <-> (MTO) UserHasAccount (MTO) <-> (OTM) Account
In UserHasAccount I have 2 options options1 and options2 (boolean)
An account can be link to multiple user. I have a page where I want to be able to change the options foreach Users linked to this Account (/account/{id}/manage-user)
Here is the first form type to map the fields from User
class AccounUserOptionFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('user', 'entity', array(
                'class' => 'AcmeUserBundle:User',
                'property' => 'fullname',
            ))
            ->add('option1', 'checkbox', array(
                'label' => 'account.form.option.one',
                'required' => false,
                'error_bubbling' => true,
            ))
            ->add('option2', 'checkbox', array(
                'label' => 'account.form.option.two',
                'required' => false,
                'error_bubbling' => true,
            ))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Acme\UserBundle\Entity\UserHasAccount',
            'translation_domain' => 'AcmeAccountBundle'
        ));
    }

    public function getName()
    {
        return 'acme_update_account_option_type';
    }
}

And the AccountUserOption form type:
class AccountUserOptionType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            // Display the collection of users
            ->add('accountUser', 'collection', array(
                'type' => new AccountUserOptionFormType($options),
            ))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Acme\AccountBundle\Entity\Account',
            'cascade_validation' => true,
            'validation_groups' => array('AcmeUpdateOption'),
        ));
    }

    public function getName()
    {
        return 'acme_account_user_option_type';
    }
}

The problem I have is with:
->add('user', 'entity', array(
    'class' => 'AcmeUserBundle:User',
    'property' => 'fullname',
))

I just want to display (label or similar) the name of the user. Using entity is displaying a dropdown :/ Is there any core field type I could use or do I have to create a custom one? I would have think that this could be core.
Cheers,
Maxime


text:
Q: How to show all results if search is empty I have the code below where I am trying to search by Country. On the home page there is a dropdown box to select the Country from. My problem is that it shows the results for the selected Country but if nothing is selected then there are no results.
I want it to show ALL Country results if there is no selection.
With this code in the mysql search if country_select was empty then there are zero results:
and bam.country='".mysql_real_escape_string(trim($_POST['country_select']))."'

Here is the full code:
$searchsql = "SELECT pp_id, appmt_id, price, max( stay_from )
                        FROM (
                        SELECT bp.pp_id, bam.appmt_id, bam.appmt_name, bp.price, bp.stay_from
                        FROM bsi_apartment_master AS bam, bsi_appmt_features AS baf, bsi_priceplan AS bp
                        WHERE bam.status=true and baf.appmt_id = bam.appmt_id".$addquery." AND baf.bedroom >=".$this->bedroom." AND baf.bathroom >=".$this->bathroom."
                        and bam.country='".mysql_real_escape_string(trim($_POST['country_select']))."'
                        AND bam.appmt_id NOT IN (SELECT appmt_id FROM bsi_bookings WHERE is_deleted = FALSE AND (( '".$this->mysqlCheckInDate."'
                        BETWEEN checkin_date AND checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) )
                        OR ( DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) BETWEEN checkin_date AND checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) )
                        OR ( checkin_date BETWEEN '".$this->mysqlCheckInDate."' AND DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) )
                        OR ( checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) BETWEEN '".$this->mysqlCheckInDate."' AND DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) )))
                        AND bam.appmt_id = bp.appmt_id
                        AND if( ( ".$staycount." NOT BETWEEN bp.stay_from AND bp.stay_to ) = true,
                        ( ".$staycount." NOT BETWEEN bp.stay_from AND bp.stay_to ) AND bp.default_pp !=0,
                        ( ".$staycount." BETWEEN bp.stay_from AND bp.stay_to ) )
                        order by bp.stay_from desc
                        ) AS t1
                        GROUP BY appmt_id
                        order by price ".$this->sorting;

A: $searchsql = "SELECT pp_id, appmt_id, price, max( stay_from )
                    FROM (
                    SELECT bp.pp_id, bam.appmt_id, bam.appmt_name, bp.price, bp.stay_from
                    FROM bsi_apartment_master AS bam, bsi_appmt_features AS baf, bsi_priceplan AS bp
                    WHERE bam.status=true and baf.appmt_id = bam.appmt_id".$addquery." AND baf.bedroom >=".$this->bedroom." AND baf.bathroom >=".$this->bathroom;

  if(!empty($_POST['country_select']))
  {
     $searchsql .=" and bam.country='".mysql_real_escape_string(trim($_POST['country_select']))."'";
   }
                    $searchsql.="AND bam.appmt_id NOT IN (SELECT appmt_id FROM bsi_bookings WHERE is_deleted = FALSE AND (( '".$this->mysqlCheckInDate."'
                    BETWEEN checkin_date AND checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) )
                    OR ( DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) BETWEEN checkin_date AND checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) )
                    OR ( checkin_date BETWEEN '".$this->mysqlCheckInDate."' AND DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) )
                    OR ( checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) BETWEEN '".$this->mysqlCheckInDate."' AND DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) )))
                    AND bam.appmt_id = bp.appmt_id
                    AND if( ( ".$staycount." NOT BETWEEN bp.stay_from AND bp.stay_to ) = true,
                    ( ".$staycount." NOT BETWEEN bp.stay_from AND bp.stay_to ) AND bp.default_pp !=0,
                    ( ".$staycount." BETWEEN bp.stay_from AND bp.stay_to ) )
                    order by bp.stay_from desc
                    ) AS t1
                    GROUP BY appmt_id
                    order by price ".$this->sorting;

A: Add like instead of = with % sign before and after searching parameter
and bam.country like '%".mysql_real_escape_string(trim($_POST['country_select']))."%'

A: You can set up the WHERE clause to work for either a value or if empty like:
AND (bam.country = $country_value OR $country_value = '')

This would make it so that not setting a value would return all possible values. However if you had rows with country actually blank, there would not be a way to filter for only those rows.

A: You can use the following code,
$country_select  = $_POST['country_select'];

//To intialize search condition
$search_condition = '';

//Search condition for selected country
$search_condition .= $country_select!=""?"bam.country = '$country_select'":"";

$searchsql = "SELECT pp_id, appmt_id, price, max( stay_from )
                        FROM (
                        SELECT bp.pp_id, bam.appmt_id, bam.appmt_name, bp.price, bp.stay_from
                        FROM bsi_apartment_master AS bam, bsi_appmt_features AS baf, bsi_priceplan AS bp
                        WHERE bam.status=true and baf.appmt_id = bam.appmt_id".$addquery." AND baf.bedroom >=".$this->bedroom." AND baf.bathroom >=".$this->bathroom." $search_condition
                        AND bam.appmt_id NOT IN (SELECT appmt_id FROM bsi_bookings WHERE is_deleted = FALSE AND (( '".$this->mysqlCheckInDate."'
                        BETWEEN checkin_date AND checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) )
                        OR ( DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) BETWEEN checkin_date AND checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) )
                        OR ( checkin_date BETWEEN '".$this->mysqlCheckInDate."' AND DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) )
                        OR ( checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) BETWEEN '".$this->mysqlCheckInDate."' AND DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) )))
                        AND bam.appmt_id = bp.appmt_id
                        AND if( ( ".$staycount." NOT BETWEEN bp.stay_from AND bp.stay_to ) = true,
                        ( ".$staycount." NOT BETWEEN bp.stay_from AND bp.stay_to ) AND bp.default_pp !=0,
                        ( ".$staycount." BETWEEN bp.stay_from AND bp.stay_to ) )
                        order by bp.stay_from desc
                        ) AS t1
                        GROUP BY appmt_id
                        order by price ".$this->sorting;

A: If there is no country selection then the country_select key would be empty in $_POST right? so how about you keep that part of the query outside. So your huge query would look something like
query = "";
queryAllCountries = "SELECT FOO, BAR FROM TABLE WHERE FOO=SOMETHING";
if ($_POST[country_select] != null) {
    query = queryAllCountries + " AND COUNTRY = $_POST[country_select]";
} else {
    query = queryAllCountries;
}

mysql_query(query)

That way you append the WHERE clause ONLY if the country_select parameter is POSTED.
ps: Its been really long since i touched PHP and MySQL so the syntax might be wrong. Excuse that part. I hope you get the logic though?