w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
SQL query for various time periods
A simple starting point would be something like below, of course you may want to adjust the ith value to suit your needs; SET @period='1M'; SELECT CASE WHEN @period='1Y' THEN YEAR(completed_time) WHEN @period='1M' THEN YEAR(completed_time)*100+MONTH(completed_time) WHEN @period='2M' THEN FLOOR((YEAR(completed_time)*100+MONTH(completed_time))/2)*2 WHEN @period='1W' THEN YEARWEEK(completed_time) WHEN @period='2W' THEN FLOOR(YEARWEEK(completed_time)/2)*2 END ith, SUM(BOOK_CNT) Total FROM my_tab GROUP BY ith ORDER BY ith DESC; An SQLfiddle to test with.

Categories : Mysql

PHP time format, am and pm with periods
There's no straightforward way. What I'd do is fetch date("a"), see whether it's am or pm, and then output a.m or p.m accordingly.

Categories : PHP

Lagging over multiple time periods in R
Try the following instead: sapply(-1:-2, function(k) lag(data$orders, k=k)) you might want to use , simplify=FALSE if you'd like to preserve the attributes

Categories : R

How do I get in progress periods in Joda Time?
Soounds like you need an interval : http://joda-time.sourceforge.net/apidocs/org/joda/time/Interval.html And use the minusdays method. (yes it easy, very much so compared to the vanilla java date/calendar) To get the time of day : int hour = dt.getHourOfDay(); int min = dt.getMinuteOfHour(); int sec = dt.getSecondOfMinute();

Categories : Java

SSRS Subscriptions - Daily Emails Within a Time Interval
Not through Report Manager; you've already seen that you have limited options there. However, when you set up an SSRS subscription, behind the scenes it's just set up as a normal SQL Server job run through the SQL Server Agent - these jobs are set up under a GUID type name, i.e. something like 8DF42130-97D3-41F7-B3EF-72E48BFDFBFA. This means that you can update the job schedule in Management Studio with a few more options: You should be able to update a SSRS created subscription to suit your requirements. Not sure why you can't just do this through Report Manager, but hopefully this will help.

Categories : Sql Server

MySQL grouping results by time periods
With little info on your tables this is no more than a basic idea for you, but you could do something like this:- SELECT COUNT(*) FROM ( SELECT a.TimeStamp AS ThisTimeStamp, MIN(b.TimeStamp) AS NextTimeStamp FROM SomeTable a INNER JOIN SomeTable b ON a.TimeStamp < b.TimeStamp GROUP BY a.TimeStamp ) Sub1 WHERE Sub1.ThisTimeStamp < (Sub1.NextTimeStamp - 600) Get all the timestamp and join them against all other timestamps that are greater, and use MIN to narrow that down to the next greatest timestamp. Then from that select the count where the difference is less than 600 seconds (assuming unix timestamps). EDIT - If you want the tied down for the number of 10 minute+ gaps in events for users then:- SELECT COUNT(*) FROM ( SELECT a.user_id, a.TimeStamp AS Thi

Categories : Mysql

Best way to determine and store Pay Periods for a time clock in PHP and MySQL
I think you are over thinking this. Let thte user define the start and end dates. You will need the UserId, a timestamp (time in and time out) of the user and that should be about it. I picture something like this: UserId | DateIn | DateOut On the page you could put put dropdowns (or if you want a nifty interface a datepicker that uses javascript) and allow the manager to pick a start and end date that he wants to choose. So if he wants to see an employees time between Jan. 1 and Feb. 31 he can choose those as his start and end dates. This will allow things to be very flexible, for example the manager can choose Feb 16 as start date and Feb 29 as end date. It makes sense to allow him to choose the data requirements so he can view whatever he wants. EDIT: An example from my comment

Categories : PHP

Periodically running script with periods of time idle?
Windows have Task Scheduler. You can schedule a recurring task which runs at 01:30 every day which starts a script which register task to run every three minutes. Also, schedule a task at 23:50 which will run a script that disables the task that runs every 3 minutes, and then continues with running DO.py.

Categories : Python

rails order by time with reversed 24 hour periods
I guess you can do it like that c = Event.where(:time_start > 12.hours).order(:time_start) << Event.where(:time_start < 12.hours).order(:time_start) this will concatenate the two results one after the other and give you the desired result.

Categories : SQL

What is a good way to record time periods in Rails application, so that I can easily use them for calculations?
It would be best to store them all in a standardized format; like seconds, so that you can easily do calculations without having to first convert things. If you also stored some sort of units field (i.e. years, days, minutes, seconds), you could then easily convert the seconds back to their appropriate units for display - sort of like what you have above. stored_value_in_minutes = stored_value.seconds / 1.minutes

Categories : Ruby On Rails

Pandas data frame: adding columns based on previous time periods
You could groupby person and then apply a shift to the values: In [11]: g = df.groupby('person') In [12]: g['value'].apply(lambda s: s.shift()) Out[12]: 1 NaN 2 NaN 3 NaN 4 NaN 5 NaN 6 0 dtype: float64 Adding this as a column: In [13]: df['lastPeriod'] = g['value'].apply(lambda s: s.shift()) In [14]: df Out[14]: person period value lastPeriod 1 P22 1 0 NaN 2 P23 1 0 NaN 3 P24 1 1 NaN 4 P25 1 0 NaN 5 P26 1 1 NaN 6 P22 2 1 0 Here the NaN signify missing data (i.e. there wasn't an entry in the previous period).

Categories : Python

Trying to aggregate (and average) time series data (collected every five minutes) into day and night periods for each 24 hr period in R
You don't have a particularly good dataset to test code since you have only am cases for the first data and pm cases for the second, but this will do a two-way classification by date and am/pm indicator in the time column. I also removed all the non-numeric columns from consideration, since it makes no sense to ask for the mean of a factor. new2 <- aggregate(dat[unlist(lapply(dat, is.numeric))], by = list(date, gsub("^.+ ", "", dat$GMT_Time) ), mean) new2 Group.1 Group.2 CollarID ActivityX ActivityY ActivitySum Temp 1 2000-01-01 AM 2905 0.00000 0 0.00000 21.66667 2 2011-02-21 PM 2905 10.66667 12 22.66667 20.66667 The gsub call is removing any character between the beginning of the string and the last instance of a

Categories : R

Matlab - Compatibility in Different Editions
MathWorks try pretty hard not to make things incompatible between releases, and when they know they're going to make some changes that will break existing code they try to announce it a few versions before they release, in order that you have a year or so to prepare any changes you might need to make. But they do make improvements that sometimes introduce incompatibilities, and they do fix bugs that sometimes people didn't realise were bugs and were relying on - and sometimes, they accidentally break something without realising, or introduce a bug they didn't anticipate. When they do that, they will often post a workaround or fix on the support site. If you have a particular problem with your code related to an incompatibility between releases, post it.

Categories : Matlab

Session get null before the session time out periods in MVC3
I've able to overcome this issue by adding Action filter to my controller using System.Web.SessionState; [SessionState(SessionStateBehavior.Required)] public class HomeController : Controller { } Now I can ideal my site for longer time

Categories : Asp Net Mvc

Differences between MySQL Cluster OSS and CGE editions
All the core features are available in the GPL version. Besides support, the commercial version includes non-free management tools.

Categories : Mysql

GUI client for SVN for Windows that integrates with Visual Web Developer 2010 & older Express editions
Try TortoiseSVN. It's the best standalone SVN client for Windows. Microsoft does not allow to use 3rd party extensions with Visual Studio Express / Visual Web Developer.

Categories : Svn

iOS subscriptions and In-App Purchases
Technically - of course, yes, why not? It's your business to decide, what does the subscription give to the user. But you should guarantee, that, anyway, subscription reamins useful for user. I mean, you must guarantee, for example, that "usual" issues should be published regularly, and if user subscribes to your app - he can be sure, that he will receive issues he paid for. Because, on the other hand, it will be unfair from your side, if you'll do something like "Oh, sorry, but there is no usual issue this week. Of course, you paid usual price for this month. You were just unlucky. We suggest you to buy our special issue."

Categories : IOS

communicate between subscriptions in azure
Correct, a virtual network is currently limited to the scope of a single subscription. This is definately something we're looking to make better soon. For the time being, you'll need to set up multiple VPN tunnels if you want to divide your Azure-hosted resources across multiple subscriptions.

Categories : Networking

Publications Subscriptions Observe
The solution is so easy ! Meteor.autosubscribe( function () { Meteor.subscribe( 'chat', { room: Session.get( 'currentRoom' ) } ); } ); If you want to limit your subscription to the maps viewport with changing viewport-bounds, than you have to use autosubscribe. It seems that autosubscribe takes care of changing subscription-arguments :) Meteor.autosubscribe( function () { var a = Session.get('bounds'); if(a) Meteor.subscribe( 'posts', a.swlat, a.swlng, a.nelat, a.nelng, 5 ); } );

Categories : Meteor

SSRS 2008 R2 Subscriptions
This should be possible with a "Data-Driven" subscription, which unfortunately requires the Enterprise version of SQL Server. I will need to defer to someone who has experience with that version. If we're talking less than 5 subscriptions, then do them individually and either hard code or pull their contact info for each subscription. It's not ideal, but it works.

Categories : Reporting Services

Is it possible to view all active subscriptions
Don't have an idea about "active" subscriptions. But there is an object Meteor.default_connection._subscriptions that stores information of all the subscriptions that have been subscribed till the given time. var subs = Meteor.default_connection._subscriptions; //all the subscriptions that have been subscribed. Object.keys(subs).forEach(function(key) { console.log(subs[key]); // see them in console. }); Not exactly what you want though.

Categories : Meteor

Paypal subscriptions button and details
I allow users to register for my site. After registration their account is created and they get a user level of 1. At this level they are shown a Paypal button to pay for the full subscription. After they pay my ipn will change their user level to 2 and update their info in the data base to paid and the date of payment.

Categories : Database

Get YouTube Channel Subscriptions in Java
You can get those using Analytics API Sample requests would help you understand. Analytics API is a different service but libraries come in same package and you can use same authorization with adding "https://www.googleapis.com/auth/yt-analytics.readonly" scope Here's a JAVA sample for Analytics API./

Categories : Java

Google Reader Subscriptions With OAuth2
The library tries to get user's profile, which requires userinfo.profile scope (https://www.googleapis.com/auth/userinfo.profile). Add that scope to your config and it should work.

Categories : PHP

Order of IPN returns when setting up subscriptions
Either way should work. Another option that some merchants have done, is written all of the information to their database and set up the account before sending the buyer over to PayPal to sign up and make the payment. Then the merchants would rely on the IPN to actually activate the IPN or activate it beyond it's free trial period. You could also set up a script to check your system periodically to see if there are any profiles that are deactivated and should be removed from your system, or that never paid.

Categories : Paypal

Use iCloud To Restore Non-Renewing Subscriptions
I'm just looking into this, and for what I understand you must save your relevant data (that is, subscription expiry, typically) in a file that will be saved when a iCloud backup is performed. This way, the file will be sync in all devices, and your users will enjoy the subscription paid in one device, among all of them. Customers should be warned they have to use iCloud or they won't have it available everywhere, of course. Hope this helps, jaime

Categories : IOS

Restore transactions for Non-renewing subscriptions without registration
I have submit my app to the appStore. I restore transactions for Non-renewing subscriptions who register or login. I do not restore transactions for Non-renewing subscriptions who don't "register" and "delete my app". My app is approved

Categories : Iphone

Google wallet annual recurring subscriptions?
Technically there's no way to configure an annual subscription. But I suppose you can work around it: Request an initial payment for the entire first year and then a monthly-recurring payment at a discount. For example, suppose you offer a monthly plan that costs $100. And you want to offer an annual plan for $900 (25% discount). Instead, you may offer an initial payment of $900 followed by 36 monthly-recurring payments of $75. What this means for your business is that once a user has paid for and used your service for an entire year then you start treating her as a "loyal customer" and let her keep paying the discount price without committing for another year.

Categories : Android

iOS In-App purchase subscriptions integration with a third party system
So you want the people that have bought the service from the website to be able to use the app, exactly like if they had purchased it from in App Purchases and in App Purchases people to be able to join the service just like people that joined through the site? As far as I know, Apple doesn't allow you to pay through other services as you said, but let's say someone buys the service from the app. What should happen would be that the money will be transferred to the company. Then after the payment you should include some code doing what the site does after a new person has payed for the service, so create his account as a paid account. Then, the app should also have a login screen where the registered users (no matter where they registered from) will be able to login into the app and use th

Categories : IOS

Select just thumbnails from user's youtube subscriptions
Add fields=entry(media:group(media:thumbnail(@url))) to your API call url. More about this, here: https://developers.google.com/youtube/2.0/developers_guide_protocol_partial#Fields_Formatting_Rules

Categories : PHP

Paypal IP Recurring Subscriptions - custom field
Yes it is. Once you verify the IPN, (well actually before as well but always verify first...) the name value pair collection you get will contain all fields that have data, including the "custom" field. For reference this shows all possible values in a subscriptin IPN https://www.paypal.com/cgi-bin/webscr?cmd=p/acc/ipn-subscriptions-outside

Categories : Paypal

Facebook Realtime Update Subscriptions and new app users
All of the connections you can subscribe to are listed here: https://developers.facebook.com/docs/reference/api/realtime/ - the Application object is not one, nor is there a connection of the application object which returns a list of users Since you need to make an API call to register each new user anyway, why not log the new user into your own system at that point? or at the time they first authorise your app?

Categories : Facebook

Restoring expired auto-renewable subscriptions
"Store Kit provides built-in functionality to restore transactions for non-consumable products, auto-renewable subscriptions and free subscriptions. To restore transactions, your application calls the payment queue’s restoreCompletedTransactions method. The payment queue sends a request to the App Store to restore the transactions. In return, the App Store generates a new restore transaction for each transaction that was previously completed. The restore transaction object’s originalTransaction property holds a copy of the original transaction. Your application processes a restore transaction by retrieving the original transaction and using it to unlock the purchased content. After Store Kit restores all the previous transactions, it notifies the payment queue observers by calling thei

Categories : IOS

Subscriptions to model lifecycle events accumulate
I guess to avoid accumulation of subscriptions you should use one: http://emberjs.com/api/classes/Ember.Evented.html#method_one as a one time subscription. one subscribes a function to a named event and then cancels the subscription after the first time the event is triggered. remove any existing subscription As for the unsubscription, you could do it with on's counterpart off: http://emberjs.com/api/classes/Ember.Evented.html#method_off Hope this helps.

Categories : Ember Js

in-app purchase for auto-renewal subscriptions notifications
Answering question 1, you can verify subscription receipts in the same way as other IAP, but you'll need to check it periodically to see if the subscription has expired (the verification will tell you if it's expired). There is more info on the Apple docs here: http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html

Categories : IOS

Split string on periods '.'
Try the following: /.(?![w.]*['"]])/ This seemed to work in the Regexp tester I was using. And it also works in my JSFiddle. I simply changed w* to [w.]*

Categories : Javascript

Multiple dots/periods in CSS
The selector simply means select any a element having class .button AS WELL AS .gold so your anchor tag should look like <a href="#" class="button gold">Hello</a> Demo The selector can be also written as element[attr~=val] as @BoltClock Commented like a[class~="button"][class~="gold"] { color: #f00; } Demo Generally the above(Not the selector, but calling multiple classes for a single element method) is also used when you want to apply properties of 2 classes to a single element, so say for example you have .demo having color: green; and .demo2 having font-weight: bold; so using <p class="demo demo2">Hello, this will be green as well as bold</p> Will make it green as well as bold. Demo 2

Categories : HTML

How to quantify overlap between three periods?
I found a solution (see below). The code looks rather cumbersome though, so can probably be made more efficient. Any advise is welcome! spec.fu <- function(years,birth,begin,end,age.cat,data){ birth <- data[,birth] start.A <- data[,begin] end.A <- data[,end] if (any(sapply(c(birth,start.A,end.A),FUN=function(x) class(x)!="Date"))) { stop("'birth', 'begin' and 'end' must be of class 'Date''") } # ifelse-function that saves Date class in vectors # (http://stackoverflow.com/questions/6668963) safe.ifelse <- function(cond, yes, no) { structure(ifelse(cond, yes, no), class = class(yes))} for (i in years){ start.B <- rep(as.Date(paste(i,"01-01",sep="-")),nrow(data)) end.B <- rep(as.Date(paste(i+1,"01-01",sep="-"

Categories : R

Remove multiple periods from a name in sql
Here is a (rather complicated) way to do this: DECLARE @DataTable TABLE(Data VARCHAR(100)) INSERT INTO @DataTable VALUES ('test.test.doc'), ('test.test.test.docx') SELECT REPLACE(LEFT(Data,LEN(Data)-CHARINDEX('.',REVERSE(Data),0)),'.','_')+ RIGHT(Data,CHARINDEX('.',REVERSE(Data),0)) Col1 FROM @DataTable These are the results: ╔═════════════════════╗ ║ Col1 ║ ╠═════════════════════╣ ║ test_test.doc ║ ║ test_test_test.docx ║ ╚═════════════════════╝ And here is a sqlfiddle with a live demo of it.

Categories : SQL

Can I store subscriptions in a collection named differently than on server
I found the solution through help of Andrews Hint the Discover Meteor book that shows a lot of publishing subscription scenarios. Anyway: After reading I discovered that the question I was heading for is also answered in the Meteor documentation Meteor.publish The last example basically creates a virtual collection "counts" for the "messages" collection. Well done already ;-) "Wer lesen kann ist im Vorteil!"

Categories : Meteor



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