Posts

Showing posts from August, 2012

scheme - If I shadow a buit-in function, how can I recover it? -

take example: (define sqrt (lambda (x) (* 2 (sqrt x)))) (sqrt 2) 2.828427 ... how can call original built-in sqrt procedure without restarting interpreter (or undefine shadowing define)? actually, happens internally when this? built-in overwritten, or 2 procedures coexist in different namespaces? your definition of sqrt cause stack overflow, because recurses itself, not built-in sqrt . :-p anyway, in racket, definition of sqrt affect current module only. possible reimport built-in sqrt under different name, , call module-specific sqrt : (require (rename-in racket/base [sqrt racket-sqrt])) (define sqrt (lambda (x) (* 2 (racket-sqrt x)))) note code won't affect other modules don't import module's sqrt definition; continue use built-in sqrt .

php - What is the best way to display a feed of different media types? -

i've created php file named feed.php designed fetch items mysql database , display them (in news feed style way) on webpage. way i've done involves using 19 if/elseif/else statements - , number growing. in short, these statements decide how information displayed. i'll include code below, quite long , repetitive. <? $con = mysqli_connect("localhost","username","password","database"); if (!$con) { die('could not connect: ' . mysqli_connect_error()); } $query = "select * mainfeed order timestamp desc limit 0 , 1000"; $comments = mysqli_query($con, $query); echo "<h1>recent posts</h1><br><br><hr>"; while($row = mysqli_fetch_array($comments, mysqli_assoc)) { $comment = $row['comment']; $timestamp = $row['timestamp']; $file = $row['file']; $info = pathinfo($file); $info['extension']; $comment = htmlspecialchars($row['

web services - How can I add a a default server Block in Nginx? -

i have several sites configured in nginx , wondering if can include default configuration of them in single server block , include in sites server block. for example if want set security directives common sites, nice if can include in 1 server block rather having modify every sites server block. let me know best possible way tackle this

html - 100% wide Footer, outside main wrap, must extend to bottom of page -

there lots of info footer 100% wide or extend 100% bottom of browser. my problem little different. all content of site wrapped in max-width container. client wants footer 100% wide , if page info short, footer must stretch bottom of page. so have put footer outside main container can go right across width of page. means can't use the html , body {height:100%;} option because making footer 100% high not outside main container. so, ignoring main container, how tell standalone 100% wide footer fill page bottom of browser if page short fill screen top bottom? how footer fill gap on bottom? here simple copy of code: <!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled document</title> <style> #main { height: 100px; max-width: 900px; background-color: blue; margin: auto; } footer { width: 100%; background-color: lightblue; color:

Redirect all tag pages in WordPress using .htaccess -

i trying redirect tag pages in wordpress website blog page using .htaccess. code in .htaccess - redirect 301 ^tag/(.*) /blog/ unfortunately not work, can solution it? redirect directive doesn't use regex, can use redirectmatch instead redirectmatch 301 ^/tag/(.*) /blog/ or redirect 301 /tag/ /blog/

Original domain in periodic triangulation with CGAL -

i have questions regarding periodic triangulation in cgal. 1) according understanding of manual examples ( http://doc.cgal.org/latest/periodic_2_triangulation_2/examples.html ) , reference manual if don't use iso_rectangle in constructing triangles, (0,0,1,1) chosen default value, right? 2) meaning of statement manual? " input point required element of half-open square representing original domain " 3) " another effect when algorithm switches 9-sheeted covering 1-sheeted covering vertex_handles , face_handles referencing deleted items becomes invalid ", mean if have vertex circulator in code, adjacent vertices in periodic boxes, neglected , not displayed in output? 1) yes triangulation_2 (const iso_rectangle &domain=iso_rectangle(0, 0, 1, 1), const geom_traits &traits=geom_traits()) http://doc.cgal.org/latest/periodic_2_triangulation_2/classcgal_1_1periodic__2__triangulation__2.html#a1e9c60f7c9844a33edff96b95aeb6c85 2) insert funct

android - Hide Date and Year from DatePickerDialog -

i have datepickerdialog, want hide year , date fields dialog, possible hide specific field? if possible how can hide? in advance!!! my code below case r.id.ll_date: showdialog(999); break; , dialog @override protected dialog oncreatedialog(int id) { if (id == 999) { datepickerdialog datepickerdialog = new datepickerdialog(mactivity, mydatelistener, curryear, currmonth, currday); return new datepickerdialog(this, mydatelistener, curryear, currmonth, currday); } return null; } private datepickerdialog.ondatesetlistener mydatelistener = new datepickerdialog.ondatesetlistener() { @override public void ondateset(datepicker arg0, int year, int month, int day) { calendar selectedcal = calendar.getinstance(); selectedcal.set(year, month, day); dateformat df = new simpledateformat("mm/dd/yyyy", new locale("en_us&quo

java - How to refer a bean inside "util:list" bean? -

i have bean definitions below <util:list id="mybeanlist"> <bean id="stage1" class="stageclass"/> <bean id="stage2" class="stageclass"/> </util:list> i know if want refer above list, can use <ref bean="mybeanlist" /> but, don't want refer whole list, instead want refer particular bean inside list, "stage1". may <ref bean="mybeanlist$stage1" /> ? is possible refer inner bean this? yes, how do? you can use spring expression language this. <ref bean="#{mybeanlist[0]}" /> however, i'm not sure you'll able access bean's id within list. list not allow access bean id or name (that inherently map kind of pattern). if need by-name access, should consider putting beans in map , expression language should allow access name. here example of how can access elements map bean id. one reference of expression language found th

How to open a new activity on itemclick in gridview.The below code not opening a new activity.Kindly help me -

// final arraylist<string> arr = new arraylist<string>(); arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1,r.id.textview1 ,prgmnamelist); gv = (gridview) findviewbyid(r.id.gridview1); textview1 = (textview) findviewbyid(r.id.textview1); gv.setadapter(new customadapter(this, prgmnamelist, prgmimages)); gv.setonitemclicklistener(new adapterview.onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) { intent intent = new intent(getapplicationcontext(),englishactivity.class); intent.putextra("id",v.getid()); intent.putextra("index",position); startactivity(intent); } }); }

using netbeans 8.1 with MinGW for c/c++ on windows 7 32 bit -

i trying 24 hours compile c++ program facing same issue "build failed" have used mingw , set path variables c:\mingw\msys\1.0\bin; , c:\mingw\bin; faced same issue before running program, have build project , run program situation same same. error message receiving cd 'c:\users\dell\documents\netbeansprojects\cppapplication_1' c:\mingw\msys\1.0\bin\make.exe -f makefile conf=debug "/c/mingw/msys/1.0/bin/make.exe" -f nbproject/makefile-debug.mk qmake= subprojects= .build-conf make.exe[1]: entering directory `/c/users/dell/documents/netbeansprojects/cppapplication_1' "/c/mingw/msys/1.0/bin/make.exe" -f nbproject/makefile-debug.mk dist/debug/mingw-windows/cppapplication_1.exe make.exe[2]: entering directory `/c/users/dell/documents/netbeansprojects/cppapplication_1' mkdir -p build/debug/mingw-windows rm -f "build/debug/mingw-windows/main.o.d" g++ -c -g -mmd -mp -mf "build/debug/mingw-windows/main.o.d" -o build/

c# - Visual Studio not showing IntelliSense descriptions anymore -

Image
since month ago, vs doesn't seem want display summary info in tooltips system methods or classes when hover them mouse. i had resharper installed , started noticing problem. assumed resharper disabled default method descriptions, wasn't thinking further it, considering mere annoyance. after removing resharper though, problem persisted. vs shows descriptions own methods i've added <summary> tag , descriptions nuget packages, not system methods where , encoding.getstring , etc. i've tried repairing vs, resetting settings, un-/checking checkboxes in options > text editor > general, no avail. has had similar problem? this looks more framework issue rather vs/r# issue. if neither 1 of them can load description strings, means description xml files missing. check if see xml files in: c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.5.2 if don't, reinstall framework fix issue. link .net framework

Does Elixir have a variable which holds the name of the current file (ala Ruby’s __FILE__)? -

how in elixir can specify current file being compiled? in ruby, can use __file__ variable. there equivalent in elixir? here script: io.puts “#{__file__}” here output: ** (compileerror) modulesandfunctions-7.exs:3: undefined function __file__/0 (elixir) expanding macro: kernel.to_string/1 modulesandfunctions-7.exs:3: (file) you can use __env__.file

centos - Operation not permitted systemctl with docker + systemctl -

dockerfile from centos:7 env container docker volume ["/sys/fs/cgroup"] run yum -y update run yum install -y httpd run systemctl start httpd.service add . /code workdir /code docker-compose.yml version: '2' services: web: privileged: true build: . ports: - "80:80" volumes: - .:/code command docker-compose build error : step 6 : run systemctl start httpd.service ---> running in 5989c6576ac9 ?[91mfailed d-bus connection: operation not permitted ?[0m?[31merror?[0m: service 'web' failed build: command '/bin/sh -c syste mctl start httpd.service' returned non-zero code: 1 obs : running on windows 7 :( any tip? as explained in centos docker image repository , systemd not active default. in order use systemd, need include text similar example dockerfile below: from centos:7 maintainer "you" <your@email.here> env container docker run (cd /lib/systemd/system/sysinit.target.wants/;

file - How to create folder with PHP code? -

can create folder php code? want whenever new user create new account folder automatically creates , php file created.is possible? purely basic folder creation <?php mkdir("testing"); ?> <= this, creates folder called "testing". mkdir () function on php.net basic file creation <?php $file = fopen("test.txt","w"); echo fwrite($file,"hello world. testing!"); fclose($file); ?> use a or a+ switch add/append file. fwrite() function on php.net edit: this version create file , folder @ same time , show on screen after. <?php // change name below folder want $dir = "new_folder_name"; $file_to_write = 'test.txt'; $content_to_write = "the content"; if( is_dir($dir) === false ) { mkdir($dir); } $file = fopen($dir . '/' . $file_to_write,"w"); // different way write content // fwrite($file,"hello world."); fwrite($file,

java - Implementing a token style security when doing GET requests -

i'm implementing temporary , simple token-style authentication mechanism application. the idea simple. whenever user logs in application, token returned client, stores in sessionstorage data structure of browser. now, whenever request through ajax can send token request , server can verify if token associated authentication or username. if is, parses request normally, if not, error page or initial page returned or displayed. i'm not sure if way token-style authentication , authorization implemented in real or serious applications, i've no idea how send token when doing requests clicking on link of view. my idea intercept requests can fill them token, seems quite odd, , i've lot of links , views. search json web tokens , implementations on java. need. if want send user sensitive data inside jwt, use json web encryption. you can send token on each request header or request parameter

vb.net - Code Behind Client Side Alert -

i previous asked assistance don't think ask right question. new coding & have web app form on has yes/no dropdown & textbox after reason. managed write code behind msgbox need on client side. know it's not complicated thihk. code behind used server side msgbox: protected sub submitbutton_click(sender object, e event args) handles submitbutton.click if criticallist.text = "yes" if textbox13.text <> "" sqldatasource1.insert() response.redirect("formsreport.aspx") else msgbox("if critical, must provide reason.") end if else sqldatasource1.insert() response.redirect("formsreport.aspx") end if end sub can someone, please give me guidance of how write client side alert? preferably in code behind. dim message string = "if critical, must provide reason." dim script string = "<script type='text/javascript'> alert('" + message + "');</script&

How to convert double value to integer value in MIPS? -

if have in mips : li.d $f0,4.5 my question : how convert double value integer value in mips... how can cast value in register $f0 4 ??? here's sequence works. can use $f0 instead of $f2 if want: .text .globl main main: li.d $f0,4.5 cvt.w.d $f2,$f0 # f2 have 4 # print integer mfc1 $a0,$f2 li $v0,1 syscall # exit program li $v0,10 syscall

Shell script can't find other files when launched on login (Debian Linux) -

so have script launched on login via rc.local. script calls few other scripts launched , ran. console says file and/or directories not found. when run script manually after login works fine. have tried add small delay know system logged in. idea why , how fix it? sorry if answer bit vague understand scripts require run via admin privileges. let me elaborate, when system starts runs set of specific scripts , differs distro distro. therefore, i'd check ~/.bashrc /etc/profile.d and importantly ~/.bash_login . see can there. added here ~/.config/autostart worked fine. don't forget create .desktop file. hope helps

java - How to set mouseClicked event? -

i'm trying write program shows me x- , y-coordinates when click left mouse button, doesn't work. console shows me x- , y-coordinates automatically if run program, want see coordination after mouse click. import java.awt.*; import java.awt.event.*; import javax.swing.swingutilities; public class simple { public static void main(string[] args){ mouse maus = new mouse(); maus.mouseclicked(null); } } second file import java.awt.*; import java.awt.event.*; public class mouse implements mouselistener { public void mouseclicked(mouseevent e) { double mousex = mouseinfo.getpointerinfo().getlocation().getx(); double mousey = mouseinfo.getpointerinfo().getlocation().gety(); system.out.println(mousex+" "+mousey); } @override public void mouseentered(mouseevent arg0) {} @override public void mouseexited(mouseevent arg0) {} @override public void mousepressed(mouseevent arg0) {}

jquery - Get combo box selected value -

i have button that, when clicked, should me value of combo box's selected item. example, if have following combo , button: <select id="client-sort-type"> <option></option> <option>name</option> <option>recent</option> </select> <button id="client-sort-submit" type="button">sort</button> i want like... <script type="text/javascript"> $("#client-sort-submit").click(function () { var val = $("#client-sort-type").attr("value"); window.location.href = "project/index/" + val; }); </script> only isn't working, returns nothing. help? use $("#client-sort-type").val()

C# Calling a method -

i have form multiple instances of user control on it. i've assigned following: switch.armyswitchclosebutton.click += armyswitchclose; so when 1 of instances pressed, call following method: void armyswitchclose(object sender, eventargs e) the above method has bunch of additional code in isn't required here. now need button, call above function every instance. how can this? many thanks in constructor of each user control can pass same instance of object knows how run method void armyswitchclose(object sender, eventargs e) then, call method inside each event method, ex: public class usercontrol(){ private makeevent makeevent; public myclass(makeevent makeevent) { this.makeevent = makeevent; switch.armyswitchclosebutton.click += armyswitchclose; } void armyswitchclose(object sender, eventargs e) { makeevent.armyswitchclose(sender,e); } } public class makeevent() { void armyswitchclose(ob

performance - Monitor RabbitMQ nodes via JConsole -

we doing r & d on rabbitmq , activemq, want measure cpu , memory consumption particular mq. for activemq found support jconsole , working expected, unable find out jconsole support rabbitmq. can please give me head test rabbitmq jconsole. if not possible jconsole suggest alternatives. jconsole java tool, rabbitmq written in erlang. in order monitor rabbitmq can use management ui you can enable using: rabbitmq-plugins enable rabbitmq_management the web ui located at: http://server-name:15672/ http api , documentation both located at: http://server-name:15672/api/ (or view our latest http api documentation here). have plugin https://github.com/rabbitmq/rabbitmq-top

Looking for code to implement this simple asynchronous example -

i'm looking simple example of asynchronous code ( preferable in vb .net ) this: main() async sub1() async sub2() await sub1() print "end" end sub1() n=1 1000 { } next end sub sub2() if n=500 in sub1() print "hello" end sub an alternative be: main() async sub1() async sub2() await sub1() print "end" end sub1() n=1 1000 if n=500 send signal { } next end sub sub2() if signal received print "hello" end sub

javascript - How to use filterBy in Vue.js -

i putting simple book sorter app , having trouble using filterby filter. filter works fine filtering non-fiction genre reason not work fiction . want display book titles , authors, , in input field, filter through list of books being displayed genre. if write fiction in input field, should display fiction books. view looks like: <div id="app"> <h1>{{title}}</h1> <div id="input"> <input type="text" v-model="genre" placeholder="search fiction/non-fiction"> </div> <div id="display-books" v-for=" book in books | filterby genre in 'genre' "> <span>title: {{book.title}}</span> <span>author: {{book.author}}</span> </div> </div> and here app.js : var appdata = { title: 'book sorter', filters: &

php - E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 java.lang.RuntimeException: An error occured while executing doInBackground() -

i beginner in programming , want create app display markers on map using coordinates database( hosted 000webhost), using php , json.the map working, there no markers. please me because cannot figure out. this error message get: e/androidruntime: fatal exception: asynctask #1 process: com.kid.compaq.licenta, pid: 24949 java.lang.runtimeexception: error occured while executing doinbackground() @ android.os.asynctask$3.done(asynctask.java:304) @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:355) @ java.util.concurrent.futuretask.setexception(futuretask.java:222) @ java.util.concurrent.futuretask.run(futuretask.java:242)

ruby on rails - Getting something different than standard nesting resources -

i wondering if possible nest resources differently see. usually, resources go this: resources :article resources :comment end and produces url /article/:article_id/comment [for comment#index, of course] however, i'm wondering if differently like /article/comment [excluding :article_id] article have of other normal routes, , comment behave in first example. there way this, keep /comment connected comments_controller, or need relocate of comment methods articles_controller? i'd prefer avoid that, because causes headaches later. **you're asking why i'd ever need in context. truth is, i'm doing in different context, 1 easier explain. edit: the real purpose different example. want controller, 'employee_benefits', regular controller , have regular resources. however, i'd able /employee_benefits/new_type. type of benefit appears in form when creating new employee_benefit. i'd able things /employee_benefits/edit_type[:id], /empl

javascript - Using Promises upon different parts of object -

i'm working on program has main object object called glob,. in first phase of program , need files in folder using async function , assign result files property, i'm using promise: glob.files = new promise (resolve, reject) { asyncfunc(args, function(result) { resolve(result); }); } then, in older phases, need access glob files, need make cpu intensive work, i'm using async.eachlimit limit number of concurrencies, because of this, whole glob become promise: new promise (resolve, reject) { glob.files.then(function(files) { var temporary1 = []; var temporary2 = []; async.eachlimit(files, 5, function(file, callback) { // here // // temporary1.push(file); or temporary2.push(file); }, function(error, files) { // work temporary1 , temporary2 variable here, delete unnecessary pieces , reassign glob.files; // reassign glob.files glob.files = temporary1.concat(temporary2); // resolv

VHDL - Qualified Expression must match the type that is implied for the expression by context -

this question continuation my last question . as mentioned before, i'm trying interface classic hd44780 lcd. have implemented local ram write data wish show on display. the ram defined way (slight change last question): type ram_type array (integer range <>) of std_logic_vector(7 downto 0); signal lcd_mem : ram_type(0 16*2-1); i display bunch of constant characters , number in location on lcd, tried doing writing directly lcd_mem way: lcd_mem <= (0 => x"45", 1 => x"72", 2 => x"72", 3 => x"6f", 4 => x"72", 5 => x"73", 6 => x"3a", 15 => x"30", 16 => x"54", 17 => x"58", 18 => x"3a", 30 => x"4d", 31 => x"3a", others => x"20"); line 79: lcd_mem(22 28) <= get_ascii(1234567); --to_integer(unsigned(n_bits(39 downto 20))) the integer 1234567 later replaced to_integer comment.

nfc - Why is using an RFID's unique ID in generating a MAC insecure? -

came across 2012 post prevent copying nfc chip signal advises: "recommend against using tag's unique id security feature." why, other reasons stated below, security problem use unique id part of message generates message authentication code (mac)? my application use rfid transponder's 8-byte fixed unique id, portion of rfid's 100s of data bytes , random data* derive mac. mac used authenticate tag's message . the primary reason incorporating unique id mac prevents simple copy of tag's message , mac tag not yield legitimate mac. the mac needs of sufficient size, with/without id. mac size target: 512 bits (32 bytes). known issues: a direct copy of entire tag's data , id , ported tag simulator, can generate id, ready known risk , using id not help. mac variation depends solely on id variation (the other data same), may break mac. additional random data added. 4 bytes of random data insure, should data content repeated, varia

Rails 4 - Nested Resources -

user has_many tickets . ticket belongs_to user ( ticket.user_id ) routes.rb resources :users resources :tickets end rake routes user_tickets /users/:user_id/tickets(.:format) tickets#index users/index.html.erb <%= link_to("view user's tickets", user_tickets_path(user)) %> users_controller.rb private def set_user @user = user.find(params[:id]) @tickets = @user.tickets end tickets_controller.rb def index @search = ticket.search(params[:q]) @tickets = @search.result.paginate(:page => params[:page], :per_page => 25) render 'shared/tickets.html.erb' end when hover on link, shows .../users/[the selected user's id]/tickets when goes ticket/index page, shows tickets, not tickets selected user's id. i'm pretty sure route incorrect, or may else entirely. appreciated. edit i think problem need call @tickets in tickets_controller/index method variety of ways, because want use view @tickets.all , @u

javascript - Function doesnt see parameter as a array of objects -

i´m having troubles array of objects parameter function. real codes: function drawtable(x,y,numero,t,e) { context.fillstyle = "#ffff66"; context.fillrect(x*146,y*146,55,55); var color; if (e[numero].tocado == "rojo") { color = "#cc3300" } else if (e[numero].tocado == "azul") { color = "#0099ff"; } else { color = "#66ff66"; } context.fillstyle = color; if (t==0 && x < 4) { context.fillrect((x*146)+55,(y*146)+9,91,39); } if (t==1){ context.fillrect((x*146)+9,(y*146)+55,39,91); } if (x==4) { if (y<4) { if (t==1) { drawtable(0,y+1,numero+1,0,e); } else { drawtable(0,y,numero,1,e); } } } else { drawtable(x+1,y,numero+1,t,e); } return; } socket.on("start", function (data) { game = data; dr

c# - Save CheckBox state to xml -

my application form based application, having multiple textboxes can filled. textboxes optional , checkbox included toggle if should included. now save progress of form can opened later further editing. saving file .xml . saving textboxes have no problem with, best way save state of checkboxes .xml file, can loaded later? i can use - string s = bool.tostring(); . work when working lot of checkboxes can become long process. have class handles saving of .xml file. there way add more 1 checkbox list parse "true/false" value class array of bool[] ? checkbox-state nothing else boolean? -> nullable bool. can simple serialize using xmlserializer or write manually file: string s = checked.tostring(); and parse it: bool checked = boolean.parse(s)

inheritance - Python -- polynomials in finite fields. Why does only __add__() work with super() in this case? -

i'm trying use parent class's __div__() in order maintain same type many operations can called @ once in last example mix1 = bf2/bf4*bf1%bf5 in main() below multiple arithmetic operations strung together. reason, can use super() in __add__() not in __div__() . error "indexerror: list index out of range" , i've been going on , on without progress. note related polynomial arithmetic within finite field. i'm including parsepolyvariable() , it's dependents (sorry if looks there's bit of code assure it's cause , builds character), since that's list error seems stemming can't life of me figure out going wrong. i'm teaching myself python, i'm sure there other beginners out there see i'm missing obvious. i've been looking on these don't seem related situation: http://docs.python.org/2/library/functions.html#super python super(class, self).method vs super(parent, self).method how can use python's super(

java - render the param-value of the web.xml in the initpage.jps file -

i trying render para-value using configuration in web.xml file in web-inf directory getting the default user servlet config is: rendered (without parm value of web.xml file). can explain me error is? initpage.jps <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <body> default user servlet config is: <%getservletconfig().getinitparameter("defaultuser");%> </body> </html> web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.su

linux - How to check if the file is downloaded with curl -

i writing shell script, need download 6 files internet, in script have done curl curl b curl c , on it works, curl: (7) couldn't connect host files in middle of script example, download miss file b above error , download file c. catch error code execute successful download of files. you chain them && ... curl --fail && curl --fail b && curl --fail c... update : @nwk pointed out below, need add --fail make curl fail on bad http codes.

tfs2012 - TFS 2012 Build Definition for web deployment ignores parameters defined in project files -

i'm trying set tfs 2012 build definition build solution , deploy several web apps within solution. came across this article seems address i'm trying , seems agree solution mentioned here . so tried implementing build definition/project configuration described in article, no matter do, seems ignoring parameters put in specific configuration property group of csproj files this: <propertygroup condition=" '$(configuration)|$(platform)' == 'myconfig|anycpu' "> ... <deployiisapppath>my website name</deployiisapppath> <msdeployserviceurl>mywebserver</msdeployserviceurl> </propertygroup> i following error each project i’m trying deploy: web deploy publish/package validating error: missing or invalid property value $(msdeployserviceurl) so tried defining msdeployserviceurl in msbuild arguments of build definition instead of in csproj files. solved above error, error: the “concatfullserviceurlwithsiten

sql - Inserting row via stored procedure (Informix) -

is possible create stored procedure inserts row table values taken procedure parameters? i'm using informix. :-( show how creating procedure , executing. the example give on comment question works: [infx1210@tardis ~]$ dbaccess pavle - database selected. > create table tab1( > col1 varchar(8), > col2 integer, > col3 integer > ); table created. > create procedure sp1 (a varchar(8), b integer, c integer) > insert tab1 (col1,col2,col3) values (a,b,c); > end procedure; routine created. > execute procedure sp1 ('test sp1',1,2); routine executed. > select * tab1; col1 col2 col3 test sp1 1 2 1 row(s) retrieved. > database closed. [infx1210@tardis ~]$ on squirrel have change statement separator else temporarily. go file menu , select new session properties , go sql tab , change statement separator \ . connect again , try: create procedure sp1

PHP unable to get ENV variable set by Vagrant -

i have seen few posts , solutions here, far none of them seem work me. i'm using vagrant 1.8.1 on windows 7 64-bit env plugin installed , enabled config.env.enable in vagrantfile. [update] i'm perhaps doing wrong or missing something? i trying set string=123abc kind of environment variable. started inline provisioning in vagrantfile: config.vm.provision "shell", inline: <<-shell echo "export my_svr_host=192.168.33.10" > /home/vagrant/.profile shell i tried source /home/vagrant/.profile underneath (after echo) did not work.. i tried adding source line provisioning file (bootstrap.sh) also (in bootstrap file) tried vagrant ssh && source /home/vagrant/.profile && exit did not work either. note, there line in bootstrap file restarts apache. i tried set var = value in php.ini file ; arbitrary, set host ip vagrant vm_host_ip=192.168.33.10 that did not work. tried (in httpd.conf) add setenv vmhostip "192.168

html - CssClass="table table-striped" change transparent strip to blue -

i import twitter classes when use table stripped shows me 1 white , 1 transparent, want transparent change gray, way achive that. regards look below section in bootstrap.css , replace background-color of choice .table-striped > tbody > tr:nth-child(odd) > td, .table-striped > tbody > tr:nth-child(odd) > th { background-color: #999; /*change color here*/ }

c# - Why don't I get an EF5 Concurrency Error? -

Image
in database i'm working on company keeps track of order numbers each regional office. have table named [company] has single record each regional office. table has field holds next available order number office. orders created in single [order] table. realized possible more 1 user @ given office ask new order @ same time. have set optimistic concurrency. [company] table has column named rowmodtracker used concurrency purposes (see images @ bottom properties in ef , sql). in code below, record regional office, increment field has order number , put copy in local variable. save off table. expect if 2 users hit method @ same time first user save off valid order number. expect second user save off optimistic concurrency error , null should returned (which causes prompt asks them try again). users tell me few times in last 8 months have indeed gotten orders same order number. no messages , no errors happen until later in process when go save order , unique constraint on order n

wdk - AddPrinterDriverEx fails if pscript5.dll not in root drivers folder -

i've got code install post-script based virtual printer port monitor (for printing pdf). code works fine on x86 , x64 platforms winxp win7, unless pscript5 set of files isn't in "root" drivers folder. on few of test pcs files there, on newer win7 pc have files not there. for example, since know above clear mud, on windows xp 32-bit, if these files: ps5ui.dll pscript5.dll pscript.hlp pscript.ntf are located in c:\windows\system32\spool\drivers\w32x86\, code works. if aren't, code fails. files in c:\windows\system32\spool\drivers\w32x86\3\, , outcome same (apparently windows doesn't in "3" sub-folder). do need copy them 3 sub-folder -- others doing? doesn't seem "good practice" reason. according this on msdn , can maybe redistribute files, need contact microsoft guess, , can't figure out how (links weird, typical). this (cleaned up) code runs on win7 64-bit (32-bit uses "windows nt x86" instead of "w

arrays - ordering keys from Javascript object -

i saw this topic , answers, doesn't seem work me. tried alll variants of values in object , sort, doesn't seem work. want list ordered on keys (not values) in objects (the, in example 2 objects in in json): d3.json: { "test1": {"purchase": ["yes", 2], "safety": ["no", 3], "quality": ["carried husk", 1], "name": ["eggs!", 0]}, "test2": {"purchase": "yes", "safety": "no", "quality": "carried husk", "name": "0"} } and javascript: d3.json("d3.json", function(root) { (key in root) { console.log(root[key]); var test = root[key]; var list = object.keys(test).sort(function(a,b){ return test[a]-test[b] }) console.log(list); } }); edit: apologies, wasn't clear on expected results: looking keys sorted, return values answer of dlopez did.

view - Making distant object always appear larger in OpenGL without recalculating vertex positions -

http://i.imgur.com/fvuxgdj.jpg i rendering 3d scene needs have viewing angle same of human eye, however, need objects distant appear larger in scene. say had long, narrow rectangular prism above camera extending distance. prism appear large close user, taper of distance, becoming thin, pixelated line. trying prevent. want way make prism taper of more slowly, more of length visible, without expanding part close user. current solution split many every growing rectangular prisms go off distance, approach computationally costly. is there way can manipulate system make distant objects appear larger, without changing view angle, i.e. without 'zooming in' on scene? key scene must not appear distorted. should if distance objects have grown. i not sure avenue take achieve goal. original thoughts manipulations of view matrix, recognize that may not help. clarification , more drawings available upon request. you seem looking non linear projection (not strai

php - file_get_contents fails to get a link with some perso-arabic characters -

this link works ok when open in browser but when this $link = 'http://www.bama.ir/خريد-خودرو/?ac411129-3-0-0-0-0-0-900000000-1/کادنزا-كیا'; echo file_get_contents($link); i ( ! ) warning: file_get_contents(http://www.bama.ir/خريد-خودرو/?ac411129-3-0-0-0-0-0-900000000-1/کادنزا-كیا): failed open stream: http request failed! http/1.1 404 not found in i think it's becuz of characters @ end of link (it works ok if replace them latin characters ) is there urlencode function file_get_contents ? ----------------- edit -------------------------- $link = urlencode('http://www.bama.ir/خريد-خودرو/?ac411129-3-0-0-0-0-0-900000000-1/کادنزا-كیا'); echo file_get_contents("$link"); result warning: file_get_contents(http%3a%2f%2fwww.bama.ir%2f%d8%ae%d8%b1%d9%8a%d8%af-%d8%ae%d9%88%d8%af%d8%b1%d9%88%2f%3fac411129-3-0-0-0-0-0-900000000-1%2f%da%a9%d8%a7%d8%af%d9%86%d8%b2%d8%a7-%d9%83%db%8c%d8%a7): failed open stream: no such file or directory in