text:
Q: Interleaving in litz wire transformer - to be or not to be? i am designing a transformer for 2-switch forward converter. For now, primary is wound as 5 wires of 0,5mm diameter (34 turns, 3 layers), the secondary is wound as 3 wires of 1,32mm diameter (17 turns, 2 layers). The frequency of smps is 83khz. The idea is to use litz wire in primary and secondary and increase frequency to 100khz.
So, the primary would be wound as litz wire (0,1mm diameter, 120 strands) in 2 layers. The secondary would be litz too (0,071mm diameter, 1076 strands) in 2 layers too. So, the skin effect must be elliminated completely. But what about a coupling? I have read a lot of books on winding interleaving technique, but all the cases if wire radius is more or less greater than the skin depth.
So, it is easy to do interleaving on this litz wire transformer (1 layer primary, 1 layer secondary, 2 layer primary, 2 layer secondary). So guys, will it worth it? I hope there must be some benefits like increased coupling between windings and reduced proximity losses... But i am not sure about that.
So - is it good idea to use winding interleaving on litz wire windings? Will i get better coupling between windings and decreased leakage inductance?
Thanks for your response. It is easy to do interleaving, but harder than just wound windings as 1P,2P,1S,2S.
I will post results of my experiments most likely.

A: This is a bit late, but...
For this frequency range proximity effect losses will be much higher than skin effect losses. Proximity effect loss is reduced by using Litz (also good for reducing skin effect losses) or bunched conductors (less effective at reducing skin effect losses). Loss resistance due to proximity effect is proportional to \$ number\_of\_wire\_strands \times wire\_diameter^4 \$ which is why bunched (or Litz) wire is so effective at reducing AC copper losses. An increase in wire strand diameter will cause proximity effect losses to increase - a seemingly counterintuitive outcome.
Since you're operating at a higher frequency, consider reducing the number of turns by a factor of 0.83 (83kHz/100kHz). You'll maintain the same flux density which allows you to reduce DC & AC copper losses which is proportional to the number of turns.
Reducing the number of turns also reduces leakage inductance \$ (L_l\propto N^2) \$.
To improve coupling (reducing leakage inductance) interleaved windings are your friend. It does increase the complexity of the construction which is costly. The number of interfaces between the primary and secondary winding layers is the important factor and will reduce the leakage inductance by a factor of \$  1/M^2 \$, where \$M\$= number of interfaces. The standard physical arrangement for interleaved windings:

*

*M=1: P : S

*M=2: S/2 : P : S/2

*M=4: P/4 : S/2 : P/2 : S/2 : P/4

*M=6: S/6 : P/3 : S/3 : P/3 : S/3 : P/3 : S/6

Where P & S are primary and secondary number of turns (P & S are interchangeable in the above formulas, e.g., you can do P/2 : S : P/2 for M=2).
For a narrow band transformer there is an optimal wire diameter, in metres, to minimize AC + DC copper losses.
$$ d_{opt} = {\sqrt[6]{128 \left({ \hat I \; \rho_c } \over {\pi \omega s \bar {\hat B} }  \right)^2}}  $$
Where
\$ \;\; \rho_c \$ = resistivity of the wire in \$\Omega \; m\$ (approx \$1.72 \times 10^{-8}\$ for annealed copper wire)
\$ \;\; \omega = 2\pi f\$ = angular frequency
\$ \;\; s = \$ number of wire strands
\$ \;\; \bar {\hat B} = \$ average value of peak flux density [T] over the space occupied by the winding \$ = {{\mu_o N \hat I} \over {l_e}} \$
\$ \;\; \mu_o = \$ magnetic constant \$ = 4 \pi 10^{-7} \$
\$ \;\; \hat I = \$ peak current which cancels out
\$ \;\; l_e = \$ effective magnetic path which is approx equal to the winding breadth for an ungapped core in metres
Good references for transformer design:
"Soft Ferrites", E. C. Snelling
"Ferrites for Inductors and Transformers", Snelling & Giles
These books can be found in uni libraries.

A: It is better to do interleave winding method to reduce the number of consecutive layers with rising MMF proximity losses towards centre of core.
Since your turns ratio is 2:1  this is what your interleave pattern should be 2P1S... repeating.
If Eddy current proximity losses can be minimized, the benefit is lower core temp rise at rated current.
There are many variables with core types , geometry and winding methods and skin depth becomes more important as the number of layers increases.


text: Q: Xtragrid sorting appears not to be reliably removed I have a DevExpress Xtragrid on Winforms that I'd like to keep in the same sort order even when cells are edited by the user. My problem is that even after all the sorts are cleared (by ctrl-clicking the column headers) sometimes the rows will still jump around as though sorting dynamically. I wonder if anyone has any clue as to why this might be happening.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How count the most frequently repeated phrases in Pandas I have Pandas dataframe with one text column. I want to count what phrases are the most common in this column.
For example, from the text, you can see that phrases like a very good movie, last night etc. appears a lot of time.
I think that there is a way of defining n-grams, for example that phrase is between 3 and 5 words, but I do not know how to do that.
import pandas as pd

text = ['this is a very good movie that we watched last night',
        'i have watched a very good movie last night',
        'i love this song, its amazing',
        'what should we do if he asks for it',
        'movie last night was amazing',
        'a very nice song was played',
        'i would like to se a good show',
        'a good show was on tv last night']

df = pd.DataFrame({"text":text})
print(df)

So my goal is to rank the phrases (3-5 words) that appears a lot of times

A: First split text in list comprehension and flatten to vals, then create ngrams, pass to Series and last use Series.value_counts:
from nltk import ngrams
vals = [y for x in df['text'] for y in x.split()]

n = [3,4,5]
a = pd.Series([y for x in n for y in ngrams(vals, x)]).value_counts()
print (a)
(a, good, show)                      2
(movie, last, night)                 2
(a, very, good)                      2
(last, night, i)                     2
(a, very, good, movie)               2
                                    ..
(should, we, do)                     1
(a, very, nice, song, was)           1
(asks, for, it, movie, last)         1
(this, song,, its, amazing, what)    1
(i, have, watched, a)                1
Length: 171, dtype: int64

Or if tuples should be joined by space:
n = [3,4,5]
a = pd.Series([' '.join(y) for x in n for y in ngrams(vals, x)]).value_counts()
print (a)
last night i                  2
a good show                   2
a very good movie             2
very good movie               2
movie last night              2
                             ..
its amazing what should       1
watched last night i have     1
to se a                       1
very good movie last night    1
a very nice song was          1
Length: 171, dtype: int64

Another idea with Counter:
from nltk import ngrams
from collections import Counter

vals = [y for x in df['text'] for y in x.split()]
c = Counter([' '.join(y) for x in [3,4,5] for y in ngrams(vals, x)])

df1 = pd.DataFrame({'ngrams': list(c.keys()),
                   'count': list(c.values())})
print (df1)
                   ngrams  count
0               this is a      1
1               is a very      1
2             a very good      2
3         very good movie      2
4         good movie that      1
..                    ...    ...
166  show a good show was      1
167    a good show was on      1
168   good show was on tv      1
169   show was on tv last      1
170  was on tv last night      1

[171 rows x 2 columns]


text:
Q: Alternative button for turning a laptop "ON" I have a Dell 6400, and the power button has trouble working sometimes, I was wondering if there is anyway to swap its function with a some of the buttons I don't use, like the front media buttons or the MediaDirect button (which also turns the laptop on but in a low-level media-only mode). Or to fix the laptop power button itself?
Thank you so much, I tried to google this one out and looked for software, but I guess this is more of a hardware issue? Any help with this would be greatly appreciated : )
This is what the laptop looks like:

A: I agree with the osther comments from Molly and Niek but would add one thing.
I have seen some Latitude D820/830 that get some dirt or something under the power button and then work sometimes and not others.  Have you removed the cover that runs just below the screen (assuming it is same, can't find a parts diagram)and had a look at the actual button that is usually at the top of the main board?

A: there is no software solution, your only hope is soldering.

A: As Molly said, there would be no software solution for this.
Is this laptop still under warranty? If so, please do consider sending it in. In most cases, they should be able to fix this for you for free. (However, please do make backups of all your important data before sending it in. Some factories format all machines (or even replace the harddrives) by policy before even beginning on hardware work)
Otherwise, I am afraid the only way would indeed be by soldering.

A: if bios supports hotkey power on but might drain battery faster because it would have to supply power to the keyboard even when it's off


text:
Q: In Eclipse, how do I remove the Debug keyboard shortcut for showing the perspective? For some reason, the Debug perspective's keyboard shortcut is bound to the same shortcut as "Open Resource" for me (Command+Shift+R). I only want it for Open Resource. I can't seem to find it when I search for 'debug' in the keyboard shortcut part of the preferences.

A: The command in the keys preferences is called "Show perspective (Debug)". If that is not visible in your version, I would also suggest looking at the filters in the key preferences.

A: Under File -> Preferences, in the popup under General -> Keys is where the bindings are stored.


text:
Q: BeautifulSoup parsed only one Column instead of entire Wikipedia table in Python I am trying to parse 1st table located here using BeautifulSoup in Python. It parsed my First column but for some reason It didn't parsed entire table. Any help is appreciated!
Note: I am trying to parse entire table and convert into pandas dataframe
My Code:
import requests
from bs4 import BeautifulSoup

WIKI_URL = requests.get("https://en.wikipedia.org/wiki/NCAA_Division_I_FBS_football_win-loss_records").text
soup = BeautifulSoup(WIKI_URL, features="lxml")
print(soup.prettify())
my_table = soup.find('table',{'class':'wikitable sortable'})
links=my_table.findAll('a')
print(links)

A: It only parsed one column because you did a findall for only the items in the first column.  To parse the entire table you'd have to do a findall for the table rows <tr> and then a findall within each row for the table divides <td>.  Right now you are just doing a findall for the links and then printing the links.
my_table = soup.find('table',{'class':'wikitable sortable'})
for row in mytable.findAll('tr'):
    print(','.join([td.get_text(strip=True) for td in row.findAll('td')]))

A: NOTE: Accept B.Adler's solution as it is good work and sound advice. This solution is simply so you can see some alternatives as you are learning.
Whenever I see <table> tags, I'll usually check out pandas first to see if I can find what I need from the tables that way. pd.read_html() will return a list of dataframes, and you can work/manipulate those to extract what you need.
import pandas as pd

WIKI_URL = "https://en.wikipedia.org/wiki/NCAA_Division_I_FBS_football_win-loss_records"

tables = pd.read_html(WIKI_URL)

You can also look through the dataframes to see which has the data you want.
I just used dataframe in index position 2 for this one, which is the first table you were looking for
table = tables[2]

Output:
print (table)
                     0    1      ...                  6              7
0                 Team  Won      ...        Total Games     Conference
1             Michigan  953      ...               1331        Big Ten
2         Ohio State 1  911      ...               1289        Big Ten
3         Notre Dame 2  897      ...               1263    Independent
4          Boise State  448      ...                618  Mountain West
5            Alabama 3  905      ...               1277            SEC
6             Oklahoma  896      ...               1274         Big 12
7                Texas  908      ...               1311         Big 12
8                USC 4  839      ...               1239         Pac-12
9             Nebraska  897      ...               1325        Big Ten
10          Penn State  887      ...               1319        Big Ten
11           Tennessee  838      ...               1281            SEC
12     Florida State 5  544      ...                818            ACC
13             Georgia  819      ...               1296            SEC
14                 LSU  797      ...               1259            SEC
15   Appalachian State  617      ...                981       Sun Belt
16    Georgia Southern  387      ...                616       Sun Belt
17          Miami (FL)  630      ...               1009            ACC
18              Auburn  759      ...               1242            SEC
19             Florida  724      ...               1182            SEC
20        Old Dominion   76      ...                121          C-USA
21    Coastal Carolina  112      ...                180       Sun Belt
22          Washington  735      ...               1234         Pac-12
23             Clemson  744      ...               1248            ACC
24       Virginia Tech  743      ...               1262            ACC
25       Arizona State  614      ...               1032         Pac-12
26           Texas A&M  741      ...               1270            SEC
27      Michigan State  701      ...               1204        Big Ten
28       West Virginia  750      ...               1292         Big 12
29          Miami (OH)  690      ...               1195            MAC
..                 ...  ...      ...                ...            ...
101            Memphis  482      ...               1026   The American
102             Kansas  582      ...               1271         Big 12
103            Wyoming  526      ...               1122  Mountain West
104          Louisiana  510      ...               1098       Sun Belt
105     Colorado State  520      ...               1124  Mountain West
106        Connecticut  508      ...               1107   The American
107                SMU  489      ...               1083   The American
108       Oregon State  530      ...               1173         Pac-12
109               UTSA   38      ...                 82          C-USA
110       Kansas State  526      ...               1207         Big 12
111         New Mexico  483      ...               1103  Mountain West
112             Temple  468      ...               1094   The American
113         Iowa State  524      ...               1214         Big 12
114             Tulane  520      ...               1197   The American
115       Northwestern  535      ...               1240        Big Ten
116                UAB  126      ...                284          C-USA
117               Rice  470      ...               1108          C-USA
118   Eastern Michigan  453      ...               1089            MAC
119   Louisiana-Monroe  304      ...                727       Sun Belt
120   Florida Atlantic   87      ...                205          C-USA
121            Indiana  479      ...               1195        Big Ten
122            Buffalo  370      ...                922            MAC
123        Wake Forest  450      ...               1136            ACC
124   New Mexico State  430      ...               1090    Independent
125               UTEP  390      ...               1005          C-USA
126             UNLV11  228      ...                574  Mountain West
127         Kent State  341      ...                922            MAC
128                FIU   64      ...                191          C-USA
129          Charlotte   20      ...                 65          C-USA
130      Georgia State   27      ...                 94       Sun Belt

[131 rows x 8 columns]


text:
Q: Database Error "Parameter count mismatch" on C++ So I am missing something on the code but I cant figure out what this is. I am trying to isert some values from text fields into the database but I get the error of the article name.
Can somebody help?
I am posting the isert code and the buttons code.
Thanks in advance.
Database.cpp
bool    Database::insertStudent(Student &s)
{
bool success = false;
QSqlQuery query(db);
query.prepare("INSERT INTO student (name,lastname,semester,studentid) VALUES (:name,:lastname,:semester,:studentid)");
query.bindValue(":name", s.getname());
query.bindValue(":lastname",s.getlastname());
query.bindValue(":semester", s.getsemester());
query.bindValue(":studentid",s.getstudentid());
query.exec();
if(query.exec()) success = true;
else
{
        qDebug() << "Database error:  "
                 << query.lastError();
}
  return success;
}

MainWindow.cpp
void    MainWindow::addSlot()
{

    if(nameEdit->text().isEmpty() || lastnameEdit->text().isEmpty() || semesterEdit->text().isEmpty() ||
            idEdit->text().isEmpty())
    {
        QMessageBox::critical(this,"Error","Empty fields");
        return;
    }
    Student S(nameEdit->text(),lastnameEdit->text(),semesterEdit->text().toInt(),idEdit->text().toInt());
    mydb->insertStudent(S);
    reloadTable();
}

Table name is student and it has 4 fields i created with this code.
Database::Database()
{
    db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName("students.db");
    db.open();
    QSqlQuery q(db);
    q.exec(QString("create table if not exists student(")+
                        QString("id integer primary key autoincrement,")+
                        QString("name varchar(1024),lastname varchar(1024),semester integer,")+
                        QString("studentid integer)"));
}

student.cpp
#include "student.h"

Student::Student()
{
    name="";
    lastname="";
    studentid=0;
    semester=0;
}

Student::Student(QString n,QString l,int s,int p)
{
    name=n;
    lastname=l;
    semester=s;
    studentid=p;
}

QString Student::getname()
{
    return name;
}

QString Student::getlastname()
{
    return lastname;
}

int Student::getstudentid()
{
    return studentid;
}

int Student::getsemester()
{
    return semester;
}

QString Student::toString()
{
    return name+","+lastname+","+QString::number(semester)+","+QString::number(studentid);
}


text:
Q: UML: Real and UnlimitedNatural literals I am not sure that my notation of Real and UnlimitedNatural literals are correct so I did this example. Please, say if this notation is right or wrong.
-----------------------------
|       MyClass             |
-----------------------------
| var1:Real=0.87            |
| var2:Real=1.6E-2          |
| var3:UnlimitedNumber=5..* |
-----------------------------

A: A default value is described by a ValueSpecification (as noted in Chapter 9.5. of UML specs, or here How to specifiy enumeration literal as default value in UML Attribute?).
In your case, you are interested in Reals, and UnlimitedNaturals.

8.4.2 Notation

*

*A LiteralUnlimitedNatural is shown either as a sequence of digits or as an asterisk (*), where an asterisk
  denotes unlimited. Note that "unlimited" denotes the lack of a limit on the value of some element (such as a
  multiplicity upper bound), not a value of "infinity."

*A LiteralReal is shown in decimal notation or scientific notation. Decimal notation consists of an optional sign
  character (+/-) followed by zero or more digits followed optionally by a dot (.) followed by one or more digits.
  Scientific notation consists of decimal notation followed by either the letter "e" or "E" and an exponent
  consisting of an optional sign character followed by one or more digits. The scientific notation expresses a real
  number equal to that given by the decimal notation before the exponent, times 10 raised to the power of the
  exponent.

So var1 and var2 are correct, however var3 is not.
5..* is a multiplicity expressing "at least 5 values", having it as a default value isn't really meaningful.
As for LiteralUnlimitedNatural, this is meaningful primarily for multiplicities, where you can use it to express lack of upper bound.
For default value it is no different to LiteralInteger with constraint >=0 --- any non-negative number.
Integer is any whole number: -2, 0, 27, ...
Natural is any non-negative (>=0) number: 0, 120, ...
UnlmitedNatural is a Natural number or an asterisk *, which means lack of limit;
however * is not a value of itself (it doesn't mean infinity as noted above), but rather lack of value in a specific (multiplicity range) context.


text:
Q: setOpaque(true/false); Java In Java2D when you use setOpaque I am a little confused on what the true and false does.
For example I know that in Swing Opaque means that when painting Swing wont paint what is behind the component. Or is this backwards? Which one is it?
Thanks

A: The short answer to your question is that "opaque" is defined in English as completely non-transparent.  Therefore an opaque component is one which paints its entire rectangle, and every pixel is not at all translucent to any degree.
However, the Swing component opacity API is one of those mis-designed and therefore often mis-used APIs.
What's important to understand is that isOpaque is a contract between the Swing system and a particular component.  If it returns true, the component guarantees to non-translucently paint every pixel of its rectangular area.  This API should have been abstract to force all component writers to consider it.  The isOpaque API is used by Swing's painting system to determine whether the area covered by a given component must be painted for components which overlap it and which are behind it, including the component's container and ancestors.  If a component returns true to this API, the Swing system may optimize painting to not paint anything in that area until invoking the specific component's paint method.
Because of contractual implication of isOpaque, the API setOpaque should not exist, since it is actually incorrect for anything external to call setOpaque since, in turn, the external thing can't know whether the component in question will (or even can) honor it.  Instead, isOpaque should have been overridden by each concrete component to return whether it actually is, in fact, opaque given its current properties.
Because the setOpaque API does exist, many components have mis-implemented it (quite understandably) to drive whether or not they will paint their "background" (for example JLabel and JPanel filling with their background color).  The effect of this is to create an impression with users of the API to think that setOpaque drives whether or not that background should paint, but it doesn't.
Furthermore, if, say, you wish to paint a JLabel with a translucent background you need to set a background color with an alpha value, and do setOpaque(true), but it's not actually opaque - it's translucent; the components behind it still need to paint in order for the component to render properly.
This problem was exposed in a significant way with the Java 6's new Nimbus Look & Feel. There are numerous bug reports regarding transparent components filed against Nimbus  (see stack overflow question Java Nimbus LAF with transparent text fields). The response of the Nimbus development team is this:

This is a problem [in] the orginal design of Swing and how it has been confusing for years. The issue is setOpaque(false) has had a side effect in [existing] LAFs which is that of hiding the background which is not really what it is [meant] for. It is [meant] to say that the component may have transparent parts and [Swing] should paint the parent component behind it.

So, in summary, you should not use setOpaque.  If you do use it, bear in mind that the combination of some Look & Feels and some components may do "surprising" things.  And, in the end, there is actually no right answer.

A: javadoc says : If true the component paints every pixel within its bounds. Otherwise, the component may not paint some or all of its pixels, allowing the underlying pixels to show through.
try this example program too...
http://www.java2s.com/Code/JavaAPI/javax.swing/JPanelsetOpaquebooleanisOpaque.htm

A: I think that the following also needs to be added:
The term opaque has different meanings in Java 2D and in Swing.
In Java 2D opacity is a rendering concept. It is a combination
of an alpha value and the Composite mode. It is a degree to
which the pixel colours being drawn should be blended with pixel
values already present. For instance, we draw a semi-transparent
rectangle over an existing oval shape. The oval is therefore
partially visible. This concept is often compared to light
going trough glass or water.
In Swing, an opaque component paints every pixel within its
rectangular bounds. A non-opaque component paints only a subset of
its pixels or none at all, allowing the pixels underneath it to
show through. The opaque property was set for efficiency reasons; Swing
does not have to paint areas behind opaque components.
Source: Java docs and Filthy Rich Clients

package com.zetcode;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import static javax.swing.SwingConstants.CENTER;
import net.miginfocom.swing.MigLayout;

class DrawingPanel extends JPanel {

    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);

        doDrawing(g);
    }

    private void doDrawing(Graphics g) {

        Graphics2D g2d = (Graphics2D) g;

        g2d.setColor(Color.green);
        g2d.fillOval(20, 20, 100, 100);
        g2d.setColor(Color.blue);
        g2d.setComposite(AlphaComposite.getInstance(
                AlphaComposite.SRC_OVER, 0.1f));
        g2d.fillRect(0, 0, 150, 150);
    }
}

class MyLabel extends JLabel {

    public MyLabel(String text) {
        super(text, null, CENTER);
    }

    @Override
    public boolean isOpaque() {
        return true;
    }
}

public class OpaqueEx2 extends JFrame {

    public OpaqueEx2() {

        initUI();
    }

    private void initUI() {

        JLabel lbl1 = new JLabel("Java 2D opacity");
        JLabel lbl2 = new JLabel("Swing opaque");

        DrawingPanel dpanel = new DrawingPanel();

        MyLabel mylbl = new MyLabel("isOpaque()");
        mylbl.setBackground(Color.decode("#A9A9A9"));

        createLayout(lbl1, lbl2, dpanel, mylbl);

        setTitle("Opaque");
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    private void createLayout(JComponent... arg) {

        JPanel pnl = new JPanel(new MigLayout("ins 10"));

        pnl.add(arg[0], "w 150");
        pnl.add(arg[1], "w 150, wrap");
        pnl.add(arg[2], "w 150, h 150");
        pnl.add(arg[3], "w 150, h 150");

        add(pnl);
        pack();
    }

    public static void main(String[] args) {

        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                OpaqueEx2 ex = new OpaqueEx2();
                ex.setVisible(true);
            }
        });
    }
}

In the code example, we have two components. The component on the left is a panel which uses AlphaComposite to paint a highly translucent rectangle over an oval. The component on the right is a label. Labels are non-opaque in most look and feels. We overwrite the label's isOpaque() method to set a gray background.


text:
Q: Was that random Orion Girl a spy in Star Trek 2009? In the Star Trek 2009 movie, early on, we see Uhura discover that Kirk has had an intimate moment with an Orion Girl during his time at Starfleet Academy.
But if I recall correctly, the Orion Women all generate a pheremone that makes men fight for their attention, and infiltrate societies by posing as slave girls.
So is this random Orion Girl a spy for the people of Orion?

A: No, she was just another of Kirk's sexual conquests. She's probably not a spy for the Orion Syndicate, assuming it even still exists.
Apparently, in the Abrams-verse (Star Trek: 2009, Star Trek: Into Darkness) the people of Orion are already members of the Federation and training at Star Fleet Academy.

A: It appears it was actually the other way around, in that (according to Memory Alpha) Kirk was the one trying to hack into her systems:

According to writers Roberto Orci and Alex Kurtzman, Gaila worked in the computer lab, which is one of the reasons Kirk was interested in her. Kirk became involved with Gaila to gain access to the computer for the Kobayashi Maru simulation. In a scene deleted from the final cut of the film Star Trek, Kirk sent Gaila an e-mail which launched a virus into the simulation computer containing his "cheat patch", allowing him to beat the scenario. [1] During Kirk's hearing, Gaila is clearly visible in the audience, with her arms crossed at all times; in the DVD audio commentary for the film, this was stated to be a holdover from the previous scene, as she is quite upset with Kirk for using her in such a way.

Also in that article (and possibly more relevant):

Screenwriter Roberto Orci said Gaila could have escaped the life of an Orion slave girl because "there's an underground railroad and some of the Orion slave girls got out and they were sold to freedom." [2] This might be seen as contradicting a depiction of Orions established in the Star Trek: Enterprise episode "Bound", wherein Orion women use pheromones to manipulate humanoid men.


text:
Q: UICollectionViewFlowLayout Subclass transform.m34 causing disappearing cells I am working on a Coverflow style layout for UICollectionView. Its a simple enough concept, and just to make it easier there are about 100 tutorials on the subject. However as anyone doing transforms knows, m34 is the magic number. However, as soon as I set it to get some perspective for my rotations, the views disappear. The only appear when the rotation is near 0.
I suspect this is a bounds/zIndex issue, however after days of monkeying around with zIndexes and clipping adjustments, the cells just refuse to appear. Any help is greatly appreciated.
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
{
    NSArray *array = [super layoutAttributesForElementsInRect:rect];

    CGRect visibleRect = (CGRect){self.collectionView.contentOffset, self.collectionView.bounds.size};

    CGFloat maxDistance = visibleRect.size.width / 2.0;
    CGFloat maxRotation = M_PI_2;

    [array enumerateObjectsUsingBlock:^(UICollectionViewLayoutAttributes * attributes, NSUInteger idx, BOOL *stop) {

        CGFloat distanceFromCenter = CGRectGetMidX(visibleRect) - attributes.center.x;

        CGFloat percentageFromCenter = distanceFromCenter / maxDistance;
        percentageFromCenter = MIN(percentageFromCenter, 1.0);
        percentageFromCenter = MAX(percentageFromCenter, -1.0);

        CGFloat angle = percentageFromCenter * maxRotation;

        CATransform3D transform = CATransform3DIdentity;
//        transform.m34 = 1.0 / -800.0;
        transform = CATransform3DRotate(transform, angle, 0.0, 1.0, 0.0);

        attributes.transform3D = transform;
    }];

    return array;
}

A: So thanks to one @mpospese on Twitter. The problem wasn't with the m34 value itself. It was with a particular feature of UICollectionView.

when frame height exceeds collection view's height, cells are removed

So in my case I had a UICollectionViewLayout specially designed to grab the height of the UICollectionView and use it for the height of the cells. Problem is, when m34 is factored in that obviously adjusts the frame and therefore exceeds the bounds. Rather than just clipping the cell like most UIView operations would have done pointing directly to the problem, UICollectionView actually automatically removes cells entirely if they so much as brush the outer-bounds.


text:
Q: How to use the same callback as the arrow in GTK Treeview? If you're familiar with GTK Treeviews, they have an arrow on the left side that allows the expansion of that row. I'd like to hook up this functionality to clicking the row itself, using g_object_set(G_OBJECT(view), "activate-on-single-click", TRUE, NULL); and g_signal_connect(G_OBJECT(view), "row-activated", callback, data);. Right now, I have a callback that causes some problems, but if I expand the tree view row with the arrow, these problems disappear.
Is there any easy way to do this? I was thinking about using gtk_tree_view_row_activated, but I'm not sure how to package the data that goes into the data parameter of g_signal_connect.
Some additional resources:
g_signal_connect()
GTK TreeView
g_object_set()
If there's anything else I can provide, let me know. Thanks!

A: You could use expand_row. The callback for row-activated will provide you with the TreePath.


text:
Q: How to align table data Right or left and color any row in HTML table from JSON Data fiddle link

    var tableValue = [
                      {
                         "5": "15942",
                         "6": "46456",
                         "7": "149079",
                         "8": "231616",
                         "9": "221235",
                         "10": "189642",
                         "11": "144417",
                         "12": "188025",
                         "13": "335321",
                         "14": "405479",
                         "15": "280150",
                         "16": "234051",
                         "17": "243563",
                         "18": "276148",
                         "19": "258459",
                         "20": "228403",
                         "21": "145696",
                         "22": "14966",
                         "OUTLET": "",
                         "BILLDATE": "TOTAL",
                         "TOTAL": "3608648"
                       },
                       {
                         "1": "0",
                         "2": "0",
                         "3": "0",
                         "4": "0",
                         "5": "605",
                         "6": "6073",
                         "7": "8324",
                         "8": "15596",
                         "9": "13424",
                         "10": "15865",
                         "11": "12101",
                         "12": "16792",
                         "13": "31889",
                         "14": "39439",
                         "15": "19949",
                         "16": "17571",
                         "17": "21105",
                         "18": "20803",
                         "19": "22551",
                         "20": "19865",
                         "21": "9632",
                         "22": "5",
                         "OUTLET": "JAYANAGAR",
                         "BILLDATE": "2018-08-01",
                         "TOTAL": "291589"
                       },
                       {
                         "1": "0",
                         "2": "0",
                         "3": "0",
                         "4": "0",
                         "5": "3736",
                         "6": "5177",
                         "7": "10598",
                         "8": "12227",
                         "9": "12020",
                         "10": "12329",
                         "11": "11412",
                         "12": "20662",
                         "13": "32000",
                         "14": "37438",
                         "15": "21690",
                         "16": "18499",
                         "17": "23042",
                         "18": "22779",
                         "19": "19878",
                         "20": "16754",
                         "21": "14371",
                         "22": "1513",
                         "OUTLET": "",
                         "BILLDATE": "2018-08-02",
                         "TOTAL": "296125"

                       }
                     ]

 function addTable() {
      var col = Object.keys(tableValue[0]);     // get all the keys from first object

          var countNum = col.filter(i => !isNaN(i)).length;
         var num = col.splice(0, countNum);
         col = col.concat(num);

                                                                        // shift the first item to last
                                                                        // CREATE DYNAMIC TABLE.
    var table = document.createElement("table");

                                                        // CREATE HTML TABLE HEADER ROW USING THE EXTRACTED HEADERS ABOVE.

    var tr = table.insertRow(-1);                       // TABLE ROW.

      for (var i = 0; i < col.length; i++) {
        var th = document.createElement("th");             // TABLE HEADER.
        th.innerHTML = col[i];
        tr.appendChild(th);
    }

                                                            // ADD JSON DATA TO THE TABLE AS ROWS.
    for (var i = 0; i < tableValue.length; i++) {

        tr = table.insertRow(-1);

        for (var j = 0; j < col.length; j++) {
            var tabCell = tr.insertCell(-1);
            tabCell.innerHTML = tableValue[i][col[j]];
        }
    }

                                                              // FINALLY ADD THE NEWLY CREATED TABLE WITH JSON DATA TO A CONTAINER.
    var divContainer = document.getElementById("newTable");
    divContainer.innerHTML = "";
    divContainer.appendChild(table);
}
addTable()
  table, th, td
            {
                border: solid 1px #DDD;

            }

I am making a html table and the data for HTML table is coming from  Java end  in form of JSON from which i am populating my html table.
What i want is to align all numeric data to right and alphabetical data to left and want to color the text of a single row dark black.
Here below is my code

this is my CSS

    table, th, td
    {
        border: solid 1px #DDD;
        text-align: right;

    }
</style>

I just want to know how can i align the text left or right and how can i give the bold text or color any one of rows using javascript

A: In table add to tr same class as you used in header or just add below
style="font-weight:bold"

for the leftalign go to the td and add below

A: Here I created sample code Hope this will help you. By default, every element takes float: left property.

table {
  border: 1px solid black;
  width: 100%;
}

th,
td {
  text-align: left;
  padding: 8px;
}

tr {
  border: 1px solid black;
}

.right {
  float: right;
}

tr:nth-child(even) {
  background-color: #ccc;
}

    First Name
    Last Name
    Points

    jhon
    Griffin
    $100

    Lois
    Griffin
    $150

    Swanson
    $300

Using jquery do like this
$(document).ready(function(){
    $('#tablecontent tr:eq(2) > td:first-child').addClass('right');
     $('#tablecontent tr:nth-child(even)').css('background-color', '#cccccc');
});


text:
Q: How can I ensure that a resource is a dbpedia-owl:Person? How  can I ensure that a resource is a dbpedia-owl:Person? Currently I have a a pattern like the following.  What can I add to this query to ensure that each ?node is also a dbpedia-owl:Person?
?node dbpedia-owl:something ?edge .

A: As I replied on the DBpedia mailing list, you can use something like
select * where {
  ?influencer dbpedia-owl:influenced ?influencee .
  dbpedia-owl:Person ^a ?influencer, ?influencee .
}

That uses some syntactic sugar that SPARQL defines, but without it, it's simply
select * where {
  ?influencer dbpedia-owl:influenced ?influencee .
  ?influencer a dbpedia-owl:Person .
  ?influencee a dbpedia-owl:Person .
}

It doesn't matter which order you put the triple patterns in.  E.g., you could also write
select * where {
  ?influencer a dbpedia-owl:Person .
  ?influencer dbpedia-owl:influenced ?influencee .
  ?influencee a dbpedia-owl:Person .
}

or
select * where {
  ?influencer a dbpedia-owl:Person .
  ?influencee a dbpedia-owl:Person .
  ?influencer dbpedia-owl:influenced ?influencee .
}

RDF is a graph based data representation, and a graph is a set of directed edges.  The order of triples in the pattern doesn't matter.


text:
Q: TCP connection breaks after 1 message I have a project which i communicate with DNS servers. For example I used googles DNS server. After connecting to the server and sending a message, everything works well and the server returns an answer. But by the time i send the second query, the server already closed the connection by himself(sends FIN) and now I send a message to an invalid fd. Is there a known solution to this problem?

A: From the DNS over TCP RFC:

The server should assume that the client will initiate connection
closing, and should delay closing its end of the connection until
all outstanding client requests have been satisfied.

This means that if you send multiple requests simultaneously, the connection will stay open until all the requests have been replied to. But once there are no more pending requests, the connection can be closed.
If you want to make multiple requests, then you either need to send them all at once, or create new connections for each single request.


text:
Q: maximum call stack size exceeded in local database data fetch in for loop I am using  awiat in for loop 2 times for data fetching from local database.
Apparently it works fine but when I open and close the screen/component 4-5 times .It shows me the error. "Maximum call Stack size Exceeded"
I Have tried many solutions like promises to handle it but it still it gives me this error.
code :
for (let i = 0; i < val.length; i++) {
console.log('batchno', val[i].batchno);
let result = await item.GetPendingCountwithbatchno(val[i].batchno); //from sqllite
let result2 = await item.GetCalledphoneNumberCountswithbatchno(
val[i].batchno,
); // from sql lite
  let pending = result.rows.item(0).Cnt;
  let called = result2.rows.item(0).Cnt;
  val[i].pending = pending;
  val[i].called = called;
}
console.log('val:', val);
console.log('lastindex:', lastindex);
//return val;
if (val[lastindex].pending != undefined) setbatchlist([...val]);

};


text:
Q: Add/complete fixed number of columns on dataframe in R I'm processing multiple R files some have 3 columns
id v_1 v_2 V_3
 1 1   2   3

Other have more some less
id v_1 v_2
 1 1  7

Is is possible to "force" every file to have 10 columns (not counting id col) and the extra ones with no values such that you get
For the first example
id v_1 v_2 v_3 v_4 v_5 v_6 v_7 v_8 v_9 v_10
1  1   2   3

And for the second example
id v_1 v_2 v_3 v_4 v_5 v_6 v_7 v_8 v_9 v_10
1  1  7

So basically regardless of the number of columns from the input file you always get 10 columns

A: Here is a possibility using bind_rows, where you first create an empty dataframe with the desired columns, then bind them together.
library(dplyr)

df_cols <- setNames(data.frame(matrix(ncol = 11, nrow = 0)), c("id", paste0("v_", 1:10)))

bind_rows(df_cols, df)

Another (probably faster option) is to use data.table:
library(data.table)

rbindlist(list(df_cols, df), fill = TRUE)

Another option is to use plyr:
plyr::rbind.fill(df_cols, df)

Output
  id v_1 v_2 v_3 v_4 v_5 v_6 v_7 v_8 v_9 v_10
1  1   1   2   3  NA  NA  NA  NA  NA  NA   NA

If you have a list of dataframes, then you could use map to update all the dataframes in the list:
library(tidyverse)

map(list(df, df2), bind_rows, df_cols)

#[[1]]
#  id v_1 v_2 v_3 v_4 v_5 v_6 v_7 v_8 v_9 v_10
#1  1   1   2   3  NA  NA  NA  NA  NA  NA   NA

#[[2]]
#  id v_1 v_2 v_3 v_4 v_5 v_6 v_7 v_8 v_9 v_10
#1  1   1   2  NA  NA  NA  NA  NA  NA  NA   NA

Data
df <- read.table(text = "id v_1 v_2 v_3
 1 1   2   3", header = T)

df2 <- read.table(text = "id v_1 v_2
 1 1   2", header = T)


text:
Q: How can I create (approximately) the double sigmoid in the shown figure? I want to create  (approximately) the double sigmoid in the shown figure as
a function in terms of the parameters X,Y,Z, a,b,c and d.
Any idea?  Thanks.

A: This question seems to have gone ignored, so try something like this:
k = 1   # adjust this for "sharpness"

s(x) = (tanh(k * x) + 1) / 2

f(x) = X + (Y-X) * s(x-b) + (Z-Y) * s(x-c)

Here's an example plot.


text:
Q: Is there any component equivalent in LWC or AURA for apex:actionPoller? Is there any component equivalent in LWC or AURA for apex:actionPoller ?
I know that we could achieve the functionality of apex:actionPoller by setTimeout() method, but I wonder if we have any component in the Component Library or method which covers this either in LWC or Aura?

A: The equivalent would be lightning:empApi/lightning-emp-api. Instead of asking for updates, it's much easier to listen for updates. If you need a polling mechanism, use setInterval/setTimeout. However, there's almost always a better way to deal with server-side updates, such as event-driven notifications.


text:
Q: ISC-DHCP-SERVER failed, but issues IP fine I am running a PXE service on buster.
On a client it searches for a DHCP server, for about a minute.  Then eventually times-out.
Meanwhile on the server sudo systemctl status isc-dhcp-server.service reports …Active: failed (Result: exit-code)… .  Then I issue sudo systemctl restart isc-dhcp-server.service - reply: Job for isc-dhcp-server.service failed because the control process exited with error code.… .
However back on the client, I restart it and again it searches for a DHCP server.  In a second or two it is assigned an IP … (This happens on each boot - as it should.)
So in order to discover more, on the server, sudo systemctl status isc-dhcp-server.service gives me the PID. Then journalctl _PID=<PID> gives all the messages: … DHCPINFORM from x.y.z.xx via wlan0 and … DHCPACK to x.y.z.xx (a:b:c:d:e:f) via wlan0 - over and over.

*

*Are there really errors?

*Why does the daemon report failed (with non-error responses) when it works?

A: I think you want to figure out what is going on with your DHCP server first and why it isn't reporting good status.  Run this command to get the journal entries as to why it is failing as a good start:
journalctl -u isc-dhcp-server


text:
Q: Starting a resque task within your rails app For development purposes, it is quite convenient to have my resque workers start/stop with my Rails app, but every example I find shows how to run a worker with a rake task.
So, here's what I've done so far, and it I've seen jobs be taken off the queue and processed successfully.  But it's a completely uninformed attempt.  Are there any pitfalls to this approach, or could it be done better?  However, I have encountered one serious problem related to ActiveRecord.  I'm pretty sure the ralis app and the worker are both using the same activerecord connection at times.  I need to figure that out, clearly.
I ripped off the guts of resques' worker task code, and put it in my config/initializer/resque.rb, like shown below.  I did bother to pre-populate the QUEUES env variable if not set, so that developers don't have to type as much with our rails app.
Resque.redis = Rails.application.config.redis_host

if !$rails_rake_task && Rails.env == 'development'

  # pre-populate QUEUES env var with '*' if not set
  ENV['QUEUES'] ||= '*'

  Thread.new do
    # from: https://github.com/resque/resque/blob/1-x-stable/lib/resque/tasks.rb
    queues = (ENV['QUEUES'] || ENV['QUEUE']).to_s.split(',')

    begin
      worker = Resque::Worker.new(*queues)
      if ENV['LOGGING'] || ENV['VERBOSE']
        worker.verbose = ENV['LOGGING'] || ENV['VERBOSE']
      end
      if ENV['VVERBOSE']
        worker.very_verbose = ENV['VVERBOSE']
      end
      worker.term_timeout = ENV['RESQUE_TERM_TIMEOUT'] || 4.0
      worker.term_child = ENV['TERM_CHILD']
      worker.run_at_exit_hooks = ENV['RUN_AT_EXIT_HOOKS']
    rescue Resque::NoQueueError
      abort "set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work"
    end

    if ENV['BACKGROUND']
      unless Process.respond_to?('daemon')
        abort "env var BACKGROUND is set, which requires ruby >= 1.9"
      end
      Process.daemon(true, true)
    end

    if ENV['PIDFILE']
      File.open(ENV['PIDFILE'], 'w') { |f| f << worker.pid }
    end

    worker.log "Starting worker #{worker}"

    worker.work(ENV['INTERVAL'] || 5) # interval, will block
  end
end

A: I solved this by adding an environment variable in Raquefile
require 'resque/tasks'

task "resque:setup" do
  ENV['QUEUE'] = '*'
end

A: So far, the best I've come up with that seems to have no issue is running a rake task using system() in a thread. I was just hoping to avoid creating a whole new process.
Resque.redis = Rails.application.config.redis_host

if !$rails_rake_task && Rails.env == 'development'

  Thread.new do
    system("QUEUE='*'bundle exec rake environment resque:work")
  end
end

A: I think what you want to do is set Resque.inline = true in your development.rb file.  This is a bad idea generally speaking - but if you're trying to debug Resque jobs, or run tests around them, it can be a helpful setting.  Basically, it will run Resque in the same process as your Rails application, pausing the Rails app while the job runs.


text:
Q: Multiple Selects In Query Not Giving All Result Sets In my code there is a loop that gives the results of an SQL query using SqlCommand.
However, for some queries that I need to run there are multiple select statements in the query. For example, this might be what the entire statement would look like:
Dim query as string = "
    Select * from people
    Select * from places
    Select * from items
    Select * from foods"

cmd = New SqlCommand(query, connect)
cmd.Connection.Open()
reader = cmd.ExecuteReader

While reader.HasRows()
//various logic
While reader.Read()
//Do Logic Here
End While
End While

When my query is ran I get the results for the first 2 but since the 3rd one has no results it kicks the application out of the loop and I do not get the results of the 4th select. I need the results of the 4th select also.
Edit: Union will not work for this case because I need to be able to differentiate between result sets in my logic.

A:     static void Main(string[] args)
    {
        cmd = new SqlCommand("zp_multiple_results", connect);
        cmd.Connection.Open();

        reader = cmd.ExecuteReader();

        do
        {
            if (reader.HasRows)
                while (reader.Read())
                {
                    Console.WriteLine(reader[0].ToString());
                }
        }
        while (reader.NextResult());

        cmd.Connection.Close();
        cmd.Connection.Dispose();
        cmd.Dispose();

        Console.ReadLine();
    }


text:
Q: How to include libraries into a executable in c++ I want to make simple application using c++ and SDL libraries on mac. When I try to make executable with makefile, my SDl libraries are in the "/Library/Frameworks" directory.
CC = g++
CFLAGS = -c -std=c++23 -g
LDFLAGS = -g -I/opt/homebrew/include/SDL2 -F/Library/Frameworks -framework SDL2 -framework SDL2_ttf -framework SDL2_image
SRC = ${wildcard src/* .cpp}
HDR = ${wildcard include/* .hpp}
OBJ = ${SRC:.c=.o}
EXEC = window_app

all: ${SRC} ${OBJ} ${EXEC}

${EXEC}: ${OBJ}
    ${CC} ${LDFLAGS} $^ -o $@

%.o: %.c ${HDR}
    ${CC} ${CFLAGS} $< -o $@

When I run the executable on my computer it works perfect, but when I transfer the executable to another computer, same os, it throws a error on me saying "SDL2, SDL2_ttf and etc..." don't exist on the computer.
I have tried to include the SDL folders into my project and compiling them but they don't work when they are directly inside my project. My question is there a way to compile the libraries with my project? Please and thank you. I am sorry if I am not clear enough, I am new to all of the coding stuff.

A: There are two types of libraries:

*

*static: they are incorporated in the executable. Usually, .a files.

*dynamic link: only the definition of the interface (API) is added to the executable. The library itself remains in a separate file that must be installed. Usually a .so file.

These options are not specifically related to the C++ language. They are system conventions used by any compilation chains.


text:
Q: Java Lucene Stop Words Filter I have about 500 sentences in which I would like to compile a set of ngrams. I am having trouble removing the stop words. I tried adding the lucene StandardFilter and StopFilter but I still have the same problem. Here is my code:
for(String curS: Sentences)
{
          reader = new StringReader(curS);
          tokenizer = new StandardTokenizer(Version.LUCENE_36, reader);
          tokenizer = new StandardFilter(Version.LUCENE_36, tokenizer);
          tokenizer = new StopFilter(Version.LUCENE_36, tokenizer, stopWords);
          tokenizer = new ShingleFilter(tokenizer, 2, 3);
          charTermAttribute = tokenizer.addAttribute(CharTermAttribute.class);

    while(tokenizer.incrementToken())
    {
        curNGram = charTermAttribute.toString().toString();
        nGrams.add(curNGram);                   //store each token into an ArrayList
    }
}

For example, the first phrase I am testing is: "For every person that listens to". In this example curNGram is set to "For" which is a stop word in my list stopWords. Also, in this example "every" is a stop word and so "person" should be the first ngram.

*

*Why are stop words being added to my list when I am using the StopFiler?

All help is appreciated!

A: What you've posted looks okay to me, so I suspect that stopWords isn't providing the information you want to the filter.
Try something like:
//Let's say we read the stop words into an array list (A simple array, or any list implementation should be fine)
List<String> words = new ArrayList();
//Read the file into words.
Set stopWords = StopFilter.makeStopSet(Version.LUCENE_36, words, true);

Assuming the list you of stopwords you generated (the one I've named 'words') looks like you think it does, this should put them into a format usable to the StopFilter.
Were you already generating stopWords like that?


text:
Q: Best/neutral sound quality out of a Mac(Book)? And out of a iOS device? (Current models.) Does the headphone jack support digital audio output or not)?
Which is the provides the best sound quality the USB,  Thunderbolt, digital socket or perhaps Mini DisplayPort from the Mac of the Mac? and how does that compare with the output of the iPhone/iPod/iPad?
Please note this is actually two questions in one. I both ask about the output of the Mac(Book)s and iOS devices, respectively. Current models.
[For my question not to sound too subjective, I ask about natural, neutral sound.]
More info: NwAvGuy: Headphone & Amp Impedance (Basically he argues less - near zero - impedance is better.)

A: I am not an audiophile so I can't answer your subjective quality question (which is better-sounding).  But I can tell you that the headphone jack on your MacBook does include optical audio in a format called mini-TOSLINK, which you will need an adapter to get in a standard TOSLINK.
I have never had an audio quality issue with the standard copper-line devices I've plugged into my MacBook or iPhone or iPod.  My experience with outputting to TOSLINK extends only to sound systems which are a bit more dependant on the quality of the speakers, so I doubt the optical connector would be to blame with that.
If you are working with video, you may want to avoid TOSLINK as it apparently adds a bit of delay, but if you follow your "reduce impedance" rule, TOSLINK is probably the way to go.  Everything here is going to go through some digital stage of encoding, but TOSLINK avoids the wire, reducing radio interference and providing enough bandwidth that you can probably live with whatever or lossless (or near lossless) encoding is done.


text:
Q: Error in cef in c# windows forms good afternoon everybody
I was trying to upgrade my GUI in c#
by using the webBrowser component but it doesnt support everything and the file doesnt show as it should be
so i tried using ChromiumWebBrowser which appeared to be a great solution
but when i compiled the project it justs exits without any error
 public ChromiumWebBrowser chromeBrowser;

    public void InitializeChromium()
    {
        CefSettings settings = new CefSettings();

        // Note that if you get an error or a white screen, you may be doing something wrong !
        // Try to load a local file that you're sure that exists and give the complete path instead to test
        // for example, replace page with a direct path instead :
        // String page = @"C:\Users\SDkCarlos\Desktop\afolder\index.html";

        String page = string.Format(@"{0}\html-resources\html\mainmenu.html", Application.StartupPath);
        //String page = @"C:\Users\SDkCarlos\Desktop\artyom-HOMEPAGE\index.html";

        if (!File.Exists(page))
        {
            MessageBox.Show("Error The html file doesn't exists : " + page);
        }

        // Initialize cef with the provided settings
        Cef.Initialize(settings);
        // Create a browser component
        chromeBrowser = new ChromiumWebBrowser(page);

        // Add it to the form and fill it to the form window.
        this.Controls.Add(chromeBrowser);
        chromeBrowser.Dock = DockStyle.Fill;

        // Allow the use of local resources in the browser
        BrowserSettings browserSettings = new BrowserSettings();
        browserSettings.FileAccessFromFileUrls = CefState.Enabled;
        browserSettings.UniversalAccessFromFileUrls = CefState.Enabled;
        chromeBrowser.BrowserSettings = browserSettings;
    }

and this
public void InitializeChromium()
    {
        CefSettings settings = new CefSettings();
        Cef.Initialize(settings);
        chromeBrowser = new ChromiumWebBrowser("http://stackoverflow.com/");
        this.Controls.Add(chromeBrowser);
        chromeBrowser.Dock = DockStyle.Fill;
    }

and the function is called after InitializeComponent
This is what shows after exiting
The thread 'vshost.NotifyLoad' (0x7bc) has exited with code 0 (0x0).
The thread '<No Name>' (0x315c) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x1004) has exited with code 0 (0x0).
'cefTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\dark_\onedrive\documents\visual studio 2012\Projects\cefTest\cefTest\bin\x64\Debug\cefTest.exe', Symbols loaded.
'cefTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\dark_\onedrive\documents\visual studio 2012\Projects\cefTest\cefTest\bin\x64\Debug\CefSharp.Core.dll'
'cefTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\dark_\onedrive\documents\visual studio 2012\Projects\cefTest\cefTest\bin\x64\Debug\CefSharp.WinForms.dll'
'cefTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\dark_\onedrive\documents\visual studio 2012\Projects\cefTest\cefTest\bin\x64\Debug\CefSharp.dll'
The program '[8200] cefTest.vshost.exe: Managed (v4.0.30319)' has exited with code -2147483645 (0x80000003).

hope that someone can help

A: Make sure you are using same .Net FrameWork (4.5.2) or more


text:
Q: Coldfusion and Associative Arrays I am used to handling my associative arrays PHP style, where I would have something like the following
array[day][time] = count

This allows me to easily count the number of times something appears and its an easy structure to work with. In my case here, I am reading a resultset from a database and getting something like this to work would be really helpful
How would I do the same type of thing in Coldfusion?

A: This is a followup to a comment Reginold had about checking whether the struct is defined:
<cfset thisvar = '04/MAR/2012'>
<cfset thatvar = '04:11'>
<cfset myStruct[thisvar][thatvar] = 'test'>

<cfif structKeyExists(myStruct,thisvar) and structKeyExists(mystruct[thisvar],thatvar)>
    Both Keys Exist.

</cfif>

<cfif isDefined('myStruct.#thisvar#.#thatvar#') >
    Key Exists.

</cfif>

<cfdump var="#myStruct#">

A: This looks like a structure to me - and you can create it easily the way you are used to:
<cfscript>

   myStruct = { day= { time = count}};

</cfscript>

Or using the old syntax which perhaps outlines it better.
<cfset mySTruct = structNew()/>
<Cfset mySTruct.day = structNew()/>
<Cfset myStruct.day.time = count/>

Remember too that a ColdFusion query object is already an exceedingly useful little data construct with a format of queryName[struct][row] - and query of a query (where you can utilize SQL to simply query a query object) allows easy access to this data as well.
Hope this helps you Reg. Good luck.

A: You can do this with Coldfusion arrays, too.
array = [[], []];// initialize array

array[1][1] = 1;// set a value in the array

Just remember that Coldfusion arrays start at an index of 1, not 0.


text:
Q: ASP.net paypal form within server form If I put my Paypal button on my ASP.net website, it doesn't work because the whole page is wrapped in a <form runat="server"></form> tag.
What's the best way to integrate:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    ....
</form>

Onto my ASP.net page?

A: You need to use the PayPal NVP API.  Gives you much more flexibility than the pre-made buttons as well.


text:
Q: Google Maps mapView is only gray only on iMessage app I am working on an iMessage app for which I'd like to have access to google maps. Despite following the tutorial for getting started, the map presents the google logo and stays grey. The common solve for this is making sure the API Key is bound to the right bundle identifier and that the associated account has the Maps SDK enabled. I have checked all of the identifier, API Key, and status of "Google Maps SDK for iOS" in the google console. All of these are fine and set as expected from typical troubleshooting. When I run the code that displays the map, there are no print statements indicating an issue with anything related to the Maps SDK.
In trying to debug, I created a non-iMessage app and tried to load a map using the same API Key. The map loaded in this case.
Note that the one deviation from the tutorial is that since iMessage apps don't have an AppDelegate class, I have called the ".provideAPIKey(...)" method in the viewDidLoad of the first view controller in my app. Doing the same for the non-iMessage app had no impact on it's ability to present a map
This API Key uses google places, which functions just fine on the iMessage app. Is there anything special I need to do to get google maps working in iMessage apps? If not, what are common debugging approaches to handle iMessage apps and the google sdk?

A: Update: I have contacted Google's support team with contained examples and they have been able to replicate the bug on their end. Their engineers are working on it, and I will update this answer when they have.


text:
Q: Using a JWT token with delegation (ActAs) I have a working implementation of a Claims based authentication system implemented with WIF and .NET 4.5. It contains the usual pieces:

*

*Custom STS with Passive and Active endpoints

*Backend WCF service

*Frontend MVC application

*Frontend WebApi application

The calls from the frontend applications to the backedn WCF service use Delegated authentication, so the user authenticates in the Frontend app, the app requests a new token with ActAs=BootstrapToken and then calls the WCF service.
This is all working correctly with SAML tokens.
Now I want to use a JWT token to talk to the WebApi, so I installed the JSON Web Token Handler For the Microsoft .Net Framework 4.5 Nuget package in my STS and WebApi projects.
So I have my STS correctly issuing signed JWT tokens and my WebApi Relying Party validating the same token. All fine.
The problem:
If I use the JWT token in the ActAs field of my RST, it will be sent without the signature, so its naturally rejected by the STS. It seems that the token returned by the SecurityTokenHandler.ReadToken() method returns a token without any signature info.
Now my dilemma is this: Is this a supported scenario for a JWT token? As far as I understand, a JWT token doesn't carry all the information to validate the signature, as opposed to a SAML token, so is there any other limitations?
On the other hand, if this is indeed supported, does anyone implemented this before, or has any ideas? This is a developer preview, so could it be a bug?
Edit
This is a sample to illustrate the issue. The code produces the same results when run in the STS (with access to the signing key) and on a Relying Party (with access to the certificate's public key:
System.Diagnostics.Debug.WriteLine("Raw Token       : {0}", (object)rawToken);

var readToken = this.identityConfiguration.SecurityTokenHandlers.ReadToken(rawToken);

this.identityConfiguration.SecurityTokenHandlers.ValidateToken(readToken);

var serializedToken = this.identityConfiguration.SecurityTokenHandlers.WriteToken(readToken);

System.Diagnostics.Debug.WriteLine("Serialized Token: {0}", (object)serializedToken);

Produces the following
Raw Token       : eyJAi(...)x3a9.eyJvYXB(...)DYzWiJ9.y-lT(...)PyBUTw
Serialized Token: eyJAi(...)x3a9.eyJvYXB(...)DYzWiJ9.

So, clearly, a Read/Write roundtrip loses the signing information. I could understand why this happens in the RP, but not in the STS.
Edit 2
So here's the current JWTSecurityTokenHandler.WriteToken(SecurityToken token) implementation:
public override string WriteToken(SecurityToken token)
{
    Utility.VerifyNonNullArgument("token", token);
    JWTSecurityToken jWTSecurityToken = token as JWTSecurityToken;
    if (jWTSecurityToken == null)
    {
        throw new SecurityTokenException(string.Format(CultureInfo.InvariantCulture, "JWT10200: This instance of JWTSecurityTokenHandler can only write SecurityTokens of type '{0}', a SecurityToken of type '{1}' was received.", new object[]
        {
            typeof(JWTSecurityToken),
            token.GetType()
        }));
    }
    string text = string.Empty;
    string text2 = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", new object[]
    {
        jWTSecurityToken.EncodedHeader,
        jWTSecurityToken.EncodedPayload
    });
    if (jWTSecurityToken.SigningCredentials != null)
    {
        text = this.Sign(text2, jWTSecurityToken.SigningCredentials);
    }
    return string.Format(CultureInfo.InvariantCulture, "{0}.{1}", new object[]
    {
        text2,
        text
    });
}

By looking into it, it's clear that the written token will never have its signature when in a RP, as we don't have the Signing Credentials. So this doesn't look like a bug, but rather an implementation decision. I just don't understand why.
Thanks

A: This is neither a security (or any other) bug, nor implementation decision.
The only location Write can produce a JWT with signature is the issuing point.
Any party other than the token issuer is not supposed to try to re-create it (that's what you mean by Read-Write roundtrip).
When you receive a signed JWT you can only Validate and Read it. You are free to re-transmit the original JWT as is, but you won't be able to "properly" reconstruct it, as you are not the issuer and do not have the appropriate signing key.
This is the very reason behind signing the token: only the original issuer can properly sign it.
If you like, I can try to help you design the correct scenario with security tokens and STS, but for that, please share the sequence diagram of the scenario you are implementing.

A: I wouldn't be surprise if this is a bug - the JWT handler is still in preview mode.
But maybe you don't want to do the full blow ActAs for Web API services - have a look here:
http://blogs.msdn.com/b/vbertocci/archive/2013/01/09/using-the-jwt-handler-for-implementing-poor-man-s-delegation-actas.aspx

A: Have a look at JWTSecurityToken.RawData.  That contains the original encodedToken. And should have the signature from the original issuer.


text:
Q: Sophos Intellix Authenticate API Error trying to Authenticate I am trying to authenticate to the sophos intellix authenticate api:
curl --location --request POST 'https://api.labs.sophos.com/oauth2/token'
--header 'Content-Type: application/json;charset=UTF-8'
--header 'Authorization: Basic {encoded key:secret}'
--data-raw 'grant_type=client_credentials

I am receiving this response:
400 ERROR
The request could not be satisfied.
Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront)
Request ID: cbA_F5avox5aIXvXdc91LFbn0PylJY4LfKqB_bYL7dfMsgCFElTArA==
What am I missing in the cURL request?

A: Oh gosh... had the wrong content type header value
--header 'Content-Type: application/x-www-form-urlencoded'

The full curl request:
curl --location -X POST 'https://api.labs.sophos.com/oauth2/token' --header 'Content-Type: application/x-www-form-urlencoded' --header 'Authorization: Basic {encoded key:secret}' --data-raw 'grant_type=client_credentials' -i


text:
Q: For guest user, MS Graph API of Get Photo returns with 401 error We are building a Microsoft Teams App and in our app users use Graph api like
get users
https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http
get photo
https://learn.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0
For normal tenant users, every thing is fine, normal tenant users can get infos of users and photos of users by userIds.
However for guest users, "get users api" works well, but get photo api returns with the following error.
"error":{"code":"NoPermissionsInAccessToken","message":"The token contains no permissions, or permissions can not be understood."

Does anyone knows the reason why this fails only for guest users and only for get photo api?


text:
Q: Lucene StoredField vs StringField performance In lucene indexing part, i started using StoredField, where i dont need to index the fields(before i was using StringField for the same fields).
This is basically for reducing some index space.
I am processing the file with 1 million records, but i dont see any performance difference. But soon i might have to process more than 100 million records.
so, i would like to know will there be any performance hit when i use StoredField compare to StringField?
Thanks
Shankar

A: My guess is that your task is I/O-bound rather than CPU-bound as the most time is spent on document merging rather than simplified indexing (which, for StringField, is very cheap).
Profiling would likely help to reveal if this guess is incorrect.


text:
Q: PHP error using the preg_match function I'm was using PHP eregi function, but I get the notice that it is deprecated. Here's my code:
!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))

Therefore I am trying to replace the function with the preg_match, but seems that I am unable to get the correct pattern for the preg_match, as I get error with the following code:
!preg_match("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))

Here's the error I get from above code:
Warning: preg_match(): No ending delimiter '^' found in

Thanks for any help.

A: You need to use a delimiter at the beginning and end of your regex, commonly /:
!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$/", trim($_POST['email']))

Manual entry: PCRE introduction / delimiters

A: You need to delimit your regular expression:
preg_match("/^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$/",
            ^                                         ^

A: preg_match() wants you to use a delimiter at the start or end of a regex string:
preg_match("/^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$/", trim($_POST['email']))

The delimiter can be several characters, including ~, %, #, /, @, etcetera. Notice that when you pick a delimiter, if that character is used inside the regular expression, it must be escaped with a backslash character (\). For example, using the regex
http://[0-9a-z]+\.com

with the combination of the delimiter /, will require you to escape every occurence of /:
/http:\/\/[0-9a-z]+\.com/

See the PHP manual for more information.

A: Try it like,
!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$/i", trim($_POST['email']))

You must use a delimiter like /

A: By the way, in order to validate an email address, you can use filter_var function as well.
$is_email_valid = filter_var($email, FILTER_VALIDATE_EMAIL);

Details: http://php.net/manual/en/function.filter-var.php


text:
Q: Screen goes randomly black in OS X A Macbook screen goes black randomly, sometimes completely black and sometimes near black (you can still see the GUI).
This happens in OS X Yosemite and also during USB (Mavericks) (Yosemite) install wizards. However the screen remains perfectly bright in the boot selection menu.
You can see it clearly in this video.

As mentioned in the video the model is Macbook mid 2009.
Issues:

*

*F1 and F2 keys don't affect the brightness levels. However they
appear to help to wake up the screen for short periods of time.

*Battery does not affect the screen state.

*The screen is always bright during the Boot selection menu.

*Screen rotation does not affect the display.

*Display brightness is set to 100% and Power options are set to max
with or without battery.

*The problem started after upgrading Mac OS X Leopard to Yosemite.


text:
Q: Python all() and bool() empty cases? when using help(all), it returns:
all(iterable)=>bool
return True if bool(x) is True for all values x in the iterable.
if the iterable is empty, return True

help(bool) returns:
bool(x) -> bool
 |
 |  Returns True when the argument x is true, False otherwise.
 |  The builtins True and False are the only two instances of the class bool.
 |  The class bool is a subclass of the class int, and cannot be subclassed.

when trying:
>>>bool()
False

>>>all([])
True

my question is, in case that all's input is the empty list/dict/tuple(i.e. iterator), what's passed to bool??
and how come it returns True, as it's dependent on bool?

A: all(iterable)

...is documented to be equivalent to;
def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True

...which returns False if and only if any value in the list converts to False.
Since there is no element in the list you pass in, no element converts to False, and the result of the function call is True.

A:
[…] what's passed to bool?

Nothing – and not the "nothing" of bool(). bool is never called. Is every element in an empty sequence truthy? Yes! There aren't any that aren't, after all.

A: My guess is that it's implemented something like:
def all(inp):
    return not any(not bool(x) for x in inp)

so an empty iterator is "vacuously true." This makes sense, and corresponds with similar notions in logic -- we usually say that a universal quantifier holds of some proposition over a domain even if an existential one doesn't.

A: bool() is never invoked if all()'s argument is empty.  That's why the docs point out the behavior of all() on an empty input as a special case.
The behavior bool() == False is irrelevant to what all() does in any case.  By the way, in Python bool is a subclass of int, so bool() == False is necessary to be compatible with that int() == 0.
As to why, e.g., all([]) is True, it's to preserve useful identities.  Most importantly, for any non-empty sequence x it's desirable that
all(x) == (bool(x[0]) and all(x[1:]))

and all([]) == True is the only result allowing that identity to hold for all values of x.


text:
Q: Is p.l.(piecewise linear) map continuous? I'm reading Rourke and Sanderson's book "Introduction to Piecewise-Linear Topology", and I tried to show that the composition of two p.l. maps is p.l. (this is an exercise 1.6(2)) , but I couldn't. I think if any p.l. map is always continuous, then I can show that. So what I want to ask is p.l. map is always continuous? And if it doesn't hold, how can I show that the composition of two p.l. maps is p.l.?
(These are the definitions in the book:
For $a\in \mathbb{R}^m, L\subset\mathbb{R}^m$, $aL:=\{(1-t)a+tb; b\in L, t\in[0,1]\}$ is a cone if each point $x\in aL$ which is not $a$ is uniquely expressed by the form $(1-t)a+tb$ ($b\in L, t \in [0,1]$).
$P\subset\mathbb{R}^m$ is a polyhedron if each point $a\in P$ have its cone neighborhood $N=aL\subset P$ with $L$ compact.
$f:P\to Q$ ($P\subset\mathbb{R}^m,Q\subset\mathbb{R}^n$ are polyhedra) is p.l. if each point $a\in P$ have its cone neighborhood $N=aL$ ($L$:compact) such that $f((1-t)a+tb)=(1-t)f(a)+tf(b)$ for any $b\in L,t\in[0,1]$.)

A: Yes, PL maps are always assumed to be continuous. If you read page 1 of their book,  they say "a map is a continuous function." It is very common among topologists to use the word "map" only for continuous maps.


text:
Q: Using variable in mod_rewrite on redirect I have following code, that works perfectly but my problem is I dont want to birds hard coded in RewriteRule.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /birds/$1 [L,R=301]

I dont want to add it manually because there are many folders like "birds"
Example:
from
http://domain.com/birds/x.html/

to
http://domain.com/birds/x.html

but in my case it returns to
http://domain.com/x.html

A: You can capture full URI path from RewriteCond %{REQUEST_URI} instead of RewriteRule which is relative to current directory:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(/.*)/$
RewriteRule /$ %1 [L,R=301,NE]

A: You want a rewrite map.
http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewritemap
http://httpd.apache.org/docs/2.4/rewrite/rewritemap.html
Then you can do the following
RewriteMap MyDirs "txt:/etc/apache2/mydirs.txt"
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)/?$ /${MyDirs:$1/ [L,R=301]


text:
Q: A/B testing for React SSR app with chunking Versions:
webpack: 4.30.0,
react: 16.8.6,
react-loadable: 5.5.0,

I'm having one entry JS in webpack. Other chunks are currently created using react-loadable and vendor JS is created using splitChunks.
Idea of my application:
SSR and chunking is working with react-loadable for route-level components. And dynamic-components chunk can be made using either webpack's import promise or react Loadable.

Now, I want to introduce A/B testing to these dynamic components.
I've 2 approaches:

*

*First approach: Wrap dynamic-import statement inside if-else to import A/B variation of that dynamic-component. And at server level, I would know that for a given user, I would set a flag in Redux store, in order to select A/B variation.
(This approach can be followed for whether app is SSR and SPA.)
Notes for this approach:
a. Seems doable :P
b. Can't scale for A/B/C very easily. In this case, I would have to introduce a 3rd else condition to dynamically import C variation. It'll bust the browser caching for the route-level component's chunk(containing these variations) because hash in file name is changed. And same will happen to all the route-level components which takes effect for adding additional C testing.
c. Have to unnecessarily pollute code with if-conditions. If A/B testing is completed, then code again will have to modified, which busts the browser cache again.

*Second Approach: I'll have only 1 dynamic import in code but I want 3 different chunks for the same component A, B and C, like A/some_chunk[hash].js, B/some_chunk[hash].js and C/some_chunk[hash].js. And at server level, I would use same logic for segmenting the user for A/B/C testing as in approach 1, but instead of setting flag in redux store, **I'll serve some_chunk[hash].js from A, B or C folder as per user's segment.
Notes for this approach:
a. I need to ask how we can create chunks for dynamic-component without they being actually imported in a file.
b. Can very easily scale for A/B/C testing, since now A/B testing is now dependent upon which variation of file server is serving.
c. No polluting of code with if-else conditions in client code. No issues of browser cache busting.
d. Will need separate wrapper component for server code for ReactDOMServer.renderToString to know which variation to pick for server side rendering.
Questions:

*

*So, I need to know how we can create chunk as per 2nd approach? Because webpack would ignore creating chunk for the file if not reachable (i.e not imported by any other file)

*Would you recommend this approach. What's the right micro FE app approach of doing AB testing?
PS:
If this is doable, then my roadmap would be to chunk for base layouts as well. Where I can avoid if-else conditions in code and entire layout can be changed as per which A/B variation server sends to browser.

A: This can be done using webpack's weak resolve
Example from webpack docs:
const page = 'Foo'; // Trick: Can be taken from props
__webpack_modules__[require.resolveWeak(`./page/${page}`)];

My use case:
Suppose, we're doing A/B testing on component D which has variations D1, D2 and D3.
We can make folder D/ with D1.js D2.js and D3.js variations inside this folder. Now, require.resolveWeak('./D/${variation}') will pack chunks for D1, D2 and D3 in the build folder. Now, on runtime, passing the props to pick the particular variation will dynamically load that JS.
Note: For eg: to pick D2 variation, experiment name also must be D2 (or else you must store mapping of experiment name to component name) to be passed as props. Generally, people do A/B testing by just having multiple if-elses. So, in the loadVariationOfD.js, instead of having weak resolve import statement, if-else is used with dynamic imports(I'm using loadable-components for this).


text:
Q: How can I improve my Current Region selector? I have made a simple macro assigned to a hotkey to select the current region and then remove the header row. The problem is that the ranges we work with are often full of blank cells which prevent the selector from capturing the entire table dependant on the activecell.
I thought about maybe simply creating a loop, offsetting the ActiveCell and trying again until it hits an illegal range, but I have a bad feeling about this approach.
Sub multieditSelect()
Dim tbl As Range
If ActiveCell.Value = "" Then
    MsgBox "Select a cell with something in it, you bastard"
    Exit Sub
End If
Call startNoUpdates
Set tbl = ActiveCell.CurrentRegion
tbl.Offset(1, 0).Resize(tbl.Rows.Count - 1, _
tbl.Columns.Count).Select
Call endNoUpdates
Selection.Copy
End Sub

Is there a way to make this more reliable?
Edit: Let me add further complication/detail to this problem...
We work with a database and editing records en masse requires exporting them into excel, and the copy/pasting them back into the web interface, so it is common for us to be working with numerous tables of different size, using a worksheet like a notepad to store and modify them.
I want to create a sub that will select the current region irrespective of where it lies on the worksheet, quite possibly this is the third or fourth table to have been pasted onto the same sheet.
This makes going by the last column or last row too inflexible. CurrentRegion is ideal were it not for it's occasional failure to detect the table... so I suppose I need to build my own version of CurrentRegion that will overcome it's shortcomings.
Edit2: I've come up with a lazy solution.
Since these tables will always have a header, I'll just have the activecell offset up till it hits something, and hopefully that will be the header if an empty column is the starting point.
I think this will still be unreliable should there be a pocket of cells surrounded by empty cells in the middle of the table.
Sub multieditSelect2()
Dim tbl As Range
On Error GoTo errmsg
startNoUpdates
Do While ActiveCell.Value = ""
    ActiveCell.Offset(-1, 0).Activate
Loop
startNoUpdates
Set tbl = ActiveCell.CurrentRegion
tbl.Offset(1, 0).Resize(tbl.Rows.Count - 1, _
tbl.Columns.Count).Select
endNoUpdates
Selection.Copy
Exit Sub

errmsg:
endNoUpdates
errMsgBox = MsgBox("Couldn't find a table!", vbCritical, "Error!")
End Sub

Edit3: Here is an example of where my code calls down:

I would like it to be able to capture the table even in this scenario where a cell in the test region is the activecell... but how?

A: Additional to my comment, see if this helps improve your logic (see comments in code for more details):
Sub multieditSelect()

Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets("Sheet1") 'use a variable for the sheet you want to use

Dim tbl As Range
Dim lRow As Long, lCol As Long

lRow = ws.Cells(Rows.Count, 1).End(xlUp).Row 'last row at column 1
lCol = ws.Cells(1, Columns.Count).End(xlToLeft).Column 'last column at row 1

Set tbl = ws.Range(ws.Cells(2, l), ws.Cells(lRow, lCol)) 'Set the range starting at row 2, column 1, until last row, last col

Call endNoUpdates(tbl) 'pass your range as a parameter if you require this specific range in your other sub

tbl.Copy Destination:=tbl.Offset(0, 20)  'copy 20 columns to the right

'Alternative
ws.Range("W1").Resize(tbl.Rows.Count, tbl.Columns.Count).Value = tbl.Value 'copy values to specific range

End Sub

Sub endNoUpdates(tbl As Range)

    'do something with this range, i.e.:
    Debug.Print tbl.address

End Sub


text:
Q: Informatica Stored Procedure Transformation Is there a way to call a stored procedure transformation which has no input and output parameters defined in the stored procedure? Please advise.

A: I think the easiest way is to create a dummy mapping (first create a dummy table in the source which has columns for different data types) and then call the stored procedure in the pre-sql or post-sql for the session.


text:
Q: why a "" in the 0th index of an array on perfoaming a split() w/o delimiters? public static void main(String[] args) {
    // TODO Auto-generated method stub

    String str="aaabbddaabbcc";
    String[] str2=str.split("");
    String pointer=str2[0];
    int count=0;
    String finalStr="";
    for(String str132:str2)
    {
        if(str132.equalsIgnoreCase(pointer))
        {
            ++count;
        }
        else
        {

            finalStr+=str132+count;
            count=0;
            pointer=str132;
            ++count;
        }
    }
    System.out.println(finalStr);
}

On performing a str.split(""), why am I getting a "" in the 0th index of the str2 array?

A:
why am i getting a "" in the 0th index of the str2 array?

Because the delimiter you use has matched here:
 aaaabbddaabbcc
^

Since .split() collects the parts is has "walked by" when it progresses into the string, here it collects the empty string.
Note also that since the delimiter is empty, in order to avoid infinite loops, at the next iteration, .split() will forward one character before starting to search again.


text:
Q: jquery ui autocomplete multiple remote not working So I can search the database and return the values I want but when I attempt to add more than one value to the input field, the search request returns no results.
my javascript:
$(function() {
function split( val ) {
    return val.split( /,\s*/ );
}
function extractLast( term ) {
    return split( term ).pop();
}

$( "#tags" )
    // don't navigate away from the field on tab when selecting an item
    .bind( "keydown", function( event ) {
    if ( event.keyCode === $.ui.keyCode.TAB &&
    $( this ).data( "ui-autocomplete" ).menu.active ) {
        event.preventDefault();
    }
})

.autocomplete({
    source: function( request, response ) {
        $.ajax({
            url: "search.php",
            type: "GET",
            dataType: "json",
            data: { term: request.term },
            success: function (data) {
                response($.map(data, function (item) {
                    return { value: item.tag };
                }))

            }
        })
    },

    search: function() {
        // custom minLength
        var term = extractLast( this.value );
        if ( term.length < 2 ) {
            return false;
        }
    },

    focus: function() {
        // prevent value inserted on focus
        return false;
    },

    select: function( event, ui  ) {
        var terms = split( this.value );
        // remove the current input
        terms.pop();
        // add the selected item
        terms.push( ui.item.value );
        // add placeholder to get the comma-and-space at the end
        terms.push( "" );
        this.value = terms.join( ", " );
        return false;
    }
});
});

and my returned json looks like this:
[{"tag":"tag1"},{"tag":"tag2"}]

What am I missing?


text:
Q: How narrow union of object types when the discriminating field has overlap? I have a type below:
type Animal = {
  kind: 'cat';
  params: string;
} | {
  kind: 'dog';
  params: number[];
} | {
  kind: string;
  params: Record<string, string>
}

When I'm trying to narrowing down the Animal type using switch, it couldn't narrow down to specific object type.
switch (animal.kind) {
  case 'cat':
    console.log(animal.params.toUpper())  // Error: animal.params is a type of `string | Record<string, string>`
    break;
  case 'dog':
    console.log(animal.params.length)
    break;
  default:
    console.log("animal is an object");
}

But this is not working. In the first case it thinks params is string | Record<string, string>.
I understand it's because string and "cat" has overlap, but how can I make this narrowing happen?

A: As @jcalz mentioned in the comments of the question, It seems that this is a typescript Design Limitation.
Base on the comment here, Typescript needs to do something like negated types (string - cat - ...) which Typescript is not designed desecrate unions like that.


text:
Q: How to calculate determinant of a matrix using pointers in c? I am writing a program to calculate determinant of a matrix using pointers with size up to 3x3 and I've started with writing the formula for 2x2 matrix.
I got an error and it displayed "expression must have arithmetic type" in places of the parentheses at the beginnings of multiplied expressions.
It seems that the program recognize the values as pointers instead of just multiplying values, but I'm not sure either. How do I fix it?
void determinant(int size, int matrix[][MAXSIZE])
{
    int d;
    if(size == 2)
    {
        d = matrix * ((matrix + 1) + 1) - ((matrix + 1) + 0) * ((matrix + 0) + 1);
        printf("Determinant of your matrix: %d\n", d);
    }
}

A: Why not just matrix[0][0] * matrix[1][1] - matrix[1][0] * matrix[0][1]?
You should probably pass a more type-safe argument than int matrix[][] to the function, though (e.g. create some kind of a struct MATRIX_2_2).
For the sake of exercise, if you really want to use pointer arithmetics, you'd probably want to write something like:
d = (**matrix) * (*(*(matrix + 1) + 1)) - (*(*(matrix + 0) + 1)) * (*(*(matrix + 1) + 0));

Here, every first de-reference (that's what an asterisk is) gets a 1-D array of the matrix, and the second one gets a specific value.

A: The question of computing the determinant is a basic math question (totally unrelated to C) and most linear algebra courses would explain how to do that. You actually need to understand how you would compute that "by hand".
A different question is how to represent matrixes (as an abstract data type) in a C program. I would suggest using flexible array members (and pointers to struct-s containing them), and I detailed more how to do that in this answer (which of course you need to complete for your needs).
By combining both approaches (the math side and the programming side) you can complete your homework.
Don't forget to enable all warnings and debug info when compiling (e.g. compile using gcc -Wall -Wextra -g with GCC; see also the advice given here), and read How to debug small programs.


text:
Q: ERROR in MAP SIDE JOIN in HIVE I found we have to set the below property if want to run only map phase in join.i.e reduce=0.then i am getting error as below.if i set the property as false map-reduce run and join happens sucsessfully.
hive> set hive.auto.convert.join=true;

hive> set hive.mapjoin.smalltable.filesize=(default it will be 25MB);
Query returned non-zero code: 1, cause: 'SET hive.mapjoin.smalltable.filesize=(default it will be 25MB)' FAILED because hive.mapjoin.smalltable.filesize expects LONG type value.
hive> SELECT /*+ MAPJOIN(expense) */ c.ID, c.NAME, o.AMOUNT, o.DATE FROM emp c CROSS JOIN expense o ON (c.ID = o.emp_ID);
Query ID = acadgild_20161226234949_6ede202c-7f91-42ac-a0c9-3b2617fad0ae
Total jobs = 1
java.io.IOException: Cannot run program "/home/acadgild/hadoop-2.6.0/bin/hadoop" (in directory "/home/acadgild"): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at java.lang.Runtime.exec(Runtime.java:620)
    at java.lang.Runtime.exec(Runtime.java:450)
    at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.executeInChildVM(MapredLocalTask.java:289)
    at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.execute(MapredLocalTask.java:137)
    at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
    at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85)
    at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1604)
    at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1364)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1177)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:247)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:199)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:783)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 23 more
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
hive> set hive.auto.convert.join=false;
hive>

A: Map Side Join in Hive can be performed in two ways.

*

*By specifying the keyword, /*+ MAPJOIN(b) */ in the join statement.

*By setting the following property to true.
hive.auto.convert.join=true
I think you are trying to combine both the ways. Please check this blog for more info link
Hope this helps.

A: As the error suggests, the program can't find the native hadoop libraries at /home/acadgild/
What you can do is, try run the below command:
cp -r /usr/local/hadoop-2.6.0/ /home/acadgild/

Now go into hive and try to do that and it should work.