text:
Q: How to use the R 'with' operator in rpy2 I am doing an ordinal logistic regression, and following the guide here for the analysis: R Data Analysis Examples: Ordinal Logistic Regression
My dataframe (consult) looks like:
           n  raingarden  es_score  consult_case
garden_id
27436      7           0         3             0
27437      1           0         0             1
27439      1           1         1             1
37253      1           0         3             0
37256      3           0         0             0

I am at the part where I need to  to create graph to test the proportional odds assumption, with the command in R as follows:
(s <- with(dat, summary(es_score ~ n + raingarden + consult_case, fun=sf)))

(es_score is an ordinal ranked score with values between 0 - 4; n is an integer; raingarden and consult_case, binary values of 0 or 1)
I have the sf function:
sf <- function(y) {
     c('Y>=1' = qlogis(mean(y >= 1)),
       'Y>=2' = qlogis(mean(y >= 2)),
       'Y>=3' = qlogis(mean(y >= 3)))
}

in a utils.r file that I access as follows:
from rpy2.robjects.packages import STAP
with open('/file_path/utils.r', 'r') as f:
    string = f.read()
sf = STAP(string, "sf")

And want to do something along the lines of:
R = ro.r
R.with(work_case_control, R.summary(formula, fun=sf))

The major problem is that the R withoperator is seen as a python keyword, so that even if I access it with ro.r.with it is still recognized as a python keyword. (As a side note: I tried using R's apply method instead, but got an error that TypeError: 'SignatureTranslatedAnonymousPackage' object is not callable ... I assume this is referring to my function sf?)
I also tried using the R assignment methods in rpy2 as follows:
R('sf = function(y) { c(\'Y>=1\' = qlogis(mean(y >= 1)), \'Y>=2\' = qlogis(mean(y >= 2)), \'Y>=3\' = qlogis(mean(y >= 3)))}')

R('s <- with({0}, summary(es_score~raingarden + consult_case, fun=sf)'.format(consult))

but ran into issues where the dataframe column names were somehow causing the error: RRuntimeError: Error in (function (file = "", n = NULL, text = NULL, prompt = "?", keep.source = getOption("keep.source"),  :
  <text>:1:19: unexpected symbol
1: s <- with(      n raingarden
I could of course do this all in R, but I have a very involved ETL script in python, and would thus prefer to keep everything in python using rpy2 (I did try this using mord for scipy-learn to run my regreession, but it is pretty primitive).
Any suggestions would be most welcome right now.
EDIT
I tried various combinations @Parfait's suggestions, and qualifying the fun argument is syntactically incorrect, as per PyCharm interpreter (see image with red highlighting at end):  ... it doesn't matter what the qualifier is, either, I always get an error
that SyntaxError: keyword can't be an expression.
On the other hand, with no qualifier, there is no syntax error: , but I do get the error TypeError: 'SignatureTranslatedAnonymousPackage' object is not callable when using the function sf as obtained:
from rpy2.robjects.packages import STAP
with open('/Users/gregsilverman/development/python/rest_api/rest_api/scripts/utils.r', 'r') as f:
    string = f.read()
sf = STAP(string, "sf")
With that in mind, I created a package in R with the function sf, imported it, and tried various combos with the only one producing no error, being: print(base._with(consult_case_control, R.summary(formula, fun=gms.sf))) (gms is a reference to the package in R I made).
The output though makes no sense:
Length   Class    Mode
      3 formula    call
I am expecting a table ala the one on the UCLA site. Interesting. I am going to try recreating my analysis in R, just for the heck of it. I still would like to complete it in python though.

A: Consider bracketing the with call and be sure to qualify all arguments including fun:
ro.r['with'](work_case_control, ro.r.summary(formula, ro.r.summary.fun=sf))

Alternatively, import R's base package. And to avoid conflict with Python's named method with() translate the R name:
from rpy2.robjects.packages import importr

base = importr('base', robject_translations={'with': '_with'})

base._with(work_case_control, ro.r.summary(formula, ro.r.summary.fun=sf))

And be sure to properly create your formula. Consider using R's stats packages' as.formula to build from string. Notice too another translation is made due to naming conflict:
stats = importr('stats', robject_translations={'format_perc': '_format_perc'})

formula = stats.as_formula('es_score ~ n + raingarden + consult_case')


text:
Q: Spring STS spring boot project maven pom error Hello I am trying to learn spring boot. I have installed Spring STS
Spring Tool Suite
Version: 3.6.4.RELEASE
Build Id: 201503100339
Platform: Eclipse Luna SR1 (4.4.2)
Java 1.7.
I am trying to create a spring starter project. After I do it with the sts  I get the project generated but the Maven pom contains errors.
It always says : Project build error:
Project build error: Non-resolvable import POM: Failure to transfer org.springframework:spring-framework-bom:pom:4.1.6.RELEASE from  repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework:spring-framework-bom:pom:4.1.6.RELEASE from/to central  repo.maven.apache.org/maven2): The operation was cancelled.

Failure to transfer org.springframework:spring-framework-bom:pom:4.1.6.RELEASE from //repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework:spring-framework-bom:pom:4.1.6.RELEASE from/to central  repo.maven.apache.org/maven2): The operation was cancelled.

Project build error: Non-resolvable import POM: Failure to transfer org.springframework.security:spring-security-bom:pom:3.2.7.RELEASE from  repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.security:spring-security-bom:pom:3.2.7.RELEASE from/to central ( repo.maven.apache.org/maven2): The operation was cancelled.

The POM is automatically generated when I create a spring starter project and it always generates that error.
I understand that there is something wrong the the spring files but I don't know how to solve that problem.
Can someone here give me please an advice how to solve this.
Thanks.
Best regeards.
Khelvan

A: I was getting the same issue while importing maven project from spring initialzr.
Spring Tool Suite 4 Version: 4.1.0.RELEASE
Just add below lines in pom.xml file:-
<properties>
        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>

Happy Coding ;

A: I had the same problem, using NetBeans 8.1, Maven 3.0.1, and Spring MVC versions 4.0.1 and 4.2.5.
The first solution I found on the web was to update Maven to version 3.3.9, which did not solve my problem. However, with more search I found a useful link. There it explains for including Maven's "bill of materials" (BOM) dependency you can use:
<dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-framework-bom</artifactId>
        <version>4.2.5.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
</dependencies>

Before I was missing <type> and <scope> tags in the auto-generated code. After adding them the problem was solved.
Since I am not sure if updating Maven also helped or not, you might also try that.

A: Check the version of the bom you are using.  When I changed mine to 4.3.5.RELEASE, the error went away

redpajama_set_name: RedPajamaStackExchange


text:
Q: Self-Executing Anonymous Function with Revealing Module Pattern - in typescript On the basis of this js example, what would be the preferred way to do the same in ts the ts way - I have been experimenting with classes, modules and namespaces but still unsure and still not getting a match so would like to see your ideas;
(function($, window, document, undefined) {
  'use strict';

  var MyProject = MyProject = MyProject || {};
  var MyArea = MyProject.MyArea = MyProject.MyArea || {};

  MyArea.MyModule = (function() {
    var PublicFunction = function() { };

    var PrivateFunction = function() { };

    return {
      PublicFunction: PublicFunction
    };
  })();
})(jQuery, window, document);

The idea behind it is creating a Self-Executing Anonymous Function, using Revealing Module Pattern and placing all my modules in a single namespace defined by myself.


text:
Q: Windows Equivalent for package.json script commands I am using parcel and want to clean the .cache folder and also to run React frontend on 3000 while also running backend on 1234. these are my start scripts.
"scripts": {
    "test": "jest --watchAll",
    "start": "npm run build-client && node index.js",
    "dev": "npm run dev-client & nodemon index.js",
    "dev-peer": "cross-env GENERATE_PEER_PORT='true' nodemon index.js",
    "build-client": "npm run clean && parcel build client/src/index.html --out-dir client/dist",
    "dev-client": "npm run clean && parcel client/src/index.html --out-dir client/dist",
    "clean": "rmdir /s/q .cache client/dist"
  },

I have already put the windows commands on the 'clean' script with rmdir /s/q but get
Invalid switch - "dist".
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ajax27-blockchain@1.0.0 clean: `rmdir /s/q .cache client/dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ajax27-blockchain@1.0.0 clean script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shaun\AppData\Roaming\npm-cache\_logs\2019-07-09T11_49_08_194Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ajax27-blockchain@1.0.0 dev-client: `npm run clean && parcel client/src/index.html --out-dir client/dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ajax27-blockchain@1.0.0 dev-client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shaun\AppData\Roaming\npm-cache\_logs\2019-07-09T11_49_08_223Z-debug.log

A: You can alternatively use rimraf npm module and it works well with windows as well.


text:
Q: RXTX string encoding, only '?' printed I try to use java RXTX to read data from a rs232 serial port, but when i print the output, it only prints '?'
Here is my code;
public void read()
{
    int max = 32;
    int total = 0, read;
    byte[] buffer = new byte[max];
    try
    {
        while (total < max && (read = in.read(buffer, total, max - total)) >= 0)
        {
            total += read;
        }

        System.out.println(new String(buffer, StandardCharsets.UTF_8));
    }
    catch (IOException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

I try with a python programm and i receive the good data, so im sure that the problem came from the algorithm.
Here the output when i send hello is :
???? ? ?? ?????
Do you have an idea ?

A: Every time i ask a question on internet, i found the answer by myself a second later... I did copy the connection protocole and i forgot to change the debit. I just replaced serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
with serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
and it works well !


text:
Q: Javascript Cross Domain Authentication I have a JavaScript which can be called externally using <script type="text/javascript" src="http://mydomain.com/myscript.js"></script> the script is created dynamically using php but I need to know where the script is being called from (which domain) the only way i can think off is using $ SERVER["HTTP REFERER"] but not all browsers support this and it is insecure as it can be changed.
Dose anyone know a better way I could do it?

A: First of all anything the browser provides cannot be trusted, this includes the HTTP Referer header.
However I don't agree with this being insecure, what exactly are you doing with this information?  All the server can do is trust what the browser supplies it, so if you are attempting to restrict this javascript you are going to have to authenticate the user first (so you can plant a cookie).
So what exactly are your intentions?

A: Here is my idea.
Use a PHP file to render the JS file contents and it will only serve the javascript when session id matches. Hide your real js file too


text:
Q: How to Host many React-apps (with react-router-dom) in apache server without sub-domains? I have an Ubuntu server with Apache2 where I need to host a React-router app among other web apps, (php, NodeJs).
The problem I'm facing is that I do not know how to tell react that the whole app is in a specific path, e.g., '/var/www/html/react_app_one/'
I changed the package.json to add the "homepage" attribute to '/react_app' and also changed the <Router basename={'/react_app'}> and  it seemed to work, when I type 'https://server/react_app/' in the browser, the app "works" but if I am in a route like 'https://server/react_app/users' and reload the page the server returns the 404 screen.
I also added an .htaccess in the public folder and made sure it was in the build:
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /react_app/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule . /react_app/index.html [L]
</IfModule>

But didn't worked.
In my "/etc/apache2/conf-enabled" there is a file that configures a reverse proxy for a NodeJS app, so I added the configuration in this file; in one of many tests, my react app worked but the other apps stopped working... I do not know what else to try...
Thank you in advance for any guidance.


text:
Q: Not able to allow null values in my sql script I'm very beginner in writing sql scripts,
while trying to write the following script and execute it, i could not send null values into the procedure.
could someone help me out from the following code??
ALTER PROCEDURE SP_TALKTRACK2
    -- Add the parameters for the stored procedure here

    @city VARCHAR(100) = NULL,
    @state VARCHAR(100)= NULL,
    @zip VARCHAR(100) = NULL,
    @gender  VARCHAR(100)= NULL

AS
BEGIN
    /*
    DECLARE @CITY VARCHAR(100)
    DECLARE @STATE VARCHAR(100)
    DECLARE @ZIP VARCHAR(100)
    DECLARE @GENDER  VARCHAR(100) */
    DECLARE @TOTALMAKES INT
    DECLARE @DESCRIPTION VARCHAR(100)
    DECLARE @MAKE2 INT

    SET @CITY = @city
    SET @STATE = @state
    SET @ZIP = @zip
    SET @GENDER = @gender

    SET @DESCRIPTION =  ' MAKES ARE BEING USED IN ' + @CITY + ' ' + @STATE + ' ' + @ZIP

    SET @MAKE2 = (SELECT COUNT(MAKE)FROM [TALK TRACK RAP].[DBO].[CARSEXCEL]
    WHERE CITY = @CITY AND STATE = @STATE AND ZIP = @ZIP AND GENDER = @GENDER)

    SELECT  MAKE , ( (100 * COUNT(*)) /@MAKE2 ) AS MAKECOUNT ,
    CONVERT(VARCHAR, ( (100 * COUNT(*)) /@MAKE2 ))+ ' % ' + MAKE + @DESCRIPTION AS MAKES_PERCENTAGE INTO ##TEMP1
      FROM [TALK TRACK RAP].[DBO].[CARSEXCEL]
      WHERE CITY = @CITY AND STATE = @STATE AND ZIP = @ZIP AND GENDER = @GENDER
      GROUP BY MAKE

    SELECT * FROM ##TEMP1 where MAKECOUNT <> 0 order by MAKECOUNT desc

    DROP TABLE ##TEMP1

    SET NOCOUNT ON;

    -- Insert statements for procedure here

END
GO

In the above if i execute leaving one parameter i'm getting null records because i don't have null data
EXEC SP_TALKTRACK2 @CITY = 'ODESSA', @STATE = 'TX', @ZIP = '79762', @GENDER = 'FEMALE'

But what i need is, it should ignore that parameter and run considering only the other 3 values or 2 values what ever i provide.
Thanks in advance for your help!!
Thanks,
Pradeep

A: In your condition you must use following format :
Where ISNULL(CITY,-1) = ISNULL(@CITY,-1)

OR
Where ((City is null and @City is null) or (city = @City))

A: In SQL null is something of a Pandora's box.  So let me introduce you to some of null fun.
If you add null to anything, the resulting sum is null.  For example,
print 'Hello ' + null

Prints the string Hello plus null, which is null.  The print statement will not print anything, not even an empty row.
If you compare null to anything, the result is not true or false, but a third value: unknown.  The SQL standard tries to make unknown intuitive, but it can have surprising effects.  For example, the query
select  *
from    users
where   name = null

will never return a row, not even a row where the value of the name column is actually null.  Not even null is equal to null:
where   null = null

will happily filter out all rows.  There is a special operator you can use to find columns that are null:
where   name is null

Beside is null, you can use isnull() or coalesce() to deal with null values.  Both of these functions allow you to provide an alternative for null:
 print 'Hello ' + isnull(@name, 'unknown human')

If the @name variable is null, the isnull() function will return 'unknown human' instead.
Using this information, you can ignore null filter parameters by explicitly looking for them:
where   @name is null or name = name

Alternatively, there is a common trick to return any row if @name is not set:
where   name = isnull(@name, name)

When @name is null, the result of isnull(@name, name) is name, and name = name is true.
One of the more surprising aspects of null involves the not in operator. Look at this query:
select  *
from    names
where   name not in (select name from actor)

Now imagine that the actor table contains these rows:
'Barrack'
'Vladimir'
null

Then the where clause above becomes:
where   name not in ('Barrack', 'Vladimir', null)

Which is equivalent to:
where   name <> 'Barrack' and name <> 'Vladimir' and name <> null

The surprise is this: name <> null evaluates to unknown, and true and unknown is also  unknown.  So this query, which looks like it just excludes Barrack and Vladimir, excludes everyone instead.  It never returns a row.
For some more funs with null, enjoy this Wikipedia article.

A: use ISNULL if first parameter is null then return secound parameter
for for example ISNULL(@CITY, '') if @CITY is null return empty string becuase secound parameter is empty string
this check is required becuse if you add null to string the result is null!
and also in where condation you must check if @city is null dont check city column by null
like :
@City is null or City = @City

if your City column also is nullable you can check this :
((@City is null AND City is null) OR (City = @City))

and you'r procedure must like this :
ALTER PROCEDURE SP_TALKTRACK2
    -- Add the parameters for the stored procedure here

    @city VARCHAR(100) = NULL,
    @state VARCHAR(100)= NULL,
    @zip VARCHAR(100) = NULL,
    @gender  VARCHAR(100)= NULL

AS
BEGIN
    /*
    DECLARE @CITY VARCHAR(100)
    DECLARE @STATE VARCHAR(100)
    DECLARE @ZIP VARCHAR(100)
    DECLARE @GENDER  VARCHAR(100) */
    DECLARE @TOTALMAKES INT
    DECLARE @DESCRIPTION VARCHAR(100)
    DECLARE @MAKE2 INT

    SET @CITY = @city
    SET @STATE = @state
    SET @ZIP = @zip
    SET @GENDER = @gender

    SET @DESCRIPTION =  ' MAKES ARE BEING USED IN ' + ISNULL(@CITY, '') + ' ' + ISNULL(@STATE, '') + ' ' + ISNULL(@ZIP, '')

    SET @MAKE2 = (SELECT COUNT(MAKE)FROM [TALK TRACK RAP].[DBO].[CARSEXCEL]
    WHERE (@city is null OR CITY = @CITY) AND (@state is null or [STATE] = @STATE) AND (@zip is null or ZIP = @ZIP) AND (@gender is null or GENDER = @GENDER))

    SELECT  MAKE , ( (100 * COUNT(*)) /@MAKE2 ) AS MAKECOUNT ,
    CONVERT(VARCHAR, ( (100 * COUNT(*)) /@MAKE2 ))+ ' % ' + MAKE + @DESCRIPTION AS MAKES_PERCENTAGE INTO ##TEMP1
      FROM [TALK TRACK RAP].[DBO].[CARSEXCEL]
      WHERE  (@city is null OR CITY = @CITY) AND (@state is null or [STATE] = @STATE) AND (@zip is null or ZIP = @ZIP) AND (@gender is null or GENDER = @GENDER)
      GROUP BY MAKE

    SELECT * FROM ##TEMP1 where MAKECOUNT <> 0 order by MAKECOUNT desc

    DROP TABLE ##TEMP1

    SET NOCOUNT ON;

    -- Insert statements for procedure here

END
GO


text:
Q: Xcode React-Native: linker error - library not found for -lRCTTypeSafety after clean Xcode 12.3
Cocoapods 1.10.1
React Native CLI 4.13.1
I am having a recurring failure building a React Native app at the linking stage (library not found for -lRCTTypeSafety) in the Xcode "Archive" Build task. ("Product" > "Archive") It fails with the same error when I run the first "Build" after a "Clean Build Folder".
It does not occur when I run the "Build" task, which usually succeeds, but the "first build after a clean" behavior lines up with how the "Archive" task behaves, which appears to run an implicit "clean" first, so they appear to be a similar failure case.
None of the suggested remediations I've found on-line have worked. I am using the workspace, not the project file. FWIW, I have confirmed the same occurs using xcodebuild. (As opposed to the Xcode gui.) xcodebuild clean build fails reliably, as well as xcodebuild archive, but xcodebuild build succeeds if it isn't the first build after a clean.
Several Pod libraries are missing from the linker command when it fails. On a successful run, the xcodebuild build action has the following additional -L flags in the clang linking command that are missing on the failed attempts:
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/DoubleConversion
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/FBReactNativeSpec
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/Folly
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/RCTTypeSafety
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/RNCPicker
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-Core
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-CoreModules
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-RCTAnimation
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-RCTBlob
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-RCTImage
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-RCTLinking
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-RCTNetwork
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-RCTSettings
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-RCTText
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-RCTVibration
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-cxxreact
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-jsi
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-jsiexecutor
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-jsinspector
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/ReactCommon
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/<project>.app
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/Yoga
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/glog
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/react-native-geolocation
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/react-native-maps
-L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/React-Core/AccessibilityResources.bundle

A successful build action has no WriteAuxiliaryFile, CompileC, or Libtool log lines, so it appears that the failed first attempt after a clean is actually building the Pod files correctly, just not providing the necessary paths to the linker command.
The Libtool lines for the missing library from a failed build look like:
Libtool /Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/RCTTypeSafety/libRCTTypeSafety.a normal (in target 'RCTTypeSafety' from project 'Pods')
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only arm64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.3.sdk -L/Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/RCTTypeSafety -filelist /Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Intermediates.noindex/Pods.build/Release-iphoneos/RCTTypeSafety.build/Objects-normal/arm64/RCTTypeSafety.LinkFileList -dependency_info /Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Intermediates.noindex/Pods.build/Release-iphoneos/RCTTypeSafety.build/Objects-normal/arm64/RCTTypeSafety_libtool_dependency_info.dat -o /Users/<user>/Library/Developer/Xcode/DerivedData/<project>-bcgmbzkfkmobskcxnhtpmhoehiux/Build/Products/Release-iphoneos/RCTTypeSafety/libRCTTypeSafety.a

and I've checked that the output file libRCTTypeSafety.a is present in the path specified for the -o flag above. The directory that contains the file is included in the missing -L flags provided, so it really looks like there's just some step between compilation and linking that is getting missed.
Any help would be greatly appreciated!


text:
Q: MySQL Binary Tree Index order I have a query like this:
SELECT * FROM mytable WHERE
((num=8198747 AND class='A') OR
 (num=1646463 AND class='B') OR
 (num=4099442 AND class='C') OR
 (num=1176312 AND class='A') OR
 (num=2146847 AND class='B') OR
 (num=7000296 AND class='F') OR
 --...about 400 more clauses like this
)

SHOW INDEXES FROM mytable;
+---------+------------+----------+--------------+---------------+
| Table   | Non_unique | Key_name | Seq_in_index | Column_name   |
+---------+------------+----------+--------------+---------------+
| mytable |          0 | PRIMARY  |            1 | id            |
| mytable |          1 | nc_idx   |            1 | num           |
| mytable |          1 | nc_idx   |            2 | class         |
+---------+------------+----------+--------------+---------------+
3 rows in set (0.00 sec)

My understanding is that for each of the ~400 clauses in the query, it will do a separate BTREE lookup on num=XXXXXXXX. Is there any value in changing the query to:
SELECT * FROM mytable WHERE
((class='A' AND num IN (8198747, 1176312, ...)) OR
 (class='B' AND num IN (1247910, 1248192, ...)) OR
 (class='F' AND num IN (7244626, 9084903, ...)) OR
 --...for each class in the query
)

after adding a new index cn_idx on class and num, in that order?
I think it won't be much faster, since class is just one char, and thus the number of BTREE lookups will be the same. But, each subtree will be shorter. Thoughts?

A: In short

*

*just stick to OR

*the index on num is the only index that will help this query

*an composite index on (num,class) has negligible effect, since num is already very selective

Two other ways to write it, using UNION ALL
SELECT * FROM mytable
WHERE (num=8198747 AND class='A')
UNION ALL
SELECT * FROM mytable
WHERE (num=1646463 AND class='B')
UNION ALL
SELECT * FROM mytable
WHERE (num=4099442 AND class='C')
UNION ALL
... etc ...

This may work well if you don't have too many num/class pairs, as each one will individually perform an index seek.  (A composite index on num/class will work better than num and class indexes single-field indexes.  class/num is less selective)
The second way uses JOIN mechanics, by making a virtual table out of the num/class pairs:
SELECT t.*
FROM mytable t
JOIN (
    select 8198747 as num, 'A' as class union all
    select 1646463, 'B' union all
    select 4099442, 'C' union all
    ... etc ...
    ) v on v.num=t.num and v.class=t.class

Performance comparison
Create a table
create table mytable (
id int auto_increment primary key,
num int,
class char(1),
other varchar(10),
date timestamp default current_timestamp) ENGINE InnoDB;

Fill it up with 1 million records
(Note: data properties - selectivity: num ~ 1, class ~ 1/26)
insert into mytable(num, class, other)
select rand()*100000000, char(rand()*26+65), concat('',rand()*10000000)
from
(select 1 a union all select 2 union all select 3 union all select 4
union all select 5 union all select 6 union all select 7
union all select 8 union all select 9 union all select 0) a,
(select 1 a union all select 2 union all select 3 union all select 4
union all select 5 union all select 6 union all select 7
union all select 8 union all select 9 union all select 0) b,
(select 1 a union all select 2 union all select 3 union all select 4
union all select 5 union all select 6 union all select 7
union all select 8 union all select 9 union all select 0) c,
(select 1 a union all select 2 union all select 3 union all select 4
union all select 5 union all select 6 union all select 7
union all select 8 union all select 9 union all select 0) d,
(select 1 a union all select 2 union all select 3 union all select 4
union all select 5 union all select 6 union all select 7
union all select 8 union all select 9 union all select 0) e,
(select 1 a union all select 2 union all select 3 union all select 4
union all select 5 union all select 6 union all select 7
union all select 8 union all select 9 union all select 0) f

Create the indexes
create index nc_num on mytable(num);
create index nc_class on mytable(class);

Select using OR
select * from mytable
WHERE
(num=38142659 and class='T') OR
(num=42476845 and class='E') OR
(num=45205882 and class='B') OR
(num=84861596 and class='K') OR
..... 100 in total

Output of Show profiles: (run set profiling=1; once. then run the queries. run show profiles to see the last timings)
Duration: 0.00003025

Explain extended (add explain extended before the query)
"id";"select_type";"table";"type";"possible_keys";"key";"key_len";"ref";"rows";"Extra"
"1";"SIMPLE";"mytable";"range";"nc_num,nc_class";"nc_num";"5";NULL;"125";"Using where"

Select using UNION ALL between num/class
SELECT * FROM mytable WHERE (num=38142659 AND class='T') UNION ALL
SELECT * FROM mytable WHERE (num=42476845 AND class='E') UNION ALL
SELECT * FROM mytable WHERE (num=45205882 AND class='B') UNION ALL
SELECT * FROM mytable WHERE (num=84861596 AND class='K') UNION ALL
.... 100 in total

Show Profile
Duration: 0.00069525

Explain extended
"id";"select_type";"table";"type";"possible_keys";"key";"key_len";"ref";"rows";"Extra"
"1";"PRIMARY";"mytable";"ref";"nc_num,nc_class";"nc_num";"5";"const";"1";"Using where"
"2";"UNION";"mytable";"ref";"nc_num,nc_class";"nc_num";"5";"const";"1";"Using where"
"3";"UNION";"mytable";"ref";"nc_num,nc_class";"nc_num";"5";"const";"1";"Using where"
"4";"UNION";"mytable";"ref";"nc_num,nc_class";"nc_num";"5";"const";"1";"Using where"
... etc

Select using Union All to build up a virtual table
SELECT t.*
FROM mytable t
JOIN (
select 41805446 num, 'X' collate utf8_general_ci class union all
select 84867135, 'P' union all
select 52747446, 'R' union all
.... etc...
) v on v.num=t.num and v.class=t.class

Show profile
Duration: 0.00026100

Explain extended
"id";"select_type";"table";"type";"possible_keys";"key";"key_len";"ref";"rows";"Extra"
"1";"PRIMARY";"<derived2>";"ALL";NULL;NULL;NULL;NULL;"100";""
"1";"PRIMARY";"t";"ref";"nc_num";"nc_num";"5";"v.num";"1";"Using where"
"2";"DERIVED";NULL;NULL;NULL;NULL;NULL;NULL;NULL;"No tables used"
"3";"UNION";NULL;NULL;NULL;NULL;NULL;NULL;NULL;"No tables used"
"4";"UNION";NULL;NULL;NULL;NULL;NULL;NULL;NULL;"No tables used"
....
"101";"UNION";NULL;NULL;NULL;NULL;NULL;NULL;NULL;"No tables used"
NULL;"UNION RESULT";"<union2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,...>";"ALL";NULL;NULL;NULL;NULL;NULL;""

Select using IN
SELECT * FROM mytable WHERE
(class='A' and num in (28538065
)) or (class='B' and num in (70851926
,90457823
,94804149
)) or (class='C' and num in (74179050
,43280101
,24562525
,56859448
,38226813
,33532373
,93501613
,28634136
,8204338
,15636810
)) or (class='D' and num in (26672499
.... etc

Show profile
Duration: 0.00003125

Explain extended
"id";"select_type";"table";"type";"possible_keys";"key";"key_len";"ref";"rows";"Extra"
"1";"SIMPLE";"mytable";"range";"nc_num,nc_class";"nc_num";"5";NULL;"136";"Using where"


text:
Q: remove text from a function (i think) I am trying to remove the "_" in the "change_option". I managed to add the class ok but that's it
<select onchange="change_option('SELECT___100E___7',this.options[this.selectedIndex].value)" name="SELECT___100E___7" class="link_fix3">

Here is the code I have so far...
$("form select[onchange^='change_option']")
    .addClass('link_fix3')
    .attr('onchange', function(k,x){
     return x.replace('_','');})

A: Without knowing the internals, it seems you're trying to call changeoption(name, value), you can do this entirely in jQuery, like this:
$("form select[onchange^='change_option']")
  .addClass('link_fix3')
  .change(function() {
    changeoption(this.name, $(this).val());
  });

Though with more details, this can probably be even simpler, for example is giving the <select> a class initially an option? That would make the selector much cleaner, then you can leave the initial onchange attribute off completely...you have to admit this looks prettier :)
<select name="SELECT___100E___7" class="link_fix3">

Script like this:
$("form select.link_fix3").change(function() {
  changeoption(this.name, $(this).val());
});

If you post what your changeoption function looks like, I could improve the answer to show additional simplifications, if any of these options I'm offering are do-able...I know the programmers control over markup varies widely, so let us know what options you do have.

A: just a thought... if you do this,
$("form select[onchange^='change_option']")
    .addClass('link_fix3')
    .attr('onchange', function(k,x){
     return x.replace('_','');})

the output would be,
onchange="changeoption('SELECT00E7',this.options[this.selectedIndex].value)" // notice your, 'SELECT___100E___7'

I suggest this,
$("form select[onchange^='change_option']")
        .addClass('link_fix3')
        .attr('onchange', function(k,x){
         return x.replace('change_option','changeoption');})

that is, if you really want to solve it that way...


text:
Q: MySQL SELECT JOIN LIMIT row Comment per Post and LIMIT row Post per User I have 3 tables in database, ig_user, ig_post, and ig_komentar
ig_user
id_ig_user   username     nama
---------------------------------------
1            elizabeth    elizabeth store
2            celmirashop  celmira store

ig_post
----------------------------------
id_ig_post    url_post    username
1             a1b2c3      elizabeth
2             d1e2f3      elizabeth
3             g1h2i3      elizabeth

4             j1k2l3      celmirashop
5             m1n2o3      celmirashop
6             p1q2r3      celmirashop

ig_komentar
------------------------------------------
id_ig_komentar    url_post   nama_komentar
1                 a1b2c3     arif
2                 a1b2c3     budi
3                 a1b2c3     candra
4                 a1b2c3     doni

5                 d1e2f3     ema
6                 d1e2f3     fellaini
7                 d1e2f3     gusti
8                 d1e2f3     hussein
9                 ......     ........
10                ......     ........
11                ......     ........

I want select data every user have 2 post, and every post have 3 comment (from table ig_komentar)
I try this query
SELECT p1.nama_komentar
     , p1.isi_komentar
     , p1.id_ig_komentar
     , ip.username
     , p1.url_post
  FROM ig_komentar p1
  JOIN ig_komentar p2
    ON p1.url_post = p2.url_post
   AND p2.id_ig_komentar >= p1.id_ig_komentar
  JOIN ig_post ip
    ON p1.url_post=ip.url_post
 GROUP
    BY p1.id_ig_komentar
     , p1.url_post
HAVING COUNT(*) <= 3
 ORDER
    BY url_post
     , id_ig_komentar

and return 3 comment/komentar in every post. but, I need user too.
how to query that return 3 comment/komentar in every post and 2 post in every user  like this?
username     url_post   nama_komentar
elizabeth    a1b2c3     arif
elizabeth    a1b2c3     budi
elizabeth    a1b2c3     candra

elizabeth    d1e2f3     ema
elizabeth    d1e2f3     fellaini
elizabeth    d1e2f3     gusti

celmirashop  j1k2l3     taufiq
celmirashop  j1k2l3     uzumaki
celmirahsop  j1k2l3     vivian

celmirashop  m1n2o3     wahyu
celmirashop  m1n2o3     xarman
celmirashop  m1n2o3     yoris

username elizabeth have 2 url_post, in every post have 3 nama_komentar
username celmirashop havw 2 url_post, in every post have 3 nama_komentar

A: Consider a slightly different output, but from simpler SQL:
SELECT ( SELECT username FROM ig_post WHERE url_post = k.url_post ) AS username,
       url_post,
       SUBSTRING_INDEX(GROUP_CONCAT(nama_komentar), ',', 3) AS namas
    FROM ig_komentar AS k
    GROUP BY url_post;


text:
Q: How turn off showing path on project pane in PyCharm? How I can turn off showing path to project on project pane in PyCharm?

A: I do not think it is possible. Here's a request in the tracker that looks similar: http://youtrack.jetbrains.com/issue/IDEA-126014


text: Q: load dynamically data in grid kendo ui As you can see in the picture this is a kendo grid that gets the data from the database and do the sorting, paging and grouping and right now it has been grouped by. My record are a lot, they're more than 2-3 millions and because of this reason I can not send all my data to the grid so first the I send a request to database and then I receive the paged, sorted and group by response back from the server and everything works great but sometimes there might be only 2 set of grouped data but inside these two there might be millions of data so this is what I did, I just show the name of the groups with no child data. My problem is that when someone clicks on a group, I want to open up it's nodes and show the related data. but I didn't find any method in kendo to show the nodes' data that is present inside a datasource in its related node.


text:
Q: Blockchain Questions I am currently developing a thesis project for the Master of Computer Engineering. The project is being developed in a business environment and consists on the creation of an abstract module based on the concept of blockchain, so it is possible to integrate it into several company products. In the course of my research a number of questions have arisen:

*

*In blockchain concept there are several nodes that share a ledger, in which each node participates in the network (inserting data in the ledger and validating this data). Does it make sense that only 1 node enter data and the other nodes just serve the consensus mechanism? If this makes no sense, what are the alternatives?

*It makes sense to have a ledger common to all customers that contain data in this ledger, and is this ledger not distributed by these customers, but by other entities that are responsible for maintaining the ledger and serving the consensus mechanism?

*Can any node read the ledger data? Do these restrictions depend only on technology?

A: In blockchain concept there are several nodes that share a ledger, in which each node participates in the network (inserting data in the ledger and validating this data). Does it make sense that only 1 node enter data and the other nodes just serve the consensus mechanism? If this makes no sense, what are the alternatives?

Yes it's possible. Not every participating node has to be a mining node. You have basically 2 types of nodes in the network that is mining nodes and transactional nodes.

It makes sense to have a ledger common to all customers that contain data in this ledger, and is this ledger not distributed by these customers, but by other entities that are responsible for maintaining the ledger and serving the consensus mechanism?

don't understand this question. Please put it in a better way

Can any node read the ledger data? Do these restrictions depend only on technology?

Any node participating can read the data. Infact anyone in the world can read the ledger without node I.e., through Block explorers like etherscan


text:
Q: Is there any point in using the warning flags with GCC when just linking object files? If I just want to link some object files, like:
gcc a.o b.o c.o -o program

is there any point in using the following flags with it:
gcc a.o b.o c.o -o program -std=c99 -Wall -pedantic-errors -Werror

Do they make any difference?

A: Converting comments into an answer to allow for closure.

Is there any point in including the warning flags when merely linking object files?

Succinctly, no, they don't make a difference, but they don't do any harm, either. At the command line with you typing, you may omit them. In a makefile, you should probably keep them (via ${CFLAGS}) just in case a source file gets listed in the link line.
Incidentally, the -g flag is often important for making debuggable executables. It is needed in both the object-file compilation and the linking command line, but is usually embedded in the CFLAGS value.  This is one of the important reasons for including the CFLAGS in with the linking operation.  Other linking flags can be misplaced (the -g flag is not really misplaced) in the CFLAGS; by using it, you protect yourself from inadvertent errors.

Well, actually I need it for a makefile

Use this command sequence to link your programs:
${CC} -o $@ ${CFLAGS} ${OBJECTS} ${LDFLAGS} ${LDLIBS}

CFLAGS will include the warnings etc. LDFLAGS will specify library locations and other library-related controls; LDLIBS lists the libraries to be linked. Note that the libraries are after the object files; that's important. Don't fret about it — simply do it. OBJECTS is the list of object files to be linked. In your example:
OBJECTS = a.o b.o c.o

You'd have a rule:
program: ${OBJECTS}
    ${CC} -o $@ ${CFLAGS} ${OBJECTS} ${LDFLAGS} ${LDLIBS}

GNU Make might have a special variable notation for ${OBJECTS} in the command.
You're entirely at liberty to use $(CFLAGS) where I used ${CFLAGS}; both notations are recognized by Make.

${CC} -o $@ ${CFLAGS} ${OBJECTS} ${LDFLAGS} ${LDLIBS}

vs
${CC} ${LDFLAGS} ${LDLIBS} -o $@ ${CFLAGS} ${OBJECTS}

Does the order matter?

Yes, the order matters. I said so (Note that the libraries are after the object files; that's important) and I meant what said. You could but LDFLAGS anywhere on the command line before LDLIBS, but the object files must precede the libraries for reliable cross-platform linking. On a given platform, you may get away with tinkering with the order, but the next upgrade, or a change to a new platform, stands a decent chance of breaking your code if you put libraries ahead of object files.


text:
Q: scaling of rabbit mq what scaling options can we use if rabbitMQ metrices reaches a threshold?I have a VM on which RabbitMQ is running. If the queue length>90% of total queue length, can we increase the instance count by 1 and a with a separate queue such that they are to be processed on a priority basis?
In short what scaling options do we have based on different parameters for RabbitMQ

A: Take a look into RabbitMQ Sharding Plugin
From their README:

RabbitMQ Sharding Plugin
This plugin introduces the concept of sharded queues for RabbitMQ.
  Sharding is performed by exchanges, that is, messages will be
  partitioned across "shard" queues by one exchange that we should
  define as sharded. The machinery used behind the scenes implies
  defining an exchange that will partition, or shard messages across
  queues. The partitioning will be done automatically for you, i.e: once
  you define an exchange as sharded, then the supporting queues will be
  automatically created on every cluster node and messages will be
  sharded across them.
Auto-scaling
One interesting property of this plugin, is that if you add more nodes
  to your RabbitMQ cluster, then the plugin will automatically create
  more shards in the new node. Say you had a shard with 4 queues in node
  a and node b just joined the cluster. The plugin will automatically
  create 4 queues in node b and join them to the shard partition.
  Already delivered messages will not be rebalanced, but newly arriving
  messages will be partitioned to the new queues.


text:
Q: How to submit form data to php sql database from chrome extension I don't know whats wrong with this code but it is not working. I changed form method to post and get but nothing worked. I want to submit this form to DB.
popup.html:
<form id='myForm' action='savenewfeed.php' method="get">
        URL:
        <input class= 'vals' type="text" name="feed" id="url">

        Title :
        <input class= 'vals' type="text" name="title" id="title">

        Channel:
        <select class= 'vals' name='pid'>
          <option value="2">Big</option>
          <option value="3">H</option>
          <option value="4">T</option>
        </select>

        <button id='sbmt'>Submit</button>
    </form>

manifest:
{
  "manifest_version": 2,

  "name": "One-click Kittens",
  "description": "This extension gets current url of browser",
  "version": "1.0",

  "permissions": [
   "tabs",
"cookies",
"http://*/*",
"http://*/",
"https://*/*"
  ],
  "browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
  }
    }

popup.js:
function myAlert(){
document.getElementById('myForm').submit();
}

document.addEventListener('DOMContentLoaded', function () {
document.getElementById('sbmt').addEventListener('click', myAlert);
});

when i click the button, my php code appears in chrome extension, whereas , that php code to submit data works perfectly in simple web app.

A: change form action to absolute url of your submit script. don't use relative path. for example
<form id='myForm' action='http://localhost.com/mydir/savenewfeed.php' method="get">


text:
Q: load an image after clicking a button I have a <button> with the rel="example.jpg". I want the button to load the image in my #area DIV, just after clicking on it, not with the page load. So I use this code and everything is done:
$(document).ready(function(){
$("button").click(function(){
    var imgUrl = $(this).attr('rel');
    $("#area").html("");
});
});

<button rel="example.jpg">Click Me</button>

Here is its jsfiddle.
Now I found that the rel is not valid for the <button>.
I'm interested to know other solutions to do this, such as using jquery .data()

A: HTML
<button data-rel="example.jpg">Click Me</button>

jQuery
$("button").click(function () {
    var imgUrl = $(this).data('rel');
    $("#area").html("");
});

A: change
<button rel=

to
<button data-rel=

http://jsfiddle.net/x3QdU/1/

A: Change your code to this:
$(document).ready(function(){
$("button").click(function(){
    var imgUrl = $(this).data('rel');
    $("#area").html("");
  });
});

<button data-rel="example.jpg">Click Me</button>

Fiddle: http://jsfiddle.net/x3QdU/4/


text:
Q: Catchable fatal error: Object of class PDOStatement could not be converted to string Following is the php code to execute sql. But it fails with Catchable fatal error.
And I have read the php manual PDOStatement, the sample code is such similar with the code I wrote. I can't figure out the error.
$statement = $db->prepare("INSERT INTO note_list (id, date, note)"."VALUES (:id, :date, :note)");
$statement->execute(array(":id" => $count,":date" => $date,":note" => $note));

A: $statement->execute(array(":id" => $count,":date" => $date,":note" => $note));

If the error occurs on this line, then either $count, $date or $note is an instance of PDOStatement. Figure out which one it is and turn them into strings properly.


text: Q: Find mail JobId with specific Campaign Code Is it possible in Queries to find alle users who have opened an email with the Campaign Code of "Newsletter"... I Cant find the Campaigncode anywhere in the _dataview tables.. the closest is EmailName.. but this is an ongoing task with new email added all the time, so it need to be dynamic to include new emails...


text:
Q: QWidget::setEnabled(false) fails 2 times out of 10 in debug version only First, it sort of complicates debugging but I can live with that. What's worse, I'm afraid there's a race condition somewhere in Qt internals that would make the thing fail in release version too in a situation I can not predict nor run into accidentally.
The (pseudo)code goes roughly like this:
class MyCheckBox : public QCheckBox
{
public slots:
    void onClicked();
};

MyCheckBox::MyCheckBox()
{
    connect(this, &QCheckBox::clicked, this, &MyCheckBox::onClicked);
}

void MyCheckBox::onClicked()
{
    qDebug() << "onClicked";
    setEnabled(false);
}

Log says onClicked() gets called but the button stays enabled. Qt 5.7, Windows 7. What am I doing wrong?


text:
Q: How can I get saved report for Google Analytics with Apps Script? I think something like this works:
var optArgs = {
'savedReport': 'yV_LzjnnSZ6Ejy02d0cwFQ'
};

var results = Analytics.Data.Ga.get(
  tableId, startDate, endDate,
  'ga:sessions,ga:pageviews',
  optArgs);
)

Is it possible to get a saved report I created in Web UI? If so, how can I specify the custom report?

A: You may refer with this tutorial regarding Google Analytics Report Automation (Magic Script).

Google Analytics Report Automation (Magic) is an integration that reduces the work required to put Google Analytics data into any Apps Script supported product, such as Google Docs, Sites, or Spreadsheets.

It is also possible to write your own code and develop custom scripts. For example, with the Analytics - Apps Script integration, you can request the total users, sessions, and pageviews over time and put this data into a spreadsheet with just the following code:

// Get Data.
var results = Analytics.Data.Ga.get(
    tableId,
    startDate,
    endDate,
    'ga:users,ga:sessions,ga:pageviews',
    {'dimensions': 'ga:date'});

// Output to spreadsheet.
var sheet = SpreadsheetApp.getActiveSpreadsheet().insertSheet();
sheet.getRange(2, 1, results.getRows().length, headerNames.length).setValues(results.getRows());

// Make Sandwich.

To get started now, read our Automated Access to Google Analytics Data in Google Spreadsheets tutorial. Also check out the Google Analytics Apps Script reference docs.


text:
Q: Indeed Job Scraper only for Postings with External Link Currently using the below Python scraper to pull Job title, Company, Salary, and Description. Looking for a way to take it one step further by filtering only results where application link is URL to company website, as opposed to the 'Easily Apply' postings that send application through Indeed. Is there a way to do this?
import requests
from bs4 import BeautifulSoup
import pandas as pd

def extract(page):
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36'}
    url = f'https://www.indeed.com/jobs?q=Software%20Engineer&l=Austin%2C%20TX&ts=1630951951455&rq=1&rsIdx=1&fromage=last&newcount=6&vjk=c8f4815c6ecfa793'
    r = requests.get(url, headers) # 200 is OK, 404 is page not found
    soup = BeautifulSoup(r.content, 'html.parser')
    return soup

# <span title="API Developer"> API Developer </span>
def transform(soup):
    divs = soup.find_all('div', class_ = 'slider_container')
    for item in divs:
        if item.find(class_ = 'label'):
            continue # need to fix, if finds a job that has a 'new' span before the title span, skips job completely
        title = item.find('span').text.strip()
        company = item.find('span', class_ = "companyName").text.strip()
        description = item.find('div', class_ = "job-snippet").text.strip().replace('\n', '')
        try:
            salary = item.find('span', class_ = "salary-snippet").text.strip()
        except:
            salary = ""

        job = {
                'title': title,
                'company': company,
                'salary': salary,
                'description': description
        }
        jobList.append(job)
#        print("Seeking a: "+title+" to join: "+company+" paying: "+salary+". Job description: "+description)
    return

jobList = []

# go through multiple pages
for i in range(0,100, 10): #0-40 stepping in 10's
    print(f'Getting page, {i}')
    c = extract(0)
    transform(c)

print(len(jobList))

df = pd.DataFrame(jobList)
print(df.head())
df.to_csv('jobs.csv')

A: My approach is as follows-
Find the href from the <a> tag for each job card on the initial page, and then send a request to each of those links, and grab the external job link (If "Apply on Company Site" button is available) from there.
Code snippet-
#function which gets external job links
def get_external_link(url):
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36'}
    r = requests.get(url, headers)
    soup = BeautifulSoup(r.content, 'html.parser')

    #if Apply On Company Site button is available, fetch the link
    if(soup.find('a',attrs={"referrerpolicy" : "origin"})) is not None:
        external_job_link=soup.find('a',attrs={"referrerpolicy" : "origin"})
        print(external_job_link['href'])

#add this piece of code to transform function
def transform(soup):
    cards=soup.find('div',class_='mosaic-provider-jobcards')
    links=cards.find_all("a", class_=lambda value: value and value.startswith("tapItem"))

    #for each job link in the page call get_external_links
    for link in links:
        get_external_link('https://www.indeed.com'+(link['href']))

Note- You can also use the page source of the new requests which are being called to fetch the data like title, company, salary, description which you previously used to scrape from the main page.


text:
Q: Is there a language-agnostic specification for "string natural sorting order"? As I painfully try to find a good natural sorting algorithm written in JavaScript, I then stumble upon a bunch of different implementations, interesting blog posts, and answers on StackOverflow.
Each implementation provides its technical tricks. However, the more I looked into it the more a question became very clear: "Is there actually any language-agnostic specification regarding natural sorting order of strings?"
I mean, if not, then how could one expect to write a piece of code that is actually "correct for everyone" or "agreed on by the community"? I would have expected a specification stating the result of the compromises/decisions made, at least for English, as it is simple (no accents/diacritics)...
Note that I wrote "language-agnostic" as I would expect this specification to then be used to implement solutions in different languages, not only in JavaScript, C#, or Java.
Resources:

*

*Sorting for Humans: Natural Sort Order

*Alphanum: JavaScript Natural Sorting Algorithm

*www.davekoelle.com/alphanum.html

*How to sort strings in JavaScript

*Natural sort of alphanumerical strings in JavaScript

A: There is ISO 14651. This is an ISO Standard specifying an algorithm that can be used when comparing two strings. The standard also specifies a datafile specifying the comparison order, the Common Tailorable Template, CTT.
There is the European Ordering Rules. This is an implementation of the iso CTT. It defines an ordering for strings written in languages that are written with the Latin, Greek and Cyrillic alphabets.
There is the Unicode Collation Algorithm. The Unicode collation algorithm (UCA) is an algorithm defined in Unicode Technical Report #10, which defines a customizable method to compare two strings.

A: The algorithms for determining which string comes first when comparing two strings are called collation algorithms and the sort order they produce is called the collation order.
Unfortunately, there is no agreed upon global collation order. To make matters worse, the correct sorting order is not only language dependent, but can even differ between different contexts.
One example of language difference is that in German the accented characters are ordered immediately after their unaccented counterparts (ö comes immediately after o), but in Swedish the accented characters come right at the end of the alphabet (ö comes after z). And as for usage differences, phone books and dictionaries can have different sort orders.
Although there is no global collation order, there are collation orders that generally give a reasonable order independent of the natural language that the words are written in and there are collation algorithms that can be tailored to either give a reasonable sort order or to give the absolute correct order for a given culture and usage.
One such algorithm is the "Unicode Collation Algorithm", which can be found at http://www.unicode.org/reports/tr10/. This algorithm can be tailored for a wide range of collation orders and comes with a default configuration that gives a reasonable ordering for all Unicode codepoints. The algorithm does not depend on any particular programming language.
The introduction section of the standard gives a nice overview of the difficulties in correctly collating text.
Another algorithm is described in ISO standard 14651.
Besides the various national collation orders, there is also a standardized collation order for the European languages, called the European Ordering Rules (EOR).

A: It is certainly possible to write a collation algorithm that is equally useful for everyone - but only by being equally useless for everyone. There is a war going on between algorithms and people, as to who is the master and who is the servant.
Having has to provide the ability for users to dominate their computers, I can add to the examples given the following:

*

*is CH a separate single letter coming after C in the alphabet?

*Are O and Ó the same letter (Spanish) or different letters (Polish)?

*Is LL a separate single letter from L?

*and (although it isn't collation as such) the famous exception that makes conversion to upper or lower case impossible: is a capital "i" "İ" or "I"? Is a lower-case "I" "ı" or "i"?

In the war between algorithms and people it is anyone's guess who will win, though on the whole human servility makes a machine victory more likely.


text:
Q: Install static files for Python package (forgive my poor English)
I'm writing setup.py for my Python app.
My app needs some static files (pictures). I should add these files to data_files array in setup.py, and files will be installed in "/usr/xxx" path on Linux.
Then how can my app access these files after installation? I don't think it's good idea to use abslote path (like /usr/share/xxx/xxx.png) in my app (it won't work on windows).

A: You're supposed to use sys.prefix instead of an absolute path:
filename = os.path.join(sys.prefix, "share", "xxx", "xxx.png")

A: distribute/setuptools provides pkg_resources for this purpose (and will work with package installed by python setup.py develop or pip install -e).
api example::
    import pkg_resources
    assert pkg_resources.resource_exists('fabric', 'README.txt')
    assert not pkg_resources.resource_isdir('fabric', 'README.txt')
    myfile_path = pkg_resources.resource_filename('fabric', 'README.txt')
    myopen_file = pkg_resources.resource_stream('fabric', 'README.txt')
    myfile_str  = pkg_resources.resource_string('fabric', 'README.txt')
    contents_of_package = pkg_resources.resource_listdir('fabric', '')


text:
Q: Three.js Points with multiple textures I am working on a Three.js scene in which I'd like to use many points with different textures. However, so far I haven't been able to change textures in my fragment shader. Despite the fact that the points in the following scene should alternate between texture 0 (a cat) and 1 (a dog), all points show the same texture:

/**
* Generate a scene object with a background color
**/

function getScene() {
  var scene = new THREE.Scene();
  scene.background = new THREE.Color(0xaaaaaa);
  return scene;
}

/**
* Generate the camera to be used in the scene. Camera args:
*   [0] field of view: identifies the portion of the scene
*     visible at any time (in degrees)
*   [1] aspect ratio: identifies the aspect ratio of the
*     scene in width/height
*   [2] near clipping plane: objects closer than the near
*     clipping plane are culled from the scene
*   [3] far clipping plane: objects farther than the far
*     clipping plane are culled from the scene
**/

function getCamera() {
  var aspectRatio = window.innerWidth / window.innerHeight;
  var camera = new THREE.PerspectiveCamera(75, aspectRatio, 0.1, 10000);
  camera.position.set(0, 1, -6000);
  return camera;
}

/**
* Generate the renderer to be used in the scene
**/

function getRenderer() {
  // Create the canvas with a renderer
  var renderer = new THREE.WebGLRenderer({antialias: true});
  // Add support for retina displays
  renderer.setPixelRatio(window.devicePixelRatio);
  // Specify the size of the canvas
  renderer.setSize(window.innerWidth, window.innerHeight);
  // Add the canvas to the DOM
  document.body.appendChild(renderer.domElement);
  return renderer;
}

/**
* Generate the controls to be used in the scene
* @param {obj} camera: the three.js camera for the scene
* @param {obj} renderer: the three.js renderer for the scene
**/

function getControls(camera, renderer) {
  var controls = new THREE.TrackballControls(camera, renderer.domElement);
  controls.zoomSpeed = 0.4;
  controls.panSpeed = 0.4;
  return controls;
}

/**
* Generate the points for the scene
* @param {obj} scene: the current scene object
**/

function addPoints(scene) {
  // this geometry builds a blueprint and many copies of the blueprint
  var geometry  = new THREE.InstancedBufferGeometry();

  geometry.addAttribute( 'position',
    new THREE.BufferAttribute( new Float32Array( [0, 0, 0] ), 3));

  // add data for each observation
  var n = 10000; // number of observations
  var translation = new Float32Array( n * 3 );
  var texture = new Float32Array( n );
  var translationIterator = 0;

  for (var i=0; i<n; i++) {
    texture[i] = i % 2;
  }

  for (var i=0; i<n*3; i++) {
    switch (translationIterator % 3) {
      case 0:
        translation[translationIterator++] = ((i * 50) % 10000) - 5000;
        break;
      case 1:
        translation[translationIterator++] = Math.floor((i / 160) * 50) - 5000;
        break;
      case 2:
        translation[translationIterator++] = 10;
        break;
    }
  }

  geometry.addAttribute( 'translation',
    new THREE.InstancedBufferAttribute( translation, 3, 1 ) );

  geometry.addAttribute( 'textureIndex',
    new THREE.InstancedBufferAttribute( texture, 1, 1 ) );

  var loader = new THREE.TextureLoader();
  var material = new THREE.RawShaderMaterial({
    uniforms: {
      textures: {
        'type': 'tv',
        'value': [
          loader.load('https://s3.amazonaws.com/duhaime/blog/tsne-webgl/assets/cat.jpg'),
          loader.load('https://s3.amazonaws.com/duhaime/blog/tsne-webgl/assets/dog.jpg'),
        ],
      }
    },
    vertexShader: document.getElementById('vertex-shader').textContent,
    fragmentShader: document.getElementById('fragment-shader').textContent,
  });
  var mesh = new THREE.Points(geometry, material);
  mesh.frustumCulled = false; // prevent the mesh from being clipped on drag
  scene.add(mesh);
}

/**
* Render!
**/

function render() {
  requestAnimationFrame(render);
  renderer.render(scene, camera);
  controls.update();
};

/**
* Main
**/

var scene = getScene();
var camera = getCamera();
var renderer = getRenderer();
var controls = getControls(camera, renderer);
addPoints(scene);
render();
html, body { width: 100%; height: 100%; background: #000; }
body { margin: 0; overflow: hidden; }
canvas { width: 100%; height: 100%; }
<html>
<body>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/88/three.min.js'></script>
  <script src='https://rawgit.com/YaleDHLab/pix-plot/master/assets/js/trackball-controls.js'></script>

    <script type='x-shader/x-vertex' id='vertex-shader'>
    /**
    * The vertex shader's main() function must define `gl_Position`,
    * which describes the position of each vertex in screen coordinates.
    *
    * To do so, we can use the following variables defined by Three.js:
    *   attribute vec3 position - stores each vertex's position in world space
    *   attribute vec2 uv - sets each vertex's the texture coordinates
    *   uniform mat4 projectionMatrix - maps camera space into screen space
    *   uniform mat4 modelViewMatrix - combines:
    *     model matrix: maps a point's local coordinate space into world space
    *     view matrix: maps world space into camera space
    *
    * `attributes` can vary from vertex to vertex and are defined as arrays
    *   with length equal to the number of vertices. Each index in the array
    *   is an attribute for the corresponding vertex. Each attribute must
    *   contain n_vertices * n_components, where n_components is the length
    *   of the given datatype (e.g. for a vec2, n_components = 2; for a float,
    *   n_components = 1)
    * `uniforms` are constant across all vertices
    * `varyings` are values passed from the vertex to the fragment shader
    *
    * For the full list of uniforms defined by three, see:
    *   https://threejs.org/docs/#api/renderers/webgl/WebGLProgram
    **/

    // set float precision
    precision mediump float;

    // specify geometry uniforms
    uniform mat4 modelViewMatrix;
    uniform mat4 projectionMatrix;

    // to get the camera attributes:
    uniform vec3 cameraPosition;

    // blueprint attributes
    attribute vec3 position; // sets the blueprint's vertex positions

    // instance attributes
    attribute vec3 translation; // x y translation offsets for an instance
    attribute float textureIndex; // idx of texture in sampler

    // specify the varyings to pass to instances
    varying float vTextureIndex;

    void main() {
      // pass varyings to fragment shader
      //vTextureIndex = textureIndex;

      // set point position
      vec3 pos = position + translation;
      vec4 projected = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
      gl_Position = projected;

      // use the delta between the point position and camera position to size point
      float xDelta = pow(projected[0] - cameraPosition[0], 2.0);
      float yDelta = pow(projected[1] - cameraPosition[1], 2.0);
      float zDelta = pow(projected[2] - cameraPosition[2], 2.0);
      float delta  = pow(xDelta + yDelta + zDelta, 0.5);
      gl_PointSize = 50000.0 / delta;
    }
    </script>

    <script type='x-shader/x-fragment' id='fragment-shader'>
    /**
    * The fragment shader's main() function must define `gl_FragColor`,
    * which describes the pixel color of each pixel on the screen.
    *
    * To do so, we can use uniforms passed into the shader and varyings
    * passed from the vertex shader.
    *
    * Attempting to read a varying not generated by the vertex shader will
    * throw a warning but won't prevent shader compiling.
    **/

    precision highp float;

    uniform sampler2D textures[2];

    // declare received varyings
    varying float vTextureIndex; // instance uv offsets

    void main() {
      int texIdx = int(vTextureIndex);
      vec2 uv = vec2(0.0, 0.0) + vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y );
      if (texIdx == 0) {
        gl_FragColor = texture2D(textures[0], uv );
      } else if (texIdx == 1) {
        gl_FragColor = texture2D(textures[1], uv );
      }
    }
    </script>
</body>
</html>

Does anyone see what I'm missing? I'd be very grateful for any insight others can offer on this question!

A: In case others end up here facing the same trouble I had, I wanted to say that the above example was a simplified version of a larger scene. In that other scene, I was passing in an attribute texture but I was initializing the attribute as textureIndex inside the vertex shader. I then passed the textureIndex to the fragment shader as a varying, where it always equalled 0. So the moral of the story is -- if you try to read from an attribute that isn't passed to the vertex shader, that value evidently equates to zero. It would be great if this threw an error instead.
In the silly example above I had commented out the varying declaration in the fragment shader. This is fixed:

  /**
  * Generate a scene object with a background color
  **/

  function getScene() {
    var scene = new THREE.Scene();
    scene.background = new THREE.Color(0xaaaaaa);
    return scene;
  }

  /**
  * Generate the camera to be used in the scene. Camera args:
  *   [0] field of view: identifies the portion of the scene
  *     visible at any time (in degrees)
  *   [1] aspect ratio: identifies the aspect ratio of the
  *     scene in width/height
  *   [2] near clipping plane: objects closer than the near
  *     clipping plane are culled from the scene
  *   [3] far clipping plane: objects farther than the far
  *     clipping plane are culled from the scene
  **/

  function getCamera() {
    var aspectRatio = window.innerWidth / window.innerHeight;
    var camera = new THREE.PerspectiveCamera(75, aspectRatio, 0.1, 10000);
    camera.position.set(0, 1, -6000);
    return camera;
  }

  /**
  * Generate the renderer to be used in the scene
  **/

  function getRenderer() {
    // Create the canvas with a renderer
    var renderer = new THREE.WebGLRenderer({antialias: true});
    // Add support for retina displays
    renderer.setPixelRatio(window.devicePixelRatio);
    // Specify the size of the canvas
    renderer.setSize(window.innerWidth, window.innerHeight);
    // Add the canvas to the DOM
    document.body.appendChild(renderer.domElement);
    return renderer;
  }

  /**
  * Generate the controls to be used in the scene
  * @param {obj} camera: the three.js camera for the scene
  * @param {obj} renderer: the three.js renderer for the scene
  **/

  function getControls(camera, renderer) {
    var controls = new THREE.TrackballControls(camera, renderer.domElement);
    controls.zoomSpeed = 0.4;
    controls.panSpeed = 0.4;
    return controls;
  }

  /**
  * Generate the points for the scene
  * @param {obj} scene: the current scene object
  **/

  function addPoints(scene) {
    // this geometry builds a blueprint and many copies of the blueprint
    var geometry  = new THREE.InstancedBufferGeometry();

    geometry.addAttribute( 'position',
      new THREE.BufferAttribute( new Float32Array( [0, 0, 0] ), 3));

    // add data for each observation
    var n = 10000; // number of observations
    var translation = new Float32Array( n * 3 );
    var texture = new Float32Array( n );
    var translationIterator = 0;

    for (var i=0; i<n; i++) {
      texture[i] = i % 2;
    }

    for (var i=0; i<n*3; i++) {
      switch (translationIterator % 3) {
        case 0:
          translation[translationIterator++] = ((i * 50) % 10000) - 5000;
          break;
        case 1:
          translation[translationIterator++] = Math.floor((i / 160) * 50) - 5000;
          break;
        case 2:
          translation[translationIterator++] = 10;
          break;
      }
    }

    geometry.addAttribute( 'translation',
      new THREE.InstancedBufferAttribute( translation, 3, 1 ) );

    geometry.addAttribute( 'textureIndex',
      new THREE.InstancedBufferAttribute( texture, 1, 1 ) );

    var loader = new THREE.TextureLoader();
    var material = new THREE.RawShaderMaterial({
      uniforms: {
        textures: {
          'type': 'tv',
          'value': [
            loader.load('https://s3.amazonaws.com/duhaime/blog/tsne-webgl/assets/cat.jpg'),
            loader.load('https://s3.amazonaws.com/duhaime/blog/tsne-webgl/assets/dog.jpg'),
          ],
        }
      },
      vertexShader: document.getElementById('vertex-shader').textContent,
      fragmentShader: document.getElementById('fragment-shader').textContent,
    });
    var mesh = new THREE.Points(geometry, material);
    mesh.frustumCulled = false; // prevent the mesh from being clipped on drag
    scene.add(mesh);
  }

  /**
  * Render!
  **/

  function render() {
    requestAnimationFrame(render);
    renderer.render(scene, camera);
    controls.update();
  };

  /**
  * Main
  **/

  var scene = getScene();
  var camera = getCamera();
  var renderer = getRenderer();
  var controls = getControls(camera, renderer);
  addPoints(scene);
  render();
<html>
<head>
  <style>
  html, body { width: 100%; height: 100%; background: #000; }
  body { margin: 0; overflow: hidden; }
  canvas { width: 100%; height: 100%; }
  </style>
</head>
<body>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/88/three.min.js'></script>
  <script src='https://rawgit.com/YaleDHLab/pix-plot/master/assets/js/trackball-controls.js'></script>

    <script type='x-shader/x-vertex' id='vertex-shader'>
    /**
    * The vertex shader's main() function must define `gl_Position`,
    * which describes the position of each vertex in screen coordinates.
    *
    * To do so, we can use the following variables defined by Three.js:
    *   attribute vec3 position - stores each vertex's position in world space
    *   attribute vec2 uv - sets each vertex's the texture coordinates
    *   uniform mat4 projectionMatrix - maps camera space into screen space
    *   uniform mat4 modelViewMatrix - combines:
    *     model matrix: maps a point's local coordinate space into world space
    *     view matrix: maps world space into camera space
    *
    * `attributes` can vary from vertex to vertex and are defined as arrays
    *   with length equal to the number of vertices. Each index in the array
    *   is an attribute for the corresponding vertex. Each attribute must
    *   contain n_vertices * n_components, where n_components is the length
    *   of the given datatype (e.g. for a vec2, n_components = 2; for a float,
    *   n_components = 1)
    * `uniforms` are constant across all vertices
    * `varyings` are values passed from the vertex to the fragment shader
    *
    * For the full list of uniforms defined by three, see:
    *   https://threejs.org/docs/#api/renderers/webgl/WebGLProgram
    **/

    // set float precision
    precision mediump float;

    // specify geometry uniforms
    uniform mat4 modelViewMatrix;
    uniform mat4 projectionMatrix;

    // to get the camera attributes:
    uniform vec3 cameraPosition;

    // blueprint attributes
    attribute vec3 position; // sets the blueprint's vertex positions

    // instance attributes
    attribute vec3 translation; // x y translation offsets for an instance
    attribute float textureIndex; // idx of texture in sampler

    // specify the varyings to pass to instances
    varying float vTextureIndex;

    void main() {
      // pass varyings to fragment shader
      vTextureIndex = textureIndex;

      // set point position
      vec3 pos = position + translation;
      vec4 projected = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
      gl_Position = projected;

      // use the delta between the point position and camera position to size point
      float xDelta = pow(projected[0] - cameraPosition[0], 2.0);
      float yDelta = pow(projected[1] - cameraPosition[1], 2.0);
      float zDelta = pow(projected[2] - cameraPosition[2], 2.0);
      float delta  = pow(xDelta + yDelta + zDelta, 0.5);
      gl_PointSize = 50000.0 / delta;
    }
    </script>

    <script type='x-shader/x-fragment' id='fragment-shader'>
    /**
    * The fragment shader's main() function must define `gl_FragColor`,
    * which describes the pixel color of each pixel on the screen.
    *
    * To do so, we can use uniforms passed into the shader and varyings
    * passed from the vertex shader.
    *
    * Attempting to read a varying not generated by the vertex shader will
    * throw a warning but won't prevent shader compiling.
    **/

    precision highp float;

    uniform sampler2D textures[2];

    // declare received varyings
    varying float vTextureIndex; // instance uv offsets

    void main() {
      int texIdx = int(vTextureIndex);
      vec2 uv = vec2(0.0, 0.0) + vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y );
      if (texIdx == 0) {
        gl_FragColor = texture2D(textures[0], uv );
      } else if (texIdx == 1) {
        gl_FragColor = texture2D(textures[1], uv );
      }
    }
    </script>
</body>
</html>


text:
Q: Returning the list in the flutter receiving empty list List<dynamic> allDataList = [];
 Future<void> compareUserBids() async {
final QuerySnapshot snapshot = await Firestore.instance
    .collection("Pro-$productName-$productId")
    .getDocuments();
List<DocumentSnapshot> templist;
templist = snapshot.documents;
allDataList = templist.map((DocumentSnapshot ds) {
  return {ds.documentID: ds.data};
}).toList();
 return allDataList;

}
@override
Widget build(BuildContext context) {
  compareUserBids();
  print(allDataList);
}

When i am tying to print this data it is printing the null values but after hot reload it is printing the values

A: The reason you're getting an empty list is that you've not updated your widget after adding data into your global list.
You should either add the data either inside setState or you can call setState once before returning your list.
 setState((){
   allDataList = templist.map((DocumentSnapshot ds) {
     return {ds.documentID: ds.data};
     },
    ).toList()
   },
 );


text:
Q: Can't set cell title's text I'm writing simple notes app, but when I try to assign title to note.title I got error.
-(Notez*)createNoteWithTitle:(NSString*)titleNote andText:(NSString*)textNote
{
    Notez *newNote  = [Notez new];
    if (!_notesArray) {
        _notesArray = [NSMutableArray new];
    }
    newNote.dateCreated = [NSDate new];
    newNote.title = [NSString stringWithFormat:@"23"];
    newNote.text = [NSString stringWithFormat:@"233"];
    [_notesArray addObject:newNote];
    return newNote;
    }

Notez.h :
     #import
 @interface Notez : NSObject
 @property NSString *text;
 @property NSString *title;
 @property NSDate* dateCreated;
 -(Notez*)createNoteWithTitle:(NSString*)title andText:(NSString*)text;
-(void)save;
+(instancetype)sharedManager;
-(NSArray*)sortedNotes;
-(void)removeNoteAtIndex:(NSUInteger)index;
@end

note.dateCreated is OK, but note.title and note.text isn't.
They are both NSString...
- (IBAction)addNote:(id)sender {
    [[Notez sharedManager] createNoteWithTitle:@"Note Title" andText:@"Note Text"];
}

A: Since you declared title and text as properties, but for some reason get the exception:
[Notez setTitle:]: unrecognized selector sent to instance, apparently
I can only make another guess here. Usually, when declaring a property, you get a setter and a getter method for it. This way you can omit writing these by hand if you have a lot of instance variables on a class.
Using dot notation is then equivalent to calling the setter or the getter. So in your case
newNote.title = [NSString stringWithFormat:@"23"];
is equivalent to:
[newNote setTitle:[NSString stringWithFormat:@"23"]];
Now, the exception that you suggests that the setter method:  setTitle: actually does not exist on your object. I'm not sure what the reason for this might be, but you could try to explicitly synthesize your properties.
Therefor, in your .m-file add the following lines of code:
@synthesize title;
@synthesize text;

Not sure if this will actually solve your issue, but I hope the explanation of properties, getters and setters helps you to understand a little more what's going on.


text:
Q: How to clear an array and reset the values in a for loop while building a Json string? I am looping through each row in an excel sheet using the openpyxl import to ultimately build a large Json string that i can feed to an API.
I am looping through each row and building out my json structure, I need to split a cell value by " || " and then for each value it needs to be added as a nested array inside a json section. I currently am using the following code and my problem is that I build my list object in my for loop and append the json chunk to a larger array and it keeps appending my list values during each loop. So i used the .Clear() method on the list to clear it after each loop...but then when i compile my final output my list is empty. Its like it does not maintain its values when it is added to the list each loop. I am new to Python and gave it a good whirl. Any suggestions in the right direction would be appreciated. Its almost like each loop needs its own unique array to use and keep the values. The tags section of the Json is emptied in the final output for each json line...when it should have the values for each unique iteration in it.
My Data Set (i have 3 rows in excel). You can see that i have values that i want to split in the 7th column. That is the column i am looping through to split the values as they will be nested in my json.
Row 1 (cells) = "ABC","Testing","Testing Again","DATE","DATE",Empty,"A || B || C".
Row 2 (cells) = "ABC 2","Testing 2","Testing Again 2","DATE","DATE",Empty,"X || Y || Z".
Row 3 (cells) = "ABC 3","Testing 3","Testing Again 3","DATE","DATE",Empty,Empty.
My Code.
#from openpyxl import Workbook
import json
from openpyxl import load_workbook

output_table = input_table.copy()

var_path_excel_file = flow_variables['Location']

workbook = load_workbook(filename=var_path_excel_file)
sheet = workbook.active

#create a null value to be used
emptyString = "Null"

#list out all of the sections of the json that we want to print out - these are based on the inputs
jsonFull = []
jsondata = {}
tags = []

for value in sheet.iter_rows(min_row=2,min_col=0,max_col=40,values_only=True):

    #I add my split values to an array so that way when i add the array to the json it will have the proper brackets i need for the API to run correctly
    if value[6] is not None:
        data = value[6].split(" || ")
        for temp in data:
            tags.append(temp)

    #I build out the json structure here that will be added for each excel row basically
    jsondata = {
        "name": value[0],
        "short_description": value[1],
        "long_description": value[2],
        "effective_start_date": value[3],
        "effective_end_date": value[4],
        "workflow_state": emptyString,
        "tags": tags
        }

    #Add the jsondata row to the larger collection
    jsonFull.append(jsondata)
    tags.clear()

print(json.dumps(jsonFull))

And then my desired outcome would be something like this. I just need to figure out the proper syntax for the list handling...and can't seem to find an example to base off of.
[
    {
        "name": "ABC",
        "short_description": "Testing",
        "long_description": "Testing Again",
        "effective_start_date": "2020-03-04T14:45:22Z",
        "effective_end_date": "2020-03-04T14:45:22Z",
        "workflow_state": "Null",
        "tags": [
            "A",
            "B",
            "C"
        ]
    },
    {
        "name": "ABC 2",
        "short_description": "Testing 2",
        "long_description": "Testing Again 2",
        "effective_start_date": "2020-03-04T14:45:22Z",
        "effective_end_date": "2020-03-04T14:45:22Z",
        "workflow_state": "Null",
        "tags": [
            "X",
            "Y",
            "Z"
        ]
    },
    {
        "name": "ABC 3",
        "short_description": "Testing 3",
        "long_description": "Testing Again 3",
        "effective_start_date": "2020-03-04T14:45:22Z",
        "effective_end_date": "2020-03-04T14:45:22Z",
        "workflow_state": "Null",
        "tags": [
        ]
    }
]

A: You're not making a copy of tags when you put it into the dictionary or call tags.clear(), you're just putting a reference to the same list. You need to create a new list at the beginning of each loop iteration, not reuse the same list.
for value in sheet.iter_rows(min_row=2,min_col=0,max_col=40,values_only=True):

    #I add my split values to an array so that way when i add the array to the json it will have the proper brackets i need for the API to run correctly
    if value[6] is not None:
        tags = value[6].split(" || ")
    else:
        tags = []

    #I build out the json structure here that will be added for each excel row basically
    jsondata = {
        "name": value[0],
        "short_description": value[1],
        "long_description": value[2],
        "effective_start_date": value[3],
        "effective_end_date": value[4],
        "workflow_state": emptyString,
        "tags": tags
        }

    #Add the jsondata row to the larger collection
    jsonFull.append(jsondata)


text:
Q: Default Path for Database Location when using Alloy Model? Does anyone know the default Path for database that automatic created by Titanium API, when using Alloy model?
The problem that I try to solve is that I add a new property in the model and when I try to save with Alloy model method. It told me that the table does not have that new column.
If I know the path of the database, in upgrade script I can just alter the table to have a new column.
Thank you so much for your help in advance.

A: I believe the location is the same as the Classic. From the docs:

On iOS, the database file that's created is automatically assigned the .sql extension, while on Android no extension is added.
On iOS 5, database files are stored in the app's Private Documents folder (on device); on iOS 4, it is stored in the Application Support/database folder.
On iOS 5.0.1+, the database will be included in any other user data backed up to iCloud. See below for more info.
On Android, the database is created on the internal storage (you could move it, or use the install procedure to put it on external storage). The standard location on internal storage is /data/data/com.example.yourappid/databases/dbname

Alloy's default database is _alloy_. But you can choose a different one. See here.
Last, I suggest you use Alloy's db migration than writing your own script to handle it. See here.


text:
Q: Filter a property by the value of another property I have two drop down lists. Niether of them have a relation ship with each other. But I need to filter one drop down list based on the chosen value of another drop down list.
I can filter it in code. When I debug I can see the filtered results on the property. However when I run the app, it does not work. Here is my code so far:
    private BindingList<Commodity> _AllocationCommodities;
    [Browsable(false)]
    public BindingList<Commodity> AllocationCommodities
    {
        get
        {
            if (_AllocationCommodities == null)
            {
                _AllocationCommodities = new BindingList<Commodity>();
                ChangeCommodities();
            }
            return _AllocationCommodities;
        }
    }
    private SourceEntity _SourceEntity;
    [ImmediatePostData]
    [Association("SourceEntity-LimitAllocations")]
    [RuleRequiredField("RuleRequiredField_LimitAllocation_SourceEntity", DefaultContexts.Save)]

    public SourceEntity SourceEntity
    {
        get
        {
            return _SourceEntity;
        }
        set
        {

            //New Code
            if (SetPropertyValue<SourceEntity>("SourceEntity", value))
            {
                if (IsSaving || IsLoading) return;
                ChangeCommodities();
            }
        }
    }
    private Commodity _Commodity;// This is the drop down to be filtered
    [ImmediatePostData]
    [DataSourceProperty("AllocationCommodities")] //// This Attribute Should filter Commodities
    [RuleRequiredField("RuleRequiredField_LimitAllocation_Commodity", DefaultContexts.Save)]
    public Commodity Commodity
    {
        get
        {
            return _Commodity;
        }
        set
        {
            SetPropertyValue("Commodity", ref _Commodity, value);
            if (Commodity.Oid != Guid.Empty)
                AllocationVolumeUnits.Reload();
        }
    }
    private void ChangeCommodities()
    {
        if (!this.IsLoading && _SourceEntity != null)
        {
            _AllocationCommodities.RaiseListChangedEvents = false;
            _AllocationCommodities.Clear();
            OperandValue[] _params;
            System.Collections.Generic.List<CMSBOD.SourceCommodity> _sc = new System.Collections.Generic.List<SourceCommodity>();

            BindingList<Commodity> _Commodities = new BindingList<Commodity>();

            foreach (SourceCommodityEntity _tempSCE in _SourceEntity.SourceCommodityEntities)
            {
                if (_tempSCE.SourceCommodity != null)
                    _sc.Add(_tempSCE.SourceCommodity);
            }
            foreach (SourceCommodity _tempSC in _sc)
            {
                if (_tempSC.Commodity != null && !_Commodities.Contains<Commodity>(_tempSC.Commodity) && _tempSC.Commodity.IsActive)
                    _Commodities.Add(_tempSC.Commodity);
            }
            _AllocationCommodities.RaiseListChangedEvents = true;
            _AllocationCommodities = _Commodities;///This is where I can see the filtered list when debugging.

        }
    }

A: You can find a DataSourceCriteria useful in this scenario, instead of DataSourceProperty.
Assuming you have collection properties that associates Commodity back to SourceCommodityEntity, you can use this criteria:
[DataSourceCriteria("IsActive And SourceCommodities[SourceCommodityEntities[SourceEntity = '@SourceEntity'] ]")]
Even if its designed to be a 1x1 assocation, you can find that associations can be useful for filtering purposes.


text:
Q: Haskell type mismatch Int and [Int] I'm a beginner to Haskell. I'm trying to create a function which has two parameters: a character and a string.
This function is supposed to go through the string and check if the character given is in the string, and then return a list of integers representing the position of the characters in the string.
My code is:
tegnPose :: Char -> String -> [Int]
tegnPose c [] = []
tegnPose c (x:xs) = [if not (xs !! a == c)
 then [a] ++ tegnPose c xs
 else tegnPose c xs |a <- [0.. length xs - 1]]

Which is a recursive function with list comprehension.
The error I get:
Uke4.hs:14:7: error:
    * Couldn't match expected type `Int' with actual type `[Int]'
    * In the expression: [a] ++ tegnPose c xs
      In the expression:
        if not (xs !! a == c) then [a] ++ tegnPose c xs else tegnPose c xs
      In the expression:
        [if not (xs !! a == c) then
             [a] ++ tegnPose c xs
         else
             tegnPose c xs |
           a <- [0 .. length xs - 1]]
   |
14 |  then [a] ++ tegnPose c xs
   |       ^^^^^^^^^^^^^^^^^^^^

Uke4.hs:15:7: error:
    * Couldn't match expected type `Int' with actual type `[Int]'
    * In the expression: tegnPose c xs
      In the expression:
        if not (xs !! a == c) then [a] ++ tegnPose c xs else tegnPose c xs
      In the expression:
        [if not (xs !! a == c) then
             [a] ++ tegnPose c xs
         else
             tegnPose c xs |
           a <- [0 .. length xs - 1]]
   |
15 |  else tegnPose c xs |a <- [0.. length xs - 1]]

I don't understand how the mismatch happens, as the recursive function should just run through.

A: Here's why the mismatch happens.  First, note that a list comprehension that returns a list of type [a] must generate elements of type a, so you need the following to match:
example :: [Int]

--  .-- the final value is "[Int]"
--  |
example = [ 2+x*y | x <- [1..10], y <- [1..5], x < y]
--          ^^^^^
--            |
--            `- therefore, this must be "Int"

In your example, the type signature for tegnPose implies that the list comprehension must return an [Int], but the expression generating list elements, namely:
if ... then [a] ++ tegnPose c xs else tegnPose c cx

is clearly not returning a plain Int the way it's supposed to.
The first error message is indicating that actual type of the subexpression [a] ++ tegnPos c xs which is [Int] does not match the expected type of the result of the entire if .. then .. else expression which should have type Int.
If I understand your question correctly (i.e., return a list of the integer positions of each occurrence of a character in a string so that tegnPose 'a' "abracadabra" returns [0,3,5,7,10], then you should either use recursion or a list comprehension, but not both.
Note that the non-recursive list comprehension:
tegnPose c xs = [a | a <- [0..length xs - 1]

almost does what you want.  All that's missing is testing the condition to see if the character at position a is a c.  If you don't know about using "guards" in list comprehensions, go look it up.
Alternatively, the recursive function without a list comprehension:
tegnPose c (x:xs) = if (x == c) then ??? : tegnPose c xs
                                else tegnPose c xs
tegnPose _ [] = []

also almost does what you want, except it's not obvious what to put in place of ??? to return a number indicating the current position.  If you write a recursive version with an extra parameter:
tp n c (x:xs) = if (x == c) then n : tp (???) c xs
                            else tp (???) c xs
tp _ _ [] = []

with the idea that you could define:
tegnPose c xs = tp 0 c xs

then you'd be closer, if only you could figure out what new value for n should go in place of the ???.
More standard Haskell solutions might involve things like zips:
> zip [0..] "abracadabra"
[(0,'a'),(1,'b'),(2,'r'),...]

and filters:
> filter (\(i,c) -> c == 'a') $ zip [0..] "abracadabra"
[(0,'a'),(3,'a'),...]

and maps:
> map fst $ filter (\(i,c) -> c == 'a') $ zip [0..] "abracadabra"
[0,3,5,7,10]

or looking in Data.List for a function that does what you want:
> elemIndices 'a' "abracadabra"
[0,3,5,7,10]

A: Just for some variety a simpler way of implementing this functionality with a single foldr could be;
import Data.Bool (bool)
charIndices :: Char -> String -> [Int]
charIndices c = foldr (\t r -> bool r (fst t : r) (snd t == c)) [] . zip [0..]

*Main> charIndices 't' "tektronix test and measurement instruments"
[0,3,10,13,29,34,40]

Explanation:
Type of foldr is Foldable t => (a -> b -> b) -> b -> t a -> b
It takes three parameters;

*

*A function which accepts two parameters

*An initial value of type b

*A traversable data type which hold values of type a
an returns a single value of type b.
In this particular case our type a value is Char type, which makes t a a String type (due to type signature) and type b value is a list of integers [Int].
The provided function as the first parameter is (\t r -> bool r (fst t : r) (snd t == c)) which is very simple if you check Data.bool. bool is a ternary operator of type a -> a -> Bool -> a which takes three arguments. In order they are negative result, positive result and condition. (negative is on the left as usual in Haskell). It checks if the current character is equal to our target character c, if so it returns fst t : r if not r (r means result). And finally t is the current tuple of the fed tuples list. The tuples list is constructed by zip [0..] s where s is not shown in the function definition due to partial application.


text:
Q: How does Airflow parse and store schedule_interval I am working on a feature that requires schedule_intervals of Airflow jobs. Instead of writing the code to parse cron expressions in the DAG files myself, I have been trying to find parsed schedule_interval values in Airflow metadata DB, but to no avail.
Can someone give me a pointer to how Airflow parses schedule_interval expressions (e.g. a file at https://github.com/apache/incubator-airflow), and where it stores the parsed values (if the values are stored)?
Edit:

*

*The schedule_interval expression above is the DAG argument schedule_interval, as in:

dag = DAG(
     'tutorial', default_args=default_args, schedule_interval='@daily')

According to this documentation page, schedule_interval can be a cron expression, a datetime.timedelta object, or one of the 'presets' like '@daily'. Because schedule_interval can take multiple forms, I don't want to re-invent the wheel and write code to parse schedule_interval arguments, if Airflow has already parsed and stored these values.

*I am building a system to periodically check all Airflow jobs and summarize their status, through querying the Airflow metadata db. Although not absolutely necessary, it would be useful to know schedule_interval, because it reveals information such as for each Airflow job, how many dag runs are expected in the last 24 hours, and when the next dag run would be.

A: The schedule_interval value isn't stored anywhere but the process itself. Airflow determines when it's time to create a new run by checking, more or less, NOW() >= (MAX(execution_date, start_date)) + schedule_interval
You can programmatically calculate Airflow's execution_date values with the airflow.models.DAG.following_schedule and airflow.models.DAG.previous_schedule methods if you'd like.
Note: Airflow uses the croniter package to calculate off cron values.

A: I couldn't manage to find where Airflow store parsed value of schedule_interval, however I did find the code that parses schedule_interval expressions. It's in the utils module (https://github.com/apache/incubator-airflow/blob/master/airflow/utils/dates.py).