text:
Q: Scatter plot matrices with multiple variables in R I know pairs(df) is a great way to do scatter plots in finding possible correlations in variables with say about max 10 variables, but is there a way to plot scatter plots for say 200 variables?

A: as @AlexA suggested, one way:
n <- 5
ii <- cumsum(seq.int(ncol(mtcars)) %% n == 0)

pdf('~/desktop/tmp.pdf')
for (i in unique(ii))
  pairs(mtcars[, ii %in% i])
dev.off()

or to get a quick look at them
for (i in unique(ii)) {
  pairs(mtcars[, ii %in% i])
  Sys.sleep(2)
}


text:
Q: Gradle can't execute an Ant target I have a gradle task that has a dependsOn and then needs to execute an Ant task called runcukes.  Gradle won't call the ant task, however:
ant.importBuild 'build.xml'

task runCukes(dependsOn: restoreSchema) {
    runcukes
}

Running gradle with -d shows that gradle doesn't recognize the Ant target runcukes:
    Finished executing task ':restoreSchema'
17:28:37.506 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :runCukes
17:28:37.506 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter                                                                    ]
Starting to execute task ':runCukes'
    17:28:37.507 [INFO] [org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter                                                                     ]
    Skipping task ':runCukes' as it has no actions.
    17:28:37.507 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter

Gradle doesn't recognize that it has to execute the ant target runcukes.
The gradle docs don't show anything as complicated as a task that has a dependsOn that then executes an ant task.  (They only show "Hello World" examples as dependencies.)
What do I have to do to get Gradle to execute an Ant task after executing a dependsOn?
Thanks.

A: Just putting the Ant task name into the configuration block of a task won't execute it. This should do what you want if I understood your requirements correctly:
ant.importBuild 'build.xml'

runcukes.dependsOn restoreSchema
task runCukes(dependsOn: runcukes)

redpajama_set_name: RedPajamaStackExchange


text:
Q: Why is the sort order lost when returning a collection via the REST API with resultDataContents=graph For the following data:
create (a:Attendee {name:'luanne'});
create (a:Attendee {name:'adam'});
create (a:Attendee {name:'christoph'});
create (a:Attendee {name:'vince'});
create (a:Attendee {name:'michal'});

this query
MATCH p=(n:Attendee)-[r*0..1]-(m)
WITH p order by head(nodes(p)).name
return collect(distinct(p))

when executed via the shell return paths of length one, ordered by the name of the first node in the path.
However, via the REST API:
POST http://localhost:7474/db/data/transaction/commit
{"statements":[
{"statement":"MATCH p=(n:`Attendee`)-[r*0..1]-(m) WITH p order by head(nodes(p)).name return collect(distinct(p))","parameters":{},"resultDataContents":["graph"]}
]}]}

the same order is not maintained (looks like it's ordered by the node id).
How do I fix my Cypher to give me the same results as when executed via the shell?
PS. Works fine if resultDataContents is "row" and also when there is no COLLECT used in REST

A: Collect is not needed in this case.
return distinct p should be enough.
In resultDataContents "graph" it reprocesses the response using sets to collect nodes and relationships for the response uniquely. Very likely that there the order is lost.


text:
Q: Why when I enter 1999-10-17 it submits 1999-10-01 React native? I'm trying to submit a form with a birthdate. But for one or another reason when I for example enter 1999-10-17 it submits 1999-10-01. It just always removes the last number and puts a 0 before. I've been trying everything I could imagine but nothing works...
Why this happens and how can I solve it???
  const [birthdate, setBirthdate] = useState('');
  const [yearB, setYearB] = useState('');
  const [monthB, setMonthB] = useState('');
  const [dayB, setDayB] = useState('');
  const updateBirthdate = () => {
    setBirthdate(`${yearB}-${monthB}-${dayB}`);
  };
  const handleYearBChange = (yearB) => {
    setYearB(yearB);
    updateBirthdate();
  };

  const handleMonthBChange = (monthB) => {
    setMonthB(monthB);
    updateBirthdate();
  };

  const handleDayBChange = (dayB) => {
    setDayB(dayB);
    updateBirthdate();
  };
     <TextInput
        value={yearB}
        onChangeText={handleYearBChange}
        onSubmitEditing={() => yearBInput.current.blur()}
        placeholder="year"
        keyboardType="numeric"
      />
      <TextInput
        value={monthB}
        onChangeText={handleMonthBChange}
        onSubmitEditing={() => monthBInput.current.blur()}
        placeholder="month"
        keyboardType="numeric"
      />
      <TextInput
        value={dayB}
        onChangeText={handleDayBChange}
        onSubmitEditing={() => dayBInput.current.blur()}
        placeholder="day"
        keyboardType="numeric"
      />

A: You must use useEffect hook to update the birthdate with each rendering, follow the example:
  const updateBirthdate = useCallback(() => {
    setBirthdate(`${yearB}-${monthB}-${dayB}`);
  }, [yearB, monthB, dayB]);

  const handleYearBChange = (yearB) => {
    setYearB(yearB);
  };

  const handleMonthBChange = (monthB) => {
    setMonthB(monthB);
  };

  const handleDayBChange = (dayB) => {
    setDayB(dayB);
  };

  useEffect(() => {
    updateBirthdate()
  }, [updateBirthdate])


text:
Q: Does .NET Framework 3.5 SP1 require restart? We have a production machine and are trying to slowly introduce some 3.0 and up features on our web application. 3.5 is installed but I would like to upgrade to SP1, I would just like to know if it requires a restart of the machine in the end so I can schedule some down time.
Thanks!
EDIT: so it did require the restart, thanks guys for the answer...but the hosting company didn't give us the rights to do so...LOL

A: He he.  I installed it on about 4 machines...two required a restart, two did not.  The configuration was similar between them, so there was no obvious way to determine why some needed a restart and others didn't.  The best theory I have currently is that the ones which needed restarts tended to be the ones which were more active (they were all running ASP.Net sites), so it is possible that the framework bits had not yet been loaded by IIS for the ones which did not need a restart.
To be safe, plan on restarting and schedule the update accordingly.

A: 3.5 SP1 updates 3.0 to SP2 and 2.0 (which contains the CLR) to SP2. If the CLR is loaded in any process the DLLs will not be writable, and a reboot will be required.

A: Mine did not.  But I do anyway.  Clear the bits.

A: I ran the update on a Windows XP machine yesterday and it did not require a restart.

A: every machine that I have touched with SP1 for .Net 3.5 has required a reboot.  It totally trashed my Team Foundation Server box.


text:
Q: print via system() in perl via xampp (windows-7-x64) not working I need to print a generated text-file with perl. I'm using xampp, Windows7 64 bit.
My perl-script is containing the print system call:
$system = "print\ /d:\\\\SERVER\\PRINTER\ C:\\xampp\\cgi-bin\\textfile.txt";
system ($system);

When i try the same line in the cmd-shell, the print works.
The answer is:
C:\xampp\cgi-bin\textfile.txt wird momentan gedruckt.

but nothing else happens.
I then tried to create a batch-file. Starting the batch-file manually starts the print. From a system()-call nothing happens.
Then i tried another way, showing the file in Firefox first. I copied the file to my htdocs-dir and changed my batch-file to:
cd "c:\Program Files (x86)\Mozilla Firefox"
firefox.exe -new-window http://localhost/textfile.txt

Doubleclicking the bat starts my firefox and my textfile.
The system()-call ist not working.
Any Ideas?
Tom

A: My brother found the reason. THANKS CHRIS!
It was a problem with the permissions.
The apache service is running without normal user permissions.
To set user permissions (or, better: special defined, new permissions) in Windows 7 pro 64 bit:
(Sorry, this is german)
Task-Manager
"Dienste"
rechts unten auf "[Adminzeichen] Dienste"
Auf Dienst "Apache" rechtsklick "Eigenschaften"
Reiter: "Anmelden"
Auswahl: "Dieses Konto"
User und Passwort rein
"Übernehmen" und "OK"
Dann nochmal auf "Apache" linksklick und links auf "neu starten"


text:
Q: calling a function inside a function in python with lists was beginning my code, what I am trying to do is generate a list for some lottery mini-game im working on. It takes 10 numbers and 5 letters, I run a function to do that and it works just fine. Then I want to set the winning condition so I make another function and use the function within that function to fill the list with numbers/letters randomly. However, it always gives me the error "cannot choose from empty sequence" when I try to fill the list inside the win condition function. Here is my code so far
import string
def fill_list(random_list):
    random_list=[]
    for i in range(0,10):
        n=random.randint(1,10)
        random_list.append(n)
    for j in range(0,5):
        n=random.choice(string.ascii_letters)
        random_list.append(n)
    return random_list

def win_condition(the_list):
    the_list=[]
    fill_list(the_list)
    win_list=[]
    for i in range(0,4):
        n=random.choice(the_list)
        win_list.append(n)
    return win_list

#Error code
    raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence

A: here is the problem in your code (in comment after lines):
def win_condition(the_list):
    the_list=[] #the_list let an empty list
    fill_list(the_list) #you invitate the fill_list() without data, and you get a list, that you dont use
    win_list=[]
    for i in range(0,4):
        n=random.choice(the_list) #the_list is yet empty, the program can not do something with an empty list
        win_list.append(n)
    return win_list

Try it:
import string
def fill_list():
    random_list=[]
    for i in range(0,10):
        n=random.randint(1,10)
        random_list.append(n)
    for j in range(0,5):
        n=random.choice(string.ascii_letters)
        random_list.append(n)
    return random_list

def win_condition():
    the_list=fill_list()
    win_list=[]
    for i in range(0,4):
        n=random.choice(the_list)
        win_list.append(n)
    return win_list

I hope, it will be useful
Nohab

A: The problem in your code is that you are re-initializing the list after taking it as an argument. Also in win_condition() the output of fill_list(the_list) is now stored in win_list instead of initializing an empty list.
I tried to add minimum lines and just commented out the lines in your code that lead to the error.
import string
import random
def fill_list(random_list):
    # random_list=[]
    for i in range(0,10):
        n=random.randint(1,10)
        random_list.append(n)
    for j in range(0,5):
        n=random.choice(string.ascii_letters)
        random_list.append(n)
    return random_list

def win_condition(the_list):
    # the_list=[]
    win_list = fill_list(the_list)
    # win_list=[]
    for i in range(0,4):
        n=random.choice(the_list)
        win_list.append(n)
    return win_list
print(win_condition([1,2, 3]))

Output:
[1, 2, 3, 5, 1, 6, 7, 4, 2, 2, 2, 5, 10, 'e', 'A', 'N', 'S', 'x', 2, 2, 'A', 2]


text:
Q: Java Concordance Exercise So I have a programming exercise that involves concordance.  I am attempting to take a .txt file, use regex to parse it into strings containing all words, then create a Hashtable that has the key (the word) and the value (the number of times the word appears in the document).  We are supposed to be able to account for both case sensitive and non-case sensitive scenarios by passing in a boolean.
Here is what I have:
    public Concordance( String pathName, boolean is_case_sensitive ) {
    Scanner file = new Scanner(pathName);
    try {
        file = new Scanner(new File(pathName));
    } catch (FileNotFoundException e) {
        System.out.println("No File Found");
    }

    String[] words;

    Pattern pattern = Pattern.compile("\\W+");

    words = pattern.split(file.nextLine());
    String[] wordsCopy = new String[words.length];
    for (int i = 0; i < words.length; i++){
        wordsCopy[i] = new String(words[i]);
    }

    int counter = 0;

    while (file.hasNext()){
        for (String w : words){
            counter = 0;
            for (String w2 : wordsCopy){
                if (is_case_sensitive == false){
                    if (w.equalsIgnoreCase(w2)){
                        counter++;
                        //w2 = null;
                        tableOfWords.put(w, counter);
                        file.next();
                    }
                }
                if (is_case_sensitive == true){
                    if (w.equals(w2)){
                        counter++;
                        //w2 = null;
                        tableOfWords.put(w, counter);
                        file.next();
                    }
                }
            }
        }
    }
}

To walk you through where I am and where my error I believe is....
I use the scanner to "take in" the file the use the regex \W+ to get all of words.  I create a String array, I split the Pattern pattern into the String array.  Then I create a deep copy of the array to use during comparison.  (So I now have two String arrays - words and wordsCopy).  I use an int counter variable to keep track of how many times it appears and address case sensitivity by using an if statement and the equals/equalsIgnoreCase methods.  I have been going back and forth between assigning w2 to null (its currently commented out) as I intuitively feel like if it is not set to null, it will be counted twice, but I can't seem to think through it appropriately.  I think I am counting items in duplicate, but can't seem to figure out a solution.    Any insight?  Thanks!

A: You dont need any extra String[] to check case sensitive
Pattern pattern = Pattern.compile("\\W+");
        HashMap<String, AtomicInteger> tableOfWords = new HashMap<String, AtomicInteger>();

        while (file.hasNextLine()){
            words = pattern.split(file.nextLine());
            for (String w : words){
                String tmp = w;
                if (!is_case_sensitive){
                    tmp = String.valueOf(w.toLowerCase());
                }

                AtomicInteger count = tableOfWords.get(tmp);
                if (count == null){
                    count = new AtomicInteger(0);
                }
                count.incrementAndGet();
                tableOfWords.put(tmp,count);
            }
        }

Convert the actual word into low / high case if case sensitive is not required. then everything work perfectly.

A: As far as I can see you are actually counting words multiple times (more than twice aswell)
I'll give you a simple foreach loop to explain what you're doing,
some of the syntax might be wrong as i'm not using an ide to write this code
int[5] ints = {1,2,3,4,5};
int[5] intcopy = ints;

for(int i:ints){
  for(int j: intcopy){
    system.out.println(j);
  }
}

What you will end out printing is
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
So instead of counting 5 things you are counting 25 things, hope this helps


text:
Q: Fetch column with maximum value for a column & then maximum value of another column My Table:
create table temp_table_name
(seq number(10), start_Date date, end_date date, param varchar2(10))

My PK:
alter table temp_table_name add primary key (seq,start_date,end_Date)

My Records:
SEQ START_DATE  END_DATE    PARAM
10  01-Jan-2017 01-Jan-2020 10
10  01-Jan-2017 01-Jan-2022 20
10  05-Jan-2017 01-Jan-2022 30
10  06-Jan-2017 01-Jan-2020 25
10  06-Jan-2017 01-Jan-2021 50

My Requirement
To Find the record with the MAX(START_DATE) & Among those records with the MAX(END_DATE)
My Try
Select M1.* From Temp_Table_Name M1,
(
    With x as (
    Select T1.SEQ,T1.START_DATE,T1.END_DATE
    From
    Temp_Table_Name T1 Left Outer Join Temp_Table_Name T2
    On T1.Seq = T2.Seq
    And T1.Start_Date < T2.Start_Date
    Where T2.SEQ is null)
    Select X1.SEQ,X1.START_DATE,X1.END_DATE
    From
    X X1 Left Outer Join X X2
    On X1.Seq = X2.Seq
    And X1.End_Date < X2.End_Date
    Where X2.Seq is null
) M2
Where M1.Seq = M2.Seq
And M1.START_DATE = M2.Start_Date
And M1.End_Date = M2.End_Date

Although it fetches the records how i want, the query doesn't look that great & i doubt its the most efficient way to do this. I also would like to know if there might be any issues in the way I am trying to do this in future in a scenario i have not encountered yet.
Found the idea to create my query from Here.
Edit:
Another way of doing it with a much more elegant query:
Select * From (
    Select t1.*,
    row_number() over (partition by seq order by start_date desc, end_Date desc) rank
    From temp_table_Name T1
)Where rank = 1


text:
Q: How to provide image path in "main.css" in Django? I am trying to build an app in Django, I have created a home page, the statics paths I have set for the project working fine. I am able to render HTML(index.html) associated CSS (main.css) and images perfectly except an image "banner.jpg".
For other images, I have set path as we usually do in Django,
<img src="{% static 'images/image1.jpg' %}" alt="" />

For the banner of the home page, I tried to set a path in CSS something like given below.
main.css
#banner {
        background-color: #e5474b;
        color: #f2a3a5;
        padding: 13em 0 11em 0;
        background-color: #0c0c0c;
        background-image: url("../images/banner.jpg");
        background-size: cover;
        background-repeat: no-repeat;
        background-position: 15% left;
        text-align: left;
        position: relative;
        z-index: 9999;
    }

or
#banner {
    background-color: #e5474b;
    color: #f2a3a5;
    padding: 13em 0 11em 0;
    background-color: #0c0c0c;
    background-image: url("{% static 'images/banner.jpg' %}");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 15% left;
    text-align: left;
    position: relative;
    z-index: 9999;
}

but both the methods never work, however when I set path "url("../images/banner.jpg")" without Django it works perfectly and renders the image in the background. Where should I make the changes to correct this problem?
Thank you.

A: After struggling and reviewing the comments,  I am able to find a quick fix that works perfectly for me.
<head>
  ...
  <style>
    #banner {
      background-image: url("{% static 'images/banner.jpg' %}");
    }
  </style>
 ...
</head>

I just cut past the background-image section from "main.css" to "index.html" under the header section and it works perfectly.


text:
Q: Writing a list of dictionaries in CSV The next problem you have a list of dictionaries of the format
[{'a': 10, 'b': 11, 'c': 12, 'd': 13, 'e': 14},
 {'a': 20, 'b': 21, 'c': 22, 'd': 23, 'e': 24},
 {'a': 30, 'b': 31, 'c': 32, 'd': 33, 'e': 34},
 {'a': 40, 'b': 41, 'c': 42, 'd': 43, 'e': 44}]

which you want to move to CSV-file, looking like
"a","b","c","d","e"
 10,11,12,13,14
 20,21,22,23,24
 30,31,32,33,34
 40,41,42,43,44

Problem is that when you start code:
def write_csv_from_list_dict(filename, table, fieldnames, separator, quote):
    table = []
    for dit in table:
        a_row = []
        for fieldname in fieldnames:
            a_row.append(dit[fieldname])
        table.append(a_row)
    file_handle = open(filename, 'wt', newline='')
    csv_write = csv.writer(file_handle,
                           delimiter=separator,
                           quotechar=quote,
                           quoting=csv.QUOTE_NONNUMERIC)
    csv_write.writerow(fieldnames)
    for row in table:
        csv_write.writerow(row)
    file_handler.close()

raising error
(Exception: AttributeError) "'list' object has no attribute 'keys'"
at line 148, in _dict_to_list wrong_fields = rowdict.keys() - self.fieldnames

Why to be so hard to say, explicitly to close a file, not a string.

A: The below code should work
data = [{'a': 10, 'b': 11, 'c': 12, 'd': 13, 'e': 14},
        {'a': 20, 'b': 21, 'c': 22, 'd': 23, 'e': 24},
        {'a': 30, 'b': 31, 'c': 32, 'd': 33, 'e': 34},
        {'a': 40, 'b': 41, 'c': 42, 'd': 43, 'e': 44}]
keys = data[0].keys()
with open('data.csv', 'w') as f:
    f.write(','.join(keys) + '\n')
    for entry in data:
        f.write(','.join([str(v) for v in entry.values()]) + '\n')

data.csv
a,b,c,d,e
10,11,12,13,14
20,21,22,23,24
30,31,32,33,34
40,41,42,43,44


text:
Q: UIView Perspective feature I've got a view and I would like to scale this view as like below image. How do we achieve this?
Thanks,
Mahesh

A: You need to rotate your view's layer.  Something like this,
CALayer *layer = yourView.layer;
CATransform3D rotationTransform = CATransform3DIdentity;
rotationTransform.m24 = 1.0 / -350;
rotationTransform = CATransform3DRotate(rotationTransform, 60*M_PI/180, 1.0, 0.0, -0.1);
[layer setTransform: rotationTransform];

Check out this guide to understand CALayer's geometry and how it works.


text:
Q: 'this' is not available android studio I have this message during the work with the alert dialogs in the debug window: "'this' is not available"
I saw 2 questions similar( this  and this) to mine but I do not have Hugo and I could not find the solution.
My  gradle:
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   compile files('libs/androidsvg-1.2.1.jar')
   compile 'com.android.support:appcompat-v7:24.2.0'
   compile 'com.android.support:design:24.2.0'
   compile 'com.android.support:support-v13:24.2.0'
   compile 'com.android.support:cardview-v7:24.2.0'
   compile 'com.android.support:support-v4:24.2.0'
   compile 'com.android.support:support-vector-drawable:24.2.0'
   compile 'com.android.support:recyclerview-v7:24.2.0'
   testCompile 'junit:junit:4.12'
   compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
}

AND
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

AND My AlertDialogBuilder Code, which is fails on string .setMultiChoiceItems
AlertDialog.Builder builder = new AlertDialog.Builder(AddKeyActivity.this, R.style.MyAlertDialogStyle);
            builder.setTitle(R.string.choose_region)
                    .setMultiChoiceItems(regions, regions_chosen, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(...) {...}
....

}

Actually in the Activity I have one more AlertDialog.Builder, which works perfectly.
Please, can you help me to find the problem.
EDIT: The problem is that in the debug window I see " regions_chosen - 'this' is not available". The alert dialog is not appearing and the activity crashes.
EDIT2: Initialization of arrays:
final String[] regions = new String[Regions.getRegions().size()];
Regions.getRegions().toArray(regions);

boolean[] regions_chosen = new boolean[Regions.getRegions().size()];

A: Change
String[] regions = new String[Regions.getRegions().size()];
Regions.getRegions().toArray(regions);

to,
String[] regions = new String[Regions.getRegions().size()];
regions = Regions.getRegions().toArray(regions);

You can optimize the above as,
String[] regions = Regions.getRegions().toArray(new String[0]);


text:
Q: How to uniquly identify an two objects in same page having same url I Have two objects in same page but with different locations(tabs), I want to verify those objects each a part ...
i cant uniquely any of objects because the have same properties.

A: These objects clearly are unique to a point because they have completely different text, this means that you will be able to create an object to match only one of them. My suggestion would be to look for the object by using its text property, one of them will always have "Top Ranking" the other you wil need to turn into a regular expression for the text and will be something "Participants (\d+)".
I am assuming that this next answer is unlikely to be possible so saved it for after the answer you are likely to use but the best solution would of course be to get someone with access to give these elements ids for you to search for. This will in the long term be much easier for you to maintain and not using text will allow this test to run in any language.

A: Manaysah, do these objects have different indexes? Use the object spy and determine which index they have, the ordinal identifier index may be a solution to your problem. You could also try adding an innertext object property if possible, using a wildcard for the number inside the () as it appears dynamic.

A: try using xpath for the objects...xpath will definitely be different


text:
Q: Access 2010 ADO on Windows XP Mode (in ADDE format) I have a problem with ADO in My application. I have Access installed on my computer with Win7Pro and there I can use both version (ACCDB and ACCDE). But only ACCDB works under runtime (with SP1) in WinXPMode environment.
There is the code
Dim strSQL As String, Cnxn As ADODB.Connection, Rsxn As ADODB.Recordset
Dim lngDummy As Long
lngCount = DCount("[Sklad]", "cisSklad", "[Zobrazit]")
CountData = lngCount
If CountData = 0 Then Exit Sub
ReDim ItemValues(lngCount - 1)
Set Cnxn = CurrentProject.AccessConnection
Set Rsxn = New ADODB.Recordset
...

In ACCDE (under RunTime on XPMode):
The line Set Cnxn = CurrentProject.AccessConnection return the message Error 13: Type mismatch.
I have the reference to ADO 2.8.
Debug.Print CurrentProject.AccessConnection: Provider=Microsoft.Access.OLEDB.10.0;Persist Security Info=False;Data Source=C:\Work\SkladII\Sklad.accde;User=Admin;Data Provider=Microsoft.ACE.OLEDB.12.0
All tables in sklad.accde are linked
Do you have any idea, where is the problem?

A: Investigate whether this issue is confined to early binding for ADO in WinXPMode.  Remove the reference for ADO and revise your code to use late binding.
Dim strSQL As String, Cnxn As Object, Rsxn As Object
Set Cnxn = CurrentProject.Connection
'Set Rsxn = New ADODB.Recordset
Set Rsxn = CreateObject("ADODB.Recordset")


text:
Q: Anonymous SVN Checkout, but Authenticate Commit I am setting up SVN repository with Httpd. Currently, my repository is available through Httpd, but anybody can checkout and commit back. I want to limit the commit action using Microsoft Active Directory Authentication.
I am using the following in my subversion.conf.
<Location /repos>
   DAV svn

   # Directory containing all repository for this path
   SVNParentPath /srv/svn/repositories

   # List repositories colleciton
   SVNListParentPath On

   # Enable WebDAV automatic versioning
   SVNAutoversioning On

   # Repository Display Name
   SVNReposName "RepositoryName"

   # Do basic password authentication in the clear
   AuthType Basic

   # The name of the protected area or "realm"
   AuthName "RepositoryName"

   # Make LDAP the authentication mechanism
   AuthBasicProvider ldap

   # Make LDAP authentication is final
   AuthzLDAPAuthoritative off

   # Active Directory requires an authenticating DN to access records
   #AuthLDAPBindDN "ou=people,o=example,dc=com"

   # The LDAP query URL
   AuthLDAPURL "ldap://example.com:389/DC=com,DC=example,ou=people?uid(objectClass=*)" NONE

   # Read access to everyone
   Satisfy Any

   # Require a valid user
   Require valid-user

   # Authorization file
   AuthzSVNAccessFile /subversion/apache2/auth/repos.acl

   # Limit write permission to list of valid users.
   #<LimitExcept GET PROPFIND OPTIONS REPORT>
      # Require SSL connection for password protection.
      # SSLRequireSSL

      #AuthType Basic
      #AuthName "Authorization Realm"
      #AuthUserFile /etc/httpd/conf/.htpasswd
      #Require valid-user
   #</LimitExcept>
</Location>

With above configuration, it asks for the credentials everytime. Also, when provided, the repository is inaccessible. I get 500 Internal Server Error after giving the correct credentials.
I did check the log files, but nothing there to indicate the actual cause.

A: In order to allow public reading/checkout, you need to uncomment the bit between the <LimitExcept> directive and comment the separate Require valid-user line above it.
The directive <LimitExcept GET PROPFIND OPTIONS REPORT> tells the server that everything inside that does not apply to any GET, PROPFIND, OPTIONS or REPORT request to the repository, which are used for checking out/reading the repo. In other words, if you would put this bit of code in your Apache configuration, it would only require a valid user for anything else than the mentioned methods (e.g. it would require a valid user if a PUT request is made to commit):
<LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
</LimitExcept>

In your case, it should probably look something like this (I just slightly modified your posted config, assuming that is correct besides the forced login issue (I have no LDAP server to test it with). Note to replace example.com in your AuthLDAPURL to the real server host):
<Location /repos>
   DAV svn

   # Directory containing all repository for this path
   SVNParentPath /srv/svn/repositories

   # List repositories colleciton
   SVNListParentPath On

   # Enable WebDAV automatic versioning
   SVNAutoversioning On

   # Repository Display Name
   SVNReposName "RepositoryName"

   # Do basic password authentication in the clear
   AuthType Basic

   # The name of the protected area or "realm"
   AuthName "RepositoryName"

   # Make LDAP the authentication mechanism
   AuthBasicProvider ldap

   # Make LDAP authentication is final
   AuthzLDAPAuthoritative off

   # Active Directory requires an authenticating DN to access records
   #AuthLDAPBindDN "ou=people,o=example,dc=com"

   # The LDAP query URL
   AuthLDAPURL "ldap://example.com:389/DC=com,DC=example,ou=people?uid(objectClass=*)" NONE

   # Authorization file
   AuthzSVNAccessFile /subversion/apache2/auth/repos.acl

   # Limit write permission to list of valid users.
   <LimitExcept GET PROPFIND OPTIONS REPORT>
       SSLRequireSSL
       Require valid-user
   </LimitExcept>
</Location>

As long as you put the Require valid-user inside the LimitExcept, everything should work just as you want it to. You can put the rest of the authentication configuration anywhere between the Location directive.

A: Ok. I got the first part done.
With reference from 6. Access control lists section here, I added the read-only access in the AuthzSVNAccessFile file.
# Authorization file
AuthzSVNAccessFile /srv/svn/repos.acl

Contents of /srv/svn/repos.acl file
[/]
* = r

Now, all my repositories will be anonymously accessible. Now the commit part is remaining.
Now I get the following message when I commit.
Commit failed (details follow):
Server sent unexpected return value (500 Internal Server Error) in response to
MKACTIVITY request for '/repos/project1/!svn/act/783d45f7-ae05-134d-acb0-f36c007af59d'

A: Every Subversion server that I've seen:

*

*Allows anonymous checkout with no commit.

*Requires authenticated checkout and allows commit.

I believe that the Subversion commit process has to be.

*

*Receive authentication credentials.

*Checkout code with authentication.

*Reapply changes.

*Commit changes.

A: I suggest using Visual SVN Server. It has support for Active Directory. Visual Svn Server install apache and svn binaries. Also it creates necessary conf file for apache.
Install it with your wanted features and inspect apache configuration file it creates.
Also I suggest using/buying it instead of maintaining your apache server if you can run in windows box.

A: Just some notes:

*

*I never seen SVNAutoversioning used inside Subversion location

*Reading Apache error-log can give more detailed information, than "500 Error" in case of troubles

*I have read here, on SO, some topics about troubles with Subversion on CentOS, related to owner of Apache process (some processes of httpd have different owner, than another: nobody and httpd): check it with ps -au | grep

*Troubles on commit usually related to insufficient permissions: Apache process must have write permissions for all files in repository

*Last, but not least, whith priority higher, than pp. 3-4 - in case of using AuthzSVNAccessFile at least one user|group for at least one path have to have write permissions ... = rw in order to commit. I don't know, how to write inherited from AD username in repos.acl file


text:
Q: Action of $SL_2\left(\mathbb{Z}\right)$ on $\mathbb{RP}^1$ is minimal
Suppose that $SL_2\left(\mathbb{Z}\right)$ acts on $\mathbb{RP}^1$ by left multiplication i.e $A\cdot x=Ax$, where $A \in SL_2\left(\mathbb{Z}\right)$ and $x=[x_1:x_2] \in \mathbb{RP}^1$. Show that $O_x=\{A\cdot x: A\in SL_2\left(\mathbb{Z}\right)\}$ is dense for any $x \in \mathbb{RP}^1$.

Let $x=x=[x_1:x_2] \in \mathbb{RP}^1$. When $x_2 \ne 0$, we have $x=[x_1:x_2]=\left[\dfrac{x_1}{x_2}:1\right]$, otherwise $[x_1:0]=[1,0]$ . Hence, it is enough to look at the orbits of $[x:1]$ and $[1,0]$ in $\mathbb{RP}^1$. Let's look at $O_{[1:0]}=\left\{A[1:0]; A \in SL_2\left(\mathbb{Z}\right)\right\}$. Let $[y:1] \in \mathbb{RP}^1$.
By Dirichlet's Theorem, there exists $P_N,Q_N \in \mathbb{Z}$ such that $ 1 \le Q_N \le N$ and $\left|Q_Ny-P_N\right| < \frac{1}{N}$. Let $A_N=\begin{bmatrix} P_N & P_NQ_N-1\\ 1 & Q_N \\ \end{bmatrix}$. Then $A_N[1:0]=[P_N:1]=\left[\frac{P_N}{Q_N}:  \frac{1}{Q_N}\right]$.
The first component converges to $y$ the choice of $P_N$ and $Q_N$. How do I make the second component small?
Thanks for the help!!

A: Take a rational number $a/b$ close to $y$ with $(a,b)=1$. Say $ac-bd=1$. Which matrix sends $[1:0]$ close to $[y:1]$?
For the orbit of $[x:1]$, you can either adapt the above argument, or use that the action is continuous:
$\overline O_x$ contains $\infty=[1:0]$, so $O_\infty$ (closures of stable sets are stable), so $\overline O_\infty$.

A: As said by barto, the action is transitive on $\mathbf{Q}\mathbb{P}^1$.
Beware that a continuous action with a dense orbit on a topological is not always minimal. Here is, in this case, a way to conclude.
Assume by contradiction that $F$ is a closed invariant proper subset. Then $\mathbf{Q}\mathbb{P}^1$ is contained in its open complement $U$.
Let $V$ be the connected component of $U$ containing $\infty$. Then $V$ contains the complement of $[-n,n]$ for some $n$. Besides, $V$ is invariant by the stabilizer of $\infty$ in $\mathrm{SL}_2(\mathbf{Z})$, which contains the translation $x\mapsto x+1$. It follows that $V=\mathbf{Q}\mathbb{P}^1$ and hence $F=\emptyset$, proving minimality.


text:
Q: Understanding the closure, closed set theorem Theorem:
Let M be a nonempty subset of a metric space (X, d). $\overline{M}$ is M's closure then:
$$(1)x \in \overline{M} \iff \exists \{x_i\}_{i=1}^{n} \in M, x_n \to x $$
Question 1: Can we make statement (2) from statement (1)
$$(2)x \in \overline{M} \iff \exists \{x_i\}_{i=1}^{n} \in \overline{M}, x_n \to x $$
Proof:
proof 1
Let $x \in \overline{M}$
Question 2: This means x is in $M$ or in $\overline{M}$, right?
Let $x \in M$, then we have a sequence $(x,...,x)$
Question 3: Does this answer Question 1 ?
Let $x \notin M$, Then for every $n=1,2,...$ we can have a ball $B(x,\frac{1}{n})$, which contains $x_{n} \in M$
and  $x_{n} \to x$
Question 4 Why ?

Question 6 How does proving a statement for a specific ball $B(x,\frac{1}{n})$ proves the statement in general ?

Proof for <=
Question 5 What is the idea?

A: The correct version of (1) is $x \in cl(M) \Leftrightarrow \hspace{.2cm} \exists \{x_n\}_{n=1}^\infty with \hspace{.2cm} x_n \in M \hspace{.2cm} \forall n \in \mathbb{N} \hspace{.2cm} \wedge x_n \overset{n \rightarrow \infty} {\rightarrow} x.$
As you point out if $x \in M$ the sequence $x_n = x \hspace{.2cm} \forall n \in \mathbb{N}$ makes x an element of cl(M).
The claim you give in Q3 is also a correct proof you only interpret it inaccurately.
Since you in essence say $\forall n \in \mathbb{N} \hspace{.2cm} \exists x_n \in B(x, \frac{1}{n}),$ you can now define the sequence $\{x_{n_k}\}_{k=1}^\infty,$ where you select the elements of the sequence in the following way:
k = 1 pick any point in $M \backslash \{x\}$ to be $x_{n_1}$ and compute $d(x_1,x) = d_1$. $\forall k > 1$ pick  $x_{n_k} \in B(x,r_k)$, where $r_k = max(\{\frac{1}{n}| \frac{1}{n} < d_{k-1}\})$. This guarantees that $ l > k \Rightarrow d_l < d_k$. By the Monotone sequences Theorem this means that $d_k \overset {k\rightarrow \infty}{\rightarrow} 0,$ since $d_k \leq 0$ by definition.  I.e $x_{n_k} \overset {k\rightarrow \infty}{\rightarrow} x.$
With respect to Q5 $\forall r \in \mathbb{R} \hspace{.2cm} \exists k \in \mathbb{N} \hspace{.2cm} : r_k < r \hspace{.2cm} \Rightarrow x_{n_k} \in B(x,r),$ which proves the claim.


text:
Q: Saiku CE as a plugin for Pentaho 8.3 I have a question where I am stuck. I have a server where I have raised a Pentaho Community Edition version 8.3. I need to have the Saiku plugin installed to perform a series of analyzes. If I go to the Pentaho Marketplace, it only allows me to install the Saiku as a plugin but to enter the Enterpirse version. I have followed the instructions for generating a license, but this license that I generated has a duration of 30 days.
On the other hand, I have managed to install the Saiku Community Edition service from another account but as a standalone executed with Tomcat. This option is not valid since there is no way to connect it to the Pentaho server.
Any way to install a version of Saiku in Community Edition as a plugin with Pentaho?
Thank you very much in advance.

A: Maybe this can help you:
https://github.com/dudanogueira/unimed_bi/blob/master/DockerFile
I have just installed pentaho 9, and looks like Saiku is no longer a option to use inside Pentaho as plugin.
Maybe you can still use the last plugin, I have not tried and probably will not use pentaho anymore in favor of Microsoft Power BI.


text:
Q: Setting custom "view" text with select while maintaining the ability to set an object to ng-model With select, if you put in a ng-model with a value it will display that as the selected option.
I have an object like this:
startDate: {
  view: "April - 2014",
  month: 03,
  year: 2014
}

With another object like this for selecting dates:
startDates:
[  {
view: APR - 2014
year: 2014
month: 3
 } ,  {
view: MAY - 2014
year: 2014
month: 4
 } ,  {
view: JUN - 2014
year: 2014
month: 5
 } ,  {
view: JUL - 2014
year: 2014
month: 6
 } ,  {
view: AUG - 2014
year: 2014
month: 7
 } ,  {
view: SEP - 2014
year: 2014
month: 8
 }  ]

I have a select statement that looks like this:
<select ng-options="date as date.view for date in startDates" ng-model="startDate" ng-change="getStart(startDate)"></select>

I would like to have the display be startDate.view but still allow ng-model="startDate" to be populated with the object selected.
I hope this is not too confusing of a question. Any help would be great.

A: You can find the various options here. Try to use:
<select ng-model="startDate" ng-options="d.view for d in startDates" ng-change="getStart(startDate)"></select>


text:
Q: How do I configure app_data() for actix_web() In my code I have this main function:
#[actix_web::main]
async fn main() -> Result<(), StdErr> {
    // loads env variables from .env
    dotenv::dotenv().ok();

    actix_web::HttpServer::new(move || {
        let cors = actix_cors::Cors::default()
            //.allowed_origin(
            //    &(std::env::var("SERVER_URL").unwrap().to_string()+ ":" + &std::env::var("FROTEND").unwrap().to_string())
            //)
            .allow_any_origin()
            .allowed_methods(vec!["GET","POST","PUT"])
            .allowed_headers(vec![
                actix_web::http::header::AUTHORIZATION,
                actix_web::http::header::ACCEPT
            ])
            .allowed_header(
                actix_web::http::header::CONTENT_TYPE
            )
            .max_age(3600);

        //logger::init();
        let party_repo = repo::PartyRepo::PartyRepo::connect();

        actix_web::App::new()
            .app_data(party_repo)
            .wrap(
                cors
            )
            .service(controllers::PartyController::party_api())
        })
    .bind((std::env::var("SERVER_URL").unwrap().to_string(),
        std::env::var("PARTY_CONTROLLER_PORT").unwrap()
            .parse::<u16>().unwrap()))?
    .run()
    .await?;

    Ok(())
}

This compiles correctly; however, when I run the server and try to make a get request I receive a 500 error from postman that: App data is not configured, to configure use App::data().
Now I am new to rust, so I maybe missing something obvious. That being said my understanding was that App.data() was used primarily with Arc. I tried this yet I receive the same error.
Let me know if I should include more :) Thanks!

A: Look at the examples in the docs for Data. It seems you have to put your initialized struct in a Mutex and then add that to your App. Also beware that you need to include it in your path fn as a Mutex as well.

let data = Data::new(Mutex::new(YOUR_DATA))
app.app_data(Data::clone(&data));

async fn index(data: Data<Mutex<YOUR_DATA_TYPE>>) -> impl Responder {

}


text:
Q: How to do AES 128 encryption of a string in Swift using Xcode and send it as POST to the server? How to do AES 128 encryption of a string in Swift using Xcode and send it as POST to the server?...
I am new to Xcode and am learning to encrypt the string data and want to send to HTTP server. It is a basic iOS app for sending Latitude and Longitude of the device.

A: Add #import <CommonCrypto/CommonCryptor.h> to your Bridging Header then use the following:
func encryptAES128(data: NSData, key: NSString, iv: NSString) -> NSData? {
    let keyPtr = UnsafeMutablePointer<CChar>.allocate(capacity: Int(kCCKeySizeAES128) + 1)

    defer {
        keyPtr.deallocate(capacity: Int(kCCKeySizeAES128) + 1)
    }

    let ivPtr = iv.utf8String
    bzero(keyPtr, 0)
    key.getCString(keyPtr, maxLength: Int(kCCKeySizeAES128) + 1, encoding: String.Encoding.utf8.rawValue)

    let bufferSize = data.length + kCCBlockSizeAES128
    let buffer = UnsafeMutableRawPointer.allocate(bytes: bufferSize, alignedTo: MemoryLayout.alignment(ofValue: CChar.self))

    var numBytesEncrypted = 0

    let cryptStatus = CCCrypt(CCOperation(kCCEncrypt), CCAlgorithm(kCCAlgorithmAES128), CCOptions(kCCOptionPKCS7Padding), keyPtr, kCCKeySizeAES128, ivPtr, data.bytes, data.length, buffer, bufferSize, &numBytesEncrypted)

    if cryptStatus == kCCSuccess {
        return NSData(bytesNoCopy: buffer, length: numBytesEncrypted, freeWhenDone: true)
    }

    buffer.deallocate(bytes: bufferSize, alignedTo: MemoryLayout.alignment(ofValue: CChar.self))
    return nil
}

To send it to the server, base64-encode the result, and send that. Then on the server side, base64-decode the result and decrypt it.

A: Based on examples from: https://github.com/krzyzanowskim/CryptoSwift
To encrypt a string using CryptoSwift:
func encrypt(text: String) -> String?  {
    if let aes = try? AES(key: "passwordpassword", iv: "drowssapdrowssap"),
       let encrypted = try? aes.encrypt(Array(text.utf8)) {
        return encrypted.toHexString()
    }
    return nil
}

To decrypt:
func decrypt(hexString: String) -> String? {
    if let aes = try? AES(key: "passwordpassword", iv: "drowssapdrowssap"),
        let decrypted = try? aes.decrypt(Array<UInt8>(hex: hexString)) {
        return String(data: Data(bytes: decrypted), encoding: .utf8)
    }
    return nil
}

To send the values to server look up:
HTTP Request in Swift with POST method or any one of the thousands of posts how to send data to server.


text:
Q: html input text "password box" and button to check if a password is correct to display "OK" or "ERROR" First semester WEB student here. Introduced to JavaScript at the end of this semester. Professor does not go into any type of detail. I have searched on W3schools and google for help. In HTML, I am to create an input text box (type="text") and a button (type="button") there is no . This part was simple.
The part I am not understanding is the JavaScript.
The text box should get focus when the page loads. I am to add JS inside the HTML page that includes a JS comment (not an html comment) and solves the tasks below:
Code an event that will execute when the user clicks the button.
If the user enters the correct password, display "OK" on the page else display "ERROR" for an incorrect password code another button that if clicked. The fontSize of the body is changed to 30px.
Now... I realize this should be a simple project, and I SHOULD be able to go to my professor with questions, but it is an online class and he just blows me off when I ask for help. I don't even know what else to search for this. W3schools has nothing similar. Please help. I just don't get it. I DO NOT want this done for me. It is pointless to just add someone else's code into my project and not learn something I will need in the future. I am looking for some resources to help me better understand the parts of this project I am struggling with. Thank you!
W3schools
google searches
Password:
<input id="password" type="text" />
<input id="Button1" type="button" value="Run" onclick="passcheck()" />

  result:

A: You can try something like this:

  Password:
  <input id="password" type="text" />
  <input id="Button1" type="button" value="Run" onclick="passcheck()" />

Result:

Besides it's better to use the type="password" for better usability
https://www.w3schools.com/html/html_form_input_types.asp
Just pass all the JS tutorial on w3schools
https://www.w3schools.com/js/js_htmldom_methods.asp
Hope it will help you)

A: Welcome to the JavaScript world!
As much I have understood, there are two things you want to do.
1) focusing an input on load
2) do validation on button click
3) changing of font size using JavaScript
First, to focus any input element on load in JavaScript, we need to fetch that element and then we can simply call tue focus function of JavaScript.

In the above given code, we are fetching any element(input) by getElementById and then setting it be focused by calling focus() function.
Second, again you have to get that password element inside your function and get its value and do some validation.

In the above code, the value is an property of element and      its the actual value you type in your input(password).
Third, you can create function like changeFont() and do your changes.

Final JavaScript code :

If you want to learn more about JavaScript, then visit w3schools


text:
Q: Default value of execution_timeout in Python Operator in Airflow I vaguely remember that the default value of execution_timeout is 15 minutes or 30 minutes but I couldn't find a relevant document anywhere. What is the default value?

A: As per the documentation of the Operators, the execution_timeout is set to None by default.
If you want to set any sort of upper limit then you'll have to explicitly specify it.

A: PythonOperator inherits from BaseOperator so you should checkout BaseOperator's document.

A: The default task execution_timeout value for all the operators is None.
If not specified, then the value is considered as None, meaning that the operators are never timed out by default.


text:
Q: how to get facebook account details i, asp.net? how to get facebook account details in asp.net??
is that possible to get account details from facebook to my website
i want to access username , email, picture , location, birthdate
 if (provider != "facebook")
    {
        //do normal oauth
    }
    else
    {
        FacebookClient client = new FacebookClient();

        var loginUrl = client.GetLoginUrl(new
        {
            client_id = ConfigurationManager.AppSettings["facebookId"],
            client_secret = ConfigurationManager.AppSettings["facebookClientSecret"],
            redirect_uri = redirectUrl,
            response_type = "code",
            scope = "email,user_birthday"
        });

        Response.Redirect(loginUrl.AbsoluteUri);
    }

i tried that but face a lot of problem EscapeUriDataStringRfc3986 not found
like what provider  definition
ConfigurationManager.AppSettings["facebookId"]?
ConfigurationManager.AppSettings["facebookClientSecret"]??

A: there are a set of stuffs you need to do to connect to FB

*

*you need to register to FB  by creating a API @ developers.facebook.com/

*Generate the Access token and secret key for your api

*Download the FB-js Sdk and refer in your page/site

*use the key`s above generated to connect to Facebook

one best tutorial for .net  application connecting to FB is http://facebooksdk.net/docs/web/getting-started/
which explains every section clearly.


text:
Q: How to switch between 2019 and 2017 projects in Visual Studio solutions? Is it possible to dynamic link the projects in a VS solution? Here my scenerio...

VS solution

*

*C++ project (v141, VS2017)

*C# project (.net 4.8)

If I open the VS solution in VS 2017 it adds the C++ project v141...

VS solution

*

*C++ project (v142, VS2019)

*C# project (.net 4.8)

and if I open the same solution in VS 2019 it adds the C++ project with v142.


text:
Q: Running scripts asynchronously in Azure DevOps I am implementing a pipeline where I want to deploy a lambda to SAM and then be able to hit the endpoint that was started, the problem is that when the pipeline runs the sam start local-api it succeeds but keeps waiting forever:
This is the steps that creates the YAML to run SAM:
  - script: |
      yarn local
      yarn sam:dev-api
    displayName: "SAM Deployment"
    workingDirectory: api-generator/helloworld-api

And here you can see how it gets stucked waiting for the ednpoint to be hit of pressing ctrl + c:

Is there a way in which I can run the sam start command and the continue the pipeline to test the endpoint (kind of a sam start non-blocking run)? or a tool recommended to kind of run a virtual bash that can run several instances at the same time in Azure DevOps?
Thanks in advance!

A: I suggest you can set a limit to end 'deployment part' in time and do other automation after that. An example:
trigger:
- none

pool:
  vmImage: ubuntu-latest

jobs:
- job: A
  timeoutInMinutes: 1 #Use this to end the deployment part, set the value based on your situation.
  displayName: Deployment
  steps:
  - bash: |
      echo "A"
      vi README.md
      #The deployment logic here, and stuck in this place.

- job: B
  continueOnError: true
  condition: always() #Use this to start the test step
  dependsOn: A
  displayName: Test
  steps:
  - bash: |
      echo "B"
      #The test logic here.


text:
Q: Accessing a hyperfileSQL data via # I have an application designed by WinDev, and it stores its data in hyperfilesSql files. What I want to do, is to extract these data using a C# application.
I tried to find a OleDb Provider for these hyperfilesSql, but with no result. Any help?

A: Here is how do to it ^^ :
1 : You can get the OleDb Provider for hyperfileSql files from this page.
2 : Here is a simple exemple of the code used to extract data :
string connectionString = @"Provider=PCSOFT.HFSQL;Initial Catalog=C:\MyDataFolder";
string sql = @"SELECT * FROM MyTable"; //MyTable = The .FIC file

DataTable table = new DataTable();

using (OleDbConnection connection = new OleDbConnection(connectionString))
{
       using (OleDbDataAdapter adapter = new OleDbDataAdapter(sql, connection))
       {
              adapter.Fill(table); //Fill the table with the extracted data
       }
}

gridControl1.DataSource = table; //Set the DataSource of my grid control

For other connection strings : visite the page


text:
Q: How to detect browser close and pop out alert message I tried the following code to get an alert upon closing a browser window:
 <script language="JavaScript" type="text/javascript">
    window.onbeforeunload = confirmExit;
    function confirmExit()
{
    return "Please log out before exit";
}
   </script>

It works, but if the page contains few button, clicking on that any button raises the same alert. I need to show the alert only when I close the browser window and not upon clicking button.

A: Use this
$(function () {
  $("a").click(function {
    window.onbeforeunload = null;
  });
});


text:
Q: CGrigview select data from all pages I have a CGridview containing huge amount of data (> 100000 row).
This gridview containing CCheckbox for each row and I need to choose some rows to make process to them.

The problem is that I can only apply the checking for a the rows displayed in the current page.
What I want is when applying some filter on the gridview and press the select All button (At the top right), the system select the rows from entire table (not from the current page only).
Is that possible??

A: I solve it by checking the value of (select All) parameter in the server side.
if ($_POST['grid_c7_all'] == "1") { ...


text:
Q: Window function issue - max over partition I try to rewrite such SQL statements (with many subqueries) to more efficient form using outer join and max/count/... over partition. Old statements:
select a.ID,
     (select max(b.valA) from something b where a.ID = b.ID_T and b.status != 0),
     (select max(b.valB) from something b where a.ID = b.ID_T and b.status != 0),
     (select max(b.valC) from something b where a.ID = b.ID_T and b.status != 0),
     (select max(b.valD) from something b where a.ID = b.ID_T)
from tool a;

What is important here - there is different condition for max(b.valD). Firstly I didn't noticed this difference and write something like this:
select distinct a.ID,
      max(b.valA) over (partition by b.ID_T),
      max(b.valB) over (partition by b.ID_T),
      max(b.valC) over (partition by b.ID_T),
      max(b.valD) over (partition by b.ID_T),
from tool a,
     (select * from something
     where status != 0) b
where a.ID = b.ID_T(+);

Could I use somewhere in max over partition this condition of b.status != 0 ? Or should I better add 3rd table to join like this:
select distinct a.ID,
      max(b.valA) over (partition by b.ID_T),
      max(b.valB) over (partition by b.ID_T),
      max(b.valC) over (partition by b.ID_T),
      max(c.valD) over (partition by c.ID_T),
from tool a,
     (select * from something
      where status != 0) b,
     something c
where a.ID = b.ID_T(+)
     and a.ID = c.ID_T(+);

The issue is with selecting and joining millions of rows, my example is just simplification of my query. Could anyone help me to achieve more efficient sql?

A: You could try to do this using CASE:
select a.ID,
       max(CASE WHEN b.status=0 THEN b.valA END),
       max(CASE WHEN b.status=0 THEN b.valB END),
       max(CASE WHEN b.status=0 THEN b.valC END),
       max(b.valD)
  from tool a
  left join something b ON( b.ID_T = a.ID )
  group by a.ID;

Note that I replaced your implicit join by the "new" join-syntax for better readability.

A: One more way is to use JOIN and group by subquery:
select a.ID,
     b.MAX_A,
     b.MAX_B,
     b.MAX_C,
     b2.MAX_D
from tool a
LEFT JOIN
 (
    SELECT ID_T,max(valA) MAX_A, max(valB) MAX_B, max(valC) MAX_C
    FROM something
    WHERE status != 0
    GROUP BY ID_T
  ) b
  ON a.ID=b.ID_T
LEFT JOIN
 (
    SELECT ID_T, max(valD) MAX_D
    FROM something
    GROUP BY ID_T
  ) b2
  ON a.ID=b2.ID_T


text:
Q: Should I expose a server on OpenWrt to WAN or only to LAN with port-forwarding from WAN? If I installed a server on a computer behind a router and wanted to allow connection to it from the Internet, I would have to do two things:  One, open the firewall on the server machine to allow the incoming connection; and two, set up a port forwarding rule on the router so the connection may go from WAN to LAN (specifically to the server machine).
But what should I do if the server machine in question is the router itself running on OpenWrt?
I can think of two options.
Option A.  Treat the router like any other computer in LAN.  After installing the server on the router, open the firewall to allow incoming connection from within LAN to the server.  (I believe this is done in LuCI > Network > Firewall > Traffic Rules.)  Then, set up a port forwarding rule from WAN to LAN (specifically the server). (LuCI > Network > Firewall > Port Forwards.)
Option B. Use LuCI's Traffic Rules tab to open the firewall for connection from WAN directly to the server.
The questions are:

*

*Am I right to think these are the two options I may consider?

*What would be the pros and cons on either side?

*What is the standard practice?
The server in question may be a VPN server (e.g. Wireguard) or OpenSSH, which I may install in place of Dropbear.  But the same question would arise if you  installed an A/V stream server on OpenWrt (assuming that's possible).  In other words, I want this question to remain a generic one on the two options above rather than be limited to any particular software (Wireguard etc.).
I am new to both OpenWrt and Linux. I didn't know OpenWrt existed until just a few days ago.  It is possible that option A is bonkers (something no one ever does) and that my brain only thought it up because it never saw anything like OpenWrt before and can only think in "regular router" terms.
Actually, that makes me think Option A may have this advantage going for it.  I have actually done port forwarding before, but Linux firewall is new to me. So I might mass up on Traffic Rules, and it would be better if the mess-up happens only in LAN.
Please advise. Thanks.
ADDENDUM
These are LuCI screenshots illustrating Option A (left) and B (right).  The left panel assumes that port 12000 has been opened to LAN (either by default policy or specific traffic rule).   192.168.1.1. is the router's LAN IP address.

A: (While not apparent on some browsers, each file path is a link)
For SSH, standard practice is to specify a DNAT rule [port forward] to the internal network it resides within; whereas for the VPN server, you'd create a rule to allow WAN access to its server port:

*

*Wireguard Wiki

*SSH:

*

*/etc/config/firewall:
#

    ##::[[---  OpenWrt WAN Firewall Config  ---]]::##

#===========================================================
              ##----- NAT Redirects -----##
#===========================================================

# SSH #
#-----------------------------------------------------------
config redirect
    option  target          'DNAT'
    option  proto           'tcp'
    option  src             'wan'
    option  src_dport       60501
    option  dest            'lan'
    option  dest_ip         192.168.1.1
    option  dest_port       22
    option  name            'Allow Redirect WAN → LAN (SSH)'

config redirect
    option  target          'DNAT'
    option  proto           'tcp'
    option  src             'vpn'
    option  src_dport       60502
    option  dest            'lan'
    option  dest_ip         192.168.1.1
    option  dest_port       22
    option  name            'Allow Redirect Wireguard → LAN (SSH)'

#===========================================================
                  ##----- VPN Zones -----##
#===========================================================

# Wireguard #
#-----------------------------------------------------------
config zone
    option  name            'vpn'
    option  network         'vpn'
    option  input           'ACCEPT'
    option  forward         'ACCEPT'
    option  output          'ACCEPT'
    option  log             1

# Rules:
#-----------------------------------------------------------
config rule
    option  target          'ACCEPT'
    option  proto           'tcp udp'
    option  src             'wan'
    option  dest            '*'
    option  dest_port       51820
    option  name            'Allow Forwarded Wireguard → Router'

config rule
    option  target          'ACCEPT'
    option  proto           'tcp'
    option  src             'vpn'
    option  dest            '*'
    option  dest_port       60502
    option  name            'Allow Wireguard → Router (SSH)'

*/etc/config/dropbear:
#

      ##::[[---  OpenWrt DropBear Config  ---]]::##

#===========================================================
                 ##----- Default -----##
#===========================================================

# Server #
#-----------------------------------------------------------
config dropbear
    option  enable            1
    option  Interface         'lan'
    option  PasswordAuth      'off'
    option  RootPasswordAuth  'off'
    option  IdleTimeout       0
    option  Port              22
    option  RootLogin         1
    option  SSHKeepAlive      300
    option  verbose           1

*/etc/ssh/sshd_config: (Customized)
#

    ##::[[---  OpenWrt OpenSSH SSHd Config  ---]]::##

#===========================================================
              ##----- Global Options -----##
#===========================================================

  # Please verify, as all algorithms may not supported:

    # Ciphers:                  # HostKey & KeyTypes
      ## ssh -Q cipher            ## ssh -Q key

    # Kex [Key Exchange]        # MAC [Message Authentication Code]
      ## ssh -Q kex               ## ssh -Q mac

# Connection #
#-----------------------------------------------------------
AddressFamily                     = inet
ListenAddress                     = 192.168.1.1:22

# Encryption #
#-----------------------------------------------------------
AuthorizedKeysFile                = /root/.ssh/authorized_keys

HostKey                           = /etc/ssh/ssh_host_ed25519_key
HostKey                           = /etc/ssh/ssh_host_rsa_key

# Authentication #
#-----------------------------------------------------------
AllowUsers                        = root
AllowGroups                       = root

ChallengeResponseAuthentication   = no
PasswordAuthentication            = no
PermitEmptyPasswords              = no

StrictModes                       = yes
PubkeyAuthentication              = yes

LoginGraceTime                    = 30

MaxAuthTries                      = 3
MaxSessions                       = 10
MaxStartups                       = 3:30:10

PermitRootLogin                   = prohibit-password

# Reliability #
#-----------------------------------------------------------
ClientAliveCountMax               = 3
ClientAliveInterval               = 600

TCPKeepAlive                      = yes

UseDNS                            = yes

# Security #
#-----------------------------------------------------------
AllowAgentForwarding              = yes
AllowTcpForwarding                = yes

GatewayPorts                      = clientspecified
PermitTunnel                      = yes

Subsystem   sftp                  = /usr/lib/sftp-server

RekeyLimit                        = 500M 60m

# Logging #
#-----------------------------------------------------------
SyslogFacility                    = AUTH
LogLevel                          = VERBOSE

PidFile                           = /tmp/run/sshd.pid

# Ciphers and ReKeying #
#-----------------------------------------------------------
FingerprintHash                   = sha256

Ciphers                           = aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc,rijndael-cbc@lysator.liu.se

HostKeyAlgorithms                 = ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521

HostbasedAcceptedKeyTypes         = ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521

KexAlgorithms                     = curve25519-sha256@libssh.org,curve25519-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256

MACs                              = hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-512

PubkeyAcceptedKeyTypes            = ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521

*LuCI:

*

*https://<router IP> → Network (left-hand menu) → Firewall

*Traffic Rules

*

*ADD:  Name: Allow Forwarded Wireguard → Router  Protocol: TCP UDP  Source Zone: wan  Destination Zone: Any zone (forward)  Destination Port: 51820  Action: accept  SAVE

*ADD:  Name: Allow Wireguard → Router (SSH)  Protocol: TCP  Source Zone: vpn  Destination Zone: Any zone (forward)  Destination Port: 60502  Action: accept  SAVE

*Port Forwards

*

*ADD:  Name: Allow Redirect WAN → LAN (SSH)  Protocol: TCP  Source Zone: wan  External Port: 60501  Destination Zone: lan  Internal IP address: 192.168.1.1  Internal Port: 22  Action: accept  SAVE

*ADD:  Name: Allow Redirect VPN → LAN (SSH)  Protocol: TCP  Source Zone: vpn  External Port: 60502  Destination Zone: lan  Internal IP address: 192.168.1.1  Internal Port: 22  Action: accept  SAVE

*SAVE & APPLY


text:
Q: How to change hue of a texture with GLSL? Is there a way to efficiently change hue of a 2D OpenGL texture using GLSL (fragment shader)?
Do someone have some code for it?
UPDATE: This is the code resulting from user1118321 suggestion:
uniform sampler2DRect texture;
const mat3 rgb2yiq = mat3(0.299, 0.587, 0.114, 0.595716, -0.274453, -0.321263, 0.211456, -0.522591, 0.311135);
const mat3 yiq2rgb = mat3(1.0, 0.9563, 0.6210, 1.0, -0.2721, -0.6474, 1.0, -1.1070, 1.7046);
uniform float hue;

void main() {

vec3 yColor = rgb2yiq * texture2DRect(texture, gl_TexCoord[0].st).rgb;

float originalHue = atan(yColor.b, yColor.g);
float finalHue = originalHue + hue;

float chroma = sqrt(yColor.b*yColor.b+yColor.g*yColor.g);

vec3 yFinalColor = vec3(yColor.r, chroma * cos(finalHue), chroma * sin(finalHue));
gl_FragColor    = vec4(yiq2rgb*yFinalColor, 1.0);
}

And this is the result compared with a reference:

I have tried to switch I with Q inside atan but the result is wrong even around 0°
Have you got any hint?
If needed for comparison, this is the original unmodified image:

A: Andrea3000, in comparing YIQ examples on the net, i came across your posting, but i think there is an issue with the 'updated' version of your code.... i'm sure your 'mat3' definitions are flip/flopped on the column/row ordering... (maybe that's why you were still having troubles)...
FYI: OpenGL matrix ordering: "For more values, matrices are filled in in column-major order. That is, the first X values are the first column, the second X values are the next column, and so forth." See: http://www.opengl.org/wiki/GLSL_Types
mat2(
float, float,   //first column
float, float);  //second column

A: While what @awoodland says is correct, that method may cause issues with changes in luminance, I believe.
HSV and HLS color systems are problematic for a number of reasons. I talked with a color scientist about this recently, and his recommendation was to convert to YIQ or YCbCr space and adjust the the chroma channels (I&Q, or Cb&Cr) accordingly. (You can learn how to do that here and here.)
Once in one of those spaces, you can get the hue from the angle formed by the chroma channels, by doing hue = atan(cr/cb) (watching for cb == 0). This gives you a value in radians. Simply rotate it by adding the hue rotation amount. Once you've done that, you can calculate the magnitude of the chroma with chroma = sqrt(cr*cr+cb*cb). To get back to RGB, calculate the new Cb and Cr (or I & Q) using Cr = chroma * sin (hue), Cb = chroma * cos (hue). Then convert back to RGB as described on the above web pages.
EDIT: Here's a solution that I've tested and seems to give me the same results as your reference. You can probably collapse some of the dot products into matrix multiplies:
uniform sampler2DRect inputTexture;
uniform float   hueAdjust;
void main ()
{
    const vec4  kRGBToYPrime = vec4 (0.299, 0.587, 0.114, 0.0);
    const vec4  kRGBToI     = vec4 (0.596, -0.275, -0.321, 0.0);
    const vec4  kRGBToQ     = vec4 (0.212, -0.523, 0.311, 0.0);

    const vec4  kYIQToR   = vec4 (1.0, 0.956, 0.621, 0.0);
    const vec4  kYIQToG   = vec4 (1.0, -0.272, -0.647, 0.0);
    const vec4  kYIQToB   = vec4 (1.0, -1.107, 1.704, 0.0);

    // Sample the input pixel
    vec4    color   = texture2DRect (inputTexture, gl_TexCoord [ 0 ].xy);

    // Convert to YIQ
    float   YPrime  = dot (color, kRGBToYPrime);
    float   I      = dot (color, kRGBToI);
    float   Q      = dot (color, kRGBToQ);

    // Calculate the hue and chroma
    float   hue     = atan (Q, I);
    float   chroma  = sqrt (I * I + Q * Q);

    // Make the user's adjustments
    hue += hueAdjust;

    // Convert back to YIQ
    Q = chroma * sin (hue);
    I = chroma * cos (hue);

    // Convert back to RGB
    vec4    yIQ   = vec4 (YPrime, I, Q, 0.0);
    color.r = dot (yIQ, kYIQToR);
    color.g = dot (yIQ, kYIQToG);
    color.b = dot (yIQ, kYIQToB);

    // Save the result
    gl_FragColor    = color;
}

A: MSL(Metal Shader Language) version for changing the hue of a texture. I would recommend the MetalPetal pod. This pod will make life a lot easier.
#include <metal_stdlib>
using namespace metal;

typedef struct {
    float4 position [[ position ]];
    float2 textureCoordinate;
} VertexOut;

fragment float4 hue_adjust_filter(
                            VertexOut vertexIn [[stage_in]],
                            texture2d<float, access::sample> inTexture [[texture(0)]],
                            sampler inSampler [[sampler(0)]],
                            constant float &hueAdjust [[ buffer(0) ]])
{
    const float4  kRGBToYPrime = float4 (0.299, 0.587, 0.114, 0.0);
    const float4  kRGBToI     =  float4 (0.596, -0.275, -0.321, 0.0);
    const float4  kRGBToQ     =  float4 (0.212, -0.523, 0.311, 0.0);

    const float4  kYIQToR   =    float4 (1.0, 0.956, 0.621, 0.0);
    const float4  kYIQToG   =    float4 (1.0, -0.272, -0.647, 0.0);
    const float4  kYIQToB   =    float4 (1.0, -1.107, 1.704, 0.0);

    // Sample the input pixel
    float2 uv = vertexIn.textureCoordinate;
    float4 color = inTexture.sample(inSampler, uv);

    // Convert to YIQ
    float   YPrime  = dot (color, kRGBToYPrime);
    float   I      = dot (color, kRGBToI);
    float   Q      = dot (color, kRGBToQ);

    // Calculate the hue and chroma
    float   hue     = atan2 (Q, I);
    float   chroma  = sqrt (I * I + Q * Q);

    // Make the user's adjustments
    hue += hueAdjust;

    // Convert back to YIQ
    Q = chroma * sin (hue);
    I = chroma * cos (hue);

    // Convert back to RGB
    float4    yIQ   = float4 (YPrime, I, Q, 0.0);
    color.r = dot (yIQ, kYIQToR);
    color.g = dot (yIQ, kYIQToG);
    color.b = dot (yIQ, kYIQToB);

    return color;
}


text:
Q: Google Sheets - Comparing a column against a table to retrieve a tag If I have a column of values A{2,11,101,1001} and I have a table with two columns C/D{Tag1/1,Tag2/10,Tag3/100....}
I want to have an array formula that compares the values from A and sees if where they fit in the range... if less than 100 but more than 10 column B should show Tag2 etc...

A: =IFERROR(ARRAYFORMULA(VLOOKUP(A1:A,
 {QUERY(IFERROR(ARRAYFORMULA(VALUE(
  REGEXEXTRACT(D1:D&"-"&C1:C, "(\d+)"))), ), "SELECT Col1"),
  REGEXEXTRACT(QUERY(D1:D&"-"&C1:C, "SELECT Col1"),"-(.+)")}, 2)), )


text:
Q: SQL Server detected a logical consistency-based I/O error : logical error Msg 824, Level 24, State 2, Line 1
SQL Server detected a logical consistency-based I/O error:
 incorrect checksum (expected: 0xe9f5ce21;
actual: 0xe9f5cc21).
 It occurred during a read of page (1:97249) in database
 ID 7 at offset 0x0000002f7c2000 in file
'D:\SKYTECHNEW\Database\IMSDATA001SCN.mdf'.
Additional messages in the SQL Server error log or
system event log may provide more detail.
 This is a severe error condition that threatens
database integrity and must be corrected immediately.
Complete a full database consistency check (DBCC CHECKDB).
 This error can be caused by many factors;
 for more information, see SQL Server Books Online.

A: This message means that your database has a corruption.
As it says you should perform a full database consistency check (DBCC CHECKDB), because there can be more than one corrupted pages.
Update your question with the results of DBCC CHECKDB, your further actions depends on type of pages that are corrupted.


text:
Q: How to write a api test case for uploading a mp4 file and getting in return speech ( audio to speech).? Please do help me to write test case for particular api test case.
Am not getting what to write! Because I've never gone through such type of scenarios.


text:
Q: ruby super keyword From what I understand, super keyword invokes a method with the same name as the current method in the superclass of the current class. Below in the autoload method, there is a call to super. I would like to know in which superclass I would find a method with the same name or what does the call to super do here
module ActiveSupport
  module Autoload
    ...
    def autoload(const_name, path = @@at_path)
      full = [self.name, @@under_path, const_name.to_s, path].compact.join("::")
      location = path || Inflector.underscore(full)

      if @@eager_autoload
        @@autoloads[const_name] = location
      end
      super const_name, location
    end
   ....
  end
end

module ActiveRecord
  extend ActiveSupport::Autoload
  ...
  autoload :TestCase
  autoload :TestFixtures, 'active_record/fixtures'
end

This code is from the rails master branch. Thanks much.

A: The super keyword checks all the way up the ancestry tree to find the inherited method.
Do a search on the entire rails master branch. You will only find one def autoload which is exactly the one you're looking at in active_support/lib/active_support/dependencies/autoload.rb.
The method being overridden is native Ruby. It is Module#autoload

A: The example provided in the Ruby Docs for the super keyword:
module Vehicular
  def move_forward(n)
    @position += n
  end
end

class Vehicle
  include Vehicular  # Adds Vehicular to the lookup path
end

class Car < Vehicle
  def move_forward(n)
    puts "Vrooom!"
    super            # Calls Vehicular#move_forward
  end
end

Inspecting ancestors
puts Car.ancestors.inspect

# Output
# [Car, Vehicle, Vehicular, Object, Kernel, BasicObject]

Note the inclusion of the Vehicular Module object!

A: I added this method to find the owner of a method to my .irbrc, does anyone see a better way to do this, especially in handling singleton methods where the superclass of the singleton class is the singleton class of the superclass?
  class Object
    def find_method(method_string)
        if klasses = self.class.ancestors.select { |a| a if a.methods.include? method_string }
          puts "class method in #{klasses.join(',')}" unless klasses.empty?
        end
        if klasses = self.class.ancestors.select { |a| a if a.instance_methods.include? method_string }
          puts "instance method in #{klasses.join(',')}" unless klasses.empty?
        end
      rescue
        raise "owning class not found"
    end
  end

A: Check objRef.class.ancestors or ClassName.ancestors to know the inheritance chain. If the super class does not contain the method, then all modules included by the super class are checked (last included checked first). If no match, then it moves up one level to the grandparent class and so on.
You can use the list of ancestors and then call AncestorClass.methods.select{|m| m.include?("auto_load")} to zone in on the method that's being called.
(Note: the above code is Ruby 1.8. In 1.9 methods returns symbols instead of strings. so you'd have to do a m.to_s.include?(...)

A: Use Pry
Insert a binding.pry call right before you use super, and then invoke show-source -s (-s means superclass) to show the superclass method and find out where it's defined:
class A
  def hello
    puts "hi"
  end
end

class B < A
  def hello
    binding.pry
    super
  end
end

b = B.new
b.hello

From: (pry) @ line 7 B#hello:

     7: def hello
 =>  8:   binding.pry
     9:   super
    10: end

[1] (pry) #<B>: 0> show-source -s

From: (pry) @ line 2:
Number of lines: 3
Owner: A   # <--see owner here (i.e superclass)
Visibility: public

def hello
  puts "hi"
end
[2] (pry) #<B>: 0>

A: The relevant superclass method is probably Module#autoload.


text:
Q: Python: Is there a python module for ssh that supports lots of tunnels? I am writing a program that creates reverse tunnels with ssh.
I am using Popen currently, but I am receiving an error because I have too many arguments.
So my question is:
Is there any python module that supports a lot of tunnels? (Preferably 1000+)

A: Not so much a module as a library, Twisted.Conch might be a better approach... but be warned that of all the modules in Twisted, conch can be one of the most intimidating ( atleast IMHO ).


text:
Q: How to reconcile Jech's different definitions of cardinal numbers? Thomas Jech begins the chapter 3 of his Set Theory (p. 27), titled Cardinal Numbers, as follows (in all excerpts below, the emphasis in bold letters is mine):

Two sets $X$, $Y$ have the same cardinality (cardinal number, cardinal), $$\tag{3.1} |X| = |Y|,$$ if there exists a one-to-one mapping of $X$ onto $Y$.

This looks to me like a complete definition of cardinal numbers.  (I will call it Definition 1.)  But immediately after the paragraph above, Jech writes:

The relation (3.1) is an equivalence relation.  We assume that we can assign to each set $X$ its cardinal number $|X|$ so that two sets are assigned the same cardinal number just in case they satisfy condition (3.1).  Cardinal numbers can be defined either using the Axiom of Regularity (via equivalence classes of (3.1)), or using the Axiom of Choice.  In this chapter we define cardinal numbers of well-orderable sets; as it follows from the Axiom of Choice that every set can be well-ordered, this defines cardinals in ZFC.

I don't know what to make of the sentence in bold.  Does it mean that the real definition of cardinals is still coming, and therefore that Definition 1 does not count somehow?  Or does it mean that Definition 1 is what the statement "In this chapter we define cardinal numbers of well-orderable sets" is referring to?  If the latter is the case, which of the two alternative approaches (via Axiom of Regularity or via Axiom of Choice) is being used in Definition 1?
The confusion does not end there.  After Jech has already been using terms like "cardinal numbers" and "cardinals" quite extensively, including (on p. 28) a complete definition of the "arithmetic operations on cardinals", on p. 29 he writes

An ordinal $\alpha$ is called a cardinal number (a cardinal) if $|\alpha| \neq |\beta|$ for all $\beta < \alpha$.

I will call this definition of cardinal numbers Definition 2.
I have the same questions about Definition 2 as I had about Definition 1.  I.e. is Definition 2 what the sentence "In this chapter we define cardinal numbers of well-orderable sets" is referring to?  If yes, which of the two alternative approaches (via Axiom of Regularity or via Axiom of Choice) is being used in Definition 2?
Finally, how can these two different definitions of cardinal numbers be reconciled?  How is one supposed to know which one is being referred to whenever Jech uses terms like "cardinal numbers" and "cardinals" in the rest of the book?  Is this as appalling as it looks, as a piece of mathematical exposition, or am I missing something?

A: I would like to take a different point of view on your post, and suggest to you a way of reading these mathematical passages so as to avoid the confusion into which you stumbled.
Just from the way that Jech writes those passages, one is invited to think as follows.
The first sentence defines a property of a pair of sets, namely the property that those two sets "have the same cardinality".
Your own internal mathematical processor could then say to itself "That sounds like an equivalence relation... Is it? .... [thinks a bit] ... Yup, reflexive, symmetric, transitive. GREAT! Now I know what it means for two sets to have the same cardinality."
Jech then invites you, in the next parenthetical comment, to substitute the word "cardinality" with "cardinal number".
You wrote in your post

This looks to me like a complete definition of cardinal numbers.

But your own internal mathematical processor could instead say to itself: "So now I know what it means for two sets to have the same cardinal number... but that's not telling me yet what an actual cardinal number is... Just because I know that two sets have the same BLAH, it doesn't quite follow that I know what a BLAH is..."
And then, in the next paragraph, Jech is inviting you to look forward to the next step, i.e. the actual definition of a cardinal number.
You are in good company, it took the mathematical community a few decades, from Cantor to Von Neumann, to take this step.

A: In a substantial and sober-minded sense $(3.1)$ does say what a cardinal number is. But for various reasons one seeks ways of encoding everything as some sort of set, and therefore one identifies a cardinal number with a certain ordinal, and ordinals with certain sets called von Neumann ordinals, of which an example is $\{\varnothing,\{\varnothing\}\}.$
If you're familiar with the idea of identifying real numbers with equivalence classes of Cauchy sequences or with Dedekind cuts, this is a similar sort of thing.

A: Here's how I think about it:

*

*(Def) Two sets $X,$ $Y$ are equinumerous if there is a bijection between them.

*(Def) An ordinal $\alpha$ is a cardinal if no lesser ordinal is equinumerous with it.

*(Thm) If $X$ is a well-orderable set, there is a unique cardinal $\kappa$ such that $X$ is equinumerous with $\kappa.$

*(Def) The unique $\kappa$ from the previous theorem is called the cardinality of $X,$ denoted $\kappa = |X|.$

*(Thm) For any two well-orderable sets $X$ and $Y,$ $X$ is equinumerous to $Y$ if and only if $|X|=|Y|.$
When we assume the axiom of choice, every set is well-orderable so we can happily drop the restrictions to well-orderable sets in the above.

As Jech alludes to, in the absence of choice, one can also define cardinals for non-well-ordered sets using regularity. The way this works is that equinumerousness is an equivalence relation and so one might want to simply define the cardinality of a set to be its equivalence class under this relation. But the problem is that these equivalence classes are proper classes, not sets. The way that regularity allows you to get around this is that it implies every set has an ordinal rank, and classes of bounded rank are sets. So you can define quasi-equivalence classes by letting $[x]$ be the set of all sets that are equinumerous to $x$ and of minimal rank.

*

*(Def) A set is a cardinality if it is equal to $[x]$ for some set $x.$

*(Def) The cardinality of a set $x$ is $[x].$

*(Thm) Two sets are equinumerous if and only if they have the same cardinality.

(Note that it is certainly not necessarily the case that $x$ and $[x]$ are equinumerous, unlike in the situation for well-ordered cardinalities.)

The notations and terminology choices I made here are not universal by any means, and this is in general pretty variable between different authors.
The definitions for well-ordered cardinals are of greater importance, not just because AC is typically assumed, but also since even in AC's absence it is useful to define cardinality for well-ordered sets in this way. (The term "aleph" or "well-ordered cardinal" is often used in place of "cardinal" in these contexts.) It is convenient to both have a canonical set of a certain size, and one that has a natural well-ordering that you can do induction on.
The definition from regularity is mostly just of technical importance. The general trick of using foundation to represent equivalence classes of proper class-sized equivalence relations is called Scott's trick and it is used in other contexts as well, such as defining ultrapowers of the set theoretical universe.

A: What we'd ideally like to do is to put an equivalence relation $\sim$ on the class of all sets, so that $S \sim T$ iff there exists a bijection $S \to T$, and then define $|S|$ to be the image of $S$ under $\sim$. Unfortunately, the class of all sets is not actually a set, and so this doesn't work. Similarly, it would be nice to define a function from sets to some sort of object representing cardinality, and define $|S|$ to be this object; again, we run into the problem of defining exactly what a function with a domain that isn't actually a set. The workaround is just to write--- purely formally--- $|S| = |T|$ iff there's a bijection $S\to T$, which suggests the idea of the earlier construction but avoids foundational issues. In particular, write $|S| = n$ if $|S| = |\{1, \dots, n\}|$ (with the latter set defined elsewhere, and $n = 0$ corresponding to $\varnothing$). Defining $|S| \leq |T|$ or $|S| \geq |T|$, etc., is analogous, though it takes a bit of work to show that $|S| \leq |T|$ and $|S| \geq |T|$ implies $|S| = |T|$. This result would imply that $<$ is a total order on sets modulo $\sim$, but unfortunately there's the same foundational issue with what exactly "sets modulo $\sim$" means.
So, on to the latter construction. In ZFC, every set has a bijection onto a unique cardinal (e.g., via the well-ordering theorem, which is equivalent to the axiom of choice). That's effectively giving us for each set $S$ a well-defined representative of the equivalence class of $S$ modulo $\sim$, which puts the construction above on more solid ground, taking $|S|$ to be this unique cardinal.

A: 3.1 defines an equivalence relation. There is then a correspondence between the equivalence classes of that equivalence relation and cardinalities: each equivalence relation corresponds to a cardinality, all sets in that equivalence class have that cardinality, and any set with a different cardinality is in a different equivalence class. This is potentially cumbersome, however, if we wish to use it as a definition of "cardinality"; any time we want to investigate the cardinality of a set, we have to analyze it compared to all the equivalence classes we have so far identified. For each class, we have to determine whether any bijection exists (a possibly difficult task even for one class, and one we have to repeat for each class until we find in the affirmative) and if no class has any bijection, we need to establish a new equivalence class. This is a completely nonsystematic analysis; we end up with simply a collection of equivalence classes, with no inherent structure. Think of it like species: if you define species as a set of organisms that can interbreed with each other, but not with other species, we end up with an equivalence class (interbreeding isn't actually an equivalence relation, but let's ignore that for the sake of the analogy). This technically defines the concept of "species", but actually putting that into practice requires constantly checking whether organisms can interbreed, and any taxonomy relating the different species has to come from other sources. 3.1 allows us to assign sets to equivalence classes, but we need more for the those equivalence classes to really deserve the label "numbers"; it doesn't give any structure to the collection of classes, such as having any concept of "bigger" (we can easily define $\geq$ in terms of surjections, but that's not inherent to the 3.1).
The sentence in bold promises some further definition. It's not clear exactly for that sentence what that definition is going to be, but it suggests that it's going to give some algorithm that takes a well-ordered set as input, and gives some output that characterizes a cardinality equivalence class. Continuing my species analogy, suppose there were some program that you could feed in an organism's DNA that always gave the same result for two organisms of the same species, and always gave different answers if the organisms were of different species. Having that program would be much more useful than just having the definition interbreed = same species.
What you've labelled "Definition 2" is arguably imprecise. At least from some perspectives, ordinals and cardinals are different categories: each cardinal corresponds to an ordinal, but no cardinal is an ordinal. In set theory, one representation of ordinal numbers is a set, and often that representation is treated as being the ordinal. Cardinality, on the other hand, is an equivalence relation, so cardinals are labels we put on classes of sets. Those classes of ordinals are themselves sets, but they're not sets that follow the rules for "ordinal" sets, as they do not contain every set smaller than them.  So arguably, the statement should be "An ordinal α corresponds to a cardinal number (a cardinal) if |α|≠|β| for all β<α." Basically, we take the smallest ordinal of each equivalence class as the representative member of that class, and use that ordinal as the label of that class. If an ordinal isn't the smallest member of its class, it doesn't correspond to a cardinal number. So this is something that qualifies as "some algorithm that takes a well-ordered set as input, and gives some output that characterizes a cardinality equivalence class" that I mentioned earlier: given a class, take its smallest member, and characterize the class in terms of that member. I think that the reason they specified that they were talking about well-orderable sets in the earlier sentence; if each class has a well ordering, then it has a smallest member given that order. So this is using the Axiom of Choice.

A: Jech claims that there exists some definable function that maps each set $S$ to something called its cardinality denoted by $|S|$. Jech at that point has not shown that such a definable function exists. That is why he said "we assume that we can assign ...".
Note that the answers claiming that (3.1) defines cardinality are misleading, because there is not even a set of all sets with cardinality $1$, so these are fundamentally different from equivalence classes in ordinary mathematics. (Daniel Schepler did mention this in a comment, but it wasn't made clear in other existing answers.)
It turns out that in ZFC, we can in fact define for each set $S$ some ordinal $|S|$ that satisfies the desired property (3.1), and we call that ordinal a cardinal. Some authors do not like the idea of cardinals being ordinals, but that's just a matter of abstraction and typing, not substance. (For an analogy, when we say "$x∈ℝ$" we do not mean $x$ is some set of Cauchy sequences of rationals.) See here for further elaboration.

In this chapter we define cardinal numbers of well-orderable sets; as it follows from the Axiom of Choice that every set can be well-ordered, this defines cardinals in ZFC.

This is simply a preamble to the fact that, for every set $S$, there is some well-ordering of $S$ (relying on AC), and so there exists some minimum ordinal $k$ that is in bijection with $S$, and hence we can define $|S|$ to be that $k$.


text:
Q: Multiple jqModal Windows - onLoad and onClick on the same page. How? I am using jquery jqModal script for popup windows.
I have one html page with two jqModal windows.  I would like one to load when the page opens, and another one opens separately via onClick.
My script is not working.  The onLoad works (#success), but the onClick (#dialog) opens both up at the same time.
Here is my current script:

A: here is the updated code u can try
$(document).ready(function() {
    $('#dialog').jqm( {trigger:'#dialog'} );
    // $('#dialog').jqmAddTrigger('#dialog');
    $('#success').jqm().jqmShow({});
});

Let me know if its working for you
Here you need to add trigger when the modal window will open up

A: The code you presented works without problems for me. Here is the complete snippet I used:

test

test

<input type="button" value="Show Modal" onclick="showModal()"/>


text:
Q: Unsupervised answering for a predefined set of questions I am working on a project to read up a text segment and find answers to a specific set of questions, in order to do some information extraction.
I have a set of text corpus (each of about 3000 words), and I have about 10 questions to get the important facts out of the text. However, I do not have a set of answers to these question, so I cannot take a supervised approach to train a model.
What kind of an unsupervised approach can i use to get the answers ( this can be extractive text segments) from the text corpus.
I have thought about using word embeddings to find words in the text that match, or are close to the words in the question, but I'm not too sure on how to go about this.
Any ideas would be greatly appreciated!
TIA

A: One approach could be segmenting each text into paragraphs (if you have some formatting clues like double end-of-line) or sentences. Then for each chunk (paragraph / sentence), you can compare if it is similar with your questions. For similarity, you need to vectorize both question and chunk and here word embeddings can help although you need to come up with vectors for these chunks / questions, so more like doc2vec approach or manually averaging word vectors. In the latter case, I would suggest weighing with tf-idf of words.


text:
Q: What is this kind of number and how to conver it? 1.1480996566692E+14 I'm using CURL and from some URL I'm getting Account ID like "1.1480996566692E+14". I know this must be an integer. But I don't know how to convert it into human readable formate.
Can someone help?
Thanks in advance.

A: It is a double value, just use floatval to transform string to double value.`
$number="1.1480996566692E+14";
$doublevalue=floatval($number);
echo sprintf("%.0f",$doublevalue);

A: that would be 1.1480996566692E+14 = 1.1480996566692 * (10 ^14) or (int) 1.1480996566692E+14


text:
Q: "403 Forbidden" response from Google Android In App Purchases API with service account Cannot make Android In App Purchases API working with service account credentials using native Google PHP client.
I took sample script from Google PHP client package (google\examples\service-account.php),
provided all required credentials in it and it worked out perfectly for "Books" service, but not for "Android in App Purchases".
The code below works fine:
$client_id = '{SERVICE_CLIENT_ID}';
$service_account_name = '{SERVICE_ACCOUNT_NAME}';
$key_file_location = '{KEY_PATH}';

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");

$service = new Google_Service_Books($client);
$scopes = array('https://www.googleapis.com/auth/books');
$key = file_get_contents($key_file_location);
$cred = new Google_Auth_AssertionCredentials($service_account_name, $scopes, $key);
$client->setAssertionCredentials($cred);

if($client->getAuth()->isAccessTokenExpired()) {
    $client->getAuth()->refreshTokenWithAssertion($cred);
}

echo '
'; $results = $service->volumes->listVolumes('Henry David Thoreau', array('filter' => 'free-ebooks')); print_r($results); echo '
';

the code below ends up with "403 Forbidden" as a response from Google:
$client_id = '{SERVICE_CLIENT_ID}';
$service_account_name = '{SERVICE_ACCOUNT_NAME}';
$key_file_location = '{KEY_PATH}';

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");

$service = new Google_Service_AndroidPublisher($client);
$scopes = array('https://www.googleapis.com/auth/androidpublisher');
$key = file_get_contents($key_file_location);
$cred = new Google_Auth_AssertionCredentials($service_account_name, $scopes, $key);
$client->setAssertionCredentials($cred);

if($client->getAuth()->isAccessTokenExpired()) {
    $client->getAuth()->refreshTokenWithAssertion($cred);
}

echo '
'; $results = $service->inapppurchases->get('{PACKAGE}', '{PRODUCT}', '{TOKEN}'); print_r($results); echo '
';

I also tested that with Web Account credentials (when access token is generated by special "code" given by Google after "redirect"). The result is the same - 403 Forbidden.
Could anybody give any clue why Android API does not work how it's expected?

A: Ok I found the solution!
You must to connect your API with your app. You must go to your Google Play publish page (https://play.google.com/apps/publish) and invite a user with the service account email in Settings->User account & rights->Invite new user and give it the privileges of "View financial reports".
Thanks works for me, good luck!

A: You will need to log in as "you", but that can be a one time operation - if you request offline access you will be able to get a refresh token that can be used to mint new access tokens - so you could even do this as part of an out of band process and simply deploy with your refresh token. The service account can't be used (without some kind of delegation) as it doesn't identify an individual user, which is needed here.

A: I had a similar problem as you. I finally managed to solve it by looking at links generated here: https://developers.google.com/oauthplayground/
Apparently, Android publisher scope
https://www.googleapis.com/auth/androidpublisher

needs to be added into the link requesting authorisation code (before even generating refresh token) by adding:
&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fandroidpublisher

to get this:
https://accounts.google.com/o/oauth2/auth?redirect_uri=<YOUR_REDIRECT_URI>&response_type=code&client_id=<YOUR_CLIENT_ID>&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fandroidpublisher&approval_prompt=force&access_type=offline