You must be logged in to see that page. × Close

Questions on Forrst

Sorting a 3D or 4D array

rebbieboi

rebbieboi

2 hours ago · 9 views

I need to sort a 3D or is it a 4D array, but all the codes i've found are only able to sort the deepest array in each

i.e

            Array
          (
        [0] => Array
             (
        [0] => Array
            (
                [name] => 12.jpg
                [size] => 5739
            )

        [1] => Array
            (
                [name] => 123.jpg
                [size] => 4541
            )

        [2] => Array
            (
                [name] => ccopy.jpg
                [size] => 5739
            )

        [3] => Array
            (
                [name] => download (1).jpg
                [size] => 8889
            )

        [4] => Array
            (
                [name] => download (3).jpg
                [size] => 8405
            )

        [5] => Array
            (
                [name] => images.jpg
                [size] => 5739
            )

        [6] => Array
            (
                [name] => 1.gif
                [size] => 8405
            )

        [7] => Array
            (
                [name] => brdodas.jpeg
                [size] => 6829
            )

          )

       [1] => Array
          (
        [0] => Array
            (
                [name] => asd.jpg
                [size] => 5739
            )

        [1] => Array
            (
                [name] => Copy of no-cat-icon.gif
                [size] => 6951
            )

        [2] => Array
            (
                [name] => no-cat-icon.gif
                [size] => 6951
            )

         )

         [2] => Array
         (
        [0] => Array
            (
                [name] => Blue hills.jpg
                [size] => 28521
            )

        [1] => Array
            (
                [name] => Sunset.jpg
                [size] => 71189
            )

        [2] => Array
            (
                [name] => Water lilies.jpg
                [size] => 83794
            )

        [3] => Array
            (
                [name] => Winter.jpg
                [size] => 105542
            )

        [4] => Array
            (
                [name] => download (1).jpg
                [size] => 8889
            )

        [5] => Array
            (
                [name] => download (3).jpg
                [size] => 8405
            )

        [6] => Array
            (
                [name] => download.jpg
                [size] => 4541
            )

         )

        [3] => Array
          (
        [0] => Array
            (
                [name] => Water lilies.jpg
                [size] => 83794
            )

        [1] => Array
            (
                [name] => Winter.jpg
                [size] => 105542
            )

        [2] => Array
            (
                [name] => asdas.jpg
                [size] => 6168
            )

        [3] => Array
            (
                [name] => asdasdas.jpg
                [size] => 6868
            )

        [4] => Array
            (
                [name] => download (1).jpg
                [size] => 8889
            )

        [5] => Array
            (
                [name] => download (3).jpg
                [size] => 8405
            )

        [6] => Array
            (
                [name] => download.jpg
                [size] => 4541
            )

        [7] => Array
            (
                [name] => thumbnail_6_1316463355.jpg
                [size] => 2826
            )

          )

         [4] => Array
         (
        [0] => Array
            (
                [name] => Copy of download.jpg
                [size] => 4541
            )

        [1] => Array
            (
                [name] => download (1).jpg
                [size] => 8889
            )

        [2] => Array
            (
                [name] => download (2).jpg
                [size] => 6829
            )

        [3] => Array
            (
                [name] => download (3).jpg
                [size] => 8405
            )

        [4] => Array
            (
                [name] => download.jpg
                [size] => 4541
            )

       )

       )

the sorting function:

    usort($datall, 'array_name_sort');
    function array_name_sort($a,$b) {

     if($a['name']>$b['name']) return 1;
     elseif($b['name']>$a['name']) return -1;
     else return 0;
      }

i know i need to play around with this function to have the output i need, but i do not quite understand how the function work, like how does it determine the values for $a, $b.

if anyone would be kind enough to explain it to me so that i may be able to formulate my own sorting function for this problem, also if there are anyone out there that is familiar with this problem would you be kind enough to explain your algorithm in making the sorting function.

so basically i wish to learn the proper detailed algorithm for sorting such arrays.

Thank You very much.

be kind, i'm used to working with database so i'm not that familiar with arrays, especially arrays this big.

Favorite Font Management tool?

What is your favorite tool to manage a large font collection? Is there anything out there that really looks at the font and lets you filter by weight and styles (i.e. medium sans-serif)?

How do you stay focused when there are way too many technologies you want to try?

Tharnid

Tharnid

8 hours ago · 17 views

I am constantly finding myself in a state design/developer flux. I made a list of things I wanted to improve/learn and it is quite large. I know you shouldn't try to learn over three things at once (heard that some where). I am tinkerer and new things appeal to me. I can't ignore or not improve the things I have learned. I seen developer check lists which say you should learn a language a year to keep things fresh. The problem is that there are many I want to explore when I have time. How does everyone else keep on track?

CSS3 post transformation dimensions

Hi, I'm trying to develop a simple psd but I'm stuck at some point. problem After a css3 rotateX transformation on a div box, it's height changes on the display, but not in the code. Is there any way I can get these new dimensions? Safari's element inspector delimits the surface correctly, but still, in the code, the box has still a height of 430px instead of the correct 53px. I would appreciate any help!!

Railo -> MySQL utf-8 issue.

Hi,

I'm getting a problem trying to add content to a MySQL database that contains the UTF-8 character "→". If I add directly to MySQL, all is fine and so it's not an issue with the database structure, however when trying via Railo I get the error "Incorrect string value: '\xE2\x86\x92' for column '_name' at row 1".

For the record, I'm using Railo 3.3.1.000 on Ubuntu with MySQL 5.1.41-3ubuntu12.10.

I can see that a similar issue has been fixed in previous updates to Railo, so am I missing a trick here somewhere?

Thanks, Dan

How can I create a CRS with Mac OS X Lion?

luis

Luis Gerhorst

10 hours ago · 16 views

I'm working on a Safari Extension and at the moment I'm trying to create a Certificate Signing Request with Apple's Developer Certificate Utility.

On the page Apple has a very good description how to create the Certificate, but it's just for Mac OS X Leopard (Screenshot here: cl.ly/EREi). Can you tell me how I can do this with Mac OS X Lion (not Lion Server) using the keychain application?

Is there a web app out there that does this?

simonhamp

Simon Hamp

12 hours ago · 92 views

I'm at a loss as to what to search for and where to look, so I'm wondering if anyone out there knows if there is a web app that can do the following:

  • Set up tasks for a day. Each task may be of a different type, and each type of task may take a different amount of time - these would need to be configurable
  • Associate each task with a person
  • Plot a journey between two places (ideally on a Google Map) to calculate travel time by car
  • Return a best-guess of the times that the individual will arrive at each successive location given the pre-filled task time and the journey time between locations

Essentially it's a glorified task list, with tasks (or jobs) making up a person's working day from a set start time, that's able to predict when they will move from one job to the next.

Example: Person A starts work at 10am. Their first job takes 1 hour. They will leave that location and travel to a new location that is about 30 minutes away. What time will they arrive at their new location?

To-the-minute accuracy is not critical, but ideally we should be able to give the system a list of tasks (with their anticipated length) and their locations and associate them with a person. The key is to be predictive about when the person will begin and end each task.

jQuery keyboard based table filter and select

Frinkky

Jon Warner

13 hours ago · 7 views

Hey,

Just wondering if anyone knows of a jQuery plugin similar to the following:

I have a table of data, the pertinent column is a unique code. 1. I'd like to be able to filter the table by entering the code in a filter input and 2. if the enter key is pressed when only one result remains, that remaining item is copied/moved to another table. The idea is that rows can be quickly filtered and copied/moved to a 'shortlist' table as efficiently as possible i.e. keyboard only, no mouse usage required.

I'm just wondering if there's something out there already so I don't end up reinventing the wheel.

Thanks!

"Photos this color is in" API

ethankr

Ethan Kramer

20 hours ago · 15 views

Hey forrst,

So, I was thinking today about the features that I want to be in Randomizr 2 (which should be on the app store around the end of this year at the latest), and I thought it might be nice to add a feature in that when you search for a color it gives you back, palletes the color is in, patterns (powered by COLOURlovers, actually the app is based on the COLOURlovers API) , other similar colors (possibly) and photos which that color is in.

Sounds great right? Here's my problem: I was thinking the best way to implement a "photos this color is in" feature, since there are so many photos on the web and so many photo services, and one's gotta an API that I would just use API for this service the problem is I've been searching the web for days on end now and I just can't find a single photo provider api that gives me photos with a certain color in it, Not one, nada, zilch, zippo (you can tell I'm a little flustered)

I tried Flickr, no luck (by the way their API is documented horribly, I couldn't find the straight up end point descriptions), Instagram, twitpic and all have APIs but don't provide an endpoint for getting all photos with a certain color in them


So, my question for you forrst, is: Do such APIs exist? And If so What are they? (Please provide a link to API doc in the comments)

Thanks again Forrst

CSS: Should one use element#ID or just #ID

pax

pax

20 hours ago · 66 views

Does it make any sense to have

... div#idName ... {...}

when just having the idName would work just the same?

... #idName ... {...}

I used to be as specific as possible (and in this case redundant), I thought that's a form of tidiness but I just realize it doesn't really help. Are there any other aspects - like processing speed?

3 new notifications