Posts

Showing posts from February, 2015

Ruby on Rails ajax 500 syntax error -

Ruby on Rails ajax 500 syntax error - i have static controller , users controller. i have users profile page , want utilize ajax replace existing code form partial. on page, have edit button routes edit action in users controller , goes edit.js.erb view. in view have next code: $("<%= escape_javascript(render 'static/profile_form'%>").appendto("#ajax-profile"); everytime seek , create work, error this: started "/users/edit" 127.0.0.1 @ 2014-10-05 17:42:19 -0400 started "/users/edit" 127.0.0.1 @ 2014-10-05 17:42:19 -0400 processing userscontroller#edit js processing userscontroller#edit js user load (0.1ms) select "users".* "users" "users"."id" = ? limit 1 [["id", 2]] user load (0.1ms) select "users".* "users" "users"."id" = ? limit 1 [["id", 2]] rendered users/edit.js.erb (1.0ms) rendered use

Excel IF Statement Query -

Excel IF Statement Query - trying head around if statement (which speaking i'm normaly ok at!) the illustration sheet name 201401_abc123_xyz i bascically want if text after first _ reads abc123 homecoming value 123 else homecoming 456. any help appreciated thanks jim consider cell a1 has text i.e. "201401_abc123_xyz" =if(mid(a1,find("_",a1)+1,6)="abc123","123","456") here 6 length of string want search i.e. "abc123" "abc123" - string want search , 123 , 456 string want homecoming per question. hope help. excel if-statement

java - Is it possible to attach SSL certificate to this WebBrowser Component in Codename One? -

java - Is it possible to attach SSL certificate to this WebBrowser Component in Codename One? - i need open web page help of webbrowser component in codename 1 project. form form = new form(); form.setlayout(new borderlayout()); webbrowser browser = new webbrowser(); browser.seturl("{some url}"); form.addcomponent(borderlayout.center, browser); form.show(); i have sample works http. how possible attach ssl certificate, when not trusted? we don't back upwards attaching custom ssl certificate @ moment. can utilize https untrusted sites problematic on mobile device. java ssl ssl-certificate codenameone

ios - UIActionSheet throws ViewController actionSheet:clickedButtonAtIndex -

ios - UIActionSheet throws ViewController actionSheet:clickedButtonAtIndex - i using xcode 5.1.1 development purposes , using ios simulator test app. have action sheet has save, cancel , delete options. haven't yet coded action handling save , delete, tapping on cancel should go previous screen (i have used navigation controller move between screens). tapping on cancel, throws me "viewcontroller actionsheet:clickedbuttonatindex:]: message sent deallocated instance" error, not able solve. have hooked elements outlets/actions correctly. below code. please help. (i trying display action sheet when "return" button clicked. , in action sheet, when tap cancel, previous screen had displayed - guess can done dismissviewcontrolleranimated dismisses current controller , displays previous controller.) -(ibaction)returnmodalaction:(id)sender { [self dismissviewcontrolleranimated: yes completion: null]; uiactionsheet *actionsheet = [[uiactionsheet alloc]

ruby on rails - I18n.locale getting reset to :en in between controller and the view -

ruby on rails - I18n.locale getting reset to :en in between controller and the view - i'm trying internationalize rails/spree app using spree's own spree_i18n gem, can't work. i made minimal app recreates problem here. to cutting long story short, have next code in applicationcontroller: before_action :set_locale def set_locale i18n.locale = params[:locale] || i18n.default_locale puts i18n.locale end and code in view should translated ( <%= t("whatever") %> ). no matter do, text output in english. with additional code debugging, can see 1 time set_locale called while execution still within controller, locale right (e.g. if visit url /?locale=es , puts statement in above controller code outputs es ). but time execution has reached view, locale has somehow been reset en . (e.g. adding <% raise i18n.locale.to_s %> within view raises "en" error message.) i've opened issue on spree's github because far can

android - What is the reason of designing an onAnimationCancel() in Animator.AnimatorListener? -

android - What is the reason of designing an onAnimationCancel() in Animator.AnimatorListener? - android sdk animator shows: public void cancel () cancels animation. unlike end(), cancel() causes animation stop in tracks, sending onanimationcancel(animator) listeners, followed onanimationend(animator) message. to phone call method when animation not cancel. here sample aosp`s deskclock: rotateanimatory.addlistener(new animatorlisteneradapter() { private boolean miscanceled = false; @override public void onanimationcancel(animator animation) { miscanceled = true; } @override public void onanimationend(animator animation) { if (!miscanceled) { view.setrotation(0); } view.setlayertype(view.layer_type_none, null); } }); onanimationcancel() set miscanceled flag, work done in onanimationend(). combine end status , cancel status, there @ 3 type of work need done in cases: a), cancel

ruby on rails - javascript animate-ScrollTop works randomly -

ruby on rails - javascript animate-ScrollTop works randomly - i have list 10 elements after 5 seconds elements begin highlighted 1 after other , previous beingness unhighlighted. when highlighing reaches lastly element starts begining. highlighting beingness done adding selected id element. done until point. there 3 elements visible in list rest of them needs scrolled to. getting tricky. have used: scrolltoselected: => nav = $("#selected") if nav.length $(@el).animate scrolltop: nav.offset().top , 1000 this script doing scrolling not expected, scrolls randomly , downwards didn't knew tops of items. can problem be? i have tried outputting .offset().top values in console result this: 171 -627 731 -19 1131 -891 419 -299 1011 101 -891 419 -299 1011 101 -891 419 -299 1011 101 -891 419 -299 1011 101 -891 419 -299 1011 101 -891 419 -299 196.5 248.5 492.5 512.5 612.5 -414.5 any thougths? edit: after changing offset position these values

java - How to automatically trigger reindexing between SVN & Opengrok -

java - How to automatically trigger reindexing between SVN & Opengrok - we planning utilize opengrok in our project. help of below url: http://algopadawan.blogspot.com/2012/07/installing-opengrok-on-windows.html i did little poc in local desktop , able opengrok application up. part of poc did manual indexing mentioned in above url. in our project utilize svn version command , commit made in svn indexed automatically in opengrok instead of manual indexing. can allow me know how can accomplish ? many thanks, sachin you have couple of options: modify post-commit hook of svn repository fire off reindexing of repository, utilize shell script accomplish this. create cron job fire off indexing @ time interval, using similar shell script or script of choice. java svn tortoisesvn opengrok

php - MYSQL Query with String Refer to Value in Database -

php - MYSQL Query with String Refer to Value in Database - i have mysql query below: $sourcedata = mysql_fetch_array( mysql_query("select whereclause generaltable id = '1'" ) ); $whereclause = $sourcedata['whereclause']; in "whereclause" field "generaltable" in database, consist of below text: where username = '$_session[username]' then have other query: $data = mysql_fetch_array( mysql_query("select * usertable $whereclause" ) ); when echo $data['username'], not showing anything. if re-create value database replace $whereclause working fine, if replace '$_session[username]' 'admin' example, working fine.

mysql - How to store HTML text in sql database using Java -

mysql - How to store HTML text in sql database using Java - i trying store text generated java fx html editor sql database. recieving sql error. i tried utilize varchar(1000), varchar(max) , text data types. error: java fx html editor text generated editor <html><head></head><body contenteditable="true"><p style="text-align: left;"><font face="'segoe ui'">line 1</font></p><p style="text-align: left;"><font face="'segoe ui'">line 2</font></p></body></html> code: public string insertdept(department dept){ string query = "insert " + table_name + "values(" +"'"+dept.getname()+"'," + "'"+dept.getemail()+"'" + ")"; homecoming query; } i dont't know much mysq

javascript - Angular JS access $http data from factory in controller -

javascript - Angular JS access $http data from factory in controller - this question has reply here: how homecoming response asynchronous call? 11 answers i starting out angular js , have created mill pupil data. pupil info looks below. { "male": [ ["john", "smith", "2000-10-10"], ["james", "smith", "2000-10-10"] ] } i have mill , controller setup shown below .factory('students', ['$http', function($http) { var info = {}; homecoming { getstudents: function () { $http.get('api/students.json'). success(function(data, status, headers, config) { console.log(data.male); //returns array of males data.studentlist = data.male; data.propert

azure - LinqPad Displays Invalid object name 'dbo.sysforeignkeys' -

azure - LinqPad Displays Invalid object name 'dbo.sysforeignkeys' - using linqpad connect azure sql database. t-sql query ( select * dimgrade ) returns 20 records, c# look ( from g in dimgrade select g or dimgrade.take(20) ) throws error invalid object name 'dbo.sysforeignkeys' how configure linq sql azure sql database? linqpad 4.51.03 i had same problem. i've realized, didn't create connection properly. instead of "sql azure" left sql server. linqpad connect, mentioned error popout. azure linqpad

regex - Using sed to add character -

regex - Using sed to add character - this question has reply here: how add together text @ end of each line in unix 3 answers i working on adding character @ end of line big file. each line has 3 octets of ip network, ending in period , line feed (\n). working in cygwin. i.e. 10.23.34. 23.34.45. i attempting utilize sed work me; i've tried next 2 commands no success: sed 's/\n/1\n/' <filename> sed 's/\n/1\n/g' <filename> sed 's/(.*)/${1}1/' <filename> i have gotten work in perl perl -pe 's/(.*\.)/${1}1/' <filename> what doing wrong please? thank you add foo @ end of every line: sed 's/$/foo/' filename > new_filename replace in place: sed -i 's/$/foo/' filename regex perl sed cygwin

profiling - JAVA method for Class/Object creation destruction -

profiling - JAVA method for Class/Object creation destruction - i want create btrace script profile object creation , destruction. need know java methods called when creating or deleting object or class? thanks in advance. for object construction utilize constructor methods @onmethod(clazz="class.name", method="<init>") ... tracing destruction more hard - can't hook finalize method because not mandatory object provide one. right need run btrace in unsafe mode , provide own logic using eg. phantomreference notification when instance have been garbage collected ('destructed'). java profiling btrace

activerecord - Rails: Belongs_to Polymorphic Association + conditions -

activerecord - Rails: Belongs_to Polymorphic Association + conditions - so have model: class model < activerecord::base attr_accessible :to_id, :to_type belongs_to :to, polymorphic: true end i wondering if add together relationship when belongs_to on specific type: class model < activerecord::base attr_accessible :to_id, :to_type belongs_to :to, polymorphic: true belongs_to :to_user, :foreign_key => :to_id, :conditions => ['to_type = ?', 'user'] # doesn't work # or maybe belongs_to :to_user, :foreign_key => :to_id, :foreign_class => 'user' # doesn't check on model's to_type... end so my_model.to_user homecoming user if exists, , nil if unset or of different class. using rails 3.2 thanks! you can utilize status within belongs_to :to_user,-> {where(:to_type=> 'user')}, :foreign_key => :to_id form more have on association callbacks ruby-on-rails-3 activ

angularjs - Unable to inject $http into a factory -

angularjs - Unable to inject $http into a factory - i'm trying inject $http factory i'm getting error: error: unknown provider: $httpprovider <- $http <- utilservice here factory code: var util = angular.module('util', []) .factory('utilservice', ['$http', function($http) { homecoming { translate: function(objects, prop) { var keys = objects.map(function(o) {return o[prop];}); $http({method: 'post', url: 'http://localhost:8080/rest/messages', data: keys}). success(function(data, status, headers, config) { homecoming objects.map(function(o, rank) {return {'value': data[rank], 'object': o}}); }); } }; }]); the code of controller utilize service: var app = angular.module('recordcontroller', ['ui.bootstrap','dialogs', 'util']); function records($scope, $http,

c# - Speech in using System.Speech.Synthesis is not recognized. -

c# - Speech in using System.Speech.Synthesis is not recognized. - i'm trying utilize speech synthesis function universal app. looked @ microsoft documentation , says name space system.speech.synthesis. however, when type system.speech.synthesis . says speech not recognized. doing wrong? here working example: using system.speech.synthesis; static void main(string[] args) { ... // speech helper speechsynthesizer reader = new speechsynthesizer(); const string msg = "hello"; console.writeline(msg); reader.speakasync(msg); } also, create sure referencing 'system.speech': c# win-universal-app speech-synthesis

arrays - How to use chomp -

arrays - How to use chomp - below have list of info trying manipulate. want split columns , rejoin them in different arrangement. i switch lastly element of array 3rd 1 i'm running problem. since lastly element of array contains line character @ end, when switch thrid, kicks line down. code while (<>) { @flds = split /,/; stuff here; etc; print bring together ",", @flds[ 0, 1, 3, 2 ]; # switches 3rd element lastly } sample data 1,josh,hello,company_name 1,josh,hello,company_name 1,josh,hello,company_name 1,josh,hello,company_name 1,josh,hello,company_name 1,josh,hello,company_name my results - kicked downwards line. 1,josh,company_name ,hello1,josh,company_name ,hello1,josh,company_name ,hello1,josh,company_name ,hello1,josh,company_name ,hello1,josh,company_name,hello *desired results** 1,josh,company_name,hello 1,josh,company_name,hello 1,josh,company_name,hello 1,josh,company_name,hello 1,josh,company_

how to read this xml in sql server -

how to read this xml in sql server - i having xml result webservice api . need parse result , update database table. xml below . response text. <?xml version="1.0" encoding="utf-8"?> <double>1</double> sqlserver 2008 code : declare @xml xml, @rate decimal(10,4) set @xml=replace(@responsetext ,'encoding="utf-8"','') select @rate= @xml.value('(/double)[1]','decimal') i want value of double homecoming null . please help me out . hi , have done changes per suggestion still no getting. declare @xml xml declare @responsetext varchar(900) declare @rate decimal(10,4) set @responsetext = '<?xml version="1.0" encoding="utf-8"?> <double xmlns="http://www.webservicex.net/">1</double>' set @xml=replace(@responsetext ,'encoding="utf-8"','') select @rate= @xml.value('(/double)[1]','decim

pattern matching - SQL Server Query to find records with exact numbers in string -

pattern matching - SQL Server Query to find records with exact numbers in string - i querying against column has info follows winners - 1,2,3,4,5,6,21,24 / 2,8,11,21,22,24 / 12,13,15,16 / 12,13,15,21,24 winners - 2,5 / 2,5 / 1,6,11,12,22,24 / 1,11,12,22,24 winners - 1,3,5 / 1,3,5 / 4,8,11 / 2,12,14,16,21 how find ones 2 or 6 in of 4 blocks have? have query follows select * scores results 'winners - %[2,6]%/%[2,6]%/%[2,6]%/%[2,6]%' but returns ones match 21, 12, 26, 16 , on. want match 2 or 6. i sure there improve way don't know here 2 solutions select * scores ((replace(replace(result,'winners - ', ','), ' / ', ',') + ',') '%,2,%' or (replace(replace(result,'winners - ', ','), ' / ', ',') + ',') '%,6,%') , result 'winners - %' select * scores (result '% 2%' or result '% 6%' or result '%,2 %' or result &#

r - Define (not use default) for shapes in ggplot -

r - Define (not use default) for shapes in ggplot - i trying create scatterplot 3 shapes (small circle, big circle, , cross). i able point have want, except can't figure out how specify shapes: adata=as.data.frame(cbind(x=rnorm(5, 10, 1),y=rnorm(5,10,1))) adata["type"] = rep(1,dim(adata)[1]) bdata=as.data.frame(cbind(x=rnorm(5, 20, 1),y=rnorm(5,20,1))) bdata["type"] = rep(2,dim(bdata)[1]) cdata=as.data.frame(t(c(0,0,3))) colnames(adata) = c("ankle.dif", "knee.dif", "type") colnames(bdata) = c("ankle.dif", "knee.dif", "type") colnames(cdata) = c("ankle.dif", "knee.dif", "type") dataframeplot = rbind(adata, bdata, cdata) ggplot(dataframeplot, aes(x=ankle.dif, y=knee.dif)) + geom_point(aes(shape = factor(type))) i circle, triangle, , square here, prefer specify little circle, big circle, , crossbar 3 types. ideas? thanks! here 1 way using scale_shape_ma

Drupal : how to add a JavaScript file in Ctools modal popup -

Drupal : how to add a JavaScript file in Ctools modal popup - how add together javascript file in ctools modal popup ? i added js file (datatables.js) in .tpl.php file not work? the popup not observe file? drupal_add_js(drupal_get_path('module', 'my_module') . '/jquery.datatables.min.js'); we're using document.ready , ajaxcomplete: $(document).ready(function () { drupal.behaviors.namespace.functionname(); }); and $(document).ajaxcomplete(function () { drupal.behaviors.namespace.functionname(); }); clearly not dry solution, solves problem now. javascript drupal-7 datatables drupal-ctools

How to set UI Elements Enabled to true in Applescript? -

How to set UI Elements Enabled to true in Applescript? - tell application "system events" if ui elements enabled true tell application "system preferences" activate set current pane pane id "com.apple.preference.universalaccess" display dialog "this script requires access assistive evices enabled." & homecoming & homecoming & "to continue, click ok button , come in administrative password in forthcoming security dialog." icon 1 end tell set ui elements enabled true if ui elements enabled false homecoming "user cancelled" delay 1 end if end tell when run this, error. "can’t set ui elements enabled of application true" any ideas why may happening? extra info: os x yosemite i answered basic question recently. see reply here. applescript

php - Symfony2 ajax form validation render errors in twig -

php - Symfony2 ajax form validation render errors in twig - i have form in symfony2 validate ajax. working, , json "global" (for global errors) , "fields" (errors each field in here) in success statement of ajax call: {"global":[],"fields":{"fos_user_registration_form_username":"please come in username","fos_user_registration_form_email":"please come in email","fos_user_registration_form_plainpassword_first":"please come in password"}} my question is: best way nowadays these errors "fields" in view each field? rendered view elements next when validated form without ajax: <div class="form-group"> {{ form_label(form.xyz) }} {{ form_widget(form.xyz) }} {{ form_errors(form.xyz) }} </div> how can inject errors "field" list of json object appropriate {{ form_errors(form.xyz) }} ? i love hear ideas , best prac

javascript - Docker container nodejs connection to external mysql fail -

javascript - Docker container nodejs connection to external mysql fail - my nodejs application connecting mysql externally, if start interactively docker run -p 49160:8080 -t -i <image> , , run nodejs /src/server.js manually. however, when start daemon docker run -p 49160:8080 -d <image> , fail connect external mysql. tried docker start <container> , docker exec <container> nodejs /src/server.js , same error. tried docker start <container> , docker attach <container> ,run nodejs /src/server.js , works. dockerfile: from ubuntu re-create . /src run apt-get install nodejs run apt-get install npm run cd /src; npm install expose 8080 cmd ["nodejs","/src/server.js"] /src/server.js: var express = require('express'); var mysql = require('mysql'), myconnection = require('express-myconnection'); ... app.use(myconnection(mysql, { ... },'request')); ... app.get('/',functi

sql server - Trouble using the Insert Into Syntax in SQL -

sql server - Trouble using the Insert Into Syntax in SQL - on site (http://www.w3schools.com/sql/sql_insert.asp) says can utilize sql insert statement using syntax: insert table_name values (value1,value2,value3,...); i tried doing follows: create table trade ( tradeid int primary key, -- define coolumn of type int, primary key can't null symbol varchar(20) not null, --define column of type varchar. not null indicates column must have value tradeamount decimal(15, 3), -- total digits 15, 3 or decimal points filled bit not null default(0), -- specify default of 0 on column ) go insert trade values('goog',10.235785,1) however, error "column name or number of supplied values not match table definition" , unsure why case. thanks you didn't define first field autoincremental, if don't send it, table expecting 4 fields , sending 3. this should work: insert trade values(1,'goog',10.235785,1) or can create table in

java - Connect 4 using the board -

java - Connect 4 using the board - we're programming little connect 4 game without gui. have problems using board fill in chips ('x's or 'o's). made char array draw board told in instructions , clueless how fill board chips. here's code: char player = 'x'; char[][] board = new char[7][8]; public void sboard() { char[][] board = new char[7][8]; (int i=0;i<board.length-1;i++) { system.out.print("|"); (int j=0;j<board[i].length-1;j++) { board[i][j]='.'; system.out.print(board[i][j]+"|"); } system.out.println(); } } this creates board , dots on it, player 1 , 2 fill either x or o. public void userinput() { system.out.print("which coloumn? (1-7): "); scanner in = new scanner(system.in); int input = in.nextint(); in.close();

Where in the world are these fonts being loaded on my wordpress site -

Where in the world are these fonts being loaded on my wordpress site - i attempting transfer domain http https. have installed wordpress theme, modified slightly. now, can't figure out font.google.com beingness loaded from. have searched literally hours. nil found in functions.php , other similar files. i remember vaguely there lots of files called, decided add together list. don't know might alter https. thought scripts located break https in wordpress install? the domain floridamaids.com help deciphering riddle. they loaded shortcodes.css wordpress

java - Editing the table that stores sms on android -

java - Editing the table that stores sms on android - i reading sms in android device using java cursor cursor = getcontentresolver().query(uri.parse("content://sms/inbox"), null, null, null, null); cursor.movetofirst(); but need mark sms processed background service or not.will there danger in editing sqlite database table stores sms. i add together column indicate has been processed or has not. you can't modify info sms content provider since kitkat, see: http://developer.android.com/about/versions/kitkat.html#44-sms-provider so not recommended want. java android

PERL Regex to find specific string NOT ending with a period -

PERL Regex to find specific string NOT ending with a period - for reason, having brain block. cannot figure out how match specific strings not end in period. take next text: this has br string , br br has period: br. i want match br strings not br strings end in period ( br. ) please help. know easy - maybe different in perl regex not familiar enough. you can utilize regex: \bbr(?!\.) (?!\.) negative lookahead create sure br not followed dot. regex demo regex perl

uiwebview - iOS8 Simulator user agent -

uiwebview - iOS8 Simulator user agent - while investigating why have bug on ios8 webview discovered webview's user-agent is: mozilla/5.0 (iphone; cpu iphone os 10_9_5 mac os x) applewebkit/600.1.4 (khtml, gecko) mobile/12a365 (2072607680) whereas since i'm running ios8, rather should be: mozilla/5.0 (iphone; cpu iphone os 8_0_2 mac os x) applewebkit/600.1.4 (khtml, gecko) mobile/12a405kalturanativecordovaplayer (350612576) of course of study there's no iphone running version 10.10 yet, xcode6 somehow picking version mac os x. ios < ios8 simulators, works fine. so have solution me how find if it's ios8 simulator or not for javascript method: isios8 = function(){ homecoming ( /os 8_/.test( useragent ) || /version\/8/.test( useragent ) ) && isios(); }; this issue fixed in ios 8.3 simulator runtime. version , newer versions not suffer issue more. i suggest "iphone os" , "applewebkit/600.1.4" substrings if

r - Using symbols to draw lines rather than line type -

r - Using symbols to draw lines rather than line type - i have diet info of 7 monkeys details proportion of each diet item in each monkeys diet se. info included here. data <- structure(list(monkeyid = structure(c(1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 2l, 2l, 2l, 2l, 2l, 2l, 2l, 2l, 2l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 4l, 4l, 4l, 4l, 4l, 4l, 4l, 4l, 4l, 5l, 5l, 5l, 5l, 5l, 5l, 5l, 5l, 5l, 6l, 6l, 6l, 6l, 6l, 6l, 6l, 6l, 6l, 7l, 7l, 7l, 7l, 7l, 7l, 7l, 7l, 7l), .label = c("p06", "p07", "p08", "p09", "p10", "p12", "p13"), class = "factor"), diet = structure(c(3l, 2l, 8l, 1l, 5l, 4l, 6l, 7l, 9l, 3l, 2l, 8l, 1l, 5l, 4l, 6l, 7l, 9l, 3l, 2l, 8l, 1l, 5l, 4l, 6l, 7l, 9l, 3l, 2l, 8l, 1l, 5l, 4l, 6l, 7l, 9l, 3l, 2l, 8l, 1l, 5l, 4l, 6l, 7l, 9l, 3l, 2l, 8l, 1l, 5l, 4l, 6l, 7l, 9l, 3l, 2l, 8l, 1l, 5l, 4l, 6l, 7l, 9l), .label = c("apple", "bird", "cherry", "go

Powershell New-ADUser error handling password complexity (ActiveDirectory module) -

Powershell New-ADUser error handling password complexity (ActiveDirectory module) - i'm trying create project that's creating users in active directory using powershell. though, problem let's run this: new-aduser test1 -givenname test -surname test -accountpassword (convertto-securestring "abc" -asplaintext -force) as know "abc" not meet password requirement, though adds user anyways without password in project not acceptable, wan't if fails in parameter should output error without running other parameters @ all! i'd preferably in 1 line don't have create scripts it, phone call in application. tried multiple parameters such -whatif , try, catch! kind of sources/answers highly appreciated! to clarify on original post, homecoming error: "new-aduser : password not meet length, complexity, or history requirement of domain.". the user business relationship created, disabled. specifying -erroraction stop on ne

export HTML-table to excel/csv using javascript in IE (And all other browsers) -

export HTML-table to excel/csv using javascript in IE (And all other browsers) - so have been trying export html-tables excel using javascript in ie. looks newer ie-browsers won't allow (version 11). different feedback ie is: 1. webpage cannot displayed cause: •some content or files on webpage require programme don't have installed. nothing happens... when using activex, tells me not have supporting app this, , suggest me finding in app-store... here of examples have tried: var tabletoexcel = (function () { var uri = 'data:application/vnd.ms-excel;base64,' , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/tr/rec-html40"><head><!--[if gte mso 9]><xml><x:excelworkbook><x:excelworksheets><x:excelworksheet><x:name>{worksheet}</x:name><x:worksheetoptions&

facebook - Like Box Displays Empty iframe for Some Pages, But Not Others -

facebook - Like Box Displays Empty iframe for Some Pages, But Not Others - so company work has site has pages partners, , on pages, we're displaying box partner's facebook page. we're using iframe method of embedding box, same results when using html5 method. some of boxes display iframe, width , height of frame take space on page, no content. within empty frame, html tag looks this: <html class="no_js" id="facebook" lang="en"> in ones display facebook content, looks this: <html lang="en" class="" id="facebook"> it appears not display content in versions of ie , chrome, display me in firefox. others reporting doesn't display facebook content in browser. i'm @ loss figure out why happening. help appreciated. facebook iframe like box

php - xdebug instantly timeouts, though host IDE is listening -

php - xdebug instantly timeouts, though host IDE is listening - trying debug remotely on openvpn, php 5.3.3, selinux disabled, local win firewall disabled. here snippet xdebug debugging log: log opened @ 2014-10-14 20:35:03 i: checking remote connect address. i: remote address found, connecting 10.113.255.38:9000. e: time-out connecting client. :-( log closed @ 2014-10-14 20:35:04 ^c and right after this: [root@mn httpd]# telnet 10.113.255.38 9000 trying 10.113.255.38... connected 10.113.255.38. escape character '^]'. so ide(phpcharm) listening external connections. here xdebug.ini: class="lang-html prettyprint-override"> zend_extension='/usr/lib64/php/modules/xdebug.so' ;xdebug.remote_host=10.113.255.38 xdebug.remote_connect_back=1 xdebug.remote_log=/tmp/xdebug-debug.log xdebug.remote_port=9000 xdebug.max_nesting_level=200 xdebug.remote_enable=1 xdebug.idekey='pp' xdebug.remote_autostart=1 what might problem

How to find and replace , same but different words in notepad++ -

How to find and replace , same but different words in notepad++ - so have 2 big list of md5 text file 1 of them in encrypted format , 1 more decrypted format missing format (example) 1st file: md5 = ea32sd 23fr24r dada45r 2st file: md5:meanings = 23fr24r:yo (missing) dada45r:hey so wanna , find same md5 , replace meaning 1 left its 23fr24r = 23fr24r:yoo dada45r = dada45r:hey becomes yoo hey im sorry if dont points cause english language not first language script solve problem quite easily. however, can in notepad++ using powerful replacement function on sec file. replacement 1 (regular expression): ^(?!md5)(\w+): => \1 = \1: replacement 2 (regular expression): ^(?!(?!md5).*=).*$ => (empty) replacement 3 (extend) : \n\r => (empty) that trick. notepad++

Ruby Sequel model to have validation for create and not update -

Ruby Sequel model to have validation for create and not update - how can avoid having validation update while having create ? instance: i wish have image field have presence validation on create . want avoid in edit , assume previous value in case of no change. note: using padrino. in sequel, validations done @ instance level using validation_helpers plugin. utilize standard ruby conditional if want validate new objects , not existing ones: plugin :validation_helpers def validate super validates_presence :image if new? end ruby sequel

c# - Session doesn't get decimal numbers -

c# - Session doesn't get decimal numbers - i made progress bar survey ran problem it. each question person answers, progress bar should move/ fill x amount based on these calculations: progresspercent = 100 / number of questions. it works if there no decimal numbers 100 / 50 = 2. if number of questions equal 60, math 100 / 60 = 1.6666 when pass number session keeps 1 , forgets 6666 here number of questions: cnt = ds.tables[0].rows.count; then calculate progresspercent shall ryze with: session["progresspercent"] = 100 / cnt; then update progress bar setting width: int progress = convert.toint32(session["progress"].tostring()); int progressprocent = convert.toint32(session["progressprocent"].tostring()); progress += progressprocent; session["progress"] = progress; statusmeter.style.add("width", session["progress"].tostring() + "%"); this tried: int total = 100; int

Google directory api always returns 403 -

Google directory api always returns 403 - i trying utilize admin sdk directory api user profiles. able day (with in quota) 99% of time. though there times fails no matter what. yes have set service business relationship user, have proper scopes, have admin api turned on. it fails in google api explorer. see screen shots the call: https://www.dropbox.com/s/9v9m6s5zf76oix7/call.png?dl=0 the response: https://www.dropbox.com/s/te6k3x5xjkr467j/response.png?dl=0 sorry links, images maintain showing broken after contacting google supplied answer. there setting contacts app enables , disables this. admin console >> google apps >> settings contacts >> advanced settings contact sharing: enable contact sharing make sure enabled , works. here screen shot: https://www.dropbox.com/s/8jmzz7zw0xq4ux4/answer.png?dl=0 google-api google-apps google-apps-marketplace google-admin-sdk google-directory-api

Problems w/ Structures 'C' -

Problems w/ Structures 'C' - i need write programme following..i have tried not know going wrong.. define construction dollarsquartersdimes 3 simple variables int dollars, int quarters , int dimes declare monies in dollars, quarters , dimes. add 2 dollarsquartersdimes monies , store result in 3rd dollarsquartersdimes monies. remember create necessary conversions dimes , quarters dollar. note: 10 dimes = 1 dollar , 4 quarters = 1 dollar. #include <stdio.h> #include <stdlib.h> typedef struct{ int dollars; int quarters; int dimes; }dollarsquartersdimes; void main(){ dollarsquartersdimes input1 , input2 , total; printf ("please come in money in order dollars : quarters : dimes ! "); scanf ("%d%d%d" , &input1.dollars, &input1.quarters, &input1.dimes); printf ("please come in 1 time again money in order dollars : quarters : dimes ! "); scanf ("%d%d%d" , &input2.doll

Debugging QT app in WinDbg -

Debugging QT app in WinDbg - i developed qt application using qt creator. programme crashes on windows 7 , xp. lastly time happened, used task manager create dump file. tried using windbg got loads of errors not beingness able find 'symbol' files qt: *** error: symbol file not found. defaulted export symbols qtwebkit4.dll - *** error: symbol file not found. defaulted export symbols qtcore4.dll - *** error: symbol file not found. defaulted export symbols qtgui4.dll - *** error: module load completed symbols not loaded myapp1.1b.exe *** warning: symbols timestamp wrong 0x522be0b3 0x522bdb3e mswsock.dll *** warning: symbols timestamp wrong 0x4a5be0b0 0x4ce7ba42 winmm.dll *** warning: symbols timestamp wrong 0x4a5be093 0x4a5bdb3c uxtheme.dll *** warning: symbols timestamp wrong 0x53b9ff75 0x53b9f968 audioses.dll does know how debug app crash in qt app using windbg or similar tool? you need have debug symbols (.pdb files) qt in order debug crash dump. no r

scope - Variable Scoping Issue in perl -

scope - Variable Scoping Issue in perl - i not sure going on code, believe has how variables scoped, changing them "my" "our" doesn't anything. error comes in sec if block seek print $question1, perl says "$question1 requires specific bundle name". code there test need later in program. need $question variables able used throughout program. foreach $line ( split /:/, $test ) { $match1 = "1"; $match2 = "2"; if ( $line =~ /$match1/ ) { $question1 = $line; print "$question1\n"; } if ( $line =~ /$match2/ ) { $question2 = $line; print "$question2\n"; print "$question1\n"; } } to increment scope of variable beyond block, need move declaration outside of block, so: my ($question1, $question2); # both initialized undef foreach $line (split /:/, $test) { $match1 = "1"; $match2 = "2"; if

c++ - Checking files size from current directory -

c++ - Checking files size from current directory - below function read directory , insert files name (by push_back()) vector #include <dirent.h> void open(string path){ dir* dir; dirent *pdir; dir = opendir(path.c_str()); while (pdir = readdir(dir)){ vectorforresults.push_back(pdir->d_name); } } question: how can check size of each file (from current directiory) using boots library? i found method described on http://en.highscore.de/cpp/boost/filesystem.html it's e.g.: boost::filesystem::path p("c:\\windows\\win.ini"); std::cout << boost::filesystem::file_size(p) << std::endl; could please help how implement boost in open() function? how assign current directory path name variable p , iterate through files names. does help? live on coliru #include <boost/filesystem.hpp> #include <boost/range/iterator_range.hpp> #include <iostream> namespace fs = boost::filesystem; in

android - What is LinearLayoutCompat in appCompat v7? -

android - What is LinearLayoutCompat in appCompat v7? - in back upwards library appcompat v7 of android platform, there android.support.v7.widget.linearlayoutcompat class. does know why class exist? original linearlayout class exist since api level 1 don't understand why there compat version. the class linearlayout exists since api level 1, apis added after that, example, setshowdividers introduced on api level 11. so in case setshowdividers (and it's parameters) should invoked using linearlayoutcompat instead linearlayout if targeting platform api level below 11. android android-compatibility

Django migration fails for ForeignKey to custom user model -

Django migration fails for ForeignKey to custom user model - when run migration new model has foreignkey custom user model, error: valueerror: lookup failed model referenced field test.testmodel.user: account.emailuser it's in django 1.7. my custom user apps.models.emailuser . here's relevant code: # apps.test/models.py django.db import models django.conf import settings class testmodel(models.model): user = models.foreignkey(settings.auth_user_model) # settings.py auth_user_model = 'account.emailuser' installed_apps = ( ... 'apps.account', 'apps.test', ) finally, here's migration file: # -*- coding: utf-8 -*- __future__ import unicode_literals django.db import models, migrations django.conf import settings class migration(migrations.migration): dependencies = [ migrations.swappable_dependency(settings.auth_user_model), ] operations = [ migrations.createmodel( na

java - I am trying to check and see if some files exist. Why won't my program let the user enter a file? -

java - I am trying to check and see if some files exist. Why won't my program let the user enter a file? - the code compiles, after prompting user file name says invalid input (which should if file name doesn't exist). did close file early? can explain went wrong? in advance help. import java.util.scanner; import java.io.*; public class file { public static void main(string[] args) throws ioexception { system.out.println ("welcome weekly sales goal program!"); scanner keyboard = new scanner (system.in); int sales_goal; system.out.print ("\nplease come in sales goal (in dollars): "); sales_goal = keyboard.nextint(); system.out.println ("\nplease come in input file name: "); string filename = keyboard.nextline(); file file = new file(filename); scanner in = new scanner(filename); double sum = 0.0; if (file.exists()) { s

ios - Using External Users in iTunes Connect -

ios - Using External Users in iTunes Connect - i received message apple indicating external testers feature available in itunes connect. followed next steps: added new external tester. i switched on beta testing option, , sent beta app review. filled form , sent. when open testflight app there no builds testing , person added external tester didn't receive e-mail. did forget step? doing wrong? for external beta testing, need pass beta app review. app available testflight , external testers mails after app approved beta testing. apps made available external testers require beta app review , must comply total app store review guidelines before testing can begin. review required new versions of app contain important changes. 10 apps can tested @ time, internally or externally. reference : beta testing image itunes connect, when create beta testing. ios iphone itunesconnect

Displaying civicrm contact's fields in drupal 7 registration and profile edit -

Displaying civicrm contact's fields in drupal 7 registration and profile edit - i using drupal 7 civicrm 4.5. want display civi contact fields in drupal registration , profile forms. used civicrm profile display first name , lastly name fields. don't know how integrate address, phone , email fields same civi in drupal(for ex address [b]another address[/b] , [b]location type[/b] selection boxes street address,add link,delete etc). using civicrm profile able configure home street address etc individual ones. want grouped 1 how civi displaying. there module available this? help highly appreciated. in advance for improve or worse, civicrm profiles don't have features picking location type or adding indefinite numbers of addresses, etc. respect location type, have home street address, city, state, zip, etc. fields , work street address, city, state, zip, etc., , hang 2 addresses. in front-facing forms, there way using webform civicrm integration module. can se

java - JavaFx 8 - A class that has a border than you're able to color and able to have text in the middle of it -

java - JavaFx 8 - A class that has a border than you're able to color and able to have text in the middle of it - does know of class can utilize essential rectangle, has text in middle of rectangle , rectangle has fill color along border color(the border can changed reddish or along lines) essentially right have pane, , want create 2d grid(10x10), each individual object in grid rectangle-typed object has number text center justified, fill color, , border color. note: i've tried utilize gridpane, lack of documentation i've found has led me believe can set fill color, , each cell in grid pane not separate object want to. i've tried implement rectangle rectangle doesn't have text or border can manipulate. thank help. just utilize label . here's proof of concept: import javafx.application.application; import javafx.scene.scene; import javafx.scene.control.label; import javafx.scene.layout.stackpane; import javafx.stage.stage; public class

sql server ce - SQL Compact Edition Batch Update -

sql server ce - SQL Compact Edition Batch Update - i using entity framework , need update multitude of entities on regular basis. what need add together journaling number, based on several different tables. using sql server, can utilize stored procedure, inner , outer joins, grouping , row_number, heavy lifting me , efficient. see procedure code follows: create procedure [dbo].[sp_updatenumber] @refid int begin update tablewithnumber set nmr = other.nmr ( select min(c.nmr) nmr, z_id ( select row_number() on (order d.tickscreatedon, d.z_id, d.b_id) nmr, d.* ( select s.id s_id, z.id z_id, b.id b_id, s.tickscreatedon childtable b inner bring together tablewithnumber z on z.childtabl

javascript - Why error occured when remove some lines of code? -

javascript - Why error occured when remove some lines of code? - the next code working expected class="snippet-code-js lang-js prettyprint-override"> obj = { go: function() { alert(this) } } obj.go(); // object (obj.go)(); // object (a = obj.go)(); // window (0 || obj.go)(); // window but why error occurred when comment origin 2 lines? class="snippet-code-js lang-js prettyprint-override"> obj = { go: function() { alert(this) } } //obj.go(); // commented line //(obj.go)(); // commented line (a = obj.go)(); // window (0 || obj.go)(); // window i didn't alter of code above, comment 2 lines separate others, browser gives me error information? please clarify me? many thanks. you have ( after } trying phone call result of evaluating block if function. before that, however, trying evaluate a = obj.go can passed argument. since obj hasn't been defined yet (because result of callin

java - Why is my getString() method always returning null? -

java - Why is my getString() method always returning null? - i have problem file lookup function made yesterday, method used homecoming file, returning null changed homecoming file path, still returning null when it's not, here's code , output: public static string lookupfile(file file, string name) { file[] list = file.listfiles(); if(list != null) { (file fil : list) { string n = fil.getname().replace(name, ""); if (n.length() != 0) { if(fil.isdirectory()) lookupfile(fil , name); } else if (n.length() == 0) { string g = fil.topath().tostring(); system.out.println(fil.getname()); system.out.println(g); homecoming g; } } } homecoming null; } the way i'm using so: string n = sys.lookupfile(new file(sys.getappdata() + "g/"), "ggf.rtf"); system.

python - Flask / Jinja2 - best pratice of HTML escaping -

python - Flask / Jinja2 - best pratice of HTML escaping - i'm using flask build webapplication database in backend. info need escape ensure no sitemanipulations xss? the jinja2 template engine provides '|safe' filter ensure such escaping. comments , other stuff, user can edit (and perchance manipulate), seeems logically escape, other content vulnerable too? filters, extenions or tricks should used in context of flask , jinja2? you want enable automatic filtering using autoescape extension. the docs: env = environment(autoescape=guess_autoescape, loader=packageloader('mypackage'), extensions=['jinja2.ext.autoescape']) this has some performance overhead, experience shows very easy forget escape 1 variable, gives xss (even big sites, ebay, have fallen victim this). this answers question, 'what should escaped?'. in larger applications, it's not easy determine variables can straight (or i

java - return a syncrhonized value from a syncrhonized block -

java - return a syncrhonized value from a syncrhonized block - if have map of objects , each threads can go within each buckets concurrently,resulting block like syncrhonized(values.get(objecttolock)){ int sum = 0; for(int = 0; i< new random().nextint(1000)+2; i++) sum+=i; homecoming sum; } update syncrhonized(values.get(objecttolock)){ int sum = 0; for(int = 0; i< new random().nextint(1000)+2; i++) sum+=i; for(int = 0; < 10; i++) for( int j = 0; j < 10 ; j++) system.out.println(*); homecoming sum; } in piece of code, each thread can interfere between them resulting in sum distorted? no, sum local variable. each thread have own copy. declaring outside of synchronized block doesn't create less of local variable, makes scope larger. java multithreading

python - Installing and Using PIL 1.1.7 on OS 10.9.5 Marvericks -

python - Installing and Using PIL 1.1.7 on OS 10.9.5 Marvericks - i have started learning python programing , tried install pil on macos 10.9.5 marvericks using pip(1.5.6). of course of study referred other same question installing pil, cannot figure out problem. _imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found **#include freetype/fterrors.h ^ 1 error generated. error: command 'clang' failed exit status 1 the error occurred above. i add together ln -s /usr/local/include/freetype2 /usr/local/include/freetype and terminal shows ln: /usr/local/include/freetype: file exists and next add pip install pil --allow-external pil --allow-unverified pil but same error remains. i installed xcode(6.1), x11(2.7.7). freetype ver. 2.5.3_1. python ver. 2.7.6. i appreciate if teach should do. python osx python-2.7 pip python-imaging-library

jquery - Overriding keypress event during autocomplete select event -

jquery - Overriding keypress event during autocomplete select event - $('#myfield').autocomplete({ select: function(event, ui) { var selectedobj = ui.item; $('#fieldtoset').val(ui.item.id); $('#fieldfornextfocus').focus(); } i using autocomplete, , wanted jump field after finish event. set focus(). but, set focus fires first, , keypress event triggered autocomplete fires. if user autocompleted come in key or mouse click, fine, if used tab select item, set focus new field , tab execute, taking them 1 field far.. i tried inserting: event.preventdefault(); after set focus() stops field populating on click event reason. so, think need phone call event.preventdefault() if 'tab' key pressed autocomplete select method fire. can't figure out how find out pressed within of select. jquery autocomplete tabs keydown preventdefault