Posts

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -

i have other project broke somehow(i have no idea) , rebuilt app same file names , code , working fine. problem when go insert data database called texts error insert failed: method '/texts/insert' not found not know wrong because copied every line of code previous project , problem came wasn't there before. confuses me when create user accounts accounts.createuser() works fine. sendtext.js import react "react"; import {texts} "./../api/text"; import {withrouter} 'react-router-dom'; import {meteor} "meteor/meteor"; import {accounts} "meteor/accounts-base" class sendtext extends react.component{ send(e){ e.preventdefault(); let message = this.refs.message.value; let name = accounts.user().username if(name != ""){ if(message){ texts.insert({ name, message }); this.refs.m...

Python + rope: setting ignored resource patterns? -

the rope documentation says that: each project has set of ignored resource patterns but mention how configure list. how configure list of ignored resources project? every project has hidden subdirectory .ropeproject/ . take @ config.py file there. file documented.

bash - how to run simple php script from Daemon at CentOS? -

i need run simple php script every second in centos. told me should use daemon run php script every second in background. there guide how it? know nothing daemon , when search internet, looks complicated. anyone can help? this current code. keep running when run : php -q /check_status.php but when disconnect server, stops running. should keep running? !/usr/bin/php -q <?php require_once "system/daemon.php"; $daemon_options = array("appname" => "channel_usage"); system_daemon::setoptions($daemon_options); system_daemon::start(); while (true) { //some php code } sleep(1); ?> you can run command nohup infront of it, have continue executing if session ends. example: nohup ping google.com this keep pinging google if close ssh session. or can schedule cronjob doing following (change command own needs): echo "* * * * * /path/to/script.sh" >> /etc/crontab

design - Leaflet.js - How can I draw a polygon that automatically covers a group of markers? -

Image
i´m working leaflet.js , have lot of markers want polygon drawn automatically containing specific group of markers. there´s image: every marker has specific radio, if use it, this: but don't want that, want area contains markers, don't know how can that. you might want create convex hull. https://gis.stackexchange.com/questions/215137/how-to-create-a-convex-hull-with-leaflet-points : "the easiest way javascript use turf.js's convex functionality." a working sample - http://bl.ocks.org/ebrelsford/c31f61d39d2cd559e18a

c - Can't see the error -

for reason, can't see code faulty. #include <stdio.h> #include <stdlib.h> int main() { int age; printf("how old \n"); scanf("%s", &age); if (age > 18){ printf("you may enter \n"); } /* above program runs, prints "you may enter"*/ if (age < 18){ printf("nothing see here \n"); } return 0; } / thanks / hint: $ gcc main.c main.c: in function ‘main’: main.c:10:11: warning: format ‘%s’ expects argument of type ‘char *’, argument 2 has type ‘int *’ [-wformat=] scanf("%s", &age); ^ $

java - Prevent Depth First Search Algorithm from getting stuck in an infinite loop ,8 Puzzle -

so code works basic 8 puzzle problems, when test harder puzzle configurations runs infinite loop. can please edit code prevent happening. note have included code prevents loops or cycles. tried including the iterative depth first search technique, did not work. can please review code. /** implementation depth first search algorithm */ static boolean depthfirstsearch(string start, string out ){ linkedlist<string> open = new linkedlist<string>(); open.add(start); set<string> visitedstates = new hashset<string>(); // prevent cyle or loop linkedlist<string> closed = new linkedlist<string>(); boolean isgoalstate= false; while((!open.isempty()) && (isgoalstate != true) ){ string x = open.removefirst(); system.out.println(printpuzzle(x)+"\n\n"); jtr.append(printpuzzle(x) +"\n\n"); if(x.equals(out)){ // if x goal isgoalstat...

android - Getting a error with Firebase Cloud Messaging -

i'm starting firebase , trying kind of complex code saw on tutorial, , error, copied simple code, basic, i'm still getting same error, please me, i'm gonna put firebaseinstanceidservice , firebasemessagingservice , if need further information please let me know. the error i'm getting fatal exception: main process: com.bim.tech.construbimapp, pid: 30988 android.app.remoteserviceexception: bad notification posted package com.bim.tech.construbimapp: couldn't expand remoteviews for: statusbarnotification(pkg=com.bim.tech.construbimapp user=userhandle{0} id=0 tag=fcm-notification:250274573 score=0 key=0|com.bim.tech.construbimapp|0|fcm-notification:250274573|10184: notification(pri=0 contentview=com.bim.tech.construbimapp/0x1090077 vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=private)) @ android.app.activitythread$h.handlemessage(activitythread.java:1638) @ android.os.handler.dispatchmessage(handler.java:111) @ android....

javascript - Dynamically append multiple options selected into one select jquery -

i'm trying add options selected 1 select element another. i'm guessing it'll this. var selected = $("#selectwithoptions").append("<option'>" + options[selectedindex].value + "</option>"); this not work. the logic pretty straight-forward , can follow inline comments in js function: // fire function when dropdown item selected $('#dd1').change(function() { // grab text of selected item var selectedoption = $('#dd1 :selected').text(); // if not in second dropdown list, append if( $('#dd2 option').filter(function () { return $(this).text() == selectedoption; }).length <= 0 ) { $('#dd2').append('<option>'+selectedoption); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div>dropdown 1: <select id="dd1"> <option selected disabled>...

Calling a Google Script web app only available to users inside domain from another Google Script -

i have google script deployed web app, unfortunately due company policy, have deploy , make available inside domain, not anonymous. here's web app code function dopost(e) { var functionname = json.parse(e.postdata.contents).functionname; return contentservice.createtextoutput(json.stringify({result:functionname})) .setmimetype(contentservice.mimetype.json); } here's google script code i'm trying call web app through it, tried pass access token in request header. function callwebapp(functionname) { var response = urlfetchapp.fetch(url, { headers: { "authorization": "bearer " + scriptapp.getoauthtoken(), }, contenttype: 'application/json', mutehttpexceptions:true, method : 'post', payload:json.stringify({functionname: functionname}), }); logger.log(response) } you can use session service , filter out users not in company domain. for example: var user = session.g...

mysql - Inserting information into table in PHP (Issue) -

this question has answer here: fatal error: call member function bind_param() on boolean in php [duplicate] how mysqli error in different environments? 1 answer reference - error mean in php? 29 answers $stm2 = $conn->prepare("insert (onet, twot) values (?, ?)"); $userone ="netsgets"; $usertwo="netsgets2"; $stm2->bind_param('ss',$userone,$usertwo); $stm2->execute(); $stm2->store_result(); the code above should add netsgets , netsgets2 table of together. reason error. fatal error: call member function bind_param(). mean?

testing - How to test for leaking connections in a Go test? -

Image
after i've found leaks in program, i've solved problem. however, now i'm trying find out how " test " leaking connections in go test? question. i've tried change number of requests in test, didn't matter. no matter do, current number of tcp connections in test stay same. func testleakingconnections(t *testing.t) { getter := myhttp.new() s := newserver(ok) defer s.close() cur := tcps(t) := 0; < 1000; i++ { r, _ := getter.getwithtimeout(s.url, time.millisecond*10) r.body.close() } tries := 10; tries >= 0; tries-- { growth := tcps(t) - cur if growth > 5 { t.error("leaked") return } } } // find tcp connections func tcps(t *testing.t) (conns int) { lsof, err := exec.command("lsof", "-n", "-p", strconv.itoa(os.getpid())).output() if err != nil { t.skip("skipping test; error finding or ...

dependency injection - How can I abstract dependent type from base C# base project using microsoft identity framework? -

i have authentication project reuse. i have aspnetcore identity project called authentication intended reusable authentication project. if have looked @ aspnetcore identity implementation see type called usermanager application user class store implementation of user in aspnetusers database table. public class applicationuser : identityuser { } the problem having there controller in isolated authentication project called accountcontroller holds logging in/out, registering, , other related account actions. wish abstract application user out of project's class can change based on needs of project multiple solutions. the authentication project has startup class initiated follows within project in being used: authenticationstartup.configureservices<applicationuser, mydatabase> (services, configuration); as can see, subscribing project adds own implementation of applicationuser. next, comes configuration of identity references tapplicationuser in services.add...

eclipse - JSP not picking up CSS file -

i have created simple dynamic web project in eclipse mars, using spring. jsp referring css file css file not getting pickup. eclipse project folder structure: enter image description here here how, referring in jsp: my project structure same yours , refer css file via: href="css/anotherstylesheet.css"

php - passing variable value into where condition laravel 5.2 -

Image
im trying make condition variable value this. rekapcontroller@show public function show($tanggal) { $absen = absen::where('date(created_at)', '=', $tanggal) ->get(); } but when run code, show error column not found: 1054 unknown column 'date(created_at)' in 'where clause' (sql: select * absen date(created_at) = 2017-08-17) thanks you can used $absen = absen::where(db::raw("date_format(created_at,'%d/%m/%y')"), '=', $tanggal) ->get();

Name for domain service -

imaging have domain model named " service ". in case have domain service name " serviceservice " , it's confusing name. is alternative name "service"? why need add "service" it's name? , why name "service"? naming 1 should find out (single) responsibility of domain service. example, have goodservicepayingcustomerfilter or invoiceforservicegenerator .

sql server - Use Always Encrypted on decimal(18,2) -

i using new sql server 2016 feature - encrypted. cool , simple technology - not decimal type. when insert value, getting errors 1 ( zp_test - db name): operand type clash: decimal(4,2) encrypted (encryption_type = 'randomized', encryption_algorithm_name = 'aead_aes_256_cbc_hmac_sha_256', column_encryption_key_name = 'colomnkey', column_encryption_key_database_name = 'zp_test') incompatible decimal(18,2) encrypted (encryption_type = 'randomized', encryption_algorithm_name = 'aead_aes_256_cbc_hmac_sha_256', column_encryption_key_name = 'colomnkey', column_encryption_key_database_name = 'zp_test') statement(s) not prepared. my api written in c#, please see code maybe know solution. sql query creating table create table [dbo].[empinfo] ( [empid] [int] null, [natid] [nvarchar](max) collate cyrillic_general_bin2 encrypted (column_encryption_key = [colomnkey], encryption_type = randomized, algorithm ...

DataNucleus: duplicate plugin.xml in multiple jars on android -

on android, build apk: duplicate plugin.xml in following jars. compile group: 'org.datanucleus', name: 'datanucleus-core', version: '5.1.1' compile group: 'org.datanucleus', name: 'datanucleus-api-jpa', version: '5.1.1' compile group: 'org.datanucleus', name: 'datanucleus-rdbms', version: '5.1.1' how solve this? merge them? update merged 3 jars , plugin.xml described 1 jar, , created manifest.mf inside merged jar described. bundle-symbolicname: org.datanucleus;singleton:=true premain-class: org.datanucleus.enhancer.datanucleusclassfiletransformer when building android apk, jar manifest.mf discarded android build. @ runtime: java.lang.noclassdeffounderror: failed resolution of: lorg/datanucleus/enhancement/detachable; is error related manifest.mf? there workaround? example, rename manifest.mf can included in apk.

reactjs - Is React implementing the Actor Model? -

the actor model asserts individual actors can only: receive messages modify own local state create actors send messages actors addresses have received or have created. react asserts components can only: receive data through props modify own local state only send messages components have created passing props. in sense, react implementing subset of actor model, albeit in 1 direction (parent child)?

xamarin - How can we perform an action when as switch is changed in a TableView List? -

our application displays list of category groups: list<categorygroupwordcountvm> categorygroups; on screen looks this: sports 23 [switch on] hobbies 5 [switch on] countries 55 [switch on] occupations 0 [switch off] the rows objects this: public class categorygroupwordcountvm : observableproperty { public int id { get; set; } public string name { get; set; } public bool istoggled { get; set; } } page xaml: <contentpage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:japanese;assembly=japanese" x:class="japanese.categorygrouppage" x:name="categorygrouppage"> <contentpage.content> <tableview x:name="tableview" intent="settings"> </tableview> </contentpage.content> </contentpage> row xaml: <viewcell ...

Indefinitely returning the next Monday, Wednesday and Friday with Javascript or PHP -

i want indefinitely print next monday, wednesday , friday on webpage. at moment using javascript unsure how proceed days of following weeks. function nextmon(date) { var ret = new date(date||new date()); ret.setdate(ret.getdate() + (1 - 1 - ret.getday() + 7) % 7 + 1); return ret; } function nextwed(date) { var ret = new date(date||new date()); ret.setdate(ret.getdate() + (4 - 1 - ret.getday() + 7) % 7 + 1); return ret; } function nextfri(date) { var ret = new date(date||new date()); ret.setdate(ret.getdate() + (5 - 1 - ret.getday() + 7) % 7 + 1); return ret; } function nextsession(date){ var today = new date(date||new date()); //monday - wednesday if(today.getday() >= 1 && today.getday() < 3){ return nextwed(); } //wednesday - friday else if(today.getday() >= 3 && today.getday() < 5){ return nextfri(); } else{ return nextmon(); } } setinterval(fu...