Posts

Showing posts from February, 2010

javascript - IE onpropertychange event doesn't fire -

<a href="javascript:void(0)" id="select-handler">select</a> <input type="file" id="real-file-input" style="display:none" /> $('#select-handler').click(function(){ $('#real-file-input').click(); }); $('#real-file-input').bind('propertychange', function(){ alert('changed'); }); it's weird when use .click() propertychange won't fired. actually code works fine in ie7 , 8 me, whenever change value of input type ='file' , alert fired. whereas not working in >ie9 versions. from paulbakaus's blog on propertychange on internet explorer 9 what’s wrong propertychange on ie9? ie9 doesn’t fire non-standard events when binding them through addeventlistener. every modern js library uses feature detection, including jquery, fail (see also: http://bugs.jquery.com/ticket/8485 ). “not biggie” say, “simply use attacheven...

Codeigniter: Override variable in auto-loaded config file -

i have following: config/email.php $config['protocol'] = 'smtp'; $config['smtp_host'] = "xxxxxx"; $config['smtp_user'] = "xxxxxx"; $config['smtp_pass'] = "xxxxxx"; $config['smtp_port'] = xx; $config['wordwrap'] = true; $config['mailtype'] = 'html'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; in cases, i'm sending html plain-text alternative emails. config works perfectly. now in 1 special case, i'm wanting send plain-text email need override setting to: $config['mailtype'] = 'text'; how can that? tried specifying new config array , loading library again still sends html: $email_config = array( 'mailtype' => 'text' ); $this->load->library('email', $email_config); i think need call initialize when don't load config file. $this-...

spring validation annotation for compulsory and non-compulsory fields -

@notempty private string cname; public string getcname() { return cname; } public void setcname(string cname) { this.cname = cname; } private string cdescription; public string getcdescription() { return cdescription; } public setcdescription(string cdescription) { if(cdescription.length()>0){ this.cdescription = cdescription;} in above code,cname compulsory field , cdescription non-compulsory field has validated.cname working fine. want know how can validate cdescription w/o making compulsory as per requirement can use different annotations of javax.validation http://docs.oracle.com/javaee/6/api/javax/validation/constraints/package-summary.html hibernate validation you.@notblank , @notnull , @notempty various types of annotation available in hibernate-validator jar.

sed - combine one colum from two files into a thrid file -

i have 2 files a.txt , b.txt contains following data. $ cat a.txt 0x5212cb03caa111e0 0x5212cb03caa113c0 0x5212cb03caa115c0 0x5212cb03caa117c0 0x5212cb03caa119e0 0x5212cb03caa11bc0 0x5212cb03caa11dc0 0x5212cb03caa11fc0 0x5212cb03caa121c0 $ cat b.txt 36 65 fb 60 7a 5e 36 65 fb 60 7a 64 36 65 fb 60 7a 6a 36 65 fb 60 7a 70 36 65 fb 60 7a 76 36 65 fb 60 7a 7c 36 65 fb 60 7a 82 36 65 fb 60 7a 88 36 65 fb 60 7a 8e i want generate third file c.txt contains 0x5212cb03caa111e0 36 65 fb 60 7a 5e 0x5212cb03caa113c0 36 65 fb 60 7a 64 0x5212cb03caa115c0 36 65 fb 60 7a 6a can achieve using awk? how do this? paste shortest solution, if you're looking awk solution stated in question then: awk 'fnr==nr{a[++i]=$0;next} {print a[fnr] "\t" $0}' a.txt b.txt

windows - How to generate .msi installer with cmake? -

i trying generate .msi installer cmake . able generate .dll , .lib files configuration in cmakelists.txt . please provide example cmakelists.txt generate .msi installer. commands need use in command prompt ? the commands using far are: > cmake -g"visual studio 10" -h"root cmakelists.txt path" -b"path generate sln" > cmake --build "path of sln" --config release > cpack -c release output: cpack error: cpack generator not specified i used following configuration generate .dll , .lib files. here cmakelists.txt : cmake_minimum_required(version 2.8) project(mydll) include_directories(common/include) set(my_lib_src dllmain.cpp mydll.cpp ) set_source_files_properties(${my_lib_src} properties language c) add_library(mydll shared ${my_lib_src}) set_target_properties(mydll properties linker_language c runtime_output_directory ${cmake_source_dir}/common/bin...

c# - How to identify third party hardware devices for credit cards and their APIs for Windows 8 Tablet? -

i new windows 8 tablet. question how identify third party hardware devices credit cards , apis need integrate windows 8 tablet type onsite studio app? which type of languages support api windows 8 tablets? by windows 8 tablet, presume mean metro/modern style application? if you'll limited using windows 8 this. instead highly recommend looking @ api's provided in windows 8.1. using newer apis have 3 options: 1) windows.devices.pointofservice - port of pos.net across winrt namespace. basic api's allow access pos peripherals such msr readers. example code can found on: http://msdn.microsoft.com/en-us/library/windows/apps/bg182882.aspx#two 2) if want use nfc-based cards (tap , pay) - theoretically can use winrt port of smartcard framework. isn't straightforward above, , requires understanding of how smartcards work. http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.smartcards.aspx 3) can assess devices such square use 3.5mm audio jac...

apache - Webapplication common resources & Loadbalance -

i implement load balancing apache webserver , 2 tomcat servers. the war deployed on both tomcats has common resources images , css folders, quietly large, if change happens in image have copy , past again in other war file deployed. i looking out try map fix directory both war files fetch common folder. (i.e tomcat 1 , tomcat 2 access css folder c:\css\ same images ) i tried writing servlet deployed images not feasible. any other way work around high availability resource serving ? please assist if have idea. i got know can map external directory tomcat in server.xml <host name="localhost" appbase="webapps" unpackwars="true" autodeploy="true"> //add host tag <context path="/content" docbase="e:/atul/data/" /> </host>

command line arguments - What is the data type returned by getopt in Python -

i have following use of getopt in code: opts, args = getopt.getopt(sys.argv[1:], "", ["admit=", "wardname="]) then run code command line in following matter: test.py --args --admit=1 --wardname="ccu" when print contents of opts , following output: [('--admit', '1'), ('--wardname', 'ccu')] the first question data type of result? seems me list of tuples. correct? the second question - there convenient way work such tuple pairs (if these tuples)? example, how can say: if admit == 1 x ? thought of converting tuples dictionary, practice? p.s. shouldn't make difference jython , not pure python. the front page of python docs describes python library docs "keep under pillow". page on getopt at: http://docs.python.org/2/library/getopt.html you 2 lists getopt: list of tuples mentioned, followed list of remaining arguments after options have been parsed out. try this: imp...

MySQL- Is it possible to backup mySQL database within a period of time? -

i going backup mysql database in period of time. example: backup data january june. is possible that? reason want don't want database old. if possible please give me suggestion how that. thanks. i assuming want backup table rows based on date, not tables themselves. if tables have date or timestamp column, can backup rows based on date using into outfile query, example. or, command line, use mysqldump --where option. see answer: mysql dump rows

jquery - Validation for all <tr> by checkbox not working -

i have table checkbox in first <td> , want check <tr> check boxes checked. <table> <tr> <th style="width: 5%;">select</th> <th style="width: 5%;">id</th> <th style="width: 10%;">name</th> <th style="width: 5%;">order</th> <th style="width: 5%;">price</th> </tr> <c:foreach var="pack" items="${packlist}" varstatus="rowcounter"> <tr class="allpackclass"> <td class="selective_catcreation"><input type="checkbox" name="packidcatcreate" value="${pack.packid}"></td> <td>${pack.packid}</td> <td>${pack.name}</td> <td><input type="text" name="packdisorder" disabled="disabled" style="width: 20px;" value=""...

maven - How to configure Hudson to point to local repository instead of central one? -

i'm novice in hudson , need automation in building project. after installing hudson-3.0.1, tried building 1 of projects manually. keep getting error. error: failed parse poms org.apache.maven.project.projectbuildingexception: problems encountered while processing poms: [fatal] non-resolvable parent pom: not find artifact com.bnpparibas.parent:bnpparibas-parent:pom:1.0.1 in central ( http://repo1.maven.org/maven2 ) , 'parent.relativepath' points @ wrong local pom @ line 41, column 10 i understand looking artifact in central repository rather in local. don't know how configure hudson refer local repository. google searches didn't yeild useful information. can me on this? redefine "central" repository in pom: <repositories> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <name>libs...

ios - What attributes are built-in/supported in openGL ES 2.0 Shaders? -

this question has answer here: glsl: built-in attributes not accessible iphone apps? 1 answer i reading lot glsl lately , found of attributes built in. where can information of built-in attributes or uniform variables? i think might you're after http://www.khronos.org/opengles/sdk/docs/reference_cards/opengl-es-2_0-reference-card.pdf

ios - I have uploaded application with core data and I want to replace new core data without migration. Does apple allows it? -

i want replace core data , want delete old core data. apple allows delete old core data. there chance reject app. apple won't care, users might. if there data users might sorry lose, should make every effort migrate or give option export when upgrade. if you're using core data cache downloaded values, there's no problem @ all. in fact, deleting old store necessary prevent app crashing on upgrade, since wouldn't able migrate existing store. best place in core data setup code when receive error - boilerplate comments guide toward this.

c# - Binding error on XmlDataProvider (cannot bind to non-XML object) -

i have problem on binding controls xml. application populates tabcontrol @ runtime, loading xaml tab datatemplateselector: class templateselector : datatemplateselector { public override datatemplate selecttemplate(object item, dependencyobject container) { if (item != null) { string templatefile = string.format("templates/{0}", properties.settings.default.appid + ".tmpl"); if (file.exists(templatefile)) { filestream fs = new filestream(templatefile, filemode.open); datatemplate template = xamlreader.load(fs) datatemplate; tab tab = item tab; xmldataprovider xmldataprovider = template.resources["dataprovider"] xmldataprovider; xmldataprovider.xpath = tab.bridgeobj.xmlfilepath; return template; } } return null; } } the xaml: <datatemplate xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presenta...

Click on bus stop won't display any infowindow in embedded Maps -

embedded google maps in site (via javascript api v.3) display bus , train stops, not clickable, while in standard maps site , in static maps, bus stops clickable , displays departures in real-time. how can enable clickable bus stops real-time departures in embedded maps? nb: in city (genova, italy) service enabled (genova, italy).

javascript - Fancybox is getting the content size wrong when using jQuery-Chosen? -

Image
i have fancybox popup uses ajax fetch content. the fetched html div, containing title, table input fields, , buttons. problem is, i'm getting padding, or small size; anyways have unnecessary scrollbars. can disable them using css's overflow , or fancybox's scrolling property, don't want them disabled - added when necessary. i'm using jquery chosen plugin, what's causing overflow; how can avoid this? the div content modified client, can add/remove rows dynamically - need scrollbars appear in case user adds many rows fit on screen. here's happens far: what's wrong this? here's css thing: #filter-form { width: 550px; } #filter-form h2 { text-align: center; } #filter-form .chzn-results { max-height: 110px; } #filter-form .buttons { margin-top: 10px; overflow: hidden; } #filter-form .buttons .btn_save_filter { float: right; } #assoc-num, #assoc-string { display: none; } #filter-form #customuserfilters_title ...

regex - Java Replace double quote which is not in pair -

Image
i have string like "abc def" xxy"u i want replace double quote not in pair. so in above example want replace xxy"u double quote not first 2 in pair. output should in format. "abc def" xxy\"u should work every non pair double quote - "111" "222" "333" "4 here " before 4 should replaced \" thanks in advance. it great if detect actual pair too, instead of last double quote. ex: "aaa" "bbb" "ccc "ddd" -> should replaced "aaa" "bbb" \"ccc "ddd" this using int totalcountofdq = countoccurence(s, '"'); int lastindexofdq = s.lastindexof('"'); if(totalcountofdq % 2 == 1){ string start = s.substring(0, lastindexofdq); string end = s.substring(lastindexofdq+1); s = start + "\\\"" + end; } and working example thought not working "4 ...

c# - Increasing the Command Timeout for SQL command -

i have little problem , hoping can give me advice. running sql command, appears takes command 2 mins return data there lot of data. default connection time 30 secs, how increase this, , apply command? public static datatable runtotals(string assetnumberv, string assetnumber1v) { datatable dtgetruntotals; try { dtgetruntotals = new datatable("getruntotals"); //sqlparameter assetnumber = new sqlparameter("@assetnumber", sqldbtype.varchar, 6); //assetnumber.value = assetnumberv; sqlparameter assetnumber = new sqlparameter("@assetnumber", sqldbtype.varchar, 10); assetnumber.value = assetnumberv; sqlparameter assetnumber1 = new sqlparameter("@assetnumber1", sqldbtype.varchar, 10); assetnumber1.value = assetnumber1v; sqlcommand scgetruntotals = new sqlcommand("exec spruntotals @assetnumber,@assetnumber1 ", dataaccess.assetconnection); // scgetrunt...

java - Post-compilation custom action over source code? -

i need before compilation process of code *.java actions on them applied on target files not source files for example action comment system.out.println(""); statements need output target files generated without print statements source code files still print statements note : development under eclipse ide are sure you’re using right tool task? it’s simpler use static final boolean variable controlling whether code fragments ought executed. may arrange value compile time constant; in case code disabled via flag not present in resulting byte code. may runtime configuration, e.g. static final boolean debug = boolean.getboolean("myapp.debug"); … if(debug) system.out.println(something); in case command line option -dmyapp.debug=true may enable printout. there no performance difference between these variants ( , pre-processing approach well). jit smart enough eliminate conditional code @ runtime.

java - How to Create Object of Interface? -

i have field interface how create object of interface? look under known implementing classes: customfield this class looking for field<t> myfield = new customfield<t>(string name, datatype<t> type); for list (array) of fields: arraylist<field<t>> arr = new arraylist<field<t>>(); arr.add(myfield); if you're not familiar generics, t represents reference type (class) want use for simple array type (not arraylist) be: field<t>[] arr = new field<t>()[size]; arr[0] = myfield; consider using arraylist or other collection, there no reason use plain old array references variables in case.

regex - Ruby parse string with regular expressions -

if have string this: [3 series] 315 , how can parse generate substrings series="3 series" , model="315" using regexp in ruby? correct way it: "[3 series] 315".split /[|\]\s/ series can string or number _, series, model = "[3 series] 315".scan(/(\d+\s\w+|\d+)/) or _, series, model = "[3 series] 315".split /\[|\]\s/ series # => "3 series" model # => "315"

sql server 2008 - SQL splitting a word in separate characters -

i need change application , first thing need change field in database table. in table have 1 6 single characters, i.e. 'abcdef' need change '[a][b][c][d][e][f]' [edit] meant stay in same field. before field = 'abcdef' , after field = '[a][b][c][d][e][f]'. what way this? rg. eric you can split string separate characters using following function: create function ftstringcharacters ( @str varchar(100) ) returns table return v1(n) ( select 1 union select 1 union select 1 union select 1 union select 1 union select 1 union select 1 union select 1 union select 1 union select 1 ), v2(n) (select 1 v1 a, v1 b), v3(n) (select top (isnull(datalength(@str), 0)) row_number() on (order @@spid) v2) select n, substring(@str, n, 1) c v3 go and apply as: update t set t.fieldname = p.fieldmodified tablename t cross apply ( select (select quotename(s.c) ftstringcharacters(t.f...

c# - Copy file to directory -

is there no .net library call copying file directory? library calls found (e.g. file.copy() or fileinfo.copyto() ) support copying file specified file . string file = "c:\dir\ect\ory\file.txt"; string dir = "c:\other\directory"; file.copy(file, dir); // not work, requires filename is there library call? if no, what's best way write own utility, have use path.getfilename() ? do have use path.getfilename()? exactly: string destination = path.combine(dir, path.getfilename(file)); directory.createdirectory(dir); file.copy(file, destination);

multithreading - Java: How to implement a portlistener that doesn't block the rest of the program -

i have main class in define java fx scene , stage, , maincontroller in create database connection , start portlistener . 3 different parts ( views , db connection , port listener`) function when tested separately, when uncomment parts can test program in full working, doesn't work. public class main extends application { maincontroller maincontroller; @override public void start(stage primarystage) { borderpane root = new borderpane(); scene scene = new scene(root, 1100, 690); root.settop(setupmenubar()); root.setcenter(setupcenter()); root.setbottom(setupstatusbar()); scene.getstylesheets().add(getclass().getresource("application.css").toexternalform()); primarystage.setscene(scene); maincontroller = new maincontroller(); maincontroller.initcontroller(primarystage); primarystage.show(); } the problem never primarystage.show(); of main program because portlistener sits , waits incoming messages seems me there's...

php - select statement without including duplicate data -

i trying select database because database duplicate data , item names in each data may or may not duplicated. please @ example below understand more table shoe shoeid pid name 1 1 green 2 1 green 3 2 red 4 3 red thats simple example. how can select name , pid table dont want see repeated numbers or names. example don't want see red or green or whatever color have in database more once. please remember have on 100 colors in database . same thing apply pid use distinct http://www.mysqltutorial.org/mysql-distinct.aspx http://www.w3schools.com/sql/sql_distinct.asp this might want this gives unique results select distinct name, pid shoe;

Enable and disable browser JavaScript option by using JavaScript -

after applying client side validation on page, if browser javascript option has been disabled page validation/function dead. need javascript function, automatically enables , disables javascript of browser, should run on page , work on every browser. what should detect javascript disabled , degrade application validation in server side instead of client side.

Android call logs handling -

how delete particular contactno (taken user via edittext) call logs programmatically ?? lemme elaborate.. have created 1 edittext field delete button. user enter mobile no. , user hits delete button, entered mobile no should removed calllogs. please help. thank you u have following permission in manifast.xml <uses-permission android:name="android.permission.read_contacts" /> <uses-permission android:name="android.permission.write_contacts" /> deleting calllogs particular number try way: public void deletecalllogbynumber(string number) { string querystring="number="+number; this.getcontentresolver().delete(calllog.calls.content_uri,querystring,null); } }

php - How can we create and run Zend controller request? -

php application has implemented zend framework not followed zend framework. non-zend code has scope of zend framework, can use there. have page in non-zend code, includes section file (reusable other modules). now want refactor section coding zend framework. so, plan create , call zend controller existing included file , refactor existing code zend. further zend controller return output of zend view non-zend code (from it's called) or flush output of view output buffer. so, want this: make zend controller object set controller, action , query parameters make request , response object can me that?

html - Getting time difference between two times in javascript -

this question has answer here: check time difference in javascript 12 answers i have tried time difference between 2 different times , getting correctly hours , minutes. if second greater first getting problem. time displaying negative data. for example start time : 00:02:59 end time : 00:05:28 if getting difference between start , end time 00:05:28 - 00:02:59 = 00:3:-31 which not correct value. i'm using following script getting value. var start_time = $("#starttime").val(); var end_time = $("#endtime").val(); var starthour = new date("01/01/2007 " + start_time).gethours(); var endhour = new date("01/01/2007 " + end_time).gethours(); var startmins = new date("01/01/2007 " + start_time).getminutes(); var endmins = new date("01/01/2007 " + end_time).getminutes(); var startsecs = new date(...

sprite - How to set position of a dynamic body in andengine? -

i'm developing game using box2d. have move ball according accelerometer. have created body n connected ballsprite it. i'm moving body using setlinearvelocity(). once ball reaches boundaries of screen,i want stop movement of ball @ edge of screen. how do this? public void onaccelerationchanged(accelerationdata arg0) { ballbody.setlinearvelocity(arg0.getx(), 0); } you can set body velocity 0 when reach boundaries.place condition in update handler , place below statement body.setlinearvelocity(0, 0); (or) can make the body type static body.settype(bodytype.static);

Android Layout problemAt the certain part of screen, i sometimes need to display a button and sometimes a TextView -

this question has answer here: how can remove button or make invisible in android? 12 answers at part of screen, need display button , textview. when button visible, textview invisible , vice-versa.(at same place). how can ? this simple achieve. in layout have both button , textview in same place. make 1 of them visibile , hide other 1 using android:visibility="visible"/android:visibility="gone" form code can hide , show accordingly them accordingly using view.setvisibility(view.visible) view.setvisibility(view.gone) something this: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ...

ajaxcontroltoolkit - Ajax rating control not working on mouse over -

ajax rating control not working on mouse over. have mentioned classes waiting, filled, empty states. not changing css class on mouse over. dont know missing. this css. .ratingstar { font-size: 0pt; width: 15px; height: 18px; display: block; background-repeat: no-repeat; cursor: pointer; } .filledratingstar { background-image:url('images/star_full.png'); } .emptyratingstar { background-image:url('images/star_empty.png'); } .savedratingstar { background-color:red; } and here body, <div> <asp:scriptmanager id="scriptmanager1" runat="server"></asp:scriptmanager> <ajaxtoolkit:rating id="thairating" runat="server" behaviorid="ratingbehavior1" currentrating="0" maxrating="5" ...

javascript - Express.js - error when trying to pull data from mysql -

i using following controller action: exports.search = function(req, res) { var x = []; if (req.query.criteria == 'language') { var langquery ="select * languages language '%" + req.query.val + "%' order verbal desc"; client.query(langquery, function(err, results) { if (err) { throw err; } client.query('select * humans', function(err, hmns) { if (err) { throw err; } for(var = 0; < results.length; i++) { for(var j = 0; j < hmns.length; j++) { if(hmns[j].request == results[i].request) { x.push(hmns[j]); } } } res.render('allhumans', { title: 'search results', humans: x}); }); }); }else{ var query = "select * humans " + req.query.criteria + " '%" + req.query.val...

r - Set column name ddply -

how set column name of summarized data in library(plyr) ddply(data,.(col1,col2),nrow) like in ddply(data,.(col1,col2),function(x) data.frame(number=nrow(x))) perhaps looking summarize (or mutate or transform , depending on want do). a small example: set.seed(1) data <- data.frame(col1 = c(1, 2, 2, 3, 3, 4), col2 = c(1, 2, 2, 1, 2, 1), z = rnorm(6)) ddply(data,.(col1,col2), summarize, number = length(z), newcol = mean(z)) # col1 col2 number newcol # 1 1 1 1 -0.6264538 # 2 2 2 2 -0.3259926 # 3 3 1 1 1.5952808 # 4 3 2 1 0.3295078 # 5 4 1 1 -0.8204684

Quantstrat faber_rebal.R demo error -

i have been going through demos in quantstrat. have problem running faber_rebal.r. fails following error: > out<-applystrategy.rebalancing(strategy='faber' , portfolios='faber') error in `colnames<-`(`*tmp*`, value = c("maxpos", "longlevels", "minpos", : length of 'dimnames' [2] not equal array extent here output of sessioninfo(): r version 3.0.1 (2013-05-16) platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] lc_collate=english_south africa.1252 lc_ctype=english_south africa.1252 [3] lc_monetary=english_south africa.1252 lc_numeric=c [5] lc_time=english_south africa.1252 attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] quantstrat_0.7.8 foreach_1.4.1 blotter_0.8.15 [4] performanceanalytics_1.1.0 financialinstrument_1.1 quantmod_0.4-0 [7] defaults...

Vba in Excel completely ignores selections -

so one, when run example following code: activesheet.cells(5, 4).select activecell.value = "test" which literally copied http://support.microsoft.com/kb/291308 (the first line anyway). when activesheet.cells(5,4).value = "test" work, point selection doesn't work. i mean, might massively sucking here, have no clue, idea? edit: usefull add this, result writes test in cell had selected before pressed button code attached to. hence me claiming ignores select. edit2: bit of excel code runs fine on computer doesn't run on 1 due excel skippin select part. since comment provided workaround problem, decided more research escalate answer. the msdn website mentions following .enableselection property: "this property takes effect when worksheet protected: xlnoselection prevents selection on sheet, xlunlockedcells allows cells locked property false selected, , xlnorestrictions allows cell selected." since activesheet.enablese...

open two window with tree panel using extjs -

i want open 2 windows. here code trying with: ext.define('dtapp.view.myviewport', { extend: 'ext.container.viewport', requires: [ 'dtapp.class_util' ], id: 'mainwindow', autoscroll: true, layout: { type: 'border' }, initcomponent: function() { var me = this; ext.applyif(me, { items: [ { xtype: 'treepanel', region: 'west', split: false, autorender: true, autoshow: true, cls: 'detail-view + x-panel-header', width: 170, autoscroll: true, resizable: true, resizehandles: 'e', bodypadding: '0 0 0 0', animcollapse: true, collapsefirst: true, ...

Wordpress behind reverse proxy admin issues -

basically title says got wp behind reverse proxy. let's say, domain , , wordpress * *** /blog here wp-config.php edits allow work way: define('.admin_cookie_path.', '/blog'); define('.cookie_domain.', 'www.***.com'); define('.cookiepath.', '/blog'); define('.sitecookiepath.', '.'); if(isset($_server['http_x_forwarded_for'])) { $list = explode(',',$_server['http_x_forwarded_for']); $_server['remote_addr'] = $list[0]; } define('domain_current_site', 'https://www.***.com/blog'); define('wp_home','https://www.***.com/blog'); define('wp_siteurl','https://www.***.com/blog'); $_server['remote_addr'] = 'https://www.***.com/blog'; $_server['http_host'] = 'www.***.com/blog'; $_server[ 'server_addr' ] = 'www.***.com/blog'; define('force_ssl_admin', true); define('f...

stream - C++ How to initialize a std::istream* although constructor is protected -

i want use class stream-members. my code looks that: //! pushes source , inputfilters filtering_istream class filterchain { public: //! create empty filterchain filterchain(){ init(); } private: //! stream connect source , inputfilters io::filtering_istream* m_filteringstream; //! stream use other classes std::istream* m_stream; void init(){ std::streambuf* streambuffer = m_filteringstream->rdbuf(); m_stream->rdbuf(streambuffer); } }; i error message std::basic_istream constructor protected: /usr/include/c++/4.8.1/istream: in member function `void filterchain::init()': /usr/include/c++/4.8.1/istream:606:7: error: `std::basic_istream<_chart, _traits>::basic_istream() [with _chart = char; _traits = std::char_traits]' protected i tried stream references caused same error. ideas how fix this? edit 1: thx sehe fixed new init() that: void init(){ std::streambuf* streambuffer = ...

java - How to synchronize a project in eclipse, which was imported with TortoiseSVN 1.8? -

i've imported project repository using tortoisesvn 1.8 . when open project using eclipse juno can't see small svn icons on project, means there no connection between project , repository. i using default svn version given eclipse juno , , javahl 1.7 . how connect project svn repository? had similar issue. fixed me. right click on project , then team -> share project -> svn -> create new repository location enter folder path of folder exluding project folder name. it prompt override changes finds existing project @ location. in case, both same. ignore , continue. done!

html - CSS Pie & IE Meta Tag -

i've been using css3 pie on site great success. had jotform form custom css button radius, pie doesn't work jotform came across meta tag <meta http-equiv="x-ua-compatible" content="ie=edge" /> which when added particular page resolved radius issue in ie8. my question this, if it's simple allow older versions of ie render modern css can tag utilized default , if not why not i.e bad practice, technical reasons etc. it seems true i'm guessing there has reason, i'm aware doesn't validate avoid can added .htaaccess file. this meta tag needed prevent ie8—10 switching compatibility mode (which means more or less emulation of ie7 renderer). in cases, it's practice use latest available rendering engine, it's better keep meta tag. also, sure pages have proper doctype ( <!doctype html> enough practical applications), other browsers display them using newest rendering mode, according latest standards browsers c...

hibernate - Saving hasMany relationship without addTo -

we have 2 domain classes class feegroup { string name; static hasmany = [priceranges:pricerange] and class pricerange { integer from; integer to; boolean include; static belongsto = [feegroup:feegroup] from frontend application receive form json { "name":"fee group 1", "priceranges":[ {"from":10, "to":20, "include":true}, {"from":20, "to":40, "include":true}, {"from":30, "to":60, "include":true} ] } right want save data simple def model = new feegroup(data) model.save() with code shoud saved priceranges. wrong this? because save feegroup! wierd when you println model.priceranges after model.save() print new ids of priceranges - nothing in database , not in hibernate (flush not helped here). everywhere in documentations should use model.addtopriceranges w...

asp.net mvc - mvc.net custom [Authorize] attribute -

i working mvc4 in project, simplemembership role provider. need implement task based access in project. actionresult([httppost]) consist of create,get,update , delete methods. implemented custom authorize class is... public class authorizeuserattribute : authorizeattribute { // custom property public string accesslevel { get; set; } protected override bool authorizecore(httpcontextbase httpcontext) { var isauthorized = base.authorizecore(httpcontext); if (!isauthorized) { return false; } string privilegelevels = string.join("", objmanager.getpermissions()); // call method rights of user db(view,delete,update,create) if (privilegelevels.contains(this.accesslevel)) { return true; } else { return false; } } protected override void handleunauthorizedrequest(authorizationcontext filtercontext) { //some cod...

How to keep Visual studio settings syncronized across multiple machines -

is there way keep settings of visual studio 2012 including toolbars, installed plugins, etc.. in sync across multiple machines? there new feature in vs2013 you're asking vs2012. the vscommands addin enables settings synchronization : vscommands export current visual studio settings (except window layouts) sync directory , monitor directory changes. also settings can synchronized across different computers by, example, saving file in dropbox folder: vscommands supports settings synchronization folder on local file system, can further synchronize cloud using file synchronization services such dropbox. and addin free , there's paid version enables more features.

xml - Extracting part of XMLType in PL/SQL because of repeating node inside another repeating mode -

have xmltype object , want extract opening times table. <workspace> <title>workspace1</title> <item> <day>1</day> <openingtime>8:00</openingtime> <closingtime>12:00</closingtime> </item> <item> <day>1</day> <openingtime>13:00</openingtime> <closingtime>18:00</closingtime> </item> <workspace> <workspace> <title>workspace2</title> <item> <day>1</day> <openingtime>9:00</openingtime> <closingtime>14:00</closingtime> </item> <item> <day>3</day> <openingtime>12:00</openingtime> <closingtime>16:00</closingtime> </item> <workspace> i use like: select extractvalue(value(p),'workspace/item/day/text()') day ,extractvalue(value(p),'workspace/item/openingtime/text()...

angularjs - Using Resources to store data in json file in Angular -

folks have form on website who's data want store in json file. here code form: <form> <input ng-model="obj.firstname"> <input ng-model="obj.lastname"> <button ng-click="storedata()">click here store data</button> </form> my angular code below: var myapp = angular.module('app', ['ui.bootstrap.dialog','ngresource']); myapp.controller('testctrl', function($scope,$dialog,testresource) { $scope.obj = {}; $scope.obj.firstname = "mahatma"; $scope.obj.lastname = "gandhi"; $scope.storedata = function() { console.log("storing data now"); testresource.save($scope.obj); console.log("data should have been stored"); } }); myapp.factory('testresource', ['$resource', function($resource) { return $resource('test.json', {}, {} ); }]); the problem data not stored. missing here ?...

c# - RemotingServices.Marshal() does not work when invoked from another AppDomain -

i trying setup object remoting server. use remotingservices.marshal(myobj, uri) this. have following piece of code: public class ipcremoteobject : marshalbyrefobject { public void register() { var channel = new ipcchannel("ipcsample"); channelservices.registerchannel(channel, false); remotingservices.marshal(this, "test", typeof(ipcremoteobject)); console.writeline("created server, waiting calls"); console.readline(); } } if call main() of program below, works: // case 1: works new ipcremoteobject().register(); however, if create object in appdomain below, "remotingexception: requested service not found" when connecting clients. // case 2: completes without error, client connections fail var appdomain = appdomain.createdomain("foo"); var remoteobj = (ipcremoteobject)appdomain.createinstanceandunwrap(assembly, typename); remoteobj.register(); then, if create intermediat...

c# - Design Pattern for Object Modification with Timestamp -

i have colleciton of objects need maintain several time-stamps last time properties within object updated (one time-stamp per property). i implement time-stamp update in setter except deserialization library being used first creates object, updates of properties (using object's setter). means time-stamps invalidated every time program deserializes them. i'm thinking need singleton class or update method handles updating properties , controls time-stamp update. there better way implement behavior? design pattern exist behavior? if separate serialization concerns business layer, should find flexibility hammer out solution. have 99% of api work business object (which updates timestamps when properties update), convert to/from data-transfer-object (dto) serialization purposes only . for example, given business object this: public class myobject { public datetime somevalueupdated { get; private set; } private double _somevalue; public double som...

r - How to vectorize extracting significant predictor variables? -

i run glm , results ok. name of predictors significant @ 95% i.e. p-value less or equal significance level 5e-2. run: fit <- glm(data=dfa, formula=response~.) sig <- summary(fit)$coefficients[,4] (intercept) close0 close1 close2 close3 close4 closema open0 0.000000e+00 3.147425e-19 7.210909e-04 1.046019e-02 4.117580e-03 2.778701e-01 2.829958e-05 0.000000e+00 open1 open2 open3 open4 openma low0 low1 low2 8.627202e-30 1.138499e-02 1.112236e-03 7.422145e-03 3.967735e-03 3.036329e-42 3.033847e-05 3.237155e-01 low3 low4 lowma high0 high1 high2 high3 high4 8.198750e-01 6.647138e-02 4.350488e-05 6.177130e-58 2.625192e-02 4.143373e-01 3.964651e-01 3.694272e-01 highma volume0 volume1 volume2 volume3 volume4 volumema 1.416310e-05 8.027502e-02 1.975302e-01 1.630341e-09 8.979313e-03 1.2...

javascript - Breeze.js and Tasypie : Handling non OData API -

i saw in lot different post breeze.js supposed work http served resource. in breeze documentation , have references odata urls. for example, following breeze code: var query = breeze.entityquery() .from("customers") .where("companyname", "startswith", "c") .orderby("companyname"); will result in following odata request: http://www.example.com/api/northwind/customers?$filter=startswith(companyname,'c') eq true&$orderby=companyname well that's nice, i'm using django+tastypie , not support odata parameters, request fail on backend. how supposed change way breeze.js generate it's request api backend server? did missed in breeze doc? ithank help. take @ edmunds sample. in sample, breeze client makes requests of service not speak odata. if service doesn't support odata query syntax, can't use linq-like query expressions on breez...

hudson - Jenkins build pipeline on single slave -

i have software application trying build / test through jenkins. in single repo, have core application , several client applications repo-> core -> clientapp1 -> clientapp2 -> clientapp3 i want perform following tasks each time repo gets updated (or @ interval whatever) check out repo build each application cpp check each application valgrind 6,7,8 . . . run several client application tests etc and needs happen end-to-end on each test server. i want have visualized there alot of tests happen on end, , able see point broke. currently, have set of jobs, each have up/down stream project dependencies setup and, build triggers. can set artifacts pass inbetween. however, haven't figure out how tie jobs single server. is there plugin makes process easier? seems ideal , common many build/test setups can't seem find anything. to tie builds particular server, add label slave, make build attached particular label. if have mult...

wpf - Can't produce a solid color by specifying directly R, G, B and A -

i have converter determines colors based on status items. going tweak colors, opacity etc, can't colors match starters. question: why isn't outcome of below 2 lines of code equivalent? going use green example. when run the first produces normal solid green, second light green definite opacity/see through: return new solidcolorbrush(colors.green); return new solidcolorbrush{color = new color{a = 100, b = 0, g = 128, r = 0}}; as test, when create rectangle in blend , fill green: <rectangle fill="green" i see r 0, g 128, b 0 ,and 100% a not percentage, byte value r , g , b . have specify 255 100% opacity.

How to update multiple graphs from one plot in one statement in Matlab? -

i have this: p = plot([0 1], [0 1], [1 2], [1 2]); i want take each pair , append number. x = get(p, 'xdata'); y = get(p, 'ydata'); x1 = mat2cell([x{1} double(2)]); y1 = mat2cell([y{1} double(2)]); x2 = mat2cell([x{2} double(3)]); y2 = mat2cell([y{2} double(3)]); set(p, 'xdata', [x1; x2], 'ydata', [y1; y2]); % not work drawnow; 'get' giving me data in format , 'set'-ing in same format data 1 more value each pair. the error is: conversion double cell not possible. there number of different ways fetch current plot points , add them. first 2 lines of eitan's answer (using cellfun ) 1 way. here's 1 using cell2mat , num2cell : newx = [2 3]; % new x values add newy = [2 3]; % new y values add x = num2cell([cell2mat(get(p,'xdata')) newx(:)], 2); y = num2cell([cell2mat(get(p,'ydata')) newy(:)], 2); the key issue note when using set function on multiple handles stated in excerpt documenta...

c# - NServiceBus IoC Serialization Exception -

i using "custom" object builder (autofac) can re-use registration of many types have done in common assembly. when run service, hosted within nservicebus.host.exe, following error: serializationexception unhandled: type 'autofac.core.registration.componentnotregisteredexception' in assembly 'autofac, version=3.0.0.0, culture=neutral, publickeytoken=17863af14b0044da' not marked serializable. this seems odd me because nservicebus uses autofac default , doesn't have same issue. i using autofac v 3.1.1 , nservicebus 4.0.3 it's true componentnotregisteredexception not marked serializable - portable class libraries don't support serializableattribute , autofac 3.0+ pcl. i'm guessing larger issue you're running isn't serializationexception problem causing - in custom code isn't registered, when type getting resolved can't built and, thus, autofac throws componentnotregisteredexception , nservicebus trying ser...

osx - Is it possible to make mplayer from the command line mimic iTunes search -

i switched mac osx ubuntu , copied of music on had itunes style directory structure , wanted able type like: $ music abbey road at command line , hear album on shuffle or equivalently $ music beatles and hear of music have artist i came following zsh function: function music() { mplayer $home/music/**/*(#i)("$*")*/**/* -shuffle } the #i here makes case insensitive