Posts

Showing posts from February, 2012

c# - Clickonce file association icon issues with Windows 10 -

i have create simple project , deployed using clickonce. problem have icon associated file extension have setup not working on windows 10. i tried on 4 windows 10 computer , if create sample file "test.abcd" shows icon of blank sheet (the standard unrecognized icon). i tried on 3 windows 7 , 4 windows server 2008 , of them display application icon on sample file. have ran install administrator on computers. step on windows 10 make work ? have tried clean shell icons on windows 10 computers without success. running uac @ lowest setting , account local admin too. i tried remote desktop windows 10 computer see if there difference , doesn't work either. wiki

login - Raspberry pi, run Python script on startup, cron has failed, /etc/profile has failed, .config/autostart has failed, other methods? -

excuse me, i'm trying python script have written autostart on raspberry pi. i've tried several methods they've failed. i have tried methods using cron's "@reboot" feature, these seem make script run in boot sequence, enough libraries needs haven't loaded yet , other crucial functions of pi has make use of haven't yet started. example had error occur: traceback (most recent call last): file "program_name.py", line 688, in <module> fig=plt.figure() file "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 435, in figure **kwargs) file "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 81, in new_figure_manager return new_figure_manager_given_figure(num, figure) file "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 89, in new_figure_manager_given_figure window = tk.tk() file "/usr/lib/python2.7/lib-tk/tkinte

jquery - JavaScript that highlights current day in "hours of operation" part of website -

i have list of days , hours of operation of business: {% load static %} <link type = "text/javascript" href="{% static 'core/js/index.js' %}"> <div class = "col-md-4"> <div class = "business-hours"> <h2 class="title">opening hours</h2> <ul class="list-unstyled opening-hours"> <li>sunday <span class="pull-right">closed</span></li> <li>monday <span class="pull-right">9:00-22:00</span></li> <li>tuesday <span class="pull-right">9:00-22:00</span></li> <li>wednesday <span class="pull-right">9:00-22:00</span></li> <li>thursday <span class="pull-right">9

html - Mobile bootstrap navbar button not collapsing -

i know has been posted tons of times still cannot find solution. have tried viewing on mobile , shrinking browser nav collapse button isn't "collapsing." followed guidance provided other posts none have worked. have set data-target correct id , have of scripts sourced. my code: nav ul li{ width:117px; } nav{ box-shadow: 15px 0px 45px #1f2021; } .navbar-fixed-top{ position:absolute!important; } <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" /> <!-- above 3 meta tags *must* come first in head; other head content must come *after* these tags --> <t

python - dimension mismatch error in CountVectorizer MultinomialNB -

before lodge question, have i've thoroughly read more 15 similar topics on board, each somehow different recommendations, of them not me right. ok, split 'spam email' text data (originally in csv format) training , test sets, using countvectorizer , 'fit_transform' function fit vocabulary of corpus , extracts word count features text. , applied multinomialnb() learn training set , predict on test set. here code (simplified): from sklearn.feature_extraction.text import countvectorizer sklearn.cross_validation import train_test_split sklearn.naive_bayes import multinomialnb # loading data # data contains 2 columns ('text', 'target') spam = pd.read_csv('spam.csv') spam['target'] = np.where(spam_data['target']=='spam',1,0) # split data x_train, x_test, y_train, y_test = train_test_split(spam_data['text'], spam_data['target'], random_state=0) # fit vocabulary , extract word cou

C++ lambda and operator syntax -

i last used c++ in 2003, , trying revisit, , learn new stuff. have been working in java while, , learning lambda syntax. saw example in c++, , wondering if explain it: #include "stdafx.h" #include <iostream> #include <string> using namespace std; int = 42; char code = 'c'; [=, &i]() mutable { i++; code = 'd'; std::cout << "i: " << << "code " << code << std::endl; }(); void wait() { cin.clear(); cin.ignore(); cin.get(); } int main() { std::cout << "i: " << << "code " << code << endl; // hold output window open wait(); return 0; } is new lambda syntax operator= overload? i'd write test function, not sure how invoke it. i can't reply comments still don't have 50 rep points (my previous answer automatically moved comments link). i found simple way of testing lambda exp

java - Eclipse WindowBuilder: Ignore runtime paint() code -

this question has answer here: what nullpointerexception, , how fix it? 12 answers one of jpanels in swing gui designing uses awt graphics drawing figures drawable @ runtime. eclipse windowbuilder no longer wants draw of swing gui there null pointer exceptions in awt paint code. note not generic question null pointer exceptions. specific windowbuilder , how handle code doesn't make sense in context of windowbuilder. there method ignore awt paint code if windowbuilder trying interpret swing gui? import java.awt.color; import java.awt.graphics; import java.awt.image.bufferedimage; import javax.swing.jpanel; public class previewpanel extends jpanel { private static final long serialversionuid = 3787425749772291816l; public final static int width = 918; public final static int height = 125; public void paint(graphics g) { bufferedimage img = new bufferedimag

python - Bokeh histogram will not plot, is there a solution to this old issue -

Image
my issue seems post (albeit column types may different): cannot plot histogram on ubuntu 14.04 the code straight out of docs http://bokeh.pydata.org/en/0.10.0/docs/user_guide/charts.html#histograms i couldn't comment on post needed ask again if solution found... my system suse. trying plot simple histogram of datetimes pandas df series. >>>df acq_date 0 2017-01-28 1 2017-01-28 ... ... 456365 2017-07-25 456366 2017-07-25 >>>hist = histogram(df['acq_date'], title="fire frequency") 2017-08-22 11:56:15,240 error running application handler <bokeh.application.handlers.script.scripthandler object @ 0x2b6cc2c8f358>: expected element of either column(float) or column(string), got array(['2017- 01-28t00:00:00.000000000', '2017-01-28t00:00:00.000000000', '2017-01-28t00:00:00.000000000', ..., '2017-07-25t00:00:00.000000000', '2017-07-25t00:00:00.000000

html - How to fix element at top in CSS? -

Image
i have problem position on css. i create 3 elements: menu navbar , category bar (to filter content), , content. it looks this: *menu `navbar`* home *category bar* category 1 category 2 *content* lorem ipsum dolor sit amet consectetur adipisicing elit when scrolling down, menu show hidden, , category bar fixed on top. screenshot: when add css code fix category bar @ top: ul#filters { overflow: hidden; background-color: #333; position: fixed; width: 100%; } ul#filters li { float: left; display: block; color: #f2f2f2; text-align: center; padding: 14px 16px; text-decoration: none; font-size: 17px; } it looks like: i expected output is: when loading page success, first image in answer. when user scrolls down, menu hidden, category bar fix top, content @ below category bar. like this: note: change menu bar category bar here code: ul#filters { overflow: hidden; background-color

ios - XMPP background connection in iPhone -

Image
i using silent push notification in xmpp chat application. using want connect xmpp server when app not running or not in background mode. receiving silent push notification , enable following flag of xmppstream background connection. xmppstream.enablebackgroundingonsocket = yes; but socketdidconnect method not being still called when app not running , can't able connect xmpp server. the purpose of send message received status xmpp server. guide me this. i don't want use voip this. please provide me alternate solution this. follow below steps. possible using voip , pushkit framework. enable voip service certificate app. check below image. enable voice on ip app. check below image. now add pushkit.framework in appdelegate.h file import pushkit framework , add delegate pkpushregistrydelegate appdelegate.m file following. a) in didfinishlaunchingwithoptions method add below code. pkpushregistry *voipregistry = [[pkpushregistry alloc] initwi

java - Automating software installations after system refreshes on Windows -

i'm new programming i'm learning java in school, i'm trying start learning python scripting well. know it's best learn project in mind , i've got quite list of projects want do. first though has can me out @ work. for clarification work in digital forensics. when refresh our systems have install cellebrite, oxygen forensics, , xry forensics software. each 1 has agreements need agreed when install them. each of them have options select, such filetype associations, whether include desktop icons , other things of nature. i think beneficial if write script section navigate different software's stored , install recent version in specific location, agree necessary agreements, , restart system once 3 have been installed. python language use this. or there language/combination of languages better suited such including batch scripts, command line operations, java, .net, vbscripts, etc.(we use windows , have option use python v2.x or v3.x). i'm sure more int

java - In AEM query builder order by based on someproperty=somevalue -

i m trying sort aem query builder search results based on particular value of particular property. have in database mysql can sort based on column's value (for exp. order field('columnname','anycolumnname'). can have in aem. suppose have 5 assets under path /content/dam/assets. asset name------------dc:title 1.jpg------------------apple 2.jpg------------------cat 3.jpg------------------cat 4.jpg------------------ball 5.jpg------------------drag i need assets on top of results dc:title = cat , need other results in sorting asc. expected result given below 2.jpg------------------cat 3.jpg------------------cat 1.jpg------------------apple 4.jpg------------------ball 5.jpg------------------drag note:- using version aem 6.2 you can use orderby predicate value of @jcr:content/metadata/dc:title sort dc:title querybuilder . /libs/cq/search/content/querydebug.html interface test queries on instance. acs commons has breakdown of

api - How to convert an asynchronous function into synchronous function using promise in Node.js? -

i have changed code async suggested still not able access value , getting error of cannot read property '0' of undefined.the task_id not accessible third function not created: app.post('/api/add_task',function(req,res,error){ var sql = "insert `campus_ambassador`.`tasks` ( `task_type`, `task_name`, `details`, `social_media_handles`, `media`, `created_date`, `updated_date`) values ('offline', 'golfed', 'ssss', '#soccer', 'sdfsd', '2012-12-26 00:00:00', '2012-12-26 00:00:00');" var sql1 = "select task_id tasks task_name='golfed'"; var sql2 = "insert `campus_ambassador`.`task_level` (`task_id`, `level_id`, `updated_on`, `created_on`) values ("+"'"+res1[0].task_id+"'"+", '3', '2012-12-26 00:00:00', '2012-12-26 00:00:00')"; var res1='' async.waterfall([ function(callback){ db.select(sql

git - How to use TFS credentials as commit author? -

it appears on our team foundation server 2015 when check our team project's git repository attribute commit author whatever in user's .gitconfig file under [user] . feel wrong since signs our tfs server tfs credentials (ad credentials) why wouldn't want able trace commit particular tfs team member? is configured on tfs or git repo server side? no, that's not possible , made design due fact git decentralised vcs. to able exchange commits, git use sha1 hash permit sure commit (and history) unique. and sha1 computed files contents , commit metadata. of them name , email of author , commiter. if want change metadata when pushing, have modify commit , end different sha1. if sha1 has changed, way git work not work anymore... credentials here verify if have right push commits , not verify nor alter push. ps: see metadata of commit using command git cat-file -p sha1_of_a_commit wiki

asp.net core - Angular 4 throwing error EventSource's response has a MIME type ("text/html") that is not "text/event-stream" after migrating to .NetCore 2.0 -

i have existing spa based on asp .net core (i using yo generator-aspnetcore-spa generate template). worked fine, after migration .netcore 2.0 started throw error: eventsource's response has mime type ("text/html") not "text/event-stream". aborting connection. as understood problem affects auto-refresh after updating file (hot module replacement far know). other stuff working fine. so, question how fix error above? i found solution, problem in .netcore routing system, taking on , trying handle request, returning text/html, it's sending actual webpack_hmr hot file. fix need edit configure method in startup.cs file. before: // code app.usewebpackdevmiddleware(new webpackdevmiddlewareoptions { hotmodulereplacement = true }); //some code after: // code app.usewebpackdevmiddleware(new webpackdevmiddlewareoptions { hotmodulereplacement = true, hotmodulereplacementendp

asp.net core - AuthenticationHandler ending request prematurely -

i'm trying make .net core authenticationhandler custom logic. whenever make request page in auth handler runs fine returns 200 without executing code end controller. i've distilled down simplified version. startup.cs: public void configureservices(iservicecollection services) { services.addauthentication("dummy") .addscheme<authenticationschemeoptions, dummyauthhandler>("dummy", null); ... my handler: public class dummyauthhandler : authenticationhandler<authenticationschemeoptions> { public dummyauthhandler(ioptionsmonitor<authenticationschemeoptions> options, iloggerfactory logger, urlencoder encoder, isystemclock clock) : base(options, logger, encoder, clock) { } protected override task<authenticateresult> handleauthenticateasync() => task.fromresult(authenticateresult.success( new authenticationticket(new claimsprincipal(), "dummy&q

How do I handle a large number of files as an input to a build when using VSTS? -

Image
to set expectations, i'm new build tooling. we're using hosted agent we're open other options. we've got local application kicks off build using vsts api. hosted build tasks involve get sources step github repo local file system in vso. next step need copy on large number of files (upwards of 10000 files), building solution, , running tests. the problem cloned github repo in file system in visual studio online, , 10000 input files on local machine. seems bit much, since plan on doing ci , may have many builds being kicked off per day. what best way move input files cloned repo can build it? should using hosted agent this? or best on our local system? i've looked in vso docs haven't found answer there. i'm not sure if asking right questions here. there ways handle situation, can follow way closest situations. option 1. add large files github repo if local files related code of github repo, should add files same repo required files

syntax - JavaScript property access: dot notation vs. brackets? -

other obvious fact first form use variable , not string literal, there reason use 1 on other, , if under cases? in code: // given: var foo = {'bar': 'baz'}; // var x = foo['bar']; // vs. var x = foo.bar; context: i've written code generator produces these expressions , i'm wondering preferable. (sourced here .) square bracket notation allows use of characters can't used dot notation: var foo = myform.foo[]; // incorrect syntax var foo = myform["foo[]"]; // correct syntax secondly, square bracket notation useful when dealing property names vary in predictable way: for (var = 0; < 10; i++) { somefunction(myform["mycontrolnumber" + i]); } roundup: dot notation faster write , clearer read. square bracket notation allows access properties containing special characters , selection of properties using variables another example of characters can't used dot notation prope

r - merging matrix columns that exists inside a numerical list -

i have created list following 1 contains combinations of specific character inside string. code creates list follows : library(stringr) test = str_locate_all("ttest" , "t") ind1 = lapply( lapply(1:nrow(test[[1]]), combn , x=test[[1]][,1]) , t ) ind1[[1]] = rbind(ind1[[1]], 0 ) and list i'm getting looks like [[1]] [,1] [1,] 1 [2,] 2 [3,] 5 [4,] 0 [[2]] [,1] [,2] [1,] 1 2 [2,] 1 5 [3,] 2 5 [[3]] [,1] [,2] [,3] [1,] 1 2 5 what want combine/collapse columns (where ever more one) , unlist whole object in order create final vector c(1, 2, 5, 0, 1:2, 1:5, 2:5, 1:2:5 ) , able use expand.grid() function later. tried solve following code partially ":" character went on different position wanted. do.call(paste, c( as.data.frame(ind1[[2]]) ,collapse=":") ) [1] "1 2:1 5:2 5" here idea via base r convert list elements data frames , use do.call paste them, i.e. u

c# - Getting "Unable to extract the User from the SOAP Header" exception -

here while making request web service getting exception faultexceptionwas un handled message unable extract user soap header code below. static void main(string[] args) { request.servicesexternalclient se = new request.servicesexternalclient(); se.clientcredentials.username.username = "username"; se.clientcredentials.username.password = "password1"; bindingelementcollection elements = se.endpoint.binding.createbindingelements(); elements.add(securitybindingelement.createusernameforsslbindingelement()); system.uri uri = new system.uri("--url--"); se.endpoint.listenuri = uri; stringbuilder xml = new stringbuilder(); xml.append(@"<?xml version=""1.0"" encoding=""utf-8""?>"); xml.append(@"<newinvoicerequest >"); xml.appen

c - Install SDL in CLION -

Image
i try install sdl in clion c project. dowload zip sdl ( librairies dev ), add include , lib folder , change cmakelist.txt : cmake_minimum_required(version 3.8) project(projet1) set(cmake_c_standard 99) include_directories( ${project_source_dir}/include) link_directories(${project_source_dir}/lib) set(source_files main.c include lib) add_executable(projet1 ${source_files}) i have : is configuration? this problem separate clion, you'll need install sdl in whatever way supported or os (win32 exe, apt-get, brew, etc). there cmake module called findsdl2 de-facto standard making cmake include sdl2. you'll want download file , put in folder called cmake in root of project. after that, you'll want modify cmakelists.txt file : cmake_minimum_required(version 2.8) project(project1) # includes cmake/findsdl2.cmake set(cmake_module_path ${project_source_dir}/cmake) find_package(sdl2 required) include_directories(${sdl2_include_dir}) set(source_files src/

ios - Detect device rotation inside a collectionViewCell -

inside custom collectionvirewcell create gradient layer , add cell in function override func awakefromnib() {} self.layer.insertsublayer(gradient, at: 0) when device rotates size of cell changes not size of layer. need override func viewdidlayoutsubviews() { gradient.frame = self.bounds } the problem error telling me viewdidlayoutsubviews() did not override function superclass. there method detect cell size variation inside cell class? viewdidlayoutsubviews() uiviewcontroller method , not method of uiview uicollectionviewcell inherits from. the method you're looking override layoutsubviews() override func layoutsubviews() { <#code#> } i think that's problem! wiki

java - Joining 2 Spark dataframes, getting result as list -

i trying join 2 dataframes, have result list of rows of right dataframe (ddf in example) in column of left dataframe (cdf in example). made work 1 column, having issues adding more columns. seq<string> joincolumns = new set2<>("c1", "c2").toseq(); dataset<row> alldf = cdf.join(ddf, joincolumns, "inner"); alldf.printschema(); alldf.show(); dataset<row> aggdf = alldf.groupby(cdf.col("c1"), cdf.col("c2")) .agg(collect_list(col("c50"))); aggdf.show(); output: +--------+-------+---------------------------+ |c1 |c2 |collect_list(c50) | +--------+-------+---------------------------+ | 3744|1160242| [6, 5, 4, 3, 2, 1]| | 3739|1150097| [1]| | 3780|1159902| [5, 4, 3, 2, 1]| | 132|1200743| [4, 3, 2, 1]| | 3778|1183204| [1]| | 3766|1132709|

visual studio - POST http://localhost:60018/server.php 405 (Method Not Allowed) -

i getting error: angular.js:11756 post http://localhost:60018/server.php 405 (method not allowed) i not familiar php code code friend wrote while ago project worked on, , wanted work on project on own bit , make better. unsure making happen, have tried looking stuff haven't used php before. code below, , ideas appreciated. , in case matters, running project on visual studios 2015 $ids = buildfinallist(); echo json_encode($ids); function buildfinallist() { $conn = dbconnect(); $type = 'themoviedb'; $input = json_decode(file_get_contents('php://input'), true); $genre = $input['genres']; $sources = $input['sources']; $page = 1; $result = array(); while (count($result) <= 2) { $currentpage = generatelist($genre, $page++); $idchecked = idcheck($conn, $currentpage, $type); $sourcechecked = sourcecheck($conn, $idchecked, $sources); $result = calcrating($sourcechecked, $result);

angular - How to wait until one of many possible observables returns before continuing -

i have switch statement makes different http call based on input. it looks this: switch(myobject.type){ case 'type1': myobject.name = this.service1.getname(myobject.id); break; case 'type2': myobject.name = this.service2.getname(myobject.id); break; case 'type3': myobject.name = this.service3.getname(myobject.id); break; } and after these have statement save entry: this.storageservice.saveentry(myobject); but @ time entry saved, not have name property set. what proper way wait 1 of these async calls return before saving entry? if must use switch statement, perhaps have each branch return observable instead, set myobject.name in subscribe() or utilize operators such do , switchmap pass value this.storageservice.saveentry() . foo(): observable<any> { switch(myobject.type){ case 'type1': return this.service1.getname(myobject.id);

javascript - Floating certain tabs in Kendo tabstrip to the right issue -

so have 5 of 11 tabs floated right, while rest stay on left of screen per default layout of kendo tabstrip. however, last 2 tabs ones on left of screen can grow in size. correctly fill white space between left , right tabs until reach right tabs , begin pushing them off of screen. my issue is, when right hand tabs pushed off screen, kendo tabstrip scroll bars not show up. show when left tabs long , go off of screen. then, when scroll, can scroll end of left hand tabs. this dojo kind of displays issue, except right hand tabs wrap around below tab 4. , seems right hand tabs being ignored altogether. https://dojo.telerik.com/ihaqap/2 any on great! wiki

How do I change the highlighting of this variable in Visual Studio 2015 -

Image
i installed 2015 , trying import settings 2013 not transferring correctly. in picture below, cursor on variable declaration on first line. setting controls highlighting on lines assign values test? i've been through whole list in fonts , colors section of options, can't seem find it. if matters, have resharper ultimate installed, no other extensions. wiki

laravel - Call Config::set to change database in Lumen 5.4? (Using Eloquent) -

i have small application in lumen should handle multiple databases based on request url. make possible in first place i've created folder /config/ , config-file called /config/database.php . here code , added comments show need do. <?php return [ 'migrations' => 'home', 'default' => 'home', 'connections' => [ // default option , needed check if "client" exists. 'home' => [ 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'home', 'username' => 'root', 'password' => 'password', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, ],

image processing - Error in helperExtractHOGFeaturesFromImageSet (line 10) -

hi working on hog . this code: % labels each image. traininglabels = trainingset.labels; % fitcecoc uses svm learners , 'one-vs-one' encoding scheme. classifier = fitcecoc(trainingfeatures, traininglabels); % extract hog features test set. procedure similar % shown earlier , encapsulated helper function brevity. [testfeatures, testlabels] = helperextracthogfeaturesfromimageset(testset, hogfeaturesize, cellsize); % make class predictions using test features. predictedlabels = predict(classifier, testfeatures); the error occur on helperextracthogfeaturesfromimageset function please give me solution. thanks wiki

ios - Cannot use instance member within property initializer, setting the variable to lazy doesn't work -

other questions point out use lazy before variable, doesn't seem work in case. i still error, cannot use instance member 'defaults' within property initializer; property initializers run before 'self' available where getting wrong ? class userdata{ let defaults = userdefaults.standard lazy var userdatadict = defaults.object(forkey: "userdatadict") as? [string: string] ?? [string: string]() static func setmobilenumber(mobilenumber: string){ userdatadict["mobilenumber"] = mobilenumber } } try syntax: lazy var userdatadict: [string : string] = { defaults.object(forkey: "userdatadict") as? [string: string] ?? [string: string]() }() however , set userdatadict once (the first time accessed), , won't see changes/updates done userdefaults.standard after that. i recommend use computed property instead: var userdatadict: [string : string] { guard

c# - How to ensure localculture is used for interface but not floating point values in WinForms? -

i have winforms application on russian system. number of reasons, prefer using floating-values formatting invariantculture (which english). following found solutions in internet, have set invariantculture default culture application. however, result, localised versions of forms (with russian text) never loaded. how can ensure forms russian text automatically loaded on russian machines, floating point values string conversions invariantculture behaviour used? you can alter property of cultureinfo after creating specific culture, e.g.: // create culture default values russian var culture = new cultureinfo("ru-ru"); // change number format culture.numberformat = new numberformatinfo { numberdecimalseparator = "." }; // set culture thread.currentthread.currentculture = thread.currentthread.currentuiculture = culture; after don't need specify culture parsing/formatting: var test = double.parse("1.234"); // throw without changing n

css - Angular styles HMR with isolation (webpack hmr) -

i have setup angular 4, webpack & hmr. the part care style substitution. did homework , not able find working solution far. just check: have out-of-the-box solution this? if not guess need understand topic more: 1) algorithm angular using assigning component specific attributes css? 2) there api in angular (it's javascript, don't mind if it's public or implementation detail/"hidden") allow me reload/substitute styles given component? did research on hmr , if such api exists or it's doable love try & use it. 3) please verify if assumptions true: technical perspective shouldn't difficult - angular (at least in setup) loads styles <style> tags - if i'm not mistaken 1 per component type. if true shouldn't big of deal find correct <style> tag & replace it's content i'm getting webpack hmr. the problem apply isolation - compile css & apply [__ngsomething] attributes in there. wiki

javascript - setInterval() prevents other JS from running by reloading page constantly. Not a duplicate -

this based on different subject , question not duplicate , plus other guys can't answer new discovery's other post ways had chat on other post can find here link so story here made successful private message system can see partners messages automatically. decided put js features ajax response page aka chat.php responsible in showing new messages coming in constantly. copy code other guys code bought , every thing worked. every time add javascript code chat.php disappear fast or not show @ found out working. original author code rely on setinterval() show new messages coming in made of js go away fast. there other way can keep ability see new messages coming in , prevent js disappearing? know it's possible because when have web apps facebook etc.. don't deal problem any other method or advice appreciated , removed js code added chat.php guys can give me advice on using other methods instead of focusing on trouble shooting here. ok here's files , said'

c# - Flip View Data Binding and file permissions -

i learning basics of uwp , app making in windows 10. trying make flip view data pulled off folder. didn't display images, tried manually adding images so, privateset_images.add(new bitmapimage(new uri("ms-appx:///assets/spot/1.png"))); privateset_images.add(new bitmapimage(new uri("ms-appx:///assets/spot/2.png"))); privateset_images.add(new bitmapimage(new uri("ms-appx:///assets/spot/jpg.jpg"))); privateset_images.add(new bitmapimage(new uri("ms-appx:///assets/spot/jpeg.jpeg"))); privateset_images.add(new bitmapimage(new uri("ms-appx:///assets/spot/jpg.png"))); privateset_images.add(new bitmapimage(new uri("ms-appx:///assets/spot/jpeg.png"))); privateset_images.add(new bitmapimage(new uri("f:\\test sp folder\\1.png"))); privateset_images.add(new bitmapimage(new uri("f:/test sp folder/1.png"))); all ms-appx assets read , displayed (so not file-type / file-extension problem). permissions folder

c# - Equivalent to WPF DependencyProperties in Prism ViewModels -

i understand standard way in wpf expose custom property in xaml define dependencyproperty in view’s code-behind. however, works dependencyobject s, such usercontrol . yet, in clean prism fashion, code-behind (i.e., class deriving usercontrol ) empty, , deal logic in view model, derives bindablebase , not child class of dependencyobject . consider following xaml fragment: <mynamespace:mycustomview myproperty={binding} /> the core of mycustomviewmodel is private string myproperty; public string myproperty { { return myproperty; } set { setproperty(ref myproperty, value); } i’m still relatively new prism. do expose myproperty , defined in mycustomviewmodel can set in xaml tag similar above? update following @mm8’s answer , our discussion in corresponding comments, developed minimal (non-)working example of have in mind. summary first: data model list of objects. shell must display each of these objects means of custom user control object type. a)

sql server - SQL : query large table -

i want query large data set in sql - right approach? declare @datetime datetime select * sales salesdate <= @datetme or: select * sales salesdate < (select getdate()) or: select * sales salesdate < getdate() or using now() all 3 have same execution plan other 0% assign stage variable in query no. 1. turn out practice in long run initialize variable datetime , use comparison. when have long comparisons make way, user habit of formatting datetime in variable , comparing column against variables. otherwise, becomes habit of formatting sql column , comapring date. formats datetime field in every data row comparison value , makes datetime comparisons slow. for particular query, readability , ease of use, can select query no. 3 [select * sales salesdate < getdate()]. wiki

arrays - JavaScript object stores previous values even in new object -

javascript behaves weirdly in case of objects. although i'm not sure if correct behaviour. inside new object(), set properties in object. next time when again new object(), instead of default values values set in previous instance. argh. below example explains problem clearly function testo() {} testo.prototype = { obj: { what: { value: 5 } }, done: function () { console.log(this.obj.what.value); this.obj.what = {value: 10}; } }; var x = new testo(); x.done(); var y = new testo(); y.done(); the output of above code is:- 5 10 i expecting be:- 5 5 why? because i'm creating new class() , in previous instance had set value using 'this', not static , default properties of objects inside should show up. i have created above example demo. i'm facing issue in library. know has objects stored reference. how should proceed expected output? thoughts? you move prototype property (which instances identical) object

android - Image is not repeating when finish once -

i want show number of images fade in fade out animation it's working fine images not repeating when complete once. want show in loop, not getting missing 1 have idea it? my code looks below mainactivity.java animationfadein = animationutils.loadanimation(this, r.anim.anim_fade_in); animationfadeout = animationutils.loadanimation(this, r.anim.anim_fade_out); animation.animationlistener animlistener = new animation.animationlistener() { @override public void onanimationstart(animation animation) { } @override public void onanimationrepeat(animation animation) { } @override public void onanimationend(animation animation) { changeimage(animation); } }; // set listener animation animationfadein.setanimationlistener(animlistener); animationfadeout.setanimationlistener(animlistener); // start f

python - unbound method is_valid() must be called with UserLoginForm instance as first argument (got nothing instead) -

hello guys idea solve error, using django framework develop simple application using class based views. here view codes: class openlogin(formview): template_name = 'signin.html' form_class = userloginform def post(self, request, *args, **kwargs): form = self.form_class next_url = self.request.get.get('next') if form.is_valid(): username = form.cleaned_data.get('username') password = form.cleaned_data.get('password') obj = authenticate(username=username, password=password) if obj not none: if obj.is_active(): login(self.request, obj) if next_url not none: return httpresponseredirect(next_url) else: return httpresponseredirect(reverse('index')) else: messages.error(self.request, 'error! sorry ac