Responsive Ad Area

Month: June 2018

how can i make a PHP that shows on a limited number of views

I’m looking for a code that runs a php code in a different time of views, example i have this code <?php echo "Hello world!"; ?> now all i need to do is how to make this code open only to 100 or 200 first unique users ? and others just make them see blank page after 200 first opens.. I mean to be more specific run that page 200 times 200 unique users and 201 or 202….. and others see blank page! If you help me do this project you will make my day! Thanks..! how can i make a PHP that shows on a limited number of views how can i make a PHP that shows on a limited number of views test {$excerpt:n}

datepicker is not working in django?

#script added in base.html <script> $(function(){ $('.datepicker').datepicker({ format: 'mm/dd/yyyy', // startDate: '-3d' startDate: "2013-02-14 10:00", changeMonth: true, changeYear: true, yearRange: "1900:2012", uiLibrary: 'bootstrap4', autoclose : true, }); }) </script> -------------------------------- #My class "MessLeaveForm" in forms.py class MessLeaveForm(forms.ModelForm): departure_date = forms.DateField() arrival_date = forms.DateField(widget=forms.DateInput(format='%d/%m/%Y')) departure_time = forms.TimeField(widget=forms.TimeInput(format='%H:%M')) arrival_time = forms.TimeField(widget=forms.TimeInput(format='%H:%M')) verification = forms.ChoiceField(choices=BOOL_VALUES,initial="Pending",widget=forms.HiddenInput(),required=False) approval = forms.ChoiceField(choices=B...

NullPointer Exception at android.content.ContentResolver.openInputStream When Send Image To PHP Server

I modify from tutorial Android Upload Image to Server using Volley Tutorial in this tutorial, when user select an image, the script directly upload to server. so I modify that when the user select an image, the image display first on imageview, and then, when user click “sendtoserver” button, that image will send to server with the other EditText. first, I have finish with choose image button, and the image that I choose is showing on imageview. second, when I click the “sendtoserver” button, I got error about getContentResolver(), here my MainActivity Code package com.example.celmira.uploadgambar; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.net.Uri; import android.o...

Jquery UI DIalog margin too far to the right

I have a dialog that pops up on a form submit. It looks fine if the content is a small width, however, as the text grows, the left margin of the dialog is too far to the right. I need it to always be center, no matter the size of the content within it. The markup: <div id="dialog_confirm"> <p style="font-size:20px; color:white;"></p> </div> The jquery: $('#dialog_confirm').dialog({ autoOpen: false, modal: true, draggable: false, resizable: false, width: "auto", show: { effect: "blind", duration: 500 }, buttons: { 'Confirm': { text: 'Confirm', id: 'confirm_button', click: function () { $(this).dialog('close'); } }, 'Cancel': { text: 'Cancel', id: 'cancel_button', click: function () { $(this).dialog('close'); } } } }); The ‘width: auto’ part makes the cont...

Mongoose own schema methods don’t work with aggregation framework results

I am using the MEAN stack, and I have defined some own functions for my models in mongoose: DemoSchema.method({ tsFromID: function() { var datenow = +new Date(+new Date()+60*1000*60*2); var dateless15 = datenow - 1000*60*15; //console.log(new Date(datenow)); //console.log(new Date(dateless15)); //ist das als 15 Minuten? return +this.Timestamp >= +dateless15;}, checkID: function() {return this._id;} }); now, If I execute a query with mongoose / MongoDB to get document results back, I can only apply those methods with resultsets that were executed (found) by the “find” query method: DemoSchema.find({}).exec(function(err,result) { for (elem of result) { console.log("Alter:", elem.tsFromID()) } }),.. However, if I try to apply the method on document results that came from the ag...

Access global variables within python application from single import

So, what i’m trying to do is use the python interpreter as sort of a CLI for my server side python app. However, I’m getting a behavior i didn’t expect in the loading of python modules. I have two python files and a cache file: Main.py Config.py Cache.json So what happens is that when Main is imported and ran, the main() function imports Configs and then calls a function to initialize Config. When initialized Config loads some global variables from Cache.json depending on the environment i’m running in. Here’s a simplified example of the .py ‘s. #Main.py import Config def main(): """Initialize Python Application""" Config.init() if __name__ == "__main__": main() #Config.py import os import json Default_MSSQLPassword = "" Default_MSSQLUser = "" Default_Od...

Why does every worker node have different results using distributed Tensorflow implementation?

So I have this distributed Tensorflow code running in my cluster. I tweaked some of the line here: https://github.com/ischlag/distributed-tensorflow-example/blob/master/example.py and implemented a 3-fold cross validation. I was just wondering if Tensorflow implementation of data parallelism (which, afaik, was the type of parallelism in the github code above) would mean that each worker node would have different results at the end of training/testing? I wrote a simple regression model with DNN using distributed Tensorflow and it got me wondering why my worker nodes have different RMSE values at the end of the training/testing despite sharing the same seed for the initial values. Hope you help me out guys on this one! thanks! Why does every worker node have different results using di...

test 2

asdasdasdasd asdadsads  

WSO2IS – Broken after changing the hostname

We were forced to change the hostname of the WSO2IS from sso.domain.com to sso1.domain.com for reasons I could not avoid. I proceeded to manually update all of the configuration files to reflect the change. It also shows correctly inside of the carbon admin panel. I cannot log into the user dashboard. I also get the below java error in the wso2carbon.log: java.io.IOException: java.net.UnknownHostException: sso1.domain.com at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:467) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil...

Showing errors with Bootstrap Modals

I want to use Bootstrap Modals to create and update a record on the same index page so my index page looks like index.blade.php @include('create.blade.php') @include('edit.blade.php') these 2 views are just Bootstrap Modals the problem is in Laravel verification when I want to submit the form for creating a record it must show me the errors for the creating form and same to editing form I’ve tried something like @if(Session::has('errors')) <script> $('.modal').modal('hide'); $('#create-modal').modal({show: true}); // create-modal is the id for create modal </script> @endif Showing errors with Bootstrap Modals Showing errors with Bootstrap Modals test {$excerpt:n}

Infer Swift initialiser from a primitive value

I have the following Swift enum that ensures only pure json types are used. public enum JSONValue { case string(String) case integer(Int) case double(Double) case bool(Bool) public init(_ value: String) { self = .string(value) } public init(_ value: Int) { self = .integer(value) } public init(_ value: Double) { self = .double(value) } public init(_ value: Bool) { self = .bool(value) } } To initialise a JSON value, one has to do let json = JSONValue.string("my value") or in a case of a dictionary let params: [String: JSONValue] = [ "my string": JSONValue.string("my value"), "my int": JSONValue.init(10) ] Isn’t there a way to infer the initialiser from the primitive value to facilitate the usage like this: let json: JSONValue = "my value" let params: [String: JSONValue] = [ "my string"...

shouldComponentUpdate won’t be called

I want my Video component not to rerender by returning false in shouldComponentUpdate. However shouldComponentUpdate is not being called. And the component is being rerendered. Expected behaviour: when clicking on the video (clickHandler), shouldComponent will be called and returns false. Actual behaviour: when clicking on the video (clickHandler), the component rerenders and logs ‘render component’. Below you can find my code: class Video extends Component { shouldComponentUpdate() { console.log('shouldupdate video'); return false; } clickHandler = () => { if (this.props.controls) { this.props.toggleVideoPlayer(); } } render() { console.log('render component'); return ( <div className={s.container} onClick={this.clickHandler}> <video className={s.video} ref={this.v...

  • 1
  • 2