Posts

Showing posts from March, 2013

javascript - When would someone need to create a deferred? -

it seems creating deferred objects commonly discouraged in favor of using es6-style promise constructor. there exist situation necessary (or better somehow) use deferred? for example, on this page , following example given justification using deferred: function delay(ms) { var deferred = promise.pending(); settimeout(function(){ deferred.resolve(); }, ms); return deferred.promise; } however, done promise constructor: function delay(ms) { return new promise(function(resolve, reject){ settimeout(function(){ resolve(); }, ms); }); } does there exist situation necessary (or better somehow) use deferred? there no such situation deferred necessary. "better" matter of opinion won't address here. there's reason es6 promise specification not have deferred object. you don't need one. people used use deferred object can always done way doesn't use deferred object. first of...

httpwebresponse - VB.Net HttpWebRequest.GetResponse always timeout -

i'm getting time out code. the post https , works fine, never response, i try httpwebrequest , webrequest, more timeout, no response can me? >system.net.servicepointmanager.certificatepolicy = new trustallcertificatepolicy() > >req = httpwebrequest.create(url) >req.method = "post" >req.timeout = 60000 > >dim bytearray = encoding.utf8.getbytes(url) > >req.contenttype = "text/xml" > >req.contentlength = bytearray.length > >dim datastream stream >datastream = req.getrequeststream() > >datastream.write(bytearray, 0, bytearray.length) > >datastream.close() >datastream.dispose() > >dim response httpwebresponse = nothing > ><b>response = req.getresponse() '---->>> timeout here </b> > >datastream = response.getresponsestream() > >dim reader streamreader >reader = new streamreader(datastream) > >dim responsefromserver string >responsefro...

javascript - Automate the Import Function from Google Sheets -

is there way automate import function google sheets in javascript? something like: <!doctype html> <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> var datadestinationurl = 'https://docs.google.com/spreadsheets/d/1s3pu-sr4bwabtqkyx2bdlzicf8snko5d6v6o-ysot7g'; var datasource = 'c:\myexcel.xlsx' function importdata() { datadestinationurl.import (datasource) } </script> </head> <body> <input type="button" onclick="importdata" value="submit" /> </body> </html> what i'm looking this: https://www.dataeverywhere.com/use-excel-sheets but because corporation restrictions cannot have adds-on. however, can program script...

c++ - Initialize a vector inside a struct -

i have following struct: struct msgproperties { dword msgsize; std::vector<byte> vbuffer; //-constructor msgproperties(dword = 0) : msgsize(a){} }; i want use struct c++ vector i've done: std::vector<msgproperties> readtext; byte buffer[max_buffer_size]; dword bytesread; { bytesread = myfile.read(buffer, max_buffer_size); readtext.push_back(msgproperties(bytesread, std::vector<byte>((byte*)buffer, (byte*)buffer + bytesread))); } while (bytesread > 0); but can't figure out how make work correctly. can tell me missing? looks need 2 constructors: msgproperties(dword a, const std::vector<byte>& vec) : msgsize(a), vbuffer(vec) {} msgproperties(dword a, std::vector<byte>&& vec) : msgsize(a), vbuffer(vec) {} alernatively, single constructor too: msgproperties(dword a, std::vector<byte> vec) : msgsize(a), vbuffer(std::move(vec)) {} on side note, not see why need me...

google play services - Use Android DataBinding plugin parallel to GoogleServices plugin -

was able use android databinding plugin parallel googleservices pluginplugin? dependencies { classpath 'com.android.tools.build:gradle:1.3.1' classpath 'com.google.gms:google-services:1.4.0-beta3' classpath 'com.android.databinding:databinder:1.0-rc1' } apply plugin: 'com.google.gms.google-services' apply plugin: 'com.android.databinding' and whole project exploded. when remove services plugin databinding works. this gradle's stacktrace. [data binding plugin]: failed setup data binding java.lang.nosuchmethoderror: com.android.build.gradle.appextension.getapplicationvariants()lorg/gradle/api/internal/defaultdomainobjectset; @ android.databinding.tool.databinderplugin.createxmlprocessorforapp(databinderplugin.java:233) @ android.databinding.tool.databinderplugin.createxmlprocessor(databinderplugin.java:200) @ android.databinding.tool.databinderplugin.access$200(databinderplugin.java:65) @ android.databin...

python - Assign one docker instance to each client -

i have docker instance exposes port host. host reserves port b docker instance, , client connecting port b on host communicating docker on port without knowing it. currently, 1 client can access docker instance. want able manage multiple clients, each of them having own instance. server (python fine) receive connections clients on port (e.g. port 5555 all clients) , redirect each client own docker instance seamlessly. this has exist, because basic stuff server, seem lack vocabulary find online. name of such system, , 1 exist? i think need proxy server listen port a. when client connects port she/he redirected port b without noticing it. example docker apache server listen port 80 , forward request server e.g tomcat listens port 8080. eg. docker run --name tomcat run -d tomcat docker run -v path/to/your/httpd.conf:/usr/local/apache2/conf/httpd.conf --name proxy -d --link tomcat:tomcatserver -p 80:80 httpd your httpd.conf should this: # put after other loadmodule ...

fpga - VHDL button debouncing in state machine application -

i'm programming fpga board w/ lattice xp2-5e chip. on board 4 rows , 2 columns of led lights i'm trying control 4 directional push-buttons , 1 reset push-button. instance, if (1st row/1st column) led turned on , if press button right, (1st row/2nd column) led turn on , (1st row/1st column) led turn off. since there no hardware debouncing circuit implemented, need implement software solution. tick rate 25 mhz , minimal button hold time 25 ms. code shown below: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity sklop port ( btn_center : in std_logic; btn_left : in std_logic; btn_right : in std_logic; btn_up : in std_logic; btn_down : in std_logic; clk_25m : in std_logic; led : out std_logic_vector (7 downto 0)); end sklop; architecture behv of sklop type state_type (s0, s1, s2, s3, s4, s5, s6, s7); signal curs : state_type := s0; signal nxts : st...

php - Getting a whole bunch of server output along with wanted output -

when run php script end page says this: 2015-09-29 22:01:01 server -> client: ....[alot of server stuff] message has been sent. thank contacting us. in touch soon. i want message has been sent text show reason showing whole connecting smtp ,sending message stuff. code follows: <?php if(isset($_post['email'])) { $email_subject = "new customer requesting information/appointment"; function died($error) { // error code can go here echo "we sorry, there error(s) found form submitted. "; echo "these errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "please go , fix these errors.<br /><br />"; die(); } if(!isset($_post['first_name']) || !isset($_post['last_name']) || !isset($_post['email']) || !isset($_post['telephone']) || !isset($_post['...

mysql - Calculating the sum of the table row from one table then join it with another table -

sorry,i'm not sure if i'm asking right questions want happen. have table called tbemp: empnumber | name | value1 | value2 | value3 | e-001 | emp1 | 10 | 15 | 27 | e-001 | emp1 | 23 | 17 | 12 | e-001 | emp1 | 34 | 76 | 87 | e-007 | emp2 | 1 | 54 | 87 | e-007 | emp2 | 3 | 12 | 45 | e-007 | emp2 | 90 | 45 | 98 | then output this: empnumber | name | value1 | value2 | value3 | e-001 | emp1 | 67 | 108 | 126 | e-007 | emp2 | 94 | 111 | 230 | something this select empnumber, name, sum(value1) svalue1, sum(value2) svalue2, sum(value3) svalue3 tbemp group empnumber, name

latex - Duplex label and tics in gnuplot (epslatex) -

Image
i trying draw graphs reading values file, using epslatex - gnuplot (version 5.0 patchlevel 1), follows: # gnuplot.gp set term epslatex set output "figure.tex" set xlabel "x" set ylabel "y" set nokey set size square set xrange [0:1.0] set yrange [0:1.0] for[idline = 1 : 4 : 1]{ a1 = system("cat data.dat | awk 'nr == ".idline." {print $1}'") a2 = system("cat data.dat | awk 'nr == ".idline." {print $2}'") plot x**a1 + a2 lines lt 1 lc rgb "black" } and data is # data.dat 1.0 0.0 2.0 0.0 3.0 0.0 4.0 0.0 though managed draw figure i've wanted, there still problem labels getting bolder single plot (please see figures below, hope image quality enough tell difference ...). seems these phenomenon occur due duplex letters of several times plotting. i have tried several way avoid problem, non of these didn't work. there smart way avoid problem? in case ...

php - Select SQL query from two different tables but same database -

i select sql query 2 different tables. both tables in same database. this sql code , "air, temp, humidity, mq2" 1 table known "pi_sensors_network" while "dust" table known "pi_dust_sensor". may know how go selecting air, temp, humidity, mq2, dust 2 different tables same database? thanks! on side note, there no relation between both tables. want fetch data 2 different tables. $sql = "select air, temp, humidity, mq2, dust pi_sensors_network order time desc limit 1"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row just use alias each table: select t1.air, t1.temp, t1.humidity, t1.mq2, t1.dust dust1, t2.dust dust2 pi_sensors_network t1, pi_dust_sensor t2 order time desc limit 1";

php - small social networking for university assignment -

Image
i doing university assignment, making small social networking website. stuck on student search page. if don't search , shows default 20 students. if want search name, fine. however if want add friend, create problem. have while loop outing add friend button, when add friend, should output request sent or added particular student student, tried many different know didn't workout. <?php try{ include('includes/connect.php'); $user_id = $_session['id']; $found = 'false'; $sql = "select * requests user_id = $user_id"; $stmt_request_status = $connection->prepare($sql); $stmt_request_status->execute(); if($stmt_request_status->rowcount()) { $request_result = array(); while($request_row = $stmt_request_status->fetchobject()){ $request_result[] = $request_row->...

apache - Rewrite url page not found .htaccess -

i'm trying rewrite url .htaccess beautify urls i'm getting page error. surprises me it's working on friend's machine using xampp , i'm using apache on linux machine. # turn rewrite engine on rewriteengine on # rewrite info.php?id=xx rewriterule ^photos/([0-9]+) info.php?id=$1 [nc,l] # rewrite profile.php?user=xx rewriterule ^user/([0-9a-za-z_-]+) profile.php?user=$1 [nc,l] # rewrite logout.php?redirec=xx rewriterule ^logout/([0-9a-za-z]+) logout.php?redirect=$1 [nc,l] the probable cause of error appears mod_rewrite not loaded. check apache's httpd.conf file, , search line: loadmodule rewrite_module modules/mod_rewrite.so if there # before it, remove , restart server.

php - woocommerce base location condition to match current user location -

i on this basically have condition set customers outside base location in woocommerce for instance, base location united kingdom so how make condition this if (user) = united kingdom { echo 'customer in uk'; } else { echo 'customer outside uk'; } thanks also how use this; wc_get_customer_default_location() wc_get_base_location() currently got , not working $country_match = wc_get_customer_default_location(); echo 'your location ' . $country_match['country'] . '<br>'; if ( $country_match ) { $default = wc_get_base_location(); if ( $default['country'] !== $country_match ) { echo 'country match<br>'; } else { echo 'country not match<br>'; } if ( $default['state'] && $default['state'] !== $state ) { echo 'state match'; } else { echo 'state not match'; } } else { echo 'false'; }

java - Spring 4. does getBeanFromClass trigger bean's constructor for prototype beans? -

spring 4. getbeanfromclass() trigger bean's constructor prototype beans? if so, should careful calling function, right? in code getbeanfromclass this: public static <t> t getbeanfromclass(class<t> abeanclass) throws beansexception { return getapplicationcontext().getbean(abeanclass); } thanks i'm assuming method. care applicationcontext#getbean(class) (which beanfactory#getbean(class) ) method. javadoc states return bean instance uniquely matches given object type, if any. so, yes, returns instance. prototype beans, it'll return newly created instance every time. do have careful? depends entirely on you're doing. if need prototype bean instance, need use (if you're working applicationcontext directly).

ios - Segue to next view controller after successful sign up -

i've searched , searched , searched not found solution. sign works not segue next view controller. heres code: import uikit import parse import bolts class signupvc: uiviewcontroller, uiimagepickercontrollerdelegate, uinavigationcontrollerdelegate { @iboutlet weak var profilepictureiv: uiimageview! @iboutlet weak var firstnametf: uitextfield! @iboutlet weak var lastnametf: uitextfield! @iboutlet weak var newusernametf: uitextfield! @iboutlet weak var newpasswordtf: uitextfield! @iboutlet weak var emailtf: uitextfield! @iboutlet weak var phonenumbertf: uitextfield! @ibaction func setprofilepicture(sender: anyobject) { let mypickercontroller = uiimagepickercontroller() mypickercontroller.delegate = self mypickercontroller.sourcetype = uiimagepickercontrollersourcetype.photolibrary self.presentviewcontroller(mypickercontroller, animated: true, completion: nil) } @ibaction func signupbutton(sender: anyobject) { let spinner: uiactivityindicatorview = uiacti...

Android DatePicker listener not triggering -

i'm using datepicker widget , can't seem listener trigger, i've put logs everywhere see happening doesn't seem realise date has changed main.java datepicker dp = (datepicker) findviewbyid(r.id.datepicker); dp.init(year, month, day, new ondatechangedlistener (){ public void ondatechanged(datepicker dp, int selectedyear, int monthofyear, int dayofmonth) { year = selectedyear; month = monthofyear; day = dayofmonth; updatetime(year, month, day); }; }); // setup initial values , reg. handler here section in xml measure <datepicker android:id="@+id/datepicker" android:layout_width="fill_parent" android:padding="5sp" android:gravity="center" android:layout_height="wrap_content"> </datepicker> try this datepicker dp = (datepicker) findviewbyid(r.id.datepicker); dp.init(year, month, day,datepickerlistener); and in datepickerli...

ios - I joined multiple images into a rope. How can I decrease the rope stretchiness? -

i created rope based off this tutorial, except rope has 1 ball attached on each end of rope. high level: how create rope. create array of sknodes append each rope segment (node) array add each node screen join each node form rope (then add ball on each end of rope) in program move ball around , swing rope around kind of stretchy pendulum. here's issue: if swing rope around hard, rope stretches much! how can decrease amount rope stretches? don't see method decrease elasticity of body. if there other information useful please let me know! in advance you can try these 2 methods. first method increase property frictiontorque of skphysicsjointpin class. the range of values 0.0 1.0. default value 0.0. if value greater default specified, friction applied reduce object’s angular velocity around pin. an example tutorial followed, before adding joint scene, modify frictiontorque : for in 1...length { let nodea = ropesegments[i - 1] ...

Docker Namespace in kernel level -

how differentiate pid 1,17 etc of docker containers host's 1,17 etc pid's , kernel changes happening when create new process inside docker container? how process inside docker can seen in host? how differentiate pid 1,17 etc of docker containers host's 1,17 by default, pid in different namespace. since issue 10080 , --pid host , container pids can stay in host's pid namespace. there issue 10163: "allow shared pid namespaces" , requesting --pid=container:id what kernel changes happening when create new process inside docker container note , update may 2016: issue 10163 , --pid=container:id resolved pr 22481 docker 1.12, allowing join container's pid namespace. no changes on kernel level, use of: cgroups or control groups. key running applications in isolation have them use resources want. union file systems provide building blocks containers

mysql - Rails search through `has_many :through` text fields -

let have 2 models association has_many :through between them. class category < activerecord::base has_many :category_recipes has_many :categories, through: :category_recipes validates :name, presence: true class recipe < activerecord::base has_many :category_recipes has_many :categories, through: :category_recipes validates :title, presence: true i want create search functionality using activerecord mysql database, allow users implement text search on recipe title , category name . now have just: @recipes = recipe.where('title ?', "%#{params[:query]}%") how can modify query search through both title of recipe , it's category names? recipe.includes(:categories).where('recipes.title :query or categories.name :query', query: "%#{params[:query]}%").references(:categories) see: specifying conditions on eager loaded associations

Android studio Fragment TabHost -

i want display fragmenttabhost in activity_main when button clicked.when click it, shows "unfortunately fragtabhost has stopped".below code. please me!! mainactivity public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button button=(button) findviewbyid(r.id.button); button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { testfragment fragment=new testfragment(); fragmentmanager fragmentmanager=fragment.getfragmentmanager(); fragmenttransaction transaction=fragmentmanager.begintransaction(); transaction.replace(r.id.relative,fragment); transaction.commit(); } }); } @override public boolean oncreateoptionsmenu(menu menu) { ...

tomcat - spring-boot executable war keystore not found -

i build spring-boot executable war ssl support. application.properties file is: server.port = 8443 server.ssl.key-store = classpath:keystore.jks server.ssl.key-store-password = secret server.ssl.key-password = another-secret war file contains 'keystore.jks' file. strange exception: org.springframework.context.applicationcontextexception: unable start embedded container; nested exception org.springframework.boot.context.embedded.embeddedservletcontainerexception: not find key store classpath:keystore.jks caused by: java.io.filenotfoundexception: class path resource [keystore.jks] cannot resolved absolute file path because not reside in file system: jar:file:/d:/projects/vi3na/vi3na.web/target/vi3na.war!/web-inf/classes!/keystore.jks what sign '!' mean in path 'd:/projects/vi3na/vi3na.web/target/vi3na.war!/web-inf/classes!/keystore.jks' update: result of this enhancement request , limitation described below no longer applies. tomcat 8.0.2...

Install libssl-dev for Rails on Window 8.1 -

i'm having error when running gem tweetstream terminate called after throwing instance of 'std::runtime_error' what(): encryption not available on event-machine i understand has libssl. how install libssl-dev on windows? is there equivalent of ubuntu's aptitude install libssl-dev windows or gem?

vba - inserting ini File into word with formatting -

i have small bit of vba code works , inserts file specific bookmark within word, i'm struggling format text file gets inserted, either use format of bookmark or use specify format on insert. working code file_purchase_inv_def = harvdir + "\v1live" + "\purchase_invoices.def" selection.range.insertfile filename:=(file_purchase_inv_def) orng = activedocument.bookmarks("bk_puchase_invioces").range orng.select selection.range.insertfile filename:=(file_purchase_inv_def) the format i'm trying use "verdana" , font size "7" have tried formatting area of bookmark , below code. not working example1 file_purchase_inv_def = harvdir + "\v1live" + "\purchase_invoices.def" selection.range.insertfile filename:=(file_purchase_inv_def) orng = activedocument.bookmarks("bk_puchase_invioces").range orng.select selection.range.insertfi...

Django Invalid JSON Response -

the following code produces json given below. when validate json lint, invalid. doing wrong here? def json_candidate_get(request, model, m_id=none): response = {'message' : 'incorrect json'} try: obj = model.objects.filter(pk=m_id) ce = candidate_profiles.objects.filter(pk=m_id) cw = candidate_company_profiles.objects.filter(pk=m_id) response = json.dumps({ 'technologiesvalue':[],'technologies': [] }) except exception e: logging.exception("exception"+str(e)) return response @is_login() def candidate_create(request,m_id=none,token=none): response_data = {'message': 'unsuccessfull'} if token not none: try: if request.method == 'get': response_data = json_candidate_get(request,candidates,m_id) print response_data #response_data = serializers.serialize('json', response...

php - input sanitation for select option fields necessary? -

following situation: have form dropdown lists populate database. there's text input field. form sent via post. i'm wondering is, necessary sanitize $_post variables (besides text input field, of course) before putting them in sql query? after all, it's not user input if came drop down list created. $_get understand recommendation possible manipulate variables being sent. afaik, that's not possible post. faking post easy faking get . so, yes, input sanitation needed. you can fake using curl ( http://php.net/manual/en/intro.curl.php ), insanely easier edit simple html page, copy & paste code in it, replace values of dropdown whatever value want keeping address in action property of form tag, , form send garbage unprotected script.

Make custom seek bar with dots android -

i want make custom seekbar dots become black after passing level this... http://s9.postimg.org/ib3iyg73z/requ.png you can use https://github.com/karabaralex/android-comboseekbar requirement .its similar desire output . please have here how make segmented seekbar/slider following?

Compiled PHP with pthreads in Debian -

Image
i compiled php-7.0.0rc1 pthreads in debian without error according http://php.net/manual/en/pthreads.installation.php#114837 . then listed php modules 'php -m ' command , pthread listed there, inistalled correctly. after test it, used following simple code: <?php class cls extends thread { } ?> but have error below: and if remove 'extends thread' run no error. any appreciated. you allowed load latest version of pthreads in cli. if aren't getting error, aren't using latest release.

json - AngularJS using $resource service. Promise is not resolved by GET request -

let's service this: services.factory('user', function($resource){ return $resource('/rest/usersettings/:username', {}, { get: {method: 'get'}, update: {method: 'post'} }); }); so supposed used this: scope.user = user.get( {username: 'bob'} ); // console.log( json.stringify(scope.user) ) // {"$promise":{},"$resolved":false} so, when send request, goes ok, building ur + params: http://localhost:9000/rest/usersettings/bob question, why have: {"$promise":{},"$resolved":false} if request leads json-response server: {"username":"bob","email":"bob@bobs.com"} i'm expecting have scope.user filled data. should wait somehow promise ready / resolved ? user.get( {username: 'bob'} ) not return actual data immediately. returns hold data when ajax returns. ...

ios - How to update Fabric & Crashlytics? -

i installed fabric , crashlytics framework using fabric app , not cocoapods. needed update comply error , future. /crashlytics.framework/crashlytics(crashlyticsplaceholderstatic.o)' not contain bitcode. must rebuild bitcode enabled (xcode setting enable_bitcode), obtain updated library vendor, or disable bitcode target. architecture arm64 and i've read update fix issue. thanks! mike crashlytics , fabric here. if updated crashlytics 3.3.1 , fabric 1.5.1, frameworks support bitcode enabled app. release notes here.

c# - How to generate Radio Buttons With Scaffolding -

i googled couldn't find out couldn't find resource or tutorials , wanna make sure if each , every controls can populated mvc scaffolding or not. beginner in mvc appreciated. i guess possible generate every control in way , generated weird control byte datatype <input class="text-box single-line valid" data-val="true" data-val-number="the field active must number." data-val-required="the active field required." id="active" name="active" type="number" value="">

c - Iterating with sscanf -

i not know sscanf function, trying iterate through line of integers. given variable char *lineofints i have made line registers users input. able input fine, when try use sscanf, want iterate through every int. know can account through ints if know how many ints there before hand this.. sscanf(lineofints, "%d %d %d..etc", &i, &j, &k...) but if don't know how many integers user input? how can account of integers 1 variable? like sscanf(lineofints, "%d", &temp); //modifying int // jump next int , repeat thanks! maybe : #include <stdio.h> int main(void) { const char * str = "10 202 3215 1"; int = 0; unsigned int count = 0, tmp = 0; printf("%s\n", str); while (sscanf(&str[count], "%d %n", &i, &tmp) != eof) { count += tmp; printf("number %d\n", i); } return 0; }

css - How to set a radio-button label to 'checked'? -

i've total of 3 radio buttons tiny rating. don't 'normal' radio buttons, i'm using font-awesome icons instead. how can mark them checked, when user clicks on 1 of these: <input id="rate-bad" name="rate" type="radio" value="bad" tabindex="5"> <label class="choice" for="rate-bad"><i class="fa fa-frown-o fa-3x"></i>bad</label> the input button set invisible. is there 'choice::checked' can used? you can check jquery. for example <input id="rate-bad" name="rate" type="radio" value="bad" tabindex="5"> <label id="bad" class="choice" for="rate-bad"><i class="fa fa-frown-o fa-3x"></i>bad</label> jquery: $("#bad").click(function() { $("#rate-bad").prop('checked', true); });

ios - Suppressing warnings in Xcode 7 -

until in xcode 6 able suppress warnings external libraries using pragma directives, this: #pragma clang diagnostic push #pragma clang diagnostic ignored "-wdocumentation" #import "swifttoobjectivec-swift.h" #pragma clang diagnostic pop since updated project xcode 7 directives seem nothing, documentation warnings on swifttoobjectivec-swift.h. has idea problem? thanks!

encryption - Should sensitive information such as credit card number be encrypted even when transmitting using https? -

this in context of application in cloud communicating internal application through vpn on https connection. (both applications of same organization) so, when using above things, required add additional layer of security encrypting credit card information other application needs decrypt using predefined key? if dealing credit card numbers need follow pcidss . 4.1 states when sending cardholder information on open or public networks must "appropriately" encrypted. states https (so ssl/tls must enabled). i appreciate not limiting question credit card information. i things https absolutely fine. have had encrypt second user's password before (to validate information on form first user entered, bit signature) not related talking using https , encryption with. your question might worth posting on @ security.stackexchange

html - Strange Media Queries behaviour in Firefox -

something strange happens when use media queries in firefox. <div style="width:100px;height:100px;" class="test"></div> @media (min-width: 701px) { div.test { background-color: yellow; } } @media (max-width: 700px) { div.test { background-color: blue; } } what expecting happen here test-div have blue background when window <= 700px, , test div become yellow when window >= 701px. here's jsfiddle: https://jsfiddle.net/wmtanujf/embedded/result/ if open fullscreen (in firefox, latest version) , use ctrl+shift+m, can set window size example: 702 x 300, , notice doesn't set background. why happen? i think have problem version of firefox. have update firefox version latest update

Creating a View on table create in SQL Server -

i have been looking how create pre defined view on table every time created within sql server. a nightly job truncates database , recreates schema looking create view then. know table name , structure though possible. the way have been trying achieve though ddl triggers cant seem working. or steer on @ next appreciated.

c# - Windows phone 8 - Sending push notification works from Web Form but not from Phone -

i made web service can send push notification depending on this tutorial . when call function web form, works perfectly. however, when call same function phone don't receive notification @ although response "received | active | connected". function : [webmethod] public void sendnotification(string title, string msg, string url) { try { string subscriptionuri = getnotificationurl(); httpwebrequest sendnotificationrequest = (httpwebrequest) webrequest.create(subscriptionuri); sendnotificationrequest.method = "post"; string toastmessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<wp:notification xmlns:wp=\"wpnotification\">" + "<wp:toast>" + "<wp:text1>" + title + "</wp:text1...

c# 4.0 - not able to save documents in mongodb c# with .Net driver 2.0 -

i want save document in collection method below not saving @ all. internal static void initializedb() { var db = getconnection(); var collection = db.getcollection<bsondocument>("locations"); var locations = new list<bsondocument>(); var json = jobject.parse(file.readalltext(@"..\..\test_files\testdata.json")); foreach (var d in json["locations"]) { using (var jsonreader = new jsonreader(d.tostring())) { var context = bsondeserializationcontext.createroot(jsonreader); var document = collection.documentserializer.deserialize(context); locations.add(document); } } collection.insertmanyasync(locations); } if made async , await runs lately, need run first , test data. for future reference, wait() @ end of async method work synchronously internal static void initializedb() { ...

axapta - Displaying different datasources on tab pages ax 2012 -

i have created form 2 tab pages take 2 different datasources, problem 2 tables used datasources not have relation , created query in init method of form links 2 tables. when open form, result not show 1 vendor in tab1 show customers vendor on tab2. almost newer create datasource query scratch, update query instead. you have join datasources, based on description, should linktype delayed. second have have dynalink between datasources, defined in init method of second datasource. public void init() { super(); this.querybuilddatasource().adddynalink(fieldnum(vendtable,party), custtable, fieldnum(custtable,party)); } there other ways accomplish this, 1 best often.

c++ - Cannot get back original values of image points after calibrating camera -

after calibrating camera using opencv 's calibratecamera method , obtaining parameters, when try reproduce original object points nonsensical output. here code: vector<vector<cv::point3f> > object_points; vector<vector<cv::point2f> > image_points; cv::mat cam_mat; cv::mat dist_coeffs; vector<cv::mat> rvecs, tvecs; std::vector<cv::point3f> t_3d; t_3d.push_back(cv::point3f(0.9, -3, 57.5)); t_3d.push_back(cv::point3f(1.45, -3, 57.5)); t_3d.push_back(cv::point3f(2, -3, 57.5)); t_3d.push_back(cv::point3f(0.9, -3, 53)); t_3d.push_back(cv::point3f(1.45, -3, 53)); t_3d.push_back(cv::point3f(2, -3, 53)); object_points.push_back(t_3d); std::vector<cv::point2f> t_2d; t_2d.push_back(cv::point2f(434, 362)); t_2d.push_back(cv::point2f(570, 362)); t_2d.push_back(cv::point2f(706, 325)); t_2d.push_back(cv::point2f(513, 574)); t_2d.push_back(cv::point2f(513, 574)); t_2d.push_back(cv::point2f(654, 557)); image_points.push_back(t_2d); cv::calibra...

python 2.7 - django haystack with elastic search - raise BulkIndexError -

i getting issue " raise bulkindexerror while running python manage.py rebuild_index ? here haystack configuration in settings.py file haystack_connections = { 'default': { 'engine': 'haystack.backends.elasticsearch_backend.elasticsearchsearchengine', 'url': 'http://127.0.0.1:9200/', 'index_name': 'haystack', #'silently_fail': false, }, } haystack_signal_processor = 'haystack.signals.realtimesignalprocessor' here search_indexes.py class productindex(indexes.searchindex, indexes.indexable): text = indexes.charfield(document=true, use_template=true) content_auto = indexes.edgengramfield(model_attr='title') def get_model(self): return product def index_queryset(self, using=none): return self.get_model().objects.all() here views.py def search_titles(): products = searchqueryset().autocomplete(content_auto=request.post.get('search_text', '')) re...

android - Cordova call JavaScript function from Java without webview -

how can call javascript function java. example have sayhello function in www/js/app.js. need write method in java call sayhello , give result using cordova. sayhello: function(name) { return "hello "+name; } try this //method exec javascript private static synchronized void executejavascript(final string strjs, cordovawebview mywebview) { runnable jsloader = new runnable() { public void run() { mywebview.loadurl("javascript:" + strjs); } }; try { method post = mywebview.getclass().getmethod("post",runnable.class); post.invoke(mywebview,jsloader); } catch(exception e) { ((activity)(mywebview.getcontext())).runonuithread(jsloader); } } assuming have class public class mycordovaplugin extends cordovaplugin you have method @override public void initialize (cordovainterface cordova, cordovawebview webview) { //and call method executejavascript(...

c# - IIS stops responding after recompile -

i have web app i'm developing under local iis (so not not visual studio embedded one). works fine, can go page page... but if change code , recompile, iis stops responding ~2 minutes. if attach debugger, there's no executing code, won't serve pages. if stop app pool in iis, 503 error instantly, prevented restarting app pool ~2 minutes error: cannot start application pool / there error while performing operation. / details: / service cannot accept control messages @ time. (exception hresult: 0x80070425) as can imagine, crippling productivity. started happening couple of days ago, haven't made changes code have though cause problem... , doesn't matter page touch , recompile anyway, takes long recover. nothing in event log. any clues start looking? add following line web.config: <compilation optimizecompilations="true" /> related article: http://www.dnnsoftware.com/community-blog/cid/135019/a-small-webconfig-setting-that-can-sa...

c# - comparing to columns looking for similarity -

i've got program looking @ files have changed in each svn commit highlight area has changed. i'm passing data has been retrieved svn , placed table in sql server database. what i'd compare paths see area has been effected. i've got table has path shows area has been effected. example: svn: branches/projects/enhancements2015q1/wmdb/wmdb.cs this path has been found code compare table branches/projects/enhancements2015q1/gem4/utilities/utilities.csproj = utilities branches/projects/enhancements2015q1/wmdb/wmdb.cs = wmdb trunk/src/gem 4/gem4/ui/forms/autorenderoptionsform.cs = ui so i'd find path found in svn has changed wmdb. any suggestions on how this

html - How to have radio button behaviour for divs while using angular? -

so i'm starting angular , filter list depending on div selected. they selected being cliked. suppose how radio buttons behave ugly , have designed div (not label) clicked. i've read can add label attribute , hide radio button have similar. suppose able add for on div bind it. what best way achieve angular way ? you find solution @ angular ui bootstrap goto buttons sections

symfony - InvalidArgumentException: The file "/var/www/html/secerp/app/config/config_.yml" does not exist -

i have problem after installation of fosuserbundle cannot access symfony anymore. every command returns [invalidargumentexception] file "/var/www/html/secerp/app/config/config_.yml" not exist. seems lost this->environment infomation of app/appkernel public function registercontainerconfiguration(loaderinterface $loader) { $loader->load($this->getrootdir().'/config/config_'.$this->getenvironment().'.yml'); } changes did before: [root@symfony secerp]# composer require friendsofsymfony/user-bundle "~2.0@dev" ./composer.json has been updated loading composer repositories package information updating dependencies (including require-dev) nothing install or update generating autoload files > incenteev\parameterhandler\scripthandler::buildparameters updating "app/config/parameters.yml" file > sensio\bundle\distributionbundle\composer\scripthandler::buildbootstrap > sensio\bundle\distributionbundle...