Daily Archives

Articles indexed Thursday October 18 2012

Page 13/17 | < Previous Page | 9 10 11 12 13 14 15 16 17  | Next Page >

  • LOAD DATA LOCAL INFILE custom value

    - by NR03
    How to add a custom value using LOAD DATA LOCAL INFILE? The column time_added is the 7th column and the file has only 2 values for the first and the second column. For the 7th column, time_added I want to use the unix timestamp when loading from file. This code isn't working: $result = mysql_query("LOAD DATA LOCAL INFILE '{$myFile}' INTO TABLE {$table} FIELDS TERMINATED BY ':' LINES TERMINATED BY '\n' SET `time_added`=unix_timestamp()");

    Read the article

  • Send and receive data in same ajax request with jquery

    - by Pedro Esperança
    What is the best way to send data and receive a response dependent on that data? Consider the php file used for the request: $test = $_POST['test']; echo json_encode($test); I have tried unsucessfully to achieve this with: $.ajax({ type: "POST", dataType: "json", data: '{test : worked}', url: 'ajax/getDude.php', success: function(response) { alert(response); } });

    Read the article

  • Difference in displaying inner div between IE and Chrome

    - by Gaara
    I have this code that has one "outerDIV" that contains an "innerDIV". On chrome the "innerDIV" size is 491px, whereas on IE it is 425px (same as outerDIV). Hence, on Chrome I can see the first two children of "innerdiv": "My test string #1" and "test2". But for IE I can only see the first child. I am not quite sure what the "right" behavior should be, as firefox does the same as IE. However I would like to have IE do the same as Chrome. I have been experimenting with some css styles (mainly overflow and display), but still can't make it right: IE will expand its height instead of its width to make the elements fit. Can you guys help me figure out a way to change the css so that IE will wraps the div elements inline? As a restriction though, I cannot change the width on the HTML. As a benefit, I am using a css that only loads for IE to patch these kind of IE inconsistencies. The same css will NOT load for chrome, so I don't need to worry about messing with chrome when changing the IE CSS. Thanks in advance! <html> <head> <style type="text/css"> <!-- body { font-family: helvetica; } .myContainer { overflow: hidden; border: 1px solid rgba(0, 0, 0, .5); font-size: 14pt; height: 49px; line-height: 49px; overflow: hidden; display: block; } .myContainer > DIV { float: left; white-space: nowrap; display: block; } .myContainer .item:first-child { padding-left: 10px; } .myContainer .item { float: left; padding-right: 32px; } --> </style> </head> <body> <div id="outerDIV" class="myContainer" style="display: block; width: 425px;"> <div id="innerDIV"> <div class="item"> --------My test string #1-------- </div> <div class="item"> ------test2------- </div> <div class="item"> test </div> </div> </div> </body> </html>

    Read the article

  • Odd SQL Results

    - by Ryan Burnham
    So i have the following query Select id, [First], [Last] , [Business] as contactbusiness, (Case When ([Business] != '' or [Business] is not null) Then [Business] Else 'No Phone Number' END) from contacts The results look like id First Last contactbusiness (No column name) 2 John Smith 3 Sarah Jane 0411 111 222 0411 111 222 6 John Smith 0411 111 111 0411 111 111 8 NULL No Phone Number 11 Ryan B 08 9999 9999 08 9999 9999 14 David F NULL No Phone Number I'd expect record 2 to also show No Phone Number If i change the "[Business] is not null" to [Business] != null then i get the correct results id First Last contactbusiness (No column name) 2 John Smith No Phone Number 3 Sarah Jane 0411 111 222 0411 111 222 6 John Smith 0411 111 111 0411 111 111 8 NULL No Phone Number 11 Ryan B 08 9999 9999 08 9999 9999 14 David F NULL No Phone Number Normally you need to use is not null rather than != null. whats going on here?

    Read the article

  • Java: Comparing a class with another within that class using a my own .equals

    - by user1670252
    I am making a method .equals replacing the equals method used. It accepts a object. I want it to check if that object equals the class that runs the .equals class. I know I want to compare all the private methods I have to that object. Is there a way to do this without making another private class to get the private variables from the object? How do I do this to compare equality not identity? I am stuck on this. Do i have to use == to compare? Also looking online i see others use recursion. If this is the way i have to do it can you show and explain it to me? so an example i have public boolean equals(Object o) { this is in a class we will call bobtheBuilder (first thing to pop in my head) I want to check if the object o is equal to the class he has private object array and a private int. I assume I want to check if the array and int of this class equal the array and int of the object.

    Read the article

  • Change Modul popup every 30 sec Javascript

    - by SoftwareDeveloper
    I have a div id called modalpage and have css. I need a javascript function which can dynamically shows popup for 20 mins and change in every 30 secs right now i have the following javascript function. Can anybody help me please <script language="javascript" type="text/javascript"> function revealModal(divID) { window.onscroll = function () { document.getElementById(divID).style.top = document.body.scrollTop; }; document.getElementById(divID).style.display = "block"; document.getElementById(divID).style.top = document.body.scrollTop; } which is called by a input id button. <input id="Button1" type="button" value="Click here" onclick="revealModal('modalPage')" /> Thanks

    Read the article

  • constructing a recursive function returning an array

    - by Admiral Kunkka
    I'm developing a function that has a random chance to loop through itself and put it's results in one array for me to use later in my PHP class. Is there a better way to do this more organized, specifically case 5. The array becomes sloppy if it rolls 5, after 5, after 5 looking unpleasant. private function dice($sides) { return mt_rand(1, $sides); } private function randomLoot($dice) { switch($dice) { case 1: $array[] = "A fancy mug."; break; case 2: $array[] = "A buckler."; break; case 3: $array[] = "A sword."; break; case 4: $array[] = "A jewel."; break; case 5: $array[] = "A treasure chest with contents:"; $count = $this->dice(3); $i = 1; while($i <= $count) { $array[] = $this->randomLoot($this->dice(5)); $i++; } break; } return $array; }

    Read the article

  • What is the most efficient method to find x contiguous values of y in an array?

    - by Alec
    Running my app through callgrind revealed that this line dwarfed everything else by a factor of about 10,000. I'm probably going to redesign around it, but it got me wondering; Is there a better way to do it? Here's what I'm doing at the moment: int i = 1; while ( ( (*(buffer++) == 0xffffffff && ++i) || (i = 1) ) && i < desiredLength + 1 && buffer < bufferEnd ); It's looking for the offset of the first chunk of desiredLength 0xffffffff values in a 32 bit unsigned int array. It's significantly faster than any implementations I could come up with involving an inner loop. But it's still too damn slow.

    Read the article

  • Background image Windows Phone 7

    - by Xavier
    I have a little question, I want to change the background of my application with C#. I tried this code : var app = Application.Current as App; var imageBrush = new ImageBrush { ImageSource = new BitmapImage(new Uri(imageName, UriKind.Relative)) }; app.RootFrame.Background = imageBrush; But it doesn't work, the background is dark.. I tried to do : app.RootFrame.Background = new SolidColorBrush(Colors.Blue); And it works well. So I don't understand where is the problem, my image is 480*800 px and I set Build Action to Content and Copy to Output Directory to Copy if newer . Thanks for all

    Read the article

  • Need to search email body for regex using VBA

    - by user6620
    I am trying to write a script that I can run from a rule withing outlook. The goal of this script is to search the email body for a regex pattern, \d{8}-\d{3}\(E\d\) in this case. I want to take that pattern and see if a folder with the name of the match exists and if not create one. I am not super familiar with VBA as I write mostly in python. I have copied and pasted the following bit of code together but at this time I am unable to get the MsgBox to appear when I send an email with 20120812-001(E3) in the body. I have two different versions below. --version 2-- Sub Filter(Item As Outlook.MailItem) Dim Matches, Match Dim RegEx As New RegExp RegEx.IgnoreCase = True RegEx.Pattern = "\d{8}-\d{3}(E\d)" If RegEx.Test(Item.Body) Then MsgBox "Pattern Detected" End If End Sub --Version 1-- Sub ProcessMessage(myMail As Outlook.MailItem) Dim strID As String Dim objNS As Outlook.NameSpace Dim objMsg As Outlook.MailItem Dim objMatch As Match Dim RetStr As String Set objRegExp = New RegExp objRegExp.Pattern = "\d{8}-\d{3}\(E\d\)" objRegExp.IgnoreCase = True objRegExp.Global = True strID = myMail.EntryID Set objNS = Application.GetNamespace("MAPI") Set objMsg = objNS.GetItemFromID(strID) MsgBox objMsg.Body Set objMatch = objRegExp.Execute(objMsg.Body) MsgBox objMatch End Sub

    Read the article

  • data parsed to database Nokogiri rails

    - by Charlie Allombert
    So I'm just getting started with Nokogiri and Rails I have the following which returns the name of someone. TEST.rb: require 'nokogiri' require 'open-uri' url = "http://www.imdb.com/title/tt1439629/" doc = Nokogiri::HTML(open(url)) puts doc.css("div#wrapper [...too long...]")[0].text Now I created a table in my DB on rails and want to send the returned name to the actor table in the name column! How would I do that ? I can't seem to find atutorial on this... My goal would eventually be to have a rails form where I'd input an IMDB link which would return title and so on... (Also I'm new to ruby rails and programming so please provide easy info!)

    Read the article

  • Google chat badge not working anymore?

    - by Coder12345
    I was using google talk chat badge (chatback - small iframe code that enables remote user to chat with you as anonymous) for some years but now it is not working anymore. The generated code is fine as it seems it opens a new window and all but after a second, it redirects to support.google.com page which of course is not of much use. I rechecked the code, generated new code, didn't help. Again redirects to support.google.com. The code is generated from http://www.google.com/talk/service/badge/New Anyone knows what's going on? Have they discontinued it or? Also, a suggestion - is there any alternative web-presence button like that for other messengers which don't require client on other end. For Skype, Windows Live or some other messenger?

    Read the article

  • git rebase from a url/path

    - by edA-qa mort-ora-y
    Why can I not rebase from the same location that I can pull? For example, if I am in a pository I can pull from another repository: git pull /path/to/other But I cannot rebase from that other repository; the following fails: git rebase /path/to/other The help for rebase doesn't mention any refspec's, so I don't know how, or even if, I can/should specify them. How can I rebase from a different location?

    Read the article

  • EF + UnitOfWork + SharePoint RunWithElevatedPrivileges

    - by Lorenzo
    In our SharePoint application we have used the UnitOfWork + Repository patterns together with Entity Framework. To avoid the usage of the passthrough authentication we have developed a piece of code that impersonate a single user before creating the ObjectContext instance in a similar way that is described in "Impersonating user with Entity Framework" on this site. The only difference between our code and the referred question is that, to do the impersonation, we are using RunWithElevatedPrivileges to impersonate the Application Pool identity as in the following sample. SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(url)) { _context = new MyDataContext(ConfigSingleton.GetInstance().ConnectionString); } }); We have done this way because we expected that creating the ObjectContext after impersonation and, due to the fact that Repositories are receiving the impersonated ObjectContext would solve our requirement. Unfortunately it's not so easy. In fact we experienced that, even if the ObjectContext is created before and under impersonation circumstances, the real connection is made just before executing the query, and so does not use impersonation, which break our requirement. I have checked the ObjectContext class to see if there was any event through which we can inject the impersonation but unfortunately found nothing. Any help?

    Read the article

  • Apps Script Office Hours - October 18, 2012

    Apps Script Office Hours - October 18, 2012 In this episode Ikai and Arun talk about this week's Apps Script news, a Twillio integration and demo, and answer questions from developers on topics such as: - An issue with Apps Script gadgets on Google Sites with custom domains. - Determining the maximum number of objects that can fit in ScriptDB. - Backing up scripts to an outside file store. From: GoogleDevelopers Views: 30 8 ratings Time: 29:14 More in Science & Technology

    Read the article

  • List of Microsoft training kits (2012)

    - by DigiMortal
    Some years ago I published list of Microsoft training kits for developers. Now it’s time to make a little refresh and list current training kits available. Feel free to refer additional training kits in comments. Sharepoint 2010 Developer Training Kit SharePoint 2010 and Windows Phone 7 Training Kit SharePoint and Windows Azure Development Kit Visual Studio 2010 and .NET Framework 4 Training Kit (December 2011) SQL Server 2012 Developer Training Kit SQL Server 2008 R2 Update for Developers Training Kit (May 2011 Update) SharePoint and Silverlight Training Kit Windows Phone 7 Training Kit for Developers - RTM Refresh Windows Phone 7.5 Training Kit Silverlight 4 Training Web Camps Training Kit Identity Developer Training Kit Internet Explorer 10 Training Kit Visual Studio LightSwitch Training Kit Office 2010 Developer Training Kit - June 2011 Office 365 Developer Training Kit - June 2011 Update Dynamics CRM 2011 Developer Training Kit PHP on Windows and SQL Server Training Kit (March 2011 Update) Windows Server AppFabric Training Kit Windows Server 2008 R2 Developer Training Kit - July 2009

    Read the article

  • Missing subject field values in user certificate (Windows)

    - by nwang
    I am trying to enroll (on behalf of) a user certificate but certain fields appear to be missing in the subject field. Specifically, O and OU. Using ADSI, I see that the fields have the values I want but when I generate the certificate using Enroll on Behalf, certreq.exe, or certmgr.msc (run as different user) O does not appear at all and OU values are the AD containers the user account belongs to. This occurs despite my specifying the values in my .inf for certreq and setting the values in certificate properties when using certmgr.msc. Am I missing something or could I have configured something wrong? I am using an in internal CA.

    Read the article

  • kvm -net only passing broadcast, multicast, and guest destination traffic

    - by user52874
    Figured this out just last week, but I can't find it now. Even printed it out. Can't find that either. Frustrating...so...help! Configured a 'monitoring' nic on a kvm guest (running 'Security Onion, if it matters). I read (somewhere) that the default nic configuration for a kvm guest is to only pass broadcast traffic, multicast traffic, and traffic with the guest's mac as a destination. There is an option to override this behaviour, and pass all traffic. It's something like --mac-filtering=no, or --mac-restriction=no, or something like that. Worked beautifully. Does this look at all familiar to anyone who can clue me in to the exact option syntax? thx.

    Read the article

  • Rename file in Amazon Glacier

    - by Benjamin
    Is it possible to rename an archive in Amazon Glacier? The documentation says: After you upload an archive, you cannot update its content or its description. The only way you can update the archive content or its description is by deleting the archive and uploading another archive. That would lead me to think that it's not possible, but I'm not sure whether the file name is considered part of the archive description.

    Read the article

  • Apache: Setting up a reverse proxy configuration with SSL with url rewriting

    - by user1172468
    There is a host: secure.foo.com that exposes a webservice using https I want to create a reverse proxy using Apache that maps a local http port on a server internal.bar.com to the https service exposed by secure.foo.com Since it a web service I need to map all urls so that a path: https://secure.foo.com/some/path/123 is accessible by going to: http://internal.bar.com/some/path/123 Thanks. I've gotten this far: <VirtualHost *:80> ServerName gnip.measr.com SSLProxyEngine On ProxyPass / https://internal.bar.com/ </VirtualHost> I think this is working except for the url rewriting. Some resources I've found on this are: Setting up a complex Apache reverse proxy Apache as reverse proxy for https server

    Read the article

  • Windows DFS Limitations

    - by Phil
    So far I have seen an article on performance and scalability mainly focusing on how long it takes to add new links. But is there any information about limitations regarding number of files, number of folders, total size, etc? Right now I have a single file server with millions of JPGs (approx 45 TB worth) that are shared on the network through several standard file shares. I plan to create a DFS namespace and replicate all these images to another server for high availability purposes. Will I encounter extra problems with DFS that I'm otherwise not experiencing with plain-jane file shares? Is there a more recommended way to replicate these millions of files and make them available on the network? EDIT: I would experiment on my own and write a blog post about it, but I don't have the hardware for the second server yet. I'd like to collect information before buying 45 TB of hard drive space...

    Read the article

  • site to listen on port 88

    - by JohnMerlino
    I want to get one of my sites to listen on port 88. In ports.conf in /etc/apache2 on ubuntu server, I add so web app can listen on port 88: NameVirtualHost *:80 Listen 80 NameVirtualHost *:88 Listen 88 I have this in my etc/apache2/apache2.conf, I have this: # Include the virtual host configurations: Include sites-enabled/ Under sites enabled, I have a file looks like this: Listen *:88 NameVirtualHost *:88 <VirtualHost *:88> ServerName dogtracking.com DocumentRoot /home/doggps/public_html/eaglegps.com/current/public <Directory /home/doggps/public_html/eaglegps.com/current/public> AllowOverride all Options -MultiViews </Directory> <LocationMatch "^/assets/.*$"> Header unset ETag FileETag None # RFC says only cache for 1 year ExpiresActive On ExpiresDefault "access plus 1 year" </LocationMatch> </VirtualHost> Then I try to restart apache: /etc/init.d/apache2 restart And I get: * Restarting web server apache2 /usr/sbin/apache2ctl: line 87: ulimit: open files: cannot modify limit: Operation not permitted Warning: DocumentRoot [/home/xtreme/Sites/DogGPS-CMS] does not exist apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [Thu Oct 18 18:04:21 2012] [warn] NameVirtualHost *:88 has no VirtualHosts /usr/sbin/apache2ctl: line 87: ulimit: open files: cannot modify limit: Operation not permitted Warning: DocumentRoot [/home/xtreme/Sites/DogGPS-CMS] does not exist apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [Thu Oct 18 18:04:22 2012] [warn] NameVirtualHost *:88 has no VirtualHosts (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action 'start' failed.

    Read the article

  • Postfix sends to original recipient name instead of alias name

    - by user141742
    I have setup Postfix as part of my ISPConfig implementation. It should just forward all mail. Clients should be able to define a new alias and receive mail on a different e-mail address, using ISPConfig. Example: A mail sent to [email protected] on my ISPConfig server should be forwarded to external mailbox [email protected] This works fine but one important thing. When opening the mailbox for [email protected] I see the mail with the original sender name, and the original recipient name, i.e. [email protected] I have tried the forward function and the send copy function on a mailbox in ISPConfig. Both cases show the original recipient [email protected] instead of the final recipient [email protected], as it would when I manually forward an e-mail. Can this be achieved without having to maintain a list for each entry? Thanks for looking into this. M.

    Read the article

  • What kind of router do I need to handle multiple external I.P addresses?

    - by user1308743
    I have 3 dedicated I.P addresses going to a location with a few servers, and 1 RVS4000 router. Right now, only one I.P is being used. I would like a router that can use all 3 I.P addresses and I can make rules like this: IP1:80 goes to ServerA IP2:80 goes to ServerB What kind of router/device with what features do I need to handle this? I will need to set 30-40 rules to forward certain ports to certain servers. Only a couple ports will need to go to IP2 or IP3. Thanks

    Read the article

  • php5-gd shows in "php -i | grep -i gd" but not in phpinfo();

    - by Qzen
    I am trying to enable GD in my installation of Apache2, PHP5 and MySQL on my Ubuntu server. I installed php5-gd with: apt-get install php5-gd And when I run php -i I get: gd GD Support => enabled GD Version => 2.0 FreeType Support => enabled FreeType Linkage => with freetype FreeType Version => 2.4.8 T1Lib Support => enabled GIF Read Support => enabled GIF Create Support => enabled JPEG Support => enabled libJPEG Version => unknown PNG Support => enabled libPNG Version => 1.2.46 WBMP Support => enabled Directive => Local Value => Master Value gd.jpeg_ignore_warning => 0 => 0 But it does not show up in phpinfo(); I have restarted the server four times and I have tried to restart Apache2 four million times. Does anyone have any idea of how to fix this problem?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17  | Next Page >