-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
How do i query these lines in one single line someone help please??
requinix replied to Ronel's topic in PHP Coding Help
Have you tried a query that lists all the columns and requires any of the conditions? -
How do i align 3 elements with bootstrap 4 according to my designs?
requinix replied to sashavalentina's topic in CSS Help
You say you don't want to use CSS, but then you do things like <div class="col-2" style="top:-15px; left:-20px;"> and <div class="col-6 text-justify" style="position: absolute;height: 68px;left: 22%;right: 27.05%;"> which is very much the opposite of that. If you are going to use Bootstrap for positioning then do not do your own positioning. Work with the system, not against it.- 1 reply
-
- 1
-
If you also wanted permissions on some sort of "container" then you've basically discovered the Unix permissions system. Can you say that, for each permission, "if public can do X then owner and group can" as well as "if owner can do Y then group can"? If so then you have a hierarchy-based model and your system needs only know the lowest level in the hierarchy to permit the action - the second example you have. If not then you probably have a role-based model and you'll likely end up granting individual permissions to each group - the first example. In other words, first you need to know at a high "business" level what the permissions system must be capable of supporting: how people and groups relate to each other. If it isn't clear what that needs to look like, consider looking at existing permissions systems (which are mostly hierarchy- or role-based), see which seems most appropriate, and copy it.
-
It's not stupid. Not by much. My version looks almost the same: opening parenthesis, capturing group, some ungreedy amount of stuff that isn't an opening or closing parenthesis (you used an assertion instead), the word "required", and the closing parenthesis. If you absolutely can't stand having a $1 group, swap the opening and closing parentheses for assertions. But this will make it look more "obtuse". If you care about squeezing every bit of performance out of this regex then we can keep going, but with short input strings I'd need a pretty darn good reason to put in the effort.
-
Can you write something that captures the word "required" through to the closing parenthesis? What do you know about the input $string. Does it always have the word? Is it always going to be contained in parentheses? What if it shows up multiple times?
-
What "wrap"? DIVs have no inherent meaning and contribute nothing to structure. Default CSS rules aside, their sole purpose is to allow you to group elements together under a single parent, and thus apply CSS or behavior to the whole group as a unit.
-
As long as the exception is being handled somewhere and the user is getting a generic error page, you're probably okay. But you should still take steps to prevent whatever bad data reached Symfony's code from getting there. Like in whatever uses that get_quote_vehicle_select view.
-
Is "${ip}:${port}" literally what is there? Because that's obviously not a valid host. Or valid Host header. Or valid URL to give to curl. And I imagine it would only happen because of a rather glaring error in some code somewhere.
-
A box-shadow draws a shadow behind the element's box, which is always rectangular. And there is no "radius" - only border-radius. If the unrounded corners on the shadow are a problem then you can apply a matching border radius to the parent element so that it will crop the corners of the shadow.
-
Uh... margin, maybe? Or maybe you're putting your CSS on the wrong elements? Throw what you have into a jsfiddle, make it reproduce the problem you're seeing, and then we'll have a common place to start talking. Because posting a bit of HTML and a couple attempts at CSS applied... well, somewhere, isn't really great.
-
Searching and Calculating Minimum Years of experience
requinix replied to michelle1404's topic in MySQL Help
Great, but if you want years then you'll need the /365. And think about whether you want to round 2.5 years of experience up to 3 or not - because that's what a ROUND() would do. That gives you the ID and the average experience. If you want to only return IDs that have enough experience, add a HAVING clause to your query: ...HAVING Days >= 1095 /* or, if you /365 and alias the value as Years, */ ...HAVING Years >= 3 I assume you also want the first and last names? JOIN in the employees table based on the ID and you should be set. -
Searching and Calculating Minimum Years of experience
requinix replied to michelle1404's topic in MySQL Help
So "average years of experience per company worked for". Just so we're clear here what it is you're averaging. Because average is about a ratio: some number per some other number. You have a query that can give you the average for an employee. Your first step should be to adapt that so you can see all employees and their averages. You've somewhat done that in your second query except you added a bunch of other stuff to it which may or may not be useful. So back up a step. Can you write a query that just gives you the (let's say) eemp_id and the AVG(...) of their work experience? It should look very similar to the first query. -
https://www.google.com/search?q=site%3Aforums.phpfreaks.com+css+wrapper+container+width+height ?
-
Tell if class implements an interface
requinix replied to NotionCommotion's topic in PHP Coding Help
is_subclass_of, which continues the tradition of some things using the word "class" to represent interfaces too. -
I'm not really sure what the complexity is here, but I'm also not sure quite what it is you're trying to get. So you have an image with pixel dimensions WxH. You want to place circles on there, but I guess you don't want to place them on individual pixels but rather on grid "cells" to reduce the number of locations. So like a 100x100 image could be split into 10x5 cells (each is 10x20 pixels), reducing the number of locations from 100*100=10000 center points to 10*5=50 center points. Easy answer? Generate the set of cells you want to choose from, shuffle the set, then go through the first <?> of them and draw the circle appropriately. $cells = []; for ($x = 1; $x <= CELL_COUNT_X; $x++) { for ($y = 1; $y <= CELL_COUNT_Y; $y++) { $cells[] = [$x, $y]; } } shuffle($cells); for ($i = 0; $i < NUMBER_OF_CIRCLES; $i++) { list($x, $y) = $cells[$i]; // draw circle on the cell at ($x,$y) }
-
impossible de récupérer les données individuelles de l'api
requinix replied to fouix's topic in PHP Coding Help
The output is technically correct. It isn't actually empty - it just isn't outputting all of what is in there. And I think you were making progress. Did you fix your code according to my previous reply? What is your code after you did that (the full thing, please, not just the piece you showed earlier) and what is it doing now? -
Then don't create an ORM. You don't need that for an ecommerce thing. It's too complex and you're going to get it wrong - which I don't say because "lol you're an intern" or "I don't think you're smart enough" but because ORMs can get very, very complicated. If they want you to use MVC then that's fine. You should ask if you can use libraries like Doctrine or Symfony or something to speed up the work, and if they say no then that's troubling. Honestly, I'm rather concerned that they're giving an intern (no offense) the project of "make an ecommerce website". It's a big can of worms they're asking you to open.
-
If their system (1) logs the user into their site during the OAuth process, assuming the user is not already logged in, and (2) do not provide a way for you to end that session, then that's a security risk and it has to be mitigated by the other site. They could do so by not logging the user in during the process (only validating the credentials) and/or by giving the user the standard "Remember me; not recommended for shared computers" checkbox (which creates a short-lived session that expires when the browser is closed). Providing a method to sign someone out given credentials is actually rather uncommon. It's giving a remote site control over something that they don't need control, considering that there are alternatives.
-
It's possible you're running into some sort of browser bug. Maybe that some positioning is reliant on such tiny fractional numbers that a tiny difference after the recalculation caused by resizing matters. My solution would be the same as most other CSS solutions: find a way to do what you want with fewer attributes. Such as by not having both boxes fixed.
-
impossible de récupérer les données individuelles de l'api
requinix replied to fouix's topic in PHP Coding Help
Couple typos in what I wrote: $ip = ->children("http://schemas.xmlsoap.org/soap/envelope/") // <env:*> There's a variable missing before the ->. What do you think it might be? Also ->body // <env:body> the element is actually "Body", not "body". -
If you pull all the content out of the normal flow then there won't be any normal flow anymore. You don't have to make the content_box fixed. All you have to do is constrain the height so it never goes beyond the bottom of the viewport. Then there won't be anything to scroll.
-
What code have you tried so far and what happened when you used it?
-
Use ->xpath to go directly to the right <text>. /kendisplay/data/SText[@id="ken1"]/text Keep in mind that XPath queries are like SQL and HTML: if you put user-provided data into them (like if "ken1" came from the form instead of your own fingers) then it needs to be escaped first, such as with sprintf('/kendisplay/data/SText[@id="%s"]/text', htmlspecialchars($id))
-
Soon you're going to discover that making an ORM is not a simple or quick process. People use things that already exist for a reason. You do know that you don't need an entire "framework" just for database stuff, right? Libraries like Doctrine can be used just for their own features without you having to adopt all of Symfony too. There's... honestly, there's so much that needs to be said about what little you've posted that I don't even know where to start. Why can't you use an existing system for this?