Posts

Showing posts from March, 2014

ios - How to prevent "bounce" effect when a custom view redraws after zooming? -

note casual readers: despite title, question has nothing uiscrollview properties bounces (scrolling related) or bounceszoom . i using uiscrollview add zooming custom view. custom view uses sublayers draw content. each sublayer calayer instance added view's main layer [calayer addsublayer:] . sublayers use coregraphics render content. after each zoom completes, custom view needs redraw content @ new zoom scale content appears crisp , sharp again. trying approach work shown in this question , i.e. reset scroll view's zoomscale property 1.0 after each zoom operation, adjust minimumzoomscale , maximumzoomscale properties user cannot zoom in/out more intended. the content redrawing works correctly (!), missing smooth gui update zoomed content redrawn in place without appearing move. current solution (code example follows @ bottom of question), observe kind of "bounce" effect: zoom operation ends, zoomed content briefly moves different location, moves ori

cluster analysis - R plot upper dendrogram based on k -

Image
i clustering distance matrix based on 20,000 row x 169 column data set in r using hclust(). when convert cluster object dendrogram , plot entire dendrogram, difficult read because large, if output large pdf. df <- as.data.frame(matrix(abs(rnorm(3380000)), nrow = 20000)) mydist <- vegdist(df) my.hc <- hclust(mydist, method = "average") hcd <- as.dendrogram(my.hc) pdf("hclust_plot.pdf", width = 40, height = 15) plot(hcd) dev.off() i specify number of clusters (k) @ truncate dendrogram, plot upper portion of dendrogram above k split points. know can plot upper portion based on specifying height (h) using function cut(). pdf("hclust_plot2.pdf", width = 40, height = 15) plot(cut(hcd, h = 0.99)$upper) dev.off() i know can use dendextend package color dendrogram plot k groups. library(dendextend) pdf("hclust_plot3.pdf", width = 40, height = 15) plot(color_branches(hcd, k = 44)) dev.off() but data set, dendrogram dense read g

javascript - jquery masked input have only first number optional rest mandatory -

im using jquery masked input plugin , need have phone field following format: 1 (222) - 000 - 1114 my code looks this: $("#myphone").mask("9 (999) - 999 - 9999"); now cant seem work make first digit optional rest mandatory. following numbers valid : 1 (222) - 000 - 1114 (222) - 000 - 1114 and following numbers invalid 1 (222) - 000 - 11 (222) - 00 - 0011 using "?9 (999) - 999- 9999" not work since makes whole thing optional if cant done in masked can me out regular expression achieve this? try this: $.mask.definitions['~'] = '([0-9] )?'; $("#myphone").mask("~(999) - 999 - 9999");

xml - C# Calling list from Class -

this question has answer here: what nullreferenceexception, , how fix it? 29 answers i pulling httpwebrequest warranty information. have tested each section information , worked. once put class failed. my question is, how can call device class ? dell computerrequest = new dell(apikey); xdocument xltest = new xdocument(); xltest = computerrequest.xmlresponse(txttag.text.trim()); xnamespace getassetwarrantya = "http://schemas.datacontract.org/2004/07/dell.awr.domain.asset"; xnamespace getassetwarrantyi = "http://www.w3.org/2001/xmlschema-instance"; list<device> xlasset = (from asset in xltest.descendants(getassetwarrantya + "response") select new device() { deviceinfo = (from defaulti

html - HTML5 using <video> tag to insert every .mp4 from a directory -

i'm trying make basic image/video sharing website. make things easier on myself, wondering if possible mass-include .mp4's directory instead of individually adding them. here current doc: <html> <body>under construction.<br> <video autoplay> <source src="away.mp4" type="video/mp4"> </video> </body> </html> i don't want have manually add <video> tag every file, there way add them @ once? or youtube does, shows thumbnail opens page play it. if there way add video sources en masse, include newly added files? i think mean creating video playlist check these links http://thenewcode.com/909/create-an-automatic-html5-video-playlist http://thenewcode.com/792/create-a-simple-html5-video-playlist

vb.net - Visual Basic read text file and delete files from that file -

i know how tell program how read file dont know how use information delete files text file. example; i have text file called ban.txt inside file there 2 lines text abc.exe , cba.exe i want program read content of ban.txt , delete specified files. assuming know how read file , find file names, add statement for-each: my.computer.filesystem.deletefile(strfilename) there options displaying error messages , sending file recycle bin. my.computer.filesystem.deletefile("c:\test.txt", fileio.uioption.alldialogs, fileio.recycleoption.sendtorecyclebin)

comparing two numerical varialbes in R -

i have run r function stl() function , use generated residuals grubbs test. code following: stl.res = stl(dataset, s.windows='periodic') residuals = as.numeric(strl.res$time.series[, "remainder"]) grubbs.result = grubbs.test(residuals) strsplit(grubbs.result$alternative," ")[[1]][3] ## [1] "38.4000349179783" outlier = as.numeric(strsplit(grubbs.result$alternative," ")[[1]][3]) outlier ## [1] 38.40003492 which(residuals == outlier) ## integer(0) my question why return value of which() 0. residuals[1920] = 38.4000349179783 . call of which() should return value of 1921, not 0. guess problem precision. have tried many ways, not managed solve it. any appreciated. if it's precision issue (which r faq 7.31), there various ways around it. # approximation of test x <- c(1, 2, 38.4000349179783, 4, 5) y <- 38.40003492 > x == y [1] false false false false false # doesn't return # 1 basic approach > wh

how to count rows and still display all rows? mysql -

hello im trying count number of rows each employee salary. i have 2 tables ex. table employee id_____________name 1..............sam 2..............greg 3..............vic 4..............steve table salary id____________salary 1.............10000 1.............15000 2.............30000 3.............13000 4.............90000 4.............20000 the result need is id| name | salary| count 1 | sam | 10000 | 2 1 | sam | 15000 | 2 2 | greg | 30000 | 1 3 | vic | 13000 | 1 4 |steve | 90000 | 2 4 |steve | 90000 | 2 to summarize: have 4 employees past salaries. i'm trying create query shows list of salaries , how many salaries employee has. here have tried 6 count... create temporary table rates select e.id, e.name, s.salary, count(*) count employee e inner join salary s on e.id = s.id group name, s.salary order name; create temporary table sum select r.id, sum(count) sum rates r; select * rates left outer join sum s on r.id = s.id; i've t

regex pattern to match first 2 numbers in a string -

this question has answer here: learning regular expressions [closed] 1 answer can 1 please i need regex pattern check the first 2 numbers match either 01 or 02 or 03 or 07 only ^0[1237] ^ - start of string 0 - zero [1237] - character set matches 1 of listed

javascript - jQuery simultaneously slide text to center from left / slide text from center to right -

i want able have "hello" slide center right out of frame (and fade out) while @ same time have "there" slide left center (and fade in) when button clicked. can't figure out how achieve without having divs on separate lines. ultimately want build sliding menu controllable "next" , "prev" buttons, figured i'd start small. thank you! html: <div id="test"> hello </div> <div id="test2"> there </div> <button id="next"> next </button> </body> javascript: $(document).ready(function() { $("#next").click(function() { $("#test").hide("slide", { direction: "right" }, 1000); $("#test2").show("slide", { direction: "left" }, 1000); }); }); https://jsfiddle.net/qftqzr6f/ you can position absolute these divs. see

excel - If a name in a column is a match, count certain text in the row -

Image
i have column/list of duplicate names. in corresponding row/columns of duplicate names, cells contain "truant." another column contains unique names off same list. i want formula next unique name (listed once) shows how many "truant" cells name has beside it. for example: john smith might in column 5 times, , in 9 cells in same row "truant" shows sporadically. have column contains john's unique name once. in column next name, want show how many truants in cells in same rows duplicated name... wish post attachment! i suggest in 2 steps: 1) count each row, with: =countif(b2:j2,"truant") (as in k2 , copied down) then: 2) in table of unique names sum say: =sumif(a:a,m2,k:k) however there various alternatives other functions or pivottable might prove more convenient in long-term, specially if did not mind indicating truancy 1 rather truant .

powershell - Git clone: Redirect stderr to stdout but keep errors being written to stderr -

git clone writes output stderr documented here . can redirect following command: git clone https://myrepo c:\repo 2>&1 but redirect output, including errors, stderr to stdout . there way redirect progress messages stdout have error messages still written stderr . i use script run git commands. since git write stderr if successful (e.g. pull when in sync), handles cases , writes out first line of output, need know. <# .synopsis invoke git, handling quirky stderr isn't error .outputs git messages, , lastly exit code .example invoke-git push .example invoke-git "add ." #> function invoke-git { param( [parameter(mandatory)] [string] $command ) try { $exit = 0 $path = [system.io.path]::gettempfilename() invoke-expression "git $command 2> $path" $exit = $lastexitcode if ( $exit -gt 0 ) { write-error (get-content $path).tostring() }

visual studio code - Show network traffic -

Image
is possible view network traffic (http requests, raw http etc.) similar chrome dev tools ( network tab ) generated application ( nodejs if makes difference) via vscode ? this functionality present, doesn't show requests , responses of application running. the developer tools connected running instance of code , not application executing. not possible view network traffic application launching code.

javascript - Send file as a response from ajax request -

i have javascript function sends name of audio file on server php script using jquery get. looks this: function getaudioclip() { var x = document.getelementbyid("clips").value; $.get( "get_audio.php", { filename: x } ) .done(function( data ) { loadaudioclip(data); }); } the function loadaudioclip(data) displays waveform of audio file given data. want make get_audio.php return audio file file name x, can use display waveform using loadaudioclip(data) function. edit: figured out maybe can file directly instead of using php, this function getaudioclip() { var x = document.getelementbyid("clips").value; $.get( "audio/" + x , function( data ) { loadaudioclip(data); }); } is possible? x filename(ex. myrecording02.wav). opening audio file php slow process. maybe can check existence of file php, , if file exists, this: header("location: $filename");

c# - Not using method in derived class -

this question has answer here: c# - keyword usage virtual+override vs. new 9 answers uni assignment requires build pizza app in c# derives sauce ingredient . have list<ingredient> storing objects of both types. pizza.cs calls method getinstructions() different in derived method. unfortunately sauce.getinstructions() never being called. can see, there's debug line in there should pop message box when program executing routine it's not popping up. can suggest why not? pizza.cs contains following method: public string buildinstructionlist() { // iterate through list of selected toppings , build single string display in gui int count = 1; string instructions = ""; foreach (var in toppings) { instructions = instructions += string.format("step {0}: {1}", count, i.getinstructions()); count++

javascript - OwlCarousel Youtube video not showing -

i have youtube video want shown doesn't show @ all. didn't add height or width video because want keep responsive. http://www.owlcarousel.owlgraphic.com/demos/video.html <div id="carousel" class="owl-carousel"> <div> <a class="owl-video" href="https://www.youtube.com/watch?v=oy9gfaq4x4w"></a> </div> <div><img src="http://cdn.playbuzz.com/cdn/7a7a5814-ed79-410c-b748-db6a24f73f0b/4d71c010-f930-4334-ba62-79d87a7ddef4.jpg"></div> </div> http://jsfiddle.net/nlz17fcv/12/ adding video using a tag seems not working. <div> <a class="owl-video" href="https://www.youtube.com/watch?v=oy9gfaq4x4w"></a> </div> instead can replace iframe embed video want this. <div class="item-video"> <iframe width="420" height="315" src="https://www.youtube.com/embed/oy9gfaq4

mysql - Error #1215 - Cannot add foreign key constraint -

i have generated sql script mysql workbench. when try create database have "error 1215 1215 - cannot add foreign key constraint". the problem seems last foreign key in last create table : constraint `fk_tb_animation_option_col_debut` foreign key (`dt_ano_debut`) references `brest2016`.`tb_animation_option` (`dt_ano_debut`) on delete no action on update no action) this entire script: -- mysql script generated mysql workbench -- 01/16/16 00:46:22 -- model: new model version: 1.0 -- mysql workbench forward engineering set @old_unique_checks=@@unique_checks, unique_checks=0; set @old_foreign_key_checks=@@foreign_key_checks, foreign_key_checks=0; set @old_sql_mode=@@sql_mode, sql_mode='traditional,allow_invalid_dates'; -- ----------------------------------------------------- -- schema brest2016 -- ----------------------------------------------------- create schema if not exists `brest2016` default character set utf8 ; use `brest2016` ; -- ------------

javascript - Birghtcove chromeless video player controls not working in Safari -

issue happening brightcove's chromeless player the controls (pause, play, , move specific time in video) appear on hover when clicked disappear (instead of pausing/playing or moving specified time). they appear , work in firefox , chrome... :( here configuration: <object id={this.props.elemid} classname="brightcoveexperience"> <param name="allowfullscreen" value="false" /> <param name="bgcolor" value="#000000" /> <param name="width" value="960" /> <param name="playerid" value="**********" /> <param name="playerkey" value="**********" /> <param name="height" value="540" /> <param name="isui" value="true" /> <param name="isvid" value="true" /> <param name="dynamicstreaming

ruby - Strong params: How to process nested json code? -

i'm trying write update method processes json. json looks this: { "organization": { "id": 1, "nodes": [ { "id": 1, "title": "hello", "description": "my description." }, { "id": 101, "title": "fdhgh", "description": "my description." } ] } } my update method follows: def update organization = organization.find(params[:id]) nodes = params[:organization][:nodes] nodes.each |node| n = node.find(node[:id]) unless n.update_attributes(node_params) render json: organization, status: :failed end end render json: diagram, status: :ok end private def node_params params.require(:organization).permit(nodes: [:title, :description]) end unfortunately, n.update_attributes(node_params) generates: unpermi

html - Override CSS File -

this question has answer here: overriding css style? 2 answers i using optimizepress template has css file following line part of theme: .container{width:1060px;margin-left:auto;margin-right:auto;background-color:#fff} . i want override make width 900px. how can without changing css file? optimizepress theme has ability on page css tried use important not working me. you link css file, underneath current one. in css, if have 2 styles same class, last 1 computer reads 1 gets chosen. that's why need link new css after. so make new css file , write .container { width: 1060px; } then in html header, directly underneath linkg current css put <link rel="stylesheet" href="path/to/yournewcssfile.css">

c++ - "undefined reference to" in G++ Cpp -

can't seem errors go away. errors below. have looked on google , still can't figure out. not new cpp, have not fooled in while. weird thing worked g++ in windows... errors: [ze@fed0r! - - -** _ _*]$ g++ main.cpp /tmp/ccjl2zhe.o: in function `main': main.cpp:(.text+0x11): undefined reference `help::help()' main.cpp:(.text+0x1d): undefined reference `help::sayname()' main.cpp:(.text+0x2e): undefined reference `help::~help()' main.cpp:(.text+0x46): undefined reference `help::~help()' collect2: ld returned 1 exit status main.cpp #include <iostream> #include "help.h" using namespace std; int main () { h; h.sayname(); // *** // *** // *** return 0; } help.h #ifndef help_h #define help_h class { public: help(); ~help(); void sayname(); protected: private: }; #endif // help_h help.cpp #include <iostream> #include "help.h" using namespac

android.database.sqlite.SQLiteException: near ",": syntax error (code 1): , while compiling -

android.database.sqlite.sqliteexception: near ",": syntax error (code 1): , while compiling: select id, title, tagline, overview, release_date, vote_average, popularity, posterpath, runtime, genres, cast, crew, follow, notified moviesnowplaying . @override public cursor query(uri uri, string[] projection, string selection, string[] selectionargs, string sortorder) { sqlitequerybuilder querybuilder = new sqlitequerybuilder(); switch (urimatcher.match(uri)) { case uricodenowplaying: querybuilder.settables(moviesschema.moviesnowplaying.table_name); break; case uricodeupcoming: querybuilder.settables(moviesschema.moviesupcoming.table_name); break; case uricodepopular: querybuilder.settables(moviesschema.moviespopular.table_name); break; default: throw new illegalargumentexception("unknown uri " + uri); } cursor cursor = querybuil

r - PCA prcomp: how to get PC1 to PC3 graph -

Image
in script pca (below), graph of pc1 vs pc2. mydata.pca <- prcomp(mydata.fixed, center = true, scale. = true) g <- ggbiplot(mydata.pca, obs.scale = 1, var.scale = 1, groups = mysamples, ellipse = false, circle = false, var.axes=false) g <- g + scale_color_discrete(name = '') g <- g + theme(legend.direction ='horizontal', legend.position = 'top') g <- g + theme_bw() however, when run like: summary(mydata.pca) i see info pc1 pc4. how can change ggbioplot script graph of pc1 vs pc3? the choices argument ggbiplot looking for: iris_pca <- prcomp(iris[, 1:4], center = true, scale. = t) # pc1 vs pc 2 ggbiplot(iris_pca, choices = c(1,2), obs.scale = 1, var.scale = 1, groups = iris$species, ellipse = true, circle = true) + scale_color_discrete(name = '') + theme(legend.direction = 'horizontal', legend.position = 'top&#

css - Fix an image in the middle of the page with HTML -

i not deal html , thought should pretty easy seems not. wanted image , text displayed in middle of page. can align image , text middle horizontally cannot vertically. found solution , wondered why working , if there better way. code version 1 (not working): <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <div style="width:100%; height:100%; text-align:center"> <img src="http://dummyimage.com/100x50/fc0/000000.png" style="float:middle"> <br> hello world! </div> </body> </html> although read use tables when table tried: code version 2 (not working): <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd&quo

How should multiple Fortran strings be passed to C? -

to pass fortran string c, hidden parameter passed variable's size. here's working fortran definition, , c (actually c++/cli) method: interface subroutine appendextension( + filename) + bind(c, name="appendextension") character *1, intent(inout):: filename end subroutine appendextension end interface and here's c++/cli gets called: extern "c" { void __declspec(dllexport) __cdecl appendextension( char * name, int buffersize) { string^ clistr = gcnew string(name); clistr = system::io::path::changeextension(clistr->trim(), gcnew string("out")); intptr p = marshal::stringtohglobalansi(clistr); char *pnewcharstr = static_cast<char*>(p.topointer()); int cstrlen = strlen(pnewcharstr); memcpy_s(name, buffersize, pnewcharstr, cstrlen); if (cstrlen < buffersize) { // backfill spaces, since fortran st

gradle - How do I add dependencies to grandchildren projects from root? -

i have multi level nested project goes 3 levels , add dependency 3rd level root project build.gradle file. how do that? for example, have following project structure. gp (grandparent) @ root, p1 , p2 direct subprojects under gp, , gc1 , gc2 subprojects under p1 , gc3 , gc4 subprojects under p2. gp |____ p1 ...........|____gc1 ...........|____gc2 |____ p2 ...........|____ gc3 .......... |____ gc4 from gp's build.gradle, want add dependencies gc1, gc2, gc3 , gc4. tried following in build.gradle of gp: configure(subprojects) { compile group: 'org.slf4j', name: 'jul-to-slf4j', version: '1.7.7' } it fails message when trying process gc1, gc2, gc3 or gc4, passes p1 , p2. no signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.defaultdependencyhandler.compile() applicable argument types: (org.gradle.api.internal.file.collections.defaultconfigurablefilecollection) values: [file collection] possible solutions: mod

Javascript low poly generator with color change -

Image
ok, fell in love i've found on wata.pimmey.com , think color changing low poly background beautiful. i've checked source code of page , scripts attached it, couldn't find helpful. maybe it's because i'm noob , didn't see obvious in there. i'd thankful if me find exact code make similar background or find third-party tools re-create same thing. thanks in advance. pd: i'm sorry grammar errors have made in post, english not native language. i'll study bit more. edit: nevermind, found github.com/msurguy/triangles its done using multiple svg shapes , tracking mouse mouse moves around screen calculates how shade different triangles if closely can see changing color values based on mouse position for method of calculating color have use ur imagination or inspect further have try @ geteventlisteners(document.getelementbyidname('triangles') )

angular - How to target specific element with DynamicComponentLoader -

background i have data represent list of folders , categories of documents; our information management software through web interface. raw list each item has parentfolderno i've created object children: any[] property - have nested list of items; this: { id: 123, guid: "8dcaae38-4dcc-48f7-bd91-c8b0cb725890" children: [ { id: 234, guid: "...." }, { id: 345, guid: "...." children: [...] } ] } implementation there many more objects there, have it's own children, don't, each unique , has unique guid . object need create ui element lets user select specific folder or category , limit search. can think of selectable breadcrumbs. i've created component uses dynamiccomponentloader display specific 'tree' of data: @component({ host: { "[attr.id]": "category.guid" }, selector: 'category-group', template: ` <ul class="category__

visual studio 2012 - .DS-store problems when trying to publish with web deploy -

i'm trying use web-deploy when running web deploy error 4 copying file content\font\ui-fonts\font - logo, headlines.ds_store obj\release\package\packagetmp\content\font\ui-fonts\font - logo, headlines.ds_store failed. not find file 'content\font\ui-fonts\font - logo, headlines.ds_store'. 0 0 ui.webui my ms build works fine

angularjs - Pass data to ngDialog in Angular -

how can pass data ngdialog in angular? examples using scope this. don't use scope in controller. should do? here code inside controller: var vm = this; authservice.login(user.name,user.password).then(function() { $state.go('dashboard'); },function(error) { vm.user.password = ''; ngdialog.open({ template: '<h2>error</h2><p>{{error}}</p>', plain: true }); }) any idea? thanks. you using resolve same way routers. whatever properties define in resolve can injected controller ngdialog.open({ template: '<h2>error</h2><p>{{error}}</p>', plain: true, resolve:{ error: function(){ return error; } }, controller: function($scope,error){ $scope.error = error; } });

php - Failed to select data with where clause in array -

i have array $deptid : array(5) { [0]=> string(1) "2" [1]=> string(1) "8" [2]=> string(2) "11" [3]=> string(2) "15" [4]=> string(2) "17" } then, want select mysql database data deptid in array. query: $deptdid = implode(',', $deptid); $this->db->select(*) ->from('tabel_data') ->where('deptid in ('.$deptid.')') ->group_by('deptid', 'asc') ->get(''): but error occur. you have error in sql syntax; check manual corresponds mysql server version right syntax use near (array) group `deptid` @ line 6. maybe can give me solution since you're using codeigniter can try using where_in function instead of implode , where . where_in method you. $this->db->select(*) ->from('tabel_data') ->where_in('deptid', $deptid) ->group_by('deptid', 'asc') ->get(''):

Decoding a Python 2 `tempfile` with python-future -

i'm attempting write python 2/3 compatible routine fetch csv file, decode latin_1 unicode , feed csv.dictreader in robust, scalable manner. for python 2/3 support, i'm using python-future including imporing open builtins , , importing unicode_literals consistent behaviour i'm hoping handle exceptionally large files spilling disk, using tempfile.spooledtemporaryfile i'm using io.textiowrapper handle decoding latin_1 encoding before feeding dictreader this works fine under python 3. the problem textiowrapper expects wrap stream conforms bufferediobase . unfortunately under python 2, although have imported python 3-style open , vanilla python 2 tempfile.spooledtemporaryfile still of course returns python 2 cstringio.stringo , instead of python 3 io.bytesio required textiowrapper . i can think of these possible approaches: wrap python 2 cstringio.stringo python 3-style io.bytesio . i'm not sure how approach - need write such wrapper or 1 ex

How to update specified row in html table using php -

i have table employee in database. able add, fetch , display each row in table in html table dynamically using php. <a href='add-employee.php' style='float:right;'>add employee</a> <table class="table table-responsive"> <thead> <th><strong>employee id</strong></th> <th><strong>last name</strong></th> <th><strong>first name</strong></th> <th><strong>department</strong></th> <th><strong>position</strong></th> <th><strong>telephone</strong></th> </thead> <tbody> <?php $load_employees = mysql_query("select * tbl_employee"); $loaded_employees = mysql_num_rows($load_employees); while($y=mysql_fetch_array($load_employees)){

How to get the five highest values from a list in Excel -

Image
in sheet have column1 text , column2 random numbers. i column3 5 "highest texts" example: i know can text if make index/match looking number, i'm lost @ sorting part. place in cell c1 , drag down: =lookup(rept("z",255),if(large($b$1:$b$10-(row($b$1:$b$10)/9^9),rows($a$1:a1))=$b$1:$b$10-(row($b$1:$b$10)/9^9),$a$1:$a$10)) this needs entered ctrl + shift + enter .

Need help: getting a Bootstrap email contact form to work from HTML/PHP code -

i setting blog , have contact form page (standard bootstrap blog template) i have uploaded onto host - hostgator, can't manage contact form send email out properly. i have tried both external email account , account on same domain name no luck. here original html source contact page bootstrap: https://github.com/ironsummitmedia/startbootstrap-clean-blog/blob/gh-pages/contact.html and original source contact_me.php: https://github.com/ironsummitmedia/startbootstrap-clean-blog/blob/gh-pages/mail/contact_me.php is there setting need change hostgator cpanel or in code i'm missing? edit: here domain if want view source have in place: www.decentralizeblog.com i have made bit changes form have not used attributes in form link method , action , name attribute in text field <form name="sentmessage" id="contactform" action="mailer.php" method="post" novalidate> <div class="r

arrays - Twitter API sendSynchronousRequest -

i have error :"extrat argument error in call" when remove error attribute nothing fixed let verify = nsurl(string: "https://api.twitter.com/1.1/account/verify_credentials.json") var request = nsmutableurlrequest(url: verify!) pftwitterutils.twitter()!.signrequest(request) var response: nsurlresponse? var error: nserror? var data = nsurlconnection.sendsynchronousrequest(request, returningresponse: &response, error: &error) if pftwitterutils.islinkedwithuser(pfuser.currentuser()!) { let screenname = pftwitterutils.twitter()?.screenname! pfuser.currentuser()?.username=screenname! pfuser.currentuser()?.saveeventually() let url = nsurl(string: "https://api.twitter.com/1.1/users/show.json?screen_name=" + screenname!) let request = nsurlrequest(url: url!, cachepolicy: .reloadignoringlocalandremotecachedata, timeoutinterval: 5.0) let session = nsurlsession.sharedsession() session.datataskwi

How to grab values from key:value pairs in parsed JSON in Python -

i trying extract data json file. here code. import json json_file = open('test.json') data = json.load(json_file) json_file.close() at point can print file using print data , appears file has been read in properly. now grab value key:value pair in dictionary nested within list nested within dictionary (phew!). initial strategy create dictionary , plop dictionary nested within list in , extract key:value pairs need. dict = {} dict = json_file.get('dataobjects', none) dict[0] when try @ contents of dict, see there 1 element. entire dictionary appears have been read list. i've tried couple of different approaches, still wind dictionary read list. love grab nested dictionary , use .get grab values need. here sample of json working with. specifically, trying pull out identifier , description values dataobjects section. { "identi

Extended list comprehension options - Python -

i use example of code project euler exercise. [(a, b, c) in range(1, 334) b in range(1, 334) c in range(1,334) if c == 1000 - - b , < b , b < c , a**2 + b**2 == c**2] i know little list comprehensions wondering if there way imply a, b, c ints > 0 , want increment them two pseudo code examples might like: [(a, b, c) > 0 b > c > b if c == 1000 - - b] [(a, b, c) int(a) int(b) int(c) if c == 1000 - - b] is possible this? here simplification approach: [(a, b, 1000 - - b) in range(1, 332) b in range(a+1, 333) if a**2 + b**2 == (1000 - - b)**2] c fix, 1000 - - b no need make loop of values it. you can start range of b range(a+1,333) dont have test if b>a though wrong solution problem think

php - how to attach a page to a custom post type -

this has worked me in past, unsure why not working now. i have created custom post type: add_action('init', 'register_team'); function register_team(){ $args = array( 'label' => __('design team'), 'singular_label' => __('design team'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => true, 'rewrite' => array("slug" => "design-team",'with_front' => true), // permalinks format 'supports' => array( 'title', 'editor', 'thumbnail' ), 'add_new' => __( 'add new member' ), 'add_new_item' => __( 'add new member' ), 'edit' => __( 'edit member' ), 'edit_item&#