text:
Q: VBA Excel copy cells range from another workbook to active workbook I would like to copy/transfer some cell values from one workbook, which is closed, to my currently active workbook.
  Sub FrontsheetAdd()
  Dim ws As Worksheet, ws2 As String
  Dim Survey As Variant
  ws = ActiveWorkbook.Sheets("Frontsheet") 'set to current worksheet name
  ws2 = ThisWorkbook.Path & "\Site_survey_form.csv"
  Survey = ws2.Sheets("Ci_survey_form").Range("B17").Value
  ws.Range("D28").Value = Survey
  End Sub

but I am getting the error:
Compile error: Invalid qualifier
pointing at the following line:
 Survey = **ws2**.Sheets("Ci_survey_form").Range("B17").Value

There is a lot of similar problems, but they are mostly concentrated on copying a whole sheet from an external workbook or copying some cells from the active workbook to some external workbook. I need something in the reverse sequence.
How can I copy cell data from some external workbook to the workbook I am currently working on (active workbook)?
UPDATE:
After applying the code from the answer below:
 Sub FrontsheetAdd2()
 Dim ws As Worksheet, Survey, Survey2 As Variant

 Set ws = ActiveWorkbook.Sheets("Frontsheet") 'set to current worksheet name
 Survey = CellValClosedWB(ThisWorkbook.Path & "\Site_survey_form.csv", "City*", "B17")
 Survey2 = CellValClosedWB(ThisWorkbook.Path & "\Site_survey_form.csv", "City*", "B15")

 ws.Range("D28").Value = Survey
 ws.Range("D30").Value = Survey2
 End Sub

I get the #REF value in my cells.
Moreover, the macro wants me to open the Excel workbook separately for every value.

Is there any option to fix it?

A: Your code is able to return a cell value, only after opening it, as already it has been recommended.
To extract a cell value from a closed workbook, you may be use an old way (kept for compatibility), ExecuteExcel4Macro. So, use the next function, copying the following code in a standard module:
Private Function CellValClosedWB(ByVal wbFullName As String, shName As String, cellsRange As String)
    Dim foldPath As String, fileName As String, cellAddress As String

    foldPath = left(wbFullName, InStrRev(wbFullName, "\"))
    fileName = Mid(wbFullName, InStrRev(wbFullName, "\") + 1)

    cellAddress = "'" & foldPath & "[" & fileName & "]" & shName & "'!" & _
                                        Range(cellsRange).Address(True, True, xlR1C1)

    CellValClosedWB = ExecuteExcel4Macro(cellAddress)
End Function

It can be used (for your case) in the next way:
Sub testGetCellValue()
    MsgBox CellValClosedWB(ThisWorkbook.Path & "\Site_survey_form.csv", "Ci_survey_form", "B17")
End Sub

Or, in your adapted code as:
Sub FrontsheetAdd()
  Dim ws As Worksheet, Survey As Variant

  set ws = ActiveWorkbook.Sheets("Frontsheet") 'set to current worksheet name
  Survey = CellValClosedWB(ThisWorkbook.Path & "\Site_survey_form.csv", "Ci_survey_form", "B17")
  ws.Range("B17").value = Survey
End Sub

A: I think, that it can be done in much simle way.
As per the tutorial under this link
https://www.youtube.com/watch?v=9R0_h_aoSAE&ab_channel=ExcelCampus-Jon
We can simply do something like this:
  Sub Copyfromoneworkbooktoanother()

   Workbooks("City_survey_form.csv").Worksheets("City_survey_form").Range("B17").Copy _
   ThisWorkbook.Worksheets("Frontsheet").Range("D28")

   End Sub

In a situation, when our target cell is merged with others, we will get an error:
Runtime error 1004 We can't do that for the merged cells
In order to avoid this error, we should expand our target cells by merged range, like discussed here:
https://www.mrexcel.com/board/threads/run-time-error-1004-we-cant-do-that-to-a-merged-cell.1146107/
so as a result our ThisWorkbook.Worksheets("Frontsheet").Range("D28") will be ThisWorkbook.Worksheets("Frontsheet").Range("D28:F28")


text:
Q: Swift, Combine: Is @Published key word for multiple lines? Swift, Combine: Is @Published key word for multiple lines? Is it applicable for more than one property?
Example:
import Combine

final class Demo: ObservableObject {
    @Published
    var value1: Int?
    var value2: Double?
}

This is a valid code.
Question: Is @Published applied to value1 and value2? Or only for value1?
Is it one-liner?

A: It doesn't relate to lines at all.  It's a property wrapper that wraps the property right after it.

redpajama_set_name: RedPajamaStackExchange


text:
Q: mongoose find() function does not return the whole object, skips the empty field I am using mongoose find() to find a particular attribute that looks across various attributes, like this
 exports.isPhoneAlreadyExists = (req, res) => {

  var searchedPhone = req.params.phone;

 var searchOnPhoneWithOr = [{ 'phone1': searchedPhone }, { 'phone2': searchedPhone }, { 'phone3': searchedPhone }, { 'phone4': searchedPhone }, { 'phone5': searchedPhone }];
  contact.find({ $or: searchOnPhoneWithOr }, {}, function (err, resp) {
    if (err) {

        res.send(err);
    }

    res.json(resp);
});
};

it does not returns me the whole object, it only returns those attributes which are non empty, i want to get the whole object along with empty attributes.

A: MongoDB does by default not save empty objects to the DB. To avoid this behaviour, you can set the "minimize" flag in the collection option to "false".
I am not quite sure if this also applies to "primitive" values like strings or numbers, but if you only work with objects, you should be fine.
Check this for more info: https://mongoosejs.com/docs/guide.html#minimize


text:
Q: input type range output is not working for dynamic id's Input type range functionality is not working when the id values are dynamic how can i do that..?

<input name="gdOverallscore" id="gdOverallscore" type="range" min="0" value="0" max="10" step="1" list="ticks" oninput="ageOutputId.value = gdOverallscore.value"/><output id="ageOutputId">0</output>

This is working fine in my case i have dynamic id which is loop"

<input  name="gdskill[<?php echo  $skillLabel['ssid'];?>]"
       id="gdskill[<?php echo  $skillLabel['ssid'];?>]"
       type="range"
       min="0" value="0" max="10" step="1"
       list="ticks"
       oninput="Output.value = gdskill[<?php echo  $skillLabel['ssid'];?>].value"/>
<output id="Output">0</output>

In the second one id values comes like this:
gdskill[1],gdskill[3],gdskill[4],gdskill[6] etc..

A: Try using like this: Id like gdOverallscore[0] will not work.
 <?php

    $skillLabel['ssid']=10;

    ?>

    <input name="gdOverallscore" id="gdOverallscore" type="range" min="0" value="0" max="10" step="1" list="ticks" oninput="ageOutputId.value = gdOverallscore.value"/><output id="ageOutputId">0</output>

    <input  name="gdskill<?php echo  $skillLabel['ssid'];?>"
           id="gdskill<?php echo  $skillLabel['ssid'];?>"
           type="range"
           min="0" value="0" max="10" step="1"
           list="ticks"
           oninput="Output.value = gdskill<?php echo  $skillLabel['ssid'];?>.value"/>
    <output id="Output">0</output>

In Case of MUltiple:
<?php

$skillLabel['ssid'][0]=10;
$skillLabel['ssid'][1]=11;

?>

<?php foreach($skillLabel['ssid'] as $key=>$value){?>
<input  name="gdskill<?php echo  $value;?>"
       id="gdskill<?php echo  $value;?>"
       type="range"
       min="0" value="0" max="10" step="1"
       list="ticks"
       oninput="Output<?php echo  $value;?>.value = gdskill<?php echo  $value;?>.value"/>
<output id="Output<?php echo  $value;?>">0</output>

<?php }?>

DEMO

A: You have to change your Ouptut Id as well or else the output will become same for all hence it wont work..
<input name="[]" id="gdskill<?php echo  $skillLabel['ssid'];?>"

 type="range" min="0" value="0" max="10" step="1"

oninput="Output<?php echo  $skillLabel['ssid'];?>.value = gdskill<?php echo  $skillLabel['ssid'];?>.value"/>

<output id="Output<?php echo  $skillLabel['ssid'];?>">0</output>


text:
Q: Multiple Javascript variables with the same value $scope.visibilityEnabled = 'Disabled';
$scope.invertEnabled = 'Disabled';
$scope.weightEnabled = 'Disabled';
$scope.saturationEnabled = 'Disabled'

I have the above Javascript variables, would it be possible to simplify them down at all and make them efficient?

A: This should work also in Javascript
 $scope.visibilityEnabled =
 $scope.invertEnabled =
 $scope.weightEnabled =
 $scope.saturationEnabled = 'Disabled';

A: You could fairly simply change the values of all of the variables within your script to be the same name, but it wouldn't really make it any more efficient.  It appears that the variables are configuration values, so there is really no reason to do anything with them except change the values to modify the behaviour of the script.
If you're determined that there will be only one variable, use a find and replace editor, but it won't make it more efficient.


text:
Q: How to prove that a straight line is an infinite set of points? From the basic elementary level when we start reading geometry we get this idea developed in us that a straight line is the conjuction of infinite points.but how to prove this?  I mean is this an axiom or its provable?

A: There are many different foundations of geometry. Regarding the infinitude of the points of a straight line, I think, the following axioms of Ordered Geometry are the best to shape intuition:

*

*We do not define what a point is. But we will use capital letters to denote these undefined objects. We do not define what intermediacy is. We just say that triplets of our undefined points may be in intermediacy relation.

*Definition: If $[APB]$ then we say that $P$ is in  between $A$ and $B$.

*Axiom 1: There are at least two distinct points.

*Axiom 2: If $A$ and $B$ are two distinct points, there is at least one point $P$ for which $[ABP]$.

*Axiom 3: If [ABC], then $A$ and $C$ are distinct.

*Axiom 4: If $[ABC]$ then $[CBA]$ an not $[CAB]$.

*Theorem: (1) If $[ABC]$ then not $[CAB]$. (2) If $[ABC]$ then $A$, $B$, $C$ are distinct.

*Definition: If $A$ and $B$ are two distinct points then all the points $P$ for which either $[APB]$ or $[PAB]$ or $[ABP]$ form a line.

*Theorem: A line contains infinitely many points. Proof: There is at least one line because there are at least two points. The second axiom says that besides the two points defining the line the line has further points. Repeated application of of Axiom 2 shows that a line has infinitely many points.

*The axioms I use are the first two axioms of the Pasch-Veblen foundation of ordered geometry.

*Reference: Coxeter: Introduction to geometry.

A: Take your endpoints, call them $S$ and $E$. Pick some point between $S$ and $E$, let us call it $M$. Then, pick a point between $S$ and $M$. Call it $M_2$. Pick a point between $S$ and $M_2$ ....
If you can keep going like that, it is easy to see that the line must have infinite points... and you can keep going on like that. The numbers don't just end.

A: any point, y, on line in 2d cartesian space can satisfy following equation:
y = a*x + b, where a and b are constant real numbers, and x is real number with range (-inf, +inf)
because x has infinite range, so y has inf range.
this prove line has infinite number of points

A: You might know the equation of a straight line through 2 points which is: $$y-y_1=\frac{y_2-y_1}{x_2-x_1}(x-x_1)$$
From that we can see that there are infinite solutions to satisfy this equation which proves that a straight line contains infinite points.


text:
Q: How to get coords of a Tkinter Canvas Image So my problem and question is:
Is it possible to somehow get the second coordinates from an Image.
I created a game in Tkinter with canvas and the rectangle object for example has 4 coords x1,x2,y1,y2 the game works fine it is a brick breaker game.
Now i decided to add images for the ball and the paddle but it seems that it doesnt work to get the second coordinates and it makes the game kinda buggy since i dont get x2 and y2.
Is there a way to get these coordinates?
Heres an example for the game without the pictures:
        def hit_paddle(self, pos):
        paddle_pos = self.gamerootCanvas.coords(self.paddle.id)
        if pos[1] >= paddle_pos[1] and pos[1] <= paddle_pos[3]:
            if pos[0] >= paddle_pos[0] and pos[0] <= paddle_pos[2]:
               return True
        return False

and basically if i add pictures im not able to use  paddlepos[2] and [3] anymore since [0] is x1 [1] is y1 and [2] and [3] are x2 and y2.


text:
Q: how to handle errors using try catch in a dropdownlist inside a detailsview I have a dropdownlist inside a detailsview where I will be editing records inside the details view. My problem is dropdownlist inside the details view is bind to a field and giving an error

'DropDownList1' has a SelectedValue which is invalid because it does
  not exist in the list of items. Parameter name: value

This is due to the selectedvalue value is not in the dropdownlist.
Can someone tell me how to handle this error. I want to use try catch and do nothing and just ignore the error or maybe pass a blank value as selectedvalue in the dropdown.
Main problem I have is I am not sure where to put the try catch statement.
Complete code is below.
   <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
        DataKeyNames="RecordRef" DataSourceID="EntityDataSource1" Height="50px"
        Width="125px">
        <Fields>
            <asp:BoundField DataField="RecordRef" HeaderText="RecordRef" ReadOnly="True"
                SortExpression="RecordRef" />
            <asp:BoundField DataField="CustomerID" HeaderText="CustomerID"
                SortExpression="CustomerID" />
            <asp:TemplateField HeaderText="JobCategory" SortExpression="JobCategory">
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server"
                        DataSourceID="EntityDataSource2" DataTextField="ItemValue"
                        DataValueField="ItemValue" SelectedValue='<%# Bind("JobCategory") %>'>
                    </asp:DropDownList>
                    <asp:EntityDataSource ID="EntityDataSource2" runat="server"
                        ConnectionString="name=CRMSEntities" DefaultContainerName="CRMSEntities2"
                        EnableFlattening="False" EntitySetName="KeyValues">
                    </asp:EntityDataSource>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("JobCategory") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("JobCategory") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="JobDescription" HeaderText="JobDescription"
                SortExpression="JobDescription" />
            <asp:BoundField DataField="JobDate" HeaderText="JobDate"
                SortExpression="JobDate" />
            <asp:BoundField DataField="JobStatus" HeaderText="JobStatus"
                SortExpression="JobStatus" />
            <asp:BoundField DataField="Referral" HeaderText="Referral"
                SortExpression="Referral" />
            <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>

A: You can handle exception with override OnRender method of your usercontrol with using try catch around base.Render

A: Rather than using Try ... Catch, you could use the following in code behind (VB in this case):
Dim ddlItem As ListItem
ddlItem = myDDL.Items.FindByValue(UserInput.ToString())
If Not ddlItem Is Nothing Then
    ddlItem.Selected = True
Else
    myDDL.Text = "Some text to indicate failure"
End If


text:
Q: removing empty lines from a string c++ I'm trying to remove the empty lines created when I remove a person from list in a file so my file looks much nicer when is open. this is Code i have to remove the line.
std::ifstream ifs("alpha.dat");

  std::ofstream tem("temporary.text");

std::string str((std::istreambuf_iterator<char>(ifs)),
std::istreambuf_iterator<char>());

str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());

cout << str;
tem << str;
tem.close();
ifs.close();

my file content is the following:
maria hernandez 1000 h3777 +1000 19:15:19
rachel dominguez 100000 X8793 +100000 19:15:20
carlos yatch 20 g6386 +20 19:15:20

Empty line

carlos Domingues 20 g3336 +20 19:15:20
Empty Line

but What I'm getting on the file is the current:
maria hernandez 1000 h3777 +1000 19:15:19 rachel dominguez 100000 X8793 +100000 19:15:20 carlos yatch 20 g6386 +20 19:15:20

A: You shouldn't just remove all \n's. They don't represent blank lines, rather the start of a newline. You got a blank line when you got more than one consecutive \n.
For removing these consecutive \n characters I'd suggest replacing:
str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());

with something like this:
str.erase(std::unique(str.begin(), str.end(),
                      [] (char a, char b) {return a == '\n' && b == '\n';}),
          str.end());

Working example here.
std::unique removes equal consecutive elements. But since we only want to remove newlines we pass a lambda as predicate. As last we only need to erase the duplicate \n that were moved to the end of the container.

A: To remove blank lines, you need to make sure you are removing redundant \r by turning them all into \n, while making sure you don't accidentally add lines ({'\r', '\n'}), then it's a simple task of removing duplicates.

A: Look for the carriage return occurring twice, and remove one.
size_t pos;
while ((pos= str.find("\n\n", 0)) != std::string::npos)
{
    str.erase(pos, 1);
}

Run it here

A: /* Processing of text lines the method length()
 The search for the longest line of the text.
 Removing of the particular line of text.
The first step.
 Write a function to find the empty line of the text file:*/
//------------------------------------------------------------
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int Find();
void Remove( int k);
//------------------------------------------------------------
int main()
{
 cout << "blank line no "<<"is:   "<<Find()<<endl;
 Remove(Find());
 return 0;
}
//------------------------------------------------------------
int Find()
{
 int nr = 0; string ilg = "";
 int n = 0; string eil;
 ifstream fd("Data.txt");
 while (!fd.eof()) {
 getline(fd, eil);
 for(int i=0;i<n;i++)
 {
 if (eil.length() == 0) {
     nr = n; ilg = eil;}
 }
 n++;

 }
  fd.close();
 return nr;
}
//---------------------
/*The second step. Write a function to remove the given line:*/
//------------------------------------------------------------
void Remove( int k)
{
 string eil;
 ofstream fr("Result.txt");
 ifstream fd("Data.txt");
 // The lines are copied till the removed
 for (int i = 0; i < k; i++) {
 getline(fd, eil);
 fr << eil << endl;
 }
 // The line, which has to be removed, is not copied
 getline(fd, eil);
 // The remaining lines are copied
 while (!fd.eof()) {
 getline(fd, eil);
 fr << eil << endl;
 }
 fd.close();
 fr.close();
}
//---


text:
Q: strawberry perl on windows install Prima failed with no tiff.h I use strawberry perl on windows. I tried to install Prima module, running
install Prima

in CPAN console, I got
> img\codec_tiff.c:14:10: fatal error: tiff.h: No such file or directory
> #include <tiff.h>
>           ^~~~~~~~ compilation terminated. dmake.exe:  Error code 129, while making 'img\codec_tiff.o'   KARASIK/Prima-1.53.tar.gz
> C:\STRAWB~1\c\bin\dmake.exe -- NOT OK Stopping: 'install' failed for
> 'Prima'. Failed during this command:  KARASIK/Prima-1.53.tar.gz
> : make NO

so finally it failed to install Prima. So what to fix missing tiff.h problem?
update
Now I reinstalled the latest strawberry perl version 5.28.1.1
However, installing Prima failed for another reason. Error message as below:
dlltool -l blib/arch/auto/Prima/libPrima.a -d Prima.def -D PRIMA.xs.dll blib\arch\auto\Prima\Prima.xs.dll
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 755 blib\arch\auto\Prima\Prima.xs.dll
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- Prima/VB/VB.pl blib\script\VB.pl
pl2bat.bat blib\script\VB.pl
process_begin: CreateProcess(NULL, pl2bat.bat blib\script\VB.pl, ...) failed.
make (e=2): The system cannot find the file specified.
gmake: *** [Makefile:1165: blib\script\VB.pl] Error 2
  KARASIK/Prima-1.53.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'Prima'.
Failed during this command:
 KARASIK/Prima-1.53.tar.gz                    : make NO

And if I run install Prima the second time, it shows
Running install for module 'Prima'
  KARASIK/Prima-1.53.tar.gz
  Has already been unwrapped into directory C:\STRAWB~1\cpan\build\Prima-1.53-0
  KARASIK/Prima-1.53.tar.gz
  Has already been prepared
  KARASIK/Prima-1.53.tar.gz
  Could not make: Unknown error

What should I do?


text:
Q: C# - Loop through DataGridView Rows using foreach and if statement - Missing last entry I have a DataGridView with a checkbox column.

Now I want to loop through all rows, with an active checkbox and print out the IdUser and True.
foreach (DataGridViewRow row in userDataGridView.Rows)
            {
                if (row.Cells[5].Value.ToString() == "True")
                {
                    MessageBox.Show(row.Cells[0].Value.ToString() + " - " + row.Cells[5].Value.ToString());
                }

            }

In this example the  row with the IdUser 17 is the last selected one.
I don't know why, but I just see entry 15 as the last one. 17 is not shown any more...
Can anybody help?

I tried the following now:
foreach (DataGridViewRow row in userDataGridView.Rows)
            {
                msg += row.Cells[0].Value.ToString() + " - " +
                     row.Cells[5].Value.ToString() + "\r\n";
            }

and experienced, that always the last row with a selected checkbox is somehow not recognized.

A: Ok, I found a solution. I added
userDataGridView.EndEdit();

before the loop and now the last selected checkbox is also recognized.


text:
Q: Regex to get bytes between binary content I have the following 3 strings containing binary data.
s1="\t 28890\tABGT\tXYZW\t 94 23 08 92 00 00 00 EC 02 10 00 E2 00 4B\t\x00\x00\x00\x00\x01\f".force_encoding("ASCII-8BIT")
s2=" \t0000013\t123\t9886\t 95 83 49 26 0E 82 00 A6 08 02 06 C0\x00\x00\x00\x00\x02\xB2\x00\x00\x00\x00\b\xFEF".force_encoding("ASCII-8BIT")
s3=" \t0000013\t123\t9HN3\t 95 83 49 26 0E 82 00 A6 08 02 06 C0\xA1\x02\x00\x00\x02\xB2\b\xFEF".force_encoding("ASCII-8BIT")

I have the following 3 similar regex to get the bytes between *\t and something beginning with \ (i.e. \t, \x00, \xB2, \xFEF)
s1[/(?<=[A-Z]{4}\t ).+?(?=\t)/]
s2[/(?<=[0-9]{4}\t ).+?(?=\x00)/]
s3[/(?<=.+\t ).+?(?=\x..)/]

The first 2 regex work for string s1 and s2 but how could be a more general regex to match the 3 cases?
I tried the regex s3[/(?<=.+\t ).+?(?=\x..)/] but I get error below.
irb(main):> s1[/(?<=[A-Z]{4}\t ).+?(?=\t)/]
=> "94 23 08 92 00 00 00 EC 02 10 00 E2 00 4B"

irb(main):> s2[/(?<=[0-9]{4}\t ).+?(?=\x00)/]
=> "95 83 49 26 0E 82 00 A6 08 02 06 C0"

irb(main):> s3[/(?<=.+\t ).+?(?=\x..)/]
SyntaxError: (irb):4953: invalid hex escape
s3[/(?<=.+\t ).+?(?=\x..)/]
                    ^
invalid pattern in look-behind: /(?<=.+\t ).+?(?=..)/
        from /usr/bin/irb:11:in `<main>'

I think I only need to have the correct regex or is there a better way to extract the desired values without using regex?
Thanks for any help

A: R = /\h{2}(?: \h{2})+/

def extract(str)
  str[R]
end

extract(s1)
  #=> "94 23 08 92 00 00 00 EC 02 10 00 E2 00 4B"
extract(s2)
  #=> "95 83 49 26 0E 82 00 A6 08 02 06 C0"
extract(s3)
  #=> "95 83 49 26 0E 82 00 A6 08 02 06 C0"

The regular expression reads, "match two hex digits (\h{2}) followed by a space followed by two hex digits, those three characters as a group matched one or more times (+), (?: \h{2}) being a non-capture group.

A: #ruby 2.3.1

xs = ["\t 28890\tABGT\tXYZW\t 94 23 08 92 00 00 00 EC 02 10 00 E2 00 4B\t\x00\x00\x00\x00\x01\f".force_encoding("ASCII-8BIT"),
      " \t0000013\t123\t9886\t 95 83 49 26 0E 82 00 A6 08 02 06 C0\x00\x00\x00\x00\x02\xB2\x00\x00\x00\x00\b\xFEF".force_encoding("ASCII-8BIT"),
      " \t0000013\t123\t9HN3\t 95 83 49 26 0E 82 00 A6 08 02 06 C0\xA1\x02\x00\x00\x02\xB2\b\xFEF".force_encoding("ASCII-8BIT"),
      "\t 28890\tABGT\tXYZW\t 94\t\x00\x00\x00\x00\x01\f".force_encoding("ASCII-8BIT"),
      " \t0000013\t123\t9HN3\t 95 83 49 26 0E 82 00 A6 08 02 06 C0".force_encoding("ASCII-8BIT")]

r = /
    (?<=                  # start of lookbehind: asserts that what immediately precedes the current position in the string are
      [[:alnum:]]{4}\t[ ] # a space character, and a tab character and then four alphanumeric characters
    )                     # end of lookbehind
    [[:xdigit:]]{2}       # match two hex digits
    (?:                   # start non-capture group
      [ ]                 # match a space character
      [[:xdigit:]]{2}     # match two hex digits
    )*                    # end the non-capture group and match it zero or more times
    /x                    # free-spacing mode

xs.map { |x| p x[r] }

Output:
"94 23 08 92 00 00 00 EC 02 10 00 E2 00 4B"
"95 83 49 26 0E 82 00 A6 08 02 06 C0"
"95 83 49 26 0E 82 00 A6 08 02 06 C0"
"94"
"95 83 49 26 0E 82 00 A6 08 02 06 C0"


text:
Q: expanding group from an Exchange Contact Group with Outlook 2010 Im not sure if I am going slightly mad, but I am sure in a previous version of Outlook you were able to add a contact group to an email or calendar appointment and then click on a + button that would then break it down to the individuals emails, for you to then edit the final list of people the artifact would be sent to.
I have tried a few things, but I cannot get a copy of the names in the contact group.
I need to get hold of these names to send to a decision maker to allow us to clean up the group. I have asked someone with admin rights on the group to get me the names, but this is very convoluted and not a very high priority.

A: It looks like your system administrator prevented users from seeing this group's members.


text:
Q: Allure generating results for 2 test suites while running only one? I am running a TestNG suite with 3 tests inside the same class. The problem is that when I open the Allure report (using jetty server), I can see 2 suites with the same name and same content inside. There are only 2 difference between each suite.

*

*Suite 2 always finish 1 sec after Suite 1.

*I am doing parallel execution on 3 devices using 3 different threads. if suite has thread order 1,2,3 then Suite 2 will have order 1,3,2 (compared to Suite 1)

The TestNG report looks fine. Can't find any suite duplication there.
Surefire config is given below.

Please find my surefire config below. Executor.xml is my testng xml.
                org.apache.maven.plugins
                maven-surefire-plugin
                2.12.2

            <testFailureIgnore>false</testFailureIgnore>
            <argLine>
                -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
            </argLine>
            <!--only for 1.3.* TestNG adapters. Since 1.4.0.RC4, the listener adds via ServiceLoader-->
            <properties>
                <property>
                    <name>listener</name>
                    <value>ru.yandex.qatools.allure.testng.AllureTestListener</value>
                </property>
            </properties>

                <suiteXmlFiles>
                    <suiteXmlFile>Executer.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </plugin>

A: Since Allure 1.4.0.RC4, the listener adds via ServiceLoader. To avoid result duplication please remove this part of your config.
<properties>
    <property>
        <name>listener</name>
        <value>ru.yandex.qatools.allure.testng.AllureTestListener</value>
    </property>
</properties>


text:
Q: Woocommerce Shipping Calculation Logic The plot:
I am working with a Dropshipping company that has an API for providing products, the shipping is calculated this way:

Every product comes with a shipping size ( S,M,L ... ) and for each country this sizes have different fixed prices. I am saving this shipping size in a custom meta.

Example:
France

*

*Size M: 10$

*Size L: 15$

Spain

*

*Size M: 15$

*Size L: 20$

The problem:
I cannot seem to figure out a way of implementing this into woocommerce. I see that I can setup a flat rate for each country but I cannot implement these different sizes.
If this is not possible with plain Woocommerce, I want to implement something myself with php or I am also open to any official/verified Add-ons.

A: I figured out this on my own - so apparently I can make a shipping class for each of those sizes ( S, M, L ) and then I can setup Flat Rates by country and shipping class. This was very easy after all, no custom code required.

A: insert by location rules with multiple locations you can place fees for each location. A different rate can be configured in woocommerce and can also be configured by postal code

A: You can also use the plugin for handling all this stuff. I figured out this plugin maybe it can help you out. Advanced Flat Rate Shipping Method WooCommerce.
In this plugin you can create your own rules.


text:
Q: PyTube for Audio and video downloader program i have a problem with this program :
from pytube import YouTube
while True:
url = YouTube(input("please enter your YouTube LINK : "))
type = YouTube(input("please enter yr type, audio or video : "))
video = url.streams.first().download()
audio = url.streams.filter(only_audio=True).all()
if type == video:
    print(video)
    break
elif type == audio:
    yt_obj[0].download()
    print(audio)

    break
else :
    print("pls enter audio, or, video :")

print("success")
break

i get this msg :  raise RegexMatchError(caller="regex_search", pattern=pattern) pytube.exceptions.RegexMatchError: regex_search: could not find match for (?:v=|\/)([0-9A-Za-z_-]{11}).*

A: type = input("please enter yr type, audio or video : ")

That should fix it :)


text:
Q: Stripping Non-Text from a Scanned, OCRd PDF I have a PDF created from a scanned document. OCR was used to recognize text. In Acrobat, if I select text, and click 'copy with formatting', I can paste the formatted text into Word, so it seems that fonts and colors are also embedded in the document in addition to just plain text and possibly the size.
Is there any way to use this information to create a PDF that just contains the formatted OCRd text, without the scanned image. Currently, my document only shows the scanned image, and the text is on an invisible layer. I would like to create a PDF document that removes the image that was scanned, and displays the formatted text that is currently hidden.
The following post has a section on "How can we make the invisible text visible?"
PDF has an extra blank in all words after running through Ghostscript
However, doing this does not show the correct text formatting (that is retained when pasting in Word), and I also would like to remove the scanned image so that the final PDF just contains formatted (color, font, size) vector fonts, and no images.

A: Does everyone do everything the hard way now, because the programs are more complex than necessary
What I read is that you are done, you have mastered full control of a scanned text image, other than doing some minor reformatting.
The whole question I am just not understanding. When we OCR here with the most simple free software that comes with the scanner, it can give me 3 simple things.

*

*The Text, raw text the way I wanted it most, no formatting, no colors, not much word wrapping, it is just the "code" for what letters it saw. It doesn't have to be retyped and re-spell checked. That text can be re-Flowed and re-formatted, resized, recolorised. The Human is just happy to not have to retype it. It is Very Malable adjustable and tiny, it is just the code for characters.
OCR software that puts spaces between all the letters should either be reconfigured or tossed   If it put spaces there because they existed, then so to it will exist again   Skip that I am leaving them. Maybe a bit of reKerning (pushing letters together) in the word/pdf program to squeeze it up.

*Rich Text formatted columnised, paragraphed, wrapped, and could be colored or sized, but changing that is easy. This OCR selection is useful to drop it AS-IS preformatted and re-print/use it clean as it was. it is still very small size, no graphics or images.
IF I use the formatted text, and want to Re-format it for a different layout/formatting, I might as well have just OCRed the text only (1), used the RAW text and quickly re-flowed, reformatted it and re-colorised it.

*The Graphic, things that cannot be OCRed because it cannot recognize letters, this could be the whole page, or parts of the page, like a signature, or some messed up areas, or Picture items.
This Scanned section can be used with (1) or (2) to either manually place graphic back into the re-formatted docs or just put pasted into the formatted area. If the "graphic" or background noise of the page is unnecessary, then the OCR software is set to do only (1) or (2), what OCR does best. (1) figure out what the text is and ignore everything else. Or (2) figure the text and the formatting and layout of the text.
This (3) image cannot make it to the "copy Buffer" of the standard Windows stuff, WITH raw text or formatted text at the same time for normal cross program copy paste. It is not Just text, or just RTF, it is not Just Picture, it is a messy combo. It could be a "special data" copy paste.
It could be printed out of the OCR software, or a PDF "printing" could be made from the OCR software (where it is still assembled). Basically the computer/programs copy buffer can do (1) text, can do (2) text with formatting. But to do the image and Rich Text also, isnt that "mixing up data" for other programs to recognize it?
Selecting the Text ONLY in a PDF document that had text in it, would move the text into the copy paste buffer. You could paste that text into anything, and already have, changing any spacing or paragraphing and tabbing could be done in a Wurd program.
A PDF can be text only, text with formatting, text and image, and it is all separable in one quick move unless it is protected. Copy Paste. Paste just the text (you already were able to paste to Word) into a PDF and make a simple text only PDF.
IF it is  Vector  (points and curves) outline of the text? Invisable, whos brilliant idea was it to have that available when doing such simple things? Some programmer who cant leave well enough alone   It would have to be Re-OCRed  it is no longer raw text code. You could not copy paste Vector text/graphics as text characters.
With the vectors, in Photoshop you could re-stylize it, bend it re-fit it, it is vectors, but not Text Characters, very hard to re-flow or Re-Format now. The size increases dramatically if it is vectors.
IF it is rasterized (made it a Picture instead of vectors) which sort of finalizes the outline, then did not "stroke" the vector outline or stylize it. The turning it into a "picture/Graphic" again, instead of RTF text or Vectors, locks out the ease of flowing, the re-wrapping, the reformatting. The size would be the largest size once rasterized.
And Your having troubles flowing it into a PDF or a WORD    then they are going to re-code the PDF, so your asking a question, and me I am looking at it thinking:

*

*you got it

*you have major control of it, more than needed

*you were able to do anything with it anything

*how could you
possibly be lost you have mastered convertings it

*you have both
the pictures and the text

*you were able to copy paste the text

*you have it all.

This has been edited since the comments were posted.


text:
Q: Image Uploader not working magento 1.8 due to Adobe flash outdated Since end of 2020 adobe flash player going outdated because of that,Magneto 1.8 version image upload function not working. is there any solution to fix this issue.
Here attached screenshot

A: Yes you have two ways
either apply the SUPEE 8788 patch based on your magento version
or
upgrade the Magento version to the latest one at least above 1.9.3.x.


text:
Q: What is the difference between LPM Set Index 2 and Set Index 3? Just coming from another (old) SU thread asking about Intel Dynamic Platform/Thermal Framework settings and the specific meanings of each, but although most of that user's questions were answered I still could not find any specific info on the meanings of the title question.
It seems as if the links for more specific info given in one of the answers are either broken or no longer available, so I was hoping someone might be able to enlighten me as to the difference.
I understand what Power Limit and Acoustic Limit are and how they function, but I can't seem to find anything on the internet explaining what the different Low Power Mode Settings achieve. The drop down options I have available are "Disabled, App Specific, LPM Set Index 2, and LPM Set Index 3". The first two are obviously self explanatory but I'm curious about the last two.
I am creating a new power plan specifically to use the least amount of battery possible for those times when I don't have convenient access to a plug socket for extended periods - such as train or plane journeys etc.
Thanks


text:
Q: php for loop for an array that takes values from function I have a function which is returning some values. I want to put those values in an array after checking if the current value exists. I 've written the following code:
$return[0]=myexec_proc($varsearch,$get_input1);

if (isset($return[0])){
$return[1]=myexec_proc($varsearch,$return[0]);
}
if (isset($return[1])){
$return[2]=myexec_proc($varsearch,$return[1]);
}
if (isset($return[2])){
$return[3]=myexec_proc($varsearch,$return[2]);
}
if (isset($return[3])){
$return[4]=myexec_proc($varsearch,$return[3]);
}

which works as I want to but I need to do it with a for loop.
I've tried this:
$return=array();

for($i=0; $i=3; $i++){
if (isset($return[$i])){
$return[$i+1]=myexec_proc($varsearch,$return[$i]);
}}

but I get no data and after a while I get a php fatal error "Maximum execution time of 30 seconds exceeded".
Any tips on what I am doing wrong would be appreciated.

A: The second condition of your for loop is incorrect. You are assigning $i to 3 instead of checking it as a conditional.
It should be something like this:
    for($i=0; $i<=3; $i++){
        if (isset($return[$i])){
            $return[$i+1]=myexec_proc($varsearch,$return[$i]);
        }
    }

A: For loops require a condition which they loop up until. Add a less than operator to make the for run correctly.
for ($i=0; $i<=3; $i++) {
  if (isset($return[$i])) {
    $return[$i+1]=myexec_proc($varsearch,$return[$i]);
  }
}


text:
Q: Specific distibution recommendation I want to ask the distro cosmopolitans of you for a distibution recommendation for my special needs.
I'm coming from arch linux, which is really fine I like to be virtually on upstream software and I like not to be forced to format my system every half year. Super choice, but I am not satisfied with package releases (e.g. recently broke VMplayer since a kernel compiled with gcc from testing was released). However I am searching a distribution which is almost as bleeding edge like arch and where I am free to choose non-free packages, unlike fedora, which was a strong favorite. It should be a rolling release, easy to use (no gentoo) and capable of serving the daily "productive" needs.
Is there such a distro at all?

A: Manuel, you have incompatible requirements. You want bleeding edge and production. IMHO you do not need super duper fresh packages, but stable packages. You can take a look on CentOS or Oracle Linux. Both of them offer quite contemporary packages plus rock solid reliability


text:
Q: UITable Cell info only showing when row is selected I'm getting some really odd behaviour with a UITableView i'm working on. I have the following code, which loads data from an array into a UITableView. The code seems to work... but the labels only show values when i click on each row. I'm stumped as to why this is happening as i'm pretty sure i didnt have this issue before... but i could be wrong. My code:
@interface TableViewController ()

@end

@implementation TableViewController

//@synthesize cRef;

-(void) getData:(NSData *) data {
    NSError *error;
    json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
    [self.tableView reloadData];
}
-(void) start {
    NSURL *url = [NSURL URLWithString: URL];
    NSData *data = [NSData dataWithContentsOfURL:url];
    [self getData:data];
    }

- (void)viewDidLoad {
    [super viewDidLoad];
    [self start];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return [json count];;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *cellIdentifier = @"CellIdentifier";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
    NSDictionary *info = [json objectAtIndex:indexPath.row];
    cell.textLabel.text = [info objectForKey:@"CountryName"];
    cell.detailTextLabel.text = [info objectForKey:@"id"];

    return cell;
}

Any help appreciated.

A: As @ktpatel said try changing font color
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *cellIdentifier = @"CellIdentifier";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
    if (!cell){
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
    }
    NSDictionary *info = [json objectAtIndex:indexPath.row];
    cell.textLabel.text = [info objectForKey:@"CountryName"];
    cell.detailTextLabel.text = [info objectForKey:@"id"];

    // set font color
    cell.textLabel.textColor = [UIColor redColor];
    cell.detailTextLabel.textColor = [UIColor redColor];

    if ([cell isSelected]) {
        // make changes for selected state
        cell.textLabel.textColor = [UIColor blackColor];
        cell.detailTextLabel.textColor = [UIColor blackColor];
    }
    return cell;
}

Also I don't see your code for didSelectRowAtIndexPath, I think you must be doing this in it to see the selected state of UITableViewCell
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

    cell.textLabel.textColor = [UIColor blackColor];
    cell.detailTextLabel.textColor = [UIColor blackColor];
}


text:
Q: Dynamically change preload script Is there a way to set/change the preload option in webPreferences after BrowserWindow has been created?
What I would like to do is make a webcrawler that changes its preload script whenever the BrowserWindow redirects to a new URL.
The issue that I am trying to solve is that the webcrawler needs to collect different information on different sites.
The only 2 solutions I can think of are:

*

*make 1 massive preload script that covers every website or

*create a new BrowserWindow with a different preload script each time it redirects,

but neither seems resource efficient.
Is it possible to change or use different preload scripts without using multiple instances of the BrowserWindow?

A: no, preload script is tied to per-process browserwindow creation, not per-url navigation inside of browserwindow.


text:
Q: Vim plugin for browsing through Rake or Capistrano tasks I'm looking for a plugin for Vim that lets me browse through all my Rake tasks and Capistrano tasks in a file. Does this exists or could Ctags be extended easily to make this work in Taglist or NERD_tree?
I'm using MacVim with Janus

A: I've found a solution that's working for me. I added this to my $HOME/.ctags
--regex-Ruby=/(^|^[[:blank:]]*)task[ \t\:']*([A-Za-z0-9_]*)/\2/t,tasks/
--regex-Ruby=/(^|^[[:blank:]]*)namespace[ \t\:]*([A-Za-z0-9_]*)/\2/n,namespaces/

And this to my .vimrc
let g:tagbar_type_ruby = {
    \ 'ctagstype' : 'Ruby',
    \ 'kinds'     : [
        \ 'c:classes',
        \ 'f:methods',
        \ 'F:singleton methods',
        \ 'm:modules',
        \ 'n:namespaces',
        \ 't:tasks'
    \ ]
\ }


text:
Q: error CloudKit access was denied by user settings when user is not sign in I'm trying to get fetch the notification of changes in the public database:
CKServerChangeToken *token = [[cloudKitToken helper] getCloudKitToken];
CKFetchNotificationChangesOperation *op = [[CKFetchNotificationChangesOperation alloc]
                                           initWithPreviousServerChangeToken:token];
NSMutableArray *noteIds = [[NSMutableArray alloc] init];

op.notificationChangedBlock = ^(CKNotification *note) {
    CKNotificationID *noteId = note.notificationID;
    [noteIds addObject:noteId];

};

op.fetchNotificationChangesCompletionBlock = ^(CKServerChangeToken *token, NSError *error) {

    NSLog(@"error %@", error.localizedDescription);
};

[[CKContainer defaultContainer] addOperation:op];

But when the user has not login to iCloud I get this error: "error CloudKit access was denied by user settings"
By another hand with the same device I can fetch records from the public database with no problem.
What I'm trying to do with the CKFetchNotificationChangesOperation is get the deltas between device and cloudkit.
Any of you knows how can I get the deltas when the user has not login to iCloud?, does fetch records is my only option for this case?
I'll really appreciate your help.

A: With CKFetchNotificationChangesOperation you can retrieve all the notifications that were send to you since a previous fetch. These notifications are linked to subscriptions that you previously created for a device. Subscriptions are linked to an account. So you must be logged in with the same account in order to fetch these notifications.
In your case you might be better of by using CKFetchRecordChangesOperation. Then you would be able to just query for CloudKit changes since a previous query. Since it's just a query using a 'server change token'. The first time you can query it with nil and then retrieve all the records. you would get a 'server change token' in return. just save that on the device and the next time you start the app just use that token. Then there would be no need to log in to iCloud. (if your data is public)


text:
Q: best method of detecting mobile browsers with javascript/jquery? For a site I'm working on I'm implementing image preloading with javascript however i most certainly do not want to call my preload_images() function if someone is on slow bandwidth.
For my market the only people with slow bandwidth are those using mobile internet on a smartphone.
What's the best approach for detecting these users so i can avoid image preloading for them?

option 1 : detect browser width
if($(window).width() > 960){ preload... }

option 2: detect user-agent with a list of browser to preload for
if($.browser in array safelist){ preload... }

are there any better options?

A: I find that I dislike sites that decide which version of the site I should access on a particular device or environment. It's great to make an initial decision based on whatever criteria you settle on, but for goodness sake, give me a link I can click so I can choose the "Higher Bandwidth Site" or vice versa and save it to a cookie. Then I can override any error the automated script makes with my own judgement.

A: Maybe using the CSS @media directive, along with hidden objects?
.imagesToPreload {display:none;}
@media screen {
    #imageToPreload1 {background-image:url('blah.img');}
}
@media handheld {
    #imageToPreload1 {background-image:none;}
}

Then in Javascript, you can fetch all objects in "imagesToPreload" class, read the backgroundImage property and preload it if its not none.
Admittedly, this is off the top of my head, I didn't test this idea. As usual, there must be something I am not thinking about...

A: I think edeverett's point about mobile not necessarily being slow (and similarly desktop not necessarily being fast) is a good one.
Remember not to remove choice for your visitors - i.e. most decent mobile browsers have an option not to load images (or specifically not to load large ones) and also avail of proxy services that compress images before downloading - some mobile visitors may want the full preloaded experience on your site.
Another solution might be something like:
if($(window).width() < 320){ preload_smaller_images(); }
There's less reason than there used to for the mobile browsing experience to be more limited than that of the desktop.
R. Hill's CSS suggestion is not the worst though (if it can be done in CSS, it should imo), it can also be done per-screen-size:
@media handheld, screen and (max-width: 320px){ /* */ }


text:
Q: Compass: Compiling Style Sheets Changes "Black" to "#000" I am using compass to produce my CSS stylesheets.
In my style sheets, I have several mixins that are used to generate classes. Many of these classes have the word "black" in them.
Everything works fine. However, when I go to compile my scss stylesheets for production, "black" is replaced with #000 in the final style sheet, which breaks my classes.
How can I prevent this?
The code I am using to compile the style sheet is:
compass compile -e production --force

This is the command listed in the compass documents.

A: The problem is that the color keywords are being interpreted as color values, not as strings. You can coerce them into strings by surrounding them with quotes. For example:
$classname: "black";
$color: black;

.#{$classname} {
  color: #{$color};
}

In that way, the color property value will be compressed, but the class name will not.


text:
Q: Use following Theorem to show that every tree has at most one perfect matching. Use following Theorem to show that every tree has at most one perfect matching.

Theorem: Let $M_1$ and $M_2$ be matching in graph $G$. Then each component of the spanning subgraph $H$ of $G$, with $E(H)=(M_1 -M_2) \cup (M_2 -M_1)$, is one of following type
i) an Isolated vertex
ii) An even cycle whose edges are alternately in $M_1$ and in $M_2$
iii) a nontrivial path who edges are alternately in $M_1$ and in $M_2$ and such that each end vertex of the path is either $M_1$- unmatched or $M_2$-unmatched but not both

It look like I need to prove this by contradiction. So assume that a tree $T$ has two perfect matching, namely $M_1$ and $M_2$. I will some how show that this will contradict to the above theorem.
So let $H$ be a spanning subgraph with $E(H)=(M_1 -M_2) \cup (M_2 -M_1)$, this shows that $H$ contain at least one edges, thus $H$ can't be an isolated vertex, hence i) is false in this case
Second, $T$ is a tree, so $H$ can't be a cycle, thus ii) is also false
I'm trying to finad a way to argue that iii) must also false, but I haven't got any luck. Any help would be greatly appreciated.

A: It's true that the subgraph $H$ has at least one edge, but that does not by itself imply that it has no isolated vertex. In the graph shown below we have the perfect matchings $M_1=\{14,25,36\}$ and $M_2=\{14,26,35\}$, which generate the subgraph graph $H$ with the same six vertices whose edge set is $\{25,26,35,36\}$; this $H$ has two isolated vertices, $1$ and $2$.

(In fact this $H$ has two instances of alternative (i) and one of alternative (ii).) Thus, you still need to rule out (i) as well as (iii) for a tree $T$.
Suppose that $H$ has an isolated vertex $v$. Then every edge of $T$ incident at $v$ must belong to both matchings or to neither matching. There must be an edge of $M_1$ incident at $v$; call it $vw$. Then $vw$ must also be in $M_2$, and no other edge of $M_1$ or $M_2$ can be incident at $v$, or for that matter at $w$.
Now remove from $T$ the vertices $v$ and $w$ and all edges incident to either of them. What's left will be a forest $F$, and each tree in that forest will have fewer vertices than $T$. Moreover, $M_1\setminus\{vw\}$ and $M_2\setminus\{vw\}$ are distinct perfect matchings of $F$, so they must differ on at least one of the trees of $F$. This suggests that we should try a proof by induction on the number of vertices: if we already had the result for trees with fewer vertices than $T$, we'd have a contradiction at this point, showing that $H$ cannot have an isolated vertex.
Now try to take the same approach to (iii); suppose that $H$ has such a path, and consider what happens if you remove from $T$ that path and all edges of $T$ incident at its endpoints.


text:
Q: CPU usage varies from 0 to 100. Strange waveform so I have a strange problem. I'm currently using an old Thinkpad T61 and Ubuntu 14.04 LTS, although this same problem was also happening when I had elementary OS Luna (based on ubuntu 12.04 LTS)
Image:

As you can see in the picture the CPU usage varies in a sort of waveform, getting 100 % load pikes each few seconds.
So I've been a lot of time trying to find out the cause of the problem, here in these forums I found this post: Why does kworker cpu usage get so high?
I followed everything said on the replies, when I did this:
grep . -r /sys/firmware/acpi/interrupts/

I found out that the gpe12 had a really high number so I followed instructions to try to disable it. The problem was still there.
I tried another bunch of things. Actually right now there is no /sys/firmware/acpi/interrupts/  (I've tried so many things I cant remember how this happened, probably disabling the acpi in the grub options?)
So now, I don't really think It can be solved, so maybe another type of solution could be to install some older Ubuntu version with an older kernel? (Something from the late 2000s) or maybe downgrading the kernel (not really sure about if this is safe or possible for this version)
Also, I have a windows partition installed, would it be deleted if I uninstall my linux partition?
Thanks in advance and sorry if I made dumb questions, but I've been many days trying to solve this and its driving me crazy.


text:
Q: Make a view (initialized from initWithNibName) load all its subview Assuming I load a view controller from a nib, and decide to do something with one of its subview behind the scene. At a later moment in time, I would show the view of this view controller.
viewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
[viewController.someSubview doSomething];

//later on
[mainView addSubview:viewController.view];

The problem is that, the someSubview object doesn't seem to be loaded until the view appears, so the method doSomething is not called. So far my workaround is to call:
[mainView addSubview:viewController.view];
[viewController.view removeFromSuperview];

to initialize the subviews of viewcontroller first. Is there any more elegant way (like a loadSubviews method or something) for this task?

A: First of all I would try simply accessing the property:
[viewController view];

This will force the lazy load of the view (and thus the subviews and outlets etc.) and this might be enough for you. View controllers by default will not load their view until you access it so this might be why you are seeing a delay.
Forcing a load like this is usually the solution when you are trying to access an outlet property but it hasn't actually been bound yet, like someSubview in your case.
You can also improve things a bit by adding the view but making it hidden:
viewController.view.hidden = YES;
[mainView addSubview:viewController.view];

Then instead of calling addSubview when you want to show it, just do:
viewController.view.hidden = NO;

I've used this method when animating in views using the UIViewAnimationTransitionFlipFromRight etc. transitions. Even when forcing a lazy load of the view there is still a noticable lag, so I've used this to improve the performance a bit.

A: iOS 9 introduced -(void) loadViewIfNeeded
I use
if ([_myVC respondsToSelector:@selector(loadViewIfNeeded)]) {
    [_myVC loadViewIfNeeded];
} else {
    [_myVC view];
}


text:
Q: Instant app CLEARTEXT communication not supported: [] I tried to do HttpUrlConnection, but got Exception:
    java.net.UnknownServiceException: CLEARTEXT communication not supported: []
    at com.android.okhttp.Connection.connect(Connection.java:149)
    at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:185)
    at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
    at com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341)
    at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
    at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:433)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:114)
    at com.xfzj.instantappdemo2.feature.MainActivity$3.run(MainActivity.java:84)
    at java.lang.Thread.run(Thread.java:818)

Here's my code:
new Thread(new Runnable() {
        @Override
        public void run() {
            try {
                URL url = new URL("http://www.google.com");
                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                connection.connect();
                Log.i("responseCode",""+connection.getResponseCode());
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();

            }
        }
    }).start();

If I ran and installed the app, it succeeded.
or I replaced http://www.google.com with https://www.google.com, it also ran successfully in instant app.
Does instant app only support Https?

A: That's right. HTTP connections are unsupported: https://developer.android.com/topic/instant-apps/policy.html#network_traffic.

A: Add the below line into the manifest file
<application
    ...
    android:usesCleartextTraffic="true"
    ...
</application>


text:
Q: validating in cakephp model compare two fields I have a model Interesttype where i want two fields to be validated one should not be more than the other and none should be less than a particular set value. Here is my model.
    class Interesttype extends AppModel
    {
      public $primaryKey = 'int_id';
      public $displayField = 'int_name';
      public $hasMany= array(
            'Loan' => array(
                'className' => 'Loan',
                'foreignKey' => 'lon_int_id'
            )
        );
      public $validate = array(
            'int_name'=> array(
                    'rule' => 'notEmpty',
                    'allowEmpty' => false,
                    'message' => 'The interest type name is required.'
                    ),
          'int_active'=>array(
                     'rule'=>array('boolean'),
                     'allowEmpty'=>false,
                     'message'=>'Please select the status of this interest type'
                     ),
           'int_max'=> array(
                    'numeric'=>array(
                        'rule' => 'numeric',
                        'allowEmpty' => false,
                        'message' => 'Please specify a valid maximum interest rate.'
                        ),
                    'comparison'=>array(
                        'rule' => array('comparison','>',1000),
                        'allowEmpty' => false,
                        'message' => 'The Maximum interest rate cannot be less than the special rate.'
                        ),
                    'checklimits'=>array(
                        'rule' => array('checkRateLimits','int_min'),
                        'allowEmpty' => false,
                        'message' => 'The Maximum interest rate cannot be less than the minimum rate.'
                        )
                    ),
        'int_min'=> array(
                    'numeric'=>array(
                        'rule' => 'numeric',
                        'allowEmpty' => false,
                        'message' => 'Please specify a valid minimum interest rate.'
                        ),
                    'comparison'=>array(
                        'rule' => array('comparison','>',1000),
                        'allowEmpty' => false,
                        'message' => 'The Minimum interest rate cannot be less than the special rate.'
                        ))
        );
   function checkRateLimits($maxr,$minr){
           if($maxr>=$minr){
               return true;
           }
           else{
               return false;
           }
       }
    }

the above model validates my forms well except that one check will not be done, it will not check if the maximum interest rate is indeed more than or equal to the minimum inerest rate.
Where am i going wrong on the validation?

A: You'll have to add your own Validation Method to make this possible. Here's a pretty generic example that makes use of Validation::comparison() and supports all of its operators (>, <, >=, <=, ==, !=, isgreater, isless, greaterorequal, lessorequal, equalto, notequal) as the second argument in the options array and a field name to compare the validated value to as a third parameter.
class MyModel extends AppModel
{

    /* Example usage of custom validation function */
    public $validate = array(
        'myfield' => array(
            'lessThanMyOtherField' => array(
                'rule' => array('comparisonWithField', '<', 'myotherfield'),
                'message' => 'Myfield value has to be lower then Myotherfield value.',
            ),
        ),
    );

    /* Custom validation function */
    public function comparisonWithField($validationFields = array(), $operator = null, $compareFieldName = '') {
        if (!isset($this->data[$this->name][$compareFieldName])) {
            throw new CakeException(sprintf(__('Can\'t compare to the non-existing field "%s" of model %s.'), $compareFieldName, $this->name));
        }
        $compareTo = $this->data[$this->name][$compareFieldName];
        foreach ($validationFields as $key => $value) {
            if (!Validation::comparison($value, $operator, $compareTo)) {
                return false;
            }
        }
        return true;
    }

}

This is generic, so you could throw the function in your AppModel if you want to make use of it in multiple models in your App. You could also make this a Behavior to share it between different models.

A: I won't help you to do your code however I will suggest you to read the following backery article http://bakery.cakephp.org/articles/aranworld/2008/01/14/using-equalto-validation-to-compare-two-form-fields
<?php
class Contact extends AppModel
{
    var $name = 'Contact';
    var $validate = array(
        'email' => array(
        'identicalFieldValues' => array(
        'rule' => array('identicalFieldValues', 'confirm_email' ),
        'message' => 'Please re-enter your password twice so that the values match'
                )
            )
        );

    function identicalFieldValues( $field=array(), $compare_field=null )
    {
        foreach( $field as $key => $value ){
            $v1 = $value;
            $v2 = $this->data[$this->name][ $compare_field ];
            if($v1 !== $v2) {
                return FALSE;
            } else {
                continue;
            }
        }
        return TRUE;
    }

}
?>

modify the code I think it should be easy from here.

A: I don't think you can achieve this with directly inserting it into the validate array in a model. You can however specify your own validation function. An example is given here (look at the model code):
Example custom validation function

A: In your Model your validate should be field name with rule pointing to the function you want to run.
And "None should be less than a particular set value" I would use the "range" validation as seen below. The example will accept any value which is larger than 0 (e.g., 1) and less than 10
public $validate = array(
  'maxr'=>array(
    'Rate Limits'=>array(
      'rule'=>'checkRateLimits',
      'message'=>'Your Error Message'
    ),
    'Greater Than'=>array(
      'rule'=>array('range', -1, 11),
      'message'=>'Please enter a number between 0 and 10'
    )
  ),
);

In the function you pass $data which is the fields being passed. If $data doesn't work try $this->data['Model']['field'] ex($this->data['Model']['maxr'] >= $this->data['Model']['minr'])
function checkRateLimits($data){
  if ( $data['maxr'] >= $data['minr'] ) {
    return true;
  } else {
    $this->invalidate('minr', 'Your error message here');
    return false;
  }
}

Your Form would be something like
echo $this->Form->create('Model');
echo $this->Form->input('maxr');
echo $this->Form->input('minr');
echo $this->Form->end('Submit');


text:
Q: jquery css3 effects on angular4 http://www.bestjquery.com/?SGavh3Aj
exemples based on jquery
i use the  same html file, the first division which display a table contains the Accounts details and bottoms to remove , modify and get operations .
to get operation other division appear to display alla operations.

0">

                          ID
                          Solde(dinars)
                          Decouvert(dinars)
                          Date de Création
                          Numero compte
                          Propriétaire
                          Action

                      {{compte.idcpt}}
                      {{compte.solde}}
                      {{compte.decouvert}}
                      {{compte.datedecreation}}
                      {{compte.numeroCompte}}

                      {{client.nom}} {{client.prenom}}

                           view
                           Edit

                           Delete
                           opérations

// and second division to display operations

0">

                              ID
                              Date operation
                              Montant crédit/debit
                              Type operation
                              Libelle Mouvement

                              {{operation.numero}}
                              {{operation.deateoperation}}
                              {{operation.montant}} (dt)
                              {{operation.op}}
                              {{operation.libelle}}


text:
Q: CSV to JSON using BASH I am trying to covert the below csv into json format.
Africa,Kenya,NAI,281
Africa,Kenya,NAI,281
Asia,India,NSI,100
Asia,India,BSE,160
Asia,Pakistan,ISE,100
Asia,Pakistan,ANO,100
European Union,United Kingdom,LSE,100

This is the desired json format and I just cannot get to create it. I will post my work in progress below this.. Any help or direction would be appreciated...
  {"name":"Africa",
      "children":[
      {"name":"Kenya",
          "children":[
          {"name":"NAI","size":"109"},
          {"name":"NAA","size":"160"}]}]},
  {"name":"Asia",
      "children":[
      {"name":"India",
          "children":[
          {"name":"NSI","size":"100"},
          {"name":"BSE","size":"60"}]},
  {"name":"Pakistan",
      "children":[
      {"name":"ISE","size":"120"},
      {"name":"ANO","size":"433"}]}]},
  {"name":"European Union",
        "children":[
        {"name":"United Kingdom",
            "children":[
            {"name":"LSE","size":"550"},
            {"name":"PLU","size":"123"}]}]}

Work in Progress.
$1 is the file with the csv values pasted above.
#!/bin/bash

pcountry=$(head -1 $1 | cut -d, -f2)

cat $1 | while read line ; do

region=$(echo $line|cut -d, -f1)
country=$(echo $line|cut -d, -f2)
code=$(echo $line|cut -d, -f3-)
size=$(echo $line|cut -d, -f4)

if test "$pcountry" == "$country" ;
  then
  echo -e {\"name\":\"$region\", '\n' \"children\": [ '\n'{\"name\":\"$country\",'\n'\"children\": [ '\n' \{\"name\":\"NAI\",\"size\":\"$size\"\}
  else
      if test "$pregion" == "$region"
      then :
      else
          echo -e ,'\n'{\"name\":\""$region\", '\n' \"children\": [ '\n'{\"name\":\"$country\",'\n'\"children\": [ '\n' \{\"name\":\"NAI\",\"size\":\"$size\"\},

pcountry=$country
pregion=$region

fi ; done

Problem is that I cannot seem to find a way to find out when a countries value ends.

A: As a number of the commenters have said, using the shell for this kind of conversion is a horrible idea.  And, it would be nigh impossible to do it with just bash builtins; and shell scripts are used to combine standard unix commands like sed, awk, cut, etc. anyway.  You should choose a better language that's built for that kind of iterative parsing/processing to solve your problem.
However, because it's late and I've had too much coffee, I threw together a bash script (with a few bits of sed thrown in for parsing help) that takes the example .csv data you have and outputs the JSON in the format you noted.  Here's the script:
#! /bin/bash
# Initial input file format:
#
#         Africa,Kenya,NAI,281
#         Africa,Kenya,NAA,281
#         Asia,India,NSI,100
#         Asia,India,BSE,160
#         Asia,Pakistan,ISE,100
#         Asia,Pakistan,ANO,100
#         European Union,United Kingdom,LSE,100
#
# Intermediate file format for parsing to JSON:
#
#         Africa|Kenya:NAI=281
#         Asia|India:BSE=160&NSI=100|Pakistan:ISE=100&ANO=100
#         European Union|United Kingdom:LSE=100
#
# Call as:
#
#   $ ./script INPUTFILE.csv >OUTPUTFILE.json
#

# temporary files for output/parsing
TMP="./tmp.dat"
TMP2="./tmp2.dat"
>$TMP
>$TMP2

# read through initial file and output intermediate format
while read line
do
    region=$(echo $line | cut -d, -f1)
    country=$(echo $line | cut -d, -f2)
    code=$(echo $line | cut -d, -f3)
    size=$(echo $line | cut -d, -f4)

    # region record already started
    if grep "^$region" $TMP 2>&1 >/dev/null ;then
        >$TMP2
        while read rec
        do
            if echo $rec | grep "^$region" 2>&1 >/dev/null
            then
                if echo "$rec" | grep "\|$country:" 2>&1 >/dev/null
                then
                    echo "$rec" | sed -e 's/\('"$country"':[^\|][^\|]*\)/\1\&'"$code"'='"$size"'/' >>$TMP2
                else
                    echo "$rec|$country:$code=$size" >>$TMP2
                fi
            else
                echo $rec >>$TMP2
            fi
        done < $TMP
        mv $TMP2 $TMP
    else
    # new region
        echo "$region|$country:$code=$size" >>$TMP
    fi

done < $1

# Parse through our intermediary format and output JSON to standard out
echo "["
country_count=$(cat $TMP | wc -l)
while read line
do
    country=$(echo $line | cut -d\| -f1)
    echo "{ \"name\": \"$country\", "
    echo "  \"children\": ["
    region_count=$(echo $line | cut -d\| -f2- | sed -e 's/|/\n/g' | wc -l)
    echo $line | cut -d\| -f2- | sed -e 's/|/\n/g' |
    while read region
    do
        name=$(echo $region | cut -d: -f1)
        echo "    { \"name\": \"$name\", "
        echo "      \"children\": ["
            code_count=$(echo $region | sed -e 's/^'"$name"'://' -e 's/&/\n/g'  | wc -l)
            echo $region | sed -e 's/^'"$name"'://' -e 's/&/\n/g'  |
            while read code_size
            do
                code=$(echo $code_size | cut -d= -f1)
                size=$(echo $code_size | cut -d= -f2)
                code_count=$((code_count - 1))
                COMMA=""
                if [ $code_count -gt 0 ]; then
                  COMMA=","
                fi
                echo "        { \"name\": \"$code\", \"size\": \"$size\" }$COMMA "
            done
        echo "      ]"
        region_count=$((region_count - 1))
        if [ $region_count -gt 0 ]; then
            echo "    },"
        else
            echo "    }"
        fi
    done
    echo "  ]"
    country_count=$((country_count - 1))
    COMMA=""
    if [ $country_count -gt 0 ]; then
        COMMA=","
    fi
    echo "}$COMMA"

done < $TMP
echo "]"

exit 0

And, here's the resulting output from the above script:
[
{ "name": "Africa",
  "children": [
    { "name": "Kenya",
      "children": [
        { "name": "NAI", "size": "281" },
        { "name": "NAA", "size": "281" }
      ]
    }
  ]
},
{ "name": "Asia",
  "children": [
    { "name": "India",
      "children": [
        { "name": "NSI", "size": "100" },
        { "name": "BSE", "size": "160" }
      ]
    },
    { "name": "Pakistan",
      "children": [
        { "name": "ISE", "size": "100" },
        { "name": "ANO", "size": "100" }
      ]
    }
  ]
},
{ "name": "European Union",
  "children": [
    { "name": "United Kingdom",
      "children": [
        { "name": "LSE", "size": "100" }
      ]
    }
  ]
}
]

Please don't use code like the above in any production environment.

A: Here is a solution using jq.
If filter.jq contains the following filter
 reduce (
     split("\n")[]                  # split string into lines
   | split(",")                     # split data
   | select(length>0)               # eliminate blanks
 )  as [$c1,$c2,$c3,$c4] (          # convert to object
     {}                             #   e.g. "Africa": { "Kenya": {
   ; setpath([$c1,$c2,"name"];$c3)  #           "name": "NAI",
   | setpath([$c1,$c2,"size"];$c4)  #           "size": "281"
)                                   #        }, }
| [                                 # then build final array of objects format:
    keys[] as $k1                   # [ {
  | {name: $k1, children: (         #   "name": "Africa",
       .[$k1]                       #   "children": {
     | keys[] as $k2                #     "name": "Kenya",
     | {name: $k2, children:.[$k2]} #     "children": { "name": "NAI", "size": "281" }
    )}                              #   ...
  ]

and data contains the sample data then the command
$ jq -M -Rsr -f filter.jq data

produces
[
  {
    "name": "Africa",
    "children": {
      "name": "Kenya",
      "children": {
        "name": "NAI",
        "size": "281"
      }
    }
  },
  {
    "name": "Asia",
    "children": {
      "name": "India",
      "children": {
        "name": "BSE",
        "size": "160"
      }
    }
  },
  {
    "name": "Asia",
    "children": {
      "name": "Pakistan",
      "children": {
        "name": "ANO",
        "size": "100"
      }
    }
  },
  {
    "name": "European Union",
    "children": {
      "name": "United Kingdom",
      "children": {
        "name": "LSE",
        "size": "100"
      }
    }
  }
]

A: You'd be much better off using a tool like xidel that can manipulate csv / raw text and understands JSON:
I'm going to assume so_24300508.csv :
Africa,Kenya,NAI,109
Africa,Kenya,NAA,160
Asia,India,NSI,100
Asia,India,BSE,60
Asia,Pakistan,ISE,120
Asia,Pakistan,ANO,433
European Union,United Kingdom,LSE,550
European Union,United Kingdom,PLU,123

(this is extracted from your JSON sample instead of the CSV sample you provided)
xidel -s so_24300508.csv --json-mode=deprecated --xquery '
  [
    let $csv:=x:lines($raw)
    for $region in distinct-values($csv ! tokenize(.,",")[1])
    return {
      "name":$region,
      "children":[
        for $country in distinct-values($csv[starts-with(.,$region)] ! tokenize(.,",")[2]) return {
          "name":$country,
          "children":for $data in $csv[starts-with(.,$region) and contains(.,$country)]
          let $value:=tokenize($data,",")
          return {
            "name":$value[3],
            "size":$value[4]
          }
        }
      ]
    }
  ]
'

(without --json-mode=deprecated replace [ ] with array{ })
See this code snippet for intermediate steps leading to this query.
Also see this online xidelcgi demo.
Output:
[
  {
    "name": "Africa",
    "children": [
      {
        "name": "Kenya",
        "children": [
          {
            "name": "NAI",
            "size": "109"
          },
          {
            "name": "NAA",
            "size": "160"
          }
        ]
      }
    ]
  },
  {
    "name": "Asia",
    "children": [
      {
        "name": "India",
        "children": [
          {
            "name": "NSI",
            "size": "100"
          },
          {
            "name": "BSE",
            "size": "60"
          }
        ]
      },
      {
        "name": "Pakistan",
        "children": [
          {
            "name": "ISE",
            "size": "120"
          },
          {
            "name": "ANO",
            "size": "433"
          }
        ]
      }
    ]
  },
  {
    "name": "European Union",
    "children": [
      {
        "name": "United Kingdom",
        "children": [
          {
            "name": "LSE",
            "size": "550"
          },
          {
            "name": "PLU",
            "size": "123"
          }
        ]
      }
    ]
  }
]


text:
Q: Default parameter and templates Why does this function give me an error:
template < typename T >
T foo( T s = 0, const vector < T > &v)
{
    ...
}

error: default argument missing for parameter 2 of 'template summable sum(summable, const std::vector&)'

And why doesn't the following?:
template < typename T >
T foo( const vector < T > &v, T s = 0)
{
    ...
}

A: Optional arguments must be the last. I.e. non-optional arguments cannot follow an optional one.
How would you call
T foo( T s = 0, const vector < T > &v)

with just a v, and no s?
How would the compiler spot this if

*

*s and v had the same type, or

*there was an overload of foo taking just a const vector<T>&?

A: If argument has a default value, than all following arguments need to have default value as well.
Rationale is given in other answers, so I'll give you a quote from C++11 standard:

8.3.6 Default arguments [dcl.fct.default]
4 (...) In a given function declaration, each parameter subsequent to a
  parameter with a default argument shall have a default argument
  supplied in this or a previous declaration or shall be a function
  parameter pack.

A: Arguments with defaults need to be the last arguments.  In the first, you have s with a default of 0, then v with no default.  You cannot have an argument with no default following an argument with a default.
How would you call such as argument using its defaults? foo(/*default*/,vector) ?


text:
Q: Install an alternative browser on Surface with 32bit Tegra 3 Processor I found no solution to replace Internet Explorer on my surface 32 Bit ARM-Processor.
I tried to install the RT Jailbreak Tool for Windows RT 8.0 But that one doesn't seem to work on my Surface with Windows 8.1 (it starts o bootup a cmd window and after 2 minutues it shows it cannot fiind a registry entry and closes.)
I tried to install some of the list of x86 app compiled for ARM. I found QupZilla, which should run on ARM, but I already were unable to install 7zip on Windows RT by downloading the binaries of 7-zip ARM version from here: http://file.wizrd.tk/7ZARM.zip
How can I install any other browser than IE, like Firefox, Chrome or any other alternative like QupZilla?

A: You have only one option available to you - downgrade to Windows RT 8.0, jailbreak it and install the desktop apps you want that have been recompiled for Windows on ARM.


text:
Q: How update django cache in exact time? On my site, there are several pages that make a large sample from the database, but updating them enough times a day, preferably at night. How to do it right?
I have already enable cache, the issue is to update it at a certain time.

A: Did you try to set proper cache expire date? That should solve the problem.
EDIT:
Maybe the answer is here?


text:
Q: Array job gives error in bash As I want to run several simulations with different values in R, I have been recommended to use a job array in bash.
1) I generated the combination of parameters and saved it in a txt file, called parameters.txt.
2) I want now to use each combination of parameters into R. Each combination is represented by a line of 3 numbers (the 3 parameters) in parameters.txt.
When I run my script, an error message appears :

head: parameters.txt: invalid number of lines
head: parameters.txt: invalid number of lines
head: parameters.txt: invalid number of lines
Job array item : rx=, ry=, rz=

Here is my script:
# Sweeping parameters.txt
N=${SLURM_ARRAY_TASK_ID}
rx=`head -n ${N} parameters.txt | tail -n 1 | cut -d' ' -f1`
ry=`head -n ${N} parameters.txt | tail -n 1 | cut -d' ' -f2`
rz=`head -n ${N} parameters.txt | tail -n 1 | cut -d' ' -f3`

# Display
echo "Job array item $N: rx=$rx, ry=$ry, rz=$rz"
echo "---------------------------------"

# Run
R CMD BATCH ex.R $rx $ry $rz

A: Seems SLURM_ARRAY_TASK_ID is None (not set) and as a result N is None here:
N=${SLURM_ARRAY_TASK_ID}

Then bash translates it as
rx=`head -n parameters.txt ...

You can wrap with if statement as follows:
N=${SLURM_ARRAY_TASK_ID}
if [ -n "${N}" ]; then
    rx=`head -n ${N} parameters.txt | tail -n 1 | cut -d' ' -f1`
    ry=`head -n ${N} parameters.txt | tail -n 1 | cut -d' ' -f2`
    rz=`head -n ${N} parameters.txt | tail -n 1 | cut -d' ' -f3`

    # Display
    echo "Job array item $N: rx=$rx, ry=$ry, rz=$rz"
    echo "---------------------------------"

    # Run
    R CMD BATCH ex.R $rx $ry $rz
else
    echo "SLURM_ARRAY_TASK_ID / N is None"
fi


text:
Q: Need equivalent CSS Selectors of an XPATH expression I have an html code as below :

Homes name

I wrote a xpath expression for the same:
 //div[@id = 'select_a_boundary' and @class = 'dataset_select2']

What will be the equivalent CSS Selectors for the same?

A: First of all if you are using id, you don't require to use class, secondly if you are willing yo select an element with an id select_a_boundary you can use
#select_a_boundary {
   /* Styles goes here */
}

Demo

Note: Am not selecting the element which has that id and that class as
  here, id is sufficient as it has to be unique, if you are using the id
  for multiple elements than it's invalid

As per your comment
div[id=select_a_boundary][class=dataset_select2] {
    color: red;
}

Demo X-Path Equivalent
Or an easier one (Credits: Jack)
#select_a_boundary.dataset_select2 {
    color: red;
}

Note: Still I would recommend you to use #select_a_boundary is more
  than enough

A: The equivalent of your expression in CSS is this:
#select_a_boundary.dataset_select2 {
    /* whatever */
}

Because identifiers in a single document should be unique, you can even narrow it down to:
#select_a_boundary {
    /* whatever */
}

One important thing to realize is that although XPath and CSS selectors have many similarities, they're two different things.
For instance, there's no XPath equivalent of :active or :hover for instance. Properly matching by class names is also more cumbersome with XPath.
On the other hand, CSS can't match things like "all paragraphs with an anchor child" which is trivial in XPath using //p[a].


text:
Q: How can i handle confirm dialog in webview? UWP windows 10 app C# i am developing uwp app (win 10) by c#
i want put my website in xaml webview element.
most of function are workable.
but i can't handle the confirm dialog
for example
this is sample html & js code
<button id="btnConfirm" onclick="confirmBox('sure to delete?')">click me to confirm</button>
<button id="btnAlert" onclick="alert('alert message')">click me to alert</button>
<script type="text/javascript">
    function confirmBox(message) {
        if (confirm(message)) {
         alert("yes");
      } else {
         alert("no");
      }
    }
</script>

this is my xaml code
<WebView Grid.Row="1" x:Name="webView1" Source="ms-appx-web:///HTMLPage1.html" Width="auto" Height="auto"/>

this is my C# code
webView1.ScriptNotify += webView1_ScriptNotify;
webView1.NavigationCompleted += webView1_NavigationCompleted;

async void webView1_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
{
      await webView1.InvokeScriptAsync("eval", new string[] { "window.confirm = function(confirmMessage) { window.external.notify('typeConfirm:' + confirmMessage) }" });
      await webView1.InvokeScriptAsync("eval", new string[] { "window.alert = function(AlertMessage) { window.external.notify('typeAlert:' + AlertMessage) }" });
}

 private async void webView1_ScriptNotify(object sender, NotifyEventArgs e)
 {
            Windows.UI.Popups.MessageDialog dialog;
            string[] messageArray = e.Value.Split(':');
            string message;
            string type;

            if (messageArray.Length > 1)
            {
                message = messageArray[1];
                type = messageArray[0];
            }
            else
            {
                message = e.Value;
                type = "typeAlert";
            }
            dialog = new Windows.UI.Popups.MessageDialog(message);
            Debug.WriteLine("type=" + type + " ,message=" + message);

            if (type.Equals("typeConfirm"))
            {
                dialog.Commands.Add(new UICommand(
                    "Yes",
                    new UICommandInvokedHandler(this.CommandInvokedHandler)));
                dialog.Commands.Add(new UICommand(
                    "Cancel",
                    new UICommandInvokedHandler(this.CommandInvokedHandler)));

                dialog.DefaultCommandIndex = 0;

                dialog.CancelCommandIndex = 1;
            }
            var result = await dialog.ShowAsync();
            if (result.Label.Equals("Yes"))
            {
               // return true;
            }
            else
            {
              // return false
            }
 }

the problem is that confirm js function will always return false
before user clicked the yes or no.
i can get user choosed button. but it's too late.
js function "confirm" will never return true in this situation.
anyone can help me?
thanks.

A: This will not work. JS runs on single thread, and will not wait for the result of the c# call. So the alert will not wait for the result from the MessageDialog.
Please note that webview in winrt project more suitable for displaying some static html. If you do want to pop up a MessageDialog act as a confirm dialog, then you need to complete all rest work that you previous do in javascript in your c# code.
For example, if you want to change some text of a html control, you need to prepare a complete html string, then check command status in CommandInvokedHandler callback and let webview navigate to(webView.NavigateToString) the new html string.

A: If you need to receive notifications and data in your app code sent from WebView-hosted script, you need to handle the ScriptNotify event. You can refer to this sample (The scenario6).


text:
Q: How to implement set::find() to match only the key of a pair? I have a container class which stores data in a std::set. I don't need or use the extended facilities provided by std::map. There is a method values() which returns a const reference to the private set so if I were to use a map instead then I would have to copy the entire container. I want to keep it as a std::set.
The set contains objects of a class similar to std::pair with a key and a value and implements operator < for use in a set.
I have a method in the container which accepts the 'key' portion of the pair for the purpose of searching the set and returning a complete pair while only matching the key.
I can iterate through the set sequentially but then I lose the O(log N).
Also note that the set needs to be sorted, which removes the option of using an unordered_set.

A: It's not clear exactly what your operator< actually compares, but the long and the short of it is that with a std::set, the only way to efficiently search the set is by using its defined comparison function.
Based on your question, I am assuming that your set is
std::set<std::pair<firstType, secondType>, ComparisonClass>

With ComparisonClass implementing the strict weak ordering. Or, your could also be using a:
std::set<PairClass>

With the PairClass being a subclass of a std::pair, that implements an operator<, for the strict weak ordering. Either one or the other is  what appears your question is describing. But either way, both alternatives are logically equivalent, for the purpose of the following answer:
If your operator< implements strict weak ordering based on both the value pair's first and second, then that's pretty much it. You can only execute the set's built-in logarithmic search by searching for the same first and second.
There's no easy way to do anything other than that. So, what now?
Well, the root problem seems to be is that you might not be using the right container. Consider the following container that, with a little bit of work, will be equivalent to your set:
std::multimap<firstType, std::set<secondType>>

That is, your container is a multimap keyed by your pair's first, with the value of your multimap being a std::set of all the secondType that are paired up with a given firstType.
The only thing you have to be careful here is to define insert and remove operation into this container in such a manner, so that you will never end up with a firstType with an empty std::set value. As long as this condition is met, this should be logically equivalent to a std::set of your std::pairs. Furthermore:
1) You can still implement an algorithmic search for a firstType+secondType by, first, a logarithmic search on the firstType, grabbing the value std::set, and then executing a logarithmic search on that. Logically equivalent.
2) You can implement an algorithmic search for just the firstType by doing only the first half of the full search. This gives you the value std::set, that provides the equivalent of all pairs that have the same firstType.


text:
Q: How to add a Script Library to XPage Custom Java control I am trying to develop my own Java Custom Control in XPage following the guide on IBM (LINK).
Everything works fine but now I want to do some client side JavaScript things where I want to use the jQuery library. Including the jQuery.js in a XPage is not a great deal but I want to pack my control in a Library so that every developer at our company can use it.
So my question is how can I integrate the JavaScript in the control so the one who uses it doesn't have to implement the JavaScript in Notes Application by hand.
Sure, I could just put it into the render:
writer.startElement("script", null);
writer.writeAttribute("type", "text/javascript", null);
writer.writeText(JQuery-js-content, null);
writer.endElement("script");

But then the server has always to render it when a user opens a XPage which contains the control.
Loading the jQuery from the web or from an Server is no option (Firewall).
What I am searching for would be a solution whenever a developer drags the component from the panel the jQuery gets added to the Notes Application.
UPDATE:
Thanks for the hint's I found "the for me best" solution.I used the ExtLibResources Class from the Extension library com.ibm.xsp.extlib.resources.ExtLibResources to include my Script libraries. With this method they won't get included several times when you use more then one of my controls on the same XPage.
If you don't want to use the Extension Library but you want to use this method to include a CSJS in your custom control you can just build you own Resource Class.
Now my Code to include jQuery looks like this:
ScriptResource jquerymin = new ScriptResource();
jquerymin.setType("text/javascript");
jquerymin.setSrc(JQUERY_PATH);
jquerymin.setClientSide(true);
ExtLibResources.addEncodeResource(context, jquerymin);

A: Check out this project on OpenNTF.  a jQuery Ext. Library.  I suspect this is what you'd need to do.
http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=jQuery%20Extension%20Library

A: Instead of adding the library yourself wouldn't it be possible to add the jquery libraries using CDN?


text:
Q: C# quick question regarding "this" keyword? Is this piece of code correct:
using (MyForm form = new MyForm { TopMost = TopMost})
{
}

I want to make the new Form TopMost, if the parent Form is TopMost, or should I write like this, I mean the new Form TopMost property is not self assigned to itself.
using (MyForm form = new MyForm { TopMost = this.TopMost})
{
}

A: They are the same, but the second is slightly more readable. Resharper will flag this. as redundant code, so to each his own.

A: It also always happens when you have a property named exactly like an enum..
enum Reason { ... }

class Test
{
  Reason Reason { get; set; }
}

Like Yuriy said, this is just a readability issue for some
I say for some, because the side of the assignment tells us what the keyword refer to... a property or a variable, etc. So you usually deduce it without even thinking about it.
Mike


text:
Q: Curious behavior of the Dim instruction in Microsoft Visual Basic I am using VBA 7.1.1092 and I have the very strange (but I am probably missing something obvious) behavior. This is the code:
Function test(s As String) As String
    test = s
End Function
Function test2(p As String) As String
    Dim s As String
    Dim t As String
    s = p
    test2 = test(s)
End Function
Function test1(p As String) As String
    Dim s, t As String
    s = p
    test1 = test(s)
End Function

Function test2 does compile while the compilation of test1 fails on the instruction
test1=test(s)

with the error on s being "ByRef incompatible". I thought that the declarations in test1 and test2 were identical. So, what am I missing?
Thanks in advance

A: In VBA
Dim s, t As String

equivalent to:
Dim s as variant
Dim t as String

As type of s is omitted so by default it will be variant.
you will have to declare like this:
Dim s As String
Dim t As String


text:
Q: Installation setup problem (Access a checkbox in custom dialog box)
I'm trying to create a  installation setup for my VB.net application. I
  need to insert a custom action while setup is running. So I add a
  Checkbox Dialog box to my setup. And I add a dll to the setup
  installation to capture Before Install and After Install events. Those
  are works fine. But I cannot access my check box value in those
  events. If u guys can give me a hint to continue my work really
  appreciates.
Following is the Before Install event I have created. I have set some
  messages to verify my event works correctly. While I run the setup
  those messages are prompt properly.

Private Sub Installer_BeforeInstall(ByVal sender As Object, _
                               ByVal e As System.Configuration.Install.InstallEventArgs) Handles MyBase.BeforeInstall
    Dim koFaxPath As String = Nothing
    MsgBox("Installer_BeforeInstall: Starts1")

    Dim contextParameters As StringDictionary
    Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
    Dim actionDataName As String = String.Empty
    Dim arrayActionData() As String

    contextParameters = Me.Context.Parameters
    For Each actionDataName In Me.Context.Parameters.Keys
        arrayActionData = Me.Context.Parameters(actionDataName).ToString.Split("-")
        MsgBox(actionDataName.ToString)
        MsgBox(arrayActionData(0).ToString)
        MsgBox(Me.Context.Parameters.Item(actionDataName.ToString))
    Next

    Try
    Catch ex As Exception
        'needs to impliment
    End Try

    MsgBox("Installer_BeforeInstall: Ends")
End Sub

Thanks in advance.

A: I have found the answer for that. It may useful for u as well.
Once you have add your dll to the setup project, Go to dll properties.
There is a property called CustomActionData. Fill it as follows
/CheckBoxSequenceGenerator="[CheckBoxName]"

Now you can access this in following code
Context.Parameters("CheckBoxSequenceGenerator")

A: Please make sure that your check-box property are not assigned to coding.


text:
Q: How to make a sprite jump in cocos2d 3.0 I'm working on a game in Cocos2d 3.0 and I can't find much in the way of tutorials. I was hoping for someone to teach me how to make a sprite jump when you press swipe up on the left side of the screen (iphone is in landscape).
Not sure if this is needed but my sprite implementation code is below.
daveRunSG = [CCSprite spriteWithImageNamed:@"char1.png"];
daveRunSG.position = ccp(100, 130);
CCActionAnimate *animAction = [CCActionAnimate actionWithAnimation:anim];
CCActionRepeatForever *animationRepeatFor = [CCActionRepeatForever actionWithAction:animAction];
[daveRunSG.texture setAntialiased:NO];
[daveRunSG runAction:animationRepeatFor];
[self addChild:daveRunSG];

Thanks in advance for any help I receive.

A: You can apply an impulse to the character's physics body. It must be a child of a physics node and have the physics set up.
[daveRunSG.physicsBody applyImpulse:ccp(0, 1600)];

Also, if you're looking for some good tutorials you should visit https://www.makegameswith.us or http://www.raywenderlich.com/tag/cocos2d


text:
Q: Connecting thread signal to MainWindow I have two classes. One is the mainWindow class and the other is a thread which will update a progress bar, among other things.
To update the progressBar I am using a signal/slot structure like this: (I show relevant code):
import threading
from PyQt4 import QtCore, QtGui, Qt

class MyThread(threading.Thread):

    mySignal = QtCore.pyqtSignal(int, int)

    def __init__(self,*args):
        threading.Thread.__init__(self)

class Form1(QtGui.QMainWindow):

    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

    ...
    ...
    @pyqtSlot(int, int)
    def updateProgress(self, arg1, arg2):
        print "TEST Argument1: ", arg1
        print "TEST Argument2: ", arg2

    def my_function(self):
        mt = MyThread(*args)
        mt.mySignal .connect(self.updateProgress)
        mt.start()

And I am getting this that I am not sure to understand:
    mt.mySignal .connect(self.updateProgress)
TypeError: pyqtSignal must be bound to a QObject, not 'MyThread'

A: You need to inherit from QThread, not python Thread. Otherwise the QObject-Thread-ownership which is crucial for the signal/slots to work across thread boundaries can't work it's magic.