How do I make a textbox read only in mvc? I have included the following snippet, but it`s not working.
<%=Html.Textbox("test", "test", new { style="border: 0px; width:280px" ;readonly=true}%>
Hey guys,
So, I followed Apple's instructions to capture video session using AVCaptureSession: http://developer.apple.com/iphone/library/qa/qa2010/qa1702.html. One problem I'm facing is that even though the orientation of the camera / iphone device is vertical (and the AVCaptureVideoPreviewLayer shows a vertical camera stream), the output image seems to be in the landscape mode. I checked the width and height of imageBuffer inside imageFromSampleBuffer: of the sample code, and I got 640px and 480px respectively. Does anyone know why this's the case?
Thanks!
i have this script
<select>
<option value="1">one<img src="star.gif" height="15" width="15"></img> </option>
</select>
but it doesn't work.
how can i put an image into select?
thanks
update:
so it's impossible?:(
I'm using Windows 7 on a PC and connect to it via Remote Desktop Connection for Mac by MS, using a Mac. On the Mac, I have a 27" Display with 2560 x 1440 px resolution. The PC has a high performance graphics card (one of those that needs an additional power supply). Both machines are connected via network cable to a router. So network should be insanely fast.
However, the max resolution I can get is 1400 x 1050. The PC just has a old and bad 21" monitor connected to it.
How can I increase the resolution to 2560 x 1440 to work fullscreen with the Apple LED Cinema Display via Remote Desktop?
Maybe I shouldn't even ask, because I already experience some lag at the low resolution of 1400 x 1050. But I guess this can be resolved as well?
I am running a Squid (3.1) cache in front of Django. The content of the site does not change very often, so Squid gives our backend much needed breathing room.
Currently, this is the refresh pattern that we are using to cache the content:
refresh_pattern . 60 100% 60
We basically want to cache everything for at least an hour (and only an hour) before Squid then re-validates the content.
My question is on the "100%" parameter, which sets the lm-factor.
I'm not sure if setting that to 100% is doing what we want it to. The assumption was that by setting it to 100%, it would ensure that objects stay in the cache for the max cache time.
Is this an incorrect assumption?
What are the best practices that one should follow when setting up a refresh pattern like this?
Hi,
i am trying to find how can i "detect" width JavaScript if i am ih http or https environment
I am calling ajax request so if i am in https and call http ajax i get 302 Moved Temporarily
I was thinking of get the current window.location.href and do a strinh manipulation
Any suggestion is welcome.
I am having trouble creating a different image to appear when you place your curser over the original image. Heres my code without the rest of my listed buttons:
<nav class="buttons">
<ul>
<li class="left">
<a class="home" href="www.google.com">
<img src="img/Home_2.png"></a></li>
</ul>
</nav>
Css:
.buttons img{width: 190px; margin:0px; padding:0px; margin:0 auto; margin-top:55px;}
.buttons ul{list-style-type: none; margin:0px; padding:0px}
.left{float:left}
.home:hover {background: url(../img/Home_crack.PNG)}
Any suggestions?
EDIT: Okay great suggestions, however when I hover over the "home button" now the stuff in the float tweeks out. Heres the code with the full float properties:
HTML:
<nav class="buttons">
<ul>
<li class="left">
<a class="home" href="www.google.com">
<img src="img/Home_2.png"></a></li>
<li class="left">
<a href="www.google.com" class="menu">
<img src="img/Menu_2.png"></a></li>
<li class="right">
<a href="www.google.com" class="about">
<img src="img/About_2.png"></a></li>
<li class="right">
<a href="www.google.com" class="contact">
<img src="img/Contact_2.png"></a></li>
</ul>
</nav>
CSS:
.buttons img{width: 190px; margin:0px; padding:0px; margin:0 auto; margin-top:55px;}
.buttons ul{list-style-type: none; margin:0px; padding:0px}
.left{float:left}
.home:hover img{display:none}
.home:hover {background: url(../img/Home_crack.PNG);}
.right{float:right}
Basically i wanted to separate 4 buttons.... one in the left float and one in the right float, then on the hover, the buttons would change to a different image....With the new img{display:none} the left float rapidly flashes.
With VIM or Emacs I can put comments in the file that will be VIM's settings for that file:
/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* c-indentation-style: linux
* indent-tabs-mode: nil
* default-tab-width: 8
* fill-column: 125
* End:
*
* vim: et:sw=4:ts=8:si:cindent:cino=\:0,g0,(0:
*/
Can the same be done with Nedit?
After adding the new facebook like button to my page, it no longer validates using XHTML strict. The two errors I come across are:
All of the "meta property" tags say that "there is no attribute "property""
All of the variables used in the like button line are listed that there are no attributes for it. The line is as follows:
<fb:like href="http://www.pampamanta.org" layout="button_count" show_faces="false" width="120" action="like" font="arial" colorscheme="light"></fb:like>
I create array:
TextBox[] textarray = new TextBox[100];
Then in cycle set this params, all items array situated in uniformGrid1
textarray[i] = new TextBox();
textarray[i].Height = 30;
textarray[i].Width = 50;
uniformGrid1.Children.Add(textarray[i]);
How create events Click or DoubleClick that all items array?
Sorry my English.
Hi,
I am using rich:extendedDataTable to display a table. But i need to disable the column resizing in this table. I have tried using width component in rich:column but i am getting the same thing. Even I have used css class to fix the column size that is also nnot worth. Can any one help me to find a way out............Its urgent !!
YSlow keeps on telling me files like http://www.example.com/wp-content/plugins/q-and-a/css/q-a-plus.css?ver=1.0.6.2 are not gzipped while the gzip test tool at Feed the Bot mentions I am all good:
Compressed? Yes
Compression type gzip
Page size (Bytes) 32,493
Compressed size (Bytes) -1
Saving (Bytes) 32,494
Compression % 100%
I added this to my .htaccess:
# Gzip
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
#Deflate
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
The header for the file mentioned states:
CF-Cache-Status MISS
CF-RAY 13945df90a9a0c1d-AMS
Cache-Control public, max-age=2592000
Connection keep-alive
Content-Encoding gzip
Content-Type application/javascript
Date Thu, 12 Jun 2014 07:34:38 GMT
Expires Sat, 12 Jul 2014 07:34:38 GMT
Last-Modified Thu, 21 Feb 2013 01:29:18 GMT
Server cloudflare-nginx
Transfer-Encoding chunked
Vary Accept-Encoding
Any ideas what I am missing here?
I'm busy with HTML and CSS and got stuck with this.
I have created a button with :hover and :active options, which is centered on the page. Clicking on this button needs to lead to a website.
My HTML is:
<div>
<a href="website"><div id="button">Text</div></a>
</div>
The CSS is:
body, html {
height: 100%;
}
a {
text-decoration: none;
}
#button {
text-transform: uppercase;
font-size: 18px;
text-align: center;
padding: 1em 0.5em 0.8em;
background-color: white;
font-family: Myriad Pro, Source Sans Pro, Helvetica, Arial, sans-serif;
color: #ff4700;
cursor: pointer;
width: 150px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #ff4700;
margin-left: auto;
margin-right: auto;
margin-bottom: 50px;
-webkit-transition: all .1s ease;
-moz-transition: all .1s ease;
-ms-transition: all .1s ease;
-o-transition: all .1s ease;
transition: all .1s ease;
}
#button:hover {
background-color: #ff4700;
color: white;
border: 1px solid white;
}
#button:active {
background-color: #cc3900;
}
The problem lies in the fact that the whole width of the page is clickable at the height of the button and not only the button itself that is 150px wide and is centered on the page.
I think I have my divs mixed up and it needs other formatting and precedence, but I'm not sure. Thanks for your help!
P.S. First time on StackOverflow, sorry if I formatted something wrong.
I'm doing a traceroute from my box to ....say.... stackoverflow.com. I see a couple of instances where there are multiple ip's on one line. For instance, in below, line #2 has two IPs: 10.1.6.5 and 10.1.4.5
Also on line #4, there are two timestamps after 216.182.236.96: 0.653 ms and 0.637 ms
What are these? This is on Linux
Traceroute example:
traceroute to www.stackoverflow.com (198.252.206.16), 30 hops max, 60 byte packets
2 ip-10-1-6-5.us-west-1.compute.internal (10.1.6.5) 0.329 ms 0.425 ms ip-10-1-4-5.us-west-1.compute.internal (10.1.4.5) 0.471 ms
4 216.182.236.104 (216.182.236.104) 0.554 ms 216.182.236.96 (216.182.236.96) 0.653 ms 0.637 ms
5 205.251.230.64 (205.251.230.64) 0.616 ms 205.251.229.232 (205.251.229.232) 1.305 ms 205.251.230.64 (205.251.230.64) 0.573 ms
I'm starting out in HTML and CSS.
I have a div element on the page, which doesn't fill the whole page.
In it- there's a ul element and some list items in it.
I want to put the list 227px from the top of the div element, but I can't manage to accomplish this- it pushes it more.
Also- between the list items I want a margin of 40 pixels, but it also does more.
What's the problem?
Here's my code:
Html:
<body>
<div class="Hashta">
<div class="Menu">
<ul id="MenuItems">
<li><a href="#" >ONE</a></li>
<li><a href="#" >TWO</a></li>
<li><a href="#" >THREE</a></li>
<li><a href="#" >FOUR</a></li>
</ul>
</div>
</div>
</body>
CSS:
body {
background-color: Gray;
}
.Hashta{
width:874px;
height:650px;
background-color:black;
margin: auto auto 50px auto;
border-radius: 20px;
border: 3px solid darkgray;
moz-box-shadow: 2px 2px 10px black;
webkit-box-shadow: 2px 2px 10px black;
box-shadow: 2px 2px 10px black;
}
.Menu {
margin-top: 227px;
padding-right: 50px;
float:right;
}
#MenuItems {
list-style:none;
}
#MenuItems li {
text-align:center;
position:relative;
padding: 4px 10px 4px 10px;
margin-right:30px;
margin-bottom: 40px;
border:none;
}
#MenuItems li a{
width: 280px;
height: 70px;
background-color: green;
color:White;
font-family:Arial, Helvetica, sans-serif;
font-size:24px;
display:block;
outline:0;
text-decoration:none;
text-shadow: 1px 1px 1px #000;
line-height: 70px;
}
If you want to measure the pixels- you can install this: http://www.mioplanet.com/products/pixelruler/
(click to rotate)
Thanks!
I don't know why I'm experiencing so much trouble with this, but I would like to have an array that basically represents a layer number and x,y coordinates so I could essentially say,
int i = array[layer,x,y] and get the corrisponding value per layer. I create the array..
int[,,] myarray
...initialize it
myarray = new int[0,width, height];
...and it blows up when try and grab a value.
int n = myarray[0,1,1]
What am I missing?
How to get a sidebar JPanel of a fixed with with Swing. Now I'm trying this:
public SidebarPanel() {
this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
this.setPreferredSize(new Dimension(200, this.getPreferredSize().height));
...
But when I resize the window also the width of the sidebar changes. How to fix this?
I have an html textarea that is of fixed width, but variable height. I would like to set overflow:scroll and be able to show a vertical scrollbar, but not a horizontal one. I am not able to use overflow:auto due to other things specific to my situation.
I know there is no way using CSS 2 to show only vertical but not horizontal scrollbars. Is there anything I can do with javascript to hide the horizontal scrollbar?
In sproutcore I'm trying to change the border thickness of a div when a user mouses over it. All the other code is working but I can't find how to either access the css properties directly or attach a new classname to the div.
borderDiv: SC.View.design({
layout:{top:60, left:60, width: 400, height: 525},
classNames:"panel",
mouseEntered: function(evt) {
alert("this is working");
//
// No idea what to put here to change css properties
//
return YES
}
})
Hi all, i want to ask that, is it possible to show any part of image in img tag (with pixels) via Javascript.
I mean, i'll prepare a big image (e.g. 32x320 pixels) and i'll define starting position (X,Y , e.g. 0,32) and width/height (e.g. 32,32), so script will show second (32x32 pixel) part of main image..
I hope i can explain.
Thanks right now..
I have a pretty vanilla setup with Apache2, FastCGI setup as DSO and serving PHP through an external CGI script that sets the max children / serves the request to PHP.
The issue is FastCGI doesn't appear to be creating the PHP sockets / pooling them so each request calls the php-cgi binary, then dies off .. effectively making the reason I want to use FastCGI moot.
The only configuration directives I have are:
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/fcgi.cgi
FastCgiIpcDir /usr/local/apache2/fastcgi
The dyanmic/ directory is getting created as anticipated, but there are no sockets in there. Permissions are indeed correct.
Any help would be greatly appreciated, thanks!
When you unplug an external monitor with a higher resolution that your macbook from your laptop, the windows mostly retain their width, but their size gets clipped to the (smaller) height of the macbook screen. When you plug the monitor back in, their size remains frustratingly small.
My question is: is there any way that I can iterate over all open windows, save their size, and restore them once the monitor gets plugged in again?
Im trying to provide gzip compression using varnish cache. But when I set content-encoding as gzip using my below mentioned configuration for varnish (default.vcl). Browser failed to download those content for which i set content-encoding as gzipped.
Varnish configuration file:
backend default {
.host = "127.0.0.1";
.port = "9000";
}
backend socketIO {
.host = "127.0.0.1";
.port = "8083";
}
acl purge {
"127.0.0.1";
"192.168.15.0"/24;
}
sub vcl_fetch {
/* If the request is for pictures, javascript, css, etc */
if (req.url ~ "^/public/" || req.url ~ "\.js"){
unset req.http.cookie;
set beresp.http.Content-Encoding= "gzip";
set beresp.ttl = 86400s;
set beresp.http.Cache-Control = "public, max-age=3600";
/*set the expires time to response header*/
set beresp.http.expires=beresp.ttl;
/* marker for vcl_deliver to reset Age: */
set beresp.http.magicmarker = "1";
}
if (!beresp.cacheable) {
return (pass);
}
return (deliver);
}
sub vcl_deliver {
if (resp.http.magicmarker) {
/* Remove the magic marker */
unset resp.http.magicmarker;
/* By definition we have a fresh object */
set resp.http.age = "0";
}
if(obj.hits > 0) {
set resp.http.X-Varnish-Cache = "HIT";
}else {
set resp.http.X-Varnish-Cache = "MISS";
}
return (deliver);
}
sub vcl_recv {
if (req.http.x-forwarded-for) {
set req.http.X-Forwarded-For =
req.http.X-Forwarded-For ", " client.ip;
} else {
set req.http.X-Forwarded-For = client.ip;
}
if (req.request != "GET" &&
req.request != "HEAD" &&
req.request != "PUT" &&
req.request != "POST" &&
req.request != "TRACE" &&
req.request != "OPTIONS" &&
req.request != "DELETE") {
/* Non-RFC2616 or CONNECT which is weird. */
return (pipe);
}
# Pass requests that are not GET or HEAD
if (req.request != "GET" && req.request != "HEAD") {
return(pass);
}
#pipe websocket connections directly to Node.js
if (req.http.Upgrade ~ "(?i)websocket") {
set req.backend = socketIO;
return (pipe);
}
# Properly handle different encoding types
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|js|css)$") {
# No point in compressing these
remove req.http.Accept-Encoding;
} elsif (req.http.Accept-Encoding ~ "gzip") {
set req.http.Accept-Encoding = "gzip";
} elsif (req.http.Accept-Encoding ~ "deflate") {
set req.http.Accept-Encoding = "deflate";
} else {
# unkown algorithm
remove req.http.Accept-Encoding;
}
}
# allow PURGE from localhost and 192.168.15...
if (req.request == "PURGE") {
if (!client.ip ~ purge) {
error 405 "Not allowed.";
}
return (lookup);
}
return (lookup);
}
sub vcl_hit {
if (req.request == "PURGE") {
purge_url(req.url);
error 200 "Purged.";
}
}
sub vcl_miss {
if (req.request == "PURGE") {
purge_url(req.url);
error 200 "Purged.";
}
}
sub vcl_pipe {
if (req.http.upgrade) {
set bereq.http.upgrade = req.http.upgrade;
}
}
Response Header:
Cache-Control:public, max-age=3600
Connection:keep-alive
Content-Encoding:gzip
Content-Length:11520
Content-Type:application/javascript
Date:Fri, 06 Apr 2012 04:53:41 GMT
ETag:"1330493670000--987570445"
Last-Modified:Wed, 29 Feb 2012 05:34:30 GMT
Server:Play! Framework;1.2.x-localbuild;dev
Via:1.1 varnish
X-Varnish:118464579 118464571
X-Varnish-Cache:HIT
age:0
expires:86400.000
Any suggestion on how to fix it and how to provide gzip compression using varnish.
Hello!
How to get FontMetrics without use Graphics ? I want to get FontMetrics in constructor, now I do this way:
BufferedImage bi = new BufferedImage(5, 5, BufferedImage.TYPE_INT_RGB);
FontMetrics fm = bi.getGraphics().getFontMetrics(font);
int width = fm.stringWidth(pattern);
int height = fm.getHeight();