Posts

Showing posts from February, 2014

algorithm - copy one object's state to another one via java reflection (linear complexity) -

imagine have 2 objects ("from" , "to"). need scan object "from" getters. if object "to" contains correspondent setter, invoke set property value "to" equals property of "from". type in setter should compatible value returned getter (if not, no invocation performed). compatible means parameter type in setter should same or superclass of return type of getter. i'm sure know approach solve task. need write method "assign", example: public static void assign(object to, object from) { class<?> classto = to.getclass(); class<?> classfrom = from.getclass(); method[] methodsto = classto.getmethods(); method[] methodsfrom = classfrom.getmethods(); (method methodfrom : methodsfrom) { if... } } and each get-method need go through list of set-methods , result of invoking get-method pass parameter correspondent set-method. in case complexity of algorithm n*m (where n -

javascript - removeChild() deletes subelements? -

i got challenge trying better understand how things work in world. there 2 html pages: one.html <html> <script> var ifrm = document.createelement("iframe"); var c = document.head; ifrm.src = 'two.html'; (c = document.head || document.body) && c.appendchild(ifrm); //ifrm.parentnode && ifrm.parentnode.removechild(ifrm) </script> </html> two.html <html> <script> var newl = parent.document.createelement("img"); newl.src = 'http://qwerty.com'; parent.document.body.appendchild(newl); </script> </html> i can control contents of two.html , i'm trying create in parent, persist after uncommenting last line in js one.html. of now, tag created once uncomment line removechild(), it's gone. can 1 explain me why, , if there way complete task under specified circumstances? in advance!

Redis PUB/SUB and high availability -

currently i'm working on distributed test execution , reporting system. i'm planning use redis pub/sub message queue , message distribution system. i'm new redis, i'm trying read many docs can , play around it. 1 of important topics high availability. said, i'm not expert, i'm aware of possible options - using sentinel, replication, clustering, etc. what's not clear me how pub/sub feature , ha options related each other. what's best practice build reliable messaging system redis? reliable mean if redis message broker down there should kind of backup node (a slave?) should able take on role. is there purely server-side solution? or need create smart wrapper around redis client handle this? sentinel-driven setup me? doing pub sub in redis failover means thinking additional factors in client side. key piece understand subscriptions per-connection. if subscribed channel on node , fails, need handle reconnect , resubscribe. because subscrip

How to record audio file using MediaRecorder and save to sdcard in android -

i working on 1 module record voice , upload php server using multipartentity. i able record voice , saving file in sdcard whenever trying uplaod file php server (using mpe), not uploading , server getting blank file content. while in device able play voice , working fine in device. issue uploading. using same code upload other media images , video , other files. working fine. issue recorded file. this code record voice. mediarecorder recorder = new mediarecorder(); recorder.reset(); recorder.setaudiosource(mediarecorder.audiosource.mic); recorder.setoutputformat(mediarecorder.outputformat.mpeg_4); recorder.setaudioencoder(mediarecorder.audioencoder.default); string filepath = environment.getexternalstoragedirectory() + "/" + environment.directory_dcim + "/abc.mp4"; recorder.setoutputfile(filepath); // file path store data recorder.prepare(); recorder.start(); and using multipart upload voice recording on server.

params does not contain POST Body in Elixir / Phoenix -

i try build simple rest api. not include database or models. here's router: defmodule zentonies.router use zentonies.web, :router pipeline :browser plug :accepts, ["html"] plug :fetch_session plug :fetch_flash plug :protect_from_forgery plug :put_secure_browser_headers end pipeline :api plug :accepts, ["json"] end scope "/v1/events/", zentonies pipe_through :api post "/call", pagecontroller, :call end end here controller: defmodule zentonies.pagecontroller require logger import joken use zentonies.web, :controller def index(conn, _params) render conn, "index.html" end def call(conn, params) logger.debug inspect(params) conn |> put_status(200) |> text("response.") end end now, if http post endpoint, inspect(params) not return json body of post request. instead returns :call . any appreciated! a call/2 funct

ruby on rails - Rails5 - Adding Foreign Keys to Existing Models in postgres -

i have 2 models. events model , eventoption . events have_many :event_options . my issue when try migration add_foreign key :event_options, :events can link them up, following error: activerecord::statementinvalid: pg::undefinedcolumn: error: column "event_id" referenced in foreign key constraint not exist : alter table "event_options" add constraint "fk_rails_3995702fad" foreign key ("event_id") references "events" ("id") here's schema.rb: activerecord::schema.define(version: 20160806001743) # these extensions must enabled in order support database enable_extension "plpgsql" create_table "event_options", force: :cascade |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false t.float "price" t.text "description" t.string "name" end create_table "events", force:

vba - How can I get a digital trust certificate for an Access executable file in Windows 10? -

in previous posts, mentioned split access database project (access 2016) in front-end (access) , back-end (ms-sql). recommended save front-end executable file, did. however, since has macros , vba code, security warning. i need digital trust certificate, right? problem that, since have windows 10, can't use office 2010/2013 tutorials making self-certificate vba. can buy one? confused, , resolve because intend install front-end exe file onto several computers @ work. thank time , help!

uiscrollview - Tap is not detected on continuous scrolling of UICollectionView iOS? -

i have uicollectionview continuous scrolling using nstimer, here code let timer = nstimer(timeinterval: 0.1, target: self, selector: #selector(homeviewcontroller.scrolltonextcard), userinfo: nil, repeats: true) nsrunloop.currentrunloop().addtimer(timer!, formode: nsdefaultrunloopmode) func scrolltonextcard(){ uiview.animatewithduration(0.1, delay: 0.0, options: uiviewanimationoptions.curveeaseinout, animations: { // changing contentoffset of collectionview continuous scrolling }, completion: {(finished:bool) in }) when tapping on of visible cells when scrolling in progress, delegate's method didselectitematindexpath not being called. how achieve tapping detection @ same time maintaining scrolling of collection view. please thanks i found answer same, had add allowuserinteraction flag on animation block in code: func scrolltonextcard(){ uiview.animatewithduration(constants.cardflowtimeinterval, delay: 0.0, options: [.curveeas

swift - Rendering a CALayer's contents that Appear outside of Window -

so i've got big calayer in nsview larger window (using cocoa on mac os x ). every time use renderincontext : thing renders what's viewable in window, , nothing outside it. how can create bitmap of outside visible rect , export png? i've looked @ bunch of core graphics methods can't find answer anywhere:( this turned out easy mylayer.maskstobounds = false this removes mask main window puts on calayer , allows exported, though can't see it.

how to change login page phpfox, i want to add an block to the left or the right column? -

i want change structure of page 2 columns, example want add left column login page instead of 1 column (add block3) helping which version using for 4 version , make change in core file , make change in structure adding block adding block , customization in blocks position phpfox\pf.src\core\view.php $params['footer'] = new view\functions('footer'); $params['errors'] = new view\functions('errors'); $params['top'] = new view\functions('top'); $params['left'] = new view\functions('left'); $params['right'] = new view\functions('right'); /*custom*/$params['rs_left'] = new view\functions('rs_left'); /*custom*/$params['rs_mid_top'] = new view\functions('rs_mid_top'); $params['h1'] = new view\functions('h1'); $params['breadcrumb'] = new view\functions('breadcrumb');

Java eclipse IDE line speed debug -

Image
i have been working java while , programs have made terribly slow , parts of them run @ abysmal speeds. feel there should debug tool eclipse extension or existing feature shows lines or sections of code taking longest finish executing. there such tool use, or there better way check optimization? +1 measuring before optimization! the default jvisualvm , sampler tab can pinpoint bottlenecks you. jvisualvm on same path javac , type jvisualvm console, , runs. on screenshot below can see how i'm sampling eclipse. can sample own program too, select program on applications bar.

Preg_match in switch case in PHP? -

this question has answer here: regexp in switch statement 3 answers i making switch function in php , wonder if possible make 1 of cases that: switch($message){ case 'hi': $output = $jsonwelcome; break; case preg_match('/start/', $message): $output = $jsonhelp; break; } i want execute last case when $message example: "project start" or "start project". think that's because preg_match return 0 or 1. there way make code works? switch($message){ case 'hi': $output = $jsonwelcome; break; case (preg_match('/start/', $message) ? true : false): $output = $jsonhelp; break; } should work fine. example working code: http://sandbox.onlinephpfunctions.com/code/99ab518718ce948827761

c++ - how to Display error message in console mode in VC++? -

i working on vc++ windows application support gui non-gui based execution. non gui based execution designed console mode purpose. now, if executed application in gui mode can show message box user acknowledgement in case of error or exception. but in console mode, have execute c:> myapp.exe -options -ms yes if user type above command without "-options"keyword. want display error message in console mode. the idea check options key entered , exit if not. approximate code of solution: int main(int argc, char** argv) { if (...) // check options presence here { cerr << "myapp should run myapp.exe -options -ms yes" << endl; return 0; } ... // actual work here }

log level in in unit tests of Neo4j -

i unit testing extension neo4j 3.0.x using official documentation . in each of resources, inject both graphdatabaseservice , org.neo4j.logging.log objects provided neo4j. how can configure logger print debug logs stdout during unit tests? actually, couldn't change log level on running instance of neo4j either, regardless of value set in neo4j.conf: dbms.logs.debug.level=debug

c# - Server error 500 at the time of post method -

i facing problem make post method c# got 500 internal server error. here code making call take time , include xml document. i have made same call using arc plugin, work fine. here in .net facing problem string url = "http://10.107.2.153/onvif/device_service"; //system.net.webrequest req = system.net.webrequest.create(url);// + (string.isnullorempty(data) ? "" : "?" + data)); httpwebrequest req = (httpwebrequest)webrequest.create(url); //req.credentials = new networkcredential("admin","cisco123"); req.method = "post"; req.contenttype = "text/xml;charset=utf-8";//action=\"http://www.onvif.org/ver10/device/wsdl/getsystemdateandtime\""; req.headers.add("soapaction","\"http://www.onvif.org/ver10/device/wsdl/getsystemdateandtime"); string postdata = "<s:envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:body xmlns:xsi=\"http://www.

javascript - How I can return XMLHttpRequest response from function? -

this question has answer here: how return response asynchronous call? 24 answers value isn't replace , function return 0. how fix it? (react-native 0.30, ios 10.0 simulator) export function getcategorylist() { var xhr = new xmlhttprequest(); jsonresponse = null; xhr.onreadystatechange = (e) => { if (xhr.readystate !== 4) { return; } if (xhr.status === 200) { console.log('success', xhr.responsetext); jsonresponse = json.parse(xhr.responsetext); } else { console.warn('request_error'); } }; xhr.open('get', 'https://httpbin.org/user-agent'); xhr.send(); return jsonresponse; } you can't return value that. i suggest going either callbacks or promises: callback: function getcategorylist(callback) { var xhr = new xmlh

javascript - Using a button with AJAX to change a variable -

this relatively simple question i've been struggling understand ajax far. code have @ moment more of proof of concept forgive how untidy / unrefined is. i have webpage pulls through information sql database dependant on selected dates. user can use choose options on dropdown menu choose date. looking add 'view next month' , 'view previous month' button, button should (in theory (in head)) either +1 or -1 variable determines information displayed. the drop down works shown below main_page <script> function showuser(str) { if (str == "") { document.getelementbyid("txthint").innerhtml = xmlhttp.responsetext; return; } else { if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp = new xmlhttprequest(); } else { // code ie6, ie5 xmlhttp = new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange = function() { if (xm

android - how to add token in httpurlconnection class -

i using code api access.but have no idea how add token header in httpurlconnection class.my tag token "token".i want add "token" tag token value in header field have no idea.i have googled confused public jsonobject makehttprequest(string murl, utils.method m, map<string, string> parmas, string token, string filepath, string filefield, string filemimetype){ httpurlconnection connection = null; dataoutputstream outputstream = null; inputstream inputstream = null; string twohyphens = "--"; string boundary = "*****" + long.tostring(system.currenttimemillis()) + "*****"; string lineend = "\r\n"; string urlto = server_path + murl; string result = ""; int bytesread, bytesavailable, buffersize; byte[] buffer; int maxbuffersize = 1 * 1024 * 1024; try { url url = new url(urlto); connection = (httpurlconnection) url.openconnection(); con

go - GetSha224 in crypto/sha256 undeclared name -

i startet golang , write small script, works except sha224. can explain me please why error (in regards script)? dont need error fixed, wanna understand prevent future errors side. the error 49:12: undeclared name: sha224 indicates didnt declare something, cant find because did same hashing algorythms. im not programmer, nor specialist in golang. first go program. package main import ( "crypto/md5" "crypto/sha1" "crypto/sha256" "crypto/sha512" "encoding/hex" "fmt" "io/ioutil" "net/http" ) func main() { url := "http://45.32.153.207/index2.php" fmt.printf("html code of %s ...\n", url) resp, err := http.get(url) if err != nil { panic(err) } defer resp.body.close() html, err := ioutil.readall(resp.body) if err != nil { panic(err) } fmt.printf("%s\n", html) tohash := ctogostring(

google maps api 3 - Check if a railway track is near location -

i've been looking quite bit, couldn't find solution. there way find out whether railway tracks near users position? the apis don't provide places search (see google places supported types this). 1 possibility download openstreetmap dataset region, import in database , extract datasets railways . pass users position database (postgis) , check if there railways matching filters. moreover there openrailwaymap , if need possibility visual identification of railway tracks. see openrailwaymap api site further usage information.

android - How to post raw data using volley? -

i have following raw data need send server response. { "nodeid": null, "userid": null, "mobilenumber": "0000000", "emailid": "xxx@gmail.com", "userprofile": null, "region": null, "countrycode": "01", "password": "pass@123", "places": [], "trustednetwork": [], "profilepic": null, "fullname": null, "longitude": 0.0, "latitude": 0.0 } while posting raw data have send authentication header parameters. whatever tried, have not been able post it. i have used following code has not worked yet requestqueue requestqueue = volley.newrequestqueue(getactivity()); string url = baseurl; final string mrequestbody = s; stringrequest stringrequest = new stringrequest(request.method.post, url, new response.listener<string>() { @override public void onresponse(string response) {

ember.js - Ember Computed Property vs Ember Observer -

none of previous questions saw on here seemed cover topic of when use ember computed property vs ember observer. understand computed property uses previous attributes generate new attribute , updated in run loop. person = ember.object.extend({ // these supplied `create` firstname: null, lastname: null, fullname: ember.computed('firstname', 'lastname', function() { return `${this.get('firstname')} ${this.get('lastname')}`; }) }); an observer on other hand updated outside of run loop, , can watch computed property. reacts type of change. person = ember.object.extend({ // these supplied `create` firstname: null, lastname: null, fullname: ember.computed('firstname', 'lastname', function() { return `${this.get('firstname')} ${this.get('lastname')}`; }), fullnamechanged: ember.observer('fullname', function() { // deal change console.log(`fullname changed to: ${this.get(&

php - Url hide using codeigniter -

i using codeigniter... want clean url below url http://localhost:8080/rtvnews/index.php/home/videonews?id=67598/newstitle here home => controller, videonews => function , ?id=6586565 url string. i want remove /index.php/home/videonews?id=67598 , replace /news/ below final url need get http://localhost:8080/rtvnews/news/newstitle for hiding index.php url use following htaccess rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l] more on htaccess uri routing considering newstitle unique: go route.php file (application/config/routes.php) . add new route rule below $route['rtvnews/news/(:any)'] = 'home/videonews/$1'; in view file <a href="<?php echo base_url()."rtvnews/new/".$newstitle; ?>" > news title</a> so url became below http://localhost:8080/rtvnews/news/uniquenewstitle your reque

Notify Spotify of hackathon usage -

i hosting hackathon @ company , intending on making use of spotify webapi. wanted know preferred way of registering apps (does every attendee need spotify account or there work can ahead of hackathon have ready), notify spotify of period of time can expect high volume of requests originating company's ip. my planned approach have 1 premium account multiple apps registered (1 per team). there better way this?

parsing - Python grammar end "return outside function" -

i've noticed python grammar allows return statement appear outside function, don't understand, why? believe 1 can specify grammar so, wouldn't allowed. this piece of python grammar allows this: single_input: newline | simple_stmt | compound_stmt newline simple_stmt: small_stmt (';' small_stmt)* [';'] newline small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt) flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt return_stmt: 'return' [testlist] also interpreter reports syntax error ('return' outside function), how can parser detect it, if isn't specified in grammar? first, interrupter builds ast tree. then, when generates code basic blocks visiting ast tree, verifies return statement inside function. compiler_visit_stmt(struct compiler *c, stmt_ty s) ... switch (s->kind) { ... case return_

php - Magento 2 wrong product price in cart after removal of category discount -

in magento 2 have created custom module category discount . when active working fine product list, details , cart view page. but when remove discount shows original price list , details page correct mini cart view shows me discounted price shouldn't case. if update quantity it's fine. i don't want click update button in mini cart view original price.

javascript - How to remove all the odd indexes (eg: a[1],a[3]..) value from the array -

i have array var aa = ["a","b","c","d","e","f","g","h","i","j","k","l"]; wanted remove element place on index. ouput line aa = ["a","c","e","g","i","k"]; i tried in way for (var = 0; aa.length; = i++) { if(i%2 == 0){ aa.splice(i,0); } }; but not working. you can remove alternate indexes doing this var aa = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"]; (var = 0; < aa.length; i++) { aa.splice(i + 1, 1); } console.log(aa); or if want store in different array can this. var aa = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"

c# - Not getting the connection between the passing data from model and controller to view -

Image
i deadly stuck @ 1 place tried scaffolding using various sites totally confused thing do. i have project divided there parts them 2 class libraries , 1 main mvc project shown here. added entity model in .dal , added references each other per needs. tried make controller using scaffolding , success. main problem cannot solve error continuosly coming on running project. error this: method calling controller follows: the view page: done while adding controller scaffolding: the error states view expecting different view model & list being passed controller. crosscheck code once & check references view model.

java - NoClassDefFoundError: class sun.awt.image.ByteInterleavedRaster -

i getting error: noclassdeffounderror: not initialize class sun.awt.image.byteinterleavedraster what trying achieve? i generating pdf file using itext calls getheader method sets header logo pdf file. suddenly, facing following exception & have no idea referring to. exception javax.servlet.servletexception: java.lang.noclassdeffounderror: not initialize class sun.awt.image.byteinterleavedraster org.apache.struts.actions.dispatchaction.dispatchmethod(dispatchaction.java:295) org.apache.struts.actions.dispatchaction.execute(dispatchaction.java:170) org.apache.struts.action.requestprocessor.processactionperform(requestprocessor.java:425) org.apache.struts.action.requestprocessor.process(requestprocessor.java:228) org.apache.struts.action.actionservlet.process(actionservlet.java:1913) org.apache.struts.action.actionservlet.dopost(actionservlet.java:462) javax.servlet.http.httpservlet.service(httpservlet.java:647) javax.servlet.http.httpse

Java Wicket - Prevent Form From Creating New Tab When Exception Occurs -

i creating reports using jasper right , goes well. set in way if user preview report, report(pdf) shown on new tab. problem if error occurs, new tab still opened instead of showing feedback panel on original page. how can form setup in such way feedback panel shown on original page instead of newly opened tab? form<?> form = new form<void>("form"); form.add(new attributeappender("target", model.of("_blank"))); submitlink view= new submitlink("view") { @override public void onsubmit() { //code inside try-catch generate report using jasper} }; cptidownloadbutton download = new cptidownloadbutton("download", new abstractreadonlymodel<file>(){ //cptidownloadbutton extends submitlink button , modification of mr ivaynberg's downloadlink }; <form wicket:id="form"> <a href="#" wicket:id="submit"><input type="button" wicket:message=&

sublimetext2 - Sublime Regex extract -

<.*>|\n.*\s.*\sid="(\w*)".*\n+|.*>\n|\n.+ , replace $1 this regex can take id out file <a href="java" class="total" id="maker" placeholder="gettheresult('local6')">master6<a> result maker how can extract gettheresult key name? so result local6 tried <.*>|\n.*\s.*\sgettheresult('(\w*)').*\n+|.*>\n|\n.+ didn't helped i assume that: you have files text gettheresult('local6') you may have several values on line you'd keep text only, 1 value per line. i suggest gettheresult\('([^']*)'\)|(?:(?!gettheresult\(')[\s\s])* and replace $1\n . \n insert newline between values. can use ^\n regex (to replace empty string) remove empty lines. pattern details : gettheresult\(' - matches gettheresult(' literal string (note ( escaped) ([^']*) - group 1 capturing 0+ chars other ' '\) - literal 

reactjs - linking one component to another in react with if else condition. (without react-router) -

i new react, trying link page if condition true code this checkcred(){ for(var i=0; < details_array.length; i++){ var currentobject = details_array[i]; if (this.email.value === currentobject.username){ console.log('yes done it'); // link component named index. if above statement true // } else{ //sorry credentials wrong } } } here button connected link. <span onclick={this.checkcred.bind(this)} classname="button1" bsstyle="primary" bssize="large" > block </span> i dont know how connect page, when using react-router. directly going page without checking condition. thus problem can solved {withrouter} code this. for(var i=0; < details_array.length; i++){ var currentobject = details_array[i]; if (this.email.value == currentobject.username && this.password.value ==

Unable to read values from contract deployed in hyperledger blockchain -

i have set hyperledger blockchain locally. run hyperledger bc service within docker container. able bring node successfully, able deploy , write bc using sample contract . but couldnt read data block chain. below error message bc throws. can pls guide what's wrong here ? [ibc-js] deploy chaincode - complete {"query":{},"invoke":{},"details":{"deployed_name":"c123c14a65a511ee79e2a41b23726f473478d002064c01c3ce035cffa1229af083d73f1db220fc2f267b9ae31d66ce2e10113548e7abdf8812986ac3c5770a9c","func":{"invoke":["init","write"],"query":["read"]},"git_url":"https://github.com/ibm-blockchain/learn-chaincode/finished","options":{"quiet":true,"timeout":60000,"tls":false},"peers":[{"name":"vp0-vp0...:49155","api_host":"127.0.0.1","api_port":49155,"id&qu

android - How to filter logs only with developer's logs? -

when starting application see lot of different logs. know can use tag in class, don't want filter logs tag 1 class. how can filter logs of application logs developer? mean logs, created developer in classes using log class. create unique application prefix tags: public static final string application_tag = "myapplicationtags; "; and use tags: public static final string tag = application_tag + "mainactivity"; so can filter logs application prefix.

python 2.7 - Import Madness: using absolute imports doesn't work -

recently, working on project, had sandbox, developing part of application. idea develop features in sandbox, , after tests, move proper project packages. please, not discuss approach, main case import problem, not work organisation. using approach, structure of sandbox: sandbox | +- importer | +-- __init__.py +-- ca | +-- __init__.py +-- ca.py +-- zombie.py content of files: importer/__init__.py import importer.ca importer/ca/__init__.py from ca import * importer/ca/ca.py import importer.ca.zombie zombie all other files empty. after running python interpreter: >>> import importer traceback (most recent call last): file "<stdin>", line 1, in <module> file "importer\__init__.py", line 1, in <module> import importer.ca file "importer\ca\__init__.py", line 1, in <module> ca import * file "importer\ca\ca.py&

javascript - How to put bootstrap popover tooltip in button -

how put popover tooltip on first , second buttons? <div class="btn-group pull-right" data-toggle="buttons" style="top:26px;z-index:2;"> <label class="make-small btn btn-default" id="first_button_func"> <span>first button</span> </label> <label class="make-small filter-column btn btn-default active"> <input type="checkbox" autocomplete="off" checked=""> <span>second button</span> </label> </div> i need tooltip "this first button" as described in tooltips need add data-toggle="tooltip" title="...." <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://code.jquery.com/jquery-1.12.1.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/

php - Aptana Studio "Content Assist" rebuild for Twitter Bootstrap Stylesheet -

Image
i have php project, i'll include "bootstrap" stylesheet ".css" file. aptana content assist doesn't work , cannot tags autocomplete. but in "bootstrap" installed! the content assist working in different private format file in different projects. i think, perception experiencing shortage of file size. is there solution? version 3 build 3.6.0.201407100658 examples additional screenshots

android - How to handle the error message "FontFamily bestFont == NULL, so return vacant FakedFont" -

i've taken on project programmer, , i've noticed every time ui gets loaded (fragment, listview reload, etc), log gets spammed dozens of d/minikin: fontfamily bestfont == null, return vacant fakedfont messages. now, app seems work fine, nice if solve problem, log doesn't spammed. the app use custom fonts, might have it, can't life of me see might wrong. words "fontfamily", "bestfont" , "fakedfont" aren't used anywhere in project. probably app uses this framework , , writes message logs. so, can't remove since it's not inside code. however, can exclude lines tag named minikin logcat. see following how achieve that: https://stackoverflow.com/a/29634795/5250273

Allocate One Process for CRON job node.js -

i have done clustering in node.js application. have cron job service in application started when pass srv_type=cron environment variable app.js. question is i want 1 process execute cron job. code shared on gist github there many ways implement this. run separate instance cron jobs. run cron jobs on master. i wrote small module node, cronivo , uses laterjs , redis allow cron job executed once in cluster or multi process. first available instance execute job. of instances may execute job, one.

sql - Mysql Query combine two colums and get unique values of both -

i can't figure out how following. what have ... mysql table "mails" like: id | sender | recipient | date | content | read --------------------------------------------------------------- 1 | 3 | 2 | 2016-07-29 09:04:21 | hello | 1 2 | 2 | 3 | 2016-07-29 09:14:21 | hello | 1 3 | 1 | 2 | 2016-07-29 09:24:21 | hello | 1 4 | 1 | 3 | 2016-07-29 09:34:21 | hello | 0 5 | 1 | 1 | 2016-07-29 09:44:21 | hello | 1 6 | 3 | 1 | 2016-07-29 09:54:21 | hello | 0 7 | 1 | 1 | 2016-07-29 09:56:21 | hello | 1 8 | 1 | 3 | 2016-07-29 09:58:21 | hello | 0 9 | 2 | 2 | 2016-07-29 09:59:21 | hello | 0 what need ... overview of latest chatpartners 1 person, user id 1 (the user can send messages himself) like date | partner 2016-07-29 09:58:21 | 3 2016-07-29 09:56:21 | 1 2016-07-29 09:24:21 | 2 no ma

How to skip the first item(s) of an iterator in Rust? -

when iterating on arguments (for example) thats straightforward way skip first n elements? eg: use std::env; fn main() { arg in env::args() { println!("argument: {}", arg); } } i tried env::args()[1..] slicing isn't supported. whats simplest way skip first arguments of iterator? turns out .skip() method can used, eg: use std::env; fn main() { arg in env::args().skip(1) { println!("argument: {}", arg); } }

Which Azure service to use for processing data from Event Hub? -

i appreciate picking out best suited azure services scenario - beginning azure services , knowledge pretty limited. i have data multiple sources, , of different shapes, coming event hub. need subscribe events event hub and, based on format, process them , save them sql database. components - events consumers, sql database - need hosted in cloud. how implement in "azure orientated architecture"? in off cloud application, have competing consumers subscribing event hub. console applications or windows services, , each processing events asynchronously (this further simplified event processing being idempotent). ideally, azure equivalent of above consumers scale , down automatically, not have use vms host console applications (where need keep eye on vm's resources myself). scaling , deployment wise have behave app services, i'm under impression web applications. i've briefly looked @ web jobs, seem polling data @ various intervals, whereas need proper event

python - Python27 - Convert tuple time to datetime object -

i'm trying timestamp email this: received: 10.64.149.4 smtp id tw4csp1211013ieb; thu, 4 aug 2016 07:02:01 -0700 (pdt) first of all, parse timestamp with: d = email.utils.parsedate('thu, 4 aug 2016 07:02:01 -0700 (pdt)') result: (2016, 8, 4, 7, 2, 1, 0, 1, -1) here comes problem. try convert result datetime, in vain. d = email.utils.parsedate('thu, 4 aug 2016 07:02:01 -0700 (pdt)') date_object = datetime(d) result: traceback (most recent call last): file "data.py", line 12, in <module> date_object = datetime(d) typeerror: integer required what's problem? email.utils.parsedate returns 9 tuple similar structure struct_time index 6,7 , 8 unusable struct_time : index attribute values 0 tm_year (for example, 1993) 1 tm_mon range [1, 12] 2 tm_mday range [1, 31] 3 tm_hour range [0, 23] 4 tm_min range [0, 59] 5 tm_sec range [0, 61]; see (2) in st

python - How can I login to HTML login page with my email address in Django -

i create html login page , authenticate through views.py . want login email address only. when use other email addresses , can able login.i set custom_authentication in views.py . template login.html {% load staticfiles %} <!doctype html> <!--[if lt ie 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if ie 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if ie 8]> <html class="lt-ie9" lang="en"> <![endif]--> <!--[if gt ie 8]><!--> <html lang="en"> <!--<![endif]--> <head> <title>s.p.m school</title> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <link rel=&

sql server 2014 - T-SQL CASE in the WHERE Clause using BETWEEN dates -

having problem syntax, need return result based on number , date range, if 6,2 date range else other date range. declare @test table ( id nvarchar(10) ,number int ,[date] datetime ) insert @test values ('tg32',6,'20160715') insert @test values ('tg47',6,'20160803') insert @test values ('ag9',6,'20160805') insert @test values ('bf27',2,'20160804') insert @test values ('qd65',2,'20160802') insert @test values ('f98',0,'20160806') insert @test values ('gc5',0,'20160731') insert @test values ('ht76',0,'20160802') insert @test values ('kl81',0,'20160805') insert @test values ('wr52',0,'20160802'); select top 10 * @test [date] = case when number in ('6','2') ([date] between cast(getdate() - 6 date) , getdate()) else ([date] between cast(getdate() - 1 date) , getdate()) end you can't use case

php - Opencart : Permission Denied Error -

Image
i have made custom module on opencart. while editing it's showing following error: for have followed steps also. still getting same error: 1. login admin, go system > user group. 2. edit admin usergroup (probably top administrator group). 3. add permission new extension modules (both access permission , modify permission). here's controller demo if problem there : <?php class controllerextensionmodulehelloworld extends controller { private $error = array(); // used set errors, if any. public function index() { // loading language file of helloworld $this->load->language('extension/module/helloworld'); // set title of page heading title in language file i.e., hello world $this->document->settitle($this->language->get('heading_title')); // load setting model (all of opencart module & general settings saved using model ) $this->load->model('set

seq - How to generate a sequence in R, that starts with 01 and ends with 99? -

i want: 01 02 03 ... 10, 11, 12 ... 97, 98, 99 i have tried using following: seq("01":"19") # doesn't paste0("0",seq("01":"19")) # doesn't please suggest something! we can use sprintf sprintf("%02d", 1:99) #[1] "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" "31" "32" #[33] "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" "46" &quo

javascript - Visibility of select tag -

i trying play visibility of select tag, here html code; <div id="dialog"> <label id="">hi</label><input type="text" id="input-name" /> <select id="select-asd" class="selectpicker" name="name" style="display:none;" hidden></select> </div> i've tried visibility , display properties, not result. here javascript code; var selectasd = document.getelementbyid( 'select-asd' ); selectasd.style.display = 'none'; thanks in advance update** think problem because of "selectpicker" try this... if want make select visible uncomment javascript 2nd line var selectasd = document.getelementbyid( 'select-asd' ); selectasd.style.display = 'none'; <div id="dialog"> <label id="">hi</label> <input type="text" id="in

Using IN clause within FILTER clause, in SPARQL query -

i'm new sparql. i'm trying run query -- prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix owl: <http://www.w3.org/2002/07/owl#> select * <http://purl.obolibrary.org/obo/merged/doid> { ?nodeid owl:annotatedsource <http://purl.obolibrary.org/obo/doid_11330>. #?nodeid rdf:type owl:annotation. ?nodeid owl:annotatedproperty ?annotatedproperty. ?nodeid owl:annotatedtarget ?annotatedtarget. ?nodeid ?aaproperty ?aapropertytarget. optional {?annotatedproperty rdfs:label ?annotatedpropertylabel}. optional {?aaproperty rdfs:label ?aapropertylabel}. filter (isliteral(?annotatedtarget)). filter (not exists {?aaproperty in(owl:annotatedsource, rdf:type, owl:annotatedproperty, owl:annotatedtarget) })} -- got error , don't know do. please me. thanks. encountered " "in" "in "" @ line 13, column 41. expecting 1 of