text:
Q: RelativeLayout layout_alignBottom of TextView doesn't work properly Trying to do some alignment by a flexible TextView, in a RelativeLayout container that may vary in height.
Seems like no brainer, and yet, it doesn't align anywhere near where it should.
The following simple code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

<-- Stands for any view that would force minimum height, e.g. an avatar image -->
<View
    android:layout_width="10dp"
    android:layout_height="73dp"
    android:background="#300f"/>

<TextView
    android:id="@+id/t1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:text="ceterum censeo carthaginem esse delendam"/>

<View
    android:layout_width="40dp"
    android:layout_height="wrap_content"
    android:layout_alignTop="@+id/t1"
    android:layout_alignBottom="@+id/t1"
    android:background="#6f00"/>

</RelativeLayout>

This is the result:

One may obviously expect that the red rectangle would align vertically with the text. But it doesn't.
What has gone wrong?...

A: It has to do with you relative layout height is set to wrap_content.
from RelativeLayout documentation:

Note that you cannot have a circular dependency between the size of
  the RelativeLayout and the position of its children. For example, you
  cannot have a RelativeLayout whose height is set to WRAP_CONTENT and a
  child set to ALIGN_PARENT_BOTTOM.

So either you set that height to match_parent or, easier, like Ahamed wrote
add android:layout_centerVertical="true" to your red color layout

A: user  android:layout_below="@id/id"
<View
    android:layout_width="40dp"
    android:layout_height="wrap_content"
    android:layout_alignTop="@+id/t1"
  android:layout_below="@+id/t1"
    android:background="#6f00"/>

I hope It's work

A: try using the attribute "android:layout_below". For example:
...
<View android:id="@+id/v1"
    android:layout_width="10dp"
    android:layout_height="73dp"
    android:background="#300f"/>

<TextView
    android:id="@+id/t1"
    android:layout_below="@+id/v1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:text="ceterum censeo carthaginem esse delendam"/>

...

A: Please try this below.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <View android:id="@+id/some_view_id"
        android:layout_width="10dp"
        android:layout_height="73dp"
        android:background="#300f"/>

    <TextView
        android:id="@+id/t1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_below="@id/some_view_id"
        android:text="varying text view here that can \n go for multiple lines and not disturb the one below"/>

    <View
        android:layout_width="40dp"
        android:layout_height="wrap_content"
        android:layout_below="@id/t1"
        android:background="#6f00"/>
</RelativeLayout>

A: Try this code it may solve your problem:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff" >

<View
    android:layout_width="10dp"
    android:layout_height="73dp"
    android:background="#300f" />

<TextView
    android:id="@+id/t1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:text="ceterum censeo carthaginem esse delendam" />

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <View
        android:layout_width="10dp"
        android:layout_height="73dp"
        android:background="#6f00" />
</LinearLayout>

</RelativeLayout>

A: Use android:layout_toEndOf  like this
<TextView
    android:id="@+id/t1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:text="ceterum censeo carthaginem esse delendam"/>

<View
    android:layout_width="40dp"
    android:layout_height="wrap_content"
    android:layout_toEndOf="@+id/t1"
    android:layout_alignBottom="@+id/t1"
    android:background="#6f00"/>

A: Try this solution. hope this helps.
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <View
       android:layout_width="10dp"
       android:layout_height="73dp"
       android:background="#300f"/>
    <RelativeLayout
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_centerVertical="true">

      <TextView
         android:id="@+id/t1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="ceterum censeo carthaginem esse delendam"/>

      <View
         android:layout_width="40dp"
         android:layout_height="wrap_content"
         android:layout_alignTop="@+id/t1"
         android:layout_alignBottom="@+id/t1"
         android:background="#6f00"/>
   </RelativeLayout>

 </RelativeLayout>


text:
Q: Spark is crashing when computing big files I have a program in Scala that read a CSV file, add a new column to the Dataframe and save the result as a parquet file. It works perfectly on small files (<5 Go) but when I try to use bigger files (~80 Go) it always fail when it should write the parquet file with this stacktrace :
16/10/20 10:03:37 WARN scheduler.TaskSetManager: Lost task 14.0 in stage 4.0 (TID 886, 10.0.0.10): java.io.EOFException: reached end of stream after reading 136445 bytes; 1245184 bytes expected
  at org.spark_project.guava.io.ByteStreams.readFully(ByteStreams.java:735)
  at org.apache.spark.sql.execution.UnsafeRowSerializerInstance$$anon$3$$anon$1.next(UnsafeRowSerializer.scala:127)
  at org.apache.spark.sql.execution.UnsafeRowSerializerInstance$$anon$3$$anon$1.next(UnsafeRowSerializer.scala:110)
  at scala.collection.Iterator$$anon$12.next(Iterator.scala:444)
  at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
  at org.apache.spark.util.CompletionIterator.next(CompletionIterator.scala:30)
  at org.apache.spark.InterruptibleIterator.next(InterruptibleIterator.scala:43)
  at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
  at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source)
  at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
  at org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$8$$anon$1.hasNext(WholeStageCodegenExec.scala:370)
  at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:408)
  at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:161)
  at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:79)
  at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:47)
  at org.apache.spark.scheduler.Task.run(Task.scala:86)
  at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)

If anyone know what could cause this, that would help me a lot !
System used

*

*Spark 2.0.1

*Scala 2.11

*Hadoop HDFS 2.7.3

All running in Docker in a 6 machine cluster (each 4 cores and 16 Go of RAM)
Example code
var df = spark.read.option("header", "true").option("inferSchema", "true").option("nullValue", "NULL").csv(hdfsFileURLIn)
df = df.withColumn("ipix", a2p(df.col(deName), df.col(raName)))
df.repartition(nPartitions, $"ipix").write.mode("overwrite").parquet(hdfsFileURLOut)

A: Here are few points that might help you:

*

*I think you should check distribution of your ipix column data, it might happen that you have data skew, so 1 or few partitions might be much bigger than other. Those fat partitions might be such that 1 task that is working on the fat partition might fail. It probably has something to do with output of your function a2p. I'd test first to run this job even without repartitioning(just remove this call and try to see if it succeeds - without repartition call it will use default partitions split probably by size of input csv file)

*I also hope that your input csv is not gzip-ed(since gzip-ed data it's not splittable, so all data will be in 1 partition)

A: Can you provide code?
perhaps the code you wrote are running on driver? how do you process the file?
there is a special Spark functionality of handling big data, for example RDD.
once you do:
someRdd.collect()

You bring the rdd to the driver memory, hence not using the abilities of spark.
Code that handles big data should run on slaves.
please check this : differentiate driver code and work code in Apache Spark

A: The problem looks like the read failed when decompress a stream of shuffled data in YARN mode.
Try the following code and see how it goes.
var df = spark.read.option("header", "true").option("inferSchema", "true").option("nullValue", "NULL").csv(hdfsFileURLIn)
df = df.withColumn("ipix", a2p(df.col(deName), df.col(raName))).persist(StorageLevel.MEMORY_AND_DISK)
df.repartition(nPartitions, $"ipix").write.mode("overwrite").parquet(hdfsFileURLOut)

There is also a similar issue Spark job failing in YARN mode

redpajama_set_name: RedPajamaStackExchange


text:
Q: Change Cordova plugin language on iOS I'm building an app with Cordova 3.5 on iOS 7, and it's not for native English user. So I want change the plugin language, like "Use", "Retake" in camera, or "Done" on keyboard. I can't find any setting or option in Cordova doc, how to do that?

A: I don't think that is provided in Cordova. Instead, you can do it in your Xcode project settings. In your project, select Info → Localization native development region and change it to your desired language.

A: In your config.xml in the codrdova project, under the  tag add this:
<edit-config file="*-Info.plist" mode="merge" target="CFBundleDevelopmentRegion">
            <string>Your_Language</string>
 </edit-config>

It will create an entry in the .plist file
<key>CFBundleDevelopmentRegion</key>
    <string>German</string>

of the ios project generated during the ionic cordova build ios process


text:
Q: how to rewrite main domain to sub folder without changing url? I want to rewrite sub folder such as http://example.com/new to http://example.com with .htaccess
My site contents and files are in /new directory and I want the /new does not appears to users and user see the example.com without /new but load the files from /new directory.
I search very much but I couldn't find any things.
Are you have any solution to my problem?
Best regards.

A: Very complicated what you want to do, is not more easy move all your actual /new to the root?


text:
Q: CSS Text Shake Only Inside DIV containing countdown timer I have countdown timer on my site.
The text inside the container of countdown timer is acting weird something like font-weight is on & off a bit.
This doesn't happen if position is not absolute or outside elements.
See here:
http://jsfiddle.net/sakibanda/7qcrpq0x/1/
.last_sold {
  position: absolute;
  top: 90px;
  right: 0px;
  -ms-transform: rotate(90deg);
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
  color: #000;
  width: 120px;
  text-align: center;
  background-color: #FC6;
  font-size:12px;
}

A: I think this will solve your problem
CSS:
.main-example .count.top{
    line-height: 3em  !important;
}

Hope it helps.
By the way here's an updated fiddle

A: Well I just wrapped your .last_sold inside one more div with some style and position:absolute and yea it works and hope this is what you want!!
DEMO
HTML

          SHAKING INSIDE DIV

CSS
.oneMore{
    position:absolute;
    top: 0px;
  right: 0px;
}


text:
Q: Python metronome with twisted: How to pass parameter for iteration? I wanted to build a metronome in Python.
I have 2 sound files. Every second the first sound file should played and every fourth second the second sound file should played.
I found the twisted module, but couldn't figure out how to pass an parameter and iterate it. So I have the variable counter which I want to iterate, but it's not working with following code:
import simpleaudio as sa
from twisted.internet import task
from twisted.internet import reactor

def beat(bpm, counter):
    timeout = 60/bpm
    l = task.LoopingCall(play_beat, counter=counter)
    l.start(timeout)
    reactor.run()

def play_beat(counter):
    counter += 1
    print(counter) #This prints always 2, I am expecting an iteration like 2, 3, 4, 5, 6 ...
    if counter % 4 == 0:
        wave_obj = sa.WaveObject.from_wave_file("wav/beat_end.wav")
    else:
        wave_obj = sa.WaveObject.from_wave_file("wav/beat_start.wav")
    play_obj = wave_obj.play()
    play_obj.wait_done()
    pass

beat(60, 1)

A: Here's another solution.
import simpleaudio as sa
from twisted.internet import task
from twisted.internet import reactor

def beat(bpm, wave_obj):
    timeout = 60.0 / bpm
    l = task.LoopingCall(play_beat, wave_obj)
    l.start(timeout)

def play_beat(wave_obj):
    wave_obj.play()

beat_start = sa.WaveObject.from_wave_file(...)
beat_end = sa.WaveObject.from_wave_file(...)

bpm = 60.0
bps = bpm / 60
reactor.callLater(0 / bps, beat, bpm / 4, beat_start)
reactor.callLater(1 / bps, beat, bpm / 4, beat_start)
reactor.callLater(2 / bps, beat, bpm / 4, beat_start)
reactor.callLater(3 / bps, beat, bpm / 4, beat_end)
reactor.run()

It may be noteworthy that I've removed the wait_done call.  If you block the reactor thread like that, you can expect less reliable scheduling of time-based events.


text:
Q: Mac | Scala terminal error while trying to compile I just started learning scala, I installed it through "brew install scala" and when I type scala MYSCRIPT.scala or scalac MYSCRIPT.scala I get this error:
scala> scalac hello.scala
<console>:1: error: ';' expected but '.' found.
scalac hello.scala

I've tried looking for a solution to this but found nothing,
Please help.

A: OK I got it I have to write "scala" keyword outside of the scala terminal while trying to compile.
So instead of what I was doing which was typing "scala" to bring up the scala interpreter and then again writing scala MYSCRIPT.scala I have to skip the first step which was opening the scala interpreter.
Post can be removed.


text:
Q: Frequency dependent regularization of an ill-conditioned matrix A x = b
This is a frequency dependent problem, where the interested frequency range is 1-300 Hz.
A is a square matrix of 246 by 246, and it consists elements that are dependent on $\omega^2$, and the rest of the elements are either zero or have constant non-zero value. The unknown x is a response vector that is made up by displacement and pressure that have order relation of O(3) ~ O(5) between them depending on the frequency.
For the matrix A, condition number is around $10^7$, with the first 43 eigenvalues are considerably larger than the rest ~O(6).
In this problem, when $\omega$ is larger than 100 Hz, the resonance and anti-resonance frequencies deviates significantly from the FEA-predicted result. I would like to use a regularization technique, which is frequency dependent, to compensate the effect of ill-conditioning.
I have checked the following thread, but I couldn't find a use for the proposed solution where it uses discrete fourier transform.
Regularization of underdetermined system to favour low frequency solutions?
If I were to use Tikhonov regularization, how would I go on to implement a frequency dependent $\Gamma$? Or what would be the computationally efficient alternative ?


text:
Q: Calling a template member function having existing name please see the following code:
namespace std {
    template <std::size_t I, class T>
    auto& get(my_tuple_like_type<T>& t)
    {
        std::size_t ext = t.template extent<I>(); // This line
        // .... do something with ext and return
    }
}

As you can see, I'm trying to specialize (overload) std::get to make my own class template my_tuple_like_type somewhat std::tuple-like.
But gcc 5.4.0 complains that the constant I is not a type name. It seems that the reason is there is already a name std::extent which is a class template.
A workaround I can think of is to forward the call to a free-standing implementation function declared outside namespace std. But I wonder, is this the right behavior according to the standard? Or is it just another bug of gcc?
I guess this should be a bug, since clang and MSVC both compile the above code just fine. On the other hand, Nvidia's CUDA compiler (nvcc) produces a similar error message.
Thank you.
EDIT:
Providing overloads inside namespace std is forbidden (Should you overload swap in the std namespace?), so I was doing a wrong thing.
But I can't see potential problems this may induce. Is there any reason why overloadings on user-defined types are forbidden?


text:
Q: Guidance Automation Extensions for VS 2017 In our project, we using GAX for making SCSF Templates, until now we used visual studio 2015,
today we upgraded our development environment and started to use Vs 2017, I tried to search for a proper version for GAX but without success, there is one that I can download or we stack?
maybe there is an alternative way that similar to cab architecture for creating a WinForms application?
Thanks.

A: found half solution for my problem, ..
Thanks to johnx7271 that upgrade the GAT/GAX that will work with Visual Studio 2017 - LINK
but I still stuck with adding SCSF templates (found only until vs 2015)


text:
Q: SQL: How to select unique rows with duplicate items Our customer feeds us contracts with duplicate items.  We advertise unique products.  How could I select a distinct set of upcs with descriptions without doing many sub queries?  Horrible example:
/*
eventID     int
groupID     int            // This field is different between fields
upc_ean     numeric(18,0)
description varchar(512)   // Description is slightly different but same info
size        varchar(512)   // Size is slightly different but same info
*/

select A.eventid, A.upc_ean,

       ( select top 1 description
         from myTable B
         where B.eventid = A.eventid and B.upc_ean = A.upc_ean) as description,

       ( select top 1 size
         from myTable B
         where B.eventid = A.eventid and B.upc_ean = A.upc_ean) as size

from ( select distinct eventid, upc_ean from myTable) A

Is there any way to do the same thing without sub-queries, somehow joining the two together that doesn't breed records or show duplicates using eventid and upc_ean as a PK?

A: You might be able to do something like this:
SELECT A.eventid, A.upc_ean, MAX(description) as description, MAX(size) as size
FROM myTable
GROUP BY eventid, upc_ean

You should get similar results.

A: You can add an ORDER BY clause if necessary to the OVER portion of the following if necessary.
Using a CTE:
WITH example AS (
  SELECT a.eventid,
         a.upc_ean,
         a.description,
         a.size,
         ROW_NUMBER() OVER(PARTITION BY a.eventi, a.upc_ean) AS rank
    FROM YOUR_TABLE a)
SELECT x.eventid,
       x.upc_ean,
       x.description,
       x.size
  FROM example x
 WHERE x.rank = 1

Without the CTE:
SELECT x.eventid,
       x.upc_ean,
       x.description,
       x.size
  FROM (SELECT a.eventid,
               a.upc_ean,
               a.description,
               a.size,
               ROW_NUMBER() OVER(PARTITION BY a.eventi, a.upc_ean) AS rank
          FROM YOUR_TABLE a) x
 WHERE x.rank = 1


text:
Q: Can't push to repository on EC2 - Could not resolve hostname I can successfully connect to my ec2 instance by ssh:
ssh -i amazon_ec2_123.pem ubuntu@xx.xx.xx.xxx

where xx.xx.xx.xxx is my elastic ip address. Then I created a folder there called my_project.git and ran git init --bare in it.
Then I did this:
cat ~/.ssh/id_dsa.pub | ssh -i amazon_ec2_123.pem ubuntu@xx.xx.xx.xxx "cat >> .ssh/authorized_keys"

At my local machine from the projects' source directory I did this:
git remote add ec2 ssh://ubuntu@xx.xx.xx.xxx:/home/ubuntu/my_project.git

However, when I tried to push to the repo, I got the error:
ssh: Could not resolve hostname xx.xx.xx.xxx:: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What have I done wrong?

A: First of all, make sure that you are able to login with your new ssh keys into your EC2 instance.
Once you are sure that the ssh connection itself works, then, in your bare repository, run
cd git_repo.git
mv hooks/post-update.sample hooks/post-update
chmod a+x hooks/post-update

git update-server-info

Once you have done that, you can add the remote
git remote add ec2 ubuntu@xx.xx.xx.xxx:/home/ubuntu/my_project.git

And it should work. You can read more about setting up git on the server on git-scm


text:
Q: Using PL/SQL expressions in repeat_interval of Oracle 11g DBMS_SCHEDULER I am trying to set a PL/SQL expression as REPEAT_INTERVAL of my job - unfortunately, it is not working.
I would like to include CASE expression within such a interval, for example, how to set repeat interval for the job starts in a full minute, lets say at 14:17:00, and if it is run on even minute it runs in 30 seconds next time, and if it is run on odd minute it starts on next minute, so the piece of its run schedule would look like:
14:17:00
14:18:00
14:18:30
14:19:00
14:20:00
14:20:30
14:21:00

and so on. I have tried with those expressions:
trunc(sysdate, 'MI') + CASE WHEN mod(to_number(to_char(sysdate, 'MI')), 2)=0 then (1/24/60/2) else (1/24/60) end case
SYSTIMESTAMP + CASE WHEN mod(to_number(to_char(sysdate, 'MI')), 2)=0 then INTERVAL '30' SECOND else INTERVAL '60' SECOND end case

they both work in SQL query, but I am unable to compile the JOB. How should such PL/SQL expression look like?
Alternatively, is there a way to make JOB compute its next run date on runtime? I have also tried to modify start date every time the job runs, but with no success - it looks like the job is using start date only once on its first run, and never again, even if the date is changed for a future date.

A: As far as I can tell from the documentation, this should be possible if you

*

*create two schedules; one for the even minutes, one for the odd minutes

*have one of the schedules include the other

*configure your job to use the combined schedule

Example from the documentation:
BEGIN
  dbms_scheduler.create_schedule('embed_sched', repeat_interval =>
    'FREQ=YEARLY;BYDATE=0130,0220,0725');
  dbms_scheduler.create_schedule('main_sched', repeat_interval =>
    'FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=15;BYHOUR=9,17;INCLUDE=embed_sched');
END;

A: i guess its a bit late answer but better later than never. You can use plssql function inside the repeat interval:
tested on: 11.2.0.3.0
Lets create function. my_schedules.odd_even it will return current_date + 30 seconds if current minute is even and 1 minute if current minute is odd:
    CREATE OR REPLACE package my_schedules
is
function odd_even(p_date date default sysdate) return date;
end;
</code>
<code>
CREATE OR REPLACE package body my_schedules
is

-- even - 30 seconds
-- odd - 1 minute;
function odd_even(p_date date default sysdate)
return date
is
l_ret date;
l_sec_in_day number := 60*60*24;
begin

case mod( (to_number(to_char(sysdate,'MI'))) ,2)
when 0 then
--- even return 30 seconds
l_ret:= SYSDATE + 30/l_sec_in_day;
else
-- odd return a minute
l_ret:= SYSDATE + 60/l_sec_in_day;
end case;
return l_ret;
end;`enter code here`

end;
/

create job with repeat_interval=my_schedules.odd_even and enable the job:
declare
  l_action varchar2(2000);
  l_repeat_interval varchar2(250) := 'my_schedules.odd_even';
  l_job_name varchar2(30) := 'TESTING_PLSSQL_SCH';
  begin
    l_action := 'declare dummy number; begin dummy := 1; end;';

    dbms_scheduler.create_job(job_name        => '"'|| l_job_name||'"',
                              job_type        => 'plsql_block',
                              job_action      => l_action,
                              start_date      => sysdate,
                              repeat_interval => l_repeat_interval,
                              comments        => 'just a test'
                              );

    dbms_scheduler.enable(name => '"'||l_job_name||'"');
 end;

Let's check results in a while:
select job_name, actual_start_date  from DBA_SCHEDULER_JOB_RUN_DETAILS rd where job_name = 'TESTING_PLSSQL_SCH' order by actual_start_date;

job_name |  actual_start_date
--------------------------
TESTING_PLSSQL_SCH  2016/07/14/ 17:33:36,671977 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:34:36,007573 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:35:06,006206 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:36:06,001652 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:36:36,005513 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:37:06,003572 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:38:06,011409 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:38:36,011411 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:39:06,011357 +03:00
TESTING_PLSSQL_SCH  2016/07/14/ 17:40:06,002623 +03:00

Oracle Database Online Documentation 11g Release 1 (11.1) / Database Administration/Using Schedules: here


text:
Q: reopening a question in one site I have a question. I already revise my question to fit SE criteria. I search the FAQ and it says to reopen a question, other shall initiate the reopening of it. Now I already leave a comment on my question asking to reopening it and no one seems to see it, (no response), and I can't also reopen it by myself. So what is the best remedy here?
PS: my question is located in stackoverflow, and its currently mark as close. already edited it and still no update.

A: From the stackoverflow FAQ:

You should only ask practical, answerable questions based on actual problems that you face. Chatty, open-ended questions diminish the usefulness of our site and push other questions off the front page.

This means that your question as is falls into the "don't ask" group, since there's no actual problem to be solved.
Your question as it stands would lead to a chatty situation where all answers would be an opinion. This defeats the usefulness of the stackoverflow.
Try to apply a practical example on the question with a problem to be solved, that by getting solved will be given you the answer you seek.

A: You've brought it up here, which is good (since this is the place where questions are discussed), but the problem with the question is that you raise that there are 'other factors' but you never talk about those other factors, leaving each answerer to literally guess at what those factors you're thinking of might be.
Your question has a lot of issues with it, I've brought some up and another user has done so as well.  You've also gotten comments on the post that let you know the problems with it (why it's closed).
If you want the question re-opened, you'll need to take the advice listed here and in the comments. Once you do that, it may get more traction for re-open.
In general, and this is not advice on what to do with this question (because of the problems it has), if it's a programming problem that doesn't involve actual code, then you're better off asking it on Programmers.SE than Stack Overflow.


text:
Q: Why doesn't sed recognize the \ character? I have a lot of \ in a file that I would like to remove using sed. Here is my command:
sed -i.bak 's/\\\//g' myFile

And I get the following error:
sed: 1: "i.bak": command i expects \ followed by text.

Shouldn't it work. I tried:
sed -i.bak 's/\\//g' myFile

But I get the same error.
Thank you.

A: When you are using sed on OS X and when you want to change file in-place using -i flag, then you need to specify the extension for saving backups of that file.
Check out man sed section about -i flag:
 -i extension
         Edit files in-place, saving backups with the specified extension.  If a zero-length extension is
         given, no backup will be saved.  It is not recommended to give a zero-length extension when in-
         place editing files, as you risk corruption or partial content in situations where disk space is
         exhausted, etc.

So, the correct command would be:
sed -i "bak" "s/\\\//g" myFile

And if you do not want to make backup file, you could just write like this:
sed -i "" "s/\\\//g" myFile

If you want to make your script platform independent you can check the $OSTYPE environment variable for that:
if [[ "$OSTYPE" == "darwin"* ]]; then
  sed -i "" "s/\\\//g" myFile
else
  sed -i "s/\\\//g" myFile
fi


text:
Q: HTTP web request doesn't maintain session I have a program where I want to scrap some useful study material for personal use.
This site maintain a session key and some other key also.
If I tried to go to a nested page then it will end the session.
I'm unable to maintain session key using a web request class.
How can I maintain a session using a web request class?
Please help.

A: You need to maintain the CookiesCollection across your requests.
var request = (HttpWebRequest)HttpWebRequest.Create("http://www.mysite.com/");
var cookies = new CookieContainer();

//Pass the collection along with each request to maintain session
request.CookieContainer = cookies;

When you get the response back, your container will automatically contain the set of cookies associated with it. You can then reuse that container with subsequent requests.

A: Essentially you will want to read the session cookie from the response header and pass it back in the header with every request you issue. There may be more to it depending on the application you are targeting.

A: Got a similar problem when embedding a Page in an iFrame.  Solution is, for security purposes sessions get discarded by browsers (mainly IE8). Maybe this is a splution? Google for P3P to get more info.
-sa


text:
Q: How can I access the width of a JPG loaded inside a movieclip in AS3? i'm trying to reproduce the bookshelf similar the one in this site: http://www.callis.com.br/
The books are PNG files that comes in several different sizes.
What I'm trying to accomplish is, after loading in several different movieclips (book0, book1, book2, ...) read their widths, calculate the gap necessary to push it, and then arrange the x value of each book.
Every time I try to access the width value, it says it's 0.
Here's a portion of my code, that's trying to do the trick.
Thanks in advance.
for (j=0; j < dados.livro.length(); j++){
    if(j<8){
        targetLivro = MovieClip(MovieClip(root).livros.getChildByName("livro"+(j)));
    }else{
        targetLivro = MovieClip(MovieClip(root).getChildByName("livro"+(j)));
    }

    preparaLivro(targetLivro,dados.livro[j].imagem.text(),dados.livro[j].link.text());

    //larguraTotalLivrosSup += targetLivro.width;
    //trace(larguraTotalLivrosSup);
    trace("livro"+j+": ");
    trace("título:"+dados.livro[j].titulo.text());
    trace("imagem:"+dados.livro[j].imagem.text());
    trace("link:"+dados.livro[j].link.text());
}

//organiza a primeira estante

//
/*
for (i=0; i<largurasArray.length; i++){
    trace(largurasArray[i]);
}*/

var offset:Number = 20;
for (j=0; j<livros.numChildren; j++){
    //targetLivro = MovieClip(livros).getChildByName("livro"+(j));
    trace(livros.getChildAt(j).width);
}

function preparaLivro(livro:MovieClip, capa:String, url:String){
var capaLoader:Loader = new Loader();
var capaImageRequest:URLRequest = new URLRequest(capa);

var capaBitmapData:BitmapData;
var capaBitmap:Bitmap;
var capaLargura:Number = 0;

capaLoader.load(capaImageRequest);
capaLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event):void{
    capaBitmapData = new BitmapData(e.target.content.width, e.target.content.height);
    capaBitmapData.draw(capaLoader);
    capaBitmap = new Bitmap;
    capaBitmap.bitmapData = capaBitmapData;
    livro.y -= e.target.content.height;

    trace(e.target.content.width, e.target.content.height);
    livro.buttonMode = true;
    livro.addChild(capaBitmap);
    livro.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void{
          navigateToURL(new URLRequest(url), "_blank");
    });
    //trace(e.target.content.width);
});
}

A: Instantiate bitmap from LoaderInfo(event.target).content like:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest("http://www.google.com/images/srpr/logo4w.png"));

function onComplete(event:Event):void
{
    var bitmapData:BitmapData =
        Bitmap(LoaderInfo(event.target).content).bitmapData;
}

Tracing bitmapData.width and bitmapData.height outputs:

width: 550, height: 190

Otherwise, if you want width / height from the loader, access loader's contentLoaderInfo:
var width:Number = loader.contentLoaderInfo.width;
var height:Number = loader.contentLoaderInfo.height;


text:
Q: Dual boot Linux and Windows on RAID 1 drive I hope that this is the correct StackExchange to post this question.
I have got a new computer currently without any operating system installed. I have two identical Sata 1TB SSD cards and my intention is to mirror the two SSDs in RAID 1. At the same time I also want to have both Windows 10 and Linux installed and bootable off of that RAID 1 array (each OS getting one partition).
TL;DR - I basically have two identical Sata SSDs and want to have dual boot Win 10 and Linux while also mirroring the drives for data redundancy.
Unfortunately I am currently unable to get any more storage drives or a hardware raid card. And installing one OS on each of the drives wouldn't give me data redundancy.
Edit:
Actually after some more searching, I was able to find something called BIOS RAID. From what I understand I could activate that in RAID 1 and then first install Windows and then Linux, as BIOS RAID will make my two drives show up as a single drive to whatever OS I am using. Do I understand that correctly?


text:
Q: Disable a column of a QTreeWidgetItem or remove set CheckBox I have QTreeWidgetItem set in a QTreeWidget with 2 columns. Both cells got a CheckBox set by setCheckState(...).
When the user unchecks the CheckBox in my first column I uncheck the second CheckBox in column 2.
Now, I would like to prevent the user to check this second CheckBox again. Is it possible to remove this CheckBox in column 2 or to disable only this cell?
So far I have just seen that all the flags work on the complete item and a set CheckBox won't disapear.
Btw. The items are not editable and I don't want to use a QTableWidget/-Item.
Update:
The CheckBox will be automatically inserted by Qt when I call setCheckState for the item:
QTreeWidgetItem *item = new QTreeWidgetItem(ui.TreeWidget);
item->setCheckState(0, Qt::Checked);

After the new the item does not own a CheckBox (by Qt default). Calling setCheckState(...) I automatically insert a CheckBox (here in column 0) with the Qt::CheckState I want.
But after I have done it there's no way to remove the CheckBox - so it seems.
Maybe anyone got a solution how I can get rid of this CheckBox at a later time? Any help is much appreciated!

A: This will do it:
item->setData(0, Qt::CheckStateRole, QVariant());           //No checkbox at all (what you wanted)

any of these others will show the checkbox space
item->setData(0, Qt::CheckStateRole, Qt::Unchecked);        //Unchecked checkbox
item->setData(0, Qt::CheckStateRole, Qt::Checked);          //Checked checkbox
item->setData(0, Qt::CheckStateRole, Qt::PartiallyChecked); //Partially checked checkbox (gray)

The setCheckState method can not set 'no check state', only Checked, PartiallyChecked or Unckecked.


text:
Q: php sort the files listing Hi i have php which shows me all files in dir and make them href. in the output i have list of files like kpi_03.03.2015.html, kpi_02.03.2015.html etc.
I need to sort the output by date for example.

    <meta http-equiv="Content-Type" content="application/html; charset=utf-8" />

    <?php
     if ($handle = opendir('/opt/nagios/share/kpi_backup')) {
       while (false !== ($file = readdir($handle)))
          {
              if ($file != "." && $file != "..")
              {
                    $thelist .= ''.$file.'';
              }
           }
      closedir($handle);
      }
echo "list of files:

";
echo $thelist;
    ?>

I tried lot of variants like:
sort($thelist);

for ($i=0; $i <= 4; $i++)
    echo $thelist[$i]."
";

But its not working for me.

A: Get the list of base filenames in an array and sort that
usort(
    $thelist
    function ($a, $b) {
        $list($d, $m, $y) = explode('.', trim(sscanf($a, 'kpi_[^h]'), '.'));
        $dateA = $y . $m . $d;
        $list($d, $m, $y) = explode('.', trim(sscanf($b, 'kpi_[^h]'), '.'));
        $dateB = $y . $m . $d;
        return $dateA > $dateB;
    }
);

then loop the array and display

A: You can do it like this.
//Read the file list to array
$thelist = array_diff(scandir('/opt/nagios/share/kpi_backup'), array('..', '.'));

//use usort to sort
usort(
    $thelist,
    function ($a, $b) {
        list($d,$m,$y) = sscanf($a, 'kpi_%d.%d.%d');
        $da = sprintf("%d%02d%02d",$y,$m,$d);
        list($d,$m,$y) = sscanf($b, 'kpi_%d.%d.%d');
        $db = sprintf("%d%02d%02d",$y,$m,$d);
        return $da>$db;
    }
);

$print_list='';
foreach($thelist as $file){
    $print_list .= "$file";
}
echo $print_list;

you can filter the array before sorting. like the following
$thelist=array_filter(
    $thelist,
    function($k){
        return !substr_compare($k,'.html',-5);
    }
);

Note:substr_compare is case sensitive by default


text:
Q: C++ calls OpenCV in python with multithreading C++ calls Python.(Python3.6+VS2012+opencv_python‑3.4.0‑cp36‑cp36m‑win_amd64)
I initialize Python in the main thread, and execute python statements in sub-thread.
I can normally call skimage, sklearn and numpy in any thread apart from OpenCV. When i use OpenCV in the sub-thread, the program will be stuck. But in the main thread, OpenCV can be used.
Here is my code.
#include "Python.h"
#include <process.h>
#include <string>
#include <iostream>
using namespace std;

unsigned int __stdcall TestThread(void*p)
{
    if (!Py_IsInitialized())
    {
        cout << "error" << endl;
    }
    PyRun_SimpleString("import cv2");
    PyRun_SimpleString("import numpy");
    PyRun_SimpleString("img_str = u'D:/rgb.bmp'");
    PyRun_SimpleString("imgInitial = cv2.imdecode(numpy.fromfile(img_str, dtype=numpy.uint8), -1)");
    PyRun_SimpleString("print(imgInitial.shape)");
    return 0;
}

void main()
{
    Py_Initialize();
    PyRun_SimpleString("import cv2");
    PyRun_SimpleString("import numpy");
    PyRun_SimpleString("img_str = u'D:/rgb.bmp'");
    PyRun_SimpleString("imgInitial = cv2.imdecode(numpy.fromfile(img_str, dtype=numpy.uint8), -1)");
    PyRun_SimpleString("print(imgInitial.shape)");
    _beginthreadex(NULL, 0, TestThread, NULL, 0, NULL);
    while(1);
}


text:
Q: Iterating over an array in a Fetch call I have a JSON object like this:
[{"user": "poetry2", "following": ["Moderator", "shopaholic3000"]}]

I am using a Fetch API like this:
    fetch (`/profile/${username}/following`)
    .then(response => response.json())
    .then(profiles => {
        profiles.forEach(function(profile){
            profileDisplay = document.createElement('button');
            profileDisplay.className = "list-group-item list-group-item-action";
            profileDisplay.innerHTML = `
            ${profile.following}`;
            listFollowing.appendChild(profileDisplay);
        })

    })

Right now, it is showing both the following users in the same button like this:
<button class="list-group-item list-group-item-action">
            Moderator,shopaholic3000</button>

How do I amend the Fetch call to show each of the following users in separate buttons. Something more like this:
<button class="list-group-item list-group-item-action">
            Moderator</button>
<button class="list-group-item list-group-item-action">
            shopaholic3000</button>

A: So you need to do a second loop to loop over the array in following
profiles.forEach(function(profile){
  profile.following.forEach(name => {
    const profileDisplay = document.createElement('button');
    profileDisplay.innerHTML = `${name}`;
    ....
  });
});


text:
Q: Artifactory and Jenkins - get file with newest/biggest custom property I have generic repository "my_repo". I uploaded files there from jenkins with to paths like my_repo/branch_buildNumber/package.tar.gz and with custom property "tag" like "1.9.0","1.10.0" etc. I want to get item/file with latest/newest tag.
I tried to modify Example 2 from this link ...
https://www.jfrog.com/confluence/display/JFROG/Using+File+Specs#UsingFileSpecs-Examples
... and add sorting and limit the way it was done here ...
https://www.jfrog.com/confluence/display/JFROG/Artifactory+Query+Language#ArtifactoryQueryLanguage-limitDisplayLimitsandPagination
But im getting "unknown property desc" error.

A: The Jenkins Artifactory Plugin, like most of the JFrog clients, supports File Specs for downloading and uploading generic files.
The File Specs schema is described here. When creating a File Spec for downloading files, you have the option of using the "pattern" property, which can include wildcards. For example, the following spec downloads all the zip files from the my-local-repo repository into the local froggy directory:
{
    "files": [
        {
            "pattern": "my-local-repo/*.zip",
            "target": "froggy/"
        }
    ]
}

Alternatively, you can use "aql" instead of "pattern". The following spec, provides the same result as the previous one:
{
  "files": [
    {
      "aql": {
        "items.find": {
          "repo": "my-local-repo",
          "$or": [
            {
              "$and": [
                {
                  "path": {
                    "$match": "*"
                  },
                  "name": {
                    "$match": "*.zip"
                  }
                }
              ]
            }
          ]
        }
      },
      "target": "froggy/"
    }
  ]
}

The allowed AQL syntax inside File Specs does not include everything the Artifactory Query Language allows. For examples, you can't use the "include" or "sort" clauses. These limitations were put in place, to make the response structure known and constant.
Sorting however is still available with File Specs, regardless of whether you choose to use "pattern" or "aql". It is supported throw the "sortBy", "sortOrder", "limit" and "offset" File Spec properties.
For example, the following File Spec, will download only the 3 largest zip file files:
{
  "files": [
    {
      "aql": {
        "items.find": {
          "repo": "my-local-repo",
          "$or": [
            {
              "$and": [
                {
                  "path": {
                    "$match": "*"
                  },
                  "name": {
                    "$match": "*.zip"
                  }
                }
              ]
            }
          ]
        }
      },
      "sortBy": ["size"],
      "sortOrder": "desc",
      "limit": 3,
      "target": "froggy/"
    }
  ]
}

And you can do the same with "pattern", instead of "aql":
{
  "files": [
    {
      "pattern": "my-local-repo/*.zip",
      "sortBy": ["size"],
      "sortOrder": "desc",
      "limit": 3,
      "target": "local/output/"
    }
  ]
}

You can read more about File Specs here.
(After answering this question here, we also updated the File Specs documentation with these examples).

A: After a lot of testing and experimenting i found that there are many ways of solving my main problem (getting latest version of package) but each of way require some function which is available in paid version. Like sort() in AQL or [RELEASE] in REST API. But i found that i still can get JSON with a full list of files and its properties. I can also download each single file. This led me to solution with simple python script. I can't publish whole but only the core which should bu fairly obvious
import requests, argparse
from packaging import version

...

query="""
items.find({
  "type" : "file",
  "$and":[{
    "repo" : {"$match" : \"""" + args.repository +  """\"},
    "path" : {"$match" :  \"""" + args.path +  """\"}
    }]
}).include("name","repo","path","size","property.*")
"""
auth=(args.username,args.password)

def clearVersion(ver: str):
    new = ''
    for letter in ver:
        if letter.isnumeric() or letter == ".":
            new+=letter
    return new

def lastestArtifact(response: requests):
    response = response.json()
    latestVer = "0.0.0"
    currentItemIndex = 0
    chosenItemIndex = 0
    for results in response["results"]:
        for prop in results['properties']:
            if prop["key"] == "tag":
                if version.parse(clearVersion(prop["value"])) > version.parse(clearVersion(latestVer)):
                    latestVer = prop["value"]
                    chosenItemIndex = currentItemIndex
        currentItemIndex += 1
    return response["results"][chosenItemIndex]

req = requests.post(url,data=query,auth=auth)
if args.verbose:
    print(req.text)

latest = lastestArtifact(req)
...

I just want to point that THIS IS NOT permanent solution. We just didnt want to buy license yet only because of one single problem. But if there will be more of such problems then we definetly buy PRO subscription.


text:
Q: Не получается правильно массив Не могу правильно вывести массив. Пробовал сначала через mysql, так там вообще ничего не получается вывести, попробовал в pdo, получилось что-то вывести, но все равно не то что надо. Но вообще желательно бы, чтоб массив ,был написан в mysql, потому как все остальное у меня в mysql
На картинке показана база, которую нужно вывести в массив

И сам код, который я написал
  $sql= "SELECT post_id, date, author, content, name_image FROM post_en LEFT JOIN image_post ON post_id=id_post_en";
$result = $pdo->query($sql);
$rgOut = [];
foreach ($result as $row) :
        $rgOut[ $row['author'] ] = [$row['name_image']];
endforeach;

И получается, что выводит не все имена картинок

И может вообще кто подскажет правильно ли я делаю. У меня есть страница с постами.
В одном посте может входить какое-то n-ное количество картинок. Поэтому я для того что выделено красным сделал одну таблицу. Для картинок (выделено синим) другую, теперь предположим, что мне нужно вывести какое то количество постов на главной странице

Правильно ли я пытаюсь сделать, или может нужен другой подход. Ну и соответственно, почему не получается массив?

A: Если предположить, что всё остальное вы сделали правильно, это код который добавляет, в массив author столько images сколько у него есть.
$stmt = $pdo->query('SELECT post_id, date, author, content, name_image FROM post_en LEFT JOIN image_post ON post_id=id_post_en');

$rgOut = []; //
while ($row = $stmt->fetch())
{
    // Push to array in case that author already in it
    if (isset($rgOut[ $row['author'] ]))
              array_push($rgOut[ $row['author'] ], $row['name_image']);
    else// Create array with the author
        $rgOut[ $row['author'] ] = [$row['name_image']];
}


text:
Q: JSON to update table cell This was working when I had input type=text id="class_fee_cell" in the fee amount cell, but what I really want is to have a cell value that the user cannot change, but I want to update the fee amount when a different fee type is selected.
I can't see why this isn't working? (that 'form_options' is a function that builds the select box of fee types. JSON queries for the amount of the fee selected).
HTML- (two cells on the same row of a table)

    <?= html($class['class_fee']) ?>

    <select name="students[<?php echo $i ?>][fee_id]" class="fee_id_select" id="<?php echo $i ?>" style="width: 10em">
        <option></option>
        <?= form_options($fee_options, array('selected'=>$class['fee_id']) ) ?>

    </select>

jQuery: (JSON gets fee amount based on fee type selected, but the fee amount cell in the table is not being updated.)
$(".fee_id_select").live("change",function ()
{
    var $fee = $(this).closest('tr').find('#class_fee_cell');
    jQuery.getJSON('get_fee_json.php',
         {
             'id': this.value
         },
         function (data, textStatus)
         {
             var fee = data || {};
             $fee.val(fee.fee_amount || '');
         }
    );
});

A: Instead of $fee.val(fee.fee_amount || '');
you can try
$fee.text(fee.fee_amount || '');
http://api.jquery.com/text/


text:
Q: disable iphone simulator I know this may be really silly - but how can I disable the iphone simulator in xcode? I just want to try a few things and dont care about the view, only the console. I seriously looked everywhere and nada.
Thanks!

A: You need to run your code somewhere. It either runs on the device, or on the simulator. You cannot run your code on the console alone.

A: just "build", not "build and run" (shortcut: command + B).

A: If you want to test your model, and don't care about the view, create and use unit tests. But even then it needs to run the code somewhere...


text:
Q: How to make clicked tab and its contents active and others as inactive? My jsfiddle link was https://jsfiddle.net/1at91Lgo/,
The html that i have used,

Our Schools

 100+ schools with world class education

Matriculation Stream

CBSE Stream

State Board

B.Ed College

Sowdambikaa Boys MHSS

Thuraiyur - Trichy

Sowdaambikaa MHSS

Thottiyam - Trichy

Sowdambikaa MHSS

T.Pettai - Trichy

Chellammal Boys MHSS

Thiruverumbur - Trichy

Chelammal MHSS

Crawford - Trichy

AKKV MHSS

Annamalai Nagar - Trichy

Sowdambikaa Girls MHSS

Thuraiyur - Trichy

Chellammal MHSS

Nagamangalam - Trichy

Chellammal MHSS

SRM Public

Thuraiyur - Trichy

Mullai HSS

Thottiyam - Trichy

Shiva College of Education

Thathiengarpet - Trichy

Viralimalai - Pudukottai

Chellammal Girls MHSS

Thiruverumbur - Trichy

Chelammal Vidhyaashram

Musiri - Trichy

Chellammal Vidyalaya

Thiruverumbur - Trichy

SRM Public

Thuraiyur - Trichy

Mullai HSS

Thottiyam - Trichy

Shiva College of Education

Thathiengarpet - Trichy

And css was,
.ourscl .navbar-default{
    background-color:rgb(222, 35, 41) !important; /*rgb(144,21,14)!important;*/
}
.ourscl {
  background: #ffcb05;
}
.nav-pills li.active a{
    background-color: #FEC73D!important;
}
.nav-pills li a:focus{
    background-color:#FEC73D!important;
}
.nav-pills li a:hover{
    background-color: #FEC73D!important;
}
.nav-pills li a {
    color:#fff;
}
.nav-pills li a{
    border-radius:0px!important;
}
.hide-sec{
    display: none;
    text-align: left!important;
}
.nav-pills{
    display: block;
}
 .brdrlt{
     border-left:1px solid #FEC73D!important;
     text-align: left;
     padding-left: 10px;
   margin-bottom:20px;
 }
.tab-wid.active::after{
    content: '';
    position: absolute;
    top: 100%;
    /* top: 50%; */
    /* margin-top: -13px; */
    border-left: 0;
    border-right: 13px solid transparent;
    border-left: 13px solid transparent;
    border-top: 10px solid #FEC73D;
}
.schools-title {
  color: #fff;
  background: url(images/title_white.png) no-repeat bottom;
}
.italic-line {
  font-style: italic;
  color: #fff;
  margin-top: 35px;
  margin-bottom: 20px;
}
.plus_image {
  background: url(images/plus-sign.png);
  background-repeat: repeat;
}
.brdrlt h4 {
  color: #bc0101
}
.brdrlt p {
  color: #fff;
}

Here what i need was if i click on any menu on the tab(as in the fiddle), the selected menu and its content should get active, I have given id to all the contents that relates to the corresponding menu title..
The jquery script that i have tried was,

I am sure that i was wrong in using this but i don't have a clear idea about achieving the result i want..
Here is the image of what actually i am in the need of..

A: do not use multiple IDs . it's bad practice and it's messing up the whole site. When you try to link the a to # section it will only link to one of them...not to all.
anyway, i changed the href of a to simply # and added an attribute data-target:example that will link to each tab that has that class.
see snippet below or jsFiddle

$(".mtrcscl1").addClass("activetab")

$('.nav-pills li a').click(function (e) {
     e.preventDefault();

     //removing active class from other selected/default tab
    $(".nav-pills li.active").removeClass("active");
     var target = $(this).attr("data-target")
    //adding active class to current clicked tab
    $(this).parent().addClass("active");
  $(".activetab").removeClass("activetab")
  $("." + target).addClass("activetab")

});
.ourscl .navbar-default{
 background-color:rgb(222, 35, 41) !important; /*rgb(144,21,14)!important;*/
}
.ourscl {
  background: #ffcb05;
}
.nav-pills li.active a{
 background-color: #FEC73D!important;
}
.nav-pills li a:focus{
 background-color:#FEC73D!important;
}
.nav-pills li a:hover{
 background-color: #FEC73D!important;
}
.nav-pills li a {
 color:#fff;
}
.nav-pills li a{
 border-radius:0px!important;
}
.hide-sec{
 display: none;
 text-align: left!important;
}
.nav-pills{
 display: block;
}
 .brdrlt{
  border-left:1px solid #FEC73D!important;
  text-align: left;
  padding-left: 10px;
   margin-bottom:20px;
  opacity:0.2;
  transition:0.3s;
 }
 .activetab .brdrlt {
  opacity:1;
 }
.tab-wid.active::after{
 content: '';
    position: absolute;
    top: 100%;
    /* top: 50%; */
    /* margin-top: -13px; */
    border-left: 0;
    border-right: 13px solid transparent;
    border-left: 13px solid transparent;
    border-top: 10px solid red;
}
.schools-title {
  color: #fff;
  background: url(images/title_white.png) no-repeat bottom;
}
.italic-line {
  font-style: italic;
  color: #fff;
  margin-top: 35px;
  margin-bottom: 20px;
}
.plus_image {
  background: url(images/plus-sign.png);
  background-repeat: repeat;
}
.brdrlt h4 {
  color: #bc0101
}
.brdrlt p {
  color: #fff;
}
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Our Schools

 100+ schools with world class education

Matriculation Stream

CBSE Stream

State Board

B.Ed College

Sowdambikaa Boys MHSS

Thuraiyur - Trichy

Sowdaambikaa MHSS

Thottiyam - Trichy

Sowdambikaa MHSS

T.Pettai - Trichy

Chellammal Boys MHSS

Thiruverumbur - Trichy

Chelammal MHSS

Crawford - Trichy

AKKV MHSS

Annamalai Nagar - Trichy

Sowdambikaa Girls MHSS

Thuraiyur - Trichy

Chellammal MHSS

Nagamangalam - Trichy

Chellammal MHSS

Viralimalai - Pudukottai

Chellammal Girls MHSS

Thiruverumbur - Trichy

Chelammal Vidhyaashram

Musiri - Trichy

Chellammal Vidyalaya

Thiruverumbur - Trichy

SRM Public

Thuraiyur - Trichy

Mullai HSS

Thottiyam - Trichy

Shiva College of Education

Thathiengarpet - Trichy


text:
Q: Limit of an integral in deriving formula for arc-length I have struggle understanding a certain step in a proof. Let $\boldsymbol{g}:[a,b] \rightarrow \mathbb{R}^n$ be $\mathcal{C}^1$ and $\int_a^b\boldsymbol{g}:=\left[\int_a^bg_1,\, \dots\,,\int_a^bg_n \right]^T$.
At a point in the proof, it is used that
\begin{equation*}
\Vert\boldsymbol{g}'(t)\Vert = \lim_{h\rightarrow 0^+}\frac{1}{h}\int_t^{t+h}\Vert\boldsymbol{g}'(u)\Vert du
\end{equation*}
Could someone please explain why this is true?


text:
Q: Altering multiple component roots for MUI Textfield According to the MUI Texfield API here, Textfield is a simple abstraction on top of the following components

*

*FormControl

*Input

*InputLabel

*FilledInput

*OutlinedInput

*Input

*FormHelperText

And therefore, to change the styling of the Textfield for any of the components above, like for example notchedOutline class, which is a class for OutlinedInput, i can just do the following
import { TextField } from '@material-ui/core';

const style = theme => ({
  notchOutline: { /*style in here*/ }
});

<TextField
    inputProps={{ notchedOutline : classes.notchedOutline }}
>
</TextField>

All of this can be achieved if that subcomponent classes are unique for that component only.
My question is, how can i style for the more common naming class, like if say i wanna modify the root classes of OutlinedInput, InputLabel, FormHelperText or more subcomponents inside the TextField all at once? I dont think this will work right?
<TextField
    FormControlProps={{ root: classes.root }}
    OutlinedInputProps={{ root: classes.root, notchedOutline : classes.notchedOutline }}
>
</TextField>

or
<TextField
    inputProps={{
        root: classes.OutlinedInputRoot,
        root : classes.FormHelperTextRoot
    }}
>
</TextField>

Need help on how to aim the specific root of a subcomponent of a TextField, without needing to touch on the global MUI theming, or not using the provided TextField at all, instead building the textfield component using those subcomponents on it.

A: Below is an example showing how to target each of these.
Targeting TextField root is equivalent to targeting FormControl, since FormControl is the "root" component rendered by TextField.
There is no difference in how to target Input, FilledInput, or OutlinedInput -- they are all reached via InputProps.
As a side note, using the className prop for a given component is also equivalent to classes.root.
import React from "react";
import ReactDOM from "react-dom";

import TextField from "@material-ui/core/TextField";
import { makeStyles } from "@material-ui/core/styles";
const useStyles = makeStyles({
  formControlRoot: {
    border: "2px solid lightgreen",
    padding: 2,
    marginTop: 10
  },
  inputRoot: {
    border: "2px solid blue"
  },
  inputLabelRoot: {
    border: "2px solid pink"
  },
  formHelperTextRoot: {
    border: "2px solid red"
  }
});

function App() {
  const classes = useStyles();
  const [variant, setVariant] = React.useState("standard");
  return (

      <TextField
        variant={variant}
        label={`My Label (${variant})`}
        helperText="My Helper Text"
        classes={{ root: classes.formControlRoot }}
        InputProps={{ classes: { root: classes.inputRoot } }}
        InputLabelProps={{ classes: { root: classes.inputLabelRoot } }}
        FormHelperTextProps={{ classes: { root: classes.formHelperTextRoot } }}
      />

      <button onClick={() => setVariant("standard")}>Standard</button>
      <button onClick={() => setVariant("outlined")}>Outlined</button>
      <button onClick={() => setVariant("filled")}>Filled</button>

  );
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

Relevant documentation: https://material-ui.com/api/text-field/#props

A: answering this will depend specifically on the material ui version you are using, but i'm going to assume you are using version > 3.
All the following should be working in version 3.9 as i have used them myself, but they are also supposed to work fine with version > 4;
input props are used to pass props to the underlying regular html input element directly, you can pass things like style, max, value, onchange. Things that are native to the html input element.
If you want to pass classes to the underlying material ui input you need to pass a classes object to the InputProps.
Here is how
<TextField
    variant="outlined"
    // this passes props to the html element, root for example here does not mean anything
    inputProps={{
      style: { textAlign: 'center' },
    }
    // this passes props to the wrapper material input, can be  one of the following: Input, FilledInput, OutlinedInput
    // You can pass here anything that the underlying material component uses but we are only interested in two things classes and className, because other props like value and onChange you can pass directly to TextField - thats why they said TextField is an Abstraction over theses Components
    InputProps={{
       className: styles.slider_filter_input, // usually you dont need className, classes will be sufficient, but wanted to show that you can also use it
       classes: {
          focused: classes.focused
          // the list of keys you pass here depend on your variant, if for example you used variant="outlined" then you need to check the css api of the OutlinedInput
       }
    }}
/>

Finally here is a working codesandbox showing the ideas above https://codesandbox.io/s/material-ui-drawer-8p6wv


text:
Q: xquery substring and then concat I am trying to use substring and concat functions in an XQuery statement together.
Here is what I have:
fn:concat(fn:substring({data($x/DueDate)},1,4),fn:substring({data($x/DueDate)},6,2),fn:substring({data($x/(DueDate))},9,2))

The value for DueDate in my xml is: 2013-06-27.
I expected the above function to return: 20130704.
Instead, this is what I get:
fn:concat(fn:substring(2013-06-27,1,4),fn:substring(2013-06-27,6,2),fn:substring(2013-06-27,9,2))

I am confused as to why!

A: If you use it within an element, you need to surround the expression with curly parentheses, like:
{
 fn:concat(
   fn:substring(data($x/DueDate), 1, 4),
   fn:substring(data($x/DueDate), 6, 2),
   fn:substring(data($x/DueDate), 9, 2)
 )
}

A: Are you sure that your DueDate value is actually 2013-06-27? Here is what each individual call to substring equals:
substring('2013-06-27',1,4)

=> 2013
fn:substring('2013-06-27',6,2)

=> 06
fn:substring('2013-06-27',9,2)

=>  27
substring() starts at the 1-indexed character number passed in the second param and copies the number of characters passed in the third param.

A: Clean up you formatting and bracketing (remove unnecessary curly brackets, remove some parentheses) and you will get some valid code:
fn:concat(
  fn:substring(data($x/DueDate), 1, 4),
  fn:substring(data($x/DueDate), 6, 2),
  fn:substring(data($x/DueDate), 9, 2)
)

There is a much shorter and more readable version, too:
fn:string-join(fn:tokenize($x/DueDate, '-'))

Or even replace using regular expressions:
fn:replace($x/DueDate, '-', '')


text:
Q: Previous Month Calculated Column in Tableau Been trying to find an easy way to calculate the previous month values. Not sure how to get it to work correctly.
This is what I did for Current Month:
IIF(DATETRUNC('month',[Approved for Hire Date]) = DATETRUNC('month',TODAY()),'true','false')

What I tried for Previous Month"
IIF(DATETRUNC('month',[Offer Accepted Date]) = DATETRUNC('month',-1,DATETRUNC('month',TODAY())),'true','false')


text:
Q: Difference between @VisibleForTesting and @Deprecated int unit test Let's say that there just so happens to be an existing long private method (one of which i'm not allowed to refactor into smaller pieces at this stage in the development process) but i really want to write a couple of regression-protection unit test for it, just for now.
i just heard of this @VisibleForTesting annotation, but am not too sure of its benefits and gotchas. Previously, i had always been marking things with @Deprecated and comments to try and make it VERY CLEAR like:
... some code ...
    // ====================================== TESTING USE ONLY BELOW  ======================================
@Deprecated // TESTING ONLY, DO NOT USE!
boolean testGiveAccessToSomethingPrivate() {
    // call some private method and get the results
}

it seems that whenever i mark something as @VisibleForTesting it seems to expose the method for realz, without any indication to the user of the API that this method was only meant for testing... (whereas if i mark the method with @Deprecated, most IDEs will put a strike-through that warns other developers to not accidentally use the test method for their actual code

A: @Deprecated
When the method is marked @Deprecated, programmers use this method will know maybe this method will be removed, different behavior ... in future version. And if that happen, your code will be broken and you will rework. So, they should use this function very carefully or should replace by other function. (often programmer who made this api will make another similar function without deprecated for you to use).
@VisibleForTesting
You have learnt public private protected ... and you use it well. But in real world, everything not as our imagination. For example, your class have a private variable, and you want to test this variable, how can?
class SimpleClass() {
   private int a;

   public simpleMethod() {
       if (a < 0) {
          // do something
       } else {
          // do another thing
       }
   }
}

One way is changing scope of variable a to package level, because your test file will be same package with file to be tested. But another programmer jumps into and they will ask their self: "Why someone put modifier of a is package level? I think private level is better". (of course, they don't know or don't mind reading your test code because life is so busy). So you will have a way for their to know by using @VisibleForTesting. They read this and Google and know: "Ahhhh, I understood. He want this variable is testable".
That's a very short story about those two annotations. The similar is: They don't change the way your code run. Not change anything but notify for other people to know something. Very famous annotation every Java Developer knew and similar is @Override
The difference is: @Deprecated for someone using your code, and @VisibleForTesting for someone reading your code. Let make life's programmer easier in both case.
Hope this help :)


text:
Q: Updating rows in a ResultSet from an inner join I have tables A and B, they each have the same primary key (Col1).

Table A                     Table B
Col 1 | Col 2 | Col 3       Col 1 | Col 4

I'd like to update rows in table B based on information from the corresponding row in table A.  If I were to get a result set with an inner join on the two tables,
select A.Col1, A.Col2, A.Col3, B.Col4 from A inner join B on A.Col1=B.Col1;
Could I iterate through this result set and update Col4 in Table B? That is, using the JDBC/ResultSet updateX(...) methods?
The reason I ask is because, it seems a bit strange, to update table B from the result set A join B.

Clarification: Not sure if this will matter, but I'm interested in updating the rows via the JDBC ResultSet interface, not a direct MySQL update query. Thanks for the responses!

A: You should be able to update TableB using a JOIN:
UPDATE TableB B
    JOIN TableA A ON B.Col1=A.Col1
SET B.Col4 = 'Some Value'
WHERE A.Col2 REGEXP 'Some Regex'

Not knowing what Regex you want to use and in what scenario, and what value you want to update Col4 to, makes it a little difficult, but this should be pretty close.

*

*SQL Fiddle Demo

A: This worked for me:
UPDATE
    B
INNER JOIN
    A ON B.id=A.id
SET
    B.value=A.value

fiddle
This is a skeleton, update other columns of B according to your needs.

A: I stumbled on this one looking for the scenario where I wanted to transform some data and move it between tables.
There is a two pass workaround, but it involves creating temporary columns.

*

*first in the target table, create a temporary column of the fields needed in the transformation

*second, use a simple SQL update to populate those columns from the other table

*third use an updateable result set to do the transformation you initially wanted to do

*lastly remove the temporary columns


text:
Q: How do I setup webhooks for transfer I am a bit new to stripe. I am using it in node.js. Earlier today I had created stripe.transfers.create({}) object. Now in the webhook, I want to set the logic for when the transfer is complete or it fails. So I tried setting up the transfer.paid and transfer.failed webhook. But I did not receive any event.
My webhook code looks somewhat like this:
else if (webhookEvents.type === "transfer.paid") {
     // Update transfer to Success in DB
    } else if (webhookEvents.type === "transfer.failed") {
      // Update transfer back to Pending in DB
    }

The transfer begins when the stripe.transfers.create({}) is hit on button click and DB updates transfer to processing. But the transfer.paid block is never hit. I have a transfer.created block aswell and it runs everytime I start a transfer. Can anyone please help me in setting up the webhook events for a failed or successful transfer of a connected account. I need to setup the success and fail case for a transfer.

A: Historically, "transfers" were used the way Payouts are used today. You can read Stripe's documentation on the split here. The events you're
looking at are related to the old "payout" transfers, and no longer apply to transfers of funds between Stripe accounts. To listen for Connect-related transfers (which will succeed or fail synchronously with your request), you can subscribe to transfer.created events (ref).


text:
Q: How can I follow and fully report on a chain of symlinks? What are the best tools/programming-techniques for following a complicated nesting of symlinks and completely capturing and reporting on every symlink along the way, including those in the middle of a path (See below for more info).
Here's a specific example.  Consider the following output from a shell command
 ls -l /Library/Java/Home
 lrwxr-xr-x  1 root  admin  48 Feb 24 12:58 /Library/Java/Home -> /System/Library/Frameworks/JavaVM.framework/Home

The ls command lets you know that the file /Library/Java/Home file is a symlink to another location.  However, it doesn't let you know that the thing it's pointing to is also a symlink
ls -l /System/Library/Frameworks/JavaVM.framework/Home
lrwxr-xr-x  1 root  wheel  24 Feb 24 12:58 /System/Library/Frameworks/JavaVM.framework/Home -> Versions/CurrentJDK/Home

This, in turn, doesn't let you know that part of the path of the pointed to file is a symlink.
ls -l /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
lrwxr-xr-x  1 root  wheel  3 Feb 24 12:58 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK -> 1.5

Which, just to complete this tale, is another symlink
ls -l /System/Library/Frameworks/JavaVM.framework/Versions/1.5
lrwxr-xr-x  1 root  wheel  5 Feb 24 12:58 /System/Library/Frameworks/JavaVM.framework/Versions/1.5 -> 1.5.0

Finally pointing at a "real" folder.
Are there any tools that can visualize the full chain of links for you in some way (either graphically or plain old text)?  I'm sure one could script this themselves (and if you want to, please do it and share!), but it seems like the kind of thing that would be fraught with "oh, crap, edge case.  Oh, crap, ANOTHER edge case".  I'm hoping someone's already gone to the bother.
I do freelance/contract work, and everyone uses symlinks slightly differently to install their PHP applications on a web-server.  Half my job is usually un-nesting this (inevitably) undocumented hierarchy so we know where to put our new code/modules.

A: Tcl has a command [file type $filename] that will return "link" if it's a link. It has another command [file link $filename] that will return what the link points to. With those two commands it's possible to take a link and follow the links until you get to an actual file.
Perhaps something like this off the top of my head:
#!/usr/bin/tclsh

proc dereferenceLink {path {tree {}}} {
    if {[file type $path] == "link"} {
        set pointsTo [file link $path]
        if {[lsearch -exact $tree $path] >= 0} {
            lappend tree $path
            return "[join $tree ->] (circular reference)"
        } else {
            lappend tree $path
            return [dereferenceLink $pointsTo $tree]
        }
    } else {
        lappend tree $path
        return [join $tree "->"]
    }
}

puts [dereferenceLink [lindex $argv 0]]

You'll get output that looks like:

foo->bar->baz

If there's a circular link it will look like:

foo->bar->baz->foo (circular
  reference)

A: This python script would do it, if you added a single print inside the loop:
http://mail.python.org/pipermail/python-ideas/2007-December/001254.html

A: Here's a bash script I threw together a while back to do exactly this.  It finds the ">" in the ls output that indicates a symlink to walk the links.  I can't vouch for perfect behavior in edge cases (it's hard coded to give up after following ten links in order to avoid loops, for example), but it's worked well for me.

#!/bin/bash

function deref() {

    FILE="${1%/}"
    COUNT=0
    while [ -L "$FILE" ]; do
        TARGET=`ls -l "$FILE" | sed -e 's/^.*> //'`
        [ ${TARGET:0:1} == "/" ] || TARGET="`dirname $FILE`/$TARGET"

        # strip trailing slashes; -L cannot handle those
        FILE="${TARGET%/}"

        COUNT=$(( COUNT + 1 ))
        [ $COUNT -eq 10 ] && exit 1
    done
    echo $FILE

}

deref "$1"

A: If you just need to know the ultimate referent, php has the realpath function which can do that.

A: In PHP, you can use is_link and readlink.
Example usage:
function dereference_link($path) {
  $parts = array();
  foreach (explode(DIRECTORY_SEPARATOR, $path) as $part) {
    $parts[] = $part;
    $partial = implode(DIRECTORY_SEPARATOR, $parts);
    if (is_link($partial)) {
      $result = dereference_link(readlink($partial) . substr($path, strlen($partial)));
      array_unshift($result, $path);
      return $result;
    }
  }
  return array($path);
}


text:
Q: Accordion inside other accordion does not resize height of body content with Internet Explorer I have done with Bootstrap 2.0 an accordion which has other accordion in its body:

            Accordion1

                            Accordion2

                                    Button1

                                    Button2

                                    Button3

Using Internet Explorer 9, the first time that I load the principal accordion (accordion1), which is loaded opened and the accordion2 closed, when I open the accordion2 ,it resizes the height of the accordion1 to show its content correctly.
But after that, if I collapse accordion2, and after I collapse accordion1 too, when I re-open accordion1 and after accordion2, accordion2 doesn't resize the height of accordion1...and therefore I don't see the content of accordion2.
With Firefox there are no problem, Firefox resizes the content of accordion1 without any problem.
I tried to put property height:auto but it doesn't do anything...
Thanks.

A: I've solved my problem.
The solution is that Internet Explorer 9 have this bug, but in Internet Explorer 10 this problem is solved.


text:
Q: Checking dynamic Checkboxes on Change I have a dynamic table full of checkboxes that may or may not be checked. I have written a jquery script that changes the bg color of the table cell it is in whenever a checkbox is modified; however, it's quite buggy and it doesn't always change the BG color instantly.
Any suggestions?

var check;

$('[id^=approvalcd]').change(function(){
if($(this).is(":checked") != check) {
     check = $(this).prop("checked");
     $('.approvalROW'+$(this).prop('id').split('approvalcd')[1]).css('background-color', color);
}else{
     $('.approvalROW'+$(this).prop('id').split('approvalcd')[1]).css('background-color', 'inherit');
}
});

HTML:

<input id='approvalcd" . $counter ."' name='ApprovalCd" . $counter . "' type='checkbox'>

A: I'd suggest, albeit untested:
$('table td input[type="checkbox""]').change(function(){
    $(this).closest('td').css('background-color', this.checked ? 'color' : 'inherit');
});

A: I think that using classes is more flexible:
$('table').on('change', ':checkbox', function() {
    $(this).closest('tr').toggleClass('selected', this.checked);
})
.find(':checkbox').trigger('change');

For example: http://jsfiddle.net/hkL43/1/

A: I would change how you are finding the table row element.  Use...
$(this).parents('tr').css('background-color', color);

I don't know your html, but that would likely give more consistent results.


text:
Q: Why swagger documentation doesn't work on PythonAnywhere domain? I have used swagger to document my APIs on the Django rest framework, and deploy it on Pythonanywhere.
but the documentation URL doesn't have any response.

it is my urls.py code for swagger:
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
     schema_view = get_schema_view(
       openapi.Info(
          title="BoardGame API",
          default_version='v1',
          description="Test description",
          terms_of_service="http://****.pythonanywhere.com/",
          contact=openapi.Contact(email="contact@boardgame.local"),
          license=openapi.License(name="TEST License"),
       ),
       public=True,
       permission_classes=(permissions.AllowAny,),
    )
    urlpatterns = [
        ...
        path('', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    ]

and my settings.py
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'drf_yasg',
    'rest_framework_swagger',
    'rest_framework_simplejwt',
    'django_extensions',
   ...
]

A: Its because your static files has not been loaded on server try to collectstatic files and check in inspect of page whether css is loading or not

A: *

*You have to learn about static in Django

*When you apply it all UI related files will be created in a static folder

*Then swagger UI will work on pythonanywhere

A: It's seems that static file is not loaded on live server:
step 1:
LOCAL= False

step 2:
python manage.py collectstatic

step 3:
Reset server
nginx: sudo systemctl restart nginx
gunicorn: sudo systemctl restart gunicorn


text:
Q: config-yargs not found with webpack4 and webpack-cli installed After creating a new VueJS Project (with TypeScript, ans Single Files Components class) I get an error when launching it with npm run dev. I've seen on differents topics that you need to have webpack-cli installed, so I installed it, but i still get the same error :
Error: Cannot find module 'webpack/bin/config-yargs'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\tozenda\Documents\SEC\testlearning\learning\ElectriCar.WebSite\electricar.website\node_modules\webpack-dev-server\bin\webpack-dev-server.js:54:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

Here is part of my package.json :
"scripts": {
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "start": "npm run dev",
    "lint": "eslint --ext .js,.vue src",
    "build": "node build/build.js"},
[...]
"devDependencies": {
    [...]
    "webpack": "^4.16.0",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-cli": "^3.0.8",
    "webpack-dev-server": "^2.9.1",
    "webpack-merge": "^4.1.0"
  },

Do you have a solution ?
Thank you
UPDATE : I tried to downgrade to webpack 3.12.0, but ts-loader asks for webpack 4...

A: SOLUTION :
As npm update does not updates ALL the packages, this was the problem.
I used npm-update-all to update all the packages. This solved my problem.


text:
Q: What is  saying? I'm reading about object-oriented programming to try and understand it better when I came across:
print a_dict.clear
<built-in method clear of dict object at 0x0012E540>

And I'm trying to understand the results of the print statement. I get that Python is telling me that clear is a method belonging to the dict object, what does 0x0012E540 mean? Is that the "location" or where I can find the code for the clear method?
Thanks in advance.

A: When you use print , the statement "tries" first to cast the object to a string. If no __str__ method has been defined for this object the __repr__ function is used instead. The basic version of this function displays the type of the object alongside its in-memory address.
Source: http://docs.python.org/2/library/functions.html#func-repr


text:
Q: Passing data from listview in fragment to fragment when i click on the listview the bundle can get the value, but cant pass the value to second fragment.
First Fragment
categorylist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            final String category = ((TextView) view.findViewById(R.id.mainproductitem)).getText().toString();
            details_fragment ldf = new details_fragment ();
            Bundle args = new Bundle();
            args.putString("category", category);
            ldf.setArguments(args);
        }
    });
        return view;

}

Second Fragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // TODO Auto-generated method stub

    view=inflater.inflate(R.layout.my_fragment2, container, false);
    test = (TextView)view.findViewById(R.id.textView);

    Bundle args = getArguments();
    if (args  != null && args.containsKey("category")){
        String userId = args.getString("category");
        test.setText(userId);
    }
    return view;
}

A: You may be forget to start your second fragment
categorylist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            final String category = ((TextView) view.findViewById(R.id.mainproductitem)).getText().toString();
            details_fragment ldf = new details_fragment ();
            Bundle args = new Bundle();
            args.putString("category", category);
            ldf.setArguments(args);
            FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
            fragmentTransaction.replace(R.id.yourContainer, ldf);
            fragmentTransaction.addToBackStack(null);
            fragmentTransaction.commit();

        }
    });
}

and in you second activity
Bundle agrs = getArguments();
if (args != null) {
    String category = agrs.getString("category");
    test.setText(category);
}

A: In First Fragment
    categorylist.setOnItemClickListener(new AdapterView.OnItemClickListener()
 {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            final String category = ((TextView) view.findViewById(R.id.mainproductitem)).getText().toString();
            MainActivity main=new MainActivity();
                   main.openSecondFrag();
        }
    });
        return view;

}

In your MainActivity,put openSecondFrag() method
 public void openSecondFrag(){
 details_fragment ldf = new details_fragment ();
                Bundle args = new Bundle();
                args.putString("category", category);
                ldf.setArguments(args);
}

In Second Fragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // TODO Auto-generated method stub

    view=inflater.inflate(R.layout.my_fragment2, container, false);
    test = (TextView)view.findViewById(R.id.textView);

    Bundle args = getArguments();
    if (args  != null && args.containsKey("category")){
        String userId = args.getString("category");
        test.setText(userId);
    }
    return view;
}

I am sure it will work.

A: Try this: on your receiving Fragment:
Bundle agrs = this.getArguments();
if (args != null) {
    String myStr = args.getString(key, defaultValue);
}

A:
`Use this code in your categorylist.setOnItemClickListener`

    // Create fragment and give it an argument specifying the article it should show
    details_fragment newFragment = new details_fragment ();
    Bundle args = new Bundle();
    args.putString("category", category)

     //Note: if your are in fragment than replace getSupportFragmentManager to getFragmentManager.

      FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();

    // Replace whatever is in the fragment_container view with this fragment,
    // and add the transaction to the back stack so the user can navigate back
       transaction.replace(R.id.fragment_container, newFragment);
       transaction.addToBackStack(null);

    // Commit the transaction
       transaction.commit();

A: Use a Bundle. Here's an example:
Fragment fragment = new Fragment();
Bundle bundle = new Bundle();
bundle.putString(key, value);
fragment.setArguments(bundle);
getFragmentManager().beginTransaction().replace(R.id.container_view, bundle).commit();

Bundle has put methods for lots of data types. See this
Then in your Fragment, retrieve the data (e.g. in onCreate() method) with:
Bundle bundle = this.getArguments();
if (bundle != null) {
    int myInt = bundle.getString(key, defaultValue);
}

A:
HomeActivity.xml

<?xml version="1.0" encoding="utf-8"?>
  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   app:layout_behavior="@string/appbar_scrolling_view_behavior"
   tools:context="com.example.activity.HomeActivity"
   tools:showIn="@layout/app_bar_home">

//View that will hold all the fragments
<FrameLayout
    android:id="@+id/container_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
</FrameLayout>

FirstFragment

 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment

    View view = inflater.inflate(R.layout.fragment1, container, false);
    view.setBackgroundColor(Color.WHITE);

     listViewAdapter.SetOnItemClickListener(new OnItemClickListener() {
                    @Override
                    public void onItemClick(View view, int position) {
                        SecondFragment secondFrag = new SecondFragment();
                        Bundle args = new Bundle();
                        args.putString("Key","some value");

                        secondFrag .setArguments(args);
                        getFragmentManager()
                       .beginTransaction()
                       .replace(R.id.container_view, fragment)
                       .addToBackStack(null)
                       .commit();
                    }
                });
    return view;
}

SecondFragment

public class SecondFragment extends Fragment {

     public SecondFragment() {
    // Required empty public constructor
}

  @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.second_fragment, container, false);
    TextView textView = (TextView)view.findViewById(R.id.textView);
    view.setBackgroundColor(Color.WHITE);
    String key = getArguments().getString("Key");
    //Set the value to your text view
     textView.setText(key);
    return view;
}

I tried this out and it works perfectly.


text:
Q: Generalizing a C++ pattern I'm programming in a very static environment and would like to generalize the problem/code in the best way possible, to make it clean and avoid any boilerplate code. This is my case; I'm developing a modification system which sits between the program and the extensions, where the extensions will be forwarded the API calls. When my modification gets loaded by the program, I receive a pointer to a table consisting entirely of function pointers.
struct APITable
{
 void (*MouseClick)(int, int);
 void (*MouseLeave)(bool);
 int (*MouseRet)(float, int);
 // And about a 200 more
 // ......
};

In this function I set the callback functions/pointers, to point at my own (i.e apiTable->MouseClick = &MyMouseClick;). I'm trying to extend this framework (since it only allows one modification at a time) to support multiple plugins. This is done by loading additional plugins (as libraries) and then forward all callbacks (such as MouseClick) to the loaded plugins. This is an example;
void MyMouseClick(int x, int y)
{
 bool blockOriginal = false;

 // Iterate over all plugins
 if(plugin_function_is_defined_pre)
  blockOriginal = call_plugin_callback_pre(x, y);

 if(!blockOriginal)
  EngineMouseClick(x, y); // This is the programs "engine" function, which I have to call if I want normal execution flow

 // Iterate over all plugins
 if(plugin_function_is_defined_post)
  call_plugin_callback_post(x, y);
}

This is a very simplified procedure but I think it tells everything that needs to be told. Since I have over 200 functions there's no way I would copy and paste all this boilerplate code. The normal procedure would probably be a #define, one for void functions and one for functions with a return value. Although this works, I would definately prefer another solution (which might not be possible since C++ is a statically typed language).
The point is; I want to generalize this procedure in a clean and efficient way avoiding any boilerplate code. Worth mentioning is that the functions may override the original functions return value, in callbacks not declared as void.
So to strip it to the bones: Program->MyExtension->Plugins&Engine
NOTE: I do not want to use any language but C++, and will use C++11 features if necessary!
EDIT: In case of interest, this is how my modification gets loaded by the program:
extern "C" ModLoad(APITable * apiTable)
{
 apiTable->MouseClick = &MyMouseClick;
 apiTable->MouseLeave = &MyMouseLeave;
 // And so on
 // ...
}

A:
which might not be possible since C++ is a statically typed language

If only C++ had a statically-typed way to write generic code that can be customised for different parameters, maybe some kind of template facility?  ;-)
N.B. I have no idea how you intend to handle return values or what blockOriginal or the callbacks are meant to do, so this is just a sketch.
template<typename Res, typename... Args>
  Res call_plugin_func(Enum funcID, Res (*origFunc)(Args...), Args... args)
  {
    Res res = Res();
    bool blockOriginal = false;

    // Iterate over all plugins, looking for defs of funcID
    if(plugin_function_is_defined_pre)
      blockOriginal = call_plugin_callback_pre(args...);

    if(!blockOriginal)
      res = origFunc(args...);

    // Iterate over all plugins
    if(plugin_function_is_defined_post)
      call_plugin_callback_post(args...);

    return res;
  }

template<typename... Args>
  void call_plugin_func(Enum funcID, void (*origFunc)(Args...), Args... args)
  {
    bool blockOriginal = false;

    // Iterate over all plugins, looking for defs of funcID
    if(plugin_function_is_defined_pre)
      blockOriginal = call_plugin_callback_pre(args...);

    if(!blockOriginal)
      origFunc(args...);

    // Iterate over all plugins
    if(plugin_function_is_defined_post)
      call_plugin_callback_post(args...);
  }

void MyMouseClick(int x, int y)
{
  call_plugin_func(ID_MyMouseClick, &EngineMouseClick, x, y);
}

(Two function templates are needed because the one returning void has a different body, it can't declare res to be type void.)


text:
Q: How to invoke some event at fixed time in actionscript 3? I want to invoke eventX every day at 14:30,how to do this kind of job in actionscript 3?

A: The Adobe AS3 Alarm Clock example should tell you all you need to know. In particular, the setAlarm method will be of interest.

A: You can use the date object
EDIT
it was suggested that flash might freeze for a second causing the event not to fire. This is valid - I've updated it so this is no longer a problem.
var currDate:Date = new Date();

var targetHour:int = 14;
var targetMinute:int = 30;

var startHour:int = currDate.getHours();
var startMinute:int = currDate.getMinutes();

var eventTriggered:Boolean = false;

// you can use an enterframe or a timer event here, doesn't matter which
addEventListener(Event.ENTER_FRAME, onCheckTime);

function onCheckTime(evt:Event):void{
  currDate = new Date();

  var hours:int = currDate.getHours();
  var minutes:int = currDate.getMinutes();

  // in order for this not to work flash would need to freeze for an entire minute
  // not likely
  if (hours == 14 && minutes == 30){
     trigger();
  }

  // if flash froze for a whole minute
  if (!eventTriggered){
    if (startHour <= targetHour && startMinute < targetMinute){
      if (hours > targetHour && minutes > targetMinute){
        trigger();
      }
    }
  }
}
function trigger():void{
  // do anything you want here
  eventTriggered = true;
  dispatchEvent(new Event("eventX"));
  removeEventListener(Event.ENTER_FRAME, onCheckTime);
}

A: Using Date() as a trigger point for a repeating event is unreliable for the reasons mentioned and also because the Date class is tied the the local machine's time, which can be changed by the user. While unlikely, the user could change the date on the local machine, never allowing it to reach the target date.
However, if you were to use Date(), I might approach it like the following, which would give you a full minute (or whatever you set the timeOutLength variable to), to have trigger() called.  The else block calls trigger() if the trigger window is somehow passed without trigger() getting called.  The rest of the functions create a waiting period until the trigger window has expired, and then rolls the date forward one day and restarts the process.
var timeOutLength:Number = 1;
var minutesToWaitUntilReset:Number = timeOutLength + 1;
var hasBeenTriggered:Boolean = false;

var targetHour:Number = 2;
var targetMinute:Number = 38;

var currentYear:Number = new Date().getFullYear()
var currentMonth:Number = new Date().getMonth();
var currentDay:Number = new Date().getDate();

addEventListener(Event.ENTER_FRAME, onCheckTime);

function onCheckTime(evt:Event):void
{
    var currentDate = new Date().getTime();
    var targetDate = new Date(currentYear, currentMonth, currentDay, targetHour, targetMinute).getTime();
    var timeOutDate = new Date(currentYear, currentMonth, currentDay, targetHour, (targetMinute + timeOutLength)).getTime();

    if (currentDate >= targetDate && currentDate < timeOutDate && hasBeenTriggered == false)
    {
        tiggerDailyEvent();
    }
    else if(currentDate >= timeOutDate && hasBeenTriggered == false)
    {
        tiggerDailyEvent();
    }
}

function tiggerDailyEvent():void
{
    hasBeenTriggered = true;
    removeEventListener(Event.ENTER_FRAME, onCheckTime);
    addEventListener(Event.ENTER_FRAME, waitForReset);

    // this is where you call your daily event
}

function waitForReset(evt:Event):void
{
    var currentYear = new Date().getFullYear();
    var currentMonth = new Date().getMonth();
    var currentDay = new Date().getDate();

    var currentDate = new Date().getTime();
    var resetDate = new Date(currentYear, currentMonth, currentDay, targetHour, (targetMinute + timeOutLength + minutesToWaitUntilReset)).getTime();

    if(currentDate >= resetDate)
    {
        removeEventListener(Event.ENTER_FRAME, waitForReset);
        reset();
    }
}

function reset():void
{
    hasBeenTriggered = false;

    currentYear = new Date().getFullYear();
    currentMonth = new Date().getMonth();
    currentDay = new Date().getDate() + 1;

    addEventListener(Event.ENTER_FRAME, onCheckTime);
}


text:
Q: ReactJS button fills array at second click I'm trying to make a team draw app. I have a button that when you click on them runs a function. This function must be fill the state of 'Players' but when i click this button at first time, this returns an empty array. After second click works normally. I read all similar tickets like this in this page but I can't fix my problem.
//Code
import React, { useState, useEffect } from "react";
import NewPlayerButton from "./NewPlayerButton";
import PlayerList from "./PlayerList";
import NewPlayerForm from "./NewPlayerForm";

const PlayersContainer = () => {
  //Estados
  const [showAddPlayer, setShowAddPlayer] = useState(false);
  const [players, setPlayers] = useState([]);

  const [arrayGoalKeepers, setArrayGoalKeepers] = useState([]);
  const [arrayPlayers, setArrayPlayers] = useState([]);
  //Variables

  //Efectos
  useEffect(() => {
    setShowAddPlayer(showAddPlayer);
  }, [showAddPlayer]);

  useEffect(() =>{
    console.log(arrayGoalKeepers);
  }, [])

  //Funciones
  const showAddPlayerForm = (status) => {
    setShowAddPlayer(status);
  };

  const drawTeams = () =>{
    let arrGoalKeepers = players.filter(p =>{
      return p.type == "GoalKeeper";
    });

    let arrPlayers = players.filter(p =>{
      return p.type == "Player";
    });

    setArrayGoalKeepers(arrGoalKeepers);
    setArrayPlayers(arrPlayers);

    let allPlayers = [...arrayPlayers];

    for (let i = allPlayers.length - 1; i > 0; i--) {
      let drawedPlayers = Math.floor(Math.random() * (i + 1));
      let temp = allPlayers[i];
      allPlayers[i] = allPlayers[drawedPlayers];
      allPlayers[drawedPlayers] = temp;
    }

    const halfQuant = Math.floor(allPlayers.length / 2);
    console.log(halfQuant);

    let team1 = [...allPlayers.slice(0, halfQuant), ...arrayGoalKeepers.slice(0,1)];
    let team2 = [...allPlayers.slice(halfQuant), ...arrayGoalKeepers.slice(1)];
    console.log(team1);
    console.log(team2);
  }

  return (
    <>
      <NewPlayerButton showStatus={showAddPlayer} showFn={showAddPlayerForm} />
      {showAddPlayer && (<NewPlayerForm players={players} setPlayer={setPlayers} showMenu={setShowAddPlayer}/>)}

      <hr />
      <PlayerList players={players}/>
      <button className="btn btn-success w-100 border text-uppercase" onClick={drawTeams}>
      ⚽ Sortear
      </button>
    </>
  );
};

export default PlayersContainer;


text:
Q: Excel Client Side to Server Side Good afternoon.
The YMCA I work at is looking to move into a paperless setup at our membership services desks.  We will be using Adobe Sign to get documents signed which will then send .PDF files to a default email address.
I found a Client Side VBA script to automatically send attachments to a hard drive folder, but I am looking for assistance on how to change it to Server Side.
The Client Side VBA is:
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "c:\temp\"
     For Each objAtt In itm.Attachments
          objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
          Set objAtt = Nothing
     Next
End Sub

*

*How can I get this Server Side, so it sends to a network folder?