Hi all,
I am using eclipse clearcase remote client. Everytime i wish to check out the file, i am going into the long branch.
Is there any way to find a file directly in the root like searching?
Hi,
I'm writing a Maven plugin that merges CSS files together. So all the CSS files that match /foo/bar/*.css might get merged to /foo/merged.css.
A concern is that in a file such as /foo/bar/baz.css there might be a property such as:
background: url("images/pic.jpg")
So when the file is merged into /foo/merged.css this will need to be changed to
background: url("bar/images/pic.jpg")
The recalculated URL obviously depends on 3 factors:
original URL
original CSS file location
merged CSS file location
Assuming that the original and merged CSS files are both on the same filesystem, is there a general formula (or Java library) that can be used to calculate the new url given these 3 inputs?
Thanks,
Don
I am reading a book and I am not sure if its a mistake or I am misunderstanding the quote. It reads...
Nowadays every PC you can buy has
hardware that can render images with
at least 16.7 million individual
colors. Rather than have an array with
thousands of color entries, the images
instead contain explicit color values
for each pixel. A 24-bit display, of
course, uses 24 bits, or 3 bytes per
pixel, for color information. This
gives 1 byte, or 256 distinct values
each, for red, green, and blue. This
is generally called true color,
because 256^3 (16.7 million)
He says 1 byte is equal to 256 distinct values. 1 byte = 8 bits. 8^2 bits = 64 distinct colors right ?? It's not adding up right to me. I know it might be something simple to understand, but I don't understand.
I am reading a book and I am not sure if its a mistake or I am misunderstanding the quote. It reads...
Nowadays every PC you can buy has
hardware that can render images with
at least 16.7 million individual
colors. Rather than have an array with
thousands of color entries, the images
instead contain explicit color values
for each pixel. A 24-bit display, of
course, uses 24 bits, or 3 bytes per
pixel, for color information. This
gives 1 byte, or 256 distinct values
each, for red, green, and blue. This
is generally called true color,
because 256^3 (16.7 million)
He says 1 byte is equal to 256 distinct values. 1 byte = 8 bits. 8^2 bits = 64 combinations of colors right ?? It's not adding up right to me. I know it might be something simple to understand, but I don't understand.
All,
I have the following Zend application structure:
helloworld
- application
- configs
- controllers
- models
- layouts
- include
- library
- public
- design
-- css
-- site.css
-- js
-- global.js
-- images
-- siteheader.gif
-- sitefooter.gif
- .htaccess
- index.php
My .htaccess file in public folder looks like this:
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
My document root points to the "public" folder. Currently, if the user visits a directory level URL, (Ex: http://localhost/design or localhost/css) , my .htaccess file above make sure to show him the "Access Forbidden" page. But if he visits the file level URL, (Ex: http://localhost/design/css/site.css), it shows him the CSS file or the js file or PHP file..
How can I make sure to lock file level access for the above file types, if accessed directly from the URL? Since my application is JS intensive, I want to protect it from users looking at it.
Thanks
I have a file that has 2 columns as given below....
101 6
102 23
103 45
109 36
101 42
108 21
102 24
109 67
and so on......
I want to write a script that adds the values from 2nd column if their corresponding first column matches
for example add all 2nd column values if it's 1st column is 101
add all 2nd column values if it's 1st colummn is 102
add all 2nd column values if it's 1st colummn is 103 and so on ...
i wrote my script like this , but i'm not getting the correct result
awk '{print $1}' data.txt > col1.txt
while read line
do
awk ' if [$1 == $line] sum+=$2; END {print "Sum for time stamp", $line"=", sum}; sum=0' data.txt
done < col1.txt
Im using a couple of JS functions to set a cookie named 'visible' with the value of either yes or no.
Essentially Im using these values to decide if a <div> is visible or hidden.
I've only just added the cookie, previously I had been using two images 1. Show 2. Hide as a button to hide and show the <div> like this:
HTML:
<img class="show" title="Show" alt="Show" src="images/show.png" />
<img class="hide" title="Hide" alt="Hide" src="images/hide.png" />
JQUERY:
$("#tool").click(function() {
$(".help").slideToggle();
$("#wrapper").animate({ opacity: 1.0 },200).slideToggle(200, function() {
$("#tool img").toggle();
});
});
However I have now added the Cookie into the mix:
$("#tool").click(function() {
if(get_cookie('visible')== null) {
set_cookie('visible','no');
} else {
delete_cookie('visible');
}
$(".help").slideToggle();
$("#wrapper").animate({ opacity: 1.0 },200).slideToggle(200, function() {
$("#slider img").toggle();
});
});
So the .toggle() no longer matches the state of the <div>
When the cookie value = no the show.png should be visible
When the cookie value = yes then the hide.png should be visible
Can anyone suggest how i can ammend this?
When converting PSD's into html or even html5 and css, how much more difficult is it to round the corners and make those corners consistent across all browsers especially IE. Assuming the corners were rounded with code not images.
I need the imageid of the images that are stored in photo album. How can i achieve it? I have heard that PLPhotoLibrary helps in fetching the id, but because it is a private framework, app store does not allow it. Please help.
I am using JQuery hover zoom (http://jmar.github.com/jquery-hoverZoom/) Its working fine.
The thumbnails that I have is of different sizes . So I stated using the masonry plugin for arranging it. Both of them work fine when isolated but collectively the masonry plugin doesn't work as intended. Pictures start to overlap each other.
What I feel is that both Masonry and the JQuery hover zoom , interact with the same div element which causes the problem, Both are adding their attributes to it.
How can I fix this ?
Is there some way that I arrange the rows without the masonry? So that the conflict wont occur ?
Hi volks,
I have a XML file with a lot of empty tag attributes. For instance:
<mytag id="">
<ontent>aaa</content>
</mytag>
<mytag id="">
<ontent>bbb</content>
</mytag>
<mytag id="">
<ontent>ccc</content>
</mytag>
Now I want to replace id="" with e.g. id="2443" (id="[linenumber]")
I tried to do this with sed, but I did not get a successful result.
I hope someone here can help me :-)
I have a few images that i need to upload using an online form.
So far here's my code
$info = array('test title','1234','virginia','@'.realpath('e:\wamp\www\1.jpg'),'@'.realpath('e:\wamp\www\2.jpg'),'@'.realpath('e:\wamp\www\3.jpg'),'@'.realpath('e:\wamp\www\4.jpg'),'test description');
$post->postAd($url, $info);
The $info array is processed in the postAd method and it's being sent as an associative array using a method from a Curl class i have (it has been tested and worked nicely with everything i needed to do so far with curl).
The problem is that the data is completed correctly on the form but the images are not uploaded. Can anyone help with advices/code/guidance?
How i change the color of pagination dots of UIPageControl?
In this link the sample code is given.But it shows 3 errors for me...
1'st ERROR:
Line:CGRect currentBounds = self.bounds;
Error:requst for member 'bounds' in something not a structure or union
Method:-(void)drawRect:
2nd Err: same error with same line in touchesBegan method.
3rd Err:@protocol PageControlDelegate
@optional
(void)pageControlPageDidChange:(PageControl *)pageControl;
@end
Error:Expected ')' before 'PageControl' .These are the three errors occurs for me...Please help me out to solve this..
I want to change the pagecontrol indicator(dot) color...
Thanks & Regards,
Renuga
Just got done with "The art of unit testing". It was a great read and i think everyone should go buy a copy. With that said i think the next book I'm like to read would be a architecture / Design type book that would focus heavily on building your objects / software in such a way that it would be:
Low Coupling
High Cohesion
Easily Maintainable / Extended
Easy to test
Easy to Navigate / Debug
The above characteristcs are the most important ones but also maybe it would also include (but not necessary) designing for:
Performance - Don't want to design a system at at the end find out its dog slow :)
Scalability - Again don't want to design something at the end find out it won't scale.
I'd also prefer (but not necessary again):
Something newer - Architectural principles seem to gradually evolve / improve over time and id like something with current thinking.
.Net as illustrating language - like i said above its not mandatory but since its what i use every day id prefer it to be in .net. Doesn't really matter if its in vb.net or c#
Some of the topics that would be talked about its how to minimize dependencies and using interfaces throughout your solution rather than concrete classes. Maybe it would constract /compare some of the newest design principles like DDD, Repository Pattern, Ect...
I already have "Clean Code" (don't know if its this type of book or not) and "Working effectively with legacy code" on my radar but id like to read a book based upon the topic i talked about above first. Is there such a book?
I've done a big mistake, now I have to find a solution. It was my first project working with fluent nhibernate, I mapped an object this way :
public PosteCandidateMap()
{
Id(x => x.Id);
Map(x => x.Candidate);
Map(x => x.Status);
Map(x => x.Poste);
Map(x => x.MatchPossibility);
Map(x => x.ModificationDate);
}
So the whole Poste object is in the database but I would have need only the PosteId. Now I got to find all Candidates for one Poste so when I look in my repository I have :
return GetAll().Where(x => x.Poste.Id == id).ToList();
But this is very slow since it loads all the items, we now have more than 1500 items in the table, at first to project was not supposed to be that big (not a big paycheck either). Now I'm trying to do this with criterion ou Linq but it's not working since my Poste is in a BLOB.
Is there anyway I can change this easyly?
Thanks a lot for the help!
hi everyone......
im new to android development........and i am stuck with a problem......
i am trying to develop an android application that shows the user the location
of atms,hotels etc on a google map....i havent started working on the gps yet.as of now the app works something like this....first of all a map loads on which i intend to show the users current location......on clicking on the menu button there are 3 options.....
-services
-about us
-quit
on selecting services option the following options are available......
-atm
-hospital
-hotel
etc
on selecting the atm option we will be shown a screen displaying some text........
on using the menu for this screen we get the following menu items.....
-sbi
-canara
-hdfc
-icici
etc
my intention is that when the user selects the sbi option a map should load showing the various places where there are sbi atms near where the user is currently......
......i started out with the google map api but i had to quit because when i select one of the menu options,
such as "sbi",the map doesnt load......instead i am getting the error "application failed to load"...basically i was trying to load a map activity from my first map activity......after googling a bit without any results i tried another approach.......i tried to download and view the static map of the location i wanted..it worked.......but when i tried to download
the static map when i select an option like before i get the same error..."application failed to load"...then i tried downloading 2 images from inside onCreate....that worked.......i cannot do the same thing outside the onCreate.....for eg.inside the function for the selected option... i have given the link to my code below.....
if someone can please look into this it would be of great help to me.........i have been sitting with this problem for days now......and its urgent too.......i have done the project in eclipse.......
httpDownload.java --- http://dpaste.com/195981/
I've got a big numpy array full of coordinates (about 400):
[[102, 234],
[304, 104],
....
]
And a numpy 2d array my_map of size 800x800.
What's the fastest way to look up the coordinates given in that array? I tried things like paletting as described in this post: http://opencvpython.blogspot.com/2012/06/fast-array-manipulation-in-numpy.html but couldn't get it to work.
I was also thinking about turning each coordinate into a linear index of the map and then piping it straight into my_map like so:
my_map[linearized_coords]
but I couldn't get vectorize to properly translate the coordinates into a linear fashion. Any ideas?
I was testing my website inside the Android emulator with the Droid Skin (240 dpi). I have the following css:
#container {
position: relative;
width: 854px;
height: 480px;
background: #000;
margin: auto;
}
#container li {
position: relative;
list-style: none;
width: 201px;
height: 110px;
padding-left: 10px;
padding-top:10px;
padding-bottom:10px;
overflow: hidden;
float: left;
z-index: 2;
}
The display is not what I expected obviously because I am defining everything in px (when I should have been using dip but css does not allow dip). How can I convert my px to something that is suitable for Android? Any suggestions?
Whats the simplest way to update the paths of the images after migrating the website from local machine to a live server. Most of the times I end up updating the paths manually. I m convinced that there must be a simpler way which i m missing out on.
Kindly suggest.
I'm working on a string pattern match algorithm. I use NSRegularExpression for finding the matches. For ex: I've to find all words starting with '#' in a string..
Currently I use the following regex function:
static NSRegularExpression *_searchTagRegularExpression;
static inline NSRegularExpression * SearchTagRegularExpression()
{
if (!_searchTagRegularExpression)
{
_searchTagRegularExpression = [[NSRegularExpression alloc]
initWithPattern:@"(?<!\\w)#([\\w\\._-]+)?
options:NSRegularExpressionCaseInsensitive error:nil];
}
return _searchTagRegularExpression;
}
and I use it as below:
NSRegularExpression *regexp = SearchTagRegularExpression();
[regexp enumerateMatchesInString:searchString
options:0 range:stringRange
usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop)
{
// comes here for every match with range
}];
This works properly. But i just want to know if this is the best way. suggest if there's any better alternative...
I have a form with 3 sections in it. Each section has a dedicated div for fairly long contextual help messages regarding the input that has focus.
My question is, if I give each of these help divs a class of "form-tip" and each input that has a tip the class "has-tip", how can I get the tip to always show up in the previous "form-tip" div?
Something like:
$('.has-tip').each(focus(function() {
var tip = $(this).attr('title');
// Find most recent $('.form-tip') in the DOM and populate it with tip
}));
I hope that makes sense... Thanks for any help.
Hello,
My code contain
SELECT * FROM newchap WHERE company LIKE '%$company%' OR Category LIKE '%$cat%'
It works perfectly however, when the field $company contain empty, it return all result in MYSQL.
How to prevent it?
I'm building a program, and I'm quite confident using Objective-C, but I don't know how to programmatically download a file from the web and copy it on the hard drive.
I started with :
NSString url = @"http://spiritofpolo.com/images/logo.png";
NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
But then I don't know what to do with the data... that sucks, no ;)
Can somebody help?