Ritesh_4 71 Posting Pro

Hello
Is it possible to use SQL queries in a JS file?

Example I have the following code, and would like for each input[type='text'] encountered, to save its value to a sql table in a column:

jQuery("input[type='text']").blur(function(){
      var id = jQuery(this).attr('id');
      var inputVal = jQuery(this).val();      
      });
Ritesh_4 71 Posting Pro

So my code looks like this (am coding for Drupal here)

drupal_add_js('jQuery(document).ready(function(){     
        var fullDate = new Date();
        var dd = fullDate.getDate();
        var mm = fullDate.getMonth()+1;
        var yyyy = fullDate.getFullYear();
        if(dd<10){
          dd="0"+dd
        } 
        if(mm<10){
          mm="0"+mm
        } 
        var today = dd+""+mm+""+yyyy;

        jQuery("#form-gen-id").val(today+Math.floor(Math.random()*899+100));});','inline');
Ritesh_4 71 Posting Pro

@rproffitt
I've been told that they won't be having much traffic on the site, so went forward with the 3-digit random number. Also, with the DDMMYYYY value added as prefix I think it should be good for use

Ritesh_4 71 Posting Pro

Hi
Anyone can pls help me with a unique random number generator of length 3, prefixed with values from DDMMYYYY (e.g. for today's date 25062015001)?

Ritesh_4 71 Posting Pro

If you are referring to the Bootstrap framework, then follow this link:
http://getbootstrap.com/components/#navbar

Of course you also need to implement mobile css to display well in mobile devices, and can make use of the @media rule to customize according to screensize:
https://developers.google.com/web/fundamentals/layouts/rwd-fundamentals/use-media-queries?hl=en

Ritesh_4 71 Posting Pro

I believe you may be referring to something similar to what is explained in this link:
http://code.tutsplus.com/tutorials/design-and-code-your-first-website-in-easy-to-understand-steps--net-6062

Google can also help you more with specific searches.

Ritesh_4 71 Posting Pro

A friend told me to bridge a paperclip between the green and gray wires in the 24-pin socket of the PSU then switch on, thou I've not tried it yet. Anyone can confirm if this is a good alternative as well, or it may burn the whole thing?

Ritesh_4 71 Posting Pro

Hello
I want to test a power supply unit provided to me (not new, along with its power cord), but currently do not have a PC available to do so. How can I test whether the PSU is working OK before actually connecting it to the PC?

Cheers

Ritesh_4 71 Posting Pro

Hi
Have you tried to attach the monitor to a laptop's VGA port and see if you get any image there?

If not, then either the cable or the monitor itself is the problem's source, else there is a problem with your graphics card on the pc.

Ritesh_4 71 Posting Pro

hello diafol, will give the link a try.
"serveur", "makeCall" and "qparams" are indeed the variables which need to be used in the url

Ritesh_4 71 Posting Pro

Hello
Is there an equivalent for the following java code in php:

URI uri = URIUtils.createURI("http", serveur, -1, makeCall, URLEncodedUtils.format(qparams, "UTF-8"), null);

Cheers...

Ritesh_4 71 Posting Pro

Hello
I have a text-editor (CKEditor one) whereby am retrieving all the texts (which are in 3 paragraphs), in a single string variable, using Java codes.

However, all the 3 paragraphs being retrieved have leading spaces, and I want to remove them for display purposes. How can I do so, using this single variable to hold all the texts, and keeping them formatted on 3 different lines?

Example is (from the CKEditor source)
<p>This is line 1</p>
<p>This is line 2</p>
<p>This is line 3</p>

Ritesh_4 71 Posting Pro

Thnks for the links stultuske, I was actually having problems to resolve the TimeZone from my initial string to convert to the new one, since I did not know what the ZE4 was standing for (since it was generated automatically), but found the solution in the end.

Ritesh_4 71 Posting Pro

Addon:
Based on the above code, 05/05/2014 08:43:08 ZE4, how can I get it in the Google format, that is YYYY-MM-DDThh:mm:ssTZD

Ritesh_4 71 Posting Pro

Hi
I have a code in java to generate a sitemap xml, and to get the last modified date using the following line of code:
oPrint.println(" <lastmod>"+ doc.getLastModified().toString()+"</lastmod>");

The output in the browser when calling the xml file is <lastmod>23/05/2014 16:48:24 ZE4</lastmod> which is in "dd/mm/yyyy"format.

However, from this link, https://support.google.com/webmasters/answer/183668?hl=en#183668, it states that the format has to be in YYYY-MM-DD format.

How can I convert my current output to the Google one?

Ritesh_4 71 Posting Pro
Ritesh_4 71 Posting Pro

Hi
Your first stop should be Photoshop and PSD like harun20 mentioned above, this will definitely help you start designing from scratch and turn the design into a theme/template for future use on a website (Google can be of great help here).

I would also recommend the book found on this link, http://www.learningwebdesign.com/, to help you start-up, and of course, the famous http://www.w3schools.com/ to learn html and related stuffs.

Ritesh_4 71 Posting Pro

thanks for the info guys, will have a look at these 2 mentioned options and see which suits better

Ritesh_4 71 Posting Pro

Hi
Some friends and myself are starting a web project in wordpress, whereby we'll need to access the same core wordpress files remotely from our home pcs.
Is there a way to have the core files "centered" somewhere, and each one of us can branch them, do our own modifications as required, and then merge these modifications on the "centered" core again, thus avoiding overwriting of the others' codes in case we are modifying the same php files etc?

PS. We don't have any "server" as such which can be accessed 24/24, just xampp installed on Windows to host the site locally on our individual Pcs.

Ritesh_4 71 Posting Pro

I figured out there is an "async" with the script tag where it is calling the js. However, I was then told that this "async" was added for optimization of the website, and now I need to find an alternative way to solve this issue.
I tried with "defer" but it stopped loading the script altogether.
Any help on this?

Ritesh_4 71 Posting Pro

Hello.
I have the following existing function, used to load images in fancybox, but although the code works find in FF, in Chrome am getting an error (in the "firebug"-like tool), whereby under the "link.fancybox({..." code it shows "Uncaught TypeError: undefined is not a function".
The error does not happen everytime I try to open with fancybox thou, it sometimes shows up whereby clicking on a fancybox image does not load the original version of the image, and sometimes it opens the image correctly.

Anyone can help pls?
NOTE: I won't be able to provide any link to test since my dev server is not accessible outside the network am on.

function initLightbox() {


    jQuery('a.lightbox, a[rel*="lightbox"]').each(function() {

        var link = jQuery(this);

        link.fancybox({
            padding: 0,
            cyclic: false,
            overlayShow: true,
            overlayOpacity: 0.65,
            overlayColor: '#000000',
            titlePosition: 'inside',                

            onStart: function() {               
                jQuery('.fixed-block').hide();              
            },
            onClosed: function() {      
                jQuery('.fixed-block').show();              
            },          
            onComplete: function(box) {             
                if(link.attr('href').indexOf('#') === 0) {
                    jQuery('#fancybox-content').find('a.close').unbind('click.fb').bind('click.fb', function(e){
                        jQuery.fancybox.close();
                        e.preventDefault();

                    });
                }
            }
        });
    });

}
Ritesh_4 71 Posting Pro

Hello
Anyone can pls help me, whereby I need to prevent the users from being able to delete a specific folder in Windows 7, but still have read/write/execute permissions on that folder?
Also I would like to restrict the user's options in terms of software he/she wants to install, with a pre-defined list of the allowed software?

Cheers.

Ritesh_4 71 Posting Pro

In my case these are stored in Domino Designer (IBM Lotus Notes), and don't have the tags mentioned above in any of these js files

Ritesh_4 71 Posting Pro

I managed to get it to work on my server, the only problem was when to use for example ././filename or ./filename, but I did figure it out in the end

Ritesh_4 71 Posting Pro

thanks the link was of great help

Ritesh_4 71 Posting Pro

Hello
I am doing maintenance on a web server, and have several js files present which I need to categorize. However, I am faced with the dilemma of identifying between clientside js files and severside ones.
Is there a distinct way to identify between these files?

Ritesh_4 71 Posting Pro

Hello
I've created a custom php page for display in WordPress, and the client wants to allow users to be able to save this page from the browser as a pdf file on their desktop.

How can I do so, keeping in mind that I do not have access to apache folders on the server, nor the www folder?

Ritesh_4 71 Posting Pro

Hello
I am currently working on a "local" dev wordpress site, where I have a JS file stored with the path as e.g, http://www.devsite.com/websites/wordpress/mysite/wp-content/themes/mtheme/validations.js

Currently, am using the relative path e.g. src = "././wp-content/themes/mtheme/validations.js" to load it.

However, on the live server, which is maintained by someone else and I have no access, the website is using something similar to the example to load its JS files: http://www.mysite.com/wp-content/themes/mtheme/jquery.js

My question is, will my relative path for the dev site work on the live one as well, or do is there a global path which can work on both, whereby I need to change the path on my dev server?

Ritesh_4 71 Posting Pro

Somewhat similar to JorgeM's link above, I got it to print the colors after going to File -> Page Setup in Firefox's options.
However, if an end user does not know about this, is there another way to make the "css" get printed without having to go customize the settings in the browser, as different browsers will have different settings?

Ritesh_4 71 Posting Pro

Hello
Am using the window.print function on a page, but it does not print the background color which I've set in my stylesheet for table cells.
Any way to fix this issue?

Ritesh_4 71 Posting Pro

Hello
I have a web form, whereby I want to allow users to only input dates in the format DD/MM/YYYY.
I've tried with the following code to show an error message if the date is not valid, however if I add something like 5/5/5, it still passes is as a valid value.

$('#DateB').blur(function(){
    var s= $('#DateB').val();
    var dateRegex = '^(0[1-9]|1[012])[\/\-](0[1-9]|[12][0-9]|3[01])[\/\-](19|20)\d\d$';
    if(!dateRegex.match(s)){
        $("#msgDOB").val("date format not valid");
        $("#msgDate").css("display","block");
    }else
    {
        $("#msgDate").css("display","none");
    }
});

Anyone can pls help me fine-tune this code?

Ritesh_4 71 Posting Pro

thanks for the info, in the end I did put the 2nd 2GB in my B1 slot for it to work, with my initial 2GB in the A1 slot. As for the 1GB I've had to leave it out completely, since putting it in the A2 or B2 slots resulted in not going past the POST test.Think will need another 1 GB RAM to be able to use the one I already have.

Ritesh_4 71 Posting Pro

You can use teamviewer or logmein to do so

Ritesh_4 71 Posting Pro

Hello.
I have a MB Asus P5B-VM, with 4 memory slots (dual channels). I already have a 2GB DDR2-800 RAM installed, and recently got 2 more RAMs, one a 2GB DDR2-800 same as my old one, and a 1GB DDR2-800. Can I install these 2 along side my old RAM?
The 4 slots are colored, with in A1 and A2 having yellow and black, and B1 and B2 having again yellow and black colored slots.
I would like to get confirmation before installing anything on it, just in case I might damage the whole thing with incorrect installs.

Ritesh_4 71 Posting Pro

I've managed to overcome this issue using the code example below:

    String pattern = "dd/MM/yyyy";
    SimpleDateFormat format = new SimpleDateFormat(pattern);                
    String patternYear = "yyyy";
    SimpleDateFormat formatYear = new SimpleDateFormat(patternYear);
Ritesh_4 71 Posting Pro

Hello
I have a Java Agent which I need to maintain (dev was done by someone else), with the following code samples extracted:

String type = (String) types.nextElement();
DemByDate dd = (DemByDate) client.typeDemande.get(type);

Vector v = (Vector) dd.demandes;

Calendar calendar = Calendar.getInstance();

calendar.set(dd.d2.getYear(), dd.d2.getMonth(), dd.d2.getDate());                       

int maxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);

dd.d2 = new Date(dd.d2.getYear(), dd.d2.getMonth(), maxDay);
dd.d1 = new Date(dd.d1.getYear(), dd.d1.getMonth(), 1);
XML("<ligne>");
XML("<typeBesoin>" + type + "</typeBesoin>");
XML("<nbre>" + v.size() + "</nbre>");
XML("<periodeDebut>" + format.format(dd.d1) + "</periodeDebut>");
XML("<periodeFin>"+ format.format(dd.d2) + "</periodeFin>");
XML("</ligne>");


class DemByDate {
    Vector demandes;
    Date d1;
    Date d2;
}

I need to replace the .getYear() and .getMonth() accordingly, but so far, trying something like (ignore quotes) "calendar.set(dd.d2.calendar.year, dd.d2.month, dd.d2.date;"
results in a red underlined line of code, despite having for e.g. for year, int year = calendar.get(Calendar.YEAR);

In my editor I am having the getYear etc crossed out with a horizontal line across it, same goes for the line

dd.d2 = new Date(dd.d2.getYear(), dd.d2.getMonth(), maxDay); 

whereby the Date, getYear and getMonth are crossed out.    

Anyone can help me with this pls?

Ritesh_4 71 Posting Pro

glad could help you out :)

Ritesh_4 71 Posting Pro

Yes the computer is part of a domain and has the Administrators group policy applied on the user using it.

Ritesh_4 71 Posting Pro

Hello, am currently facing issues with Windows 7 SP1 Pro, whereby if I do a right click, I can the Restrictions dialog appearing. The message is in the link below.
I already have my user as an administrator on the system.
Anyone can help me troubleshoot this problem?

Click Here

Ritesh_4 71 Posting Pro

You can try follow the steps mentioned in the following link and get your Windows working again:
http://www.techsupportalert.com/content/how-fix-bootmgr-missing-error-vista-and-windows-7.htm

Ritesh_4 71 Posting Pro

have you tried with a "background-size:cover" css?

Ritesh_4 71 Posting Pro

thanks will try the code

Ritesh_4 71 Posting Pro

In fact its more the regular expression which am looking for, but which will cater for the three formats posted earlier...

Ritesh_4 71 Posting Pro

Hello
Anyone can help me derive a validation for French phone numbers, given the following:

String (max 255 chars)
French telephone formats (0123456789,
+33123456789, 0033123456789)

T.I.A.

Ritesh_4 71 Posting Pro

I've never used this, but you can try it, DriverPack Solution, from this link: http://drp.su/

Ritesh_4 71 Posting Pro

I might have missed something here?? I remember installing Win 8 on a vm to test recently and it seemed the taskbar still had transparency, thou I forgot whether I changed the theme or it was by default...

Ritesh_4 71 Posting Pro

Sony Vegas or Corel Video Studio X6 would be fine I suppose, and also Adobe Premiere Elements, all of which are paid versions by the way

Ritesh_4 71 Posting Pro

Hello, am currently facing an issue in tinymce 4 with the tiny_mce_popup.js (which is by default a 3.x plugin ported to 4.x in compatibility mode), when trying to insert an image in the text area using a custom filemanager, am getting errors in firebug on lines 45 and 108, and thus unable to insert the image.

Anyone can help me?

Ps. The full code can be found on this link (my test site): http://cms.prolectronic.ch//alyweb/lib/tinymce_4/plugins/compat3x/tiny_mce_popup.js

Ritesh_4 71 Posting Pro

eventually found out that the ADSL TV option is provided only via the livebox and unless it is disabled, no other connection can be made on the yellow port, but in this case there will be no VOD available for use on my tv decoder as well...

Ritesh_4 71 Posting Pro

thanks for all the info provided