2018-10-22         Lewis

SQL Server studio Function variable scope error

I was trying to use a function as an exercise wherein I have 2 string delimited by ; (example: '1;22;333;444;;5555;666') and another string in the same format. I want to check that in case of large data set, both strings have same elements in it Example @string1 : 'a','b','c' @string2 : 'a','g','c'In this case, I want the answer as false as B and C were not in the second string. Example2 @string1 : 'a','b','c' @string2 : 'a','b','c'In this case the answer will be true. So far I am doing something like this: CREATE FUNCTION dbo.fnSplit( @sInputList VARCHAR(8000), -- List ...

 sql                     2 answers                     22 view
 2018-10-22         Lewis

How to do site analytics with ruby on rails

I was wondering what are the options for doing site analytics with a ruby on rails application ?I haven't seen any solutions specifically targeted towards rails - more towards apache type web servers. I don't want to use the google analytics, I'd like to have the logging/analyis all local.After a quick look at wiki's list of web analytics software http://en.wikipedia.org/wiki/List_of_web_analytics_software, I can't see anything that I can see how to incorporate into my rails/ruby app. Most people deploy rails applications behind Apache or other web servers, because Rails...

 ruby-on-rails                     2 answers                     87 view
 2018-10-22         Lewis

Remove items from associative array in Javascript

I have an associative array in my JS which I want to feed my Select.These are the standard hours available that will refresh my availablehours (when page loads);var standardhours = { "09" : '9AM', "10" : '10AM', "11" : '11AM', "12" : 'Noon', "13" : '1PM', "14" : '2PM', "15" : '3PM', "16" : '4PM', "17" : '5PM', "18" : '6PM', "19" : '7PM'};These the available hours that I want to feed my Select.var availablehours = { "09" : '9AM', "10" : '10AM', "11" : '11AM', "12" : 'Noon', "13" : '1PM', "14" : '2PM', "15" : '3PM', "16" : '4PM', "17" : '...

 javascript                     1 answers                     46 view
 2018-10-22         Lewis

Gem::LoadError: when trying to deply on Heroku - Rails 4

I am trying to deploy an app (just a simple app from a Rails tutorial) to heroku but it keeps giving me the same error message. I use the command:git push heroku masterIt starts well, and then suddenly appears this error:-----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile.I did bundle install already, everything went smooth there.Here is my Gemfile:# Use sqlite3 as the database for Active Record...

 ruby-on-rails                     2 answers                     40 view
 2018-10-22         Lewis

Batch output filename to variable

I am currently trying to use batch to grab a specific file name and then place it in a variable since the file name may change but the "client" or "mui" portion will not.These two lines are what I tried first. using dir to search a path and /b to grab only the name I then filter with "client" or "mui" and that works for finding just the name. But trying to pipe that into a variable didn't work.dir "\\server\path\here" /b | Find "client" | set Clientdir "\server\path\here" /b | Find "mui" | set MUISo I tried my hand at these other items I found during some googling but these...

 batch-file                     1 answers                     56 view
 2018-10-22         Lewis

How do you create a UTC time in C for a specific day, month and year?

How do I create a UTC time in C for the following date:1st July 2038using standard ANSI C function calls (given that the tm_year element of the tm structure cannot be greater than 137) ? You don't. The 32-bit ANSI C time_t rolls over in 2038. It's like asking how you create July 23, 2003 in your old 2-digit-year COBOL system. [XXX]Others have noted that the particular date you give as an example falls beyond the maximum date/time representable by a 32-bit time_t, often referred to as the Year 2038 problem. One solution is to use a 64-bit time_t, which some 64-bit PO...

 c                     3 answers                     7 view
 2018-10-22         Lewis

Django formset if TOTAL_FORMS has different number than actual number of forms

When dealing with dynamic formset, there are times when TOTAL_FORMS is greater than the actual number of forms. Also, this input TOTAL_FORMS can be modified easily by a user.So for example, my input is <input name='user-TOTAL_FORMS' type='hidden' value='5'/>However, there are only 2 actual forms displayed. In this case Django generates unwanted empty forms in formset.forms variable. And this creates a problem if there are any validation errors and form is displayed again. Page shows those unwanted forms. (In the example, only 2 actual forms should be displayed but si...

 django                     2 answers                     78 view
 2018-10-22         Lewis

Export files to public FileSystem

I need to save some files to a directory the user could open from his folder explorer app. I tried using the ShareButton and the share function from Display but it does not allow to save to the fileSystem.I wanted to use FileChooser to let the user pick a folder in order to get the folder path and save my file in it but I don't think you can select a folder using The FileChooser.So I thought I could use FileSystemStorage using getRoots and listFiles to let the user find the folder he wants to save the file to. But I noticed that getRoots does not return the sdCard path of m...

 codenameone                     1 answers                     95 view
 2018-10-22         Lewis

UITableviewcell with UIbutton , changes tableview cell background color

I have added custom UITableViewCell with UIButton. On button click I have added popup but whenever I clicked on button then UITableViewCell background color will changed. I don't want to change the color. Also add UITableViewSelectionStyleNone. Screenshot: Set UITableViewCell.SelectionStyle to .none if using swift or UITableViewCellSelectionStyleNone for Objective-C. Also try [XXX]

 ios                     1 answers                     9 view
 2018-10-22         Lewis

How can we create iPhone-like spinners in android?

Default spinners on the iPhone look a lot better than on Android. It looks like at least one Android app (UrbanSpoon) has been able to replicate this control, and it's awesome: http://www.urbanspoon.com/androidAnyone have any ideas on how to create this? Code would be helpful. If you don't need support for the trackball, then all it will take is WebView along with some minor tweaks to some existing JavaScript that impersonates Apple's UIPickerView to create applications like this.Fancy Spinner Image http://i47.tinypic.com/aymyjc.jpgA majority of the hard work has been ...

 android                     2 answers                     31 view
 2018-10-22         Lewis

How to achieve the latest date order with format MM/DD/YYYY

IF OBJECT_ID('TEMPDB..#CommaDate') IS NOT NULL DROP TABLE #CommaDateCREATE TABLE #CommaDate( DateFormate DATE)INSERT INTO #CommaDate VALUES('2018-02-24'),('2018-01-10'),('2017-05-23'),('2017-04-06')SELECT DISTINCT STUFF((SELECT DISTINCT ',' + CONVERT(VARCHAR(20),DateFormate,101) FROM #CommaDate ORDER BY ',' + CONVERT(VARCHAR(20),DateFormate,101) DESC FOR XML PATH('')), 1,1, '')FROM #CommaDateWhat i expected is with latest order date with formate MM/DD/YYY 02/24/2018,01/10/2018,05/23/2017,04/06/2017 i tried like this IF OB...

 sql                     5 answers                     91 view
 2018-10-22         Lewis

SQL argument limit in Oracle

It appears that there is a limit of 1000 arguments in an Oracle SQL. I ran into this when generating queries such as....select * from orders where user_id IN(large list of ids over 1000)My workaround is to create a temporary table, insert the user ids into that first instead of issuing a query via JDBC that has a giant list of parameters in the IN.Does anybody know of an easier workaround? Since we are using Hibernate I wonder if it automatically is able to do a similar workaround transparently. An alternative approach would be to pass an array to the database and use ...

 sql                     4 answers                     5 view
 2018-10-22         Lewis

Send e-mail if someone execute any query on the database

Basically, whenever the user execute any query(for example: SELECT query), I want the user get instantly notified by email that he or she has executed this(the full query he just used) query. The reason I want this because the data can be confidential, so for the security purpose. Thank you. I would advise against using this approach. If the data is confidential sending the mail after it has been retrieved seems to be too late. During nights it can take hours until such a mail is read and during vacations it can take days or even weeks. Also imagine checking 100s of mail...

 sql-server                     1 answers                     75 view
 2018-10-22         Lewis

how to remove laravel with composer on linux mint 18.3(ubuntu 16.04)

I install laravel with the default composersudo composer create-project laravel/laravel laravel 5.6then I found a lot of error cause the compose is version 1.0x so oldthen I remove the composer and update the composer to version 1.7.2the question is how can I remove the bad laravel?Can I just del the laravel directory?I try sudo apt-get purge laravelsudo apt-get purge laravel/laravlesudo apt-get purge laravel/laravel laravel 5.6it shows cannot find the laravelmy var/www/html/laravel composer.json is below{ "name": "laravel/laravel", "description": "The Laravel F...

 laravel                     1 answers                     14 view
 2018-10-22         Lewis

How can i make "stack oveflow" exception on x64

I tried to make a "Stack overflow" exception.This code throws an exception on x64 Debug.void DumpSystem::makeStackOverflow(){ static int callCount = 0; ++callCount; makeStackOverflow();}But, This code don't throws an exception on x64 ReleaseThe x64 Release xxx.exe was LOOP without causing a "Stack Overflow" exception.Build Option : "SEH(/EHa)"I want to create a "Dump File" using "SetUnhandledExceptionFilter".This is the code I usedLONG saveDumpfile(EXCEPTION_POINTERS* ex);unsigned __stdcall saveDumpFileForStackOverflow(void* arg){ EXCEPTION_POINTERS* ex = static...

 c++                     2 answers                     96 view
 2018-10-22         Lewis

Gridview Scroll with OnTouchListener

Basically, I want to fast select item as well as scroll Gridview. In OnItemClickListener scroll working fine but its not fast select multiple item like OnTouchListener.My code:gridView.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent me) { int action = me.getActionMasked(); float currentXPosition = me.getX(); float currentYPosition = me.getY(); int position = gridView.pointToPosition((int) currentXPosition, (int) currentYPosition); switch (action) { case ...

 android                     1 answers                     71 view

Page 1 of 144  |  Show More Pages:  Top Prev Next Last