text:
Q: How do I configure a many-to-one and one-to-many relationship in spring? Hibernate keeps call the same query infinitely I have been reading through some older posts related to this issue and none of the proposed solutions have worked for me. Whever I try to make the call i get a stack overflow error.
Does anyone know how to resolve this?
I have a set up like this:
public class SchoolDistrict implements Serializable {
    @OneToMany(mappedBy="schoolDistrict", cascade = CascadeType.ALL, orphanRemoval = true)
    @JsonIgnore
    //@JsonManagedReference
    private List<SchoolDistrictSvc> schoolDistrictSvc;
    ...
    //getters and setters
}

public class SchoolDistrictSvc implements Serializable {
    @ManyToOne
    @JoinColumn(name = "SCHOOL_DISTRICT_ID", referencedColumnName = "SCHOOL_DISTRICT_ID", insertable=false, updatable=false)
    @JsonIgnore
    //@JsonBackReference
    private SchoolDistrict schoolDistrict;

    ...
    //getters setters
}

The sql queries produced by hibernate are all the same using the same value for the ?.
Stacktrace:
Hibernate: select schooldist0_.school_district_id as school_district_id1_19_1_, schooldist0_.city as city2_19_1_, schooldist0_.create_timestamp as create_timestamp3_19_1_, schooldist0_.created_by_id as created_by_id4_19_1_, schooldist0_.created_by_name as created_by_name5_19_1_, schooldist0_.date_display_type as date_display_type6_19_1_, schooldist0_.first_view_customer as first_view_custome7_19_1_, schooldist0_.fv_streets_customer as fv_streets_custome8_19_1_, schooldist0_.fv_student_customer as fv_student_custome9_19_1_, schooldist0_.jde_number as jde_number10_19_1_, schooldist0_.last_updated_by_id as last_updated_by_i11_19_1_, schooldist0_.last_updated_by_name as last_updated_by_n12_19_1_, schooldist0_.last_updated_timestamp as last_updated_time13_19_1_, schooldist0_.postal_code as postal_code14_19_1_, schooldist0_.route_management_type as route_management_15_19_1_, schooldist0_.school_calendar_enabled as school_calendar_e16_19_1_, schooldist0_.school_district_code as school_district_c17_19_1_, schooldist0_.school_district_name as school_district_n18_19_1_, schooldist0_.state as state19_19_1_, schooldist0_.state_plane_coordinate_project as state_plane_coord20_19_1_, schooldist0_.state_plane_coordinate_trans as state_plane_coord21_19_1_, schooldist0_.status as status22_19_1_, schooldist0_.unit_of_measure as unit_of_measure23_19_1_, schooldist1_.school_district_id as school_district_id1_22_3_, schooldist1_.business_unit_id as business_unit_id2_22_3_, schooldist1_.created_by_id as created_by_id3_22_3_, schooldist1_.create_timestamp as create_timestamp4_22_3_, schooldist1_.school_district_id as school_district_id1_22_0_, schooldist1_.business_unit_id as business_unit_id2_22_0_, schooldist1_.created_by_id as created_by_id3_22_0_, schooldist1_.create_timestamp as create_timestamp4_22_0_ from school_district schooldist0_ left outer join school_district_service schooldist1_ on schooldist0_.school_district_id=schooldist1_.school_district_id where schooldist0_.school_district_id=?
Hibernate: select schooldist0_.school_district_id as school_district_id1_19_1_, schooldist0_.city as city2_19_1_, schooldist0_.create_timestamp as create_timestamp3_19_1_, schooldist0_.created_by_id as created_by_id4_19_1_, schooldist0_.created_by_name as created_by_name5_19_1_, schooldist0_.date_display_type as date_display_type6_19_1_, schooldist0_.first_view_customer as first_view_custome7_19_1_, schooldist0_.fv_streets_customer as fv_streets_custome8_19_1_, schooldist0_.fv_student_customer as fv_student_custome9_19_1_, schooldist0_.jde_number as jde_number10_19_1_, schooldist0_.last_updated_by_id as last_updated_by_i11_19_1_, schooldist0_.last_updated_by_name as last_updated_by_n12_19_1_, schooldist0_.last_updated_timestamp as last_updated_time13_19_1_, schooldist0_.postal_code as postal_code14_19_1_, schooldist0_.route_management_type as route_management_15_19_1_, schooldist0_.school_calendar_enabled as school_calendar_e16_19_1_, schooldist0_.school_district_code as school_district_c17_19_1_, schooldist0_.school_district_name as school_district_n18_19_1_, schooldist0_.state as state19_19_1_, schooldist0_.state_plane_coordinate_project as state_plane_coord20_19_1_, schooldist0_.state_plane_coordinate_trans as state_plane_coord21_19_1_, schooldist0_.status as status22_19_1_, schooldist0_.unit_of_measure as unit_of_measure23_19_1_, schooldist1_.school_district_id as school_district_id1_22_3_, schooldist1_.business_unit_id as business_unit_id2_22_3_, schooldist1_.created_by_id as created_by_id3_22_3_, schooldist1_.create_timestamp as create_timestamp4_22_3_, schooldist1_.school_district_id as school_district_id1_22_0_, schooldist1_.business_unit_id as business_unit_id2_22_0_, schooldist1_.created_by_id as created_by_id3_22_0_, schooldist1_.create_timestamp as create_timestamp4_22_0_ from school_district schooldist0_ left outer join school_district_service schooldist1_ on schooldist0_.school_district_id=schooldist1_.school_district_id where schooldist0_.school_district_id=?
Hibernate: select schooldist0_.school_district_id as school_district_id1_19_1_, schooldist0_.city as city2_19_1_, schooldist0_.create_timestamp as create_timestamp3_19_1_, schooldist0_.created_by_id as created_by_id4_19_1_, schooldist0_.created_by_name as created_by_name5_19_1_, schooldist0_.date_display_type as date_display_type6_19_1_, schooldist0_.first_view_customer as first_view_custome7_19_1_, schooldist0_.fv_streets_customer as fv_streets_custome8_19_1_, schooldist0_.fv_student_customer as fv_student_custome9_19_1_, schooldist0_.jde_number as jde_number10_19_1_, schooldist0_.last_updated_by_id as last_updated_by_i11_19_1_, schooldist0_.last_updated_by_name as last_updated_by_n12_19_1_, schooldist0_.last_updated_timestamp as last_updated_time13_19_1_, schooldist0_.postal_code as postal_code14_19_1_, schooldist0_.route_management_type as route_management_15_19_1_, schooldist0_.school_calendar_enabled as school_calendar_e16_19_1_, schooldist0_.school_district_code as school_district_c17_19_1_, schooldist0_.school_district_name as school_district_n18_19_1_, schooldist0_.state as state19_19_1_, schooldist0_.state_plane_coordinate_project as state_plane_coord20_19_1_, schooldist0_.state_plane_coordinate_trans as state_plane_coord21_19_1_, schooldist0_.status as status22_19_1_, schooldist0_.unit_of_measure as unit_of_measure23_19_1_, schooldist1_.school_district_id as school_district_id1_22_3_, schooldist1_.business_unit_id as business_unit_id2_22_3_, schooldist1_.created_by_id as created_by_id3_22_3_, schooldist1_.create_timestamp as create_timestamp4_22_3_, schooldist1_.school_district_id as school_district_id1_22_0_, schooldist1_.business_unit_id as business_unit_id2_22_0_, schooldist1_.created_by_id as created_by_id3_22_0_, schooldist1_.create_timestamp as create_timestamp4_22_0_ from school_district schooldist0_ left outer join school_district_service schooldist1_ on schooldist0_.school_district_id=schooldist1_.school_district_id where schooldist0_.school_district_id=?
2019-10-24 14:45:13.110 ERROR 8404 --- [nio-8081-exec-1] o.s.t.i.TransactionInterceptor           : Application exception overridden by rollback exception

java.lang.StackOverflowError: null
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:774) ~[ojdbc7-12.1.0.jar:12.1.0.2.0]
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:925) ~[ojdbc7-12.1.0.jar:12.1.0.2.0]
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1111) ~[ojdbc7-12.1.0.jar:12.1.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4798) ~[ojdbc7-12.1.0.jar:12.1.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:4845) ~[ojdbc7-12.1.0.jar:12.1.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1501) ~[ojdbc7-12.1.0.jar:12.1.0.2.0]
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-3.2.0.jar:na]
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-3.2.0.jar:na]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
    at org.hibernate.loader.Loader.getResultSet(Loader.java:2167) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1930) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1892) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
    at org.hibernate.loader.Loader.doQuery(Loader.java:937) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:340) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:310) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]

    //skipped some lines is stack trace

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_171]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_171]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_171]

A: I don't know if this could be causing your problem, but you should be using a lazy load on the many side of your mapping.
@ManyToOne(fetch = FetchType.LAZY)
Also, if your query is going to be one-directional all the time, you should implement this as a one-directional relationship.  Check out the Unidirectional @OneToMany on this site.


text:
Q: R Data Frame Filter Not Working I am trying to filter the output from RNA-seq data analysis. I want to generate a list of genes that fit the specified criteria in at least one experimental condition (dataframe).
For example, the data is output as a .csv, so I read in the whole directory, as follows.
readList = list.files("~/Path/To/File/", pattern = "*.csv")
files = lapply(readList, read.csv, row.names = 1)
#row.names = 1 sets rownames as gene names

This reads in 3 .csv files, A, B and C. The data look like this
A = files[[1]]
B = files[[2]]
C = files[[3]]
head(A)
            logFC    logCPM       LR            PValue           FDR
YER037W -1.943616  6.294092 34.30835 0.000000004703583 0.00002276064
YJL184W -1.771273  5.840774 31.97088 0.000000015650144 0.00003786552
YFR053C  1.990102 10.107793 30.55576 0.000000032440747 0.00005232692
YDR342C  2.096877  6.534761 28.08635 0.000000116021451 0.00014035695
YGL062W  1.649138  8.940714 23.32097 0.000001370968319 0.00132682314
YFR044C  1.992810  9.302504 22.91553 0.000001692786468 0.00132736130

I then try to filter all of these to generate a list of genes (rownames) where two conditions must be met in at least one dataset.
1.logFC > 1 or < -1
2.FDR < 0.05
So I loop through the dataframes like so
genesKeep = ""
for (i in 1:length(files) {
F = data.frame(files[i])
sigGenes = rownames(F[F$FDR<0.05 & abs(F$logFC>1), ])
genesKeep = append(genesKeep, values = sigGenes)

}
This gives me a list of genes, however, when I sanity check these against the data some of the genes listed do not pass these thresholds, whilst other genes that do pass these thresholds are not present in the list.
e.g.
df = cbind(A,B,C)
genesKeep = unique(genesKeep)
logicTest = rownames(df) %in% genesKeep
dfLogic = cbind(df, logicTest)

whilst the majority of genes do infact pass the criteria I set, I see some discrepancies for a few genes. For example
          A.logFC    A.FDR     B.logFC    B.FDR     C.logFC    C.FDR   logicTest
YGR181W -0.8050325 0.1462688 -0.6834184 0.2162317 -1.1923744 0.04049870 FALSE
YOR185C  0.8321432 0.1462919  0.7401477 0.2191413 -0.9616989 0.04098177 TRUE

The first gene (YGR181W) passes the criteria in condition C, where logFC < -1 and FDR < 0.05. However, the gene is not reported in the genesKeep list.
Conversely, the second gene (YOR185C) does not pass these criteria in any condition, but the gene is present in the genesKeep list.
I'm unsure where I'm going wrong here, but if anyone has any ideas they would be much appreciated.
Thanks.

A: Using merge as suggested by akash87 solved the problem.
Turns out cbind was causing the rownames to not be assigned correctly.

A: I'm not exactly sure what your desired output is here, but it might be possible to simplify a bit and use the dplyr library to filter all your outputs at once, assuming the format of your data is consistent. Using some modified versions of your data as an example:
A <- structure(list(gene = structure(c(2L, 6L, 4L, 1L, 5L, 3L), .Label = c("YDR342C",
"YER037W", "YFR044C", "YFR053C", "YGL062W", "YJL184W"), class = "factor"),
    logFC = c(-1.943616, -1.771273, 0, 2.096877, 1.649138, 1.99281
    ), logCPM = c(6.294092, 5.840774, 10.107793, 6.534761, 8.940714,
    9.302504), LR = c(34.30835, 31.97088, 30.55576, 28.08635,
    23.32097, 22.91553), PValue = c(4.703583e-09, 1.5650144e-08,
    3.2440747e-08, 1.16021451e-07, 1.370968319e-06, 1.692786468e-06
    ), FDR = c(2.276064e-05, 3.786552e-05, 5.232692e-05, 0.00014035695,
    0.00132682314, 0.06)), .Names = c("gene", "logFC", "logCPM",
"LR", "PValue", "FDR"), class = "data.frame", row.names = c(NA,
-6L))

B <- structure(list(gene = structure(c(2L, 6L, 4L, 1L, 5L, 3L), .Label = c("YDR342C",
"YER037W", "YFR044C", "YFR053C", "YGL062W", "YJL184W"), class = "factor"),
    logFC = c(-0.4, -0.3, 0, 2.096877, 1.649138, 1.99281), logCPM = c(6.294092,
    5.840774, 10.107793, 6.534761, 8.940714, 9.302504), LR = c(34.30835,
    31.97088, 30.55576, 28.08635, 23.32097, 22.91553), PValue = c(4.703583e-09,
    1.5650144e-08, 3.2440747e-08, 1.16021451e-07, 1.370968319e-06,
    1.692786468e-06), FDR = c(2.276064e-05, 3.786552e-05, 5.232692e-05,
    0.00014035695, 0.1, 0.06)), .Names = c("gene", "logFC", "logCPM",
"LR", "PValue", "FDR"), class = "data.frame", row.names = c(NA,
-6L))

Use rbind to create a single dataframe to work with:
AB<- rbind(A,B)

Then filter this whole thing based on your criteria. Note that duplicates can occur, so you can use distinct to only return unique genes that qualify:
filter(AB, logFC < -1 | logFC > 1, FDR < 0.05) %>%
  distinct(gene)

     gene
1 YER037W
2 YJL184W
3 YDR342C
4 YGL062W

Or, to keep all the rows for those genes as well:
filter(AB, logFC < -1 | logFC > 1, FDR < 0.05) %>%
  distinct(gene, .keep_all = TRUE)

     gene     logFC   logCPM       LR       PValue          FDR
1 YER037W -1.943616 6.294092 34.30835 4.703583e-09 2.276064e-05
2 YJL184W -1.771273 5.840774 31.97088 1.565014e-08 3.786552e-05
3 YDR342C  2.096877 6.534761 28.08635 1.160215e-07 1.403570e-04
4 YGL062W  1.649138 8.940714 23.32097 1.370968e-06 1.326823e-03

redpajama_set_name: RedPajamaStackExchange


text:
Q: iPhone app: play video in small view only In my iPhone App I want to play video in a small view.
Video should start playing automatically, and the buttons for play pause and full screen should be hidden.

How can I achieve that?

A: What you would do is manually set the frame for MPMoviePlayerController's view, and set the control style to MPMovieControlStyleNone. Much like this below..
....
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]];
[player setControlStyle:MPMovieControlStyleNone];

//this is where you create your `embedded` view size
player.view.frame = CGRectMake(0, 0, 200, 300);

[self.view addSubview:player.view];
....

A:     MPMoviePlayerController *player = [[MPMoviePlayerController alloc] init];
[player prepareToPlay];
player.shouldAutoplay = NO;
player.allowsAirPlay = YES;
player.scalingMode = MPMovieScalingModeAspectFit;
[player.view setFrame:CGRectMake(0,0,300,320)];
[viewPlayer addSubview:player.view];

    self.moviePlayer = player;//declare MPMoviePlayerController class object globaly for play and push the vedio if you want to add this functionality

hope,this help you....
:)


text:
Q: Access response data in JSONP request I have a SAP Gateway OData-Service and a local Tomcat Apache Server. My SAPUI5 Client is deployed in the Tomcat and requests a OData-Webservice from the SAP Gateway remote server. In fact there is a cross origin domain error. So I set the header "Access-Control-Allow-Origin" in my OData-Webservice and my SAPUI5 client requests with JSONP, but I will get an error because the SAP Gateway can't handle with JSONP responses.
My code:

The error: "Uncaught SyntaxError: Unexpected token :"
The error depends on the incompatibility of the SAP Gateway to JSONP.
If I look in the network requests I will find this one:

It is the JSON (not JSONP) response from the webservice.
So my question. Is there a possibility to access to this response?
I tried to access via a lot of callbacks like success, error, fail, done, always, complete, and so on. But no chance...
thanks and best regards

A: $.ajax({
   type: 'GET',
    url: url,
    async: false,
    jsonpCallback: 'jsonCallback',
    contentType: "application/json",
    dataType: 'jsonp',
    success: function(response) {
       //this is where you'll get data/response
       console.log(response) ;
   },
    error: function(e) {
       console.log(e.message);
    }
});

Update:
Problem is with your context.. there is some value like _1453458442107=:1

Check that and encode it.

A: If you set the CORS header "Access-Control-Allow-Origin" in the odata responses you should be able to access the service with regular JSON (without the P).
JSONP is a workaround to circumvent the same origin policy when the CORS-Headers are not available.
If your odata service uses authentification it might be necessary to set some more CORS headers to get it working.
On MDN you can read more about CORS and its headers.
On Wikipedia is a chapter about CORS vs JSONP.
So have you tried something like the following?
$.get({
    url:"https://.../sap/opu/odata/sap/ZMOBILAD_SRV/UsernameSet?$format=json",
    context: document.body,
    cache: false
    }).done(function(){
        console.log(this);
    });


text:
Q: Time limit for progress dialogue in android How can I set time limit for ProgressDialog in android application.Can anybody help me for this

A: pass the Dialog object and time to this method
public void timerDelayRemoveDialog(long time, final Dialog d){
    Handler handler = new Handler();
    handler.postDelayed(new Runnable() {
        public void run() {
            d.dismiss();
        }
    }, time);
}

A: You can use android timer ,below for the demo i have it wait for 5seconds.
Hope it answers. Do let me know of any more query.
Timer timer;// Declare it above
     timer = new Timer();//Initialized
                    timer.schedule(new TimerTask() {
                        @Override
                        public void run() {

    // cancel the progress dialogue after 5 seconds
                            progress.cancel();
                            timer.cancel();
                        }
                    }, 5000 ,5000);


text:
Q: Passing Object from a screen to another one | React-Native I want to pass my data: Info from the screen WebServiceUse.js to Cellz.js.
I don't know how to do it, I can pass one value but not all the data..
Here's the code:
WebServiceUse.js:
export default class WebServiceUse extends Component {
    constructor(props) {
        super(props);
        this.state = ({
            Info: [],
            isLoading: true,
            Info1: [],
        })
    }

    componentDidMount() {
        fetch('https://*****', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({ id: '1' })
        }).then((response) => response.json()).then((responseJson) => {
            this.setState({
                Info: responseJson.ed5aaf3d933385698d872d0a0d5d4f36,
                isLoading: false,
                Info1: this.Info,
            });
        }).catch((error) => {
            //console.error(error);
            alert(error);
            this.props.navigation.navigate('ScreenTwo');

        });
    }

    render() {
        return (
            <View style={styles.container}>
                {this.state.isLoading &&
                    <View>
                        <ActivityIndicator color="red" size='large' animating={this.state.isLoading} />
                    </View>
                }
                <ScrollView style={styles.welcome}>
                    {
                        this.state.Info.map((item) => {
                            return (
                                <TouchableOpacity onPress={ () => (this.props.navigation.navigate('ScreenSix', {Info: item.id}))}>
                                    <Text>{item.id}</Text>
                                    <Text>{item.date}</Text>
                                    <Text>{item.interlocuteur}</Text>
                                    <View style={styles.Separator} />
                                </TouchableOpacity>
                            )
                        })
                    }
                </ScrollView>
            </View>
        );
    }
}

Cellz.js:
export default class Cellz extends Component {

    constructor(props) {
        super(props);}

    render() {
        return (
            <View flexDirection='column' style={styles.container}>
                <View flexDirection='row' style={styles.welcome}>
                    <Text>ID:   </Text>
                    <Text>{this.props.navigation.state.params.Info}</Text>
                </View>
                <View flexDirection='row' style={styles.welcome}>
                    <Text>Ticket ID:    </Text>
                    <Text>{this.props.navigation.state.params.Info}</Text>
                </View>
            </View>

        );
    }
}

What should I do to pass all the Data Info ?

A: You can pass the object if you want to,
Currently you are doing the following, which only passes the item.id
<TouchableOpacity onPress={ () => (this.props.navigation.navigate('ScreenSix', {Info: item.id}))}>

You can pass the item object if you wanted, or any other object in the following way
<TouchableOpacity onPress={ () => (this.props.navigation.navigate('ScreenSix', {Info: item.id, item: item}))}>

Then in your Cellz.js
You could get it like this
render() {
  const item = this.props.navigation.getParam('item');

  return (
    ...
  );
}

Check out the documentation for more about it.


text:
Q: How do I interpret logistic regression output for categorical variables when two categories are missing? I am using binary logistic regression; the dependent variable is 1 or 0; the independent variables are two groups: the first group includes continuous variables (LNTA: logarthim of total assets, ROA: return on assets, and Leverage; the second group includes categorical variables (Type of auditor: 1 or 0, Industry sector: 1,2,3, and 4, country: 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10), and finally region: 1 or 2. The problem is that when I put all these independent variables together, I get results only for 8 countries not for 9 countries. I know that I have 10 countries and in the results table only 9 countries will appear as the country number 10 is reference category; but this case is different because both countries 9 and 10 are not included in the table.

A: This was going to be a comment asking for clarification, but I wanted to give a screenshot.
A quick question (which you might already know the answer to) -- do you have missing data from any of your variables? I'd suspect the most likely culprit is that you have at least one missing datapoint for all of the observations from "Country 9" and hence all of the Country 9 observations are excluded from analysis?
Running Logistic Regression in SPSS should start off with a "Case Processing Summary" table that will answer this for you. Here's an example from a dataset with no missing variables (I just blanked out the raw data filename).

EDIT: Example two, parameter specification. Just in case!
Another issue with SPSS is that the "Parameter Coding" doesn't necessarily correspond to your original values.
e.g. in the "Variables in the Equation" table, Country(7) doesn't necessarily mean the Country with the numerical value of 7, but rather the seventh parameter associated with the Country factor. You should check the "Categorical Variables Codings" table to make sure that all nine countries are showing up in that list.
In the example figure below, I mocked up a dataset with five countries and two regions. All values of the outcome for country 3 were set to missing (but all values of Region were complete). Country 3 is skipped from the parameter coding -- but you'll see that Country(3) [the third column of coding for the Country factor] actually pertains to Country==4 in the dataset.


text:
Q: Upload document from Local Machine to SharePoint 2013 Library using WebService I have following code from http://ktskumar.wordpress.com/2009/03/03/upload-document-from-local-machine-to-sharepoint-library/ to upload a document to a sharepoint library using web services. I have added https://mysite.sharepoint.com/_vti_bin/Copy.asmx (this site is on sharepoint Online) as my service reference.
     //Copy WebService Settings
        string webUrl = "https://mySite.sharepoint.com";

        WSCopy.Copy copyService = new WSCopy.Copy();

        copyService.Url = webUrl + "/_vti_bin/copy.asmx";
        copyService.Credentials = System.Net.CredentialCache.DefaultCredentials;

        //Source and Destination Document URLs
        string sourceUrl = "http://localhost/Shared Documents/Sample.doc";
        string destinationUrl = "E:\\DocumentsSample.doc";

        //Variables for Reading metadata's of a document
        WSCopy.FieldInformation fieldInfo = new WSCopy.FieldInformation();
        WSCopy.FieldInformation[] fieldInfoArray = { fieldInfo };
        WSCopy.CopyResult cResult1 = new WSCopy.CopyResult();
        WSCopy.CopyResult cResult2 = new WSCopy.CopyResult();
        WSCopy.CopyResult[] cResultArray = { cResult1, cResult2 };

        //Receive a Document Contents  into Byte array (filecontents)
        byte[] fileContents = new Byte[4096];
        uint copyresult = copyService.GetItem(sourceUrl, out fieldInfoArray, out fileContents);

        if (copyresult == 0)
        {
            Console.WriteLine("Document downloaded Successfully, and now it's getting saved in location " + destinationUrl);

            //Create a new file and write contents to that document
            FileStream fStream = new FileStream(destinationUrl, FileMode.Create, FileAccess.ReadWrite);
            fStream.Write(fileContents, 0, fileContents.Length);
            fStream.Close();

        }
        else
        {
            Console.WriteLine("Document Downloading gets failed...");
        }

        Console.Write("Press any key to exit...");
        Console.Read();

here WSCopy is the service reference and 'WSCopy.Copy' copy class is not found on my project. How can i resolve this  or is there another way to achive my goal.

A: Refer to this post
http://www.ktskumar.com/blog/2009/03/upload-document-from-local-machine-to-sharepoint-library/
You have to add the web service url in Web Reference, instead of Service Reference.
On Visual Studio Project, Right click the References, and select the Add Service Reference.
On Add Service Reference popup, click the Advanced button on bottom of the box,
Now the Service Reference Settings popup will open, there we have to click the "Add Web Reference" botton. Then give the Web Service url and click the "Add Reference" button to include webservice url to the project.


text:
Q: Rails, trying run assets:precompile return "has already been required" The first time I moved my application to production I found a few problems. I found that I should use precompiled assets in production, so I tried to compile them, but got this error:
rake aborted!
/var/www/tracker/app/assets/templates/snippets/comment.html.erb has already been required
  (in /var/www/tracker/app/assets/javascripts/angularjs/routes.coffee.erb)

The most confusing thing here is that file comment.html.erb is in no way mentioned in routes.coffee.erb, which simply contains a few routes for angularjs:
angular.module('app', ['ui', 'app.services', 'app.directives', 'app.filters', 'ngCookies', 'ngSanitize', 'mwTable'])
  .config ['$routeProvider', ($routeProvider) ->

    $routeProvider.when '/',
      templateUrl: '<%= asset_path('announces/list.html') %>'
      controller: AnnouncesListCtrl

    $routeProvider.when '/announce/:fid',
      templateUrl: '<%= asset_path('announces/view.html') %>'
      controller: AnnouncesViewCtrl

    $routeProvider.when '/announce/:fid/edit',
      templateUrl: '<%= asset_path('announces/edit.html') %>'
      controller: AnnouncesEditCtrl

    $routeProvider.when '/registration',
      templateUrl: '<%= asset_path('users/edit.html') %>'
      controller: UsersEditCtrl

    $routeProvider.when '/registration_successful',
      templateUrl: '<%= asset_path('users/registration_successful.html') %>'
      controller: UsersEditCtrl

    $routeProvider.when '/users',
      templateUrl: '<%= asset_path('users/list.html') %>'
      controller: UsersListCtrl

    $routeProvider.otherwise({redirectTo: '/'})

  ]

The only thing I can think of is that I used <%= asset_path('announces/view.html') %>, which in turn contains <%= asset_path('snippets/comment.html')%>. If this causes the problem than the only solution that comes in mind is not to use asset_path. But is that ok to do?
Full error message is here: https://gist.github.com/SET/5167092. Despite its size, it's 99% useless.
Also, since I'm new to Rails (came from PHP), I can't understand why is it so critical that something is already required? You require it a few times but load it only once; why would this cause problems?
UPDATE:
I solved problem with replacing <%= asset_path(template) %>` to '/assets/template' but isn't it an ugly solution?


text:
Q: How to install Flask-SQLAlchemy from PyCharm terminal? I am using PyCharm with Python 3.8 and Flask. I downloaded Flask-SQLAlchemy on PyCharm terminal:
pip install  flask_sqlalchemy

Event log said installation successful. But when I write:
from flask_sqlalchemy import SQLAlchemy

It reports:

unresolved reference flask_sqlalchemy

How to solve this?
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime

main = Flask(__name__)
main.config['SQlALCHEMY_DATABASE_URI'] = 'sqlite:///blog.db'
db = SQLAlchemy(main)

class Article(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(100), nullable=False)
    intro = db.Column(db.String(300), nullable=False)
    text = db.Column(db.Text, nullable=False)
    date = db.Column(db.DateTime, default=datetime.utcnow)

    def __repr__(self):
        return '<Article %r>' % self.id


text:
Q: Calculate Great Circle Distance between two point layers via way point I need to create three distance matrices for around 550 points spread throughout Africa, Europe and Asia. The first matrix represents great circle distances, the second is the shortest distance along a network of trade routes, and the third is the shortest great circle distance via a way point.
I've completed the first two and was wondering if anyone knew of a method in ArcGIS 10.3 to calculate the distances between every point in  two point layers via a single point. For instance, I have a group of points in southern Africa (Layer 1) and another group of points in Kazakhstan (Layer 2). I have a waypoint in Cairo, Egypt (Layer 3). I need to calculate the great circle distance from each point in Layer 1 to the waypoint in Layer 3 and then the great circle distance to each point in Layer 2.
Right now I'm planning on using the Generate Near Table tool twice, once between Layer 1 and the waypoint in Layer 3, and then again with Layer 2 and the waypoint in Layer 3. I'll then combine the distances accordingly in excel. This will take a very long time since the distance matrix has roughly 250,000 lines, so if there is a tool that could calculate great circle distance via waypoints it would save me a ton of time.
Please let me know if you need any more information.


text:
Q: Morphisms between long exakt sequences I have a commutative diagram of modules of the form
$$\require{AMScd}
\begin{CD}
@. @VVV @VVV @VVV @VVV @. \\
 ... @>>> A_n @>>> B_n @>>> C_n @>>> A_{n-1} @>>> ... \\
@. @VVV @VVV @VVV @VVV @. \\
 ... @>>> D_n @>>> E_n @. F_n @>>> E_{n-1} @>>> ... \\
@. @VVV @VVV @VVV @VVV @. \\
 ... @>>> G_n @>>> H_n @>>> I_n @>>> G_{n-1} @>>> ... \\
@. @VVV @VVV @VVV @VVV @. \\
 ... @>>> A_{n-1} @>>> B_{n-1} @>>> C_{n-1} @>>> A_{n-2} @>>> ... \\
@. @VVV @VVV @VVV @VVV @. \\
\end{CD}$$
where each column is exact. Each row is exact as far as that's possible.
My question is whether there is some diagram-chasing magic that I can employ to obtain an arrow $E_n\to F_n$ that makes the DEF-row exact and the diagram commutative.
I think there should be such an arrow by analogy from short exact sequences. The BEH- and CFI-columns are exact triangles $H\to B \to E \to H[1] \to $ and $I\to C\to F\to I[1] \to$ respectively. If I had two short exact sequences $0\to H\to B \to E\to 0$ and $0\to I\to C\to F\to 0$ and morphisms left and center, then they would induce a morphism $E\to F$ that completes the diagram. My question is whether there are such completions in the derived category.
If it helps: In the specific example I'm thinking of I have additional information, namely $B_\ast = 0$ so that there are some isomorphism around one could use.

A: No, this does not work and I should have seen myself why. It kept looking at the wrong short exact sequences for comparison. Sure, any diagram of the form
$$\require{AMScd}
\begin{CD}
0 @>>> E @>>> H @>>> B @>>> 0 \\
@. @. @VVV @VVV  @. \\
0 @>>> F @>>> I @>>> C @>>> 0
\end{CD}$$
or of the form
$$\require{AMScd}
\begin{CD}
0 @>>> H @>>> B @>>> E @>>> 0 \\
@. @VVV @VVV @.  @. \\
0 @>>> I @>>> C @>>> F @>>> 0
\end{CD}$$
has a completion, but of course diagrams of the form
$$\require{AMScd}
\begin{CD}
0 @>>> B @>>> E @>>> H @>>> 0 \\
@. @VVV @. @VVV  @. \\
0 @>>> C @>>> F @>>> I @>>> 0
\end{CD}$$
do not in general, for example
$$\require{AMScd}
\begin{CD}
0 @>>> \mathbb{Z}/2 @>>> \mathbb{Z}/4 @>>> \mathbb{Z}/2 @>>> 0 \\
@. @VV=V @. @VV=V  @. \\
0 @>>> \mathbb{Z}/2 @>>> \mathbb{Z}/2\times\mathbb{Z}/2 @>>> \mathbb{Z}/2 @>>> 0
\end{CD}$$
has no completion.


text:
Q: How can I show all data model properties in TableView Cell at Swift I have data model :
struct SearchedModel {
    var yazar: [String]?
    var imageUrl: String?
    var kitapAdi: String?
    var basimTarihi: String?
    var sayfa: Int?
    var yayimci: String?
    var dil: String?
    var not: String?
    var durum: String?
    var aciklama: String?
    var satiscisi: String?
}

I need to show that model's all properties in TableView Cell because it is detail page. How can I show these datas in same table view's cells. I want to make table with each cell has model properties like first cell is yazar, second is kitapAdi, third is basimTarihi etc..
I take this data from another page and it is came with model like var detailData = SearchedModel().
How can I make it? I don't want to make custom cell for every model properties.


text:
Q: How can I make Azure AD authentication accept an url query string access token Is there a way to configure the built in Azure AD Authentication to accept both an  Authorization: Bearer <token> header and an access_token=<token> url query string?
I need this to allow a SingalR WebSocket connection from a browser.
My Scenario
I have an ASP.Net Core backend hosting SignalR Core hubs. The site is hosted as an Azure App Service with Azure AD Authentication enabled.
Accessing REST Apis works fine, both from a .Net application and from an web site.
From .Net
A SignalR connection with a .Net application works fine and uses websocket. The websocket connection is established with the following HTTP request:
GET https://<url>/hubs/chat?id=rk-Adzl1EWGCv8wsVF5ayg HTTP/1.1
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Key: m02nzEFDAFVwCgUPlF2rEA==
Sec-WebSocket-Version: 13
X-Requested-With: XMLHttpRequest
Authorization: Bearer <token>
Host: evotrqhub.evopro-ag.de
Cookie: ARRAffinity=8666c8fbc8cd126e76e2b31c5880dd9c4968a103221108a610b408e12a15fa39

Please note that the authorization is done with an Authorization: Bearer <token> header.
From a browser
When I establish a SignalR connection from a browser (Chrome or Firefox), no websocket connection can be established and long polling is used as fallback. The HTTP request for the websocket connection is:
GET https://evotrqhub.evopro-ag.de/hubs/coilthickness?id=QB5xx4MLGi6uSvVK4QmvZA&access_token=<token> HTTP/1.1
Host: evotrqhub.evopro-ag.de
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: http://localhost:5000
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
Accept-Encoding: gzip, deflate, br
Accept-Language: de,en-US;q=0.9,en;q=0.8
Cookie: ARRAffinity=8666c8fbc8cd126e76e2b31c5880dd9c4968a103221108a610b408e12a15fa39
Sec-WebSocket-Key: K4hUR2QFyRxcDKxfoNwn2w==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

Here the authorization is done with a auth_token=<token> url query parameter.
The response from the server is a redirect (response code 302) to the Azure AD login page.
The SignalR Core docs advise to use JwtBearerEvents OnMessageReceived to handle the situation, but in this case the Azure AD authentication of the Azure Service App rejects the query before it can be handled by my user code.
So is there a way to configure the Azure App Service AD Authentication to accept the access_token parameter?

A: If you're using the SignalR JavaScript client, you can provide a method which will return an access token, which will be included in the client's requests as a Bearer token. This should work regardless of the transport method used (though I haven't tried it myself)
Example from the docs (https://learn.microsoft.com/aspnet/core/signalr/configuration?#configure-bearer-authentication):
let connection = new signalR.HubConnectionBuilder()
    .withUrl("/myhub", {
        accessTokenFactory: () => {
            // Get and return the access token.
            // This function can return a JavaScript Promise if asynchronous
            // logic is required to retrieve the access token.
        }
    })
    .build();

A: I don't known if there is a built in way for manage this with the Microsoft identity platform (probably yes), anyway you can simply add a middlware in your pipeline to check if the bearer token exists in the request context, if not, check if exists the access_token parameter in the querystring collection and then add it as bearer token in a new authorization header as shown in the below snippet of code.
Startup.cs
    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {

        ...

        app.UseCors("CorsPolicy");

        // START BEARER TOKEN MIDDLEWARE ---------------------------------------------
        app.Use(async (context, next) =>
        {
            if (
                string.IsNullOrWhiteSpace(context.Request.Headers["Authorization"]) &&
                context.Request.QueryString.HasValue
            )
            {
                var token = context.Request.QueryString.Value
                    .Split('&')
                    .SingleOrDefault(x => x.Contains("access_token"))?.Split('=')[1];
                if (!string.IsNullOrWhiteSpace(token))
                {
                    context.Request.Headers.Add(
                        "Authorization",
                        new[] { $"Bearer {token}" }
                    );
                }
            }
            await next.Invoke();
        });
        // END BEARER TOKEN MIDDLEWARE -----------------------------------------------

        app.UseAuthentication();
        app.UseAuthorization();

        ...

    }

Obviously this isn't the best scenario from a security point of view, so ensure that your api is over https and take care to encrypt or totally avoid requests log.


text:
Q: rails4: multiple image upload I am trying to upload multiple images using carrierwave, and everything works fine when I am selecting multiple images at once(shift+select), but in my case I am also interested in uploading files item by item to show them in a thumbnail.
The problem is when I select one image at a time, only the last image gets uploaded after submitting the form
 <%= f.fields_for :product_attachment do |p| %>

    <%= p.label :image %>

    <%= p.file_field :image,multiple:true,name:"product_attachments[image][]",id:"files"%>
 <output id="list"></output>

<% end %>

The script:


text:
Q: Get last 6 month name in Array for Chartjs I was trying get last six months names dynamically in chart js as label
 var profitChart = {
    labels: ***** last six months name,
    datasets: [
      {
        label: "Profit",
        backgroundColor: "rgba(58,181,74,0.3)",
        borderColor: "rgba(58,181,74,0.80)",
        pointRadius: false,
        pointColor: "rgba(210, 214, 222, 1)",
        pointStrokeColor: "#c1c7d1",
        pointHighlightFill: "#fff",
        pointHighlightStroke: "rgba(220,220,220,1)",
        data: profitdata,
      },

A: Create an array having months , use getMonth() of date object to get present month and Array.slice() to extract last 6 months.

let months=["January","February","March","April","June", "July", "August", "September", "October", "November", "December"];
let currentMonth=new Date().getMonth()
var profitChart = {
        labels:months.slice(currentMonth-6).concat(months.slice(0,currentMonth)),
        datasets: [
          {
            label: "Profit",
            backgroundColor: "rgba(58,181,74,0.3)",
            borderColor: "rgba(58,181,74,0.80)",
            pointRadius: false,
            pointColor: "rgba(210, 214, 222, 1)",
        pointStrokeColor: "#c1c7d1",
        pointHighlightFill: "#fff",
        pointHighlightStroke: "rgba(220,220,220,1)",
        data: "profitdata",
      }]
      }
 console.log(profitChart)

A: If anyone needs the last n months, for any positive integer n you could do this:
const getLastNMonths = n => {
        const d = new Date();
        const currentMonth = d.getMonth();
        const locale = 'en-GB';

        let result = [];
        for (let i = n; i > 0; i--) {
            d.setMonth(currentMonth - i);
            result.push(d.toLocaleDateString(locale, { month: 'long' }));
        }
        return result;
    };

In the OPs case they would need to use getLastNMonths(6) like this
var profitChart = {
    labels: getLastNMonths(6),
    //other properties
}

The benefit of this approach is that you can change the language by changing the locale parameter.  Or leave it as undefined to output the months according to local timezone and default locale.


text:
Q: Не работает rsync в fabric/patchwork Пытаюсь скопировать файлы с локальной машины (Windows 10™) на удаленную (Ubuntu 16.04) с помощью fabric/patchwork:
from fabric import Connection
from patchwork.transfers import rsync

with Connection(REMOTE_IP, user='root', connect_kwargs={'key_filename': KEY_FILE}) as c:
    rsync(c, SRC_DIR, '/root/build/', strict_host_keys=False)

Получаю ошибку:

"rsync" не является внутренней или внешней командой, исполняемой
  программой или пакетным файлом.

Хотя путь к ней прописан в PATH. Подозреваю, что rsync запускается с очисткой переменных окружения, в результате чего исполняемый файл не находится.
Как заставить работать rsync?

A: В целях безопасности, по дефолту, раннеры задач в fabric используют опцию конфигурации replace_env=True и пустой словарь env, что вызывает запуск rsync без переменной PATH в окружении. Достаточно поменять это свойство в контексте:
c.config.run['replace_env'] = False

чтобы все заработало.


text:
Q: next js deploy vercel returns empty object when using cheerio i want to get data from API server in vercel using next js, when using localhost:3000 the API server works but when deployed, API server is not working in the domain https://komik-two.vercel.app
import axios from "axios";
import * as cheerio from "cheerio";
import { AxiosAPP, AxiosService, client } from "components/function/axios";
import { fetcher, fetcherAPI } from "components/function/fetch";
import NextCors from "nextjs-cors";

export default async function handler(req, res) {
  const link_endpoint = "https://komikcast.me/komik/";

  if (req.method === "GET") {
    try {
      await NextCors(req, res, {
        // Options
        methods: ["GET", "HEAD", "PUT", "PATCH", "POST", "DELETE"],
        origin: "*",
        optionsSuccessStatus: 200, // some legacy browsers (IE11, various SmartTVs) choke on 204
      });
      const  data  = await fetch("https://komikcast.me").then(res=>res.text());
      // console.log(data);

      const $ = cheerio.load(data);
      const element = $("#content");
      let komik_list = [];

      // console.log(element);
      let title, type, endpoint, last_upload_endpoint, thumb, chapter, rating;

      element.find(".swiper-wrapper > .swiper-slide").each((i, el) => {
        title = $(el)
          .find("a > .splide__slide-info")
          .find(".title")
          .text()
          .trim();
        type = $(el)
          .find("a > .splide__slide-image")
          .find(".type")
          .text()
          .trim();
        thumb = $(el).find("a > .splide__slide-image").find("img").attr("src");
        // thumb = $(el).find()
        endpoint = $(el).find("a").attr("href").replace(link_endpoint, "");
        chapter = $(el)
          .find("a > .splide__slide-info")
          .find(".other")
          .find(".chapter")
          .text()
          .trim();
        last_upload_endpoint = $(el)
          .find("a > .splide__slide-info")
          .find(".other")
          .find(".chapter")
          .attr("href");

        rating = $(el)
          .find("a > .splide__slide-info")
          .find(".other > .rate > .rating")
          .find(".numscore")
          .text();

        komik_list.push({
          endpoint,
          title,
          type,
          thumb,
          chapter,
          last_upload_endpoint,
          rating,
        });
      });
      res.statusCode = 200;
      res.json({
        status: true,
        message: "success",
        komik_list,
      });
    } catch (error) {
      res.status(404).json({ error });
    }
  }
}

http://localhost:3000/api/recommend
on localhost works successfully display object api
https://komik-two.vercel.app/api/recommend in vercel works but returns komik_list obejct : []
{
status: true,
message: "success",
komik_list: [ ]
}


text:
Q: How do I view the number of pages of a print job in the printer queue? I can't find anything about the number of pages of a job that's in the printer queue (that's yet to be released). I've tried looking through the attributes via "View Attributes", but the number of pages is not shown on the window. Is it possible to view this?

A: I am not sure about this, but I'd try looking at the queue through the cups interface.

*

*In your browser address bar enter: http://localhost:631/printers.

*You should see your printer in the "Queue names", click it and go to "show all jobs".

*If there are no printers you will have to add it through http://localhost:631/admin.


text:
Q: Jquery slideDown / Slide up menu I ma trying to make a sliding menu.
I want hovering on logo-container to slide it up and when animation is finished slide down menu. When the mouse will be out of logo-container menu will slide up and when animation will be finisded logo will slide down
on mouse hover
1) logo (slideUp)
- wait until animation compleate -
2) menu (slideDown)
when mouse off
1) menu (slideUp)
- wait until animation compleate -
2) lodo (slideDown)
Html

test1

test1

test1

test1

test1

test1

test1

test1

            Menu

Jquery
$("#header").hover(function(){

    $('.logo_show').slideUp('300', function(){
        $('.navigation_menu_hide').slideDown('300');
    });
},function(){
    $('.navigation_menu_hide').slideUp('200');

    $('.logo_show').stop(true, true).slideDown('300');
});

Demo - what I have now (jsfiddle)
I have made something but have issue with animation compleate waiting

A: Here is what I came up with as a solution I tweaked the jQuery a bit DEMO
$(document).ready(function() {

$('.logo_show').hover(function(){
    $(this).slideUp('300');
    $('.navigation_menu_hide').stop(true, true).slideDown('300', function() {

        $('.navigation_menu_hide').mouseleave(function() {
               $(this).slideUp('200');
              $('.logo_show').slideDown('300');

      });
    });
  });
});

Hope that is what you were looking for.


text:
Q: Unable to connect Azure VM with new key generated I lost my private key that I use during the VM creation, so I resort to create another one.
I first run
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout privatekey.key -out cert.pem

then
openssl x509 -outform der -in cert.pem -out cert.cer

I uploaded to Azure using the Azure Management Console
then
chmod 600 privatekey.key

When I run,    ssh -i privatekey.key cherhan@ch-hadoop.cloudapp.net, I can't access and got into following errors:
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to ch-hadoop.cloudapp.net [137.116.138.236] port 22.
debug1: Connection established.
debug1: identity file myPrivateKey.key type -1
debug1: identity file myPrivateKey.key-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.4
debug1: match: OpenSSH_6.4 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 56:ab:92:4b:f7:e5:53:f1:ca:67:97:d0:72:86:d9:c4
debug1: Host 'ch-hadoop.cloudapp.net' is known and matches the RSA host key.
debug1: Found key in /Users/cherhan/.ssh/known_hosts:6
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Trying private key: myPrivateKey.key
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to ch-hadoop.cloudapp.net [137.116.138.236] port 22.
debug1: Connection established.
debug1: identity file myPrivateKey.key type -1
debug1: identity file myPrivateKey.key-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.4
debug1: match: OpenSSH_6.4 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 56:ab:92:4b:f7:e5:53:f1:ca:67:97:d0:72:86:d9:c4
debug1: Host 'ch-hadoop.cloudapp.net' is known and matches the RSA host key.
debug1: Found key in /Users/cherhan/.ssh/known_hosts:6
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Trying private key: myPrivateKey.key
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Can someone enlighten me of what has happened?


text:
Q: Как посчитать коэффициент экспоненциального роста в python? Я, по всей видимости, использую неправильный термин, так как гугл мне не помогает.
Что мне нужно научиться делать: Находить коэффициент экспоненциального роста. Есть список вроде [4, 8, 16] и нужно найти коэффициент (2). Только вот список не идеальный, как в моем примере - цифры могут плавать [400, 789, 1700] и все еще нужно найти усредненный коэффициент.
Предполагаю, что есть какой-то метод в какой-то библиотеке, но гугл мне выдает exp и число Эйлера в степени x.
Подскажите с направлением, пожалуйста.

A: Можно логарифмировать элементы списка и построить приближение результата прямой, например, с помощью метода наименьших квадратов.
Коэффициент наклона прямой (a в y=ax+b) - соответствует "коэффициенту экспоненциального роста."
Модель данных
y = B * A^x
ln(y) = ln(B) + x * ln(A) = b + a * x

Подогнав  последнее, найдём а, а из него A = Exp(a)

Если в списке реально 3 значения - достаточно поделить второе на первое, а третье на второе, и взять среднее из этих отношений.

A: Тут похоже имелось ввиду построить график
y=a*С^(k*x)+b

Надо найти С. Чтоб найти подходящюю кривую аналитически составляют систему из 3х уравнений, надо ещё координату x знать
400 = a*exp(k*1)+b
789 = a*exp(k*2)+b
1700 = a*exp(k*3)+b

делим на а и логарифмируем
   ln((400-b)/a) = k*1
   ....

k вносим под логорифм
   ((400-b)/a)^(1/k) = 0

   ...

дальше замена переменных, приведение к нормальному виду и дальше не помню - надо загуглить...)
Вот Вам похоже эту систему уравнений надо решить численными методами...
Во чтото похожее , но не то что я пытаюсь вспомнить
В тех преобразованиях сводится к логарифму=1, поэтому мантиса (ну  e в экспоненте как называется..) может быть и не числом Эйлера, а ещё одним коэфицентом. который легко вычисляется когда найдете a,b,k


text:
Q: Need help with expressing this logarithm Express $log_3(a^2 + \sqrt{b})$ in terms of m and k where
 $m = log_{3}a$
$k = log_{3}b$
Given this information I made
$a = 3^m$
$b = 3^k$
Therefore
= $log_{3} ((3^m)^2 + (3^k))^{\frac{1}{2}}$
= $log_{3} (3^{2m} + 3^{\frac{k}{2}})$
I don't know if I'm done or there is still more things I can simplify. Can anyone help please, thanks

A: Since there is no expansion for $\log(a+b)$, hence, you could stop there. If you need to get an approximation(sometimes in computer science), you could use $\log(a+b)=\log a+\log(1+b/a)$, then you have following:
$$2m+\log_3(1+3^{k/2-2m}).$$

A: Alternatively, $\log_3(9^m+\sqrt3^k)$, but this makes little difference.
You can't decompose a sum inside a logarithm.


text:
Q: Check whether an ID's classifier/attribute changes from one month to the next and if it does, create a list of changes I have a data.frame with a "DATE" column, an "ID" column and a "CLASSIFIER" column, as follows:
set.seed(11)
Data <- data.frame(
        DATE = sample(seq(as.Date("2010-02-01"), length=12, by="1 month") - 1,50,replace = TRUE),
        ID = sample(1:9,50,replace = TRUE),
        CLASSIFIER = sample(c("yes", "no"), 50, replace = TRUE)
      )

The output looks like this:
        DATE ID CLASSIFIER
1 2010-03-31  3        yes
2 2010-04-30  3         no
3 2010-04-30  4         no
4 2010-06-30  4        yes
5 2010-09-30  2         no
6 2010-11-30  5         no

I would now like to get a list of those IDs whose classifier changes from one date to the next. In other words, I want a list of all
IDs (including the respective date) which change from "yes" to "no" or from "no" to "yes" from one month to the next. For clarification, by from one month to the next I am speaking strictly chronologically - the ranking of the dates in the data.frame should be irreleveant. So, a change for a given ID may, for example, only occur on 2010-02-28 if there exists an entry for the same ID on 2010-01-31 with the opposite CLASSIFIER. Ideally, the list would also state the nature of the change (i.e. from "no" to "yes" or from "yes" to "no")
From the output example above (first two lines), if ID "3" has the "yes" CLASSIFIERon 2010-03-31 and the "no" CLASSIFIER on 2010-04-30, the list should state ID "3", "2010-04-30" and something like "yes to no". ID "4" in row 3 and 4 would not qualify as a change, because the change did not occur from one month to the next chronologically speaking.
Would someone please help me with this?
Thank you very much in advance for your help!
Kind regards,
C.

A: I'm not entirely clear on your expected output, but perhaps something like this will get you started?
library(tidyverse)
Data %>%
    group_by(ID) %>%
    mutate(status = if_else(
        CLASSIFIER != lag(CLASSIFIER),
        sprintf("change: %s to %s", lag(CLASSIFIER), CLASSIFIER),
        "nochange"))
## A tibble: 50 x 4
## Groups:   ID [9]
#   DATE          ID CLASSIFIER status
#   <date>     <int> <fct>      <chr>
# 1 2010-04-30     3 no         NA
# 2 2010-07-31     3 yes        change: no to yes
# 3 2010-02-28     9 no         NA
# 4 2010-02-28     1 yes        NA
# 5 2010-10-31     2 no         NA
# 6 2010-07-31     5 yes        NA
# 7 2010-04-30     6 yes        NA
# 8 2010-12-31     3 no         change: yes to no
# 9 2010-08-31     4 yes        NA
#10 2010-01-31     1 no         change: yes to no
## … with 40 more rows

Cross check: For ID=3 there is a change from CLASSIFIER="no" to "yes" between Date="2010-04-03" and Date="2010-07-31" in rows 1 and 2. For ID=1 there is change from CLASSIFIER="yes" to "no" in rows 4 and 10.


text:
Q: Azure B2C Impersonated User access token to call web API? I am successfully using the Impersonation custom policy (https://github.com/azure-ad-b2c/samples/tree/master/policies/impersonation) to get an ID token for the user I am trying to impersonate.
However, when I call a web API (that is also secured by Azure B2C), the acquireTokenSilent() call is defaulting back to the logged in user access token to make the web API call.  How do I obtain an access token for the impersonated user so that I am calling the web API as the impersonated user.
I have modified the react b2c-sample (https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-react-samples/b2c-sample) to execute the Impersonation policy and I am seeing the correct impersonation token being returned, but when I execute a call to my web api, it is using the logged in user access token.
Any ideas on what I am missing?


text:
Q: Ubuntu Server 20.04 RAID 5 disk space I have installed Ubuntu Server 20.04.3 on a HP Rack server with Raid 5.
The hardware raid pgm indicates 1.1tb of space.
Ubuntu DF command reports only 98gb.
Filesystem                         Size  Used Avail Use% Mounted on
udev                                16G     0   16G   0% /dev
tmpfs                              3.2G   11M  3.2G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   98G   98G     0 100% /
tmpfs                               16G  4.0K   16G   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                               16G     0   16G   0% /sys/fs/cgroup
/dev/loop0                          56M   56M     0 100% /snap/core18/2128
/dev/loop1                          33M   33M     0 100% /snap/snapd/12704
/dev/loop2                          71M   71M     0 100% /snap/lxd/21029
/dev/sda2                          976M  207M  703M  23% /boot
/dev/loop3                          56M   56M     0 100% /snap/core18/2284
/dev/loop4                          44M   44M     0 100% /snap/snapd/14549
/dev/loop5                          62M   62M     0 100% /snap/core20/1328
/dev/loop6                          68M   68M     0 100% /snap/lxd/21835
tmpfs                              3.2G     0  3.2G   0% /run/user/1000

lsblk reports:
sda                         8:0    0  1.7T  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0  1.7T  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0  100G  0 lvm  /

df -h reports:
/dev/mapper/ubuntu--vg-ubuntu--lv   98G   37G   57G  40% /

Sorry about typo. Its RAID 0  Logical Drive = (4x300gb drives).
Raid utility reported: 1.1TB
I install Ubuntu 20.40 server and its DF reports only 98gb if space,
*** Thanks all. I resolved the problem by re-installing Ubuntu 20.04 server and unchecking LVM. I didn't realize that LVM and Hardware Raid were related. ***


text:
Q: Mejorar tiempo de carga NodeJS tengo una situacion. Vengo realizando un admin dashboard para mi sitio web. Utilizo la api de google analytics para consultar los datos y mostrarlos en mi app. El problema es que al realizar unas pocas consultas el tiempo de carga se hace elevadisimo... con 6 consultas a la API el tiempo de carga del dashboard es de 4 a 7 segundos. Como podria mejorarlo? Utilizo NodeJS expressJS y EJS para plasmar los datos. Deberia incorporar un framework en el frontend como react para reemplazar EJS?? les dejo una parte del codigo...
router.get("/", function (req, res, next) {
  let query1 = "SELECT count(*) AS pedidosCount FROM pedidos;";
  let query2 = "SELECT count(*) AS juegos FROM juegos;";
  let query3 = "SELECT count(*) AS ultimo FROM `juegos` WHERE MONTH(date) = MONTH(CURRENT_DATE);";
  let Pathing = req.path.replace(/\//g, "_");

  const getApGaData = async (propertyId = "******") => {
    const analyticsDataClient = new BetaAnalyticsDataClient({
      keyFilename: credentialsJsonPath,
    });
    const [traficototal] = await analyticsDataClient.runReport({
      property: `properties/${propertyId}`,
      dateRanges: [
        { startDate: "30daysAgo", endDate: "today" },
        { startDate: "60daysAgo", endDate: "30daysAgo" },
        { startDate: "90daysAgo", endDate: "60daysAgo" },
        { startDate: "120daysAgo", endDate: "90daysAgo" },
      ],
      metrics: [{ name: "activeUsers" }],
    });
    const [visitsGraphA] = await analyticsDataClient.runReport({
      property: `properties/${propertyId}`,
      dateRanges: [{ startDate: "60daysAgo", endDate: "30daysAgo" }],
      metrics: [{ name: "activeUsers" }],
    });
    const [visitsGraphB] = await analyticsDataClient.runReport({
      property: `properties/${propertyId}`,
      dateRanges: [{ startDate: "90daysAgo", endDate: "60daysAgo" }],
      metrics: [{ name: "activeUsers" }],
    });
    const [visitsGraphC] = await analyticsDataClient.runReport({
      property: `properties/${propertyId}`,
      dateRanges: [{ startDate: "120daysAgo", endDate: "90daysAgo" }],
      metrics: [{ name: "activeUsers" }],
    });
    const [visitas] = await analyticsDataClient.runReport({
      property: `properties/${propertyId}`,
      dateRanges: [{ startDate: "2021-02-20", endDate: "today" }],
      dimensions: [{ name: "pagePathPlusQueryString" }, { name: "outbound" }],
      metrics: [{ name: "activeUsers" }, { name: "eventsPerSession" }],
      orderBys: [{ metric: { metricName: "activeUsers" }, desc: true }],
      limit: "5",
    });
    const [downloads] = await analyticsDataClient.runReport({
      property: `properties/${propertyId}`,
      dateRanges: [{ startDate: "2021-02-20", endDate: "today" }],
      dimensions: [{ name: "outbound" }],
      metrics: [{ name: "activeUsers" }],
    });
    const Total_traffic_value = traficototal.rows[0].metricValues[0].value;
    const Total_downloads_value = downloads.rowCount;
    db.query(query1 + query2 + query3, function (err, results) {
      if (err) throw err;
      res.render("home", {
        count: results[0],
        juegos: results[1],
        ultimoJuego: results[2],
        jsonOBJ: Total_traffic_value,
        PreviusMonth: visitsGraphA,
        ThreeMonthsAgo: visitsGraphB,
        FourMonthsAgo: visitsGraphC,
        downloads: Total_downloads_value,
        visits: visitas,
        page_active: Pathing,
      });
    });
  };
  getApGaData();
});


text:
Q: How to open link on new window without calling onclick I have HTML code as follows:
 Text

When user clicks by "Left mouse button" on the link, then reloadPage() should be called.
But when user clicks using "Ctrl + click" or "middle button" on the link then I want to open a new window without reloadPage().
How can I do that?

A: You can refference here. Its my code
Click Me

A: You can simply set the href attribute on the a tag to the current page url, this way when a user clicks it will open the same page (reload) and if he middle clicks it will open the same page in a new tab.
If you want to use that on multiple pages then you can set the href in javascript to the current page url like this
document.getElementById('myId').href = location.href

A: You can try this approach (html):
Text

Javascript:
$(function () {
        $("#mylink").click(function (event) {
            if ((event.button == 0 && event.ctrlKey) || event.button == 1) {
                event.preventDefault();
                window.open("http://www.google.com");
            }
            else
                if (event.button == 0)
                    window.location.reload();
        });
});

A: I have two options for you.Pure javascript and with the use of jquery.
Here's the full code.
<!DOCTYPE html>

    <title></title>

     JQuery Code

     Pure Javascript Code

Hope that helps.


text:
Q: Firefox on Ubuntu 14.04 the Firefox web browser on Ubuntu 14.04 keeps unexpectedly shutting down as I am downloading.  how do I fix this?

A: Try reinstalling it and see if it solves the problem
run sudo apt-get install --reinstall firefox


text:
Q: qsub: not sharing nodes with other users Is there a way to request full machines? At my department I have the problem that when running a large job, some processes get allocated to shared machines. I am not sure why but it happens that processes on those shared machines are extremely slowed down, possibly because of what the other user is doing.
I want to avoid this and so ideally I would be able to request not to share nodes when invoking qsub, is this possible?
We are using SGE, and different nodes have different number of cores so I can't just use ppn=4.


text:
Q: How to escape quotation ' in object filter Swift 4 I have a variable which filters for certain text field inputs, but when I try to input ' quotation my app crash with this output:

uncaught exception 'NSInvalidArgumentException', reason: 'Unable to
  parse the format string "word LIKE ''*'"'
  *** First throw call stack:

here is my code:
func getEnglishWords(_ Phrase: String) -> [DictionaryResult] {

    let Words = realm.objects(Word.self).filter("word LIKE '\(Phrase)*'").sorted(byKeyPath: "word", ascending: true)

}

A: Try filtering using an NSPredicate object, and also I think BEGINSWITH would be easier to use than LIKE in this case. See the Realm documentation for examples and links to additional documentation and cheatsheets for NSPredicate use.
let predicate = NSPredicate(format: "word BEGINSWITH %@", Phrase)
let Words = realm.objects(Word.self).filter(predicate).sorted(byKeyPath: "word", ascending: true)

A: let escapedString = "You can \"escape\" like this"

print(escapedString) // prints You can "escape" like this


text:
Q: EKEventStore search event with title NSPredicate I have requirement to search events added to iOS calendar with title OR notes. I like to search events with [NSPredicate predicateWithFormat:@"title like 'Callback'"].
When googled I got predicateForEventsWithStartDate only. How can we fetch/search events with title OR notes in iOS.

A: You need 2 predicates to do this
Here a commented example :
// you init your store event
EKEventStore *store = [[EKEventStore alloc] init];

//you get the list of events
NSPredicate *datePredicate = [store predicateForEventsWithStartDate:[[NSDate date] dateByAddingTimeInterval: -86400.0] //yesterday
                                                            endDate:[NSDate date] //today
                                                          calendars:nil];
//this will return a list of EKEvent
NSArray<EKEvent *> *events = [store eventsMatchingPredicate:datePredicate];

//you create a second predicate to test on title or wethever you want
NSPredicate *textPredicate = [NSPredicate predicateWithFormat:@"title like 'Callback'"];

//here you will get the events with title like Callback
NSArray<EKEvent *> *results = [events filteredArrayUsingPredicate:textPredicate];


text:
Q: How to handle lightning:buttonMenu onselect event to identify edit or delete? I need to implement Edit and Delete option in custom component like this below

Component
<lightning:buttonMenu alternativeText="More options" onselect="{!c.lineAction }" iconSize="small" aura:id="editDelete">
  <lightning:menuItem label="Edit" value="1"  />
  <lightning:menuItem label="Delete" value="2" />
</lightning:buttonMenu>

Controller script
lineAction:function(component, event, helper){

  // Here I need to identify whether edit or delete selected and its corresponding values

}

A: Update (API Change)
In order to determine which menu item was used, check the event's "id" and "value" parameters to determine which meny item was used:
({
  handleSelect: function(component, event, helper) {
    switch(event.getParam('value')) {
      case "1": helper.doEdit(); break;
      case "2": helper.doDelete(); break;
    }
  }
})

The previous method has been deprecated and may eventually cease to work.

Original Answer
See lightning:menuItem for details, but basically, you can check event.detail.menuItem to determine which menu item was selected.
({
    handleSelect: function(component, event, helper) {
        var menuValue = event.detail.menuItem.get("v.value");
        switch(menuValue) {
            case "1": helper.doEdit(); break;
            case "2": helper.doDelete(); break;
        }
    }
})


text:
Q: Exporting in Netsuite One of our customer's uses Netsuite ERP. We would like to be able accept pick tickets(orders) from them in a format that would allow us to import the pick tickets into our custom built ERP system. Naturally, I asked them if they could export the pick tickets as CSV to us.
They are attempting to build a custom report with all the fields we need and export it into csv. Aside from them having issues exporting the report only to HTML... Im curious as to why they cant just export the pick ticket they have been sending us, which is in pdf format.
On top of that. Ive noticed via SuitesScript you could modify the on click event to generate a csv of the data. So when they click generate print ticket, why could it not easily generate a csv at that time?
Basically, due to me not havign hands on to their NetSuite system - or any insight to the inner working of NetSuite, im looking to the community to explain to me, what they are doing wrong - or what the best solution is to attain the goal of: exporting a pick ticket(im assuming this is based from the sales order in netsuite...) in a friendly format, allowing me to automate the order entry into my company's system.

A: I am sure Netsuite provides CSV option for exporting Reports. Please refer to this doc.

To export a report:

*

*On the Reports page, click the name of the report you want to see.

*In the footer of the report, select Export-CSV, Export-Microsoft® Word, Export-Microsoft® Excel, or Export-PDF.

One possible problem may be the Role Permissions. Please refer to this.

If your search results pages do not include an Export button, your account administrator may not have assigned you the Full level for the Perform Search permission. This level is required for exporting search results. The Export Lists permission also is required. See Permissions for Searches.

A: you should be able to export pdf. Please refer to https://github.com/eliseobeltran/NSProject/blob/314c5a03c4251cd06d451527103b7b85bb63f130/GOP/Innov.GOP.GeneratePDF.js

A: Once you create the saved search, NetSuite has the option to export the saved search as the CSV, MS EXCEL, or PDF. But it's a manual approach. You can do it automatically by writing a JavaScript script in the Suite Script.


text:
Q: How to run XMPP Room Join & Invite process in background Thread in iOS I have got an issue with Room join & Inviting members to XMPP Room in iOS.
I have a clause that needs to join 200 rooms together at login, I did it but it blocks the main thread.
Can anyone suggest the Approach to handle hundreds of room joining seemless without blocking main thread.
Thanks,

A: Why did you join 200 rooms at a time in the first place?
My guess you need to join so that be able to get all group chats?  This is a very inefficient way.  I think you need to implement Offline Message Push Notification.
Look into ejabberd_mod_offline_post

*

*First config the Room must be a Member-Only room, and add all users as members right after you created it, so that be able to get a total.

*Add above model into ejabberd models.

*Implement a Callback Service to handle the callback post.

The idea is when User go offline:

*

*In one-to-one case, offline_message_hook will be raised

*In MUC case, muc_filter_message will be raised, and any one not Presence-Available is offline.


text:
Q: Possible typo in proof of Bukovský-Hechler In the proof of the following theorem:

Theorem 29 (Bukovský-Hechler): Let $\kappa, \lambda$ be infinite cardinals such that $\mathrm{cf}(\kappa) \le \lambda$ and
  $\mathrm{cf}(\kappa) < \kappa$. Denote $\displaystyle \sum_{\alpha <
 \kappa} |\alpha|^\lambda = \mu$.
(a) If there exists $\alpha_0 < \kappa$ such that $|\alpha|^\lambda =
 |\alpha_0|^\lambda$ for all $\alpha$ satisfying $\alpha_0 \le \alpha <
 \kappa$, then $\kappa^\lambda = \mu$.
(b) If for each $\alpha < \kappa$ there exists $\beta$ such that
  $\alpha < \beta < \kappa$ and $\alpha^\lambda < \beta^\lambda$, then
  $\kappa^\lambda = \mu^{\mathrm{cf}(\mu)}$.

there appears to be a typo in the proof of part (b). Can you confirm this? The proof is the following:

I don't quite believe that $H$ maps into ${^{\mathrm{cf}(\kappa)}}F$. Assume $\gamma_\xi$ is somewhere between $\alpha < \gamma_\xi < \kappa$. Then $f(\beta)$ could also be somewhere above $\alpha$ so that $g \notin F$. I am not sure what am missing but I think the definition of $H$ should depend on $\alpha$. The fix I propose is the following:
$$ g(\beta) = \begin{cases} f(\beta) & \gamma_\xi < \alpha \\ 0 & \text{otherwise}\end{cases}$$
Thanks for your help.

A: I think you're misunderstanding the definition of $F$ (which is, admittedly, quite confusingly written, as is the whole proof). The $\alpha$ in the definition isn't free; $F$ is supposed to be the set of bounded functions from $\lambda$ to $\kappa$. It is clear that $H(f)(\xi)$ is bounded by $\gamma_\xi$, so the map $H$ is well defined, at least.
It is much better to imagine $H$ a bit more concretely. In particular, uncurrying the definition, we basically have a map $H\colon{\,}^\lambda\kappa\times\mathrm{cf}(\kappa)\to F$, which takes a function $f\in {}^\lambda\kappa$ and a point $\xi$, and produces a map $H(f,\xi)$ which is just $f$, cut off at the appropriate point $\gamma_\xi$ in the cofinal sequence.

A: $\newcommand{\cf}{\operatorname{cf}}$When you assume that $\gamma_\xi$ is between $\alpha$ and $\kappa$, you're presupposing some fixed $\alpha$, but there isn't a fixed $\alpha$ anywhere in this argument. The $\alpha$ in the definition of $F$ is just an index variable:
$$F=\bigcup_{\alpha<\kappa}{^\lambda\alpha}\;,$$
the set of all bounded functions from $\lambda$ into $\kappa$. Equivalently,
$$F=\{f\in{^\lambda\kappa}:\sup\operatorname{ran}f<\kappa\}\;.$$
It may make things a little clearer if I try to give a more intuitive description of $H$.
An element of $\,{^{\cf\kappa}F}$ is a function that assigns to each $\xi<\cf\kappa$ an $f_\xi\in F$, i.e., a bounded function from $\lambda$ into $\kappa$. In other words, it's a $(\cf\kappa)$-sequence of bounded functions from $\lambda$ into $\kappa$. The function $H$ then assigns to each $f:\lambda\to\kappa$ a $(\cf\kappa)$-sequence of bounded functions from $\lambda$ into $\kappa$ in a very natural way.
We have the increasing cofinal sequence $\langle\gamma_\xi:\xi<\cf\kappa\rangle$ in $\kappa$, so every bounded function into $\kappa$ must be bounded by some $\gamma_\xi$. We set $H(f)=\langle f_\xi:\xi<\cf\kappa\rangle$, where $f_\xi$ is the result of zeroing out each value of $f$ that is greater than or equal to $\gamma_\xi$. That is, we set $f_\xi(\eta)=f(\eta)$ if $f(\eta)<\gamma_\xi$, but if $f(\eta)$ exceeds that bound, we set $f_\xi(\eta)=0$. As $\xi\to\cf\kappa$, $f_\xi$ agrees with $f$ on more and more values of the argument. In fact, for any $\eta<\lambda$ there is a $\xi_0<\cf\kappa$ such that $f(\eta)<\gamma_{\xi_0}$, and we have $f_\xi(\eta)=f(\eta)$ for $\xi_0\le\xi<\cf\kappa$, so that $$\lim_{\xi\to\cf\kappa}f_\xi(\eta)=f(\eta)$$ for all $\eta<\lambda$.


text:
Q: When true positives are rare Suppose you're trying to use machine learning for a classification task like, let's say, looking at photographs of animals and distinguishing horses from zebras. This task would seem to be within the state of the art.
But if you take a bunch of labelled photographs and throw them at something like a neural network or support vector machine, what happens in practice is that zebras are so much rarer than horses that the system just ends up learning to say 'always a horse' because this is actually the way to minimize its error.
Minimal error that may be but it's also not a very useful result. What is the recommended way to tell the system 'I want the best guess at which photographs are zebras, even if this does create some false positives'? There doesn't seem to be a lot of discussion of this problem.

A: One of the things I usually do with imbalanced classes (or skewed data sets) is simply generate more data. I think this is the best approach. You could go out in the real world and gather more data of the imbalanced class (e.g. find more pictures of zebras). You could also generate more data by simply making copies or duplicating it with transformations (e.g. flip horizontally).
You could also pick a classifier that uses an alternate evaluation (performance) metric over the one usually used - accuracy. Look at precision/recall/F1 score.
Week 6 of Andrew Ng's ML course talks about this topic: link
Here is another good web page I found on handling imbalanced classes: link

A: With this type of unbalanced data problem, it is a good approach to learn patterns associated with each class as opposed to simply comparing classes - this can be done via unsupervised learning learning first (such as with autoencoders).  A good article with this available at https://www.r-bloggers.com/autoencoders-and-anomaly-detection-with-machine-learning-in-fraud-analytics/amp/.  Another suggestion - after running the classifier, the confusion matrix can be used to determine where additional data should be pursued (I.e. many zebra errors)


text:
Q: mem_set for std::map or std::list Can we do a mem_set() for std::map or std::list as soon as we create them. For ex,
typedef std::map<int, double> MY_MAP;
typedef std::list<int> MY_LIST;
MY_MAP *map_obj = new MY_MAP();
mem_set(map_obj, 0, sizeof(MY_MAP));
MY_LIST mylist;
mem_set(&mylist, 0, sizeof(MY_LIST));

and I continue with normal stl operations
map_obj->insert(std::make_pair<int, double> (1, 2.2));
mylist.push_back(1);

Is it correct to perform a mem_set(), and if it is correct can I do similarly for other STL c++ containers like std::vector, std::set etc
What will happen if we do a mem_set() to stl containers internally?

A: What you propose is undefined behaviour, and given the popular implementations of the standard library it has zero chance to do anything useful even by accident.

A:
Can we do a mem_set() for std::map or std::list [...?]

No. std::map and std::list are families of non-POD types. You are not supposed to mess with their internal representations on this low level. Apart from being UB, you would very likely violate the type's internal invariants. The same is true for std::string.
However, the default constructors of these types already create objects in a kind of "zero state". That is, they will be "empty" / will not contain any elements.

Is it correct to perform a mem_set()

No.

What will happen if we do a mem_set() to stl containers internally?

Nothing good. These types are non-PODs for a reason. They have "private parts" that nobody should mess with directly on that level.

A: What are you trying to accomplish?
When you call new MY_MAP();, it allocates memory for the map and runs the constructor. That puts the map into a known, valid state. By calling men_set (memset?) you are setting everything in the map to zero, almost certainly leaving the map in some invalid state. Inserting things into this map will fail, hopefully sooner rather than later.

A: The reason for my question above came from the following implementation.
MY_STRUCT *new_struct = new MY_STRUCT;
memset(new_struct,0,sizeof(MY_STRUCT));

This would perfectly work fine as soon as the structure is defined like
struct my_struct{
int a;
double b[100];
}MY_STRUCT;

But if the structure is defined as following
struct my_struct{
int a;
double b[100];
std::map<int,double> my_map;
std::vector<int> my_vector;
}MY_STRUCT;

doing a memset() for the above structure would try to initialize even the map and vector,
so is it allowed to do a memset() to a struct object if they contains STL containers?


text:
Q: cakePHP Flash message append class not working I am trying to get my head around the flash message functionality in cakePHP.
In my current script is use the following approach:
     $this->Session->setFlash('Error');

which as a result gives me the following output:

Error

However when I try to append a custom class to it:
    $this->Session->setFlash('Error', array ('class' => 'errormsg'));

the message / flash does not seem to be generated / is not visible in my sourcecode output at all.
Any ideas what can be wrong here?

A: try changing:
$this->Session->setFlash('Error', array ('class' => 'errormsg'));

to
$this->Session->setFlash('Error', 'default', array ('class' => 'errormsg'));

See:: cakePHP setFlash

A: As per cakephp session component you have to pass like below
$this->Session->setFlash('Error', 'default', array('class' => 'errormsg'));

you can take more reference from link
let me know if i can help you

A: For those using Cake 2.7+ (where SessionComponent::setFlash is deprecated), use
$this->Flash->set('Error', array('params' => array('class' => 'errormsg')));


text:
Q: SQLSTATE[HY000] [2002] Connection timed out while accessing remote database, logs show a connection was attempted I am currently writing a web service that will receive a POST request and write the data to a database that is hosted on a different server. When running the script to  a database on the same server, it behaves as expected. However, once it tries to access the remote database the connection times out with that error.
I've read a lot of the answers that refer to configuring MySQL to allow remote root connections, but we've created a user with all privileges from any host.
The server logs of the MySQL database show that the user we created attempted to access the database but didn't use a password even though the password is programmed to be entered. I do not have access to the core MySQL files at this time.
Could it still be an issue with root remote access or the firewall even though the server log shows an attempt to connect to the database?
This is the PHP function that throws the error:
function webservice_db_connect() {
    try {
        global $db_servername, $db_username, $db_password, $db_name, $db_port;
        $db = new PDO("mysql:host=$db_servername;dbname=$db_name;port=$db_port", $db_username, $db_password);
        $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        return $db;
    } catch(PDOException $error) {
        exit('Connection failed: '. $error->getMessage());
    }
}

Final Result:
Connection failed: SQLSTATE[HY000] [2002] Connection timed out

A: I would start by trying to log into the remote mySQL server from the mysql client:
mysql -h your.remoteserver.com -p 3345 -u yourusername -p yourpassword

Try different usernames for a successful connection.
Did you reload the privileges on the remote mySQL database?


text:
Q: MySQL - Create table with a specific TIMESTAMP format Is there any way to create a table with a specific TIMESTAMP format (HH:mm:00) where I need to fix sec to 00.
CREATE TABLE `published` (
  `time_pub` timestamp() NULL DEFAULT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

A: You can't change the way the timestamp is stored. Only the way it is presented in your select statements.
Another solution would be to store the data in a hour and minute column having an integer data type.

A: Although you can't specify the time format when create table, you can use date_format function in MySQL to fix the second part to 00 when insert data to database.
insert into TABLE_NAME values (date_format(now(), '%H:%m:00'));


text:
Q: how to add the green folder as the pic in github
what i want to know it is that how to how to add the green folder as the pic in github?
and then if i use TortoiseGit ,how do this?

A: Those green folder are submodules (special git entries)
When you clone that repo, you need a:
git submodule update --init

That will update those folder in your local working tree.
(or "TortoiseGit > Submodule update.")
Starting April, 30th 2013, when you view a repository with a submodule on github.com, you get useful links and information for the submodule.


text:
Q: 301 redirection through .htaccess file not working I'm using CodeIgniter.
in httacess file, I wrote this code to remove index.php from url:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Now I want to redirect site root to subdomain, with this code:
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ sub.domain.com/$1 [r=301,nc]

domain.com redirected to sub.domain.com successfully. but domain.com/dir to sub.domain.com/dir not work and still opening domain.com/dir.
When I removed first code, redirection worked perfect, but I need to remove index.php too.

A: Adding $to the end of rewritecond %{http_host} ^domain.com [nc] should fix it for you.
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ sub.domain.com/$1 [r=301,nc]

Would become
rewritecond %{http_host} ^domain.com$ [nc]
rewriterule ^(.*)$ sub.domain.com/$1 [r=301,nc]

A: Have your rules like this:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://sub.domain.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]


text:
Q: how to dynamically change video using jquery where the source path is stored in database and file in file system i stored video file in file system and path in database.i'm able to display video using js and also jquery.i want to dynamically change the video when onclick on the list.but only first video is playing.here is my code

slno	 Filename

  {% for i in total %}//total contains the video paths(python)

  {{ forloop.counter }}

  <input type="button" onclick="fn()" id="btn" value="{{ i.vid }}"/>

  {% endfor %}

<video id="videoclip" width="320" height="240" controls='controls' autoplay>
 <source id= "mp4video" src="/site_media/media/upload/vid2.mp4" type="video/mp4">
  </video>

A: id's must be unique change html something like this:-
<input type="button" onclick="fn(this)" id="{{ i.vid }}" value="{{ i.vid }}"/>

and then in jquery code:-
function fn(dv) {
  var player = document.getElementById("videoclip");
  var mp4Vid = document.getElementById("mp4video");
  var a = '/site_media/media/';
  var b = $(dv).attr('id');
  var c = a + b;
  player.pause();
  document.getElementById("mp4video").src = c;
  player.load();
  player.play();
}


text:
Q: Блок со скошенной стороной Как сделать блок со скошенной стороной как на картинке?

Можно конечно было бы с помощью псевдо-элемента, со свойством transform: scewX() но фон у блока полу-прозрачный и в итого получается наложение друг на друга.
И еще вопрос: возможно ли на CSS сделать такой бордер:

Или все же только картинкой?

A: Что за странное стремление делать всё чрез CSS? Такие вещи нужно делать при помощи изображений. И с чего ты взял, что нельзя псевдоэлемент выдвинуть за рамку элемента-родителя?

.bg {
  padding: 20px;
  background: #37f;
  margin-top: 50px;
}

.text {
  color: #b00;
  font-size: 15px;
  background: rgba(255, 255, 255, .5);
  padding: 15px;
  margin-right: 50px;
  position: relative;
}

.text::after {
  content: '';
  position: absolute;
  left: 100%; top: 0;
  width: 0;
  border-top: 47px solid rgba(255, 255, 255, .5);
  border-right: 50px solid transparent;
}

    Блаблабла

По поводу второго вопроса:
Сума не сходи, какой бордер? У тебя принцип не использовать изображения? Ты конечно можешь использовать какое-нибудь свойство типа border-image, но даже в таком случае, тебе нужна будет картинка. Не усложняй вёрстку, всё это можно сделать простыми методами.

A: В css есть border-image, но поддерживается пока не везде.
пример скоса с помощью псевдо элемента:

.hh {
  background: rgba(0, 0, 0, .5);
  width: 300px;
  position: relative;
  height: 2em;
  }
  .hh:after {
    box-sizing: border-box;
    position: absolute;
    content: '';
    width: 2em;
    height: 100%;
    left: 100%;
    top: 0;
    border: 1em solid rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 0, 0, 0.5) transparent transparent rgba(0, 0, 0, 0.5);
  }

покупайте наших слонов


text:
Q: How to compute the first Fridays of each month given a list of dates as DateTime object in Python? Suppose I have a DateTimeIndex object in Python stored as trading_days:
DatetimeIndex(['2014-01-02', '2014-01-03', '2014-01-06', '2014-01-07',
               '2014-01-08', '2014-01-09', '2014-01-10', '2014-01-13',
               '2014-01-14', '2014-01-15',
               ...
               '2017-12-15', '2017-12-18', '2017-12-19', '2017-12-20',
               '2017-12-21', '2017-12-22', '2017-12-26', '2017-12-27',
               '2017-12-28', '2017-12-29'],
              dtype='datetime64[ns]', length=1007, freq=None)

I want to compute the first Friday of each month in this DateTime object. My desired output is another DateTime object with these dates for the first Fridays.
My attempt was the following:
all_fridays = trading_days[trading_days.day_name() == 'Friday']
first_fridays = all_fridays[np.remainder(np.arange(len(all_fridays)), 4) == 0]

But of course this code will fail if, for example, a certain month has 5 Fridays.
For example, the output I get from the code above is
DatetimeIndex(['2014-01-03', '2014-01-31', '2014-02-28', '2014-03-28',
               '2014-05-02', '2014-05-30', '2014-06-27', '2014-08-01',
               '2014-08-29', '2014-09-26', '2014-10-24', '2014-11-21',
               '2014-12-19', '2015-01-16', '2015-02-13', '2015-03-13',
               '2015-04-17', '2015-05-15', '2015-06-12', '2015-07-17',
               '2015-08-14', '2015-09-11', '2015-10-09', '2015-11-06',
               '2015-12-04', '2016-01-15', '2016-02-12', '2016-03-11',
               '2016-04-15', '2016-05-13', '2016-06-10', '2016-07-08',
               '2016-08-05', '2016-09-02', '2016-09-30', '2016-10-28',
               '2016-11-25', '2016-12-23', '2017-01-20', '2017-02-17',
               '2017-03-17', '2017-04-21', '2017-05-19', '2017-06-16',
               '2017-07-14', '2017-08-11', '2017-09-08', '2017-10-06',
               '2017-11-03', '2017-12-01', '2017-12-29'],
              dtype='datetime64[ns]', freq=None)

January 2014 is prone to the error I just described. And then everything gets screwed.
How can I do it in a efficient way? I feel that Pandas should have something like that already built in but I couldn't find it. Thanks a lot!

A: Not 100% sure how to re-create you sample DatetimeIndex, but we'll start with a simple bdate_range.
Subset to Friday then drop duplicates on the Year-Month period
import pandas as pd
trading_days = pd.bdate_range('2014-01-02', freq='C', periods=1007, weekmask='Mon Tue Wed Thu Fri')

fridays = trading_days[trading_days.dayofweek == 4]
fridays = fridays[~fridays.to_period('M').duplicated()]

#DatetimeIndex(['2014-01-03', '2014-02-07', '2014-03-07', '2014-04-04',
#               '2014-05-02', '2014-06-06', '2014-07-04', '2014-08-01',
#               ...
#               '2017-05-05', '2017-06-02', '2017-07-07', '2017-08-04',
#               '2017-09-01', '2017-10-06', '2017-11-03'],
#              dtype='datetime64[ns]', name='date', freq=None)

A: When you will find out the first Friday of the array, then the following logic can help you.
Lets say the first Friday was on 2014-01-03, then check the digit at 4th position from the end( i am considering '-' as a position ), now add 28 to the current index. If the received date also has the same digit at the 4th position from last as that of the previous one, then add 7 more to the index and that index will be the first Friday of the next month, else the index obtained by adding 28 will the first Friday of next month.
Here you are not required to check the 5th position as the last 3 months, i.e. 10, 11 and 12 , all have last digit different from their predecessors.
All the above explanation can be easily implemented using if else conditions in pyhton.

A: Here is a simple function that will extract the first Friday of each month (or fourth Thursday of each month, or...) from a pandas DatetimeIndex.  It's an excuse to use the itertools.groupby() function.
import pandas as pd
from itertools import groupby

def get_one_date_per_month(dates, rank='first', day_name='Friday'):
    rank_to_idx = {'first': 0, 'second': 1, 'third': 2, 'fourth': 3, 'last': -1}
    idx = rank_to_idx[rank]
    dates = [d
             for d in dates
             if d.day_name() == day_name]

    filtered_dates = []
    for k, g in groupby(dates, key=lambda x: x.strftime('%Y-%m')):
        t = list(g)
        filtered_dates.append(t[idx])

    return filtered_dates

Use the function like this:
# use your list of trading days, or `dates` for illustration:
dates = pd.date_range(start='2014-01-01', end='2017-12-31', freq='D')

get_one_date_per_month(dates)[:3]

# results are:
[Timestamp('2014-01-03 00:00:00', freq='D'),
 Timestamp('2014-02-07 00:00:00', freq='D'),
 Timestamp('2014-03-07 00:00:00', freq='D')]

A: Not sure this is better than the other answers already posted.  But I started with the dates in a DatetimeIndex as per your question:
index = pd.DatetimeIndex(pd.date_range('2014-01-02', '2017-12-19'))  # some dates
dates_by_month = index.groupby(index.to_period("M"))
first_fridays = pd.Series({period: dates[dates.weekday == 4][0]
                           for period, dates in dates_by_month.items()})
first_fridays.head()

2014-01   2014-01-03
2014-02   2014-02-07
2014-03   2014-03-07
2014-04   2014-04-04
2014-05   2014-05-02
Freq: M, dtype: datetime64[ns]


text:
Q: Iseries qshell db2 truncate I'm on iseries V7. I'm trying to use the qshell db2 command with large data.
My command under qshell (strqsh):
$ db2 "select data from mytable"
Works fine except when data is bigger than 4096 characters : in that last case the output is always truncated to 4096 bytes (batch or interactive have the same behaviour)
Anyone as any clue about how to deal with date larger than 4096 characters ?
(After many researches on Stdout, pipe, PIPE_BUF, Rfile, db2 limitation, ... I can't find any valuable reason why my datas are always truncated)
Any help would be very appreciated.
Gwenaeld