w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
database design issue and mails deleted upon account removal
On table alternative_appointm.mails You have to integrity constraints. Currently: CONSTRAINT `fk_mails_users1` FOREIGN KEY (`from` ) REFERENCES `alternative_appointm`.`users` (`user_ID` ) ON DELETE NO ACTION ON UPDATE NO ACTION, And CONSTRAINT `fk_mails_users2` FOREIGN KEY (`to` ) REFERENCES `alternative_appointm`.`users` (`user_ID` ) ON DELETE NO ACTION ON UPDATE NO ACTION) First step would be to add 'ON UPDATE CASCADE', you should do that on most constraints, it means if you ever update a user id it will directly be updated on the from or to columns. Next thing is that when a user is deleted on the users tables you want to delete all mails he send and not the one he receiveid. So you only want to delete mails where you can find the user id in the from column. So update

Categories : Mysql

Is there any Java API to read Exchange Database or deleted mails in outlook mailbox?
Microsoft released a Java Api for exchange . http://blogs.msdn.com/b/exchangedev/archive/2013/01/03/ews-java-api-1-2-get-started.aspx From this API we can get the mails from any folder including deleted items,purges etc.., Sample code : ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); ExchangeCredentials credentials = new WebCredentials(userName, password); service.setCredentials(credentials); service.autodiscoverUrl(autoDiscoverUrl); service.setTraceEnabled(true); ItemView view = new ItemView(20); FindItemsResults<Item> findResults; do { findResults = service.findItems(WellKnownFolderName.RecoverableItemsDeletions, view); for (Item item : findResults.getItems()) { System.out.println(item); } view.setOffset(view.ge

Categories : Java

Between older than 30 days and less than 90days
WHERE DateCol < DATEADD(dd, DATEDIFF(dd, 0, DATEADD(dd,-30, GetDate())), 0) AND DateCol > DATEADD(dd, DATEDIFF(dd, 0, DATEADD(dd,-90, GetDate())), 0) The DATEADD-DATEDIFF truncates the time part, so that 30 days ago means midnight 30 days ago. Demo

Categories : Sql Server

get_posts no older than X days - Wordpress
The exemple from the doc should work just fine. get_posts() uses WP_Query() behind the scene to make the actual request. For your case the modified example should look something like this: // Create a new filtering function that will add our where clause to the query function filter_where( $where = '' ) { // posts in the last 30 days $where .= " AND post_date > '" . date('Y-m-d', strtotime('-10 days')) . "'"; return $where; } add_filter( 'posts_where', 'filter_where' ); $query = get_posts(array ( 'numberposts' => 5, 'orderby'=>'comment_count', 'order'=>'DESC', 'post_type' => array ( 'post' ) )); remove_filter( 'posts_where', 'filter_where' );

Categories : PHP

How do I move files older than 30 days?
Use robocopy in a batch file for this kind of task: @echo off robocopy D: E: /mov /s /minage:30 Don't waste your time on trying to re-invent robocopy in VBScript.

Categories : Vbscript

Need to drop tables older than three days
There are two ways to do this; the first is based on your own date stamp; the second on the date the table was created. Assuming your datestamp was in the format YYYYMMDD I would do something like this: begin for xx in ( select owner, table_name from all_tables where regexp_like(table_name, 'TEST_TEST_[[:digit:]]{8}') and to_date(substr(table_name, -8), 'yyyymmdd') < trunc(sysdate) - 4 and owner = 'THE_OWNER' ) loop execute immediate 'drop table ' || xx.owner || '.' || xx.table_name || ' purge'; end loop; end; / Essentially, it's all about getting your SQL statement correct so that you only have cont

Categories : Oracle

How to filter dates older than 3 days in Crystal Reports?
Given: D1 D0 T <--|--|--|--|--|--|--> -5 -4 -3 -2 -1 0 D0: a deal that occurred 2 days ago D1: a deal that occurred 4 days ago Assuming: Want D1 Don't want D0 Then: Select Report | Selection Formulas | Record... Enter the following formula: (CurrentDate - {table.date_field}) > 3 To convert a string to a date, use this syntax: ( CurrentDate - DateValue({table.string_field}) ) > 3

Categories : C#

MySQL select only the newest records older than 2 days (timestamp)
Here's the query that gets what I want: select p.id, u.number, w.time_checked, w.check_type, w.username from people p inner join units u on p.id = u.resident left join wellness w on p.id = w.people_id left outer join wellness as w2 ON w.people_id = w2.people_id and w.time_checked < w2.time_checked where w2.people_id is null and w.time_checked < (NOW() - INTERVAL 2 DAY) order by w.time_checked asc

Categories : Mysql

calculate total used disk space by files older than 180 days using find
du wouldn't summarize if you pass a list of files to it. Instead, pipe the output to cut and let awk sum it up. So you can say: find . -mtime +180 -exec du -ks {} ; | cut -f1 | awk '{total=total+$1}END{print total/1024}' Note that the option -h to display the result in human-readable format has been replaced by -k which is equivalent to block size of 1K. The result is presented in MB (see total/1024 above).

Categories : Linux

Batch file to delete subfolders in directory if all files is older than 3 days
This uses a VBS script to calculate the date 3 days ago, and then checks if any files are younger than that, using xcopy, and if no files are younger than 3 days then it should remove the "C:UsersMahmo03SShabanAnsys" folder and subdirectories. 3 days is a date calculation and not exactly 72 hours. It's not tested. @echo off call :date today -3 echo mm-dd-yyyy 3 days ago was: %day% xcopy "C:UsersMahmo03SShabanAnsys*.*" "%temp%" /l /s /d:%day% |find ":" >nul if %errorlevel% EQU 1 rd /s /q "C:UsersMahmo03SShabanAnsys" goto :EOF :date set date1=%1 set qty=%2 set separator=%~3 if /i "%date1%" EQU "TODAY" (set date1=now) else (set date1="%date1%") echo >"%temp%\%~n0.vbs" s=DateAdd("d",%qty%,%date1%) echo>>"%temp%\%~n0.vbs" WScript.Echo year(s)^&_ echo>>"%temp%\%~n0.vb

Categories : Windows

Run a batch file that would delete files in a folder (and its sub folders) that are older then 30 days
I did some copy and paste for you from here: forfiles -p "C:whatever" -s -m *.* /D -30 /C "cmd /c del @path" See forfile documentation for more details.

Categories : Windows

Bash script to find file older than X days, then subsequently delete it, and any files with the same base name?
I doubt this can be done cleanly in a single pass. Your best bet is to use -mtime or a variant to collect names and then use another find command to delete files matching those names. UPDATE With respect to your comment, I mean something like: # find basenames of old files find .... -printf '%f ' | sort -u > oldfiles for file in ($<oldfiles); do find . -name $file -exec rm; done

Categories : Bash

While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

MySQL PDO delete users older than 2 days, delete content from other tables with user_id
Ideally, you'd define things with a FOREIGN KEY constraint, and define an ON DELETE CASCADE, which automagically will delete all that related data for you. If that's not possible for some reason (stuck with a MyISAM table for instance), you could simply JOIN the related tables (yes, you can delete from more then 1 table at once). If it's your first time doing that, do it on a testdatabase, and certainly not in production.

Categories : Mysql

Batch script to delete files older than X days (based on creation date, not modified date)
See if this helps - Keep the 5 *.config files (skip=5) with the most recent creation date Test it on sample files. @echo off pushd "d:folder" del file2.tmp 2>nul for /f "delims=" %%a in ('dir *.config /b /a-d ') do call :getcreationdate "%%~fa" sort /r <file2.tmp >file.tmp for /f "skip=5 tokens=1,*" %%a in (file.tmp) do del "%%~b" del file.tmp file2.tmp popd pause goto :EOF :getcreationdate set "file=%~1" set "file=%file:=\%" WMIC DATAFILE WHERE name="%file%" get creationdate | find "." >file.tmp for /f %%b in (file.tmp) do set dt=%%b set dt=%dt:~0,8%_%dt:~8,6% del file.tmp >>file2.tmp echo %dt% "%~1"

Categories : Windows

What should I use: bulk e-mails (with MailChimp) or transactional e-mails(with Mandrill)?
Transactional emails are typically non-marketing emails. Usually they are a thank you, confirmation, invoice, receipt etc. Something that is related to a transaction your customer made. General newsletters or promotional/sales emails (anything sent in bulk to a list) is not transactional. Here is Mailchimp's What is transactional email link

Categories : Email

Script for displaying respective WORK days, TRAVEL days and LEAVE days for a particular month
Let me help you figure out: First you need to prepare calendar data set for the month of June Use Pivot separately along with following and for the days of month June: Travel data Work Data Leave Data The pivot will work well on individual columns In order to appear These 3 data sets as one use dynamic query and use union all and also use case statements to appear T- Travel days etc.

Categories : Sql Server

How to measure run time of C++ code with older C++ (g++ 4.6.3) and older Boost library (1.46.1)?
Use C/POSIX: clock_gettime(CLOCK_MONOTONIC, ...); It's convenient to wrap it into a C++ function so you don't have to deal with the timespec struct members; better to just join everything into a long long or double. Example: double getTimeInSeconds() { struct timespec result; if (clock_gettime(CLOCK_MONOTONIC, &result)) throw ...something...; return result.tv_sec + (result.tv_nsec / 1000000000.); } You might have to link against librt (i.e. add -lrt to the linker options) and maybe pthreads.

Categories : C++

create zip file using thunderbird api
I got the solution for the above question.... var file = Components.classes["@mozilla.org/file/directory_service;1"]. getService(Components.interfaces.nsIProperties). get("AChrom", Components.interfaces.nsIFile); file.initWithPath(file.path+"\smad.zip"); var filenew = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("AChrom", Components.interfaces.nsIFile); filenew.initWithPath(filenew.path+"\home.txt"); const PR_RDONLY = 0x01; const PR_WRONLY = 0x02; const PR_RDWR = 0x04; const PR_CREATE_FILE = 0x08; const PR_APPEND = 0x10; const PR_TRUNCATE = 0x20; const PR_SYNC = 0x40; const PR_EXCL = 0x80; v

Categories : Java

Skipping weekends and splitting days with an event block of 3 days using fullcalender
There is no built in solution to do what you want and a multiple day event can't skip days inside of the interval; so I enjoy to find one, here is my solution! The script work like this; for the given start date I find the correct following two days according to weekends and set three variables with the single dates. For every date I find the number of week and using it I find if I have to create a multiple day event or more events. The most relevant code is: var firstDay = new Date(date.getTime()); while (firstDay.getDay() == 0 || firstDay.getDay() == 6) { firstDay.setDate(firstDay.getDate() + 1); } var secondDay = new Date(firstDay.getTime()); do { secondDay.setDate(secondDay.getDate() + 1); } while (secondDay.getDay() == 0 || secondDay.getDay(

Categories : Javascript

counts days inbetween then add class to those days with nested divs?
You mean something like this? $(function(){ var $class1 = $('.class1'); var $class2 = $('.class2'); var $afterClass1 = $class1.nextAll('.test'); var $beforeClass2 = $class2.prevAll('.test'); var count = $afterClass1.length + $beforeClass2.length; $('.count').html(count); }); http://jsfiddle.net/SAsty/ Edit: Better visualization http://jsfiddle.net/SAsty/3/ Edit 2: Do something like: var $allBetween = $afterClass1.add($beforeClass2); $allBetween.addClass('between');

Categories : Javascript

Why the Item deleted from an array but isn't deleted from my table?
You're not returning the table after you delete the item. When you call the method to delete it and write out the table, that table is not returned after you remake the table. Take this: JScrollPane loginsScrollPane = new JScrollPane(loginsTable); Bring it outside of your method. What I think might be happening is when you create your loginsScrollPane locally inside the method, it's not being added properly to your testPanel. I think what might be happening is when you add it, and the method ends it's loosing that data that is contained. Declare your scrollpane, and your jtable where you declare your frame.

Categories : Java

How would I change Thunderbird's default CSS for links?
I don't believe that this is something that Thunderbird can handle. The reason you can see the link styles when you receive an email in Thunderbird is because Thunderbird is receiving an HTML-formatted email created by another program. Other than some basic styles that Thunderbird provides, it is not a tool for creating full blown HTML emails.

Categories : CSS

Get selected message data in Thunderbird extension
This documentation looks fairly outdated. I would suggest: using gFolderDisplay.selectedMessage (try typing top.opener.gFolderDisplay.selectedMessage in the Error Console), reading some recent code that uses Services and MailServices so as to simplify your code. That being said, I don't know what you're trying to achieve but: you'd certainly be better off using a wrapper such as MsgHdrToMimeMessage (self-reference: http://blog.xulforum.org/index.php?post/2011/01/03/An-overview-of-Thunderbird-Conversations) if you absolutely, absolutely need to get the raw contents of the message, http://mxr.mozilla.org/comm-central/source/mailnews/db/gloda/modules/mimemsg.js#223 has an example on how to do that (it's the implementation of the said MsgHdrToMimeMessage; by simplifying it, you should be

Categories : Javascript

How do I mimic Thunderbird's username/password encryption in C#?
I think that file contains the saved passwords for web forms of webpages. You'd be better off touching cert8.db, key3.db or secmod.db which are NSS files that contains the credentials for the web servers. Beware, these are potentially encrypted by a master password. I believe you should be able to find some documentation about that.

Categories : C#

read thunderbird address mab files content
I am afraid there is no answer that will give you a proper solution for this question. MORK is a textual database containing the files Address Book Data (.mab files) and Mail Folder Summaries (.msf files). The format, written by David McCusker, is a mix of various numerical namespaces and is undocumented and seem to no longer be developed/maintained/supported. The only way you would be able to get the grips of it is to reverse engineer it parallel with looking at source code using this format. However, there have been experienced people trying to write parsers for this file format without any success. According to Wikipedia former Netscape engineer Jamie Zawinski had this to say about the format: ...the single most brain-damaged file format that I have ever seen in my nineteen yea

Categories : File

Thunderbird Extension: Get the mail HTML and Object
http://mdn.beonex.com/en/Extensions/Thunderbird/HowTos/Common_Thunderbird_Use_Cases/View_Message.html has some examples. You could either render the email first, and use that, or get the raw contents of the message (you probably don't want that).

Categories : Javascript

Send email from clipboard without opening Thunderbird
I found the answer on lifehacker, here http://lifehacker.com/355941/quickly-compose-new-gmail-messages-with-launchy

Categories : Email

Query related to getting number of days in between of two days
C# code: int YourVersion() { DateTime dt1 = DateTime.Now; DateTime dt2 = DateTime.Now.AddDays(-10); int daysDiff = (dt2 - dt1).Days; return daysDiff; } int SeniorVersion() { DateTime dt1 = DateTime.Now; DateTime dt2 = DateTime.Now.AddDays(-10); TimeSpan ts = dt2 - dt1; int daysDiff = ts.Days; return daysDiff; } Compiled on VS2013, Release build, decompiled IL: Yours: .method private hidebysig instance int32 YourVersion() cil managed { // Code size 48 (0x30) .maxstack 2 .locals init ([0] valuetype [mscorlib]System.DateTime dt1, [1] valuetype [mscorlib]System.DateTime dt2, [2] int32 daysDiff, [3] valuetype [mscorlib]System.DateTime CS$0$0

Categories : C#

Freeware e-mail client for small companies excluding Thunderbird
I'd go for the e-mail client that is built in the Opera browser if I had a small company. You have one application for web browsing and e-mail communication with lots of features. I however have no idea whether you are able to choose you browser freely. Other alternatives could be Pegasus Mail and Incredimail.

Categories : Email

inline image in html, base64, doesn't appear in gmail (but does in thunderbird)
To the best of my knowledge there are no rules about how Mail User Agents (i.e. your mail reader) has to treat inline images. The "usually" results in your testing are the most troubling. It isn't how you are sending them, it's how the reader chooses to render it. There's a reason that graphics heavy emails have a click here to view as a web page link, because there is too much variation. I'd suggest that route or just making them multipart-mime attachments and forget trying to inline them reliably.

Categories : Python

Why is PHP HTML-Mail with Image Attachment in Thunderbird rendering incorrect?
$img_src = "km.png"; //about 79KB //$imgbinary = fread(fopen($img_src, "r"), filesize($img_src)); //$img_str = base64_encode($imgbinary); $to= "name@example.com"; $subject = "Test Subject"; $headers = "From: youremail@somewhere.com "; $headers .= "Reply-To: youremail@somewhere.com "; $headers .= "MIME-Version: 1.0 "; $headers .= "Content-Type: text/html" . " "; $headers .= "Content-Transfer-Encoding: base64" . " "; $message ="<html><head><title></title></head><body><h1>Hello World</h1><img src='".$img_src."' alt='no img' /><p>Some Testcontent with umlauts ÖÄÜß</p> <h1>Hello World</h1><img src='".$img_src."' alt='no i

Categories : PHP

Save on device without getting deleted once app is deleted
Yes you can save some data in the keychain, which will persist if you app is delete. But it will be removed if the device is reset.

Categories : IOS

org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations):
Without mapping end code is a bit hard... This is caused, usually, because you are deleting an object associate to a collection. You have to remove object from owning collection(s) and, after, delete object parentObject.collection.remove(objToDelete); session.delete(objToDelete); session.save(parentObject); But you can avoid this using deleteOrphan to mapped collection in this way class ParentObject { @OneToMany(orphanRemoval=true) private List<ChildObject> collection; } and code looks like parentObject.collection.remove(objToDelete); session.save(parentObject); You don't more need object deletion because it is automatically removed by Hibernate when saving parentObject. Hope can help

Categories : Hibernate

border in html email doesn't show up in outlook 2010, but works in Thunderbird
This might not be a complete answer, as I don't have access to an outlook 2010 client (see edit below), but here is my best attempt: According to this, the display style property is not supported in outlook 2010: http://campaignmonitor.cachefly.net/assets/files/css/campaign-monitor-guide-to-css-in-email-jan-2013.pdf?ver=1252 Since <span> is an inline element, and since display doesn't work in outlook 2010, then giving an inline element a border might not be supported in outlook 2010. Try to switch it to a div (or better, put the border-top style on the tr/ td) e.g. <tr><td colspan="5"><div class="solid" style="width:100%;height:1px;border-top:1px solid #f89d30;"></div></td></tr> EDIT: just tested it on outlook 2010, it didn't do the trick.

Categories : HTML

Deleted copy constructor results in deleted default constructor
C++11 §12.1/5 states: A default constructor for a class X is a constructor of class X that can be called without an argument. If there is no user-declared constructor for class X, a constructor having no parameters is implicitly declared as defaulted (8.4). Your Base(const Base&) = delete; counts as a user-declared constructor, so it suppresses generation of the implicit default constructor. The workaround is of course to declare it: Base() = default;

Categories : C++

How can I get MySQL records from past 7 days, but only days that have a record, and return each day as a record?
You won't be able to get the same day results back as an array, but you can group it by date, with the titles comma separated: SELECT GROUP_CONCAT(title) AS titles, date FROM test WHERE date > DATE_SUB(CURDATE(), INTERVAL 7 DAY) GROUP BY date; Then in PHP, do something like this: foreach ($results as $row) { echo $row['date']; foreach ($row['titles'] as $title) { echo $title; } }

Categories : PHP

SQL Query to find users with no record within the last 30 days, but with a record within the last 90 days
select distinct(userid) from thetable where recorddate > DATE_SUB(now(), INTERVAL 90 DAY) and userid not in ( select userid from thetable where recorddate > DATE_SUB(now(), INTERVAL 30 DAY) ) I don't know mySQL well, so use the appropriate way for checking if a date is within the last x days I assume that a userid can be in the table multiple times, but you only want them returned once. Hence the "distinct"

Categories : Mysql

Getting some and not all mails using Zend_Mail_Storage
Such functionality is not available. However, all messages have a number starting with 1. If you are just reading emails, then you can cache last opened message number, and next time start to retrieve emails starting from this (cached) number. Another solution is to cache all opened messages (read more) but the trick is how to invalidate the cache in this case. Quick Example: $mail = new Zend_Mail_Storage_Imap(array('host' => 'localhost', 'user' => 'root', 'password' => '******')); $cachedId = (apc_exists('email_id') ? apc_fetch('email_id') + 1 : 1); for ($id = $cachedId ; $id <= $mail->countMessages() ; $id++) { echo sprintf('%d, %s <br/>', $id, $mail->getMessage($id)-

Categories : PHP

Mails for verification using Nodemailer
Saransh, You absolutely can use the same domain and email address with both Google Apps and AmazonSES without any issues. When it comes to receiving emails, all messages have to be directed to a single server (your MX records). But sending email is very different in that you can send email from many different sources without any issues. To ensure your messages don't go to the SPAM folder just be sure to properly authenticate all your messages with SPF and DKIM. I'm not sure how this works with AmazonSES, but it was really easy with the provider that I chose for my email http://socketlabs.com

Categories : Node Js



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.