Jump to content

murfy

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by murfy

  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
  16. Hello, I have a filter for filtering badwords in my native language. My language is very accurate not like simple English, so it is harder to give good exaple in English. I don't find good word / verb to have good example. But I will try. I separated the pattern for three parts: prefix, middle and suffix. The middle will not change. The suffix can change. The prefix can be a specific letter or may not be present. lets give example now: Let's have the middle part: mil. I want to find words like smile, smiles, smiling or mile, miles, miling but not words like mill, mills, milling or words with different prefix like s. Here I dont find realistic example. So if there would be words like emile, emiles, emiling, amile, amiles, amiling, and so on. These words have not to be included in the result. In my native language I tried something similar: \bv?ojet.?\bal where ojet is the middle part and v is the only possible prefix. But this this not find anything. My second try was [v^d]?ojed[ueo][usm] this time with different middle word: ojed. The suffix is changing here according declination. But always this does not work. The common problem in my tests were that some of the characters of the incorrect middle word were captured. And I need only to capture the character of the correct word, in English example it is the mil, or smile, or smil... etc. So how can I specify pattern, that will capture as many characters as possible from the correct word, but not to capture the characters which are not presend. Note: I work only with a-z (small characters) no white characters in the text.
  17. Please help me with this I'm completely lost. The problem is that in Firefox (v12) it worked , but in IE8 and Opera 9 series did not. I know about the bugs that are there , but I can not remove it, so not to break menu. I mention the code in the original version. 1) The end tag \ p delete this should not be there 2) The main problem I see is the repeat of id AB: <li id="AB"> and also the user of class . AB is useless because the class is not there. However that is the main problem: if I remove the id#AB so it is all broken, so you wont see the submenu in IE8 or Opera will not show the backround of the submenu 3 ) the reason why the ids AB were there is to distinguish between the fisrt 4 items in menu and the last item logout. The logout should not be highlighted when you hover over it. I do not understand how the unpack of drop-down submenus works , so maybe that's why i do not know what to do, but it seems to me that the error after removing the # id selector is caused by a more detailed ( some rule that trumps ) for clarification about the dimensions of the elements here is a code with dimensions: http://paste.ofcode.org/NQANEG25v3UXQgWBVu3TMn because in jsfiddle http://jsfiddle.net/WhSzr/ it does not have the correct dimensions I use two width there the first li items, they are narrow, 85px and the submenu ul is 108px wide. I give a link to the picture in FF12 : http://oi39.tinypic.com/502t21.jpg http://oi43.tinypic.com/2qi8u47.jpg Can you help to fix the problem? I need to remove the ids AB from li and fix it to work with IE8.
  18. Working directory... do you mean directory of the project, just where I run the script? This is read/write permission for all users.
  19. two warnings: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set curl_setopt() [function.curl-setopt]: Unable to access cookies.txt Time is 1.11 - 1.25 for 50 items.
  20. Hi jazzman1 I had a break from tomorrow up today, so maybe I miss something. The posted header was not the look as I would expected. I have seen host: localhost instead host:hidemyass.com. But I am not sure if php works with the cookies. I don't see there any cookie header in the context. But the server really needs cookies because it will not send the filtered results if I disable cookies and the options will reset. Maybe curl is only change, but then it will be twice so slower.
  21. I added the additional headers in $addHeaders : host and reffererer . Also the user agent is set. exactly as you see it in the link. My headers as I copy them from the firebug - net card: http://paste.ofcode.org/G8TpiKLbrbRyEkAwmW4Zxc Notice, that there is localhost...
  22. Do you mean post it to you or post it as a content in http request? http://paste.ofcode.org/dmUqvzvfLfeADZKQxK37TV
  23. Here is my complete code. It should send/submit the form with some of the checkboxes unchecked (this is filtration to limit cound of the items displayed on the site) and recieve one page only. http://paste.ofcode.org/Jxgcaie642CU5p2mxSFkX6 Here is options to the options file: http://paste.ofcode.org/8pgNrZV3bmbC7vTS5c5Q6r However the request is not good. It should change host name. Do you know how to correct this?
  24. Is it possible to add next headers? I try this: http://paste.ofcode.org/RHfCqLWvj8eAraLFkudGkm Resulting with error: Warning: fopen - failed to open stream: Redirection limit reached, aborting ... This is second time when I have this error. What does it mean?
  25. I tried this code, but when I check headers, I see there is only GET request. Not the post. http://paste.ofcode.org/Et2dERYXZpfh64b3g72ax2 Why?
×
×
  • 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.