w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Web Deploy Command Line Logs in Event Logs (Updated / Inserted / Deleted Files) in event logs
I don't believe you can log the activities to the event log, but what you can do is use the -xml parameter to output the changes in XML format. You could then use this to log to the event log via a Powershell script, for example.

Categories : Iis

How to produce average for calendar months when spreadsheet quantity spans months?
Try =YEARFRAC(StartDate, EndDate, [convention]) which will give you the fractional number of years between the dates using a reasonable convention for day count. See http://office.microsoft.com/en-gb/excel-help/yearfrac-HP005209344.aspx for more details on various day count conventions available.

Categories : Excel

PHP dropdown select function to dynamically create months
You may be running into an issue where from the current day X months later is skipping over a month. Instead of strtotime(sprintf('+%d months', $i)); Try using strtotime(sprintf('first day of +%d month', $i));

Categories : PHP

jQuery UI datepicker: limit certain months (not a range of months)
I hope you tried something, but I have a few spare minutes so f I understand correctly you want to disable the use of some months. You can use the beforeShowDay event of jQuery UI Datepicker and check if a day is active or not based on its month and check if is in the array. To check the array I use the jQuery inArray method. beforeShowDay Default: null A function that takes a date as a parameter and must return an array with: [0]: true/false indicating whether or not this date is selectable 1: a CSS class name to add to the date's cell or "" for the default presentation 2: an optional popup tooltip for this date The function is called for each day in the datepicker before it is displayed. jQuery.inArray Description: Search for a specified value within an array and r

Categories : Jquery

Is this possible to change rails logs messages?
Yes, it's possible. You can achieve this by using config.log_tags. The log_tags option was added in Rails 3.2 and can be used to prepend information to each log message. In /config/environments/development.rb MyApp::Application.configure do config.log_tags = [:request_id] ... end

Categories : Ruby On Rails

Django: How to create user specific logs?
I guess you need to add a handler to the logger in the view. You might make a logger just for that handler, and use it for logging user-related events. The logging library is a standard python library, most of the documentation is for configuring at process startup time in a declarative way (eg, via data structure) but you can call functions to do the setup you want, which means you can do it in the view. http://docs.python.org/2/library/logging.html#logging.Logger.addHandler http://docs.python.org/2/library/logging.html#handler-objects http://docs.python.org/2/library/logging.handlers.html#filehandler Sorry, I don't know it well enough to give you a code sample, but at least I know where to find it in the documentation. I'm not sure what will happen if there are simultaneous logins f

Categories : Python

Create Login page and generate logs in asp.net
As I understand of your question, you want to activate authentication in your project. In this way there is a great article about Authentication in ASP.NET that is suitable for newbies. ASP.NET authentication and authorization The "Forms Authentication" section in the article can fulfill you expectation. Also, there are some logging libraries like NLog, Log4Net, Logging Application Block that are advanced and have lots of facilities, but for starting I recommend you reading Create Simple Error Log Files using ASP.NET and C#. With a bit change in the code you can log the text that you've mentioned.

Categories : Asp Net

How can I create a new LoginController Bean when a new user logs in?
Here, you're mixing JSF bean management annotations with Spring bean management annotation. @ManagedBean(name = "loginController") @SessionScoped @Controller Essentially, you have declared the class to be used as a managed bean by both JSF via @ManagedBean and Spring via @Controller. Essentially, you end up with two completely separate managed instances of the same class. The JSF one is declared to be placed in the session scope via @SessionScoped. The Spring one hasn't any explicit @Scope declared and therefore defaults to the application scope. As the Spring managed bean has apparently precedence over the JSF managed bean while EL-evaluating it as #{loginController}, you ultimately end up getting the application scoped Spring managed bean instance. This totally explains your concrete

Categories : Spring

Logrotate appending file name with a ".1"
If you look at the copy of the settings file from /etc/logrotate.d/", you will find there is this option extension .log. This option means you are trying to append the .log extension to rotated files. If you remove this option and run logrotate again, you will find that by default the extension will be *.log.1 , *.log.2, and so on for the rotated files. In a nutshell, remove the option extension .log. Because the rotated files will take .log as extension.

Categories : Misc

how to create custom list of logs with check box in android
Make a view for the row with checkbox and 2 imageviews and whatsoever you need. Set the source of imageview in your adapter according to your data eg: if (incoming_call) logImageView.setImageResource(your_resource); else { logImageView.setImageResource(your_other_resource) } likewise you can do

Categories : Android

I want to create Handler that will be catch all Logs of web aplications on Tomcat, and
Bundle your new handler into a jar file. Then modify the class path in the startup script to include your new handler jar. Finally, you have to modify both the handlers and the .handlers lines in the logging.properties to include your new handler.

Categories : Tomcat

Logrotate - String of junk at top of log files
I had this same problem. I found the issue was that I was outputting to the log instead of appending. For example: ./application > logfile.log when it should be: ./application >> logfile.log What happens is the copytruncate on logrotate moves the file, output then seems to try to write to the same position and fills the file with a lot of hex fluff. This changes the file to be detected as a binary file instead of a text file. After changing to append, I have not had this issue again.

Categories : Linux

How to conveniently store common logs and client specific logs
I would have an xml file that contain the appenders to specify what packages go into what log file. You can then load the xml file in your application entry point. Below is an example I have used in my current project <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <!-- appenders --> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out" /> <param name="threshold" value="error" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%t] %p %c - %m%n" /> </layout> </appender> <appender name="codebaseXAppender" class="org.apache.log4j.RollingFileAppender"> <

Categories : Java

git commit logs CREATE and COPY multiple times with curly brackets - Why?
The curly brackets are just a short-hand so Git doesn't have to print the full path twice. Thus, copy path/{a.txt => b.txt} is just short for copy path/a.txt => path/b.txt. The percentage at the end of those lines tells you how similar the respective second file is to the first one (in this case, they are exactly identical, which is why Git thinks you copied them). Note also that this has no influence on the commit content, it's just a semantic interpretation that's done purely for output. The commit's content is always an exact snapshot of all tracked files, without saving any meta information like moving or copying.

Categories : GIT

Calculate last 12 Months + Sum of all transaction before last 12 months
with cte as ( select row_number() over(partition by AccountNo order by CreatedDate desc) as rn, AccountNo, Amount, CreatedDate from TransactionsTest ), cte2 as ( select c.AccountNo, c.CreatedDate, c.Amount, 0 as Ord from cte as c where rn <= 12 union all select c.AccountNo, null as CreatedDate, sum(c.Amount) as Amount, 1 as Ord from cte as c where rn > 12 group by c.AccountNo ) select AccountNo, CreatedDate, Amount from cte2 order by AccountNo, Ord, CreatedDate sql fiddle demo

Categories : SQL

How to set the rights of a python-generated file, executed by logrotate
import os import pwd admdetails = pwd.getpwnam('adm') rootdetails = pwd.getpwnam('root') for fname in ['name1', ,,,]: os.chown(fname, rootdetails.pw_uid, admdetails.pr_gid) Or something like it should be adaptable to the job. N.B. You will probably need to run as root or sudo as changing ownership away from root without being root is discouraged.

Categories : Python

How to set intellij to show logs in the logs tab and not the output tab
In the application server Run/Debug configuration open the Logs tab and specify the full log file path there. You can just search your disk for algo_js.log file and specify its location.

Categories : Spring

Get iPhone Logs(not crash logs)
Got a breakthrough!!. We need to re-direct NSLog to a file like this and then access the file. - (void)redirectNSLogToDocumentFolder{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *fileName =[NSString stringWithFormat:@"%@.log",[NSDate date]]; NSString *logFilePath = [documentsDirectory stringByAppendingPathComponent:fileName]; freopen([logFilePath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr); } http://objcolumnist.com/2009/12/19/redirecting-nslog-to-a-log-file/

Categories : IOS

Calculate the Months between two months
I imagine there is a simpler way to do this with Linq, but a simple loop would do the job: DateTime start = DateTime.Parse(startString); DateTime end = DateTime.Parse(endString); List<string> months = new List<string>(); while (start.Month <= end.Month) { months.Add(start.ToString("MMM")); start = start.AddMonths(1); } string output = string.Join(",", months.ToArray()); See this MSDN page for info on formatting the month output via ToString(): http://msdn.microsoft.com/en-us/library/zdtaw1bw.aspx

Categories : Asp Net Mvc

How to create on-change directive for AngularJS when change a property of a model?
Your data source has some flaw since $scope.model is undefined. Change it to app.controller('MyCtrl', function ($scope) { $scope.model = {}; $scope.model.strText = "Hello"; });

Categories : Javascript

On click confirmation always deletes
You need to return the result in the onclick attribute. echo '<input type="submit" value="Delete" onclick="return confirmDelete()" "style="margin-right: 5px;" />'; ps: you don't have to echo huge strings of HTML. You could easily replace all of those echo calls with this <form action="../apps" method="post" enctype="multipart/form-data""> <input type="hidden" name="check" /> <input type="hidden" name="ID" value="<?php echo $ID ?>" /> <input type="submit" value="Delete" onclick="return confirmDelete()" /> </form>

Categories : Javascript

QDialog deletes its QLayout?
The QDialog will delete the QLayout upon destruction. You do not need to delete the layout in the destructor. See also: http://doc-snapshot.qt-project.org/qt5-stable/qtwidgets/qwidget.html#setLayout

Categories : C++

For Each loop: Just deletes the very first attachment
Try this. I added code/comments to iterate through and remove all the attachments after you do your saving. The reasons you should do this are explained very well here by David Zemens. You also should get in the habit of saving messages you modify in Outlook VBA as sometimes this is important, sometimes it's not, but it can confuse the heck out of you if you don't use Save when you need to. 'location to save in. Can be root drive or mapped network drive. Const attPath As String = "C:UserspkshahbaziDocumentsEmailAttachments" Set myAttachments = Msg.Attachments For Each olAttch In myAttachments Att = olAttch.DisplayName If Right(olAttch.FileName, 3) = "zip" Then olAttch.SaveAsFile attPath & Att 'olAttch.Delete

Categories : Vba

Cakephp HABTM deletes always the records which contains a already used id
you should spend a bit of time reading the docs Specifically look at the configuration options available, such as unique

Categories : Cakephp

Mysql "ON UPDATE" constraint deletes my row
This is the expected behaviour since the foreign key in table2 is defined with the ON DELETE CASCADE property. Deletes in table1 are "cascaded to" table2. You may want to change this definition with ON DELETE SET NULL.

Categories : Mysql

mysql_real_escape_string deletes variable contents
mysql_real_escape_string() works in context of connection made by "mysql" extension, but you use "mysqli". You need to either connect using mysql_connect() not recommended Or you need to use new approaches from mysqli such as prepared statements or mysqli_real_escape_string()

Categories : PHP

JAXB unmarshal deletes newline
An XML parser (including JAXB) will not preserve a newline in an XML attribute. http://www.w3.org/TR/REC-xml/#sec-line-ends You will need to move this content to an XML element instead.

Categories : Java

Intercept Deletes in ASP.NET WebAPI - Breeze
You'll want to use the BeforeSaveEntities interceptor on your EFContextProvider instance to change the EntityState to "Modified" and set the Deleted flag on your entity. For example: protected override Dictionary<Type, List<EntityInfo>> BeforeSaveEntities(Dictionary<Type, List<EntityInfo>> saveMap) { var orderInfos = saveMap[typeof(Order)]; foreach (var info in orderInfos) { var order = (Order)info.Entity; if (info.EntityState == EntityState.Deleted) { order.Deleted = true; info.EntityState = EntityState.Modified; } } }

Categories : Asp Net

Laravel 4 Cascading Soft Deletes
I do know this is possible from within my models: public function delete() { ChildTable::where('parent_id', $this->id)->delete(); ChildTable2::where('parent_id', $this->id)->delete(); parent::delete(); } But any update to models or table structure would cause this to be appended/edited.. including other models.

Categories : PHP

C++ rebuild deletes dependency files
Well that might mean that there is a problem with the linker. Try add those lib files to the linker. You can find the linker usually by clicking right click on your project and then going to properties. You will find a menu and on the left side. Just open the linker, and then open the "Input". In the first line you probably find "additional dependancies". Add your lib files over there by name + format. And also keep the actual lib files in your Driver:VisualStudioVClib folder. I hope that helps! :)

Categories : C++

remove() function deletes every other file
I find it likely that your remove code is readjusting the position of items in the array. Example: 012345 After removing 2 you have 01345 not 01_345 As such you want to remove the 0th element(or likely last element would be more optimal) of your array files.size() times. So replace this line: if(remove(files[b]) == 0) With this: if(remove(files[0]) == 0) Or optimally if(remove(files[files.size() - 1]) == 0) But this is of course dependant on your implementation of remove, but I find this explanation highly likely given your explanation of the symptoms. You need to adjust your for loop to use this logic as well, otherwise you are attempting to access a value that no longer exists in the vector: while(files.size()) { cout << " Removing: " << files.back

Categories : C++

Deletes Slow on a Oracle BIG Table
Parallel DML alter session enable parallel dml;, delete /*+ parallel */ ...;, commit;. Sometimes it's that easy. Parallel DDL alter index your_index rebuild nologging compress parallel;. NOLOGGING to reduce the amount of redo generated during the index rebuild. COMPRESS can significantly reduce the size of a non-unique index, which significantly reduces the rebuild time. PARALLEL can also make a huge difference in rebuild time if you have more than one CPU or more than one disk. If you're not already using these options, I wouldn't be surprised if using all of them together improves index rebuilds by an order of magnitude. And then 1.5 * 40 / 10 = 6 hours. Re-evaluate your indexes Do you really need 40 indexes? It's entirely possible, but many indexes are only created because "

Categories : Oracle

FactoryGirl deletes all users in database
You can try this. 30.times do User.last.destroy end In place of User.delete_all This will delete all the 30 users created by FactoryGirl. But will work only if you are not creating more users in between. Update The above code was just a hack. If while testing application is hitting development database, then config/database.yml file need to be checked to ensure that it's not pointing to same db for test and development.

Categories : Ruby On Rails

A more efficient way of showing adds/deletes in a context
I'm going for the long shot here - I think the delay is down the standard delay EF has on initialisation of the model cache. See my answer on this question for more details. You'll need to modify your code to find out for sure ...

Categories : C#

Is there a way to disable updates/deletes but still allow triggers to perform them?
Yes, this is possible. Triggers are run with the privileges of the trigger function, defaulting to SECURITY INVOKER which means, the trigger function is effectively executed with the privileges of the current_user, in your case the one inserting rows. If the current user does not have the required privileges for the tables your trigger function operates on, your original operation in the underlying table will error out. However, you can use SECURITY DEFINER for the trigger function to have this function run with the privileges of the OWNER of the function. If you have a superuser own the trigger function, it can do everything - which would be a possible security hazard. Consider the instructions in the manual about Writing SECURITY DEFINER Functions Safely. But it's wiser to make a pl

Categories : Postgresql

RollingFileAppender that also deletes files older than some date
Why not look at this might help? You can probably set maximum nuber of days to retain the logs. log4j.rootLogger=INFO, FILE log4j.appender.FILE=ca.justtechnologies.utils.logging.CustodianDailyRollingFileAppender log4j.appender.FILE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE.layout.ConversionPattern=%d{MMM dd yyyy HH:mm:ss,SSS} [%t] %-5p %l - %m%n log4j.appender.FILE.File=/var/log/web-apps/Dashboard.log log4j.appender.FILE.DatePattern='.'yyyy-MM-dd log4j.appender.FILE.MaxNumberOfDays=14 log4j.appender.FILE.CompressBackups=true

Categories : Java

How long does it take until php deletes the cached version of require_once()
I don't think there's such a cache on *_once() functions. Maybe it's another thing like memcache or APC that's keeping an outdated version of your file, but this is quite a strange behavior anyway.

Categories : PHP

QSqlRelationalTableModel::removerow() deletes the row from table but not from the model
From QSqlTableModel::removeRows docs: Emits the beforeDelete() signal before a row is deleted. When the edit strategy is OnManualSubmit signal emission is delayed until submitAll() is called. So check the edit strategy you're using and try to call model->submitAll() after changes.

Categories : SQL

an algorithm that deletes data in a table instead of the extract
Changing below property might help: <property name="hbm2ddl.auto">update</property> Reason: I think you are running this query by rebooting hibernate and since the property is set to create, once hibernate reboots, it create the complete schema again and your query gets executed. Since there is no data(because of the fresh schema creation, and no inserts/saves to table before this query execution), you end up getting no result. Note that i am presuming something here.

Categories : Hibernate

Ruby - FileUtils.cp deletes file and fails
Place the following in a copy_myfile.rb, then run with: sudo ruby copy_myfile.rb require 'fileutils' src = "/var/tmp/myfile" dest = "/usr/bin" FileUtils.cp(src, dest)

Categories : Ruby

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