Posts

Showing posts from March, 2011

php - Non existent pages to error page htaccess file -

i trying write rewrite rule return 404 on urls spam parameters. used following rewrite tool return error 404 query string voxter.pdf&gpvoq , parameters gpvoq not producing 404 error. rewritecond %{voxter.pdf&gpvoq} (^|&)parm1=gpvoq [nc] rewriterule (.*)/error-404.php? [r=404,l] can u please me mistake doing? %{voxter.pdf&gpvoq} isn't apache variable. match literal. need using %{query_string} variable instead: rewritecond %{query_string} (voxter.pdf|gpvoq) [nc] rewriterule ^ /error-404.php? [r=404,l] or similar regex.

c# - What to use in the blank space in order to add the "x" variable from class A without creating another object of A? -

i have use this keyword in order add 3 values of x present in 3 classes. i not allowed create instance of class a in method m1 . class program { static void main(string[] args) { c c = new c(); int op = c.m1(); console.writeline(c.x); console.writeline(); } } public class { public int x = 10; } public class b:a { public int x = 100; } public class c:b { public int x = 1000; public int m1() { return (x + base.x + _____ ); //what use in blank space in order //add "x" variable class without //creating object of } } } cast current instance ( this ) a . can use ((a)this).x heres complete code of method, how define it public int m1() { return (x + ((b)this).x + ((a)this).x ); }

How to solve OverflowError: Python int too large to convert to C long with opencv? -

__author__ = 'kyle' help_message = """script: frame_grabber.py usage: python frame_grabber.py path/to/video requires: opencv 2.4.8+ purpose: select , save frames given video. commands: key function previous frame d next frame q exit shift + skip 10 frames forward shift + d skip 10 frames backwards s saves current frame dbl click saves current frame controls: slider navigate through video """ # check if user has provided path file # otherwise display help_message import sys import time t # check if opencv module present # otherwise stop application try: import cv2 except importerror e: print "fatal error: not import opencv, ", e exit(-1) else: print "using opencv ", cv2.__version__ # these flags may depend on opencv version: # in opencv 3.0.0 these flags implemented # cv2.cap_prop_pos_

php - How to replace some characters in tsv file like HTML Math and Engineering symbol entities -

actually want replace these html math , engineering symbol entities numbers. there equivalent code ¼ ¼ , ½ ½ . examples given in link below . i have used str_replace , preg_match non of them worked. please tell me way this. highly appreciated. you can use mb_encode_numericentity function this, http://php.net/manual/en/function.mb-encode-numericentity.php $string = '¼ ½ ⅖ ⅘ ⅚ '; $convmap= array(0x0080, 0xffff, 0, 0xffff); $string = mb_encode_numericentity($string, $convmap, 'utf-8'); echo $string; output: ¼ ½ ⅖ ⅘ ⅚ demo: http://sandbox.onlinephpfunctions.com/code/c554aae1696c8ded4cdd97329269828c4cbf836b note: convert other characters outside ascii character set. if want convert 5 characters str_replace might better route. $string = ' figure ¼,½,⅖,⅘,⅚ not'; $find = array('¼', '½', '⅖', '⅘', '⅚'); $replace = array('&#

java - Serlaize case class with the variable inside it in scala with jackson -

i tiring serialize case class using jackson fasterxml , can see constructor parameters after deserialize (taskrequest , tasknamein) not variables inside class (jobsrequests null example): //@jsonignoreproperties(ignoreunknown = true) // tried remove no luck @jsonautodetect case class job(taskrequest: list[taskrequest] = nil,tasknamein:string) { { this.jobsrequests = taskrequest this.taskname= tasknamein } @jsonproperty @volatile private var jobsrequests: list[taskrequest] = nil @jsonproperty var task_name: string = "" } any suggestions ? jackson uses getter java beans standard construct json. try adding @beanproperty properties , constructor parameters compile class getter/setters. example or use jackson scala-module . can take @ tests see how use module serialization .

javascript - Page action icon displays only in extension page -

Image
i'm learning creating chrome extensions. have studied page actions, used create icon inside address bar. code follows: in manifest.json : { "manifest_version" :2, "name" : "gtmetrix", "description": "test google chrome extension", "version" : "1.0", "page_action":{ "default_icon" : "icon.png", "default_popup" : "popup.html", "default_title" : "test google chrome extension" }, "background": { "scripts": ["background.js"] }, "permissions" : [ "activetab" ] } in background.js chrome.tabs.getselected(null, function(tab) { chrome.pageaction.show(tab.id); }); in popup.html <html> <head> <script src="jquery.min.js"></script> <script src="popup.js"></script> <!-

CSS selector for first TH after a caption in a table -

i have table want select first th if contains caption . thought might this: .mytable caption + tr th:first-child { /* stuff */ } it's instead selecting nothing. bug in css or logic? see jsfiddle: https://jsfiddle.net/ukb13pdp/1/ .objecttable th:first-child { background-color: blue; color: white; } .objecttable caption + tr th:first-child { background-color: red; } <table class='objecttable'> <caption>caption table</caption> <tr> <th>a</th> <th>b</th> </tr> <tr> <td>1</td> <td>2</td> </tr> </table> <br/><br/> <span>no caption table</span> <table class='objecttable'> <tr> <th>c</th> <th>d</th> </tr> <tr> <td>3</td> <td>4</t

java - What to fill into main class in Intellij to pack all the examples into one jar? -

i'm trying build jar intellij, requires main class. example using storm-starter . want pack examples jar. what should fill main class can pack examples 1 jar?

android - Image's are loading with black background -

Image
i loading image web-service in dynamic horizontal linear layout .some of phones showing images black background moto-x android4.4.4 see image below but on moto-e android 4.4.4 .its showing image correctly check image below instead of imageview, use imagebutton , set android:src image , background color transparent/white.

xsd - XML Schema to enforce valid array indexes? -

i have xml file in mock similar array, array name being application, , each element being applicationstring, each containing "index" attribute: <con:config> <con:application con:index="0"> <con:applicationstring>gc1</con:applicationstring> </con:application> <con:application con:index="1"> <con:applicationstring>gc2</con:applicationstring> </con:application> <con:application con:index="2"> <con:applicationstring>gc3</con:applicationstring> </con:application> <con:application con:index="3"> <con:applicationstring>gc5</con:applicationstring> </con:application> </con:config> i wish write xml schema verify "index" attributes indeed valid indexes ranging 0-n , including no duplicates or missing indexes. there known way enforce this? schema have far.

How to extends Abstract Inner Class in java -

i confused if abstract class a{method();method2();} and other class b have inner class c class b{abstract class c{method(){//body}}} and question how extends class c b/c abstract class must extends else unused class. first, let's make simpler - has nothing android directly, , don't need a class @ all. here's want: class outer { abstract class inner { } } class child extends outer.inner { } that doesn't compile, because when create instance of child need provide instance of outer inner constructor: test.java:6: error: enclosing instance contains outer.inner required class child extends outer.inner { ^ 1 error there 2 options can fix this: if don't need refer implicit instance of outer inner , make inner static nested class instead: static abstract class inner { } you change child accept reference instance of outer , , use that call inner constructor, uses surprising syntax, works: child(outer outer) { // cal

javascript - Flyout hide himself on list view iteminvoked event -

if invoke flyout show function on iteminvoked event. flyout automatically hide himself in fraction of second. here code <div id="listview" class="win-selectionstylefilled" data-win-control="winjs.ui.listview" data-win-options="{ itemdatasource: teoco.listview.data.datasource, itemtemplate: select('.settingstemplate'), selectionmode: 'single', tapbehavior: 'directselect', oniteminvoked : name.listview.selectionchanged, layout: { type: winjs.ui.listlayout } }"> </div> <div id="contactflyout" data-win-control="winjs.ui.flyout"> </div> settings.settingsmodules = (new function(){ function selectioneventhandler(evt){ var settingslist = evt.target; evt.detail.itempromise.then(function (invokeditem) { var flyout = document.getelementbyid("contactflyout"

I am getting wrong value from sqlite table in swift -

i getting wrong value sqlite table. code code : var arrtribute_mast_list : nsmutablearray = [] var querysql = string(format:"select * %@ order %@", table_attribute_master, attribute_master_attr_id) var statement:copaquepointer = nil //querysql = querysql.string(nsutf8stringencoding, allowlossyconversion: false) if (sqlite3_prepare_v2(database, querysql, -1, &statement, nil) == sqlite_ok) { while(sqlite3_step(statement) == sqlite_row) { let name = sqlite3_column_text(statement, 2) let attributename = string.fromcstring(unsafepointer<cchar>(name)) println("attribute value = \(attributename)") } sqlite3_finalize(statement); } i getting output: attribute value = optional("shamitabh") need output : attribute value = "shamitabh" you getting optional("shamitabh") because string.fromcstring not guaranteed succeed.

Importing an empty CSV file in SAS -

i'm trying import series of csv files macro loops thru files in given folder.but, there empty csv files in folder exclude loop. there way in sas find csv file size ? proc import out=&output datafile= "&input" dbms=csv replace; getnames=yes; datarow=2; *guessingrows=32000; run; thanks, sam. here's away in datastep: filename fileref 'c:\date.tmp'; data a; infile fileref truncover; fid=fopen('fileref'); bytes=finfo(fid,'file size (bytes)'); crdate=finfo(fid,'create time'); moddate=finfo(fid,'last modified'); input var1 $20.; run;

php - How to extract file extension from file with no extension with mime type octet-stream? -

i have large amount of files original file names have been replaced ids database. example, once name word_document.doc 12345 . through process have lost original name. i trying present these files download. person should able download file , view using it's original application. files in 1 of following formats: .txt (text) .doc (word document) .docx (word document) .wpd (word perfect) .pdf (pdf) .rtf (rich text) .sxw (star office) .odt (open office) i'm using $fhandle = finfo_open(fileinfo_mime); $file_mime_type = finfo_file($fhandle, $filepath); to mime type , mapping mime type extension. the problem running of files have mime type of octet-stream . i've read online , type seems miscellaneous type binary files. can't tell extension needs be. in cases works when set .wpd , cases doesn't. same goes .sxw . symfony2 in 3 steps 1) mime_content_type $type = mime_content_type($path); // remove charset (added of php 5.3) if (false

oracle - Getting common fields of two tables in PL/SQL -

suppose table , table b have various fields. easy way common fields among table , table b ? want inner join on these tables don't know common fields are. note in pl/sql. when table a. or b. list of fields names of each table in drop down menu. common fields. it depends on mean "common fields". if want colums names same in both tables, can use query: select t1.column_name user_tab_columns t1 join user_tab_columns t2 on t1.column_name = t2.column_name /* , t1.data_type = t2.data_type , t1.data_length = t2.data_length */ t1.table_name = 'a' , t2.table_name = 'b' ; demo: http://sqlfiddle.com/#!4/2b662/1 but if @ tables in above demo, see table a has column named x datatype varchar2 , , table b has column named x of different type int . if want columns have the same names, same datatypes , same length , uncomment respective conditions in above query.

c# - Strategy for splitting a large JSON file -

i'm trying split large json files smaller files given array. example: { "headername1": "headerval1", "headername2": "headerval2", "headername3": [{ "element1name1": "element1value1" }, { "element2name1": "element2value1" }, { "element3name1": "element3value1" }, { "element4name1": "element4value1" }, { "element5name1": "element5value1" }, { "element6name1": "element6value1" }] } ...down { "elementnname1": "elementnvalue1" } n large number the user provides name represents array split (in example "headername3") , number of array objects per file, e.g. 1,000,000 this result in n files each containing top name:value pairs (headername1, headername3) , 1,000,000 of headername3

security - Securely running user's code -

i looking create ai environment users can submit own code ai , let them compete. language anything, easy learn javascript or python preferred. basically see 3 options couple of variants: make own language, e.g. javascript clone basic features variables, loops, conditionals, arrays, etc. lot of work if want implement common language features. 1.1 take existing language , strip core. remove lots of features from, say, python until there nothing left above (variables, conditionals, etc.). still lot of work, if want keep date upstream (though ignore upstream). use language's built-in features lock down. know php can disable functions , searching around, similar solutions seem exist python (with lots , lots of caveats). i'd need have understanding of language's features , not miss anything. 2.1. make preprocessor rejects code dangerous stuff (preferably whitelist based). similar option 1, except have implement parser , not implement features: preprocessor has unde

CSV Encoding Issue on PHP upload -

i receive csv file looks straightforward. i run on , tells me ascii. echo mb_detect_encoding($fhandle , "auto"); however when run import code: doesnt work correctly. $sql= "load data local infile '". $fhandle ."' table sys6_impbet fields terminated ',' optionally enclosed '\"' lines terminated '\n' ignore 1 lines ( accno_1, mtgdate, code, venue, location, pool, eventno, gross_sales, refunds, turnover, dividends, profit_loss);" ; it brings in correct number of records puts null or 0 in every field / record. reading file sees records won't values. heres small sample: accno_1,mtgdate,code,venue,location,pool,eventno,gross_sales,refunds,turnover,dividends,profit_loss 66096159,12/07/2015,gallops,penola,sa,treble,0,279.00,0.00,279.00,"1,955.70","1,676.70" 66096159,12/07/2015,gallops,warrnambool,vic,treble,0,"

javascript - Does a clicked on item go out of scope when going into the getJSON section -

when clicking on list item, go out of scope when going getjson section want go , data database? i have list of items displaying colours. each list item has id set of sku. when click on list item, must go , data database sku , populate contents on page. i playing around code , interest's sake wanted see if change text of clicked on list item. after json call done, tried set text, nothing happened. i sku of clicked on list item this: var sku = this.id; after json call tried set text of clicked on list item this: this.text('sample text'); i tried: this.text('sample text'); here full javascript/jquery code: <script> $(document).ready(function () { $('.attributes li').click(function () { var url = 'www.example.com/test-url'; var sku = this.id; $.getjson(url, { sku: sku }, function (data) { // not work this.text('sample tex

Closing MATLAB GUI application programmatically without using error() -

i trying make application/gui closes if user clicks cancel or exit of input dialog. tag of gui called window using close(handles.window); leads program looping through once , (after user clicks cancel or exit again) reaching close(handles.window); line which, of course, leads invalid figure handle error. is there method close application without need producing error , not closing entire matlab environment (like quit , exit). error() temporary fix works don't want application seem has crashed. i have tried close has no effect. it's worth noting application reach inside if statement if user clicks cancel or exit. i have tried setting variable , having close commands outside while loop. apa = getavailablecomport(); aplist = ''; = 0; idx = 1:numel(apa) if == 0 aplist = apa(idx); else aplist = strcat(aplist, ', ', apa(idx)); end = + 1; end prompt = {'enter com port:'}; title = 'com port'; num_lines = 1;

Empty table in MySQL even though Python can insert data into table -

i'm new mysql , python. i have code insert data python mysql, conn = mysqldb.connect(host="localhost", user="root", passwd="kokoblack", db="mydb") in range(0,len(allnames)): try: query = "insert resumes (applicant, jobtitle, lastworkdate, lastupdate, url) values (" query = query + "'"+allnames[i]+"'," +"'"+alltitles[i]+"',"+ "'"+alldates[i]+"'," + "'"+allupdates[i]+"'," + "'"+alllinks[i]+"')" x = conn.cursor() x.execute(query) row = x.fetchall() except: print "error" it seems working fine, because "error" never appears. instead, many rows of "1l" appear in python shell. however, when go mysql, "resumes" table in "mydb" remains empty. i have no idea wrong, not connected mysql'

android - How to make a circular progressBar like telegram? -

Image
i want determinate circular progress bar telegram android app cant find in project sources. and rotating update: using material progress not rotate in determinate mode, want rotate while loading... telegram app. create rotate.xml in res/anim folder: <?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1600" android:fromdegrees="0" android:interpolator="@android:anim/linear_interpolator" android:pivotx="50%" android:pivoty="50%" android:repeatcount="infinite" android:todegrees="360" /> load anim , run in code: view.startanimation(animationutils.loadanimation(activity, r.anim.rotate));

javascript - Join in Meteor with publishComposite -

i have removed autopublish meteor app. i'm publishing collections manually. have related collections. want increase performance as possible. if i'm, instance, looking @ post , want see comments related post, have query database both post: posts.findone(postid) , comments: comments.find({postid: postid}) . querying 2 collections in data field iron-router present in template i'm subscribing publications in waiton . have found https://github.com/englue/meteor-publish-composite lets me publish multiple collections @ same time. don't quite understand it. if i'm using meteor.publishcomposite('postandcomments', ...) in server/publish.js , subscribing postandcomments in waiton , , setting both post , comments in data do, have saved demand on database? me looks still query database same number of times. queries done when publishing queries made while queries done data way retrieve has been queried database? besides, in example 1, shown how publish t

git - Changed github account, not able to clone repository -

i changed github account, generated new ssh key, synced github , hi username, you've authenticated github doesn't provide shell access , , changed github config new user info , token, when try clone private repository, i'm getting fatal: repository not found what's going wrong here? i tried make repository test it, , got error "authentication failed". looked @ github after, , saw repository made, not pushed to. well, chose delete git , start scratch. did sudo rm -rf /usr/bin/git. well, reinstalled git, , i'm still having error. what's going on? pretty bad. turns out problem wasn't prompted change keychain github, had no idea using old password other github account. make sure update keychains.

c# - optional nullable DateTime value in Model -

this model : public class person { public int personid {get;set;} public string name {get;set;} [datatype(datatype.date)] [displayformat(dataformatstring = "{0:yyyy-mm-dd}", applyformatineditmode = true)] public datetime? birthdate {get;set; } } in controller want let datetime property value optional, in word user can enter or not enter value property. how can ? edit : dbcontext class: public class mydbcontext : dbcontext { public mydbcontext() : base("defaultconnection") { } public dbset<person> persons { get; set; } } my action method : [httppost] [validateantiforgerytoken] public actionresult create([bind(include = "personid,name,birthdate")] person person) { if (modelstate.isvalid) { db.persons.add(person); db.savechanges(); // error thrown return redirecttoaction("index"); } return view(person); } exception(thrown when trying create record

swift - IOS Facebook SDK: login doesn't return email despite permissions granted -

i'm trying information through facebook sdk far i'm getting id , name of user, although i'm sure there email available, account. i've been looking @ several answer here none of them solved problem far. doing wrong, , why not returning more data requesting several permissions? here code: fbloginmanager.loginwithreadpermissions(["public_profile", "email", "user_friends", "user_about_me", "user_birthday"], handler: { (result, error) -> void in if ((error) != nil) { // process error println("there error: \(error)") } else if result.iscancelled { // handle cancellations fbloginmanager.logout() } else { var fbloginresult : fbsdkloginmanagerloginresult = result if(fbloginresult.grantedpermissions.contains("email")) { println(fbloginresult)

javascript - Prevent window scrolling without using overflow:hidden -

i'm trying disable scrolling on page , want without using overflow:hidden because repaints whole page when disable overflow:hidden. since want disable touch devices need more disabling mouse movement , if disable touchmove i'm not able scroll horizontally or perform other movements touch. maybe using window.onscroll = function(){//some code here} ?? hint how this?

database - insert statement show 1 row created but data is not insert (script) -

Image
i using run sql command line insert data, script ask below. insert usermaster (userid,userpwd,username,userposition,useraccessrights,userstatus,createuserid) values ('admin','nvzfj0sojj/efu700exl6a==','admin','administrator','non-administrator','1', 'admin'); but when open database using toad , log in user , see, data not insert table. may know place goes wrong? image below output in sql command. what commit. autocommit on? or add 'commit' after insert statement

r - understanding ggplot2 geom_map map_id -

this comes ggplot2 documentation: # better example crimes <- data.frame(state = tolower(rownames(usarrests)), usarrests) library(reshape2) # melt crimesm <- melt(crimes, id = 1) if (require(maps)) { states_map <- map_data("state") ggplot(crimes, aes(map_id = state)) + geom_map(aes(fill = murder), map = states_map) + expand_limits(x = states_map$long, y = states_map$lat) last_plot() + coord_map() ggplot(crimesm, aes(map_id = state)) + geom_map(aes(fill = value), map = states_map) + expand_limits(x = states_map$long, y = states_map$lat) + facet_wrap( ~ variable) } i don't understand how can work since there no common identifier in states_map data frame uses "region" name states column , crimes data frame labels states, "states." ties data map? in example poster renames columns of map data frame conform data ggplot2 documentation doesn't seem it. how? when rename columns of states_map in example above, "state"

c++ - Adding Elements to std::vector of an abstract class -

i want store objects of classes derived common interface (abstract class) in std::vector of abstract class. vector should filled in loop , call constructor of class , push created object vector. as understand, in case of abstract class can store pointers class, need push_back pointers of derived classes. however, not sure scope of these newly created objects. please, have @ code below. code compiles , works fine questions are: a) objects guaranteed exist in second for-loop in main function? or might cease existing beyond scope of loop in created? b) objects' destructors called or might there memory leaks? #include<vector> #include<iostream> class interface { public: interface( int y ) : x(y) {} virtual ~interface() {} virtual void f() = 0; int x; }; class derived_a : public interface { public: derived_a( int y ) : interface(y) {} void f(){ return; } }; class derived_b : public interface { public: derived_b( int y

javascript - Adding a fade in/fade out effect to innerHTML -

i have function loads in json file , changes contents of several divs on page. part works correct, wanted make sexy. when button calls function clicked, new text replaces old text. wanted old text fade out, change text, , fade in new text. here code function loadnextpassage() { //fading out effect $("#passage-title").fadeout(); $("#title").fadeout(); $("#pre-post").fadeout(); $("#passage").fadeout(); $("#media").fadeout(); //load new json file , change elements $.getjson("passage-2.3.2.json", function( data ) { document.getelementbyid("passage-title").innerhtml = data["passagenumber"]; document.getelementbyid("title").innerhtml = data["title"]; document.getelementbyid("pre-post").innerhtml = data["prereading"]; document.getelementbyid("pre-reading-content").innerhtml = data["prereading"

java - How to format number cell in excel by Aspose? -

i using aspose creating excel. getting few difficulties. 1st issue cells.importresultset in how insert customdateformatstring 2nd issue cells.importresultset in how insert customnumberformatstring please check below example number 10000 $10,000 1) may put desired custom date/time format string customdateformatstring parameter in cells.importresultset() overloaded method. see sample line of code reference: e.g sample code: worksheet.getcells().importresultset(rs, 0, 0, true, "d-mmm-yy", true); 2) better once have imported data excel worksheet using cells.importresultset() method, may apply desired number formatting cells in range/column accordingly, see document reference: http://www.aspose.com/docs/display/cellsjava/setting+display+formats+of+numbers+and+dates in case, should set custom number format string "$#,##0" requirements.

c++ - mmap: enforce 64K alignment -

i'm porting project written (by me) windows mobile platforms. i need equivalent of virtualalloc (+friends), , natural 1 mmap . there 2 significant differences. addresses returned virtualalloc guaranteed multiples of so-called allocation granularity ( dwallocationgranularity ). not confused page size, number arbitrary, , on windows system 64k. in contrast address returned mmap guaranteed page-aligned. the reserved/allocated region may freed @ once call virtualfree , , there's no need pass allocation size (that is, size used in virtualalloc ). in contrast munmap should given exact region size unmapped, i.e. frees given number of memory pages without relation how allocated. this imposes problems me. while live (2), (1) real problem. don't want details, assuming smaller allocation granularity, such 4k, lead serious efficiency degradation. related fact code needs put information @ every granularity boundary within allocated regions, impose "gaps" with

android - The target server failed to respond! why this error in 000webhost? -

i using 000webhost sample db, can me solve this? ran application both in real object , on emulator. i getting error: 07-02 07:17:27.120: w/system.err(2675): org.apache.http.nohttpresponseexception: target server failed respond 07-02 07:17:27.120: w/system.err(2675): @ org.apache.http.impl.conn.defaultresponseparser.parsehead(defaultresponseparser.java:85) this json: public class jsonparser { static inputstream = null; static jsonobject jobj = null; static string json = ""; // constructor public jsonparser() { } public jsonobject makehttprequest(string url, string method, list<namevaluepair> params) { // making http request try { // check request method if(method == "post"){ defaulthttpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(url); httppost.setentity(new urlencodedformentity(pa

html - Video thumbnail that links to other page for playing -

i have small thumbnail video file. user can hover on thumbnail , lights up. when user clicks thumbnail video, should lead him category page video can played may user choose so. now code lets video played directly in thumbnail upon clicking, thats not want. is possible have user click video thumbnail "video player look" , video not play, instead user directed page can play video in full screen?? got link working, problem have video should not play in thumbnail user can see "video player controls" knows video can view in category page. html: <div class="videofile"> <video controls=""> <source src="https://commons.wikimedia.org/wiki/file%3aanimaci%c3%b3n_de_escanciar.ogv" type="video/ogv"</video> </div> css: .videofile:hover { opacity:.3 } fiddle: fiddle a video control never used sure overkill - add play button watermark abo

How to install tig docs via Homebrew? -

i installed tig via homebrew , tig works okay, there way cleanly install man pages via brew instead of source (i.e. avoiding make install-doc described @ https://github.com/jonas/tig/blob/master/install.adoc ) "if installed homebrew standard install directories, i.e. relatives /opt/homebrew, there 2 commands register binaries , man files used: /usr/bin/sudo -s echo /opt/homebrew/bin >/etc/paths.d/homebrew echo /opt/homebrew/share/man >/etc/manpaths.d/homebrew exit if using bash or zsh actual shell, have enter 1 simple command take account these 2 environment modifications: . /etc/profile if want learn more how these 2 directories used under macos x, read: man path_helper " - daniel azuelos

Defining python global variable in sub function -

i have tkinter gui opens separate gui checkboxes. in separate window, need reference states of checkboxes, following error: exception in tkinter callback traceback (most recent call last): file "c:\python27\lib\lib-tk\tkinter.py", line 1470, in __call__ return self.func(*args) file "c:\@ batch\lms python script\tester3.pyw", line 23, in var_states print("fx: %d, fy: %d, fz: %d, mx: %d, my: %d, mz: %d" % (fx_1.get(), fy_1.get(), fz_1.get(),mx_1.get(), my_1.get(), mz_1.get())) nameerror: global name 'fx_1' not defined is possible define , reference global variable sub function? here code: from tkinter import * import tkinter import tempfile root = tkinter.tk() root.title("generate apdl") root.geometry("200x225") lbl1 = label(root, text="how many interface points?") lbl1.pack(side=top,padx=5,pady=5) entry1 = entry(root, bd =1) entry1.pack(side=top,padx=5,pady=5) def newwindow(): ipoints=int

javascript - Sending a variable attribute every Ember Data request -

i have various ember models need send same attribute server identify information should modify, know add non-serialised attribute each model , set each time, seems messy. the attribute on application controller, , want sent whenever save/get/update/etc model. any ideas on how might it?

SPI bit banging; MCP3208; Raspberry;error -

i using raspberry pi 2 board raspbian loaded. need spi bit banging & interface mcp3208 . i have taken code github . written mcp3008(10 bit adc). only change made in code instead of calling: adcvalue = recvbits(12, clkpin, misopin) i called adcvalue = recvbits(14, clkpin, misopin) since have receive 14 bits of data. problem : keeps on sending random data ranging 0-10700. though data should max 4095. means not reading data correctly. i think problem mcp3208 has max freq = 2mhz, in code there no delay between 2 consecutive data read or write. think need add delay of 0.5us whenever need transition clock since operating @ 1mhz. for small delay reading accurate delays on raspberry pi excerpt: ...when need accurate short delays in order of microseconds, it’s not best way, combat this, after studying bcm2835 arm peripherals manual , chatting others, i’ve come hybrid solution wiringpi. delays of under 100μs use hardware timer (which appears otherwise unuse

reactjs - Changing src attribute for an audio element doesn't work -

changing src attribute audio element doesn't work: var audio = react.createclass({ render : function() { return ( <audio src={this.props.data.songurl}/> ); } }); var music = react.createclass({ render : function() { return ( <article classname="music"> <article classname="musiccontent"> <musicbutton data={data} /> <list /> <footer /> </article> </article> ); } }); var musicbutton = react.createclass({ getinitialstate : function() { return { isplay : true, count : 0 } }, musicplay : function () { var audio = react.finddomnode(this.refs.audio); if(this.state.isplay) { audio.play(); this.setstate({isplay: false}); } else { a

git - How do i get commit logs of a remote located branch? -

without cloning repository, possible following command-line/git bash, list of branches in repository git logs of specific branch as far aware way connect server using ssh , running git log on server ssh remote@host "cd repo && git log" fo windows u can use putty

javascript - filter array of list into sub array in jquery -

i stuck @ code, have array of li's element , want array contains li ist array has classname hide. here trying <div id="videoarea "> <ul> <li class="hide">a</li> <li class="hide">a</li> <li class="hide">a</li> <li >a</li> <li >a</li> <li >a</li> </ul> <ul> <li class="hide">b</li> <li class="hide">b</li> <li class="hide">b</li> <li >b</li> <li >b</li> <li >b</li> </ul> </div> var items = $("#videoarea div ul"); var templi = items.eq(1).children().hasclass("hide"); // showing true, want array of li's having class hide i want array contains li's of particular ul having class hide , if possible array dont have class hide for li elements .

javascript - Safari jerky / flickering on $(window).scroll function -

i'm coming across issue in safari - image flickers or jerks while scrolling, when altering height of 1 element , margin of on page scroll. this working smoothly , expected far in chrome / firefox (osx), you'll see issue on safari here: http://jsfiddle.net/y1lrnd24/7/ $(window).scroll(function () { var imgheight = 300; var scrolltop = $(window).scrolltop(); var slideheight = imgheight - scrolltop; var margintop = scrolltop; if (slideheight > 0) { $('.slide').css('height', slideheight); $('#slide-holder').css('paddingtop', margintop); } }); (may better illustrated in full-screen: https://jsfiddle.net/y1lrnd24/7/embedded/result/ ) has clues? tried altering margintop paddingtop, had no effect. any appreciated - hoping quick fix! edit: thought should add here 'bug' visible when using mouse wheel... actually, looking @ jsfiddle in safari looks totally normal me. makes me

java - Grails nullable:true not working after modifying domain class -

i have domain class few fields. application running , had add 2 more fields domain class marked nullable: class somedomain{ // fields beginning ............. // 2 fields added afterwards string fielda string fieldb static constraints = { // constraints on initial fields ............... // constraints on fields added afterwards fielda(nullable: true) fieldb(nullable: true) } } but when run this, see fields added mysql table. don't have nullable constraint. not allowing nulls in fields. reason , there way solve this. can edit mysql tables directly add nullable property 2 fields. want know why create 2 fields in table, failed add null constraint(so in future can avoid such errors). i using grails 2.2.1.

java - Validate JSON schema compliance with Jackson against an external schema file -

i use jackson library ( https://github.com/fasterxml/jackson ) deal json files in java, described json schema file. now, validate, if parsed json complies json schema file, parsed itself. there json schema module jackson ( https://github.com/fasterxml/jackson-module-jsonschema ). however, appears me primary focus on creating json schema file within java. what way validate json schema in java? - preferably using jackson, open other solutions. as far know jackson can produce schemas given types, not validation. there json-schema-validator no longer maintained.

simulation - Display time for specific event in simulink/stateflow -

i trying time @ specific condition in simulation occurs. specifically, in simulink model comparing 2 inputs , need save workspace time @ equal each other. appreciated! you can following 2 steps: inside triggered subsystem, put clock block feeding directly workspace block. make subsystem rising edge triggered. outside triggered subsystem, compare 2 signals, , feed comparison trigger port. the times @ comparison true written (as vector) specified workspace variable.

linux - Find, Replace or Insert - command Line -

i have list similar : what want do? import text file opening in excel import text file connecting export data text file saving change delimiter used in text file change separator in .csv text files using sed can find match on 'connecting' , replace line: sed 's^.*connecting.*^import text file opening it^g' crontab this should change above list : what want do? import text file opening in excel import text file opening export data text file saving change delimiter used in text file change separator in .csv text files however need able is: if line exists containing word connecting , replace line, if line doesn't exist add end of list new line. i know can echo "import text file opening it" >> list add line end of list, there anyway can within 1 command ? or commands can run in 1 instance ? thanks an easy way use awk : awk 'begin { s = "import text file opening it" } /connecting/ { $0 = s; n = 1 } 1; end {