PIVO US | KVM based VPS | 50% off lifetime | 4 CPU 8GB RAM | $10/month


VPS from PIVO can offer you affordable True NVMe SSD Virtual Private Servers!

~ Reliable, super fast and 100% NVMe SSD

~ Fully KVM based and not shared

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 GB KVM NVMe: only $20.00/month

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • 8 x CPU Core
  • 16 GB RAM
  • 80 GB NVMe SSD
  • 3 TB Bandwidth

Order Now – $20.00/month with coupon HALFOFF

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 GB KVM NVMe: only $10.00/month

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • 4 x CPU Core
  • 8 GB RAM
  • 60 GB NVMe SSD
  • 3 TB Bandwidth

Order Now – $10.00/month with coupon HALFOFF

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 GB KVM NVMe: only $7.00/month

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • 2 x CPU Core
  • 4 GB RAM
  • 40 GB NVMe SSD
  • 2 TB Bandwidth

Order Now – $7.00/month with coupon WELCOMEABOARD

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 GB KVM NVMe: only $5.00/month

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • 1 x CPU Core
  • 2 GB RAM
  • 20 GB NVMe SSD
  • 1 TB Bandwidth

Order Now – $5.00/month

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All virtual servers come with the below:

  • 1 IPv4 address
  • /64 subnet IPv6 addresses
  • Connection via 10 GE port
  • Choose from OS templates or install custom OS using ISO
  • Free DDOS protection
  • No setup fees
  • Free reinstalls
  • 99.99% uptime SLA
  • 24/7 on-site technical support
  • Full remote management and control (VNC access, reboot, rDNS, reinstall, bandwidth check, etc.)
  • No long-term contract. Monthly payment and you can cancel at any time.
  • Payments by credit/debit cards, Paypal, Bitcoin, Wechat

Why choose Pivo?

  • 24/7 on-site support
  • HW RAID-10 NVMe servers
  • 99.99% network uptime
  • Professional and super fast support
  • Motivated and friendly staff
  • Full 2N redundancy
  • Looking Glass is available with test IP address 162.216.242.193
  • Pay online and start using immediately
  • We OWN all our hardware and IP
  • Coupons do not expire and are applied to the lifetime of the service

FAQ

  • Is VPN allowed? – Yes for personal use.
  • Is TUN/TAP/PPP enabled? – Yes.
  • Is adult hosting allowed? – Yes.
  • Do you own the servers? – Yes, we OWN all our hardware and manage them ourselves.

Payment Methods: PayPal, Bitcoin, all major Credit/Debit Cards, WeChat

All our servers are located in our Tier 3+ Phoenix AZ USA Data Center.

Please visit our website Pivo to open a ticket with our sales department for any custom quote or any questions you may have.

Contact us at sales@pivo.com to ask us any questions about our offers.

How does JCEKS Password Based Encryption work

I want to get my hands on some recent documentation or an explanation on how Password based encryption works inside of JCEKS KeyStores

Some questions I am looking to get answers to are

  1. What is the strength of the key encrypting key (KEK) that gets generated by JCEKS ?
  2. Is the “generated KEK” stored somewhere within the keystore? if yes, where ?

game design – 3D World; how do I deal with the thickness of walls on a grid to create a tile based building system

I want to develop a tile based 3D building system as a foundation for an game. But there is a question which is cracking my mind a bit.

I am grateful for every thought, hint, link or book suggestion.

How do I deal with the thickness of walls on a grid, respectivelly how should I realize walls?

I used the search engine, watched at other games on steam & youtube, but the result & my conclusion is not really satisfying.

What is the most common way, which causes the least problems in your oppinion?

The game-engine i want to use is Godot.

This are the 3 options which I have, at least I think this are the 3 I have:

(1) Wall as a plane
Wall as a plane

I think this option causes not much problems, but it is also the least attractive option because it doesn’t look that great to a player.

The wall is flat, the positioning of items in front of the wall, on both sides shouldn’t make problems because. The wall has no thickness, so there is no offset related to the grid.

(2) Wall in size of the grid
Wall in size of the grid

I think this option causes the least problems, but probably you get really thick looking walls if your grid is to big & with a smaller grid you maybe get other problems (performance issues or something else).

The wall doesn’t affect the positioning of items in front of the wall, on both sides. The wall has thickness, but the thickness doesn’t results in an offset related to the grid.

Currently I think this is the option I should stick with, but to get walls which are not that thick, I believe I should create a grid with a size of .5 or .25 when you relate 1 to an meter (walls in germany are about 25 till 50 cm).

Maybe I worry too much about the size of the walls?

(3) Wall overlapping the grid
Wall overlapping the grid

I think this option makes the most headache, at least for me. With this option you have a offset resulting from the thickness of the wall. Because it’s overlapping the floor tiles half the walls thickness, so you have to deal with the placement of items in front of the wall & currently I have no idea to deal with.

python – Apply additions on a base array based on date ranges

please roast my code, I hope this is the good place to look for some advice on where I can improve.

Problem definition:

Apply modifications on values depending on date ranges.

Data:

Base array – holds dictionaries in the following format:

({‘date’: 20200101, ‘value’: 1}, {‘date’: 20200102, ‘value’: 2})

Modifier array – holds dictionaries with similar format:

({‘date’: 20200101, ‘value’: 1}, {‘date’: 20200201, ‘value’: 2})

Goal:
Add the respective value of the modifier array to the base array lining up the date ranges. Dates are exclusive, for example when the modifier array contains 2020-01-01 you have to add the value ‘1’ to all values in the base array that have a date less than 2020-01-01. Base array has a lot of elements while modifier array relatively few. In practice this splits the base array into a couple of date ranges. If the last modification date is less than the date in base array no modification is required.

My solution:

This is assuming the comparing of dates will work, I have translated this from perl for an easier read.

mod_index = 0 
mod_size = len(mod_arr)

for elem in base_arr:
  if elem('date') > mod_arr(mod_size - 1)('date'):
    break
  else:
    if elem('date') < mod_arr(mod_index)('date'):
      elem('value') += mod_arr(mod_index)('value')
    else:
      elem('value') += mod_arr(mod_index + 1)('value')
      mod_index += 1

unity – Component Based Spells/Abilities

This has been a bit of a long time coming challenge for me, if you look back at previous questions for Component based spells you are likely to find my old questions, given that they are 1 + 2 years old respectively and I’m on attempt three, I thought I’d try again hopefully with more knowledge!

I am attempting to build a ScriptableObject based spell system, where each spell is made up of five components, Spell_Cast, Spell_Aim, Spell_Visual, Spell_Motion, Spell_Behaviour and a bunch of information on the spell itself (Cast, Cost, Max Targets, Base Spell Power, Range, Radius) etc.

Currently I am trying to get bare bones examples working.

For my proof of concept spells, I have picked “Mage Hand” and “Mage Light”

Mage Hand:

  • Spell Cast : Channel (Casts while button is held)
  • Spell Aim : Raycast (Target Object)
  • Spell Visual : A Prefab model of a hand.
  • Spell Motion : Projectile (Hand will fire from player to target)
  • Spell Behaviour: This parents the target object to the Mage Hand Effect Instance, Disables Gravity, Freezes Rotation and Holds it in-front of the player while the button is held.

Mage Light:

  • Spell Cast : Instant (Casts instantly)
  • Spell Aim : Raycast (Target Object)
  • Spell Visual : A Prefab model of a particle system and light.
  • Spell Motion : Projectile (Light will fire from player to target)
  • Spell Behaviour: Most of this spell takes place on the Visual Prefab itself, the spell just fires it towards the target, and in PostEffect sets a self destruct timer based on spell power. The prefab handles ‘sticking/unsticking’ itself to things and destroying itself with monobehaviours.

Both these spells work but I am feeling quite unsure about the spell behaviours, currently there are 1 behaviour scriptableobject per spell.

These are not generalised, I realise I could rework the Behaviour class so it just holds a list of actions to run on the target whatever it may be, but I don’t understand how I could make a spell like Mage Hand work using only general actions and the fact it would need to do some actions just once (What if I added
an effect that reduces the weight of held item?), but do the actual ‘holding’ of the object every frame while the button is held.

Take for example my ‘Mage Hand’ behaviour, there are a lot of sub behaviours (Holding T lets you slightly adjust the hand, or Press ScrollWheel throws the object which i’m not happy with but I went with ‘just get something working’ philosophy)

I am storing all of the spell state data on SpellCastData and any action I use too often in a behaviour gets moved to the base Spell_Behaviour class so I’m not repeating myself.

Below (first) is component I use to store and cast spells (Entity_Cast_Comp), second is the behaviour for ‘Mage Hand’

So, all of that out of the way my question is: How do I generalise a spell such as Mage Hand that I could then turn my Spell Behaviour objects into a collection of generalised actions?

Thanks for reading this far!

public class Entity_Cast_Comp : MonoBehaviour
{
    (HideInInspector)
    public GameObject parent;
    (Header("Available Spells"))
    public List<Spell> spells = new List<Spell>();
    (Header("Debug information"))
    public bool debug = false;

    //events
    (HideInInspector)
    public UnityEvent OnSpellsChanged;

    private void Start()
    {
        parent = this.gameObject;
    }

    public void Cast(Spell spell, KeyCode button)
    {
        SpellCastData data = new SpellCastData();
        data.button = button;
        data.caster = parent;
        //TODO : This seems like a bad idea
        data.castLocation = parent.transform.Find("CastPointRight");

        //check the spell isnt already casting
        if (data.spellRunning == false && GameObject.FindObjectOfType<UI_Controller>().UIOpen() == false)
        {
            data.spellRunning = true;
            data.SetState(SpellStates.AIMING);
            StartCoroutine(DoCast(spell, data));
        }
    }

    public void AddSpell(Spell spell)
    {
        if (!spells.Contains(spell))
        {
            spells.Add(spell);
            OnSpellsChanged.Invoke();
        }
    }


    public void RemoveSpell(Spell spell)
    {
        if (spells.Contains(spell))
        {
            spells.Remove(spell);
            OnSpellsChanged.Invoke();
        }
    }

    private IEnumerator DoCast(Spell spell, SpellCastData data)
    {
        while (data.spellRunning)
        {
            data.UpdateButtonState();


            switch (data.state)
            {
                case SpellStates.AIMING:
                   yield return spell.spellAim.Aim(spell, parent, data);

                break;

                case SpellStates.CASTING:


                    yield return spell.spellCast.Cast(spell, parent, data);
                    yield return spell.spellAim.DrawAim(spell, parent, data);


                    foreach (var target in data.targets)
                    {
                        if (!data.effectInstances.ContainsKey(target))
                        {
                            //TODO : F
                            data.effectInstances(target) = spell.spellVisual.SpawnEffect(data.castLocation.position, parent.transform.rotation);
                            data.targetsHit.Add(target, false);
                        }

                    }

                    foreach (var target in data.targets)
                    {
                        while (data.targetsHit(target) == false)
                        {
                            yield return spell.spellMotion.Move(spell, parent, data, target);
                        }
                    }

                    foreach (var target in data.targets)
                    {
                        if (data.preEffectDone.ContainsKey(target) == false)
                        {
                            yield return spell.spellBehaviour.PreEffect(spell, parent, data, target);
                            data.preEffectDone.Add(target, true);
                        }

                        yield return spell.spellBehaviour.Effect(spell, parent, data, target);
                    }

                break;

                case SpellStates.CANCELLING:

                    data.spellRunning = false;
                    data.Reset();
                yield break;

                case SpellStates.FINISHED:

                    foreach (var target in data.targets)
                    {
                        yield return spell.spellBehaviour.PostEffect(spell, parent, data, target);
                    }

                    data.Reset();
                yield break;
            }

            yield return null;
        }

        yield break;
    }

}

This is the spell behaviour for ‘Mage Hand’

(CreateAssetMenu(menuName = scriptableObjectPath + componentPath + "TeleHold"))
public class Spell_Effect_TelekineticHold : Spell_Behaviour
{
    public float speed = 5f;
    public float moveSpeed = 3.5f;
    public float xOffsetMin = 0f;
    public float xOffsetMax = 2f;
    public float yOffsetMin = 0f;
    public float yOffsetMax = 2f;
    public float zOffsetMin = -0.5f;
    public float zOffsetMax = 1f;



    private Transform pivotPoint;

    private float zOffset = 0;
    private float xOffset = 0;
    private float yOffset = 0;

    private Vector3 targetOffset = new Vector3();

    public float smoothTime = 0.3F;

    private Vector3 targetOriginalRotation;
    private Vector3 velocity = Vector3.zero;
    private Quaternion quaternion;

    public override IEnumerator Effect(Spell _parent, GameObject caster, SpellCastData data, GameObject target)
    {       
        //hold target in place as long as casting and target exists
        if (target)
        {

            //TODO : Extra action keys shouldnt be hard coded
            if (Input.GetKey(KeyCode.T))
            {
                xOffset += Input.GetAxisRaw("Mouse X");
                yOffset += Input.mouseScrollDelta.y * 0.25f;
            }
            else
            {
                zOffset += Input.mouseScrollDelta.y * 0.25f;
            }

            //TODO : Extra action keys shouldnt be hard coded
            //and this probably doesnt want to work like this?
            if (Input.GetKey(KeyCode.Mouse2))
            {

                yield return PostEffect(_parent, caster, data, target);
                AddForce(target, data);
                data.spellRunning = false;
                yield break;
            }

            xOffset = Mathf.Clamp(xOffset, xOffsetMin, xOffsetMax);
            yOffset = Mathf.Clamp(yOffset, yOffsetMin, yOffsetMax);
            zOffset = Mathf.Clamp(zOffset, zOffsetMin, zOffsetMax);

            int targetIndex = data.targets.FindIndex(x => x == target);
            //TODO : Improve multi hand stacking
            targetOffset = new Vector3(xOffset + 1.4f * targetIndex, yOffset, 0);

            if (data.effectInstances(target) != null)
            {
                Widget targetWidget = target.GetComponent<Widget>();
                Vector3 targetPosition = (pivotPoint.position + targetOffset) + (pivotPoint.forward * zOffset * 5f);
                if (targetWidget)
                {
                    targetPosition.y = targetPosition.y + targetWidget.carryTargetPositionOffset.y;
                    target.transform.localPosition = Vector3.zero + targetWidget.carryTargetPositionOffset;
                }
                else
                {
                    target.transform.localPosition = Vector3.zero;
                }

                data.effectInstances(target).transform.DOMove(targetPosition, smoothTime);

                data.effectInstances(target).transform.rotation = data.caster.transform.rotation;
            }

            yield return null;
        }
        else
        {
            yield break;
        }     
        yield break;
    }

    public override IEnumerator PreEffect(Spell _parent, GameObject caster, SpellCastData data, GameObject target)
    {
        //Debug.Log("pre effect");
        if (target)
        {
            SetSpellDataPreviousParent(data, target);
            pivotPoint = caster.transform.Find("MageHandRight").transform;
            ParentToEffectInstance(target, data);
            targetOriginalRotation = target.transform.eulerAngles;
            CopyPhysicsSettings(target);
            DisablePhysics(target);
        }

        yield break;
    }

    public override IEnumerator PostEffect(Spell _parent, GameObject caster, SpellCastData data, GameObject target)
    {
       // Debug.Log("post effect");
        if (target)
        {
            target.transform.eulerAngles = targetOriginalRotation;
            RemoveParentToEffectInstance(target, data);
            RestorePhysicsSettings(target);
            ResetVariables();
            DeleteEffectInstance(data, target);
        }            
        yield break;
    }

    private void ResetVariables()
    {
        zOffset = 0;
        xOffset = 0;
        yOffset = 0;
    }

}

sharepoint online – Unable to filter the items based on the content type inside my content search web part

I have a content search web part inside our sharepoint online site collection, and i want to show items which are under certain content type, but when i use the following to get the items which are linked to a content type named “OrderManagmentSales”, as follow:-

enter image description here

i got all the items and not only the ones associated with the “OrderManagementSales” content type, any idea why this is not working? seems the content search web part ignore the ContentType:"OrderManagementSales" inside the query..

Thanks

linux – Deny port redirection based on source IP – firewalld

I’m trying to forward a port to an external IP using firewall-cmd, but I need to deny access from certain ips.


To setup a port-forward of port 55500, I use:

firewall-cmd --permanent --zone=public --add-forward-port=port=55500:proto=tcp:toport=55500:toaddr=2.2.2.2

The above works fine and users connecting to port 55500 get successfully redirected to 2.2.2.2 , but, as mentioned previously, I need to deny access to users coming from 1.1.1.1/24, for that I tried:

firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='1.1.1.1/24' reject"

or :

firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=1.1.1.1/24 port port=55500 protocol=tcp reject'

or:

firewall-cmd --zone=drop --add-source=1.1.1.1/24

But none of the commands above worked, and users connecting to port 55500 from 1.1.1.1 still get redirected to 2.2.2.2.


How can I deny the port redirection based on the source IP?

linux – Deny port redirection based on source IP – firewalld

I’m trying to forward a port to an external IP using firewall-cmd, but I need to deny access from certain ips.


To setup a port-forward of port 55500, I use:

firewall-cmd --permanent --zone=public --add-forward-port=port=55500:proto=tcp:toport=55500:toaddr=2.2.2.2

Which works fine, and users connecting to port 55500 are successfully redirected to 2.2.2.2 , but, as mentioned previously, I need to deny access to users coming from 1.1.1.1/24, for that I tried:

firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='1.1.1.1/24' reject"

or :

firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=1.1.1.1/24 port port=55500 protocol=tcp reject'

or:

firewall-cmd --zone=drop --add-source=1.1.1.1/24

But none of the commands above (all followed by firewall-cmd --reload) worked, and users connecting to port 55500 from 1.1.1.1 still get redirected to 2.2.2.2.


How can I deny the port redirection based on the source IP?

SharePoint Online AD Security Group Based Navigation Bar

I am trying to have group-based navigation in my SharePoint Online intranet. This is because I want only specific links to be in the dropdown of some menus to be visible to certain AD Security groups because of confidentiality.

I have read online about security trimming or client-side scripting, but in my site settings I am missing numerous options people mention in their guides but are not present.

In essense, I am curious in SharePoint Online how I can “censor” certain links in the main navigation bar based upon a users AD Security Group. Thanks

![enter image description here]1

sql – How do I extract data from a main table based on this specific scenario?

I am using SQL Server 2014. I have a table (T1) which contains the list of IDs of cancelled bookings and their equivalent re-bookings.

Extract of table T1:

CancelledID       Re-bookingID
  301                754
  387                801
  400                900
  ...

Each CancelledID has a unique equivalent in the Re-bookingID column.

I have another table (T2) which contains the list of ALL BookingIDs with additional information related to each ID. An extract of this table is shown below:

BookingID     MonthOfStay      RoomNights
...
301             2019-03-01        10
387             2019-04-01         7
400             2019-03-01         5
754             2019-08-01        10
801             2019-09-01         3
900             2019-07-01         5
900             2019-08-01         4
...   

I need a t-sql query which will me the following output:

  BookingID       Cancelled_MonthOfStay     Re-booking_MonthOfStay     RoomNights
    301                2019-03-01                                           10
    387                2019-04-01                                            7
    400                2019-03-01                                            5
    754                                           2019-08-01                10
    801                                           2019-09-01                 3
    900                                           2019-07-01                 5
    900                                           2019-08-01                 4

As you can see, a re-booking can span over 2 months with additional room nights.

I am thinking about “Joins” between the 2 tables but I am stuck at the logic to be used for the “Joins” (if that is the right way of tackling the problem).

Any help would be appreciated.