AdminLTE. table page change 1 to other - asp.net

I have table used Bootstrap 3.
That is option
$('#DT_NoticeList').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": false,
"info": false,
"autoWidth": false,
"pageLength": 15
});
If there are 10 page, how to change the page number 1 to other?
I want to change the page directly in Javascript or code side.
that is mean move page 1 to other in javascript or anyway
like this [ (1) 2 3 4 5 ] -> [ 1 2 (3) 4 5 ]
how to do?

Related

to identify if the data have certain words and label them TRUE if they have FALSE if they don't have

body : c(" i want a computer", "use my laptop", "buy a macbook", "found a good deal on macbook and windows laptop")
I want to identify if these posts have certain words and label them TRUE if they have FALSE if they don't have. Results would look sth like this.
lets' say there are the words i need R to identify for me ;
words_to_be_identified : ("Computer", "laptop", "MacBook")
Results should look like thisenter image description here
Body: c(" i want a computer", "use my laptop", "buy a macbook", "found a good deal on macbook and windows laptop")
Computer : TRUE, FALSE, FALSE, FALSE
laptop: FALSE, TRUE, FALSE, TRUE
MacBook : FALSE, FALSE, TRUE, TRUE
Multiple: FALSE, FALSE, FALSE, TRUE

Find an edge that is already connected with vertices to a specific vertex ID, and merge it with the result

Consider facebook search results of the people list scenario. I want to get all the people from the database (hasLabel('person')). For each of these people, I want to know whether the logged in person already have connected and follows. What is the best solution to get this in gremlin (possibly avoiding duplication)?
g.addV('person').property('id',1).as('1').
addV('person').property('id',2).as('2').
addV('person').property('id',3).as('3').
addV('person').property('id',4).as('4').
addE('connected').from('1').to('2').
addE('connected').from('2').to('3').
addE('connected').from('3').to('1').
addE('connected').from('4').to('2').
addE('follows').from('1').to('2').
addE('follows').from('1').to('3').
addE('follows').from('1').to('4').
addE('follows').from('2').to('1').
addE('follows').from('2').to('3').
addE('follows').from('3').to('1').
addE('follows').from('3').to('4').
addE('follows').from('4').to('2').
addE('follows').from('4').to('3').iterate()
For instance, if the logged-in person id is 2, the formatted JSON response will be
[
{
"id": 1,
"follows": true,
"connected": true
},
{
"id": 3,
"follows": true,
"connected": false
},
{
"id": 4,
"follows": false,
"connected": true
}
]
and if the logged-in person id is 4
[
{
"id": 1,
"follows": false,
"connected": false
},
{
"id": 2,
"follows": true,
"connected": true
},
{
"id": 3,
"follows": true,
"connected": false
}
]
Note: The JSON response is provided to understand the outcome, but I just wanted the Gremlin query to get the outcome.
Below is the general pattern you are looking for however based on the script you have listed above and the direction of the edges it's unclear exactly when to return true and when not to.
g.V().
hasLabel('person').
not(has('id', 2)). //find me person 2
project('id', 'follows', 'connected').
by('id').
by(
__.in('follows').
has('id', 2). //traverse all inbound follows edges to find if they go to person 2
fold(). //create an array (empty if nothing)
coalesce(unfold().constant(true), constant(false))). //return true if edge exists, else false
by(
__.out('connected').
has('id', 2).
fold().
coalesce(unfold().constant(true), constant(false)))
Based on the script you provided there is no way to get the answers you asked for. Let's look at just the connected edges.
For vertex 2:
using in() we would get true for 1 and 4 and false for 3
using out() we would get true for 3 and false for 1 and 4
using both() all would be true
So based on the results above it looks like you want to use in() edges. However when we apply that to vertex 4 all the results would be false

Printing objects without ansible_host

I'm trying to use jq to process JSON from the VMware Ansible inventory module so I can produce a list of objects (VMs) that don't have ansible_host defined.
The closest I've been able to get is:
{
"config.cpuHotAddEnabled": true,
"config.cpuHotRemoveEnabled": false,
"config.hardware.numCPU": 1,
"config.instanceUuid": "500e4e98-50ec-a3a7-9d45-b0ac36c2d192",
"config.name": "tu-openldap-01",
"config.template": false,
"guest.guestId": "rhel6_64Guest",
"guest.guestState": "notRunning",
"guest.hostName": "tu-openldap-01",
"guest.ipAddress": null,
"name": "tu-openldap-01",
"runtime.maxMemoryUsage": 2048
}
{
"config.cpuHotAddEnabled": true,
"config.cpuHotRemoveEnabled": false,
"config.hardware.numCPU": 1,
"config.instanceUuid": "500efaa5-baac-163b-65c0-7ed2a19f1d7d",
"config.name": "tu1vcm7tst2001",
"config.template": false,
"guest.guestId": "rhel7_64Guest",
"guest.guestState": "running",
"guest.hostName": "rhel7-template",
"guest.ipAddress": null,
"name": "tu1vcm7tst2001",
"runtime.maxMemoryUsage": 4096
}
using the following:
jq '._meta.hostvars[] | select(.ansible_host | not)' prod-inventory_201905070920.json
This is almost where I want it, but the problem is how do I print these plus the key for the object itself?
If I do:
jq '._meta.hostvars | select(.ansible_host | not)' prod-inventory_201905070920.json
I get these:
"tw1pttest1001_420e92f4-453e-1267-4331-d6253d771882": {
"ansible_host": "<omitted>",
"config.cpuHotAddEnabled": true,
"config.cpuHotRemoveEnabled": false,
"config.hardware.numCPU": 2,
"config.instanceUuid": "500ef630-16c1-cb91-be9c-e9e667b551d9",
"config.name": "tw1pttest1001",
"config.template": false,
"guest.guestId": "windows9Server64Guest",
"guest.guestState": "running",
"guest.hostName": "<omitted>",
"guest.ipAddress": "<omitted>",
"name": "tw1pttest1001",
"runtime.maxMemoryUsage": 49152
},
"tw1swsrm1001_420e18d2-0c96-0df5-e6c7-1ff8fc070cdb": {
"ansible_host": "<omitted>",
"config.cpuHotAddEnabled": true,
"config.cpuHotRemoveEnabled": false,
"config.hardware.numCPU": 4,
"config.instanceUuid": "500e231d-1eda-4e66-3f4a-8c68392a70b5",
"config.name": "tw1swsrm1001",
"config.template": false,
"guest.guestId": "windows9Server64Guest",
"guest.guestState": "running",
"guest.hostName": "<omitted>",
"guest.ipAddress": "<omitted>",
"name": "tw1swsrm1001",
"runtime.maxMemoryUsage": 16384
},
Any suggestions? I feel like it's something simple that I'm missing.
Assuming you are searching for items found in the ._meta.hostvars object, you can filter the objects by key/value by using something like with_entries/1.
$ jq '._meta.hostvars | with_entries(select(.value.ansible_host | not))
' prod-inventory_201905070920.json
This will in effect take the hostvars object and only keep properties that match that condition (does not have an ansible_host property value).

graphite\carbon cant understand how to feed them

so I wanted to start playing with it and test it, so i put this config:
storage-schemas.conf:
[short2]
pattern = ^short2\.
retentions = 10s:1m
storage-aggregation.conf
[sum]
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum
what I think that my config say:
get data every 10 seconds and save it to 1 minutes so total of 10 points will be saved
now if i go to
http://localhost/render/?target=short2.sum&format=json&from=-1h
I see many data with null values a lot more than 10,
ok so I give up on that, than I said let's try to feed it data once every 10 seconds, if i do
echo "short2.sum 22 `date +%s`" | nc -q0 127.0.0.1 2003
wait 11 seconds
echo "short2.sum 23 `date +%s`" | nc -q0 127.0.0.1 2003
now looking at the api I can see only the last point get registerd like:
[
null,
1464781920
],
[
null,
1464781980
],
[
null,
1464782040
],
[
null,
1464782100
],
[
23,
1464782160
],
now if I send it another point (a lot after 10 seconds)
echo "short2.sum 24 `date +%s`" | nc -q0 127.0.0.1 2003
this is what I get:
[
null,
1464781920
],
[
null,
1464781980
],
[
null,
1464782040
],
[
null,
1464782100
],
[
24,
1464782160
],
only once in a couple of tries I will see them count as new but they just overwriting each other instead of acting like new data
Actually:
[short2]
pattern = ^short2\.
retentions = 10s:1m
means: all metrics starts with short2. keep for 1 minute with 10 second resolution (each datapoint represents 10s). It also means if there are not defined other storage schemas for short2., it will have value only for 1 (last) minute.
http://graphite.readthedocs.io/en/latest/config-carbon.html#storage-schemas-conf

Styling lists with natural behaviour

I want to style a css list like this
[ 1 ][ 2 ]
[ 3 ][ 4 ]
[ 5 ][ 6 ]
Which is basically no problem when using float:left
But there is a problem, when [ 4 ] is heiger than 3 the following happens:
[ 1 ][ 2 ]
[ 3 ][ 4 ]
[ ]
[ 5 ][ 6 ]
But i want to behave it like this:
[ 1 ][ 2 ]
[ 3 ][ 4 ]
[ 5 ][ ]
[ 7 ][ 6 ]
Please take a look at the problem:
http://xbox360livegold.nl/gastenboek
I don't think you'll be able to do this in pure CSS unless you know ahead of time what each item is going to look like, and I'm assuming this is for the news feed section on the site you lined to. You might be able to use something like the JQuery Masonry library to accomplish it.
If you're okay with the items being displayed from top to bottom instead of left to right, i.e. like this:
[ 1 ][ 4 ]
[ 2 ][ ]
[ 3 ][ 5 ]
then you could use the CSS3 multi-column feature. Setting the column-count to 2 will automatically divide the items into two columns.

Resources