DECLARE l_counter NUMBER := 0;
t NUMBER:=0;
BEGIN
LOOP
l_counter := l_counter + 1;
IF l_counter > 32690 THEN
EXIT;
END IF;
SELECT ISEQ$$_832661.nextval INTO t from dual;
END LOOP;
END;
DECLARE l_counter NUMBER := 0;
t NUMBER:=0;
BEGIN
LOOP
l_counter := l_counter + 1;
IF l_counter > 32690 THEN
EXIT;
END IF;
SELECT ISEQ$$_832661.nextval INTO t from dual;
END LOOP;
END;
Reference : Deploying to Microsoft Internet Information Server (IIS) | Gatsby (gatsbyjs.com)
Reference: https://jimsalasek.com/2019/01/09/sql-server-find-users-connected-to-databases/
With actual usernames and machines that are connected
Reference : Automatically Replacing an Image on an HTML Page When it is Not Found - CodeProject
select from_unixtime(`last_activity`) as lastdt from `sessions` WHERE from_unixtime(`last_activity`) >= NOW() - INTERVAL 15 MINUTE
ORDER BY last_activity DESC;
Finally !!!!
Need to declare function on initComplete event. And use search function.
Datatable version 1.11.
I want to access object attributes with child objects dynamically just by specifying the attribute in a string variable.
$book->category->name
Result : null
Solution :
Result : book category name
I've got a situation where the git client is not allowed to be installed on the production server (due to strict user policies) but I still want to use git without having to install the git client.
Finally, I found a solution using docker. (For this test I used Docker Desktop on Windows 11).
To clone a repository, just use the instructions below.
docker run -ti -v e:\repo\project1:/git alpine/git clone https://gitlab.com/test/project1.git ./
Need to map the volume (on my windows folder) to /git (in docker) and clone the repository to the current folder (./).
Then, git started cloning the repository.
To pull changes :
docker run -ti --rm -v e:\repo\project1:/git alpine/git pull
I want to use slug in ASP.NET MVC application. The URL should be something like this
Here are the steps required to do so:
1. Defined the route (startup.cs)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Slug",
"{slug}",
new { controller = "Home", action = "ScholarInfoDetails" }
);
2. Create SlugToIdAttribute.cs class
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
///
/// Summary description for SlugToIdAttribute
///
public class SlugToIdAttribute : ActionFilterAttribute
{
private ApplicationDbContext db = new ApplicationDbContext();
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var slug = filterContext.RouteData.Values["slug"] as string;
if (slug != null)
{
var model=db.Banks.Where(x => x.Code == slug).First();
if (model != null) {
filterContext.ActionParameters["id"] = model.id.ToString();
}
}
base.OnActionExecuting(filterContext);
}
}
3. Use in the controller. Add annotation [SlugToId]
[AllowAnonymous]
[SlugToId]
public ActionResult ScholarInfoDetails(String id)
{
var r = new ContentResult();
r.Content = "Hello World " + id.ToString();
return r;
}
Now the function can be access using slug. E.g http://localhost:58128/ABMB. Result will be something like this :Hello World 2
DateField dateField = new DateField(new DateTimePropertyEditor(DateTimeFormat.getFormat("dd-MMM-yyyy")));
String sDate=session.getIps_year().toString() + "-" + session.getIps_month().toString() + "-01";
Date mindate =Application.mysqlDateTimeFormat.parse(sDate);
dateField.setMinValue(mindate);
dateField.getDatePicker().setMinDate(mindate);
Date maxdDate=CalendarUtil.copyDate(mindate);
CalendarUtil.addMonthsToDate(maxdDate, 1);
int days= CalendarUtil.getDaysBetween(mindate, maxdDate);
maxdDate=CalendarUtil.copyDate(mindate);
CalendarUtil.addDaysToDate(maxdDate, days-1);
dateField.setMaxValue(maxdDate);
dateField.getDatePicker().setMaxDate(maxdDate);
DateField dateField = new DateField(new DateTimePropertyEditor(DateTimeFormat.getFormat("dd-MMM-yyyy")));
dateField.getDatePicker().setMinDate(mindate);
dateField.getDatePicker().setMaxDate(maxdDate);
find * -exec touch {} \;
A better approach is to use the touch command with the dash t switch and specify
an actual date and time. The example below will set all files to being modified at
ten a.m. on the 29th of Feb 2012.
find * -exec touch -t 201202291000 {} \;
import java.util.HashSet;
import java.util.Set;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.ValueUpdater;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.core.client.ValueProvider;
public class AnchorLinkCell<T> extends AbstractCell<T> {
String imgURL = "";
String styleClass = "";
AsyncCallback<T> callback;
ValueProvider<T, String> vp;
public AnchorLinkCell(String imgURL, ValueProvider<T, String> vp, String styleClass, AsyncCallback<T> callback) {
this.imgURL = imgURL;
this.callback = callback;
this.styleClass = styleClass;
this.vp = vp;
}
@Override
public void render(com.google.gwt.cell.client.Cell.Context context, T value, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<div class=\"" + this.styleClass + "\" style='cursor: pointer'/>");
if (imgURL != "") {
sb.appendHtmlConstant("<img src='" + imgURL + "' style='cursor: pointer'/> ");
}
sb.append(SafeHtmlUtils.fromTrustedString(this.vp.getValue(value)));
sb.appendHtmlConstant("</div>");
}
@Override
public Set<String> getConsumedEvents() {
Set<String> events = new HashSet<String>();
events.add("click");
return events;
}
@Override
public void onBrowserEvent(com.google.gwt.cell.client.Cell.Context context, Element parent, T value, NativeEvent event, ValueUpdater<T> valueUpdater) {
// TODO Auto-generated method stub
super.onBrowserEvent(context, parent, value, event, valueUpdater);
if (parent.getFirstChildElement().isOrHasChild(Element.as(event.getEventTarget()))) {
this.callback.onSuccess(value);
}
}
}
ColumnConfig<PremiseBean, PremiseBean> prm_companyColumn = new ColumnConfig<PremiseBean, PremiseBean>(props.identity(), 150,"Company Name");
IdentityValueProvider<PremiseBean> identity();
AnchorLinkCell<PremiseBean> acLink=new AnchorLinkCell<PremiseBeanHelper.PremiseBean>("images/icons/add.png",props.prm_name(), "myLinkStyleNameinCSS", new AsyncCallback<PremiseBean>() {
@Override
public void onFailure(Throwable caught) {
Application.handleException(caught);
}
@Override
public void onSuccess(PremiseBean result) {
Info.display("AnchorLinkCall Test", result.getPk());
}
});
prm_companyColumn.setCell(acLink);
ColumnConfig<PremiseBean, String> prm_nameColumn = new ColumnConfig<PremiseBean, String>(props.prm_name(), 150, "Name");
ImageCell ic = new ImageCell() {
@Override
public void render(com.google.gwt.cell.client.Cell.Context context, String value, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<div class=\"myClickableCellTestStyle\" style='cursor: pointer'/>");
sb.appendHtmlConstant("<img src='images/icons/add.png' style='cursor: pointer'/> ");
sb.append(SafeHtmlUtils.fromTrustedString(value));
sb.appendHtmlConstant("</div>");
}
@Override
public Set<String> getConsumedEvents() {
Set<String> events = new HashSet<String>();
events.add("click");
return events;
}
@Override
public void onBrowserEvent(com.google.gwt.cell.client.Cell.Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
if (parent.getFirstChildElement().isOrHasChild(Element.as(event.getEventTarget()))) {
Console.writeLine("OnEvent");
Info.display("Test", value);
}
}
};
prm_nameColumn.setCell(ic);
.myClickableCellTestStyle{
text-decoration:underline;
}