Jump to content
php.lv forumi

GedroX

Reģistrētie lietotāji
  • Posts

    373
  • Joined

  • Last visited

Everything posted by GedroX

  1. PHP manuālis - funkcija header(). if (headers_sent()) { // Nefiga nesanaks. Skaties, lai pirms koda nenotiek nekāds output. Vislabāk izmanto ob_* funkcijas. } else { header('Content-type: image/jpeg'); } // Tagad gruzī iekšā savu attēlu P.S. Venom -> nedaudz nokavēju :p
  2. PostgreSQL-am ir tāda lieta kā VACUUM. Domāju, ka tas pats vien ir, tikai citādi nosaukts. =) Running VACUUM recommended The estimated rowcount on the table "access" deviates significantly from the actual rowcount. You should run VACUUM ANALYZE on this table. Instead of issuing a manual VACUUM ANALYZE command on this table (you can use the pgAdmin III maintenance menu for this), running VACUUM ANALYZE on a regular or automated basis should be considered. This can be achieved using a scheduler. PostgreSQL also supplies the pg_autovacuum daemon, which will track changes made to the database and issue vacuum commands as required automatically. In most cases, pg_autovacuum will be the best choice. What is VACUUM good for? The PostgreSQL query planner makes its decision based on assumptions, taken from the estimated rowcount. If the actual rowcount is too different from the estimated rowcount, the planner might take a wrong decision, resulting in a query plan that is not optimal. This might result in poor performance. The PostgreSQL storage needs VACUUM to have transaction IDs in tables fixed. Additionally, outdated rows from updates and deletes are not cleaned up until the VACUUM command has been issued on that table. In-depth information can be found in the online documentation, just press the help button. Un vēl ir tāda lieta, kā Reindex.
  3. Robis-> Par tiem krieviem pilnīgas muļķības. Ļoti patīkams kolektīvs. Grey_Wolf-> firma nepārtraukti paplašinās, tādēļ arī meklē.
  4. Mēģini vai nu php.ini konfigurācijā pārbaudīt, vai short_tags=on, vai arī visās <? vietās rakstīt <?php.
  5. Uztaisi caur AJAX. Neesmu īpaši ņēmies, bet iedomājos, ka varētu būt kautkā tā: Pirmais rekvests - parastais. Pienāk html ar javascriptu, kurā rakstīts, ka jāgriežas uz to pašu adresi, tikai pieliekot klāt kādu GET parametru. Caur HTTPRequest sūti pieprasījumu kopā ar GET-u, PHP ievērtē, ka tika padots šis GET parametrs un sūta jau pilno lapas versiju. JS saņemot to ielādē lapā. Cik tas ir reāli? Varbūt arī tā ir mana utopija... :p Javaskripa nav, lapas arī nebūs... (chuckle)
  6. Nav vienu } aizverošo iekavu, komentārs sākas ar '/ *' nevis '/*' (starpā atstarpe), funkcija function get_float32($fourchars) {} ļoti aizdomīga (tukša). Pēc argumenta $fourchars var spriest, ka tai būtu jāaizverās pēc return 0.0;.
  7. Kā jau iepriekš teicu, piesit klāt viņam beigās simbolu 'i' (...+$/i) - itkā tā būtu jāiet. Bet nu dīvaini, ka A-Z nenostrādā... Kautko tu tur nomudīji, man liekās. Visās 4trās piemeti?
  8. Pie reizes tiek piedāvāts darbs kantorī Vide Infra Group. Pats tur strādāju. Viss ir ļoti augstā līmenī. Welcome. :)
  9. Tu domā šo: # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # # # Putting this all together, we can internationalize error responses. # # We use Alias to redirect any /error/HTTP_<error>.html.var response to # our collection of by-error message multi-language collections. We use # includes to substitute the appropriate text. # # You can modify the messages' appearance without changing any of the # default HTTP_<error>.html.var files by adding the line: # # Alias /error/include/ "/your/include/path/" # # which allows you to create your own set of files by starting with the # @exp_errordir@/include/ files and copying them to /your/include/path/, # even on a per-VirtualHost basis. The default include files will display # your Apache version number and your ServerAdmin email address regardless # of the setting of ServerSignature. # # The internationalized error documents require mod_alias, mod_include # and mod_negotiation. To activate them, uncomment the following 30 lines. # Alias /error/ "@exp_errordir@/" # # <Directory "@exp_errordir@"> # AllowOverride None # Options IncludesNoExec # AddOutputFilter Includes html # AddHandler type-map var # Order allow,deny # Allow from all # LanguagePriority en cs de es fr it ja ko nl pl pt-br ro sv tr # ForceLanguagePriority Prefer Fallback # </Directory> # # ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var # ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var # ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var # ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var # ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var # ErrorDocument 410 /error/HTTP_GONE.html.var # ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var # ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var # ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var # ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var # ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var ?
  10. Palasi manuāli - funkcijas - strtotime(), date().
  11. Tādā veidā var to regulāro izteiksmi līdz 5 lapām attīstīt. ;) Tā jau tikai pamata pārbaude. Labāk tomēr kļūdaini uzskatīt par pareizu kādu nekorektu adresi nekā otrādi. Iedomājies situāciju - tu raksti savu e-pasta adresi, bet serveris neņem pretī.. Sviesc, ne? (:
  12. Par skaitļiem ir šāds skripts (daudz vispusīgāks par to, ko uzrādīji - arī reāliem skaitļiem). Epastam - <script type="text/javascript"> <!-- email="[email protected]"; if (email.match(/^[!#$%&\'\*\+\/=?^_`{|}~a-z0-9-]+(\.[!#$%&\'\*\+\/=?^_`{|}~a-z0-9-]+)*@[!#$%&\'\*\+\/=?^_`{|}~a-z0-9-]+(\.[!#$%&\'\*\+\/=?^_`{|}~a-z0-9-]{2,})+$/)) { alert('Pareizs'); } else { alert('Nepareizs'); } //--> </script> P.S. Tam email skripta regulārajai izteiksmei laikam prasītos beigās i, lai arī lielos burtus ņem pretī... Slinkums pārbaudīt.
  13. GedroX

    opacity

    Es domāju, ka ar to arī problēma ir atrisināta. Vai ne, dot? Ja nu vienīgi caurspīdīgu png ar BilžuVeikalu nemāki uztaisīt. :p
  14. GedroX

    opacity

    CSS liek alpha caurspīdīgumu visam elementam (tavam div-am un visiem viņa 'bērniem'). Kā saprotu, atsevišķiem apgabaliem to nevar izmainīt. Rīkoties var šādi - div-am kā background-image uzlikt png ar 80% caurspīdīgumu. .transp { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=tavs_png_sheit.png, sizingMethod=scale); } .transp[class] { background-image: url(tavs_png_sheit.png'); } P.S. Pirmā daļa priekš IE, otrā - FF.
  15. GedroX

    Ģenetīvs

    Ok. Pieķēri. :) Sen jau tā skola bija. Termini sajukuši.
  16. Uzskatu pierakstu [0-9] pārskatāmāku gadījumā, kad regulārā izteiksme nav no vienkāršākajām.
  17. function convert2columns_ag($colcontent, $columns, $column_spacing, $colW) { $res = '<table border="0" cellspacing="' . $column_spacing . '" width="' . $colW . ' px">'; $content = array_chunk(explode('<br/>', $colcontent), $columns); if (empty($content)) { $res .= '<tr><td></td></tr>'; } else { foreach ($content as $row) { $res .= '<tr>'; foreach ($row as $value) { $res .= '<td>' . $value . '</td>'; } $res .= '</tr>'; } } $res .= '</table>'; return $res; } Kā izskatās? Vienkāršota funkcija, bet īsti nesapratu tavu jautājumu... Un labāk tomēr padot tās garšas kā masīvu, citādi explode ar <br/> ir diezgan nekorekti. A ja nu tiek padots ar <br /> vai nu <br>? P.S. Silti iesaku kādreiz izlasīt manuālī visas string, array funkcijas, citādi tādi brīnumi tiek rakstīti, kā vietā pietiktu ar vienu funkciju.
  18. GedroX

    Ģenetīvs

    Nemaz nesaku, ka suns ir 6tā dzimte [deklinācija]. Bet nu vārds Zibens (vai arī uzvārds) pilnīgi varētu būt... :P
  19. 1. Klients prasa - klients saņem. Un vispār. Tu nekad neredzēsi šīs formas, ja netaisies strādāt GEMā. 3. Servera validācija stingrākā. Pat personas kodus pēc checksum validē.
  20. GedroX

    CSS un tabula

    Tīri ar CSS nekas neiznāks. Ja gribi ļoti automatizēti, nāksies vien likt klāt javascript. Skripts izskrien caur visu docu, atrod visas tabulas ar tavu klasi, sagrūž vajadzīgās klases tabulu šūnām. Cilvēki mīļie! Tagad nesāciet lamāt mani un stāstīt, cik tas ir stulbi! Diemžēl šajā forumā tā bieži notiek... Zinu, ka, jo mazāk js, jo labāk (visbiežāk), bet ja nu cilvēkam vajaga...
  21. Paldies! Godīgi sakot pats nezināju atšķirību.. o_O Žēl... Tagad arī ir uz RegExp. Un viss skaisti, tīri, nekādas kursora lēkāšanas pie nekorektas ievades. Tā arī darīju, starp citu. Kāpēc te visi brauc augumā. Za*** totāli. Bet kad šiem prasa kautko (ko pats neesmu nekad īsti darījis), šie mēmi un saka, lai paši tiekot galā. Funking stulbi! Iesakiet kādu ārzemju PHP forumu. Tinos prom. A ja nu klients pieprasa? ;) Nu tomēr laukā `cena` nevajadzētu rakstīt kkādas muļķības.
×
×
  • Create New...