Posts

Showing posts from March, 2015

android - ShowCaseView Target from another Layout -

my main activity inflate activity_main.xml setcontentview(r.layout.activity_main); in activity main have recyclerview view: <android.support.v7.widget.recyclerview android:id="@+id/readlist" android:scrollbars="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/layoutlistarspiner" android:layout_alignparentstart="true" /> for recyclerview items have layout, recycleritemlist inflated adapter: public mycustomholder oncreateviewholder(viewgroup viewgroup, int i) { view itemview = layoutinflater. from(viewgroup.getcontext()). inflate(r.layout.recycleritemlist, viewgroup, false); return new mycustomholder(itemview); } and inside recyclerviewlist have imagebutton want set showcaseview point: <imagebutton android:id="@+id/status" android:layout_width=&qu

c# - Delete GridView Row in Windows Forms -

i have gridview , in each item of grid have button use delete row of these button. not working. private void grvorders_cellcontentclick(object sender, datagridviewcelleventargs e) { var sendergrid = (datagridview)sender; if (sendergrid.columns[e.columnindex] datagridviewbuttoncolumn && e.rowindex >= 0) { grvorders.rows.remove(sender); } } anyone me? your problem can't remove sender: it's not datagridviewrow . instead, use grvorders.rows.removeat(e.rowindex); .

java - Android: Notification is displaying more than once -

i need show notification @ 3 everyday. working fine , sending notification around 3 am. when test in phone notification comes immediately. read if time crossed show notification. fine this. issue: when click notification opens activity correctly. after few seconds loading notification. if click again closing notification , creating new 1 after few seconds. here code: 1. in activity oncreate() calendar calendar = calendar.getinstance(); // calendar.set(calendar.month, 10); // calendar.set(calendar.year, 2014); // calendar.set(calendar.day_of_month, 13); calendar.set(calendar.hour_of_day, 3); calendar.set(calendar.minute, 0); calendar.set(calendar.second, 0); calendar.set(calendar.am_pm, calendar.am); intent myintent = new intent(litcalactivity.this, myreceiver.class); pendingintent = pendingintent.getbroadcast(litcalactivity.this, 0, myintent, pendingintent.flag_one_shot); alarmmanager alarmmanager = (alarmmanager) getsystemservice(alarm_service); alarmmanager.setinexactrepea

apache spark - Scala:case class runTime Error -

this demo ran ok. when move class function(my former project) , call function, compiles failure. object dfmain { case class person(name: string, age: double, t:string) def main (args: array[string]): unit = { val sc = new sparkcontext("local", "scala word count") val sqlcontext = new org.apache.spark.sql.sqlcontext(sc) import sqlcontext.implicits._ val bsonrdd = sc.parallelize(("foo",1,"female"):: ("bar",2,"male"):: ("baz",-1,"female")::nil) .map(tuple=>{ var bson = new basicbsonobject() bson.put("name","bfoo") bson.put("value",0.1) bson.put("t","female") (null,bson) }) val t

parse.com - How to connect my app to parse in android studio -

i unzip sdk named parse-1.9.2 , dragged files libs folder present in app folder. added following code in build.gradle(module: app) dependencies { compile 'com.parse.bolts:bolts-android:1.+' compile filetree(dir: 'libs', include: 'parse-*.jar') } after don't how proceed. if not new android development, easy set parse sdk android project using steps provided in parse.com website. if new android development, follow 1 of these, https://guides.codepath.com/android/building-data-driven-apps-with-parse http://www.androidbegin.com/tutorial/android-parse-com-simple-login-and-signup-tutorial/

c# - Set simple timeout -

i've checked other questions in timeout in c#, since i'm beginner, don't know how implement them code. sophisticated. i have text box , added click event. upon click, user copies content of text box clipboard. make copy process noticeable user, change color of text box. once content copied , want change color of text box normal. need set timeout. private void idbox_click(object sender, eventargs e) { copytoclipboard((textbox)sender); } private void copytoclipboard(textbox textbox) { if (textbox.text != "") { textbox.backcolor = system.drawing.color.mistyrose; clipboard.settext(textbox.text); // set 200ms timeout , change backcolor //textbox.backcolor = system.drawing.systemcolors.window; } } how can set timeout? example great. not sure if fits requirements (beginner?), simple blinking using task , invoking text color changing after delay: textbox.backcolor = color.mistyrose; task.run(() =&g

c# - Index was out of range. Must be non-negative and less than the size of the collection. 4 -

my datagridview has 4 rows. row[2] has name of date1 , row[3] has name of date2. tested code cells[2] , cell[3] instead of cells name. again received same error. problem index not out of range. , less size of collection. code: for (int = 0; < dgv1frmmodateeghamat.rows.count; i++) { datetime date1 = convert.todatetime(dgv1frmmodateeghamat.selectedrows[i].cells["date1"].value); datetime date2 = convert.todatetime(dgv1frmmodateeghamat.selectedrows[i].cells["date2"].value); timespan span = date2.subtract(date1); int result = int.parse(span.totaldays.tostring()); if (result >= int.parse(textboxx2.text)) { dgv1frmmodateeghamat.selectedrows[i].visible = true; } else { currencymanager cr = (currencymanager)bindingcontext[dgv1frmmodateeghamat.datasource]; cr.suspendbinding(); dgv

c# - Permissions necessary for conn.getSchema()? -

i'm trying list of databases using following code: datatable databases = conn.getschema("databases"); for sql server. that works has worked on other instances. it's not returning databases @ on 1 instance, though there dbs in it. so, permissions/security rights necessary pull schema? using sql server profiler, calling getschema("databases") causes following sql sent server: exec sp_executesql n'if object_id(''master..sysdatabases'') null exec sp_executesql n''select name database_name, dbid, crdate create_date sysdatabases (name = @name or (@name null))'', n''@name nvarchar(128)'', @name=@name else exec sp_executesql n''select name database_name, dbid, crdate create_date master..sysdatabases (name =

Check for URL variable in PHP -

i have php page takes date variable: mypage.php?date=2015-07-14 , displays output. how check if date= empty , if insert , refresh page current date? i've tried formulate small script @ top of page using _get date value not sure how handle reload of page? you can check input not empty using empty function, , create date (it default current, unless pass parameter), , passed parameter in header function same page. if(empty($_get['date'])) header('location:'.$_server['php_self'].'?date='.date('y-m-d'));

python - Installing dependencies of debian/control file -

i in process of porting ruby file used in our build system python. file looks depends lines in debian/control file in our repository, checks every dependency, , apt-get install s isn't installed. trying reproduce functionality. as part of porting python, looked @ deb_pkg_tools module. pip install ed , created simple script, install-dep2.py . #!/usr/bin/python import deb_pkg_tools controldict = deb_pkg_tools.control.load_control_file('debian/control') however, when run script, following error: $ build/bin/install-dep2.py traceback (most recent call last): file "build/bin/install-dep2.py", line 4, in <module> controldict = deb_pkg_tools.control.load_control_file('debian/control') attributeerror: 'module' object has no attribute 'control' the debian/control file exists: $ ls -l debian/control -rw-rw-r-- 1 stephen stephen 2532 jul 13 14:28 debian/control how can process debian/control file? don't need

scala - Set#apply with argument `Unit` -

scala puzzlers presents "puzzler": scala> list("1", "2").toset() + "3" warning: there 1 deprecation warning; re-run -deprecation details res13: string = false3 the explanation notes above code de-sugars to: (list("1", "2").toset[any] apply ()) + "3" but why doesn't following return false ? scala> set("1")() <console>:11: error: not enough arguments method apply: (elem: string)boolean in trait gensetlike. unspecified value parameter elem. set("1")() ^ the compiler smart enough know makes no sense set[a] . set[a]#apply has signature: apply(elem: a): boolean i.e., must supply argument of a , , a invariant set . if try supply unit set[int] , type mismatch, not false . scala> set("1")(()) <console>:19: error: type mismatch; found : unit required: string set("1")(())

Escape character = SQL server -

i need update row in column like update my_table set column_name = 'vector = 1 , value in('a','b','c')' i think problem don't know how escape = sign just clear; vector = 1 , value in('a','b') existing value in row want update vector = 1 , value in('a','b','c') tips on how can this? thanks you not run in problem = sign quote sign. 'vector = 1 , value in(''a'',''b'',''c'')'

Echo the basename in shell -

i have path directory , need extract filename out of can use further in shell script. #!/bin/sh dir=/var/tmp/file1 fname= basename $dir echo $fname echo "the script executes:" $fname echo $fname here fname gets printed once. in other cases, comes blank. where going wrong? this below working. #!/bin/sh dir=/var/tmp/file1 fname=`basename $dir` echo $fname echo "the script executes:" $fname echo $fname output $: ./tt.sh file1 the script executes: file1 file1

c++ - Substring Replace Vector -

this minimal code sample i'm trying create array of substrings find can replace them single word. in case i'm changing common greetings simple 'hi'. the problem when run code i'm getting error. error: no matching function call 'std::vector >::push_back(const char [4], const char [4], const char [3])' if me understand why error occurring , suggest solution perfect. #include <iostream> #include <string> #include <algorithm> #include <cctype> #include <ctime> #include <vector> vector<string> hiword; hiword.push_back("hey", "sup", "yo"); (const auto& word : hiword){ while (true) { index = r.find(word); if (index == string::npos) break; r.replace(index, word.size(), "hi"); } } you might want start creating vector of strings want search , replace: vector<string> searchwords = {"hey", "hello

How to append Git commit information the built website -

i use automated script latest (or specific) git commit, build , deploy platform. want append commit details upon each build, possible see commit used build platform. what strategy achieve that? thank in advance eduardo this command can current commit digest. git rev-parse --short head output: 3ba7598 you can save digest upon each build.

php - PHPmyadmin upgrade / Loading forever while access any db -

i trying upgrade phpmyadmin on hosted server. have asked hosting provider company said me that, manually need upgrade phpmyadmin using, server's command line using following command: /usr/local/cpanel/bin/updatephpmyadmin my concern can write thing on hosted server. ? i new php developer , first experience hosting site. on host server when ever try access db "loading" remain forever. phpmyadmin version on hosted server 4.0.10.7 (lasted 1 4.4.10) some people claiming same issue resolved upgrading phpmyadmin latest version. think upgrading phpmyadmin might solve issue well. any appreciated. for have faced issue, it might possible in channel/whm password have used special character (i have used "pound" symbol not accepted in system. think should stick use standard symbol printed on keyboard.) i have change password , working. hope information other well. thanks

jquery - Set and Get uniqueID for each file -

im use jqueryfileupload . how can uniqueid each file??? $('#multifileinput').fileupload({ dropzone: $("#dropzone"), url: "./fileupload.ashx", datatype: 'json', submit: function (e, data) { $.each(data.files, function (i, file) { alert("uid file " + file.name + " - " + file.uid); } } }); i had fix code in jquery-fileupload-5.42.3.js: _getsinglefileinputfiles: function (fileinput) { /* ----==== code ====-----*/ if (!$.fileuploadid) $.fileuploadid = 1; $.each(files, function (index, file) { file.uid = "fileuploadid" + $.fileuploadid++ ; }); return $.deferred().resolve(files).promise(); } can have access without code changes source jqueryfileupload? var myincrement = 0; $('#multifileinput').fileupload({ dropzone: $("#dropzone"), url: "./fileupload.ashx", datatype: 'json', submit: function (e, data) { $.each(data.files,

java - Is there a way to compare two doc files that are located online? -

how go comparing 2 doc files download links on html page? working in java. want pull 2 files 2 separate urls compare them (removing spacing, using trim?) i using watij bit don't think has capability. edit: if webpage has multiple hyperlinks named "download file", there way list urls without knowing them , coding them manually? to compare 2 files. open file input stream , use ioutils url url1 = new url("http://path/file1.txt"); url url2 = new url("http://path/file2.txt"); inputstream is1 = url1.openstream(); inputstream is2 = url2.openstream(); if( ioutils.contentequals( is1, is2 ) ) { //the same content }

Matlab - how to analyse sequences of binary behavioural responses? -

i interested in effect of previous responses on current response in behavioural test. example if on 3 previous trials in test participant answers 'no', 'yes', 'yes' likelihood of 'yes' response on current trial different if had answered 'yes', 'yes', 'no' , , on. to analyse need find instances of particular sequences of responses in dataset. e.g. every time yes yes yes occurs, every time yes yes no occurs..., , forth possible permutations of yes/no sequences. to can hard code long chain of if/else statements in matlab (to work on fixed number of previous trials), or can write each possible sequence out , search both methods slow write. rather code hand fixed number of previous trials, i.e. previous 3 responses, there sensible solution use instead previous n trials? i.e. want analyse, say, previous 5 trials, rather previous 3, chain of if/else statements required becomes unbearable! nb. response data binary (i.e.

asp.net mvc - How to appear short text in p tags html -

Image
i new mvc creating small blog myself , have long text want display short text if click on "more" link appear text being hide.like people have long comment, facebook appear short text , use "more" link display rest of text and here paragraph expect : many thanks. i not sure want, inferred want toggle show less/all text. there few js plugins can incorporated application.

date - I need to remove the ' from every row of a csv -

i have bunch of csv files have data in format of yyyy-mm-dd hh ,value can split hours off running open(out_path+filename,'r+') data_r: comreader = csv.reader(data_r, delimiter=' ', quotechar='"') row in comreader: print ','.join(row) from 'yyyy-mm-dd,hh',value what need remove (') in front of yyyy , after hh you're using quotechar parameter, wrongly: it should read "'" if want interpret ' character surrounding strings. other that, can parts of strings python's slicing abilities: outstring = instring[1:-1] will give 1. (dropping 0.) (excluding it) last character.

function - R: cannot open file 'specdata/001.csv': No such file or directory -

i'm pretty new r, , after researching error extensively, i'm still not able find solution. function created in r determine complete cases in directory 332 .csv files. complete <- function(directory, id = 1:332) { s <- vector() (i in 1:length(id)) { path <- c(paste(directory, "/",formatc(id[i], width=3, flag=0),".csv",sep="")) data <- c(read.csv(path)) s[i] <- sum(complete.cases(data)) } dat <- data.frame(cbind(id,nobs=s)) return(dat) } when want test function, giving following command (specdata directory .csv files stored) complete("specdata", 1) i keep getting following error: error in file(file, "rt") : cannot open connection in addition: warning message: in file(file, "rt") : cannot open file 'specdata/001.csv': no such file or directory i checked working directory i checked files within directory cannot detect problems there. thi

foreach - Pass .each loop reference object in Ruby on Rails -

i writing code in ruby on rails creating dynamic rows in table involves .each loop. want pass .each loop reference object gives me error. following code: <% pworkflows.workflow_executions_list.each |wf| %> <tr> <td><%= wf.execution_status %></td> <td> <% if(wf.start_timestamp != nil) %> <%= wf.start_timestamp.localtime; %> utc <% end %> </td> <td><%= wf.close_status %></td> <td><%= wf.execution.run_id %></td> <td><%= button_to "details",{ :controller => "pages", :action => "mainpage",:rulesetinstance=>rinsid, :ndetails=>wf} %></td> </tr> <% end %> :ndetails=>wf gives error. wf not being recognized correct syntax send. please suggest way. the error being: undefined local variable or method `id' #<comrulemanagement::workflowexecutionobject:0x00003d

reverse ordering of legend colors in matlab bar plot -

Image
trying change of properties associated bar plot in matlab confusing. have found number of solution problems here. however, there 1 cannot find. consider following: ax1 = subplot(121); id2 = [8;2;3;5]; id2_t = sum(id2); id3 = (id2/id2_t).*100; id3(:,2) = 0; h1 = bar(id3','stacked','edgecolor','none'); set(gca,'xticklabel',[]); xlim([0.75 1.25]); % add legend str = {'str1','str2','str3','str4'}; ll = legend(str); legend('boxoff'); set(ll,'plotboxaspectratio',[0.5 1 1]); ll_i = get(ll,'position'); set(ll, 'position', [0.25 ll_i(2)-0.1 ll_i(3) ll_i(4)]); % change dimensions of plot ax1 = get(ax1,'position'); set(ax1,'position',[ax1(1) ax1(2) ax1(3)/2.7 ax1(4)]); this code written produce single stacked bar in matlab, not sophisticated of solutions, works. bar plot below: now trying reverse order of legend entries match plot. people have suggested flipud or flipl

javascript - Starting Out In LiveWeave -

i have been trying make cute little games in javascript, using liveweave html/css/javascript playground. however, can't seem figure out how insert javascript. blocks use? put script in html? reason i'm asking tested out making few rects around screen, yet none showed up. help, please go http://liveweave.com . best regards, dominic

java - Unable to use send keys for disabled Element in selenium -

Image
the input field trying write code in selenium: input class="tt-hint" type="text" disabled="" spellcheck="off" autocomplete="off" style="position: absolute; top: 0px; left: 0px; border-color: transparent; box-shadow: none; background: none repeat scroll 0% 0% rgb(255, 255, 255);" my code is: webelementy inp= driver.findelement(by.classname("tt-hint")); inp.sendkeys(new string[] { "mo" }); but above code not work. error keep getting is: exception in thread "main" org.openqa.selenium.invalidelementstateexception: element disabled , may not used actions any appreciated. i have modified code javascriptexecutor js = (javascriptexecutor) driver; js.executescript("arguments[0].removeattribute('disabled')",inp); inp.sendkeys("mo"); output the exception says all. element not ready accept interaction , disabled. javascript op

java - MainActivity is not public -

i getting weird error in androidmanifest.xml file saying "mainactivity not public. validate resource reference inside android xml files." not know how solve error. can me here? androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pixalstudio.javaclasses" > <uses-permission android:name="android.permission.access_network_state" > </uses-permission> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.

Looping through a List<Map<Integer, Map<Long, Integer>>> in Java -

as title suggests, i'm struggling looping through data structure given. i have list of maps contain integer key , map value contains long , integer. how can loop through list, map, map able access of required fields? thanks. edit: in response comments, looping through list i'm fine with. step 1 loop through list, i'm left with: for (map<integer, map<long, integer>> periodscores : request.getperiodscoremap()) { ... } it's goes in there confuses me. currently have: for (map<integer, map<long, integer>> periodscores : request.getperiodscoremap()) { while (periodscores.entryset().iterator().hasnext()) { map<integer, map<long, integer>> opponentscores = (map<integer, map<long, integer>>) periodscores.entryset().iterator().next(); } } and i'm struggling final map of its matter of being careful , being able differentiate between map , list it

android - MPAndroidChart PieChart Animations -

i set 2 values on piechart. want animate it. want change animation way. animations right left angle. want left right angle. how can change animation direction? edit 1 : library: mpandroidchart edit 2 : althought not relevant, add following code here. mbutton_availablelimit.setonclicklistener( new view.onclicklistener() { @override public void onclick(view v) { // fromangle , toangle float variables less 360 mpiechart.spin( 500,fromangle,360 - toangle, easing.easingoption.easeinoutquad ); } } ); it's simple in fact, //for rotating anti-clockwise mpiechart.spin( 500,0,-360f, easing.easingoption.easeinoutquad);

can't get email address from Facebook SDK v5 for PHP -

i want user's email address after logging facebook using php sdk v5, running issues don't quite understand. according step step guide https://developers.facebook.com/docs/reference/php/5.0.0 i create login.php , login-callback.php files login.php session_start() ; require_once __dir__ . '/src/facebook/autoload.php'; $fb = new facebook\facebook([ 'app_id' => $app_id, 'app_secret' => $app_secret, 'default_graph_version' => 'v2.2', ]); $helper = $fb->getredirectloginhelper(); $permissions = ['email', 'public_profile']; // optional $loginurl = $helper->getloginurl('http://www.example.com/login-callback.php', $permissions); echo '<a href="' . $loginurl . '">log in facebook!</a>'; login-callback.php session_start() ; require_once __dir__ . '/src/facebook/autoload.php'; # login-callback.php $fb = new facebook\facebook([ 'app_id&#

jquery - Ionic: how to open popover triggered from two place on the same place? -

Image
i have 2 buttons triggering same popover. problem if click on second button (big blue plus icon on image below) displayed popover in place big icon popover should displayed in right corner (as on second image). how can please? code triggering following: button 1 (smal) : working correctly <button ng-disabled="downloadinprogress" id="availablesoundsbtn" ng-click="openpopover($event,'popover_available_sounds.html')" class="button button-icon icon ion-plus-circled"></button> button 2 (big) : not working correctly <div class="wrapperbigicon" ng-if="selectedsounds.length == 0 && arefilesdownloaded == true"> <h2>{{ 'click_to_add_track' | translate }}</h2> <i ng-click="openpopover($event,'popover_available_sounds.html')" class="icon ion-plus-circled addcustomicon"></i> </div> many advice.

javascript - How to get rid of space between lines of multiline span? -

Image
for example, jsfiddle: https://jsfiddle.net/qmn8q2ck/ <p> <span> multiline text. multiline text. </span><span>this multiline text. multiline text. multiline text. multiline text. multiline text. multiline text. multiline text. </span> </p> span { background-color: red; display: inline; } however, noticed browser highlighting doesn't have spaces between lines, , has effect like. how effect? edited show need display:inline , effecting span elements opposed whole paragraph. with css line-height property p { /* or span */ line-height: 90%; /* try values here */ }

visual c++ - Upgrading VC++ project from VS 2008 to VS 2012 -

i trying upgrade projects' target framework version 2.0 4.0, have opened project's solution vs 2012. other vb , c# projects upgraded, during upgrading vc++ project got message in "upgradelog.xml" file "msbuild not contain value "vctargetspath" property" due above error vc++ project upgrade failed, don't know error means. related vc++ redistributable? am missing here during upgrade process? any suggestions?

maven - ERROR [WsdlTestCase] Failed to create test step for [X] -

i error error [wsdltestcase] failed create test step [x] when executing soapui project maven. tests work fine soapui client software. soap-ui.error log empty. there doesn't seem enough information let me debug - i'm guessing there's dependency i'm missing, tests simple (rest requests few assertions on http response). assumed core maven plugin suffice. my maven config below (i've included eviware repository - http://www.eviware.com/repository/maven2/ ) <plugin> <groupid>eviware</groupid> <artifactid>maven-soapui-plugin</artifactid> <version>2.0.2</version> <executions> <execution> <phase>integration-test</phase> <id>soapui-tests</id> <configuration> <projectfile>${basedir}/src/test/resources/mytestsuite.xml</proje

php - What are ORM patterns other than Active Record and Data Mapper? -

i've been reading dal design , orms in php , far i've come across "active record" , "data mapper". are these 2 patterns available or there more patterns? thanks not sure being php-specific, key design patterns i've used create orm functionality, , key patterns see in well-established orms are: data mapper identity map lazy load unit of work

java - NoSQL DAO implementation -

i have concluded using dao design best trying achieve, have never tried befor having bit of trouble. i've read documentation , examples know goal having hard time figuring out need include in dao interfaces. for example have model object has: public string name; public double baseline; public list<group> groups; public list<indicator> indicators; i don't know how i'd create dao interface though? put every method i'd think i'd need in there because know daoimpl class going have actual queries nosql database. this stands right now: public interface modeldao { list<model> getallmodels(); list<model> getmodelbyname(string name); void updatemodel(model model); void deletemodel(model model); } but example if want update name of model, or add/remove group list of groups? things take care of inside dao class? or address inside of respective dao classes. sorry if understanding isn't there yet, still trying l

javascript - What is the best way to load only needed Google Web Fonts? -

i've got set simple news-blog-style frontpage website. content being edited ckeditor. according question i've managed possible select several google web fonts in editor. the problem is, have load these fonts frontpage. don't know fonts used anyway. loading of them seems bit exaggurated, if e.g. 3 of fonts being used anyway. content changes can't sure fonts. is there way know fonts needed , import these frontpage? and if not possible... what best way load of these fonts front page? first, solution assumes you're using google web font plugin ckeditor: http://ckeditor.com/addon/ckeditor-gwf-plugin you can subscribe ckeditor changes , parse resulting html google font families. here's example using base example plugin page: var editor = ckeditor.replace( 'editor1',{ toolbar: [ ['font', 'fontsize'] ], startupfocus: true, fillemptyblocks: false, autoparagraph: false,

Adding more than one class html -

this question has answer here: how assign multiple classes html container? 3 answers is possible add more 1 class in html? here i've tried: <a href="#" class="class1" class="class2">my text</a> thanks! :) yes, possible, can declare class attribute once per html element. separate classes want apply space. <a href="#" class="class1 class2">my text</a> if declare class attribute more once, definitions beyond first ignored, in code .class2 not applied link.

python 3.x - Undefined symbol when importing cythonized c++ code -

i tried call c++ code python, using cython in minimal(ish) example: # setup.py import numpy np import glob distutils.core import setup cython.distutils import build_ext distutils.core import setup cython.build import cythonize setup( name = "pytest", version = "0.0.1", author = "herbert", #cmdclass = {'build_ext': build_ext}, py_modules = ['pytest'], ext_modules = cythonize( '_pytest.pyx', language="c++", sources=['testcpp.cpp'], #extra_compile_args=['-fopenmp', '-o3', '-ffast-math'], include_dirs = [np.get_include(), '.'], #extra_link_args=['-fopenmp'] ) ) # pytest.py __future__ import division import os import time import numpy np import scipy.sparse _pytest import pyprint pyprint() # _pytest.pyx # distutils: language = c++ # distutils: sources = testcpp.cpp cimport cython cdef extern void testprint () @cython.boundscheck

asp.net mvc - I don't understand the stack trace from a clients website. System.NullReferenceException: Object reference not set to an instance of an object -

the web application asp mvc. can't figure out object reference not set instance of object means. database related or ajax failing? not familiar asp mvc apps. , when try go admin page, index.apsx keeps getting injected in wrong place in url, causes that? server error in '/' application. object reference not set instance of object. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.nullreferenceexception: object reference not set instance of object. source error: an unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [nullreferenceexception: object reference not set instance of object.] boatingsafety.utils.createcontext() in c:\inetpub\wwwroot\appdevprojects\asp.net\boatingsafety\boatingsafety\sup

javascript - How Cant I Reference a Text File in Html / Make a way to post on my website -

i run website people work post things often, i'm 1 knows html , css, have format posts, , add them page/ create new page them, want know if there's way add way either have them make text file have reference in code, or different way allow them write posts on site , have posts automatically add site? the problem you're facing common problem in developers life. when create site client regularly posts news updates or blog articles 1 has manually write code needed. normal people can't write necessary html, css , javascript, it's developer. luckily, cms (content management systems) come in this wikipedia page explains cms in detail: https://en.m.wikipedia.org/wiki/content_management another friendly article on cms: http://searchsoa.techtarget.com/definition/content-management-system basically, these systems is: 1. developer first sets cms client. developer writes necessary code cms work. 2. after getting cms ready, deployed in production , adm

c# - I cannot link my SQL Server database with Visual Studio -

i have problem, can not link sql server database visual studio this images show problem brief http://store1.up-00.com/2015-07/1436893705031.png http://store1.up-00.com/2015-07/143689370512.png here cannot find database

How to get mesos log dir -

i want mesos log dir mesos-master --zk=zk://localhost:2181/mesos --log_dir=/users/wangyao/workandlog/mesos/log /users/wangyao/workandlog/meoso/log how in code? i try getrequest in code this getrequesthandler requesthandler = new getrequesthandler() { @override public string dogetrequestcallback(httpresponse response) throws ioexception { return entityutils.tostring(response.getentity()); } }; map<string, string> httpparams = new hashmap<string, string>(); string obj = httpclientutils.dogetrequest("http", "localhost", 5050, "/master/state.json", httpparams, requesthandler); in way can log_dir in obj. but knew application server , mesos server not using same machine ,so can't request 'localhost', it's not viable way. there way log_dir?

Azure WebDeploy Failing -

i've been happily deploying website windows azure, morning following error... web deployment task failed. (could not connect remote computer ("xxxxx.scm.azurewebsites.net") using specified process ("web management service") because server did not respond. make sure process ("web management service") started on remote computer. learn more at: http://go.microsoft.com/fwlink/?linkid=221672#error_could_not_connect_to_remotesvc.) i can load website , data coming webapi have. i've looked @ link suggests following.... you can ping remote machine that msdepsvc or wmsvc service started on remote server. your firewall not blocking incoming connections of ports on destination. if used default installation, 80 msdepsvc , 8172 wmsvc. i've tried ping, doesn't work, ping actual site doesn't work either (and site works). these azure servers i'm unsure how check points 2 & 3. another site deploy azure has worked, there must pr

tsql - SQL Server : sorting NULL Marks with ORDER BY clause -

i have query : select orderid, shippeddate sales.orders custid = 20 order shippedate; and output is: orderid shippeddate ------- ----------- 11008 null 11072 null 10258 2006-07-23 00:00:00.000 10263 2006-07-31 00:00:00.000 10351 2006-11-20 00:00:00.000 10368 2006-12-02 00:00:00.000 ... as exercise, trying figure out how sort orders shippeddate ascending, have nulls sort last. i know standard sql support options null first , null last , t-sql doesn't support option. any suggestions? thanks you can this: select orderid, shippeddate sales.orders custid = 20 order case when shippeddate null 2 else 1 end, shippedate;

Android: Expandable List/Gridview causing never-ending loading -

my app contains 2 expandableheightlistviews , 1 expandableheightgridview shared vertical scrolling. the contents of views read in file. works fine small files, data displayed correctly , activity loads. however, when selecting large files, activity never loads, when debug it, adapters 3 views looping round endlessly. i'm assuming due expanded nature of views trying load everything, surely can avoided? here code ... expandableheightlistview ... public class expandableheightlistview extends listview { boolean expanded = false; public expandableheightlistview(context context) { super(context); } public expandableheightlistview(context context, attributeset attrs) { super(context, attrs); } public expandableheightlistview(context context, attributeset attrs, int defaultstyle) { super(context, attrs, defaultstyle); } public boolean isexpanded() { return expanded; } @override

python - How can I use a calendar visual widget in django form? -

i creating django application , have next problem: cannot add calendar widget works. i have next script in html code: <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( ".vdatefield" ).datepicker(); }); </script> ... <form id="ensaioak_bilatu" method="post" action="/farmaciapp/aukera_menua/ensaio_kontsulta/ensaio_bilaketa/" enctype="multipart/form-data"> {% csrf_token %} {{ forma.as_p }} <input class="btn btn-primary" type="submit" name="bilatu_ensaioak" value="bilatu"/> </form> i

javascript - How do I stop my html5 audio playlist from looping? -

i've set play list our website. got auto play stop can't stop each track looping. last song in list stops after played rest keep going , going. here javascript being used. missing something? </style> <script> var audio; var playlist; var tracks; var current; init(); function init(){ current = 0; audio = $('#audio'); playlist = $('#playlist'); tracks = playlist.find('li a'); len = tracks.length - 1; audio[0].volume = .20; audio[0].play(); playlist.find('a').click(function(e){ e.preventdefault(); link = $(this); current = link.parent().index(); run(link, audio[0]); }); audio[0].addeventlistener('ended',function(e){ current++; if(current == len){ current = 0; link = playlist.find('a')[0]; }else{ link = playlist.find('a')[current]; } run($(link),audio[0])

Revit Family Rename in a project -

is possible rename families in project through api. updating , standardizing our family naming convention. i'd build add-in rename families in existing project new standard names. haven't had success finding example of online. i’ve been able find family names, however, can’t rename family. i’m using c#. i tried direct way .name property , seems work. uiapplication uiapp = commanddata.application; uidocument uidoc = uiapp.activeuidocument; application app = uiapp.application; document doc = uidoc.document; foreach(elementid id in uidoc.selection.getelementids()) { familyinstance faminstance = doc.getelement(id) familyinstance; if (faminstance == null) continue; //skip element faminstance.symbol.name = faminstance.symbol.name + " - changed"; }

javascript - jquery value does't match format -

i validate input field , check if value not match time format 06:15 should .not statement? ($("#id").val().not.match(/^(2[0-3]|[01][0-9]):[0-5][0-9]$/)) you should not use .not in case. the .not jquery function need selector , element or array parameter, eg: $( "li" ).not( ":even" ); as mentionned arun p johny in comments, best way use logical not operator : ! perform logical negation on expression: if(!$("#id").val().match(/^(2[0-3]|[01][0-9]):[0-5][0-9]$/)) { //not matching regexp }

dictionary - How to iterate a map that contains another map with jQuery? -

Image
i have json called data : like can see, map contains map (listinfo). i iterate with: $.each(data, function (key, value) { alert(value); }; the alert print values (1, reunion, 15/06/2015, , on) when arrives listinfo prints, rightly, [object object] how can solve problem? thanks function loop(data) { $.each(data, function (key, value) { if(typeof value === "object") loop(value); else alert(value); }); } loop(data);

javascript - cant get comments to the facebook from the website -

i working website development.when adds comment website,comments displaying in website not in facebook wall.can please give me suggestion regarding this this feature in testing right major publishers according http://techcrunch.com/2015/03/25/facebooks-new-comments-plugin-syncs-conversations-between-sites-and-fb-pages/ i'm hoping it's released soon.