Posts

Showing posts from August, 2011

java - How to write an if condition for return key or enter ket -

i writing program in java in want if user presses "return" key next statement should executed. but, can't understand how write if condition "return key" or enter key in code. please me? unless i'm missing check nextline() scanner . scanner s = new scanner(system.in); system.out.println("press enter continue"); s.nextline(); system.out.println("thank you");

javascript - Can't get instafeed to work at all -

for whatever reason, instafeed ( http://instafeedjs.com/ ) isn't displaying anything. i'm using localhost if makes difference. my markup follows: <div class="photo-container"> <div id="instafeed"></div> </div> i've set height of photo-container in css. here js: <script type="text/javascript"> var userfeed = new instafeed({ clientid: '33a######################76569e', get: 'user', userid: 22####892, accesstoken: '2######92.46######.108#######403e8088#####05', limit: 9, usehttp: true, target: 'instafeed', template: '<a href="{{link}}" target="_blank"><img src="{{image}}" /><div class="likes">&hearts; {{likes}}</div></a>' }); userfeed.run(); </script> i have following line a

javascript - Pass data from input field to $http.get in an angular factory -

i want able pass user input values submit button fired in controller factory loads values, stored variables, $http.get() request. how pass value controller service? going right way? controller 'use strict'; angular.module('myapp') .controller('phonesubmitcontroller', function($http, phoneservice) { $scope.submitphone = function(data) { phoneservice.then(function(data) { var phone = $('#phone_number').val(); var phone1 = phone.substring(1,4); var phone2 = phone.substring(5,8); var phone3 = phone.substring(9,13); $scope.jawn = data; }); }; }); factory angular.module('myapp') .factory('phoneservice', function($http) { var promise = $http.get('http://dev.website.com:8080/api/get?areacode=' + phone1 + '&exchange=' + phone2 + '&lastdigits' + phone3, { headers: { 'authorization': "basic " + base64.encode("allen" + ":" + "ivers

css - Display non equal height element with bootstrap -

Image
i want make page posts have non equal height, same width 2 posts on row without use of rows did give every div col-md-6 class gave me 2 divs in row there's gap between elements since different height. this: and gap becomes bigger if show comments button clicked: here's working plunker example. tried pull odd element side , element other, thought maybe when elements floated left stay left, not correct. first looked worked: but again once show comments button clicked gap reappear , if play little padding elements unaligned: here's working example in plunker . , in examples if element long enough push element under other side, other behaviour don't want. question how display non equal height elements in way there's no gaps , when 1 element long (or show comments button clicked) won't push 1 under other side? note: i'm looking css solution. update: as @gorostas , @dsuess answered use of 2 containers separate elements original des

actionscript - Sending notifications and/or messages to a Flash/Silverlight/HTML5 player in fullscreen -

i'm researching project need send messages and/or have interaction user while watching video full-screen on website. understanding once flash (or of other programs) start, browser has no control on process. can find little no information on possibilities. possible without having user install separate software? any appreciated clearly didn't homework, have found impossible: are overlays on top of full-screen flash video possible?

Read inputfile as csv in python -

i want read csv file stdin , operate on it. the following code reading csv file , doing operation needed. works fine. want take input stdin. import csv open('hospital_data.csv', 'rb') csvfile: mydict = {} csvreader = csv.reader(csvfile, delimiter=',') row in csvreader: if row[6] not in mydict.keys(): #print 'zipcode: ' + row[6] + ' hospital code: ' + row[1] mydict[row[6]] = 1 elif row[6] in mydict.keys(): #print 'value in row '+ str(mydict[row[6]]) mydict[row[6]] += 1 is there way in python read file stdin csv file ? csv.reader take yields lines, can use of methods shown @ answer lines stdin: how read stdin in python? i'm partial fileinput myself due flexibility. eg: import csv import fileinput mydict = {} csvreader = csv.reader(fileinput.input(mode='rb'), delimiter=',') but works too: import csv import sys mydic

oop - Extending classes or Interface or Abstract - PHP Child Classes for MVC ref: Vtiger -

i'm working in vtiger (mvc set up), modules contain mvc files. modules extend other modules extending class of other module. in case looking at, quote extends inventory module. outcome custom block inside quote, not whole new "page". i want "block" whole module. should simple, except ran php "inheritance" issues. class need extend extended class already. my logic was: ( b gets c ) works! gets b stuff. did not work. the parent class class event extends calendar (shows event details / "final page") the exiting "working" class class event extends inventory (creates new block) i need these 2 classes communicate, since calendar "talks" events, , events talks inventory, variables unrelated, cannot output work, assume because of class "inheritance" so direct question is : can existing child class extended? stack addresses in few posts i'm not able "grasp" how applies here since no vari

java - Android Custom Bar Graph Layouts Not Adding -

i'm trying create own custom bar graph in android having issues. graphing libraries i've seen don't offer flexibility , customization need. anyway, i'm in beginning phases , have basic layout placeholders of "bars" placed. xml below <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="250dp" android:layout_gravity="center" android:layout_margin="0dp" android:duplicateparentstate="true" android:orientation="horizontal"> <framelayout android:layout_width="150dp" android:layout_height="match_parent" android:background="@drawable/sectioned_borders" > <framelayout android:id="@+id/frame1" android:layout

Excel VBA search for a word in a column and copy the row below the word onto a new workbook -

i trying run macro open workbook, search word apples , copy first row below word onto new workbook. in column , word "apples" comes on multiple rows. code takes word apple & row below , moves onto sheet. want move workbook , take row below. reason grabs 2 unwanted lines @ end. been fiddling not sure go here. sub apples() date1 = range("b3").value chdir "c:\users\name\desktop\" & date1 workbooks.opentext filename:= _ "c:\users\name\desktop\" & date1 & "\file" & left(date1, 4), origin:= _ 437, startrow:=1, datatype:=xldelimited, textqualifier:=xldoublequote, _ consecutivedelimiter:=false, tab:=true, semicolon:=false, comma:=false _ , space:=false, other:=false, fieldinfo:=array(1, 1), _ trailingminusnumbers:=true windows("apples" & left(date1, 4)).activate sheets.add after:=sheets(sheets.count) const fwhat string = "apples"

javascript - Customise jQuery Accordion -

i'd following: 1) open first box default & 2) close box when clicked. right closes & re-opens instantly. demo: http://jsfiddle.net/2hmzcgqm/ (function($) { var allpanels = $('.accordion > dd').hide(); $('.accordion > dt > a').click(function() { allpanels.slideup(); $(this).parent().next().slidedown(); return false; }); })(jquery); 1) add line after click handler: $('.accordion > dt > a').first().trigger('click'); 2) add line @ second line of click handler: if ($(this).parent().next().is(":visible")) return false; so: $('.accordion > dt > a').click(function() { allpanels.slideup(); if ($(this).parent().next().is(":visible")) return false; $(this).parent().next().slidedown(); return false; }); $('.accordion > dt > a').first().trigger('click'); updated fiddle

html - Can I Specify Variable Names In A CSS File -

i in process of adding background images couple of hundred web pages. app doesn't know until runtime image load. have been able work fine changing statement in of pages contain attributes need plus variables image file name, etc: <body style="margin:0; background-image: url(<%= strbackgroundimage %>); background-repeat: <%= strbackgroundrepeat %>"> while above statement works, rather put attribute info css file this: body { margin:0; background-image: url(<%= strbackgroundimage %>); background-repeat: <%= strbackgroundrepeat %>; } but doesn't work. attributes containing variable names ignored. how can modify above snippet work in css file , still allow me set variables' contents in code behind files? thanks. in short no cannot pass variables in css. sass or scss sass , scss support variables. http://sass-lang.com/ less less supports variables too http://lesscss.org/

c++ - Using Other Programs as Part of Another Program -

i'm working last programming assignment of semester (my last computer program ever guess seeing changed majors ha) , have kind of run roadblock. assignment asks write 2 programs, 1 program reads in information file , creates hash table saves output file. second program supposed allow user enter key , program search output file key , return information contains if found. i'm still in planning stages of program, write them out on paper before start coding since reason kind of helps me figure out what's going on better, think program creates hash table should work since it's identical program had write couple weeks ago created hash table (fingers crossed), i'm having problem on search program. search program has 1 method search file key entered user. may easier explain specific issue if include code search function used in program mentioned created hash table. void hash::finditem(int key) { int index = hash(key); bool wasfound = false; record* ptr =

php - Magento homepage on a custom theme NOT showing after catalog URL rewrites? -

i uploaded products new magento site through csv data profiles import. the catalog url rewrites stuck on 'processing' after , couldn't rewrite them through magento admin backend, used ssh rewrite urls through query on indexer.php as did that, homepage not showing anymore. header , footer showing up. blocks in middle missing. to rectify, truncated catalog urls table , homepage on no problems @ rewrites gone , links don't work well. reindexed them through ssh again. now homepage problem persists, it's not showing up. any ideas on appreciated! make sure 1 of products doesn't have blank url key or space (this possibility when importing products). what happen if case magento create url index / cause issues homepage loading. you can double-check if case looking in core_url_rewrite database table , looking blank or / value inside of request_path column.

ruby on rails - Mutiple has_one of the same class -

got interesting situation has_one , belongs_to relationships when rails loads dependant models in inversed manner. let have model couple 2 related models of same class, user : class couple < activerecord::base has_one :male, class_name: "user" has_one :female, class_name: "user" end class user < activerecord::base belongs_to :couple end in situation, when create couple , assign 2 instances of user , this: # create stuff couple = couple.new = user.create name: 'bob' = user.create name: 'sara' couple.male = couple.female = couple.save # here's gap begins: couple.male.name # => 'bob' couple.female.name # => 'sara' # ok, far good... couple.find(couple.id).male.name # => 'bob' # what's ..?! couple.find(couple.id).female.name # => 'bob' and i've seen in console performing these, this: > couple.female.name 'sara' # nothing happens model loaded > couple

regex - How do I match an entire string to replace it with its components? -

ok, have been fiddling on regexr.com long while , i'm still having no joy. this sample data: <html><body><p>7792,783,5365514 -1,1,-1 6329,46,72141 -1,1,-1 8595,42,49104 -1,1,-1 14386,21,5026 6172,52,128182 6311,51,114826 9108,43,51437 8257,24,7050 5289,55,169099 -1,1,-1 15667,26,8919 29,79,1861956 32,83,2681719 4595,32,16506 8469,22,6113 -1,1,-1 -1,1,-1 -1,1,-1 7912,50,102981 -1,1,-1 6951,15,2579 -1,1,-1 4830,46,70571 6617,24,7553 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 -1,-1 </p></body></html> what want do, replace entire string each number. so... run regex once, , replace string 7792. run again , replace 783. run again, replace 5365514 , on. how build first, second , third regex? can work out form there... the numbers parts of change. rest stay same anytime run. ok, have worked out solution though not best. still wondering if has better

python - Protection against multiple click on a link -

i have web site made django 1.7. user can click on link it's take while before rendering because of server works. how can disable correctly link after first click ? know can javascript want know if there way. just precision, link: <a class="navbar-brand" href="/ds9s/view/">let's go !</a> thanks reading , maybe answering ! here parameters need: 1) needs client side. server side makes no sense tracking ui clicks 2) needs fast. it seem javascript meets both criteria. why not use disable click? going have page load when server responds, it's pretty straight forward.

javascript - Can't get $.ajax.mostRecentCall to work with jasmine 2.0.2 -

having real trouble getting simple example work. using example taken https://gist.github.com/madhuka/7854709 describe("test spies", function() { function sendrequest(callbacks, configuration) { $.ajax({ url: configuration.url, datatype: "json", success: function(data) { callbacks.checkforinformation(data); }, error: function(data) { callbacks.displayerrormessage(); }, timeout: configuration.remainingcalltime }); } it("should make ajax request correct url", function() { var configuration = { url : "http://www.google.com", remainingcalltime : 30000 }; spyon($, "ajax"); sendrequest(undefined, configuration); expect($.ajax.mostrecentcall.args[0]["url"]).toequal(configuration.url); }); }); for whatever reason, $.ajax.mostrecentcal

c - Stackdump Error working with Linked Lists -

i working on homework assignment linked lists. 1 of functions need write add node of linked list. code wrote in attempt follows: void add_back(struct node **list, int value) { /* variable declarations */ struct node *pnewnode; /* pointer new node want add */ struct node *ptemp; /* temp pointer walking through list */ /* allocate space our new node , initialize member variables */ pnewnode = malloc(sizeof(struct node)); pnewnode->number = value; pnewnode->next = null; /* sets ptemp head pointer, don't mess */ ptemp = *list; /* while we're not @ end of list */ while(ptemp->next != null) { /* go next entry in list */ ptemp = ptemp->next; } /* have previous end of list point @ new end of list */ ptemp->next = pnewnode; } the specific error message i'm getting "0 [

python - what is the use of flushing in this instance? -

i curious use of flushing in particular instance, has no bearing on whether app functions or not. line in question under 2nd class route definition, "sys.stdout.flush()" line. used for? class route(object): def __init__(self): self.__route = [] #route information array def add_route(self, t): #user generated input array self.__route.append(t) print t.name sys.stdout.flush() #using "flush" method def compile_list(self): #route list compiler output = "" #sets addition variable route in self.__route: #looping inputs output += "<div id='container'><div class='results-container'><span class='title'>route name: </span>" + "<span class='result'>" + route.name + "</span></div><br />" + "<div class='results-container'><span class='title'>stop one

ruby on rails - I am not able use wkhtmltopdf for urls with https -

i not able convert web pages pdf using wkhtmltopdf websites https. here console: wkhtmltopdf "https://mywebsite.com" "test.pdf" loading pages (1/5) error: failed loading page..(sometimes .....) why getting error when can view page in browser?

c# - Stored procedure dynamic where clause, getting a value from a variable -

i'm using sql server, c#, asp.net. doing project menus dynamically displayed database according user's permission. of here's stored procedure, create proc spgetmenudata begin select * tblmenu1 end i have users table, roles table , menu table on database. users: userid, username, pass, roleid roles: roleid, name (admin, user) menu: menuid, name, url, roleid, userid or menuid, name, url, roleid (please tell me if what's more appropriate) now, want userid , roleid check menus. can store userid variable program , pass stored procedure. like: create proc spgetmenudata begin select * tblmenu1 //(where tblmenu1.userid = useridfromthevariable , tblmenu1.roleid = useridfromthevariable's roleid) end please me, i'm beginner. in advance! here do: users table: user_id, username, pass, role_id roles table: role_id, role_name menu_roles table: role_id, menu_id menus table: menu_id, name, url specify menus belong role , have roles belong users. menu

ios - Issue with unregistering and registering to a different server -

i've encountered issue registration , unregistering in app. development purposes have 3 instances of sup. following scenario causes errorcode 568; create database & register uat server (success) perform initial sync server (success) unregister uat server & delete database (success) create database & register dev server (success) perform initial sync server (success) unregister dev server & delete database (success) create database & register uat server (fail) error output: [error] [supapplication.m:1171] error @ registerapplication messagingclientexception { errorcode = 568; errormessage = ""; } ================================================= onregistrationstatuschanged: status = 201, code = 568, message = supapplicationerror_unknown ================================================= [line 420] exception: suppersistenceexception: sync failed: -1497 (error) %1:3 %2:3004;parameter 1:3;parameter 2:3004 attempt 1: thought calli

Is docker an ephemeral instance? -

i created few docker images, did wget , apt-get install on one. everytime exit docker instance, after going image again, e.g. ubuntu:myimage seems spawn new fresh version of means apt-get install , wget "lost". i realized it's not persistent did docker commit... proper way have "persistence" in docker? my question: possible have persistence without doing commit time? thanks the docker run command start new container provided image. use docker start restart stopped container. if want save changes image, possible use docker commit command, not want. instead, use dockerfile build images , update whenever want make change. way can recreate image , make changes without starting scratch. persistence (.e.g. config files , databases) use volumes, directories stored outside of union file system normal directories on host.

android - Issue creating JSONObject with Instagram API response -

i have made call instagram endpoint images contain tag #selfie. issue having in dealing response. massive json response, , need "thumbnail" image "url". how can go structuring object data in jsonobject? public static class fetchtaggedimages extends asynctask<string, void, jsonarray> { @override protected jsonarray doinbackground(string... params) { string maccesstoken = params[0]; string url = (api_url + "?access_token=" + maccesstoken); httpget httpget = new httpget(url); httpclient httpclient = new defaulthttpclient(); string instagramjsonresponse = null; jsonarray responsearray = null; httpresponse postresponse; try { postresponse = httpclient.execute(httpget); instagramjsonresponse = entityutils.tostring(postresponse .getentity()); jsonobject jsonobject = new jsonobject(instagramjsonresponse); stri

android - LibGDX - Basic physics error? Cannot detect collision between player and ONE side of a platform (tile) -

couldn't find useful tutorials online tried freestyle algorithm collision. basically, i've modelled player (main character) , platform (a tile player can collide with) rectangles sake of collision detection. in code, playerrect rectangle representing player , getrect() rectangle representing platform. as stands player moves left right, can collide 3 of platform's sides (left, , bottom). have managed detect collision on top , bottom part of platform, reason can't detect collision on left side. would highly appreciated if can have @ code , possibly find i'm going wrong. public class platform extends gameobject { ... public void update() { // rectangle of player playerrect = player.getrect(); //a boolean checks whether or not player's rectangle //and platform's rectangle overlap isoverlapping = playerrect.overlaps(getrect()); if (isoverlapping) { // if player hits bottom part of platform, // have gravit

javascript - Jittering geo paths using D3.js -

i'm trying add 'jitter' or add random noise d3.js map contains line features. note, different other example because involves geo paths. additionally, while i'd use custom transformation this, don't think can because need able use standard transformation (from wgs84 ny state plane). think jittering function should either based on modified path function, or separate function takes path input. var projection = d3.geo.conicconformal() .parallels([40 + 40 / 60, 41 + 2 / 60]) .rotate([74, -40 - 10 / 60]); var path = d3.geo.path() .projection(projection); note don't want modify input data @ (i.e., jittering should on paths, not input geodata). note jittering can totally random (i.e., not have same every time). initial thought wrap data in jitter function, or wrap path function in jitter function. either way, i'm not sure start on this? suggestions? link relevant api item awesome! svg.selectall("path") .data(jitter(lines.f

sql server - Conversion failed when converting date or time from character string in java -

i have created 2 methods in java ,one of returns database server time , other returns 1 hour ago time of database server.now have use these 2 date time sql query.the code retrieving database server time is:- public string database_time() throws sqlexception { con = getconnection(); string sql = "select getdate()"; clstmt = con.preparecall(sql); clstmt.execute(); rs = clstmt.getresultset(); while(rs.next()) { timestr= rs.getstring(1); } system.out.println("database time is" +timestr); return timestr; } another method retrieving 1 hour ago time public string previostime() throws parseexception, sqlexception { database_time(); string format = "yyyy-mm-dd hh:mm:ss"; simpledateformat simpledateformat = new simpledateformat(format); date date = simpledateformat.parse(timestr); calendar calendar = calendar.ge

javascript - Ruby on rails, new POST to API and refresh page -

i new ruby on rails. on our site user gets search , list of results. now want add ability view results sorted (by price, rating, etc). api sorting have sent new post request api new option (i.e. &sort=price ) return results in order. my issue don't know how this, i've tried button_tag , button_to , button_to if clicked , manually refreshed works, if add multiple button_to tags won't. i have made $sort global variable (with default sort value in api docs i.e. no_sort) when button pressed try change variable desired name post, have in view: <%= button_to 'price', :controller => 'database', :action => 'getlist', :method => 'post' %> <% $sort="price" %> <% end %> <%= button_to 'rating', :controller => 'database', :action => 'getlist', :method => 'post' %> <% $sort="

python - how can I use sympy to add expressions with index -

i have dataframe in pandas, first columns named x0 , second x1 . has many(like 100) rows. have 100 groups of [x0,x1] , , want generate long expression every related 1 group. more clearly, task want generate expression: exp(b0*x00+b1*x10)+exp(b0*x01+b1*x11)+...exp(b0*(x0 100) + b1*(x1 100)) b0 , b1 both unknown value (symbols) here , find solution later on. in brief, need expression sigma(exp(b0*x0+b1*x1)) , sigma has 100 items x0,x1 n dataframe, don't know how program loop. please me. i hope helps, i'm not familiar panda, need summation (f, (i, a, b)) sympy. essentially, need declare expr = summation(exp, (i, 0, 101)) in case, 'exp' function has symbolic b0 , b1 terms inside it. and when want pretty print out, need use pprint(expr) instead of print().

date - Time Formatting? VB.Net -

i have been trying find how make happen if write time format textbox without being current time. so instead of this: if textbox1.text = format(now, "hh:mm") , textbox2.text = format(now, "mm/dd/yyyy") or textbox1.text = format(now, "h:mm") , textbox2.text = format(now, "mm/dd/yyyy") then want detect there time format , date format , can time , date, matters has time , date format. thanks help, thevb10guy use datetime.tryparse(): dim dt datetime if datetime.tryparse(textbox1.text, dt) debug.print("pass") else debug.print("fail") end if

c++ - Visual Studio, interpret address of variable -

i'm testing things on 64-bit system , in visual studio following output code below.. #include <iostream> using namespace std; int main() { int asdf = 32; cout << &asdf; } 00acf88c in gcc -m32 0xfffc1828. differences between these 2 addresses? 0xff same 00? these logical or physical addresses? the address @ variables placed implementation. there's nothing special addresses other that's address compiler , platform decided use store particular integer @ particular time ran program. on system virtual memory addresses can access (unless you're writing kernel's memory management unit) going virtual addresses.

c# - [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection -

i got error after updating mvc framework 5.2.2.0 using nuget [a]system.web.webpages.razor.configuration.hostsection cannot cast [b]system.web.webpages.razor.configuration.hostsection. type originates 'system.web.webpages.razor, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' in context 'default' @ location 'c:\windows\microsoft.net\assembly\gac_msil\system.web.webpages.razor\v4.0_2.0.0.0__31bf3856ad364e35\system.web.webpages.razor.dll'. type b originates 'system.web.webpages.razor, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' in context 'default' @ location 'c:\windows\microsoft.net\framework\v4.0.30319\temporary asp.net files\vs\36d3424f\d8d844c3\assembly\dl3\a0b68557\24516c31_ea0dd001\system.web.webpages.razor.dll'. on web.config <appsettings> <add key="webpages:version" value="3.0.0.0" /> ... </appsettings> <

c# - Assign value to String Property based on integer Property value in Linq query -

i have linq query , , want assign string value string property, in dependent on int property value. have saved int value in database, , want appropriate string value saved integer value. below query.. var data = db.projectsetups.select(c => new projectsetup { projectid = c.projectid, name = c.name, namearabic = c.namearabic, startdate = c.startdate, enddate = c.enddate, date = c.date, stringtype = (c.type.toint32() == 1 ? "development" : "rental").tostring(), stringstatus = (c.status == 1 ? "inprogress" : c.status == 2 ? "completed" : c.status == 3 ? "dividend" : "closed"), landarea = c.landarea, saleamount = c.saleamount }).tolist(); i got below

c++ - Getting a "expected type-specifier" error when I instantiate a custom class in a custom class -

it seems error arises when don't include classes, after checking work seems in order... for sake of brevity created test.h + test.cpp show how code breaking. reason when attempt instantiate class setaslist in test.cpp throws me title's error. commented line of code well thank insight! main: #include <iostream> #include "test.h" using namespace std; int main(int argc, char **argv) { } test.h #ifndef _test #define _test #include "setasoc.h" #include "setaslist.h" using namespace std; class test { public: test(){}; void example(); }; #endif test.cpp: #include "test.h" void test::example() { setaslist *trial = new setaslist::setaslist(); // <-- test.cpp:6:25: error: expected type-specifier } setaslist.h #ifndef _setlist #define _setlist #include <iostream> #include <stdlib.h> #include "set.h" using namespace std; //node dll typedef struct node{ node *previous; node *nex

regex - .htaccesss RewriteRule won't work -

i want rewrite htttp://www.site.ru/company.html?name=bestcompany to htttp://www.site.ru/company/bestcompany.html please suggest wrong. do: rewriterule ^company/([^/]*)\.html$ /company.html?name=$1 [l] cms modx, .htacces in root folder, full .htaccess code: rewriteengine on rewritebase / rewritecond %{http_host} . rewritecond %{http_host} !^www\.site\.ru [nc] rewriterule (.*) http://www.site.ru/$1 [r=301,l] # friendly urls part rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?q=$1 [l,qsa] rewriterule ^company/([^/]*)\.html$ /company?name=$1 [l] rearrange rules this: rewriteengine on rewritebase / rewritecond %{http_host} . rewritecond %{http_host} !^www\.site\.ru [nc] rewriterule (.*) http://www.site.ru/$1 [r=301,l,ne] rewritecond %{the_request} \s/+(company)(?:\.html)?\?name=([^\s&]+) [nc] rewriterule ^ /%1/%2.html? [r=302,l,ne] rewriterule ^company/([^./]+)\.html$ /company?name=$1 [l,nc,qsa]

javascript - How to sort and filter ngTable date (milliseconds) data? -

i pretty new angularjs need sorting date in milliseconds in descending order filter table columns. created plunker here when key in filter param not see filtered data , data lost table. please me in sorting date column , doing case insensitive filter search, below providing code. <table ng-table="tableparams" show-filter="true" class="table" > <tr ng-repeat="item in $data" height="10px"> <td data-title="'date'" filter="{ 'item[0]': 'date' }" sortable="'item[0]'">{{translate(item[0])}}</td> <td data-title="'count'" filter="{ 'item[1]': 'text' }" sortable="'item[1]'">{{item[1]}}</td> </tr> </table> $scope.translate = function(value) { if (value == null || value == undefined) return value; var monthnames = [ "jan", "fe

python - PyQt move vertical scrollbar location in QGraphicsView -

i have qgraphicsview in qtabwidget tabs on left. want move location of vertical scrollbar of qgraphicsview left side, directly underneath tabs. possible? you try setting layout direction on graphics-view: self.view.setlayoutdirection(qtcore.qt.righttoleft)

twitter bootstrap - Prestashop slider settings won't update -

so i've done fresh install of prestashop. version: 1.6.0.9 theme: prestashop default bootstrap theme i'm trying make default slider full width. to this, followed mini tutorial says have un-hook theme configurator in module position section leaving slider , go slider settings , change max-width 1170px. however, every time change of values, max-width , speed or pause , press save, doesn't save? it reverts original default values though states "the settings have been updated." anyone know why values aren't changing? try editing tpl file of slider. first close div tag @ top of tpl file , again open closed divs @ end.

javascript - How show a group label in ng-table? -

anyone knows how create group in ng-table: <div> <div ng-controller="contractscontroller" style="position: relative;background:whitesmoke; border:1px solid lightgray; border-radius:5px; margin-top:0px; margin-bottom:5px; height:330px;"> <button prevent-default ng-click="tableparams.sorting({});tableparams.filter({});" class="btn btn-deufol btn-sm pull-right" style="width:150px;margin: 2px;"><span class="glyphicon glyphicon-th"></span> alle anzeigen</button> <div style="margin-top: 6px;"> gruppieren nach: <select ng-model="groupby" style=" font-weight:bold;"> <option value="vppickup" label="abgeholt">abgeholt</option> <option value="vshier1" label="auftragsnummer">auftragsnummer</option>