|
Thanks alot for your deep explaination
But when i console.log(total[language]) it return for me string: javascript, css and html rather number
thanks alot
|
|
|
|
|
Hello! I need some help with my project, it's only html and css, please contact me in private and we can talk there. Thank you very much!
|
|
|
|
|
Sorry, no. This is an open forum for technical discussions and questions. If you want someone to work for you then try freelancers.com.
|
|
|
|
|
i said i need help not for someone to do the project for me
|
|
|
|
|
|
No private. Ask your questions here and there are lots of people who can answer.
|
|
|
|
|
You can tell here what help you need, i will give you solution as much as possible.
|
|
|
|
|
Hi, i need some help with a project with a responsive gallery, can anyone help me please contact me in private here .
|
|
|
|
|
How Do You Remove Unused CSS From a Site? | CSS-Tricks[^]
The effect on page loading time will depend on how much you remove. It's unlikely to have as much effect as optimizing your images and Javascript, but you would need to profile your page load time to determine where the bottleneck is.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
as light-weight files,
web resources like scripts pages ( htm ; php ; js ... ) , and css files are the costless.
1 video 2 Go
1 UHD picture 8 Mo
1 HD picture 4 Mo
1 CSS file 0 Mo 200 ko
It's really to forget with the aim to increase load speed.
Something usual is to increase code quality, with 'less' code as effect.
It's refactorising.
Html can be skills increased, Css too.
With a better use of tags, and current features.
It's bring the code to a higher quality, with refactorizing.
Then sending the code to a client is faster,
loading, and building the page DOM is faster again,
and so displaying, and interacting
It's a gain.
modified 23-Aug-21 21:01pm.
|
|
|
|
|
We have four possible environments within two possible categories of environments in which to run our web apps (about 15 apps).
Unclassified dev box, dev server, test, QA, and prod
Classified dev box, dev server, test, QA, and prod
Each of these environments also has an environment-specific database server, and several connection strings were required per application.
At one point, we were building a web app deployment package that was category and environment specific, meaning we could potentially be creating 8 different packages depending on the target environment. So, as we progress through the dev/test/acceptance/production life cycle, we'd eventually have to create at least four deployment packages.
Yes. It was a pain in the ass and as you might guess, fraught with danger with regards to deploying essentially untested code (that could even be different from package to package assuming something goes sideways during the creation of the package).
---------------------------------------------------------
We recently transitioned to "the cloud", and the "new way" is to create just one package, and as it transits the dev/test/prod life cycle, the same package is merely deployed to the next environment. While this is by far a better idea, I have concerns.
The connection strings are contained in the web.config file, which means that we can't deploy the "new way", because the deployment package we build has always been environment specific (remember, each environment has its own database).
---------------------------------------------------------
Are my concerns justified? In the interest of full disclosure, we do not use Entity Framework for database access.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I have a simple Test controller:
public class TestController : _ControllerBase
{
[HttpPost]
public void Post([FromBody] TestEntity entity)
{
Repository.AddTest(entity);
}
[HttpDelete]
public void Delete(Guid id)
{
Repository.DeleteTest(id);
}
[HttpGet]
public IEnumerable Get()
{
return Repository.GetTests();
}
[HttpGet]
public TestEntity Get(Guid id)
{
return Repository.GetTest(id);
}
[HttpPut]
public void Put(Guid id, [FromBody] TestEntity entity)
{
Repository.UpdateTest(entity);
}
}
If I call the Get I get back "Bad Request".
If I comment out the second Get (the single entity), the IEnumerable Get fires fine.
My URL is "https://localhost:44355/api/Test/Get"
My RouteConfig looks like this:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
What am I doing wrong here??
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
modified 26-Feb-21 13:59pm.
|
|
|
|
|
I probably just chose the wrong format to store the datetime in the cookie, but it's worth pursuing time someone tells me to change it.
I need help with converting the date, so I can do a compare or diff, or perhaps dumping the date for something else, or just general help with making this work. Help can just be an idea or nudge. Keep in mind that I'm not a PHP 7 expert, and lost my knowledge of PHP back in 2005 or so. I've been working on this for hours and I'm not sure whether to dump it and start again, or do even more research.
public static function setJsonAuthCookie($userName, $userType): void {
date_default_timezone_set('America/Los_Angeles');
$today = new DateTime();
$jsonData = array(
"userName" => $userName,
"userType" => $userType,
"createdOn" => $today,
"expires" => $today->add(new DateInterval('PT4H')),
"token" => "",
"auth0" => ""
);
$jsonEncode = json_encode($jsonData, JSON_FORCE_OBJECT);
setcookie("authJson", $jsonEncode, time()+240);
}
public static function validateUser(): array {
$cookie = clsAuth::getJsonAuthCookie();
if (!isset($cookie)) {
$formAction = "/pcad/unauthorized.phtml";
header("Location: http://".$_SERVER['HTTP_HOST']."$formAction");
} else {
$userName = $cookie['userName'];
$userType = $cookie['userType'];
$createdOn = $cookie['createdOn'];
$expires = $cookie['expires'];
$token = $cookie['token'];
$auth0 = $cookie['auth0'];
date_default_timezone_set('America/Los_Angeles');
$today = new DateTime();
$dateString = $expires['date'];
$timeZone = $expires['timezone'];
echo "<div>validating token</div>";
if ($dateString > $today) {
echo "<div>token declined</div>";
sleep(1);
$formAction = "/pcad/";
} else {
echo "<div>token accepted</div>";
%7B%22userName%22%3A%22jimk%22%2C%22userType%22%3A%22Executive%22%2C%22createdOn%22%3A%7B%22date%22%3A%222021-02-17%2018%3A32%3A54.638030%22%2C%22timezone_type%22%3A3%2C%22timezone%22%3A%22America%5C%2FLos_Angeles%22%7D%2C%22expires%22%3A%7B%22date%22%3A%222021-02-17%2018%3A32%3A54.638030%22%2C%22timezone_type%22%3A3%2C%22timezone%22%3A%22America%5C%2FLos_Angeles%22%7D%2C%22token%22%3A%22%22%2C%22auth0%22%3A%22%22%7D
Then reading the cookie, extracting the json, and trying to compare the date "expires" to $today which is DateTime
Tried to convert the string date in the JSON back to an PHP DateTime object, so I can say is today > expires
I tried for hours, using getDate, strtotime, and reading up on time in seconds since the epoch.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Message Closed
modified 15-Feb-21 12:19pm.
|
|
|
|
|
You can't.
Number of fields in a table: 255
If you need more fields, you'll have to use a different DBMS.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I can make "Programming" in this code work as a link but I want the icon to be the link. I did come up with one solution but it deformed the icon when mousing over it.
<div class="col-lg-3">
<div class="features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3">
<div class="features-icons-icon d-flex">
class="icon-playlist m-auto text-primary">
</div>
<a href="#schedule">
<h3>Programming</h3>
</a>
<p class="lead mb-0">Schedule</p>
</div>
</div>
|
|
|
|
|
You just need to put the icon image between <a> and </a> .
Use a browser with dev tools to see what styling is applied on hover that is messing it up.
<a href- ... >;
<img src=...>
clickable words if you want
</a>
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I'm trying to convert this function written in V4.7.3 to V7.4.
This function is used quite often in the app. I get what it does in a general sense, but not at expert level, because I lost my expert PHP database skills back in 2005.
I'm struggling to translate mssql_fetch_field. I tried sqlsrv_fetch_array and the result was 1. Then I tried sqlsrv_get_field and the result was 1.
The webpage errors say:
meta= 1
Notice: Trying to get property 'name' of non-object in C:\App\Dev\PCAD\class\cls_db_tools.php on line 137
Notice: Trying to get property 'name' of non-object in C:\App\Dev\PCAD\class\cls_db_tools.php on line 141
meta= 1
I don't understand the 1 that was returned. Obviously 1 doesn't contain a name, and I expected $meta to be a result.
And I don't have the old dev server to go back to to see what it's suppose to return with the old code.
Here's the old function
function db_Sel_Query($sqlQuery) {
<pre>
$Rows = Array();
$resQuery = mssql_query($sqlQuery) or die();
$cRows = mssql_num_rows($resQuery);
$cFields = mssql_num_fields($resQuery);
$rgFields = Array();
for ($i = 0; $i < $cFields; $i++) {
$meta = mssql_fetch_field($resQuery);
$rgFields[$i] = $meta->name;
}
for ($i = 0; $i < $cRows; $i++) {
$row = mssql_fetch_row($resQuery);
for ($col = 0;$col < $cFields;$col++) {
$Rows[$i][$rgFields[$col]] = rtrim($row[$col]);
}
}
mssql_free_result($resQuery);
return $Rows;
}
The new function I wrote
public static function dbSelectQuery($sqlQuery): array {
<pre>
$Rows = array();
$rgFields = array();
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$conn = clsDbConnect::createConn();
$resQuery = sqlsrv_query($conn, $sqlQuery, $params, $options) or die();
$rowCount = sqlsrv_num_rows($resQuery);
$fieldCount = sqlsrv_num_fields($resQuery);
for ($i = 0; $i < $fieldCount; $i++) {
$meta = sqlsrv_fetch_array($resQuery, SQLSRV_FETCH_ASSOC, $i);
echo "<div>meta= " . print_r($meta) . "</div>";
if ($meta->name) {
echo "<div>meta.name= $meta->name</div>";
}
$rgFields[$i] = $meta->name;
}
for ($i = 0; $i < $rowCount; $i++) {
$row = sqlsrv_fetch_array($resQuery,SQLSRV_FETCH_NUMERIC);
for ($col = 0; $col < $fieldCount; $col++) {
$Rows[$i][$rgFields[$col]] = rtrim($row[$col]);
}
}
sqlsrv_free_stmt($resQuery);
return $Rows;
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I think I figured it out.
What I'm trying to get is the column names in the meta data of the table.
The example use a foreach loop, so now I know how to use foreach in PHP V7+
Seems needs some work and polishing.
public static function dbSelectQuery($sqlQuery): array {
<pre>
$Rows = array();
$rgFields = array();
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$conn = clsDbConnect::createConn();
$resQuery = sqlsrv_query($conn, $sqlQuery, $params, $options) or die(" cls_db_tools 128: " . $sqlQuery . print_r(sqlsrv_errors()) );
$rowCount = sqlsrv_num_rows($resQuery);
$fieldCount = sqlsrv_num_fields($resQuery);
$cIndex = 0;
foreach( sqlsrv_field_metadata( $resQuery ) as $fieldMetadata ) {
$columnName = $fieldMetadata['Name'];
$rgFields[$cIndex] = $columnName;
$cIndex++;
}
for ($i = 0; $i < $rowCount; $i++) {
$row = sqlsrv_fetch_array($resQuery,SQLSRV_FETCH_NUMERIC);
for ($col = 0; $col < $fieldCount; $col++) {
$Rows[$i][$rgFields[$col]] = rtrim($row[$col]);
}
}
sqlsrv_free_stmt($resQuery);
return $Rows;
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I'm stumped, and sort of shocked that PHP didn't like the value or type.
$sold_date in the the sql server table is defined as smalldatetime.
In the table, the value is 2/7/2008
I tried $sold_date->format('m-d-y') and it didn't like it.
I also searched and searched, and just found generic anwsers
Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in C:\App\Dev\PCAD\project_update.phtml:427 Stack trace: #0 {main} thrown in C:\App\Dev\PCAD\project_update.phtml on line 427
echo "
<td class='text-align-center'>
<p class='margin-text-indent'> $sold_date </p>
</td>";
My database call is
$row_proj = sqlsrv_fetch_array($res_proj);
$projectNumber = $row_proj[0];
$proj_stage = $row_proj[1];
$version_no = $row_proj[2];
$customerNumber = $row_proj[3];
$sold_date = $row_proj[4];
$sales_no = $row_proj[5];
$swan_job = $row_proj[6];
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
jkirkerx wrote: I tried $sold_date->format('m-d-y') and it didn't like it.
How did you try it? I suspect you'd need to use the "complex" syntax[^] to embed that within a string:
echo "
<td class='text-align-center'>
<p class='margin-text-indent'> {$sold_date->format('m-d-y')} </p>
</td>"; If that doesn't work, what error do you get?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Oh that works!
I would figured it out eventually, maybe within 3 months
Just read the link, did not know that.
I was thinking perhaps I had to preprocess that variable before echoing it out to the presentation layer.
Well that solves another 500 errors in this project, about 1000 more to go.
Thanks Richard, really appreciate the help. This project is really beating me up mentally, but it will be worth it in the end.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Hello,
Sorry if i post this message at the wrong place.
I am making a website with a CMS. On this CMS i add my own little functions. For one of them i used an Ajax script to refresh a div but it doesn’t worked. I asked to the CMS creator he told me to use Pjax. Is it possible to do that ? (i don’t know pjax).
If someone can help me , it would be kind.
Thanks
modified 6-Feb-21 16:22pm.
|
|
|
|
|
This is the wrong place - try here: Ask a question[^] but try to give us actual information rather than your vague description. Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Or better, go back to your CMS creator and ask him to elaborate.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This is going to be really generic, but...
ASP.Net website hitting a sql server database.
Our web site hits a database and according to the sql server profiler, the stored proc is returning the requested data, but the response that we're seeing is a 500 error.
What might cause that?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|