text:
Q: Drop a role with privileges This looks like a very basic need, but I do not find any quick and suitable answer. I have a role in Postgres which has privileges to many other tables in various databases.
I need to drop this role. I have one postgres instance and then many databases on top of it.
SELECT DISTINCT 'REVOKE ALL ON TABLE ' || table_schema || '.' || table_name || ' FROM ' || r.param_role_name || ';'
FROM information_schema.table_privileges CROSS JOIN (SELECT 'some_role_name'::text AS param_role_name) r
WHERE grantee ~* r.param_role_name;

I can do like above, by going to each and every database and find all revoke statements and then drop the role. Is there any way I can find all revoke statements at one place for all the databases.
Or something like I can alter owned by this role, can I alter all privileges with one statement?
Edit1: As most of the replies are targeted to reassign owned by and drop owned by, I want to be more specific.
I can execute below commands on each database and drop the roles once all the dependencies are removed.
REASSIGN OWNED BY some_role_name TO postgres;
DROP OWNED BY some_role_name;

but there are many databases so I am looking for something forcefully flush all privileges and drop this role.

A:
I need to drop this role.

Run this in every database of the same cluster where the role might own anything or have any granted privileges:
REASSIGN OWNED BY some_role_name TO postgres;
DROP OWNED BY some_role_name;

postgres being the default superuser, you can pick any other. It is going to own objects currently owned by the old role. Immediately after REASSIGN OWNED, there are no objects left that would be owned by the same user. It may seem unintuitive to run DROP OWNED. The wording of the command is misleading, since it also revokes all privileges and default privileges for the role in the same database. The manual:

DROP OWNED drops all the objects within the current database that are owned by one of the specified roles. Any privileges granted to the given roles on objects in the current database and on shared objects (databases, tablespaces) will also be revoked.

Bold emphasis mine.
You still have to execute it in every single database where the role owns anything or has any granted privileges. The manual:

Because REASSIGN OWNED does not affect objects within other databases, it is usually necessary to execute this command in each database that contains objects owned by a role that is to be removed.

Finally, run (once):
DROP role some_role_name;

Roles are stored in a cluster-wide system catalog, while ownership and privileges on objects are stored in database-local system catalogs.
Detailed explanation in this related answer:

*

*Find objects linked to a PostgreSQL role
There is a related page in the manual with instructions.
Full automation
There is no single command to do it all. But you can let Postgres generate a complete psql script for you.
Dependencies for roles are stored in the system catalog pg_shdepend:

This information allows PostgreSQL to ensure that those objects are unreferenced before attempting to delete them.

Since we (potentially) need to connect to different databases, we need a combination of psql meta-commands (\c my_database) and SQL DDL commands as shown above. Create this function somewhere in your DB cluster once:
CREATE OR REPLACE FUNCTION f_generate_ddl_to_remove_role(dead_role_walking regrole)
  RETURNS text
  LANGUAGE sql AS
$func$
SELECT concat_ws(
   E'\n'
 ,(SELECT string_agg(format(E'\\c %I\nREASSIGN OWNED BY %2$s TO postgres; DROP OWNED BY %2$s;'
                          , d.datname, dead_role_walking)
                   , E'\n')
   FROM  (
      SELECT DISTINCT dbid
      FROM   pg_shdepend
      WHERE  refobjid = dead_role_walking
      ) s
   JOIN   pg_database d ON d.oid = s.dbid)
 , format(E'DROP role %s;\n', dead_role_walking)
   )
$func$;

Call:
SELECT f_generate_ddl_to_remove_role('some_role_name');

Produces a string like:
\c my_db1
REASSIGN OWNED BY some_role_name TO postgres; DROP OWNED BY some_role_name;
\c my_db2
REASSIGN OWNED BY some_role_name TO postgres; DROP OWNED BY some_role_name;
DROP role some_role_name;

Or, if the role does not own anything and has no privileges, just:
DROP role some_role_name;

If you provide a non-existing role name, you get an error.
Copy the string (without enclosing single quotes) to a psql session opened with a superuser like postgres. Or concatenate a bash script with it. All done.
There are several related answers with more explanation for dynamic SQL:

*

*https://stackoverflow.com/search?q=%5Bplpgsql%5D+%5Bdynamic-sql%5D+string_agg

A: You cannot drop a role until there are dependent objects in any of the database.
You will have to reassign the objects owned by this user (some_role_name) to another user.
Once it is done for all objects in all the databases, you can then delete the user.
REASSIGN OWNED BY some_role_name TO some_other_role_name;
If the dependent objects are not required, you can also go ahead using DROP OWNED BY, removing all the object that are owned by some_role_name.
DROP OWNED BY some_role_name;


text:
Q: Wireshark: Parsing packets I am wondering how does Wireshark parse 802.11 packets.
For example, A probe request packet has a sequence number: 2327.
In the packet details, in hexadecimal it is "70 91", while in ASCII it is "p."
Then how does wireshark get the value "2327" from the packet? Is there a similar example in C?

A: The 802.11 Sequence Control field is a 16 bit little-endian field that contains two subfields - the upper 12 bits contain the Sequence Number, and the lower 4 bits contain the Fragment Number.  In this case:

*

*Sequence Control = 0x9170

*Sequence Number = 0x917 = 2327 decimal

*Fragment Number = 0x0 = 0

A: @caf was right,anyway i post the code on how i extract the Sequence Number..
//this is the subfields
 typedef struct seqctl_subfields
 {
    unsigned fragment:4;
    unsigned seq_num:12;
 };

 struct seqctl_fields *se = (struct seqctl_fields*)p->sc // where p is a struct of the 802.11 header,p->sc points to the sequence control field of the 802.11 header
 std::cout << se->seq_num << std::endl;

redpajama_set_name: RedPajamaStackExchange


text:
Q: Microservices router locator dont work with euroka urls everyone
I just making a microservices application with gateway and eureka
(I used spring 3.0.2)
Eureka server
@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(EurekaServerApplication.class, args);
    }
}

application.yml
server:
  port: 8761

eureka:
  client:
    fetch-registry: false
    register-with-eureka: false

Gateway

@SpringBootApplication
@EnableDiscoveryClient
public class GateWayApplication {

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

}

Cloud config
@Configuration
@Slf4j
@AllArgsConstructor
public class CloudConfig {
    private final DiscoveryClient discoveryClient;

    private final APIRouter APIRouter;

    private URI getURI(String service) throws URISyntaxException {
//        log.info("service url - {}", discoveryClient.getInstances(service).get(0).getUri());
//           return discoveryClient.getInstances(service).get(0).getUri();
        return new URI("lb://" + service + '/');
    }

//    @Bean
//    @LoadBalanced
//    public RestTemplate restTemplate() {
//        return new RestTemplate();
//    }

    @Bean
    @LoadBalanced
    public WebClient.Builder loadBalancedWebClientBuilder() {
        return WebClient.builder();
    }

    @Bean
    public RouteLocator gatewayRoutes(RouteLocatorBuilder builder) {
        var builderRoutes = builder.routes();
        for (var api : APIRouter.getApis()) {
            for (var path : api.getRoutes()) {
                builderRoutes.route(r ->
                {
                    try {
                        return r.path("/api" + "/" + api.getVersion() + "/" + path.getUrl() + "/**")
                                .filters(f -> f.stripPrefix(3))
                                .uri(getURI(path.getServiceName()));
                    } catch (URISyntaxException e) {
                        throw new RuntimeException(e);
                    }
                });
            }
        }

        return builderRoutes.build();
    }
}

application.yml
server:
  port: 5000

spring:
  main:
    web-application-type: reactive
    allow-bean-definition-overriding: true
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher
  application:
    name: gateway
  datasource:
    url: jdbc:postgresql://localhost:5432/jwt_security
    username: postgres
    password: 123456
    driver-class-name: org.postgresql.Driver
  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true
    properties:
      hibernate:
        format_sql: true
    database: postgresql
    database-platform: org.hibernate.dialect.PostgreSQLDialect

  api-router:
    apis:
      - version: v1
        routes:
          - url: kleiderkammer
            service-name: KLEIDER-KAMMER
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka

Kleiderkammer
@RestController
@RequestMapping("public/")
public class PublicController {

    @GetMapping("/test")
    String test() {
        return "Hello from public";
    }
}

@SpringBootApplication
@EnableDiscoveryClient
public class KleiderkammerApplication {

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

server:
  port: 8700

spring:
  application:
    name: kleider-kammer
  datasource:
    url: jdbc:postgresql://localhost:5432/kleiderkammer
    username: postgres
    password: 123456
    driver-class-name: org.postgresql.Driver

  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true
    properties:
      hibernate:
        format_sql: true
    database: postgresql
    database-platform: org.hibernate.dialect.PostgreSQLDialect

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka

  instance:
    prefer-ip-address: true

But when i make request
http://localhost:5000/api/v1/kleiderkammer/public/test
i just get nothing
enter image description here
And i have not an error message
I have tried to change lb to http(than i have an error)
I tried to use RestTemplate instead of WebClient.Builder(for load balancer)


text:
Q: Array específico de Strings em PHP é possível? Bom, tenho o código abaixo que deveria funcionar mas dá erro:
function teste( string... $_array ) : array {

    //FINS DE TESTE

    return $_array;

}

print_r (   teste ( ["teste","2"] ) );

Se eu fizer apenas
 function teste( array $_array ) : array {

        //FINS DE TESTE

        return $_array;

    }

funciona!
Mas eu gostaria de especificar que o array é de strings apenas.
Como fazer isso em PHP?

A: Até o PHP 7 não havia como especificar o tipo do array, eu também queria que pudesse. Entretanto, não sei se em versões recentes tal recurso foi acrescentado.
Mas, o seu primeiro código funciona, apenas acrescentando o ... no array:
// Inalterado
function teste( string... $_array ) : array {
    return $_array;
}

// Acrescentado o `...` antes da array
print_r(teste( ...["teste","2"]));

O ...["teste","2"] fará com que cada item se torne um valor.


text:
Q: Java response.sendRedirect() not clearing angularjs state providers url after # Currently I am working in angular js and j2ee frameworks.
Currently I am http:something.com/home/#/main
But if i am redirect the above url from java servlet using response.sendRedirect("http:something.com/login/")
It redirects me to the page but in browsers url "#/main" remains even after redirecting like below....
http:something.com/login/#/main.
I don't want that angulars state after my redirection.
Thanks in advance

A: The prevailing browser behaviour is to preserve URL fragments after redirects.
If the location in the redirect contains a URL fragment, then it will override any carried over URL fragment.
So what you could do is simply append an empty URL fragment (hash mark #) to your redirect so that it clears anything being carried over.
response.sendRedirect("http://something.com/login/#")


text:
Q: Is there any proof for this formula $\lim_{n \to \infty} \prod_{k=1}^n \left (1+\frac {kx}{n^2} \right) =e^{x/2}$? Some times ago, In a mathematical problem book I sow that this formula. I don't no whether it is true or not. But now I'm try to prove it. I have no idea how to begin it. Any hint or reference would be appreciate. Thank you.
$$\lim_{n \to \infty} \prod_{k=1}^n \left (1+\frac {kx}{n^2} \right) =e^{x/2}$$

A: Notice that $x-x^2/2\leq \ln(1+x) \leq x$ for $x\geq 0$ then : $$\frac{xk }{n^2}  \geq \ln\left(1+\frac{ xk}{n^2}\right) \geq \frac{x k}{n^2} -\frac{x^2 k^2}{n^4} $$ Sum form $k=1$ to $n$ : $$\frac{(n+1)x}{2n} \geq \sum_{k=1}^n \ln\left(1+\frac{ xk}{n^2}\right) \geq \frac{(n+1)x}{2n} - \frac{(n+1)(2n+1)x}{6n^3} $$
Then the limit of the middle sum is $x/2$ take the exponential to get that the requested limit is $e^{x/2}$.

A: Here I use the method suggested by Daniel Fischer in the comment section:
Take the logarithm of  $$\prod _{k=1}^n \left(1+\dfrac{kx}{n^2} \right).$$ Then we have
$$\ln\left(\prod_{k=1}^n\ \left(1+\dfrac{kx}{n^2 }\right) \right)=\sum_{k=1}^n\ln\left(1+\dfrac{kx}{n^2 }\right).$$
By the Taylor series expansion of logarithms,
$$ \ln\left(1+\dfrac{kx}{n^2} \right)=\sum_{m=1}^\infty\dfrac{(-1)^{m-1}}{m}\left(\dfrac{ kx}{n^2 }\right)^m \\=
\left(\dfrac{kx}{n^2 }\right)-\dfrac{1}{2} \left(\dfrac{kx}{n^2 }\right)^2+\dfrac{1}{3} \left(\dfrac{kx}{n^2 }\right)^3-\dfrac{1}{4} \left(\dfrac{kx}{n^2 }\right)^4+\dfrac{1}{5} \left(\dfrac{kx}{n^2 }\right)^5-\dfrac{1}{6} \left(\dfrac{kx}{n^2 }\right)^6+ …$$
Now
$$\sum_{k=1}^n\ln\left(1+\dfrac{kx}{n^2} \right) =\dfrac{x}{n^2 }\left( \sum_{k=1}^nk\right)-\dfrac{x^2}{2n^4 }\left( \sum_{k=1}^nk^2\right)+\dfrac{x^3}{3n^6 } \left(\sum_{k=1}^nk^3 \right)-\dfrac{x^4}{4n^8 }\left(\sum_{k=1}^nk^4 \right)+ …$$
Note that
$$\sum_{k=1}^nk^r =\dfrac{n^{r+1}}{r+1}+\dfrac{n^r}{2} + O(n^{r-1})$$
is a $(r+1)^{\text{th}}$ degree polynomial of $n.$
Therefore
$$\lim_{n\to\infty}\left(\dfrac{1}{n^{2r}}  \sum_{k=1}^nk^r\right)=\left\{
\begin{array}{rl}
\frac{1}{2}:&r=1\\
0:&r>1
\end{array}
\right.
$$
Hence we can obtain $$\lim_{n\to\infty}\ln\left(\prod_{k=1}^n\left(1+\dfrac{kx}{n^2 }\right) \right)=\lim_{n\to\infty}\sum_{k=1}^n\ln\left(1+\dfrac{kx}{n^2 }\right)=\dfrac{x}{2}-0+0-0+ ...$$
$$\ln \left(\lim_{n\to\infty}\prod_{k=1}^n\left(1+\dfrac{kx}{n^2 }\right)\right)=\dfrac{x}{2}$$
$$\lim_{n\to\infty}\prod_{k=1}^n\left(1+\dfrac{kx}{n^2 }\right)=e^{x/2}$$


text:
Q: Big-O - what about the small values? So the big-O tells you something about the worst-case performance when n (the input size) is sufficiently large, like . But what about the part where n is not that large? Don't we care about that?

A: There is a load of factors which must be taken into account for small input sizes in real-world scenarios. Actually factoring them in would bloat the analysis. So, in contemporary reality, you are either satisfied with big O, which is a tip of the iceberg, or dig further armed with knowledge of the use case details, which are non-universal anyway.


text:
Q: Html5 input type="time" with an X button I noticed that on Chrome HTML5 inputs with type=time have an X button that clears the value, setting it to the empty value --:--; however, this appears only when the input doesn't have the required attribute, and I can see the reason why this happens, since clearing out a required field shouldn't be allowed.
Is there any way, maybe through some CSS property I don't know of, to have the X button not display without setting the required attribute, for instance if I just don't want it to be visible but my field isn't, semantically, required?
This is what happens when the input doesn't have the required attribute:

And this is what happens when the required attribute is specified:


text:
Q: Как понять, что произошло подтверждение личности аккаунта разработчика Google Play? В четверг 30.07.20 создал аккаунт разработчика в Google Play, отправил фото паспорта. Сегодня пришло письмо следующего содержания:
"Добро пожаловать в Google Play!    Спасибо, что присоединились. Вы стали частью сообщества разработчиков, чьи приложения и игры приносят пользу и радость миллиардам пользователей." и так далее.
Однако функция подтверждения личности из Google Play Console не исчезла:

Подскажите, пожалуйста, является ли мой аккаунт подтверждённым или мне нужно сделать ещё что-то?

A: Как оказалось, подтверждения не произошло, по причине того, что я закрыл подпись на паспорте:

Дабы второй раз не мучатся с паспортом, скинул водительское удостоверение и, через несколько часов успешно прошёл идентификацию


text:
Q: Why cant the terminal locate and install Acetoneiso_2.3.tar.gz.? The package is on my desktop
cd Desktop
parallels@LouiseAvon:~/Desktop$ sudo apt-get install acetoneiso_2.3.tar.gz
[sudo] password for parallels:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package acetoneiso_2.3.tar.gz
E: Couldn't find any package by regex 'acetoneiso_2.3.tar.gz'
parallels@LouiseAvon:~/Desktop$

What can I do? Is the file extension the problem?

A: apt-get is for packages that are resident in the Ubuntu on-line repositories. Please try:
sudo apt-get install acetoneiso

A tar.gz file is only needed when you wish to compile a package not found in the repositories from source code.


text:
Q: where to specify libraries to link in makefile I'm sorry about the long text. But I want to compile the libxls library for C++. I've amended it to use ICU for handling encoding. Where in the following makefile can I add the respective library files to be linked to? NOTE, these libraries are named for ex. icudt.lib, so the notation -L, -l won't work. Also, ICU is setup with pkg-config, if that helps. And there are also a makefile.am and makefile.in, if they have any importance.
# Makefile.in generated by automake 1.13 from Makefile.am.
# Makefile.  Generated from Makefile.in by configure.

# Copyright (C) 1994-2012 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

am__make_dryrun = \
  { \
    am__dry=no; \
    case $$MAKEFLAGS in \
      *\\[\ \   ]*) \
        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
      *) \
        for am__flg in $$MAKEFLAGS; do \
          case $$am__flg in \
            *=*|--*) ;; \
            *n*) am__dry=yes; break;; \
          esac; \
        done;; \
    esac; \
    test $$am__dry = yes; \
  }
pkgdatadir = $(datadir)/libxls
pkgincludedir = $(includedir)/libxls
pkglibdir = $(libdir)/libxls
pkglibexecdir = $(libexecdir)/libxls
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-mingw32
host_triplet = i686-pc-mingw32
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
    $(top_srcdir)/configure $(am__configure_deps) \
    $(srcdir)/config.h.in mkinstalldirs AUTHORS INSTALL TODO \
    config.guess config.sub depcomp install-sh missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
    $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
    $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
    $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    $(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
 configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo "  GEN     " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
    ctags-recursive dvi-recursive html-recursive info-recursive \
    install-data-recursive install-dvi-recursive \
    install-exec-recursive install-html-recursive \
    install-info-recursive install-pdf-recursive \
    install-ps-recursive install-recursive installcheck-recursive \
    installdirs-recursive pdf-recursive ps-recursive \
    tags-recursive uninstall-recursive
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
  distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
  $(RECURSIVE_TARGETS) \
  $(RECURSIVE_CLEAN_TARGETS) \
  $(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
    cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
    $(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates.  Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
  BEGIN { nonempty = 0; } \
  { items[$$0] = 1; nonempty = 1; } \
  END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique.  This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
  list='$(am__tagged_files)'; \
  unique=`for i in $$list; do \
    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
  if test -d "$(distdir)"; then \
    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
      && rm -rf "$(distdir)" \
      || { sleep 5 && rm -rf "$(distdir)"; }; \
  else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
  dir0=`pwd`; \
  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
  sed_rest='s,^[^/]*/*,,'; \
  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
  sed_butlast='s,/*[^/]*$$,,'; \
  while test -n "$$dir1"; do \
    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
    if test "$$first" != "."; then \
      if test "$$first" = ".."; then \
        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
      else \
        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
        if test "$$first2" = "$$first"; then \
          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
        else \
          dir2="../$$dir2"; \
        fi; \
        dir0="$$dir0"/"$$first"; \
      fi; \
    fi; \
    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
  done; \
  reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).zip
GZIP_ENV = --best
DIST_TARGETS = dist-gzip dist-zip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = ${SHELL} /c/Users/sirghi/Desktop/libxls-1.3.4/missing aclocal-1.13
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AR = ar
AUTOCONF = ${SHELL} /c/Users/sirghi/Desktop/libxls-1.3.4/missing autoconf
AUTOHEADER = ${SHELL} /c/Users/sirghi/Desktop/libxls-1.3.4/missing autoheader
AUTOMAKE = ${SHELL} /c/Users/sirghi/Desktop/libxls-1.3.4/missing automake-1.13
AWK = gawk
CC = gcc -std=gnu99
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DSYMUTIL =
DUMPBIN =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /bin/grep -E
EXEEXT = .exe
FGREP = /bin/grep -F
GREP = /bin/grep
INSTALL = /bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = c:/mingw/mingw32/bin/ld.exe
LDFLAGS =
LIBOBJS =
LIBS = /mingw/lib/icuin.lib /mingw/lib/icuuc.lib /mingw/lib/icudt.lib
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIBTOOL_DEPS = ./ltmain.sh
LIBXLS_LIBS =  /mingw/lib/icuin.lib /mingw/lib/icuuc.lib /mingw/lib/icudt.lib
LIBXLS_MAJOR_VERSION = 1
LIBXLS_MICRO_VERSION = 1
LIBXLS_MINOR_VERSION = 2
LIPO =
LN_S = cp -pR
LTLIBOBJS =
MAKEINFO = ${SHELL} /c/Users/sirghi/Desktop/libxls-1.3.4/missing makeinfo
MKDIR_P = /bin/mkdir -p
NM = /mingw/bin/nm
NMEDIT =
OBJDUMP = objdump
OBJEXT = o
OTOOL =
OTOOL64 =
PACKAGE = libxls
PACKAGE_BUGREPORT = dhoerl@users.sourceforge.net
PACKAGE_NAME = libxls
PACKAGE_STRING = libxls 1.2.1
PACKAGE_TARNAME = libxls
PACKAGE_URL =
PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /mingw/bin/pkg-config
RANLIB = ranlib
SED = /bin/sed
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
VERSION = 1.2.1
VERSION_INFO = 3:1:2
WITH_ICONV = 0
abs_builddir = /c/Users/sirghi/Desktop/libxls-1.3.4
abs_srcdir = /c/Users/sirghi/Desktop/libxls-1.3.4
abs_top_builddir = /c/Users/sirghi/Desktop/libxls-1.3.4
abs_top_srcdir = /c/Users/sirghi/Desktop/libxls-1.3.4
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_DUMPBIN =
am__include = include
am__leading_dot = .
am__quote =
am__tar = $${TAR-tar} chof - "$$tardir"
am__untar = $${TAR-tar} xf -
bindir = ${exec_prefix}/bin
build = i686-pc-mingw32
build_alias =
build_cpu = i686
build_os = mingw32
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = i686-pc-mingw32
host_alias =
host_cpu = i686
host_os = mingw32
host_vendor = pc
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /c/Users/sirghi/Desktop/libxls-1.3.4/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /mingw
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix =
top_builddir = .
top_srcdir = .
AUTOMAKE_OPTIONS = foreign dist-zip
SUBDIRS = include src test
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

# Extra files to distribute
EXTRA_DIST = doc
all: config.h
    $(MAKE) $(AM_MAKEFLAGS) all-recursive

.SUFFIXES:
am--refresh: Makefile
    @:
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
    @for dep in $?; do \
      case '$(am__configure_deps)' in \
        *$$dep*) \
          echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
          $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
        && exit 0; \
          exit 1;; \
      esac; \
    done; \
    echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
    $(am__cd) $(top_srcdir) && \
      $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
    @case '$?' in \
      *config.status*) \
        echo ' $(SHELL) ./config.status'; \
        $(SHELL) ./config.status;; \
      *) \
        echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
        cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
    esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
    $(SHELL) ./config.status --recheck

$(top_srcdir)/configure:  $(am__configure_deps)
    $(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
    $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):

config.h: stamp-h1
    @if test ! -f $@; then rm -f stamp-h1; else :; fi
    @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi

stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
    @rm -f stamp-h1
    cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in:  $(am__configure_deps)
    ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
    rm -f stamp-h1
    touch $@

distclean-hdr:
    -rm -f config.h stamp-h1

mostlyclean-libtool:
    -rm -f *.lo

clean-libtool:
    -rm -rf .libs _libs

distclean-libtool:
    -rm -f libtool config.lt

# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
#     (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
    @fail= failcom='exit 1'; \
    for f in x $$MAKEFLAGS; do \
      case $$f in \
        *=* | --[!k]*);; \
        *k*) failcom='fail=yes';; \
      esac; \
    done; \
    dot_seen=no; \
    target=`echo $@ | sed s/-recursive//`; \
    case "$@" in \
      distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
      *) list='$(SUBDIRS)' ;; \
    esac; \
    for subdir in $$list; do \
      echo "Making $$target in $$subdir"; \
      if test "$$subdir" = "."; then \
        dot_seen=yes; \
        local_target="$$target-am"; \
      else \
        local_target="$$target"; \
      fi; \
      ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
      || eval $$failcom; \
    done; \
    if test "$$dot_seen" = "no"; then \
      $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
    fi; test -z "$$fail"

ID: $(am__tagged_files)
    $(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags

tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
    set x; \
    here=`pwd`; \
    if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
      include_option=--etags-include; \
      empty_fix=.; \
    else \
      include_option=--include; \
      empty_fix=; \
    fi; \
    list='$(SUBDIRS)'; for subdir in $$list; do \
      if test "$$subdir" = .; then :; else \
        test ! -f $$subdir/TAGS || \
          set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
      fi; \
    done; \
    $(am__define_uniq_tagged_files); \
    shift; \
    if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
      test -n "$$unique" || unique=$$empty_fix; \
      if test $$# -gt 0; then \
        $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          "$$@" $$unique; \
      else \
        $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          $$unique; \
      fi; \
    fi
ctags: ctags-recursive

CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
    $(am__define_uniq_tagged_files); \
    test -z "$(CTAGS_ARGS)$$unique" \
      || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
         $$unique

GTAGS:
    here=`$(am__cd) $(top_builddir) && pwd` \
      && $(am__cd) $(top_srcdir) \
      && gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
    test ! -s cscope.files \
      || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
    -rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive

cscopelist-am: $(am__tagged_files)
    list='$(am__tagged_files)'; \
    case "$(srcdir)" in \
      [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
      *) sdir=$(subdir)/$(srcdir) ;; \
    esac; \
    for i in $$list; do \
      if test -f "$$i"; then \
        echo "$(subdir)/$$i"; \
      else \
        echo "$$sdir/$$i"; \
      fi; \
    done >> $(top_builddir)/cscope.files

distclean-tags:
    -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
    -rm -f cscope.out cscope.in.out cscope.po.out cscope.files

distdir: $(DISTFILES)
    $(am__remove_distdir)
    test -d "$(distdir)" || mkdir "$(distdir)"
    @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
    topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
    list='$(DISTFILES)'; \
      dist_files=`for file in $$list; do echo $$file; done | \
      sed -e "s|^$$srcdirstrip/||;t" \
          -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
    case $$dist_files in \
      */*) $(MKDIR_P) `echo "$$dist_files" | \
               sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
               sort -u` ;; \
    esac; \
    for file in $$dist_files; do \
      if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
      if test -d $$d/$$file; then \
        dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
        if test -d "$(distdir)/$$file"; then \
          find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
        fi; \
        if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
          find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
        fi; \
        cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
      else \
        test -f "$(distdir)/$$file" \
        || cp -p $$d/$$file "$(distdir)/$$file" \
        || exit 1; \
      fi; \
    done
    @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
      if test "$$subdir" = .; then :; else \
        $(am__make_dryrun) \
          || test -d "$(distdir)/$$subdir" \
          || $(MKDIR_P) "$(distdir)/$$subdir" \
          || exit 1; \
        dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
        $(am__relativize); \
        new_distdir=$$reldir; \
        dir1=$$subdir; dir2="$(top_distdir)"; \
        $(am__relativize); \
        new_top_distdir=$$reldir; \
        echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
        echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
        ($(am__cd) $$subdir && \
          $(MAKE) $(AM_MAKEFLAGS) \
            top_distdir="$$new_top_distdir" \
            distdir="$$new_distdir" \
        am__remove_distdir=: \
        am__skip_length_check=: \
        am__skip_mode_fix=: \
            distdir) \
          || exit 1; \
      fi; \
    done
    $(MAKE) $(AM_MAKEFLAGS) \
      top_distdir="$(top_distdir)" distdir="$(distdir)" \
      dist-hook
    -test -n "$(am__skip_mode_fix)" \
    || find "$(distdir)" -type d ! -perm -755 \
        -exec chmod u+rwx,go+rx {} \; -o \
      ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
      ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
      ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
    || chmod -R a+r "$(distdir)"
dist-gzip: distdir
    tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
    $(am__post_remove_distdir)

dist-bzip2: distdir
    tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
    $(am__post_remove_distdir)

dist-lzip: distdir
    tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
    $(am__post_remove_distdir)

dist-xz: distdir
    tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
    $(am__post_remove_distdir)

dist-tarZ: distdir
    tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
    $(am__post_remove_distdir)

dist-shar: distdir
    shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
    $(am__post_remove_distdir)
dist-zip: distdir
    -rm -f $(distdir).zip
    zip -rq $(distdir).zip $(distdir)
    $(am__post_remove_distdir)

dist dist-all:
    $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
    $(am__post_remove_distdir)

# This target untars the dist file and tries a VPATH configuration.  Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
    case '$(DIST_ARCHIVES)' in \
    *.tar.gz*) \
      GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
    *.tar.bz2*) \
      bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
    *.tar.lz*) \
      lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
    *.tar.xz*) \
      xz -dc $(distdir).tar.xz | $(am__untar) ;;\
    *.tar.Z*) \
      uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
    *.shar.gz*) \
      GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
    *.zip*) \
      unzip $(distdir).zip ;;\
    esac
    chmod -R a-w $(distdir)
    chmod u+w $(distdir)
    mkdir $(distdir)/_build $(distdir)/_inst
    chmod a-w $(distdir)
    test -d $(distdir)/_build || exit 0; \
    dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
      && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
      && am__cwd=`pwd` \
      && $(am__cd) $(distdir)/_build \
      && ../configure --srcdir=.. --prefix="$$dc_install_base" \
        $(AM_DISTCHECK_CONFIGURE_FLAGS) \
        $(DISTCHECK_CONFIGURE_FLAGS) \
      && $(MAKE) $(AM_MAKEFLAGS) \
      && $(MAKE) $(AM_MAKEFLAGS) dvi \
      && $(MAKE) $(AM_MAKEFLAGS) check \
      && $(MAKE) $(AM_MAKEFLAGS) install \
      && $(MAKE) $(AM_MAKEFLAGS) installcheck \
      && $(MAKE) $(AM_MAKEFLAGS) uninstall \
      && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
            distuninstallcheck \
      && chmod -R a-w "$$dc_install_base" \
      && ({ \
           (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
           && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
           && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
           && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
                distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
          } || { rm -rf "$$dc_destdir"; exit 1; }) \
      && rm -rf "$$dc_destdir" \
      && $(MAKE) $(AM_MAKEFLAGS) dist \
      && rm -rf $(DIST_ARCHIVES) \
      && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
      && cd "$$am__cwd" \
      || exit 1
    $(am__post_remove_distdir)
    @(echo "$(distdir) archives ready for distribution: "; \
      list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
      sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
    @test -n '$(distuninstallcheck_dir)' || { \
      echo 'ERROR: trying to run $@ with an empty' \
           '$$(distuninstallcheck_dir)' >&2; \
      exit 1; \
    }; \
    $(am__cd) '$(distuninstallcheck_dir)' || { \
      echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
      exit 1; \
    }; \
    test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
       || { echo "ERROR: files left after uninstall:" ; \
            if test -n "$(DESTDIR)"; then \
              echo "  (check DESTDIR support)"; \
            fi ; \
            $(distuninstallcheck_listfiles) ; \
            exit 1; } >&2
distcleancheck: distclean
    @if test '$(srcdir)' = . ; then \
      echo "ERROR: distcleancheck can only run from a VPATH build" ; \
      exit 1 ; \
    fi
    @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
      || { echo "ERROR: files left in build directory after distclean:" ; \
           $(distcleancheck_listfiles) ; \
           exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive

install-am: all-am
    @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-recursive
install-strip:
    if test -z '$(STRIP)'; then \
      $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
        install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          install; \
    else \
      $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
        install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
        "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
    fi
mostlyclean-generic:

clean-generic:

distclean-generic:
    -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
    -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
    @echo "This command is intended for maintainers to use"
    @echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-recursive
    -rm -f $(am__CONFIG_DISTCLEAN_FILES)
    -rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
    distclean-libtool distclean-tags

dvi: dvi-recursive

dvi-am:

html: html-recursive

html-am:

info: info-recursive

info-am:

install-data-am:

install-dvi: install-dvi-recursive

install-dvi-am:

install-exec-am:

install-html: install-html-recursive

install-html-am:

install-info: install-info-recursive

install-info-am:

install-man:

install-pdf: install-pdf-recursive

install-pdf-am:

install-ps: install-ps-recursive

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-recursive
    -rm -f $(am__CONFIG_DISTCLEAN_FILES)
    -rm -rf $(top_srcdir)/autom4te.cache
    -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-recursive

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-recursive

pdf-am:

ps: ps-recursive

ps-am:

uninstall-am:

.MAKE: $(am__recursive_targets) all install-am install-strip

.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
    am--refresh check check-am clean clean-cscope clean-generic \
    clean-libtool cscope cscopelist-am ctags ctags-am dist \
    dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
    dist-tarZ dist-xz dist-zip distcheck distclean \
    distclean-generic distclean-hdr distclean-libtool \
    distclean-tags distcleancheck distdir distuninstallcheck dvi \
    dvi-am html html-am info info-am install install-am \
    install-data install-data-am install-dvi install-dvi-am \
    install-exec install-exec-am install-html install-html-am \
    install-info install-info-am install-man install-pdf \
    install-pdf-am install-ps install-ps-am install-strip \
    installcheck installcheck-am installdirs installdirs-am \
    maintainer-clean maintainer-clean-generic mostlyclean \
    mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
    tags tags-am uninstall uninstall-am

dist-hook:
    rm -rf `find $(distdir)/doc -name CVS`

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

As you can see, I tried setting the LIBS variable:
LIBS = /mingw/lib/icuin.lib /mingw/lib/icuuc.lib /mingw/lib/icudt.lib

but it doesn't work.
Please help!

A: Here's what I've found:
# The following naming scheme is used for libraries.
#
# On *nix:
#     libxxx.a       static library
#     libxxx.so      shared library
#
# On windows (msvc)
#     libxxx.lib     static library
#     xxx.dll        DLL
#     xxx.lib        import library
#
# On windows (mingw):
#     libxxx.a       static library
#     libxxx.dll     DLL
#     libxxx.dll.a   import library
#
# On cygwin i.e. <target-os>cygwin
#     libxxx.a       static library
#     cygxxx.dll     DLL
#     libxxx.dll.a   import library

It appears gcc detects all of these types on my windows. So, it finally worked with the -lxxx notation, but I used it as an argument to the configure script. I still don't know where I can put them manually in the makefile. I've searched the generated makefiles for the libraries but couldn't find them. Don't know where automake has put them.


text:
Q: how to convert this? hi may i know how to convert this c++ code to c#?
memset(device, 0, 32);

I tried the following :
device = new string(Char(32));
Is this correct?

A: well, basically, in c#, you can simply say :
string device = string.Empty;

in fact, you can even say:
var device = string.Empty;

At this point, device is initialized as a pointer to a string variable who's current value is string.Empty or "", with whatever amount of memory c# decides that it needs.  The amount of memory allocated to that object will be transparent to you as the .net developer.
One of the major differences between c++ and c# is that c# handles all the memory management for you behind the scenes.


text:
Q: What's going on in Rails' application_record.rb? Found this code in the Rails source code.
<% module_namespacing do -%>
class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true
end
<% end -%>

Haven't seen anything alike yet. Would someone mind to explain
what the enclosing module_namespacing is doing and why it looks like a modified (because of the dashes) Rails view .erb statement?

A: What you looked at are just generators. You can read more about these in official guides.
These are used, well, to generate code when you run generators :)
You can check a list of available generators with
bundle exec rails generate


text:
Q: SQL - Finding foreign key ID associated with a combination of multiple/variable table variable rows In a Microsoft SQL Server stored procedure, I have table variable, @PlayerComboStrategy, with a variable number of rows, and columns PLAYER_ID, POSITION_CODE, STATUS_CODE.
I am looking for the most efficient way to retrieve the STRATEGY_ID associated with the exact combination of all of my table variable rows, if it exists. In other words, how can I find the STRATEGY_ID involving all of the PLAYER_IDs with their specific POSITION_CODE and STATUS_CODE. In the event that it does not exists, I will proceed with its creation in my stored procedure.
I was thinking of pulling a list of all of the STRATEGY_IDs for each rows matching the combination of PLAYER_ID, POSITION_CODE and STATUS_CODE and see if there is a common ID between the lists. However, this will fail if, for example, three players (and their position and status code) are associated with a strategy, and the exact same combination plus one (or many) extra players are associated with another strategy. That being said, the STRATEGY_ID retrieved must be built from x number of rows from PLAYER_STRATEGY matching the x number of rows from @PlayerComboStrategy.
An example of @PlayerComboStrategy
+-----------+---------------+-------------+
| PLAYER_ID | POSITION_CODE | STATUS_CODE |
+-----------+---------------+-------------+
|        33 |             2 |           2 |
|        23 |             4 |           1 |
+-----------+---------------+-------------+

A sample of PLAYER_STRATEGY:
+-------------------+-------------+-----------+---------------+-------------+
| PLAYER_STATEGY_ID | STRATEGY_ID | PLAYER_ID | POSITION_CODE | STATUS_CODE |
+-------------------+-------------+-----------+---------------+-------------+
|              1490 |         511 |        64 |             2 |           2 |
|              1491 |         511 |        33 |             2 |           2 |
|              1492 |         511 |        23 |             4 |           1 |
|              1493 |         512 |        33 |             2 |           2 |
|              1494 |         512 |        23 |             5 |           1 |
|              1495 |         513 |        33 |             2 |           2 |
|              1496 |         513 |        23 |             4 |           1 |
|              1497 |         514 |        33 |             2 |           2 |
+-------------------+-------------+-----------+---------------+-------------+

For this example, I would want STRATEGY_ID = 513 to be found.

A: Here is one way to tackle this. I included a fully working example so you can see a nice and easy way to share data. :) There are multiple ways you can tackle this kind of thing but this is what came to my mind first.
declare @PlayerStrategy table
(
    PLAYER_STATEGY_ID int
    , STRATEGY_ID int
    , PLAYER_ID int
    , POSITION_CODE int
    , STATUS_CODE int
)

insert @PlayerStrategy values
(1490, 511, 64, 2, 2)
, (1491, 511, 33, 2, 2)
, (1492, 511, 23, 4, 1)
, (1493, 512, 33, 2, 2)
, (1494, 512, 23, 5, 1)
, (1495, 513, 33, 2, 2)
, (1496, 513, 23, 4, 1)
, (1497, 514, 33, 2, 2)

declare @PlayerComboStrategy table
(
    PLAYER_ID int
    , POSITION_CODE int
    , STATUS_CODE int
)

insert @PlayerComboStrategy values
(33, 2, 2)
, (23, 4, 1)

select ps.STRATEGY_ID
from @PlayerStrategy ps
join @PlayerComboStrategy pcs on ps.PLAYER_ID = pcs.PLAYER_ID
                                        and ps.POSITION_CODE = pcs.POSITION_CODE
                                        and ps.STATUS_CODE = pcs.STATUS_CODE
group by ps.STRATEGY_ID
having count(ps.PLAYER_ID) = (select count(*) from @PlayerComboStrategy)
    and count(ps.PLAYER_ID) = (select count(*) from @PlayerStrategy ps2 where ps2.STRATEGY_ID = ps.STRATEGY_ID)

A: WITH matching_strategies AS (
    SELECT strategy_id, COUNT(*) AS matching_strategies
    FROM @PlayerComboStrategy p
    JOIN PLAYER_STRATEGY s
        ON p.player_id = s.player_id
        AND p.position_code = s.position_code
        AND p.status_code = s.status_code
    GROUP BY strategy_id ),
total_strategies AS (
    SELECT p.strategy_id, COUNT(*) AS total_strategies
    FROM PLAYER_STRATEGY p
    JOIN matching_strategies s
        ON p.strategy_id = s.strategy_id
    GROUP BY p.strategy_id )
SELECT ms.strategy_id
FROM matching_strategies ms
JOIN total_strategies ts
    ON ms.strategy_id = ts.strategy_id
    AND ms.matching_strategies = ts.total_strategies
    AND matching_strategies = (SELECT COUNT(*) FROM @PlayerComboStrategy)

The first CTE will give you counts of all of your strategies which match to a player. The second will get the total count of players on a strategy for those which match one of the players we're looking for. The final select will check for those who's player counts match the total count, and match the total number of players being looked for.


text:
Q: UTF-8 to unicode converter for embeded system display I have an embedded system that gets UTF-8 encoded data to display via UPNP. The display device has the ability to display characters. I need a way to convert the UTF-8 data I recieve via UPNP to unicode. The display is on a PIC, and it is sent data via a UPNP bridge running linux. Is there a simple way to do the conversion before I send it to the display board in linux?

A: To convert an array of bytes encoded as UFT-8 into an array of Unicode code points:
The trick is to detect various encoding mistakes.
#include <limits.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>

typedef struct {
  uint32_t UnicodePoint;  // Accumulated code point
  uint32_t Min;           // Minimum acceptable codepoint
  int i;                  // Index of char/wchar_t remaining
  bool e;                 // Error flag
} UTF_T;

static bool IsSurrogate(unsigned c) {
  return (c >= 0xD800) && (c <= 0xDFFF);
}

// Return true if more bytes needed to complete codepoint
static bool Put8(UTF_T *U, unsigned ch) {
  ch &= 0xFF;
  if (U->i == 0) {
    if (ch <= 0x7F) {
      U->UnicodePoint = ch;
      return false; /* No more needed */
    } else if (ch <= 0xBF) {
      goto fail;
    } else if (ch <= 0xDF) {
      U->Min = 0x80;
      U->UnicodePoint = ch & 0x1F;
      U->i = 1;
    } else if (ch <= 0xEF) {
      U->Min = 0x800;
      U->UnicodePoint = ch & 0x0F;
      U->i = 2;
    } else if (ch <= 0xF7) {
      U->Min = 0x10000;
      U->UnicodePoint = ch & 0x07;
      U->i = 3;
    } else {
      goto fail;
    }
    return true; /* More needed */
  }
  // If expected continuation character missing ...
  if ((ch & (~0x3F)) != 0x80) {
    goto fail;
  }
  U->UnicodePoint <<= 6;
  U->UnicodePoint |= (ch & 0x3F);
  // If last continuation character ...
  if (--(U->i) == 0) {
    // If codepoint out of range ...
    if ((U->UnicodePoint < U->Min) || (U->UnicodePoint > 0x10FFFF)
        || IsSurrogate(U->UnicodePoint)) {
      goto fail;
    }
    return false /* No more needed */;
  }
  return true; /* More needed */

  fail:
  U->UnicodePoint = -1;
  U->i = 0;
  U->e = true;
  return false /* No more needed */;
}

/* return 0:OK, else error */
bool ConvertUTF8toUnicodeCodepoints(const char *UTF8, size_t Length,
    uint32_t *CodePoints, size_t *OutLen) {
  UTF_T U = { 0 };
  *OutLen = 0;
  for (size_t i = 0; i < Length;) {
    while (Put8(&U, UTF8[i++])) {
      // Needed bytes not available?
      if (i >= Length) {
        return true;
      }
    }
    if (U.e) break;
    CodePoints[(*OutLen)++] = U.UnicodePoint;
  }
  return U.e;
}

This is based on some old code, please advise as it may not be up to current standards.
Not the prettiest with goto and magic numbers.
What is nice about this approach is rather than CodePoints[(*OutLen)++] = U.UnicodePoint for consuming the codepoint, if one wanted to extract UTF16 (BE or LE), one could easily write consumer code for the UTF_T block and not need to change to the UTF8 -> codepoint part.

A: If you have a real operating system and hosted C environment at your disposal, the best approach would be to simply ensure that your program runs in a locale that uses UTF-8 as its encoding and use mbrtowc or mbtowc to convert UTF-8 sequences to Unicode codepoint values (wchar_t is a Unicode codepoint number on Linux and any C implementation that defines __STDC_ISO_10646__).
If you do want to skip the system library routines and do UTF-8 decoding yourself, be careful. I once did a casual survey using Google code search and found that somewhere between 1/3 and 2/3 of the UTF-8 code out in the wild was dangerously wrong. Here is a fully correct, fast, and simple implementation I would highly recommend:
http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
My implementation in musl is somewhat smaller in binary size and seems to be faster, but it's also a bit harder to understand.

A: I would use the Unicode manipulation functions of GLib, a LGPL-licensed utility library. It sounds like g_utf8_to_ucs4() is what you are looking for.


text:
Q: Convertfeaturestographics Tool or Program Problem : With over 19 feature classes in our dataset, we need to convert all these featureclasses to graphic . But to do it programmatically, we searched the resources but could not find a Python script for converting features to graphics.
Though below VBA code was available , I hope it wont help us in 10.1
http://edndoc.esri.com/arcobjects/9.0/samples/arcmap/convertfeaturestographics.htm
Mightbe we are missing some trick here ?

A: It appears VBA is still supported for v10.1, however there are some additional install steps, see link below:
http://resources.arcgis.com/en/help/install-guides/arcgis-desktop/10.1/index.html#//008700000012000000
The recommended workflow is to covert your VBA code to .NET.  There are many forum posts and ESRI how to for doing this migration.

A: I don't know about a way to convert the features directly to graphics. But you could do something like this:

*

*Put your feature classes in a mxd; either manually or programmatically

*Create dataDrivenPages, have a look at ArcGIS Help 10.1

*Export each data driven page to graphic with arcpy.mapping.ExportToJPEG (or PNG,SVG, ...)


text:
Q: How to Evaluate Func with use EF.Functions? I'm trying to evaluate func<T, bool> with EF.Functions.Like in CSharpScript.EvaluateAsync, But I have an error in run time (The name 'EF' does not exist in the current context) when call GetPredicate() method.
Create Func Method:
public static class Helper
{
    public static async Task<Func<T, bool>> GetPredicate<T>(string stringExpression)
            {
                ScriptOptions options = ScriptOptions.Default.AddReferences(references: typeof(T).Assembly);
                Func<T, bool> discountFilterExpression = await CSharpScript.EvaluateAsync<Func<T, bool>>(stringExpression, options);

                return discountFilterExpression;
            }
}

Call Method:
string expString = "x => EF.Functions.Like(x.CodeId, pattern) || EF.Functions.Like(x.Name, pattern) || EF.Functions.Like(x.CategoryId, pattern)";
Func<MyClass, bool> exp = await Helper.GetPredicate<MyClass>(expString);

How to do this?

A: EF.Functions usually are not supposed to be evaluated.
But to answer your concrete question, you need to add both reference to Microsoft.EntityFrameworkCore assembly and import (using) of Microsoft.EntityFrameworkCore namespace, e.g.
ScriptOptions options = ScriptOptions.Default
    .AddReferences(references: typeof(T).Assembly)
    .AddReferences(typeof(EF).Assembly) // <--
    .AddImports(typeof(EF).Namespace); // <--


text:
Q: Getting UTF-8 characters from SQL Server table into PHP using PDO I have a SQL Server table that contains country names translated into various languages. I am attempting to display this in a web page. However, what is stored in the database as Amérique du Nord comes out in PHP as Amérique du Nord
My PDO connection string is
sqlsrv:SERVER=<SERVER>;DATABASE=<DATABASE>

There is no charset option for SQL Server, but the default according to the documentation is UTF-8.
I have tried casting the column to varbinary, but that just gives me an ascii number that I have not been able to convert to a character. I have also tried a few variations of mb_character_encode which ended up making the characters Chinese.
For additional information:
I am on IIS 7.5, running PHP through FastCGI.
The script is sending the utf-8 header.
On other areas of the same page, I am successfully outputting UTF-8 that I am reading in from a .po file. Only text from the database query is mis-encoded.


text:
Q: Enabling bluetooth on Compaq Presario C504EA I have recently installed Ubuntu 14.04 LTS on a Compaq Presario C504EA (wiping off the old Windows Vista install), and I am trying to enable Bluetooth.
I have had a look on rfkill list all, the results are:
0: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
1: hp-bluetooth: Bluetooth
Soft blocked: no
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no

When you open System Settings | Bluetooth, it says Bluetooth is disabled, whether Bluetooth is switched to on or off.
Edit: the results of uname -a; dmesg | egrep -i 'blue|firm'
rob@rob-Presario-C500-RT154EA-ABU:~$ uname -a; dmesg | egrep -i 'blue|firm'
Linux rob-Presario-C500-RT154EA-ABU 4.2.0-36-generic #42~14.04.1-Ubuntu SMP Fri May 13 17:30:34 UTC 2016 i686 i686 i686 GNU/Linux
[    0.103205] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
[   22.560190] Bluetooth: Core ver 2.20
[   22.560311] Bluetooth: HCI device and connection manager initialized
[   22.560319] Bluetooth: HCI socket layer initialized
[   22.560324] Bluetooth: L2CAP socket layer initialized
[   22.560334] Bluetooth: SCO socket layer initialized
[   22.668875] Bluetooth: RFCOMM TTY layer initialized
[   22.668892] Bluetooth: RFCOMM socket layer initialized
[   22.668900] Bluetooth: RFCOMM ver 1.11
[   22.788640] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   22.788647] Bluetooth: BNEP filters: protocol multicast
[   22.788656] Bluetooth: BNEP socket layer initialized
[   31.878953] b43-phy0: Loading firmware version 666.2 (2011-02-23 01:15:07)

Results of lsusb:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Any thoughts? Many thanks

A: On viewing uname -a; lsusb; dmesg | egrep -i 'blue|firm' and lshw on the terminal, there is no mention of Bluetooth capabilities, so it would appear that the Compaq Presario C504EA is one of the models that wasn't Bluetooth enabled.


text:
Q: Calculate % of total - redshift / sql I'm trying to calculate the percentage of one column over a secondary total column.
I wrote:
create temporary table screenings_count_2018 as

select guid,
       datepart(y, screening_screen_date)                          as year,
       sum(case when screening_package = 4 then 1 end)             as count_package_4,
       sum(case when screening_package = 3 then 1 end)             as count_package_3,
       sum(case when screening_package = 2 then 1 end)             as count_package_2,
       sum(case when screening_package = 1 then 1 end)             as count_package_1,
       sum(case when screening_package in (1, 2, 3, 4) then 1 end) as count_total_packages

from prod.leasing_fact

where year = 2018
group by guid, year;

That table establishes the initial count and total count columns. All columns look correct.
Then, I'm using ratio_to_report to calculate the percentage (referencing this tutorial):
create temporary table screenings_percentage as

    select
    guid,
    year,
    ratio_to_report(count_package_1) over (partition by count_total_packages) as percentage_package_1

from screenings_count_2018

group by guid, year,count_package_1,count_total_packages
order by percentage_package_1 desc;

I also tried:
select
    guid,
    year,
    sum(count_package_1/count_total_packages) as percentage_package_1

    -- ratio_to_report(count_package_1) over (partition by count_total_packages) as percentage_package_1

from screenings_count_2018

group by guid, year,count_package_1,count_total_packages
order by percentage_package_1 desc;

Unfortunately, percentage_package_1 just returns all null values (this is not correct - I'm expecting percentages). Neither are working.
What am I doing wrong?
Thanks!

A: Since you are already laid out the columns with components and a total, in creating screenings_count_2018, do you actually need to use ratio_to_report?
select
    , guid
    , year
    , count_package_1/count_total_packages as percentage_package_1
    , count_package_2/count_total_packages as percentage_package_2
    , count_package_3/count_total_packages as percentage_package_3
    , count_package_4/count_total_packages as percentage_package_4
from screenings_count_2018

That should work. NB are you guaranteed to never have count_total_packages be zero? If it can be zero you'll need to handle it. One way is with a case statement.
If you wish for the per-package percentages to appear in a single column, then you can use ratio_to_report -- it is a "window" analytic function and it will be something like this against the original table.
with count_table as (
select guid
       , datepart(y, screening_screen_date) as year
       , screening_package
       , count(1) as count
from prod.leasing_fact
where year = 2018
group by guid
    , datepart(y, screening_screen_date)
    , screening_package
)
select guid
    , year
    , screening_package
    , ratio_to_report(count) over(partition by guid, year, screening_package) as perc_of_total
from count_table

A: you will need round(100.0*count_package_1/count_total_packages,1) and so on as you already calculated the subtotal and total


text:
Q: Should og:image and og:url put in  or ? For og:image and og:url, since they have URL, can I place them in a link tag instead of a meta tag, and is it preferable?
Also what is the difference in using these two tags w.r.t. og:image and og:url?

A: I don't know about other major consumers of the OGP so this might not be a problem for your case, but if you plan to implement it for Facebook,
stick to meta tags.
Doing a quick live test with the open graph debugger and fiddling with the og: tags, it appears that facebook only recognizes them if they are placed in <meta>s.
Try it
If you create an empty HTML file with a single og:url tag in its <head> section, upload it to any URL and run it through the debugger above, both
<link rel="og:url" href="http://www.imdb.com/title/tt0117500/" />

and
<link property="og:url" content="http://www.imdb.com/title/tt0117500/" />

edit or, as suggested in the comments
<link property="og:url" href="http://www.imdb.com/title/tt0117500/" />

will fail to parse and return the original URL, while
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />

parses correctly and returns the contents of The Rock on IMDb instead. At the end of the day semantics are nice, but working code is even better.

A: You must use link instead of meta if the value is a URL.
From the definition of the meta element:

The meta element represents various kinds of metadata that cannot be expressed using the […] link […] elements.

But a URL can of course be expressed using a link element (as it's its purpose).
If you use a meta element for a URL value, RDFa parsers would extract a string value instead of a URL value. This also means that they wouldn't be able to apply relative references against the base URL.
Example
Let's say these elements are in a document with the URL http://example.com/foo:
<link property="schema:url"    href="/bar" />
<meta property="schema:url" content="/bar" />

The value from the link element is the URL http://example.com/bar.
The value from the meta element is the string /bar.
However, in the case of OGP …
The examples in OGP's documentation use the meta element for URL values; there is no example with a link element.
While this means that many of their examples are invalid HTML+RDFa, and RDFa parsers will extract strings instead of URLs in those cases,
it may be the case that Facebook (or any other consumer) isn't actually using RDFa to parse the content, and it may be the case that they don't support link elements.
Note: These are just possibilities, judging from the quality of their documentation. I don't have any experience/insight, as I don't use Facebook. So you might want to test it with Facebook if you care about their OGP-based features.


text:
Q: Java, Spring Framework MVC - redirection I am using spring framework 3.
I have a form for posting comments to the article. When the form is submitted, it is checked if there any errors.
In case there is no errors, controller returns string
"redirect:entryView/"+comment.getEntryId();

And everything is okay.
But when there are some errors, if controller returns
"redirect:entryView/"+comment.getEntryId();

The errors should be displaed near the form with spring-form.tld tags:
<form:errors path="author"/>

But there are no displayed errors!
When i am trying to return
"entryView/"+comment.getEntryId();

Without redirect: prefix, then it is going to /rus/WEB-INF/jsp/entryView/8.jsp and there is HTTP Status 404. But it must go to http://example.com/rus/entryView/8, i.e page where the article and form for comments are!
This is view resolver:
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/jsp/"/>
        <property name="suffix" value=".jsp"/>
</bean>

What should i do?
Rest of controller:
@Controller
public class CommentController {
private RusService rusService;
private CommentValidator commentValidator;
@Autowired
public CommentController(RusService rusService,CommentValidator commentValidator){
    this.rusService = rusService;
    this.commentValidator = commentValidator;
}
@RequestMapping(value="/addComment",method=RequestMethod.POST)
public String addComment(Comment comment,BindingResult result){
    commentValidator.validate(comment, result);
    if(result.hasErrors()){
        return "redirect:entryView/"+comment.getEntryId();
    }else{
        rusService.postComment(comment);
        return "redirect:entryView/"+comment.getEntryId();
    }
}
}

A: The display of errors in <form:errors path="author"/> works like this:

*

*During validation/binding, the Errors are saved as an attribute in the HttpServletResponse object

*The implementation of this JSP tag calls response.getAttribute(name) to find the Errors instance to display

When you use redirect:url, you are instructing Spring to send a 302 Found to the client's browser to force the browser to make a second request, to the new URL.
Since the redirected-to page is operating with a different set of request/response objects, the original Errors is lost.
The simplest way to pass "errors" to a page you want to redirect to in order for the new page to display it would be to handle it yourself, by adding a message to the Session object which the second page's controller can look at (or by passing an argument in the URL).

A: Try using the view of the page of the "add comment" form instead of redirecting to the view that displays the new comment:
if(result.hasErrors()) {
    return "commentForm";
}

You may also have to add @ModelAttribute Comment in the method signature...

A: bkent314 is right:
Have a look at this two method that is a way that defently works.
I separate domain objects from form gui objects (FolderCreateCommand) but that is my style. And in this case I use ModelAndView for return instead of string, because so I have full controll to the model.
@RequestMapping(method = RequestMethod.GET, params = "form")
public ModelAndView createForm() {
    return modelAndViewForCreate(new FolderCreateCommand(..default values..));
}

@RequestMapping(method = RequestMethod.POST)
public ModelAndView create(@Valid FolderCreateCommand folderCreateCommand,
          BindingResult bindingResult) {

    if (bindingResult.hasErrors()) {
        return modelAndViewForCreate(folderCreateCommand);
    }
    Folder folder = this.folderService.createFolder(folderCreateCommand);
    return redirectToShow(folder);
}

private ModelAndView modelAndViewForCreate(FolderCreateCommand folderCreateCommand) {
    ModelMap uiModel = new ModelMap();
    uiModel.addAttribute("folderCreateCommand", folderCreateCommand);
    uiModel.addAttribute("parentFolders", this.folderDao.readAll());
    return new ModelAndView("folders/create", uiModel);
}

private ModelAndView redirectToShow(Folder folder) {
    return new ModelAndView(new RedirectView("/folders/" + folder.getId(), true));
}


text:
Q: Accordion меню на CSS Здравствуйте.
Я хотел бы сделать меню Accordion с помощью CSS.
Блок имеет такую структуру:

                Heading 1

content

                 Heading 2

content2

                 Heading 3

content3

content4

Я набросал примерный CSS, но он естественно не работает.

.accordion a + li{

        height: 0;
        overflow: hidden;

        -moz-transition: height 0.3s ease-in-out;

        -webkit-transition: height 0.3s ease-in-out;

        -o-transition: height 0.3s ease-in-out;

        transition: height 0.3s ease-in-out;

    }

    .accordion :target a + li{

        height: 100px;

    }

Вот как сделать так, чтобы это заработало? Заранее спасибо за любую помощью. )

A:

[id^=acc] {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s;
}

[id^=acc]:target {
  max-height: 100px;
  transition: max-height 0.2s;
}

    Heading 1

content

    Heading 2

content

    Heading 3

content


text:
Q: SVM Algorithm Implementation on Python I have a dataset from Stanford on Movie Reviews - Movie Review Dataset. It has both training data and testing data - all of them are text files in 2 folders - positive and negative.
How do I implement text classification using SVM algorithm on it? (Using a Python Library)

A: Check scikit-learn, it's a great machine learning framework. Have a look at Working With Text Data Classification of text documents using sparse features example, Feature extractions.
There is also NTLK, but it's not very powerful in ur case, check this thread for more details.


text:
Q: Selecting elements inside a frame with a dynamic src and NO id I am trying to select a value in a dropdown which is inside a iFrame. The frame contains no id but has a src that is dynamic.
/MyApplicantPortal/Applicant/244029/SelectOrderTemplate?t=1

HTML:
<html class = ......>

    .
    .
    .

the number 244029 changes and because of this, I am not able to identify the objects inside the frame. The iframe is the child of the div.
My code is
in_frame(:src => 'MyApplicantPortal/Applicant/244025/SelectOrderTemplate?t=1') do |frame|
select_list(:template, :id => 'selectlisname', :frame => frame)

end

A: Solution 1 - Using a regexp
Contrary to my initial assumption, the in_frame method does not support locating a frame using regular expressions (Issue 197). However, it is possible to monkey patch the functionality in. Where you require page-object, add the following code to monkey match the nested_frames method.
require 'watir-webdriver'
require 'page-object'
module PageObject
  module Platforms
    module WatirWebDriver
      class PageObject
        def nested_frames(frame_identifiers)
          return if frame_identifiers.nil?
          frame_str = ''
          frame_identifiers.each do |id|
            value = id.values.first
            if value.is_a?(Regexp)
              frame_str += "frame(:#{id.keys.first} => #{value.inspect})."
            else
              frame_str += "frame(:#{id.keys.first} => #{value})." if value.to_s.is_integer
              frame_str += "frame(:#{id.keys.first} => '#{value}')." unless value.to_s.is_integer
            end
          end
          frame_str
        end
      end
    end
  end
end

This then allows you to use a regular expression to define the src of the frame (when using in_frame):
class MyPage
  include PageObject

  in_frame(:src =>  /MyApplicantPortal\/Applicant\/\d+\/SelectOrderTemplate\?t=1/) do |frame|
    select_list(:template, :id => 'selectlisname', :frame => frame)
  end
end

Note that in a regexp, you need to escape the characters \*?{}.. The \d+ part means that any number will be matched.
Solution 2 - Define a frame_element
If you do not want to monkey patch the page object gem, then you could:

*

*Define the frame element (using the regular expression)

*Use a block, which references the frame element, to define the select list

This would look like:
class MyPage
  include PageObject

  element(:select_order, :frame, :src => /MyApplicantPortal\/Applicant\/\d+\/SelectOrderTemplate\?t=1/)
  select_list(:template){ select_order_element.select_list_element(:id => 'selectlisname') }
end


text:
Q: Django: 'User' object does not support indexing I have been incurring the problem:

'User' object does not support indexing

ever since I changed from a ForeignKey to a ManyToManyField for to get Users:
user = models.ManyToManyField(User) # Was ForeignKey before

Here is my views.py file:
if form.is_valid():
    instance = form.save(commit=False)
    instance.user = request.user # The problem I'm guessing
    instance.offered_fund = default_state
    instance.save()

I tried to follow the instructions found here with no success. Additionally I am using Python3 if that has anything to do with the problem. Any ideas on how I can solve this? Thanks

A: instance.user = request.user

Well, user is ManyToManyField, you couldn't just just assign it to model, because it's "set" of models.
Don't you want to do this one instead?
instance.user.add(request.user)

A: First you need this line of code to add user to your objects.
instance.user.add(request.user)

instead of
instance.user = request.user

But, you also need to run some changes to convert the current foreign key user to new M2M user data.
So i would suggest following steps to do first:
1.) Make a new M2M relationship and keep the existing foreign key also.
user = models.ForeignKey(User)
users = models.ManyToManyField(User)

2.) Migrate DB Now.
python manage.py makemigrations
python manage.py migrate

3.) Run following code from terminal to migrate data.
for obj in Model.objects.all():
    obj.users.add(obj.user)

4.) Delete the old user field ( Also change users to user, if you wish, but i would recommend to use as users to reflect plurality. Migrate again.
5.) Make the necessary changes in code like at top to add or process users instead of user.


text:
Q: How to show last reached Activity When open Application? User plays game.Then user click backkey to home.Then user replays game.I want to
show user  last used screen.

A: This is a basic problem about saving data in android in fact.
Referring to android saving data training, you can use the way you like to saving data. For you, the data is about which activity, what is on this activity. In your condition, I recommend you to use SharedPreferences API.
You can use the method onPause() do something about saving data such as your activity name, for example, com.x.x.XXActivity, then in your MainActivity(Which means that the activity will be launched first) start this activity by Intent.
This all.


text:
Q: How do I access deeply embedded json objects from a go map object? I am new to go and I understand how to marshall json data into custom predefined Struct types but I'm currently working with a JSON set that can have dynamic keys & values with every call.  I can marshall this dynamic data into a map/interface no problem but I'm a little lost with how to access the item that are deeply nested in an array.
Here is sample JSON that I'm working with from the USDOL website
    {
    "name": "osha-establishment",
    "count": 15,
    "frequency": "Manual Crawl",
    "version": 4,
    "newdata": true,
    "lastrunstatus": "success",
    "lastsuccess": "Mon Dec 08 2014 11:19:57 GMT+0000 (UTC)",
    "thisversionstatus": "success",
    "results": {
                    "est_search": [
                                    {
                                    "est_name": "Chipotle Mexican Grill",
                                    "state": "MN",
                                    "activity": {
                                        "href": "https://www.osha.gov/pls/imis/establishment.inspection_detail?id=317911832",
                                        "text": "317911832"
                                    },
                                    "opened": "11/20/2014",
                                    "rid": "0552700",
                                    "type": "Complaint",
                                    "sc": "Partial",
                                    "sic": {
                                        "href": "https://www.osha.gov/pls/imis/sic_manual.display?id=44&tab=description",
                                        "text": "5812"
                                    },
                                    "naics": "722110",
                                    "vio": ""
                                    },
                                    {
                                    "est_name": "Chipotle Mexican Grill, Inc.",
                                    "state": "AZ",
                                    "activity": {
                                        "href": "https://www.osha.gov/pls/imis/establishment.inspection_detail?id=317801066",
                                        "text": "317801066"
                                    },
                                    "opened": "07/14/2014",
                                    "rid": "0950411",
                                    "type": "Complaint",
                                    "sc": "Partial",
                                    "sic": {
                                        "href": "https://www.osha.gov/pls/imis/sic_manual.display?id=44&tab=description",
                                        "text": "5812"
                                    },
                                    "naics": "722211",
                                    "vio": "2"
                                    }
                                ]
                }
    }

I'd like to access the values of the sic keys in this JSON set.
Here is my broke go code:
package main

    import (
        "encoding/json"
        "log"
        "net/http"
    )

    func main() {
        resp, err := http.Get("https://www.kimonolabs.com/api/2oowt0xq?apikey=")

        if err != nil {
            // handle error
        }
        defer resp.Body.Close()

        var result map[string]interface{}

        dec := json.NewDecoder(resp.Body)
        if err := dec.Decode(&result); err != nil {
            // handle error
            log.Println("This is an error")
        }

        log.Println(result["results"].(map[string]interface{})["est_search"], err)

    }

Any help showing me how to access the sic values would be greatly appreciated.

A: To decode JSON into an interface value, Decode stores one of these in the interface value:
1. bool, for JSON booleans
2. float64, for JSON numbers
3. string, for JSON strings
4. []interface{}, for JSON arrays
5. map[string]interface{}, for JSON objects
6. nil for JSON null

According to rules above,

*

*result["results"].(map[string]interface{})["est_search"] is
[]interface{} from JSON array (rule 4).

*iterate over
result["results"].(map[string]interface{})["est_search"].([]interface{}), each item is map[string]interface{} from JSON object (rule 5).

Here is the example code, I ran it and it seems to work with that URL;
package main

import (
    "fmt"
    "encoding/json"
    "net/http"
)

func main() {
    resp, err := http.Get("https://www.kimonolabs.com/api/2oowt0xq?apikey=DTgSLPbfOPauuLCXTws5jquLQd0V7kBB")

    if err != nil {
        // handle error
    }
    defer resp.Body.Close()

    var result map[string]interface{}

    dec := json.NewDecoder(resp.Body)
    if err := dec.Decode(&result); err != nil {
        // handle error
        fmt.Println("This is an error")
    }

    for _, item := range result["results"].(map[string]interface{})["est_search"].([]interface{}) {
        fmt.Println(item.(map[string]interface{})["sic"])
    }
}


text:
Q: Reading a mipmap resource for a specific density How can I read bytes from a specific mipmap image? For example, I'm trying to read bytes from ic_launcher.png that's located at mipmap-xxhdpi

Here is what I'm trying to do:
InputStream ins = getResources().
            openRawResource(getResources().
                    getIdentifier("ic_launcher.png",
            "mipmap-xxhdpi", getPackageName()));

But I get an exception saying that the resource was not found. What is the right way to do it? I want to read the file in mipmap-xxhdpi particularly

A: you can get that specific drawable for xxhdpi with
ResourcesCompat.getDrawableForDensity(getResources(), R.mipmap.ic_launcher, DisplayMetrics.DENSITY_XXHIGH, getTheme());

after that you could make a bitmap a compress it back to png
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
drawable.draw(new Canvas(bitmap));

ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] pngBytes = stream.toByteArray();


text:
Q: iterate through function arguments supposede to be lists python I try to write a long program in python
the first part is:
def frequence(entranche):
podium = []
for item in entranche:
    scat = len(entranche)
    for indice in range (len(entranche)):

        if entranche[indice] == item:
            scat -= 1
        frequence = len(entranche) - scat
        podium = podium.append(frequence)
    plus_haute_frequence = max (podium)
    return(plus_haute_frequence)

print(frequence(("Je suis né dans le béton Coincé entre deux maisons  Sans abri sans domicile"
 ).split()))
How would the program treat "entranche" as list?

A: You didn't call the split method.
entranche = poeme.split()

A: entranche = poeme.split is a function, not a list. You forgot the parenthesis, which do the actual call to the function entranche = poeme.split() and returns a list.

A: If entranche would be a list, you wouldn't see that error. So, check what entranche really is. Check its type(), or just print it.
You'll find your error here:
entranche = poeme.split

That should be:
entranche = poeme.split()

A: there is noway to precise my question
Folowing xph I try this
def frequence(entranche):
    podium = []
    print("premier podium", type(podium))
    for item in entranche:
        print ("deuxieme podium", type(podium))
        scat = len(entranche)
        for indice in range (len(entranche)):
            if entranche[indice] == item:
                scat -= 1
            frequence = len(entranche) - scat

        podium = podium.append(frequence)
        print("troisieme podium", type(podium))
        plus_haute_frequence = max(podium)
    return(plus_haute_frequence)
print(frequence("Je suis né dans le béton Coincé entre deux maisons".split()))

and I get a big surprise!
premier podium <class 'list'>
deuxieme podium <class 'list'>
troisieme podium <class 'NoneType'>

What is iT??


text:
Q: Cannot unpause game when bringing app back to Foreground SpriteKit is automatically pausing my app when it goes into the background.  This is fine, except it stays paused when the app becomes active again. I'm trying to un-pause the game in the appropriate application events, to no avail. I'm manually un-pausing the two SKViews and the game Scene that constitute the app. From inside the AppDelegate file:
func applicationWillEnterForeground(application: UIApplication) {

    if let vw = self.window?.rootViewController {
        let gc = vw as! GameViewController
        let parView = gc.view as! SKView
        parView.paused = false
        gc.gameView.paused=false
        gc.gameScene.paused=false
        println("paused = \(gc.gameScene.paused)")

    }

}

func applicationDidBecomeActive(application: UIApplication) {

    if let vw = self.window?.rootViewController {
        let gc = vw as! GameViewController
        let parView = gc.view as! SKView
        parView.paused = false

        gc.gameView.paused=false
        gc.gameScene.paused=false
        println("paused = \(gc.gameScene.paused)")

    }

}

At the end I print the pause state. If I hit the device's Home key and then return to the app, it prints false as desired. However, somewhere (not by my code) this is being immediately set back to true, and the game remains paused.
Update
I overrode the scene's paused property, and it is definitely being set back to true after I un-pause in the given events. Confusing, because from reading other questions, the typical behavior of sprite kit is to automatically un-pause the game when the app is reactivated. Yet it's doing the exact opposite for me.

A: Well, I basically gave up on trying to control whether the game pauses/resumes during the app's state changes. Instead I overrode the scene's paused property, so now I can just detect whenever sprite kit decides to pause or resume, and handle that accordingly.  My suspicion is that my hierarchy of SKViews in my app might not be conventional, and maybe caused sprite kit difficulty in controlling the scene state, but that's only a guess.


text:
Q: Cumulative Sum of a column based on values in another column? I have a data frame similar to this one, I would like to get the cumulative sum of the column "Number" until column Name is equal to "AAAA".
So basically, I would like to get the cumulative sum of the column 'Number' between each 'AAAA'. So the sum starts again each time we have 'AAAA' in the column.
Is there a way I can do that?
data = {'Name':  ['AAAA','B','C','D','E','AAAA','O','C','D','E','AAAA','D', 'C','D','E','AAAA','B','C','D','E','AAAA','L','M'],
    'Number': [7,8,9,10,1,1,2,34,5,6,7,8,9,10,1,1,7,8,2,3,5,6,7]
    }

df = pd.DataFrame (data, columns = ['Name','Number'])
df['Sum_Cummulative']=df['Number'].cumsum()

A: Use GroupBy.cumsum with helper Series created by compare Name with Series.cumsum:
df['Sum_Cummulative']=df.groupby(df['Name'].eq('AAAA').cumsum())['Number'].cumsum()
print (df)
    Name  Number  Sum_Cummulative
0   AAAA       7                7
1      B       8               15
2      C       9               24
3      D      10               34
4      E       1               35
5   AAAA       1                1
6      O       2                3
7      C      34               37
8      D       5               42
9      E       6               48
10  AAAA       7                7
11     D       8               15
12     C       9               24
13     D      10               34
14     E       1               35
15  AAAA       1                1
16     B       7                8
17     C       8               16
18     D       2               18
19     E       3               21
20  AAAA       5                5
21     L       6               11
22     M       7               18


text:
Q: PowerShell: Passing an ArrayList of Objects into another Script as an Argument I am trying to pass an ArrayList that contains objects into another PowerShell script to execute something further.
The error message that I am receiving is:

"Cannot process argument transformation on parameter 'al'. Cannot convert the "System.Collections.Hashable System.Collections.Hashable System.Collections.Hashable" value of type "System.String" to type "System.Collections.ArrayList""

In script1.ps1:
$al = New-Object System.Collections.ArrayList

...

$obj =  @{"var1"="apple"; "var2"="banana"; "var3"="carrot";}
$al.Add($obj)

...

foreach ($i in $al) {
    $temp = $($i.var1)
    write-host "$temp"     #outputs "apple" correctly
}

invoke-expression -Command "script2.ps1 -al '$al'"

In script2.ps1:
param ([System.Collections.ArrayList]$al)

...

foreach ($i in $al) {
    $temp = $($i.var1)
    write-host "$temp"     #error message
}

A: For a reason that I'm not familiar with, Invoke-Expression is converting your ArrayList to a HashTable. If you really need an ArrayList in script2.ps1, you can make $al a global variable (see below).
Updated script1.ps1
$al = New-Object System.Collections.ArrayList
$obj = @{"var1" = "apple"; "var2" = "banana"; "var3" = "carrot"; }
$al.Add($obj)

foreach ($i in $al) {
    $temp = $($i.var1)
    write-host "$temp"
}

$Global:al = $al

invoke-expression -Command "$PSScriptRoot\script2.ps1"

Updated script2.ps1
param()

$Global:al.GetType().FullName

foreach ($i in $Global:al) {
    $temp = $($i.var1)
    write-host "$temp"
}


text:
Q: How to limit the scope of a CSS reset? I want to use a CSS reset in my app, but my app has the requirement of eventually being embeddable in other apps as a component, so I don't want to do a global reset because it might affect my parent app.
For example, here's a portion of Eric Meyer's reset (edited for brevity):
div, span,h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, em, img, ins, kbd,
q, s, b, u, i, ul, li, form, label, legend, table, caption {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    vertical-align: baseline;
}

My first idea to constrain this reset to children of my main component node is to use decendant selectors. Let's say my app is called "foo":
.foo div, .foo span, foo h1, .foo h2, .foo h3, .foo h4, .foo h5, .foo h6, .foo p, .foo blockquote,
.foo pre, .foo a, .foo em, .foo img, .foo ins, .foo kbd, .foo q, .foo s, .foo b, .foo u, .foo i,
.foo ul, .foo li, .foo form, .foo label, .foo legend, .foo table, .foo caption  {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    vertical-align: baseline;
}

The problem I'm having is that this wins the specificity fight on almost everything in my app.
For instance:
.huge-red-border {
    border: 10px solid red;
}

        I should have a huge red border, but I don't
        because ".foo div" takes precedent over ".huge-red-border".

I can't add !important to every one of my rules (because I need that distinguisher to have meaning within my rules).
Any ideas on how to solve this?

A: It is a specificity and cascade issue.
You can overcome it by putting your preferred elements further down in the stylesheet and boosting their specificity:

.foo div {     /* specificity points: 11 */
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
}
div.huge-red-border {    /* specificity points: 11 */
  border: 10px solid red;
}

    I should have a huge red border, but I don't because ".foo div" takes precedent over ".huge-red-border".

Here's another method that allows you to keep boosting specificity using the :not() pseudo-class:

.foo div {   /* specificity points: 11 */
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
}
.huge-red-border:not(html):not(body) { /* specificity points: 12 */
  border: 10px solid red;
}

    I should have a huge red border, but I don't because ".foo div" takes precedent over ".huge-red-border".

From the spec:

6.6.7. The negation
  pseudo-class
The :not() pseudo allows useless selectors to be written.
For instance :not(*|*), which represents no element at all, or
  foo:not(bar), which is equivalent to foo but with a higher
  specificity.


text:
Q: Getting String in Text I can't seem to figure out exactly how to get a certain portion of text I need out of a larger block. I need to be able to grab a string between a : and a ( in a regular block of text while parsing an email. An example is below. I know a bit about preg_match and I figured that was the answer, but can't seem to get that to work either. Any help would be appreciated as searches of here and Google have turned up nothing.
For GC3J26P: Wise Lake II (Traditional)
I need just the text between the : and the beginning parentheses. Thanks for any help.

A: Since you say you've tried and not managed to get anything going, try this:
$str = "For GC3J26P: Wise Lake II (Traditional)";
preg_match('/(?<=:).*(?=\()/', $str, $str);
if ($str) echo $str[0];

If you're new to the murky - yet beautiful - world of REGEX, allow me to explain what's happening here.
It's all about the pattern. Our pattern defines what is and is not acceptable in what we match - i.e. capture.
More than that, it even states what should immediately precede and procede our match. These are called look-behind and look-ahead assertions, respectively. These assertions are anchors for our matching points - they do not contribute to the captured match itself.
So our pattern translates as:
1) begin the match after a colon (but do not include the colon in the match)
2) then allow and capture any character (barring line breaks and certain other spacial characters), zero or more times
3) match up to (but not including) an opening bracket
Our pattern is what's called greedy. In our case, this means that, should the sub-string you wish to match itself contain a colon or bracket, this will be no problem and won't break things. As long as there is a valid match available starting from SOME colon, and up to SOME opening bracket, all's fine. (Note: greedy behaviour can be modified, if required).
There's far, far more to REGEX and you either love it hate it. If you're interested, I suggest reading up on it. It's very satisfying once you get into it.
And with that, it's bed time.

A: You can try this:
$string = 'For GC3J26P: Wise Lake II (Traditional)';

preg_match('/\:(.*?)\(/', $string, $matches);

echo $matches[0]; // : Wise Lake II (
echo $matches[1]; // Wise Lake II

A: Here it is:
I used a 'named sub-pattern' (named it "name", but could be called almost anything)...
$str="For GC3J26P: Wise Lake II (Traditional)";
preg_match('/:(?P<name>[\S\s]+)\(/', $str, $matches);
echo $matches["name"];


text:
Q: How to solve this emulator: ERROR: x86 emulation currently requires hardware acceleration After installing android-studio-bundle-141.2456560-windows.exe in Windows 7 32 bit ultimate (6.1 build 7600)
I'm getting HAXM error while run emulator, I have exercised all the possible ways like,

*

*Installing INTEL HAXM  hardware accelerator through SDK manager I have uploaded a screenshot of this.

*I have unchecked HYPER V option in turn on and off features

*When I try to install HAXM from android SDK extras shown in screen shot

*Note that I don't have Virtualization option in my BIOS setup if we consider that some advanced SoC will internally takes care about this virtualization

!!!But still android emulator is throwing the error

A: According to Intel's website, the Core 2 Duo E7200 does not support VT-x
Intel ARK
Unfortunately you cannot run HAXM without vt-x. This means either you'll have to try a different emulation method or use a real android device. Using a real android device will always give you the best results, so I recommend going that route.

A: if you have not installed intel x86 Emulator Accelerator (HAXM installer) then you need to install it from tools -> SDK Manager there you will find this HAXM installer
if it has been already installed then also the same issue is arising then go to the folder where SDK is stored for me it is
D:\sdk\extras\intel\Hardware_Accelerated_Execution_Manager
and then run silent_install with administrator permission
and you are ready to go..!!!

A: *

*First, uninstall your "intelhaxm-android.exe".

*go to the BIOS and enable "Intel(R) Virtuallzation Technology".

*again install "intelhaxm-android.exe".

*create a new Virtual device and run.