Posts

Showing posts from May, 2012

Filtering a result set to show or hide specific result in SQL Server -

using "select [users],[stars] [table]", here example result set returned: <table border="1"> <th>users</th> <th>stars</th> <tr> <td>admin</td><td>3</td> </tr> <tr> <td>worker</td><td>4</td> </tr> <tr> <td>student</td><td>2</td> </tr> </table> how show admin if has more 3 stars , not part of result set if 3 stars or less? my best guess case when statement go in select or clause? i'm still quite new development , appreciated. this should cover using clause select [users], [stars] [table] [users] != 'admin' or [stars] > 3

Make google map monochrom -

this code google map custom marker. <script> var map; function initialize() { map = new google.maps.map(document.getelementbyid('map'), { zoom: 17, scrollwheel: false, center: new google.maps.latlng(40.6328215, 22.9468210), //* add here coordinates, here map center *// maptypeid: google.maps.maptypeid.satellite, disabledefaultui: true }); var icons = { church: { name: 'church', icon: 'images/map/pin.png' //* add here church pin *// } }; function addmarker(location) { var marker = new google.maps.marker({ position: location.position, icon: icons[location.type].icon, map: map }); } var locations = [ { position: new google.maps.latlng(40.6328215, 22.9468210), //* add here church coordinates *// type: 'church' } ]; (var = 0, location; location = locations[i]; i++) { addmarker(loc...

cocoa - "type of expression is ambiguous without more context" error in Swift closure -

i'm getting strange type-related error in swift code: type of expression ambiguous without more context. this happens if provide full type information. here's code reproduces it. i have 2 structures: struct person{ let name_ : string let address_ : address } struct address { let street_ : string let city_ : string } i create structure contains 2 functions , set address of person : struct lens<a,b> { let extract: (a)->b let create: (b,a) -> } when try create instance of lens gets , sets address (in later case returns new person new address), error in first closure. let lens : lens<person, address> = lens( extract: {(p:person)->address in return p.address_}, // here's error create: {person($0.name_, address(street_: $1, city_: $0.address_.city_))}) not type of parameter of first closure specified in type lens, in closure itself. what's going on???? while suggests ...

regex - RexExp in javascript dont match a number inside a string -

im learning regular expresions in javascript , there thing dont understand. the following regexp should match string z if add number says correct var patron = /[a-za-z]/; var regex = new regexp(patron); var v= "hello word 512"; if(v.match(regex)) { //should not match }else { objinput.style.color = "red"; } and them tried this: var patron = /[a-za-z\d]/; var regex = new regexp(patron); var v= "hello word 512"; if(v.match(regex)) { //should not match still dont work }else { objinput.style.color = "red"; } and also, parentheses not being match var patron = /[a-za-z\"\']/; var regex = new regexp(patron); var v= "hello word 512"; if(v.match(regex)) { //it match whenever double quoute followed single quoute' }else ...

go - Is there a way to make channels receive-only? -

this works: // cast chan string <-chan string func reconly(c chan string) <-chan string { return c } func main() { := make(chan string, 123) b := reconly(a) <- "one" <- "two" //b <- "beta" // compile error because of send receive-only channel fmt.println("a", <-a, "b", <-b) } but there one-liner this, without declaring new function? you can explicitly define b 's type receive-only channel , set value a . cast a receive-only channel. go spec : a channel may constrained send or receive conversion or assignment. func main() { := make(chan string, 123) var b <-chan string = // or, b := (<-chan string)(a) <- "one" <- "two" //b <- "beta" // compile error because of send receive-only channel fmt.println("a", <-a, "b", <-b) }

Can't seem to be able to redirect without using internal instance of react -

i had use move new page: this._reactinternalinstance._context.history.push('/page-one'); this.context {} this.props {} anyone have hint fix doing wrong here? thanks package.json relevant parts "history": "^1.17.0", "lodash": "^3.10.1", "react": "^0.14.3", "react-addons-css-transition-group": "^0.14.3", "react-datagrid": "^2.0.1", "react-dom": "^0.14.3", "react-multi-dropdown": "^1.0.1", "react-router": "^1.0.3", "react-select": "^0.9.1", "reflux": "^0.3.0", import react 'react'; import reflux 'reflux'; import routercontext 'react-router'; import history 'history'; import auth '../stores/auth-store'; module.exports = react.createclass({ mixins: [ reflux.listento(auth, 'ondatachange'), history ...

android - Horizontal scrollView with snapping -

i'm starting in android development, , i'm trying scrollview. used horizontalscroll view, there no snapping layout. after search, found https://github.com/ysamlan/horizontalpager . operation similar of iphone there trouble use it. how can horizontal scroll view snapping ? isn't viewpager you're looking for?

c# - Windows Service starts and runs but no Stop or Shutdown options appear in Management Console -

i have created proof-of-concept windows service in visual studio 2013 service project (in c#) along installer components. installs , runs correctly, writing record database every 5 seconds. can see it's working. it manual start. canshutdown , canstop properties set true , , yet these options grayed out in management console's services window. i've uninstalled (installutil /u fooservice.exe) , rebooted , reinstalled, , have gotten success messages each time. i've opened compmgmt.msc administrator, no difference. what have neglected do?

c# - Listview not exporting columns to excel -

i'm trying export listview excel file. information in listview exported successfully, columns not. here code: stringbuilder sb = new stringbuilder(); microsoft.office.interop.excel.application app = new microsoft.office.interop.excel.application(); app.visible = true; microsoft.office.interop.excel.workbook wb = app.workbooks.add(1); microsoft.office.interop.excel.worksheet ws = (microsoft.office.interop.excel.worksheet)wb.worksheets[1]; int = 1; int i2 = 1; int x = 1; int x2 = 1; foreach (columnheader ch in listview1.columns) { ws.cells[x2, x] = ch.text; x++; } foreach (listviewitem lvi in listview1.items) { = 1; foreach (listviewitem.listviewsubitem lvs in lvi.subitems) { ws.cells[i2, i] = lvs.text; ws.cells.select(); ws.cells.entirecolumn.autofit(); i++; } i2++; } can try setting i2 = 2 instead of i2 = 1 ? may be, 2nd part overwriting columnheader because of i2 = 1 .

php - three different table in one views laravel 5.2 -

hi display 3 different table in 1 views using laravel 5.2. seems having problem on it. my homecontroller.php namespace app\http\controllers; use illuminate\http\request; use db; use app\http\requests; use app\http\controllers\controller; class homecontroller extends controller { public function index() { $about = db::select('select * about'); $teams = db::select('select * teams'); $services = db::select('select * services'); return view('master', ['about' => $about], ['teams' => $teams], ['services' => $services]); } } in views: @foreach ($about $abt) <h4>{{$abt->title}}</h4> <span class="semi-separator center-block"></span> <p>{{$abt->description}}</p> @endforeach @foreach ($teams $team) <div class="creative-symbol cs-creative"> <img src="assets/images/...

sql server 2008 - Scalar function-Merge -

i have scalar function written 3 times minor change. m planning merge 3 functions 1 function. forstudent- declare @cn int select @cn=count(*) xyz a.subjects in ('1223','2234','3345') if @cnt>3 select @pass=1 else select @pass=0 return @pass end //similarly forstudent - b declare @cn int select @cn=count(*) xyz a.subjects in ('1214','0987','0098') if @cnt>5 select @pass=1 else select @pass=0 return @pass end same student 3. for instance there 3 students (fixed value=3), , have fixed sujects. how can merge these 3 functions one? i presently doing if @student= 'a' begin call code end if @student = 'b' begin call code b end if @student = 'c' call code c end is there better solution can think of? thanks, the obvious way have studentsubjects table (possibly indication...

Elegant way to code generated coffeescript in ruby? -

i have following converts coffeescript when ...../coffee/xxxx.js called. example trying load variables compliments script loaded. should load in separate js file or elegant way of injecting coffee script well? get "/coffee/*.js" filename = params[:splat].first coffee "../public/coffee/#{filename}".to_sym end

api - Custom Properties Text Font -

Image
i have created macro imports custom properties solidworks part file. problem solidworks seems not understand chosen vba text font , imports modified text. me resolve problem? you can see altered text here. i don't think can test since install uses english ascii encoding , appears using characters cannot use, found code convert ascii unicode : public function asciitounicode(stext string) string dim satext() string, schar string dim sfinal string, safinal() string dim x long, lpos long if len(stext) = 0 exit function end if satext = split(stext, ";") 'unicode chars semicolon separated if ubound(satext) = 0 , instr(1, stext, "&#") = 0 asciitounicode = stext exit function end if redim safinal(ubound(satext)) x = 0 ubound(satext) lpos = instr(1, satext(x), "&#", vbtextcompare) if lpos > 0 schar = mid$(satext(x), lpos + 2, len(satext(x)) - (lpos + 1)) if isnumeric(sc...

Formatting US zip codes with leading zeros in a Meteor helper -

i have collection in meteor has imported csv file zip code field. problem when print out document query, print zip 04191 4191. .... {{#each query}} <p>{{zip}</p> {{/each}} .... i'd need like: .... {{#each query}} <p>{{zip.tostring()}</p> {{/each}} .... here's generic zip code helper: template.registerhelper('formatzip',function(zip){ var pad="00000"; return (pad+zip).slice(-5); // 5 digit zips only! }); you can use template in app with: {{formatzip zip}} assuming zip contains zip code wish format. with props https://stackoverflow.com/a/9744576/2805154 - answer merely reformulates answer meteor.

flex - How to access a file stored in File.applicationStorageDirectory in AIR, for Android -

i have actionscript code downloads simple text file , wish display in stagewebview. file downloads , saved in file.applicationstoragedirectory successfully. can output contents console, however, cannot display file in stagewebview. according have read, should work. why can not display file downloaded , saved locally, on android? please note, cannot change stagewebview open file remote location because user needs able access file in offline-mode. i cannot store file on sdcard because not want user have access file. here sample test, demonstrates trying do. using apache flex 4.9.0 , deploying android 4.1.2 <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" applicationdpi="160" > <fx:declarations> <!-- place non-visual elements (e.g., services, value objects) here --> </fx:declarations> protected var webview:stagewebview = new stagewebview(); ...

sql - DateDiff use current date if enddate is null -

i calculating 2 dates , returning days want exclude weekends , holidays. want say, if enddate null, use current date? how do datediff? or use this.. if object_id('tempdb..#holidays') not null drop table temp..#holidays create table #holidays(id int identity(1,1),holiday date) insert #holidays values ('2015-12-25'),('2015-12-28') set dateformat ymd declare @startdate date = '2015-12-01' declare @endtdate date = '2015-12-31' --some times @endtdate might null so, set getdate() set @endtdate = isnull(@endtdate,cast(getdate() date)) declare @holiday int set @holiday = (select count(*) #holidays holiday between @startdate , @endtdate) select (datediff(dd, @startdate, @endtdate) + 1) -(datediff(wk, @startdate, @endtdate) * 2) -(case when datename(dw, @startdate) = 'sunday' 1 else 0 end) -(case when datename(dw, @endtdate) = 'saturday' 1 else 0 end) -@holiday

c++ - Calculate Change Without If/While/For Statement or any data structures -

i trying write program generates minimum amount of change (quarters, nickels, dimes, pennies), stipulation can't use kind of if, for, while statements. i'm sure possible, i'm extremely limited, , can't seem figure out how make work without breaking rules. the following code works, accept when runs value of 0, , breaks while trying use modulus on 0 ( think): #include <iostream> int main() { int cents; std::cout << "enter amount in cents less dollar:" << std::endl; std::cin >> cents; int quarters = cents/25; int remainder = cents % (quarters*25); int dimes = remainder/10; remainder = remainder % (dimes*10); int nickels = remainder/5; remainder = remainder % (nickels*5); int pennies = remainder/1; std::cout << "your change be: " << "\n q: " << quarters << "\n d: " << dimes << "\n n: " << nickels <...

Jenkins: how to test the slaves -

i creating list of jenkins jobs sanity test of our jenkins build environment. want create layers of jobs. first layer of jobs check environment, e.g. if slaves up, 2nd layer can check integration other tools such github, tfs, sonarqube, 3rd layer can run typical build projects. sanity test can used verify environment after major changes jenkins servers. we have 10 slaves created on 2 servers, 1 windows , 1 linux. know can create job run on specific slave, therefore test if slave online, way need create 10 jobs test slaves. there best approach check if slaves online? one option use jenkins groovy scripting task this. groovy plugin provides jenkins script console (a useful way experiment) , ability run groovy scripts build steps. if you're going use script console periodic maintenance, you'll want scriptler plugin allows manage scripts run. from manage jenkins -> script console , can write groovy script iterates through slaves , checks whether online: fo...

python - HTML IDs for rows of a Pandas Dataframe.to_html() output -

i'm trying style rows of pandas dataframe way (depending on external factor) using df.to_html() , css rules, there way give rows html ids using pandas, or have deal raw html output of to_html() . more details: have pandas dataframe result of sql query. compared previous query results , table sent out email. want highlight rows of dataframe new. i'm thinking of doing inserting css rules either apply ids of specific rows in resultant html table, or attaching class these rows. you can use .to_html() classes keyword (see docs) attach classes <table></table> tag. if need id instead of class , fix output df.to_html(classes='my_class').replace('class', 'id') . with brand new version 0.17.1 , pandas received conditional html formatting allows more fine-grained layout control - under development: see docs. . in particular, slicing functionality sounds looking highlight specific rows . ipython notebook documentation , inter...

C# Datagridview - How to organize and set certain column and cell values and save the data in a text file -

i'm using c3 vs 2012 express. have windows form tab control. on 1 of tabs (and have setup) datagridview (not sure if should use accomplish need seems suit - open other suggestions). please refer attached picture. need create text file have settings set , selected in datagridview shown. image reference user can edit field (which keep fields have marked areas need answers for. here goes: how hide index user , able select several computernames part of group name pluto. i need user select date , time here using datetimepicker. how make button read browse , place value in location cell (or same cell) edit : have part answer this.. can place value in location cell now: private void datagridview1_cellcontentclick(object sender, datagridviewcelleventargs e) { openfiledialog fdialog = new openfiledialog(); if (fdialog.showdialog() != dialogresult.ok) return; system.io.fileinfo finfo = new system.io.fileinfo(fdialog.filename); string strfilename = fi...

d3.js - d3 donut charts of varying radius -

i recreate similar following examples: http://bl.ocks.org/mbostock/3888852 http://bl.ocks.org/mbostock/1305111 the difference want control radius of each donut, rather having same of them. how dynamically vary radius of donut charts? for this, need adjust .innerradius() and/or .outerradius() dynamically each appended pie chart, example svg.selectall(".arc") .data(function(d) { return pie(d.ages); }) .enter().append("path") .attr("class", "arc") .attr("d", function(d, i) { return arc.innerradius(radius - 30 * math.random())(d, i); }) .style("fill", function(d) { return color(d.data.name); }); complete example here . in real example, you'd want specify radius in data , reference instead of making random number each segment of pie chart. can have same radius segments in same pie chart.

authentication - Spring Security : sharing security between my CRM webapp and my Front webapp -

i've 2 distinct webapp: a crm webapp show customer resume office users a portal webapp customer users my crm webapp use combination of ldapmanager , inmemorymanager basicauthenticationfilter , basicauthenticationentrypoint portal use classic jdbc manager standard usernamepasswordauthenticationfilter now, need access transparently portal crm webapp. for example, work in office on crm webapp. customer call me , ask explanations mentionned in portal. i possible office user access portal customer http link in crm customer account page. so bypass loginurlauthenticationentrypoint , access directly customer account. edit after michael help, realize need keep trace of crm user access portal account : questions : - should use preauthenticatedmanager or runasmanager ? - need declare 2nd entrypoint ? - authenticationfilters ? - possible recover user basic authenticated crm webapp in new portal abstractpreauthenticatedprocessingfilter ? i have following...

rust - "cannot move out borrowed content" when assigning a variable from a struct field -

i'm learning rust , i'm fighting against borrow checker. i have basic point structure. have scale function modifies coordinates of point. call method method named convert : fn factor(from: angleunit, to: angleunit) -> f32 {} impl point { pub fn new(x: f32, y: f32, z: f32, unit: angleunit) -> point { point { x: x, y: y, z: z, unit: unit } } fn scale(&mut self, factor: f32) { self.x = self.x * factor; self.y = self.y * factor; self.z = self.z * factor; } fn convert(&mut self, unit: angleunit) { let pointunit = self.unit; self.scale(factor(pointunit, unit)); } } but have following error: cannot move out borrowed content what doing wrong? the complete error message states: error: cannot move out of borrowed content [e0507] let pointunit = self.unit; ^~~~ note: attempting move value here let pointunit = self.unit; ^~~~~~~~~ help: ...

python - SettingWithCopyWarning while using .loc -

problem simplified: i need extract , modify particular rows of dataframe based on whether or not text within column has '-' character. dash , beyond needs removed , remaining text needs whatever preceding '-'. have: textcol 0 no dash here 1 1 - here want: textcol 0 1 here code used recreate scenario. df = pd.dataframe(data=['no dash here', 'one - here'], index=[0, 1], columns=['textcol']) df2 = df[df['textcol'].str.contains('-') == true] df2.loc[:, ['textcol']] = df2['textcol'].str.split('-').str[0] the resulting dataframe df2 yields result desire, 1 exception. every time call df2 (or derivative thereafter) receive following settingwithcopywarning : a value trying set on copy of slice dataframe see caveats in documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy i tried accomplish wanted different way, , given similar error...

Posting a 2D array in JSF -

i have application risk matrix. headings 5 severities (from severitiesbean in example) , 5 likelihoods (from likelihoodsbean in example). (the headings go different names in literature, such exposure or probability or consequences.) in each cell there risk rating (enumerated riskratingsbean ). give idea of looks visually, there example here . i able display matrix fine, seems people asking related questions on cared about. however, want display , allow administrator of system edit risk each cell in grid. selectonemenu dropdown in either h: or p: (primefaces) seems way of allowing selection. here's jsf: <h:panelgroup id="editarea"> <table border="1" style="border-collapse:collapse;" class="riskmatrix"> <tr> <td rowspan="2" colspan="2"></td> <th colspan="5">severity</th> </tr> <tr> <!-- severities going ...

python - Function that replaces itself with builtin after first execution -

is possible write function replaces after first execution? first.py: from second import max x = max(1,2,3) y = max(4,5,6) second.py: def max(*args): ... #rewire references return min(args) can make second call max calls builtin, while first 1 calls 1 second.py ? tried modifying globals() dict, had no effect, of course, neither did declaring global max in custom max function, renamed (and later named max again). is there way possible? can access importing module in way? (before comes inevitable comment: know bad idea, don't plan use in production, if it's possible. i'm interested in knowing whether doable.) edit: clarify, afterwards should how looks in repl: >>> second import * >>> max <function max @ 0x10e501400> >>> x = max(1,2,3) >>> max <built-in function max> in file maxtest.py: import __builtin__ _max = __builtin__.max def max(*args): print "inside non standard max f...

java - Euclidean Distance between 2 Vectors Implementation -

i working through few exercises academic programing book. task implement 2 vectors , calculate euclidean distance between thereof. no not home work, rather self studying. i'm seeking feedback on correctness of distance implementation. public class euclideandist { public static void main(string[] args) { euclideandist euc = new euclideandist(); random rnd = new random(); int n = integer.parseint(args[0]); double[] = new double[n]; double[] b = new double[n]; double[] x = new double[n]; euc.print(euc.init(a, rnd)); euc.print(euc.init(b, rnd)); print(euc.distance(a, b, x)); } private double[] init(double[] src, random rnd) { for(int = 0; < src.length; i++) { src[i] = rnd.nextdouble(); } return src; } private double[] distance(double[] a, double[] b, double[] x) { double diff; int n...

javascript - can this be done without jquery? -

how can show alert when have scrolled right 300px? $('.container').scroll(function () { if ($(this).scroll() === 300) { // alert("you've scrolled 300 pixels."); } }); can getting callback without using jquery? you can bind onscroll method: window.onscroll = function() { if (window.pageyoffset == 300) { alert("you've scrolled 300 pixels."); } };

python - Catching exception from a called function -

i have function reads csv, checks values in rows, , if okay, writes rows new csv file. have few validation functions i'm calling within main function check value , format of rows. i'm trying implement main function in way when call other validation functions , doesn't check out, skip writing row entirely. #main function row in reader: try: row['amnt'] = divisible_by_5(row['amnt']) row['issue_d'] = date_to_iso(row['issue_d']) writer.writerow(row) except: continue #validation function def divisible_by_5(value): try: float_value = float(value) if float_value % 5 == 0 , float_value != 0: return float_value else: raise valueerror except valueerror: return none at moment, writer still writing rows should skipped. example, if number not divisible 5, instead of skipping row, writer writing '' . so, how can handle exception ...

flot line changes after animation -

i have flot animation on line time graph. after animation has finished line changes slightly. how can prevent ocurring? https://jsfiddle.net/shorif2000/cq6chwu8/ var options = { "xaxis": { "mode": "time", "timeformat": "%d/%m" }, "yaxes": [{ "position": "left", "min": 98, "max": 100, "ticksize": 1 }, { "position": "right", "min": 0, "max": 2 }], "series": { "lines": { "show": true, "linewidth": 3 }, "curvedlines": { "apply": true } }, "colors": ["#008c00"], "legend": { "show": false }, "grid": { "hoverable": true, "clickable": true } }; var data_ajax = [{"...

asp.net mvc - <a> tag not working when Html.ActionLink is? -

i'm starting out mvc , need div become link page. whenever make link using tag href server error in '/' application message. when make piece of text link using html.actionlink, works flawlessly. here's code div link doesn't want work: <a href="../home/page1"> <div class = "col1"> function 1 </div> </a> please help! i think u can use url.action address <a href="@url.action("page1", "home")"><div class = "col1"> function 1 </div></a>

svn - Git vs. Subversion for multiple large development branches -

at company, using subversion. our project development process consists of "live" branch of code (this on our live web servers), general dev branch smaller projects, , each larger project has own separate branch. have @ least 2 larger project in development @ given time. merging live branch can pain, what's more of pain when large project 1 goes live, large project 2 going live little later, , merge process just... messy. what i've been doing in svn have daily merge live (so bug fixes etc. happen) development branches. larger project merge process still messy, , i'm wondering if cleaner git. 1 example of "bad" that's happened svn, have small feature on dev, merge live, when performing live backmerge, svn tries merge feature dev again (causing conflict), unless manually deselect commit in merge. understanding, git "smart" enough know commit originated in dev, wouldn't try merge in... understanding wrong. hear git better @ aut...

modeling - Power Law in Excel works better than R? -

Image
i trying model data. having better luck excel r, excel solution won't scale need figure how in r. excel map trendline data , power curve yields reasonable y = 0.6462x^-0.542. when put same data r , try model continuous power-law in powerlaw package y = 0.14901x^-3.03671 . intercept way small , alpha way big. # 14 days of % of users retained y = c(0.61431 , 0.42585 , 0.35427 , 0.33893 , 0.28853 , 0.26004 , 0.2352 , 0.20087 , 0.17969 , 0.1848 , 0.17311 , 0.17092 , 0.15777 , 0.14901) y.pl = conpl$new(y) y.pl_est = estimate_xmin(c_pl) y.pl_est # $ks # 0.1068587 # # $xmin # 0.14901 # # $pars # 3.03673 # # $ntail # 14 is there way use lm or glm power curve give reasonable intercept , alpha? i haven't used powerlaw package, r's base nls (non-linear least squares) function gives results similar got excel. if there difference, after checking code errors, first thought "so worse excel" :). # data dat = data.fram...

jsp - Tag Library supports namespace: http://java.sun.com/jsf/core, but no tag was defined for name: ajax -

below page <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %> <h:form> <h:outputlabel id="outtxt" value="#{user.name}"/> <h:inputtext id="intxt" value="#{user.name}"> <f:ajax event="keyup" execute="intxt" render="outtxt"/> </h:inputttext> </h:form> throws below error tag library supports namespace: http://java.sun.com/jsf/core , no tag defined name: ajax how caused , how can solve it? the <f:ajax> available in facelets tag library of jsf . however, you're using jsp deprecated since jsf 2.0. jsf 2.x development jsp has stopped. new jsf 2.x specific tags/attributes such <f:ajax> , <h:head> , <h:link> , <h:button> , <h:inputfile> , <f:viewparam> , <f:viewaction> , et...

javascript - How should I catch a change in a bunch of dropdowns (in a table) and store it? -

i have table populated static data, 1 column contains dropdown built every row during foreach (item in array). while have same content, need treated separately. user change dropdown , choice needs stored. i've seen jquery .change method, , according docs can go $(document).ready(function(){ $( "input[type='select']" ).change(function() { console.log (input( $( ).val() ) }); }); to fire when there's change in of dropdowns. above doesn't log, nor error. how monitor of dropdowns changes , store change? or would better off setting script per select monitor 1 assigned element? i'm not concerned performance or filesize, or ever. i'm using foreach populate rows , selected right option of dropdown the problem you're using select , not input[type="select"] . that's incorrect one. <table id="yourtableid"> <tr> <td> <select> ...

apache - RewriteURL not working in HTTPS -

i have been searching other topics regarding this, seem @ lost @ one: i have managed create modrewrite url following rewriteengine on rewriterule ^/gui/?(.*)$ /webui/index.php?shell_file=$1 [r,l,qsa] this working fine in http, when go https, doesnt work. need change in order make work? have followed many tutorials, can't seem able make work.

laravel - modify php built-in server to route resource requests to my app -

i'm building app locally laravel + php 5.6.8's built-in server testing purposes. on main server, it's running vanilla apache+php5.6.8 , not have issue. when try create route /api/account/1.json (in laravel route::get(/api/account/{id}.{format}) , test locally, says "resource not found". it's trying find 1.json file rather parsing , passing $id / $format variables. how go modifying php.ini disallow json resources routed app?

sql server - Attach long text file to sql database -

in website there name of authors images. how can add biography database? biography long text. you can use biography field data type varchar(max) store large text data.

java - Storing arrays in strings -

why storing array in string work if do for(int i=0;i<testing.length;i++) string mark += testing[i]; but for(int i=0;i<testing.length;i++) string mark = testing[i]; will not work , produce error saying cannot convert int testing array cannot converted type string the first way uses string concatenation, special cased in java language allow use object or primitive type. however, cannot assign random value string .

ios - Swift - pinch zoom multiple images -

i have scrollview holds imageview, pinches , zooms fine. issue when i'm programmatically adding additional imageviews scrollview, doing zooming , not main scrollview. in fact, scrollview "locked" panning , zooming. what want "sync" images place on scrollview respond pinch , zoom, appears in right "scale" size @ whatever zoomscale end with. this how place new images on screen: let singletaprecognizer = uitapgesturerecognizer(target: self, action: "scrollviewsingletapped:") singletaprecognizer.numberoftapsrequired = 1 singletaprecognizer.numberoftouchesrequired = 1 scrollview.addgesturerecognizer(singletaprecognizer) and routine adds images: imageview = uiimageview(image: uiimage(named: "fingerprint36x36.png")) imageview.tag = 1999 imageview.center = cgpoint(x: pointinview.x, y: pointinview.y); scrollview.addsubview(imageview) once happens, appears "self" becomes new view control, , n...

node.js - Can't install Grunt -

need little here pass grunt instalation c:\users\danie>npm install -g grunt-cli npm err! windows_nt 10.0.10586 npm err! argv "c:\\program files\\nodejs\\node.exe" "c:\\program files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli" npm err! node v5.3.0 npm err! npm v3.3.12 npm err! code econnrefused npm err! errno econnrefused npm err! syscall connect npm err! error: connect econnrefused 127.0.0.1:8080 npm err! @ object.exports._errnoexception (util.js:855:11) npm err! @ exports._exceptionwithhostport (util.js:878:20) npm err! @ tcpconnectwrap.afterconnect [as oncomplete] (net.js:1063:14) npm err! { [error: connect econnrefused 127.0.0.1:8080] npm err! code: 'econnrefused', npm err! errno: 'econnrefused', npm err! syscall: 'connect', npm err! address: '127.0.0.1', npm err! port: 8080 } npm err! npm err! if behind proxy, please make sure npm err! ...

javascript - Encrypt file and storing it on the server -

i don't want have readable endpoint .com///something.jpeg so 1 thing use hash (i'm using bcrypt) mask whatever needed mask, question have performances issue doing encrypting on server side did not save encrypted string db. here's how it. saving bcrypt user_id, blog_post , filename , save file storage retrieving related identifier db, bcrypt them , use value go endpoint of file. am doing right?

javascript - JSON syntax error in firefox only -

im getting syntax error in firefox when using $.parsejson() . same code works on chrome/chromium, , safari. i call function random generated token set. function gettoken() { var url = "/csrf_token_generate"; $.ajax({ url: url, method: "get" }).done(function(data) { console.log(data); // logs data call var json = $.parsejson(data); // error occurs token = json.token; console.log(token); }); } the url /csrf_token_genrate returns json object similar {"token":"$2y$10$jcr.p3fnqeji6rqd93lnxeiks9gynipj7cboahz8rccsgkw7vofhi"} in url, setting content-type application/json works in every other browser. the error im getting this syntaxerror: json.parse: unexpected character @ line 1 column 2 of json data n.parsejson() jquery.min.js:4 gettoken/<() wheel.bak.js:94 n.callbacks/j() jquery.min.js:2 n.callbacks/k.firewith() jquery....

php - REST Service not working-Code Igniter -

i want implement phill sturgeon codeigniter restserver library in project. copied files rest.php, format.php, rest_controler.php in folders config,library,library respectively. i created controller called services following code: <?php require(apppath.'/libraries/rest_controller.php'); class services extends rest_controller { function teams_get(){ $teamnames=$this->team_model->getteamnames(); $this->response($teamnames); } teammodel autoloaded in autoload.php . when want run teams_get method in browser result is: {"status":false,"error":"unknown method."} i read here should change rest_controler.php configuration file, change should done if post methods not working. my services should public, don't need authentication methods. what's wrong here? when calling api, url should name of method, without _get (or _post ). added rest server depending on how url called...

recursion - Error Within Code

this set of code producing stack overflow error due infinite recursion (at least, think is). have been staring @ code long time , can't figure out error happens be. if can point out why getting such error, great. public void drawvalues(graphics g, graphics2d g2, int x, int y, int a, int b){ if (b>8){ b = 0; a++; x = 61; y+=66; } if (a==8 && b==8){ g.drawstring(string.valueof(solver.rows[a][b]), x, y); } else{ g.drawstring(string.valueof(solver.rows[a][b]), x, y); drawvalues(g,g2, x+66, y, a, b++); } } it state rows 9x9 2d array, , b start @ 0 this because using post-increment(b++) instead of pre-increment(++b) when make recursive calling of drawvalues method. if use post-increment, argument increment after method has been invoked. hence, in case, variable b never changed. so, should use pre-increment: ... drawvalu...