Jump to content

murfy

Members
  • Posts

    47
  • Joined

  • Last visited

murfy's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I would like to have a very simple protractor to users, to help to measure angle on a photo. I am apparently very JS beginner but maybe somebody can help? Let's have an image with television and imaginative blue axis x which will not be visible in the JS tool, but it helps me to explain how the tool should work. I would like to measure some angle for example in the profile view, and I will draw the red line and blue angle to show you which angle I want to measure. Now as the description shows, you should need to do two clicks. One to show the initiate point, the second to show the ending point. The angle that should be measured would be alpha. You would just twice click and it would calculated the angle referenced to the horizontal axis and show it somewhere outside the image. Could anybody do this? Additional and voluntary opinion would be to display the angle during you move the mouse cursor just after first click, when you are trying to find the correct point so you would not need to click, but also to show the red line between starting point and the mouse cursor xy position. Use of the protractor, for example if user uploaded photo, but he needs to rotate it and does not know how much. So he would measure it and then I can use php code to fix the rotation of the photo :-)
  2. HI, problem fixed. Thanks
  3. I have this example code: http://paste.ofcode.org/rc4f3z38S2Vr8VxbX3SvNU You have some png image where you want to calculate an average hue or average color in red colors. For example a clipart of lips which contains three colors: normal red, light red and dark red alias brown. I have the colors in the array $mycolors. Now I would like to calculate the average in this colors so I used a class Lux_Color to convert to HSL color space, then sum the HSL values of colors and then calculate the average. But the result for me is incorrect and I got cyan color, not red or brown as I would expect. Any idea what's wrong? $mycolors = array(array(255,0,0),array(255,126,126),array(86,13,0)); $hsl_colors = array(); $average_color_hsl = array(0,0,0); $lux = new Lux_Color(); for($n=0; $n<count($mycolors); $n++): $hsl = $lux->rgb2hsl($mycolors[$n]); // returns 0 => Hue, 1 => Saturation, 2 => lightness $average_color_hsl[0] += $hsl[0]; $average_color_hsl[1] += $hsl[1]; $average_color_hsl[2] += $hsl[2]; $hsl_colors[] = $hsl; endfor; $average_hue = $average_color_hsl[0]/$n; $average_RGB = $lux->hsl2rgb($average_color_hsl); $average_color = $lux->rgb2hex($average_RGB); die("$n : $average_hue : $average_color");
  4. Is there a way to get alpha channel value with input values x,y into integer? Any method for high performance and without generating arrays? Also I want to ask you about the following command, which seems to be a mysthic for me. $rgb = imagecolorat($im, $x, $y); $c = imagecolorsforindex($im, $rgb); They used to use two commands to get array of rgba, instead one command that would return rgba type of integer... Why? Why so complicated? And also - it is not clear to me -> how can imagecolorsforindex() work when it misses the x, y values and $rgb misses x,y values too?! That makes no sense! But I would like to see some command to do it in the way like this: $rgba = imagecolorsat($im, $x, $y); $a = $rgb & 255; $b = ($rgb >> & 255; $g = ($rgb >> 16) & 255; $r = ($rgb >> 24) & 255; Without need to call two functions and generating arrays... Any better solutions?
  5. Hello, can you help to fix this user menu? http://t24.4fan.cz/ There is problem with the submenu. When you go with mouse over the first ul, then the submenu ul is displayed and it needs to move downwards cca +5 px. I tried to position it absolutely, but it does not work. When I make top:3px; in #menu ul li ul, no effect.
  6. I am not a businessman hence I am not planning to do commertial project.
  7. I believe it can simply happen that there will be hundrets of page views per day. My page should be dating site, peaple who will click on sections of adds and profiles, can make for example 40-80 clicks for one person per day. It is just estimation. But I believe, there will be at least 10-20 peaple online per day, so this would result up to 80x20 clicks per day, which is 48000 clicks per month. For 50 kb per page I have 2,288 Gbyte... But I did not calculate with posibility to have photos on profiles and view them. So if one photo has eg 120 kb. It could go up. Also my site is going to be international for 3 Countries in middle Europe. This could increase the visits. Then I think bots like google, and spam bots could come, i know they like to go do but they probably do not load css files and images.
  8. Is there some site where one could upload custom css file (something like free hosting, which rules permits you to refer to this file directly like with the html style tag? <style type="text/css" media="all">@import "www.hostmycss.com/CSS/012345/main.css";</style> To have my account there and this file to be saved without time limit? I would like to import my file because I want to save traffic. My provider gives me 30 GB of traffic for free (per month), but I calculated that if I would save my file on different server I would save a lot of trafic (css is 20kbyte but html is only 10kbyte, header image is 5kbyte. There is also few icons with size of 500 byte to 1kbyte and probably there will be thumbnails of prifile photos in the size of 2,5 kbyte. Hence I think I could save a bit of the traffic when I would upload the 20kbyte file outside).
  9. I have successfuly solved the problem for FF and Opera 9.64 but in IE8 I still have this problem: The header is placed on the left, whilst the yellow content of the page is on the middle. Any idea how to solve the problem? Note: I have replaced the section tag for div (there is img#head) and small (message notice) and menu tags. These tags are blocks having 100% width and the p children are with 779px and margin:auto; or margin: 0 auto; This is how I centered the top in Firefox and Opera, but IE8 still fails to accept the rules. Any solution? I need to move the header containning logo image, notice, main menu and user menu into the same distance of the position of the yellow left side of the page content.
  10. I have a site centered on the center, but I had a problem in that the head was fixed width 800px (use text-align: left , while the foot was stretched to the edge of the maximum (use text-align: center). I therefore want to do header so that it must be stretched to the edge of page. But there's a problem. once it is to the edge, so the elements are to the edge too - the parts of text-align left, rebounds elements header to the edge. I thought I could fix it with absolute positioning the 2px from left, but it does not help. So how does it actually do? <DIV class=context> <p id=header> <IMG SRC=.../images/logo.png" > <p id=mainmenu>THIS MAIN MENU ID NOT VISIBLE BECAUSE OF CSS BUG: I MADE THE p ELEMENTS TO BE ABSOLUTELY POSITIONED ON LEFT.WISIBETOTO JE HLAVNÍ MENU S BÍLÝM TEXTEM, NENÍ VIDĚT, SCHOVALO SE POD ...here are links to main menu... </p> User menu is like this: <ul id=menu> <li><a ...><IMG SRC=".../images/messages.gif" > MENU SECTION</a> <ul> <li><a ...>SUBMENU></a></li> <li><a >SUBMENU</a></li> </ul> </li> </ul> <p>Notice: you have one new message THIS IS ALSO NOT VISSBLE BECAUSE OF CSS BUG</p> There is a whole html: http://paste.ofcode.org/KHSU6Ay88K3RW8Ki5mqwCm Picture Title header, both menu and message need to put in order began closest to the red lines / arrows. PS: Sorry for Google's fucking English.
  11. I have a JS code to select elements in form (select all checkboxes of all messages), but it is not working and I cannot find why: function sel() { with(document.form) { for(i=0;i<elements.length;i++) { thiselm = elements[i]; if(thiselm.name.substring(0,3) == 'del') thiselm.checked = !thiselm.checked } } } Error message in Firebug: elements is not defined: for(i=0;i<elements.length;i++) { I found working code on different page, but this code does not work for this page with messages: http://paste.ofcode.org/nN2ijGpxjjwd4ABRCsHmLj So I have no idea how to fix that. Can you help? Or do you know Jquery and can you give me simple code in Jquery to do it with shorter code? I think that could be faster solution than to solve this complicated function Example html with messages (utf8): http://paste.ofcode.org/nKa2KUmpLrT2dNtRYayMV3 And demo with the problem: http://jsfiddle.net/eD4VL/
  12. How to correct this to get sentences from message? preg_match_all('/(?:\.|^).+(?:\.|$)/u', $message, $matches);
  13. I have successufly solved the patterns: (?:[^cdkprmt])oje[tl].? (?:[^cdkprmt])ojed[ueo][usm]? For sentences: $str='Tvoje auto je vojete. Otec, dojel v cas. Kojeni neni dojeni. Vojedu tvoje auto klicema. Projedu se autem. Dojedu az zitra. '; Correct result after match and replace: Tvoje auto je ******. Otec, dojel v cas. Kojeni neni dojeni. ****** tvoje auto klicema. Projedu se autem. Dojedu az zitra.
  14. First pattern So I try this regular expression: v?ojet.? and I apply if for sentences "Tvoje auto je vojete. Otec, dojel v cas. Kojeni neni dojeni.". This is result of my program: Tvoje auto je ******. Otec, d**** * cas. Kojeni neni dojeni. First sentence works fine. "Tvoje" was not found and "vojete" was correctly replaced for stars. But the second sentence is wrong. word "dojel" should not be in the result because it should not look for dojel and dojel is not bad word.. Last sentence is fine (none bad word). Second pattern But now I try the second pattern for the words like in sentence: "Vojedu tvoje auto klicema." I change this: [v^d]?ojed[ueo][usm]? to this: v?ojed[ueo][usm]? But it does not work correctly. Try this sentences: Vojedu tvoje auto klicema. Projedu se autem. Dojedu az zitra. Tak jsem se projel. My program will return: ****** tvoje auto klicema. Pr***** *e autem. D***** az zitra. Tak jsem se projel. Vojedu was found OK. But Projedu, Dojedu are not bad words so they should not be in the result. They are also wrong expressions.
  15. I check it again and find, that tha al should not be there. I am not sure how I got it there, but it is mistake, I will correct that but the original pattern was: \bv?ojet.?\b but that was just a tip which somebody gave me. v? means that the v is not neccessary, but if the v is there, so it will be included in result
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.