text:
Q: How can I found out why I lost 60 rep on a deleted answer? I had written an answer to a question called "Why doesn't C# support string enumerations?" That was an actual answer IMO. Today I see in my account that I have recieved -60 rep for that answer and it also deleted.
I cannot even find the question anymore, a search for the question in quotation mark gives me no result, without quotation mark 720, and I cannot see the one. Searching for +why +C# +support +string +enumerations yields 7 hits but not the question I am searching for.
My question is:
Did the deletion take those 60 reps from me, or was it the consequence of so many people downvoting my answer? (I assume the latter.)
How can I find the question and the answer and the reason why my answer was downvoted and deleted?

A: Your answer wasn't down-voted.
What happened would be:

*

*User asks question.

*You answer it.

*Your answer receives 6 upvotes => +60 reputation.

*For whatever reason the question (and your answer is deleted)

*Your reputation now goes down by 60 points because those votes don't exist any more.

Previously you wouldn't have noticed this and your reputation would have been inflated by these no longer existant votes.
Recent changes now mean that reputation reductions due to deletions are reflected as they happen rather than waiting for a recalculation.

A: The answer got deleted, so any reputation associated with it was also deleted and removed.
This was always happening, but not as visible as the reputation on the site would not normally display this reduction in reputation immediately, but only after reputation recalculations.
This changed recently.


text:
Q: Navigation in react native iOS I have a Navigator component in my react native app.
It is supposed to navigate between different pages.
When I run the project, It is working fine in Simulator.
But, when I run the app in device (ipad), It is not going on second page.
XCode console throws an error saying  " Listeners not binded "
How to solve this issue ?
index.ios.js -

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  Image,
  ListView,
  StyleSheet,
  Text,
  Navigator,
  View
} from 'react-native';

var SplashPage = require('./js/SplashPage');
var MainPage = require('./js/MainPage');
var PersonPage = require('./js/PersonPage');
var VotePage = require('./js/VotePage');
var VoteDetailsPage = require('./js/VoteDetailsPage');
var PersonByLocationPage = require('./js/PersonByLocationPage');
var SearchRepresPage = require('./js/SearchRepresPage');
var navigator;

class Netizen extends Component {

   render() {

    return (
      <Navigator
          ref={(nav) => { navigator = nav; }}
          initialRoute={{id: 'SplashPage', name: 'Index'}}
          renderScene={this.renderScene.bind(this)}
          configureScene={(route) => {
            if (route.sceneConfig) {
              return route.sceneConfig;
            }
            return Navigator.SceneConfigs.FloatFromRight;
          }} />
    );
  }

  renderScene(route, navigator) {
    var routeId = route.id;

    if (routeId === 'SplashPage') {
      return (
        <SplashPage
          navigator={navigator} data={route.data}/>
      );
    }
    if (routeId === 'MainPage') {
      return (
        <MainPage
            navigator={navigator} data={route.data}/>
      );
    }
    if (routeId === 'PersonPage') {
      return (
        <PersonPage
          navigator={navigator} data={route.data}/>
      );
    }
    if (routeId === 'VotePage') {
      return (
        <VotePage
            navigator={navigator} data={route.data}/>
      );
    }
    if (routeId === 'VoteDetailsPage') {
      return (
        <VoteDetailsPage
            navigator={navigator} data={route.data}/>
      );
    }
    if (routeId === 'PersonByLocationPage') {
      return (
        <PersonByLocationPage
            navigator={navigator} data={route.data}/>
      );
    }
    if (routeId === 'SearchRepresPage') {
      return (
        <SearchRepresPage
            navigator={navigator} data={route.data}/>
      );
    }
    return this.noRoute(navigator);

  }

  noRoute(navigator) {
    return (
      <View style={{flex: 1, alignItems: 'stretch', justifyContent: 'center'}}>
        <TouchableOpacity style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}
            onPress={() => navigator.pop()}>
          <Text style={{color: 'red', fontWeight: 'bold'}}>请在 index.js 的 renderScene 中配置这个页面的路由</Text>
        </TouchableOpacity>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
  shareText: {
    fontSize: 20,
    margin: 10,
  }
});

AppRegistry.registerComponent('Netizen', () => Netizen);

MainPage.js -

render() {
    return (
      <Navigator
          renderScene={this.renderScene.bind(this)}
          navigator={this.props.navigator}
          navigationBar={
            <Navigator.NavigationBar style={{backgroundColor: '#246dd5'}}
                routeMapper={NavigationBarRouteMapper} />
          }
         />
    );
  }

Note - Navigation is working in Simulator, but not in iOS

redpajama_set_name: RedPajamaStackExchange


text:
Q: Django: model object related table not exist It has been quite a while since I'd used MySQL DB using django ORM.
And When I tried to make a dump file so that I can move the data to another database, I figured out some one of the table were missing.
Below is the relevant code in mainapp.models.py
class Review(models.Model):
    id = models.CharField(max_length=100, primary_key=True)
    title = models.TextField(blank=True)
    contents = models.TextField(blank=True)

I expected table 'mainapp_review' should be in the database but any query or execution related to this query didn't work saying it doesn't exist.
Also, 'show tables' command result confirmed mainapp_review is not there.
My question now is, if it is true, where those row data exist then?
And how django ORM has been able to do CRUD when there is no table for that?

A: The data might be different model instead the model that you are checking.I think you have other model in your web app , please check that table.


text:
Q: How to access inner dictionary items of a dictionary in Python I have following data structure:
mydic = {
           'q4a1_0' : {'title':'4 Question 1 Answer (01)','choices': ((0,'Very Bad'),(1,'Medium'),(2,'Good'),(3,'Very Good'))},
           'q3a1_0' : {'title':'3 Question 1 Answer (01)','choices': ((0,'Very Bad'),(1,'Good'),(2,'Very Good'))}
         }

My question is how can I access 'choices' or 'titles' of any dictionary keys(say 'q4a1_0') directly.

A: Access by using the indices.
>>> mydic['q4a1_0']['choices']
((0, 'Very Bad'), (1, 'Medium'), (2, 'Good'), (3, 'Very Good'))

A: You can do it like so:
mydic['q4a1_0']['choices']

A: mydic is a dictionary, which has a dictionary in it.  So mydic['q4a1_0'] gets you to the inner dictionary, and mydic['q4a1_0']['title'] would get you the title key from q4a1_0.


text:
Q: what is the max number of requests Nginx server allow client to send in one HTTP 1.1 connection HTTP  client could send multiple requests in one HTTP 1.1  connection due to Keep alive feature.
But is there any limit of that number in protocol?
If not, what is the implementation for Nginx about that? Does it have any configuration?

A: The answer is 100 for nginx 1.9.9 or earlier and 1000, for nginx 1.9.10 and later.
Thekeepalive_requests directive (default is 100/1000) allows you to configure the maximum number of requests done through a single keepalive connection. From documentation link above:

Sets the maximum number of requests that can be served through one keep-alive connection. After the maximum number of requests are made, the connection is closed.

A mere equivalent for this directive in HTTP/2 is http2_max_requests


text:
Q: Usually after Windows updates the device name of my hard drives change So every now and then, not on every Windows update, but notably connected with Windows updates, the device names of some of my hard drives change.
For example just today after running a Windows update, the two hard drives seen in the object manager namespace as \Device\Harddisk0 and \Device\Harddisk1 switched places. Correspondingly the volume device name changed from \Device\Harddisk1\Partition7 to \Device\Harddisk0\Partition7.
For the most part this wouldn't be an issue because the way drive letters get assigned doesn't rely on these device names.
However, I need to rely on the device name to mount encrypted volumes.
How can I teach Windows 7 to always assign the same device name to a given hard drive?

From the perspective of a driver writer I don't see one as these things are sorted out in a PnP fashion, but maybe there is something in userland that allows for it based on some device ID similar to the way USBDLM handles things at the volume level?


text:
Q: Does charging a Li-ion battery smart phone through a computer's USB port put additional strain on the battery vs a wall charger? I was curious about this. I read that you should generally avoid completely discharging and then full charging your Li-ion battery because this can strain the battery (though some suggested doing this every so often for calibration).
When your charging your phone via a PCs USB port it will take longer to charge because the USB port does not supply as much power as a wall charger.
Because of the fact that it will take your battery longer to charge, does it strain the battery more to charge when plugged into a PC?
Say for example my battery is almost completely discharged (like 10% life left) and I want to charge it to 100%. Plugging it into a wall charger vs a PC- what will be the impact on the health of the batter?

A: The issue of loss of capacity with battery charging and discharging is due to crystallization of pure concentrated chemicals inside the battery. Once crystals start to form they do not want to revert back to a liquid state again, and the battery permanently loses some charge/discharge capacity.
This is why sometimes old lead-acid batteries bulge outward when they are failing... huge lead crystals have formed which apply pressure to the lead plates and case and bend them. Growing crystals can also form electrical shorts between plates and ruin the individual cells.
The goal of not discharging too far is to try to stay out of the area where crystallization becomes much easier due to high concentrations of the chemicals in the deeply discharged state.
Lead acid cells should ideally never be allowed to stay discharged very long, and rapid recharge is recommended. Though once charged they need to trickle charge to prevent damage from overcharging.
Lithium cells are generally more tolerant of full charge and discharge cycles. The construction of the cell and the surface features of the plates can help prevent crystal formation. Slow charging generally should not affect the life of lithium cells as much as it can with lead-acid cells.
It's often said that lithium cells have a fixed life of about five years, though my own experience does not bear this out. We have about 15 IBM Thinkpads with original lithium battery packs from a decade ago and they all still hold at least 2 hrs of charge.

A: There are all sorts of  conditions than can affect this, but as a general rule of thumb, the faster you charge/discharge a battery, the more you will 'strain' it (lowering lifetime).
Again, not always true, but as a general rule of thumb your wall charger will deliver more current than your PCs USB port, charging your battery faster.
Therefore, the computer will typically put less strain on the battery (by taking longer to charge it).
Honestly though, this would be a small effect and you'd be unlikely to notice a difference. For lifetime, there are much more important things to consider like temperature and limiting how often/much you need to re-charge your battery.

A: It's true that the USB port may deliver less power than a phone charger, or not support a specific protocol required by the phone to charge at full speed. This is possible when using USB from a desktop and almost certain if using USB from a laptop.
Generally speaking, you can "power charge" batteries, to charge them faster, but it will hurt their lifetime. The electronics in the phone and the protocol in USB make it impossible to accidentially "power charge" a phone, so the only thing that does happen is that they will charge slower than usual. Charging batteries somewhat slower (2x, 4x) will not hurt them.
However, because of the slower charge speed it's now possible to use battery faster than you are charging it, if you use the phone heavily while charging - that wouldn't be good for the lifetime of the battery, but it also wouldn't kill the battery outright.

A: Wall charger has adapter power of 25w compared to the usb charger where only maximum 10W available so wall charger is faster 2.5 times than USB
Another fact is that Charging via USB decrease the life of battery because it generate more amount of heat which would degrade the battery life time.


text:
Q: How to use Json correctly I want to sent a Json from my serverside to Java script.
return Json("{\"Message\":\"A Mistake just happend\",\"Passed\":\"false\"}", JsonRequestBehavior.AllowGet);

I does work and I get everything but as a string. I want to ask if it passed. So
I would have to either convert my Passed to a bool var or compare if it equals false.
I that  the right way to go or do I do something wrong with sending or receiving th Json?

A: Do not pass string to Json method, you need to pass C# object instead. In your case you can use anonymous object. So if you will replace:
return Json("{\"Message\":\"A Mistake just happend\",\"Passed\":\"false\"}", JsonRequestBehavior.AllowGet);

with:
return Json(new {Message = "Something", Passed:false}, JsonRequestBehavior.AllowGet);

everything will work well.


text:
Q: Selective field in output from Array of Documents in MongoDB I am new to MongoDB and still trying to learn basics.
Here is my document in MOongoDB in which I am facing some issue.
{
        "_id" : 19,
        "name" : "Gisela Levin",
        "scores" : [
                {
                        "type" : "exam",
                        "score" : 44.51211101958831
                },
                {
                        "type" : "quiz",
                        "score" : 0.6578497966368002
                },
                {
                        "type" : "homework",
                        "score" : 93.36341655949683
                },
                {
                        "type" : "homework",
                        "score" : 49.43132782777443
                }
        ]
}

Now, I am firing a query something like this:to find the scores of student where type is homework in sorted order and only the homework score needs to be found.
db.students.find({"name":"Gisela Levin","scores.type":"homework"},{"_id":1,"scores.score":1});

What I am trying to achieve is getting output only the score corresponding to homework in sorted order and not others. (i.e. I dont want score for exam and quiz in the output but only for homework in sorted order).
I am trying to use projection but I am kinda struck with no forward path.
Please guide.


text:
Q: Call requires API level 23 (current min is 18): android.app.Activity#requestPermissions The error is showing in this "checkSelfPermission" Function
This is my code:
private void checkBTPermissions() {
        if(Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP){
            int permissionCheck =
            this.checkSelfPermission("Manifest.permission.ACCESS_FINE_LOCATION");

           permissionCheck+=this.checkSelfPermission("Manifest.permission.ACCESS_COARSE_LOCATION");

          if (permissionCheck != 0) {

                this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number
            }
        }else{
            Log.d(TAG, "checkBTPermissions: No need to check permissions. SDK version < LOLLIPOP.");
        }
    }

A: Permission Check is only available from API 23 i.e. from Marshmallow.
You don't need to ask for Permission on Api < 23 as they are automatically granted on App Install.
More Info -
https://developer.android.com/about/versions/marshmallow/android-6.0-changes#behavior-runtime-permissions

A: You are wrong at the following code:
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {}

Build.VERSION_CODES.LOLLIPOP = 21. You can ask runtime permissions only for API level > 22.
Fix it by changing your code into:
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) {}

Or even better way would be to use my library. :)


text:
Q: Metaplex - Canceling an (English) Auction made by Auctioneer I have a question about canceling auctions in the Metaplex's Auction House.
I'm currently creating an Auction with the following instruction:
const accounts = {
  auctionHouseProgram,
  listingConfig,
  wallet,
  tokenAccount,
  metadata,
  authority,
  auctionHouse,
  auctionHouseFeeAccount,
  sellerTradeState,
  freeSellerTradeState,
  auctioneerAuthority,
  ahAuctioneerPda,
  programAsSigner
};

const args {
  tradeStateBump,
  freeTradeStateBump,
  programAsSignerBump,
  auctioneerAuthorityBump,
  tokenSize,
  startTime,
  endTime,
  reservePrice,
  minBidIncrement,
  timeExtPeriod,
  timeExtDelta,
  allowHighBidCancel,
}

Auctioneer.createSellInstruction(acounts, args);

Is there any way to cancel a listed auction of this type?
I know that other types of listings such as AuctionHouse.createSellInstruction (https://github.com/metaplex-foundation/metaplex-program-library/blob/master/auction-house/js/src/generated/instructions/sell.ts) do have a Cancel Instruction, and I've used them before.
But how can I cancel the English Auction type? Is it even possible? Like, what if I accidently made an Auction last for years, or put a wrong Listing Configuration value?
All Cancel instructions take as an argument the buyerPrice. But in this case there is no buyerPrice, it rather uses reservePrice.
I've tried to pass the buyerPrice as 18446744073709551615 to try to execute the Auctioneer.createCancelInstruction, which is the same buyerPrice value I used to create the TradeState for listing it. But I get the following error:
2: "Program log: AnchorError caused by account: token_account. Error Code: AccountOwnedByWrongProgram. Error Number: 3007. Error Message: The given account is owned by a different program than expected."
3: "Program log: Left:"
4: "Program log: 11111111111111111111111111111111"
5: "Program log: Right:"
6: "Program log: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"

Also...

*

*Is it possible to create a ListingReceipt for this type of
listing? I want to keep track of creation date, canceled date, etc.

*When an Auction for an item has ended and failed to bid cause no bidders or any other reason, if I try to list it again for another auction I get: Address { address: GkX7ZE4sz6mtvueoWT6KGpjZLUd3wkohy3ha3VZNh2Fz, base: None } already in use So I believe cancelation is needed. Cause now it's on a weird unknown status where Auction has ended due to time constraints and Token cannot be listed again.

A: You can cancel your listing Using THIS.

*

*You can you normal listing receipts of AH for this as well.

*The previous account should be closed in order to create a new listing. In order to close that account you need to cancel listing or the Nft should be sold.


text:
Q: How to convert a UTC date to NSDate? I have a string that is UTC and would like to convert it to an NSDate.
static NSDateFormatter* _twitter_dateFormatter;
[_twitter_dateFormatter setFormatterBehavior:NSDateFormatterBehaviorDefault];
[_twitter_dateFormatter setDateFormat:@"EEE MMM dd HH:mm:ss ZZZ yyyy"];
[_twitter_dateFormatter setLocale:_en_us_locale];

NSDate *d = [_twitter_dateFormatter dateFromString:sDate];

When I go through the debugger d is nil even though sDate is "2010-03-24T02:35:57Z"
Not exactly sure what I'm doing wrong.

A: Ditto on the need to alloc/init your NSDateFormatter object, but you have another problem too: your Date format string does not match the actual date  you're giving it.
"EEE MMM dd HH:mm:ss ZZZ yyyy"
- vs -
"2010-03-24T02:35:57Z"

That format string would match something like:
"Wed Mar 24 00:07:33 -0400 2010"

See the unicode standard for the meaning of the date format string.

A: You aren't allocating or initialising your NSDateFormatter object.
Try something like this:
NSDateFormatter* _twitter_dateFormatter = [[NSDateFormatter alloc] init];
[_twitter_dateFormatter setFormatterBehavior:NSDateFormatterBehaviorDefault];
[_twitter_dateFormatter setDateFormat:@"EEE MMM dd HH:mm:ss ZZZ yyyy"];
[_twitter_dateFormatter setLocale:_en_us_locale];

NSDate *d = [_twitter_dateFormatter dateFromString:sDate];
[_twitter_dateFormatter release];

It's also unclear why you are declaring _twitter_dateFormatter as a static.  If you are trying to avoid re-allocating it, make it an ivar of your class.

A: Apple gives source code for Parsing an RFC 3339 date-time. If using ARC, you'll may want to adjust that source by removing the calls to 'autorelease'.
FYI, RFC 3339 is a subset of ISO 8601 with one deviation (negative zero offset is allowed in RFC 3339). So Apple's code is killing two birds with one stone, handling the so-called 'Internet-style' RFC 3339 datetimes as well as simple datetimes of ISO 8601.


text:
Q: make listview clickable setOnItemclicklistener method not working I made a listView with text and image.Now i want to make its items clickable.I used setOnitemclickListener method but it's not working ..
i think i am doing something wrong
here is my code....
Adapter.java
   public class Adapter extends BaseAdapter  {

   private static final String TAG = "Adapter";
    private Activity mActivity;
    public ArrayList<Data> mObjects;

   static class ViewHolder {
    ImageView icon;
    TextView title;
    TextView name;
    TextView review;
    DownloadImageTask mTask;
   // DownloadImageTask1 mTask1;
   // ImageView photo;
}

public Adapter(Activity activity, ArrayList<Data> mObjects) {

    this.mActivity = (Activity) activity;
    this.mObjects = mObjects;
}

public void setObjects(ArrayList<Data> mObjects) {
    this.mObjects = mObjects;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    Data item = mObjects.get(position);
    View rowView = convertView;

    if (rowView == null) {
        LayoutInflater inflater = mActivity.getLayoutInflater();
        rowView = inflater.inflate(R.layout.item, parent, false);
        ViewHolder viewHolder = new ViewHolder();
        viewHolder.icon = (ImageView) rowView.findViewById(R.id.image);
       // viewHolder.photo = (ImageView) rowView.findViewById(R.id.photo);
        viewHolder.title = (TextView) rowView.findViewById(R.id.title);
        viewHolder.name  = (TextView) rowView.findViewById(R.id.name);

        viewHolder.review  = (TextView) rowView.findViewById(R.id.status);
        rowView.setTag(viewHolder);
    }

    ViewHolder holder = (ViewHolder) rowView.getTag();

    holder.title.setText(item.getmTitle());
    holder.name.setText(item.getmConcatinate());
    holder.review.setText(item.getmreview());
    holder.icon.setBackgroundResource(R.drawable.ic_ab);
   // holder.photo.setBackgroundResource(0);
    holder.mTask = new DownloadImageTask(item.getmImageUrl(), holder.icon);
    if (!holder.mTask.isCancelled()) {
        holder.mTask.execute();
    }
   // holder.mTask1 = new DownloadImageTask1(item.getmImageUrl1(), holder.photo);
  //  if (!holder.mTask1.isCancelled()) {
  //      holder.mTask1.execute();
  //  }

    return rowView;
}

@Override
public int getCount() {

    return (this.mObjects.size());
}

@Override
public Object getItem(int position) {

    return (this.mObjects.get(position));
}

@Override
public long getItemId(int position) {

    return (position);
}

public AbsListView.RecyclerListener mRecyclerListener = new RecyclerListener( ){

    public void onMovedToScrapHeap(View view) {
        ViewHolder viewHolder = (ViewHolder) view.getTag();
        DownloadImageTask imagetask = viewHolder.mTask;
       // DownloadImageTask1 imagetask1 = viewHolder.mTask1;
        if (imagetask != null) {
            imagetask.cancel(true);
        }
       // if (imagetask1 != null) {
      // //     imagetask1.cancel(true);
      //  }
    }

};

}
using that content in main class
       @Override
    protected void onCreate(Bundle savedInstanceState) {
    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
            .detectAll().penaltyLog().build();
    StrictMode.setThreadPolicy(policy);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile3);

    name = (TextView) findViewById(R.id.textView1);
    bmImage2 = (ImageView) findViewById(R.id.imageView1);
    address = (TextView) findViewById(R.id.textView2);
    gender = (TextView) findViewById(R.id.textView3);
    loyalitypoints = (TextView) findViewById(R.id.textView7);
    followers = (TextView) findViewById(R.id.textView8);
    following = (TextView) findViewById(R.id.textView9);
    // list13 = new ArrayList<HashMap<String, Object>>();
    mListView = (ListView) findViewById(android.R.id.list);
    mListView.setClickable(true);

    // mListView=(ListView)findViewById(R.id.list);
    mAdapter = new Adapter(this, mSource);
    mListView.setAdapter(mAdapter);
     Log.w("Parsing JSON Data", "Before Item click");

    mListView.setRecyclerListener(mAdapter.mRecyclerListener);

    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> arg0, View arg1, int position,long arg3) {
             Log.w("Parsing JSON Data", "After Item click");
        }
    });

A: u will have to make oclicklistener in your adapter only.
   viewHolder.name.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                //perform action

            }
        });

A: Try this **
ListView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View arg1, int position,long arg3)
        {
              // your action to be performed
        }
    });

}


text:
Q: Is there a redstone device that can gather lava buckets hands off? My nether portal is a stone throw away from a lava lake. I've been using a crab load of buckets to keep my furnaces running for building materials.
I'm trying to cut the work down and not run around all the time. I'm trying to figure out if it's possible to have a redstone device that I can just drop buckets in and it'll gather the lava for me.
I've been doing some tests but I keep getting buckets spat into the lava pool and I'm not desiring to lose more iron. Just seeing if it's possible. Or worthwhile.

A: If you are getting buckets spat into the lava pool, it is either because you are dispensing buckets using a dropper or because you are dispensing them into flowing lava instead of source blocks.
Unlike water, lava doesn't create source blocks. This means you can't create infinite lava sources like you can with water, and unfortunately you cannot automate the full process.
You can, however, semi-automate this process by creating a system where you use one bucket to transport the lava between the lava lake and the machine, and the machine will fill each bucket from an input hopper. You can check out many tutorials online to help you with this, or see if you can find a bug online that can help you create an infinite lava source.

A: The only option to automatically fill a bucket with lava is using a dispenser, from lava source right in front of it. The dispenser can't be moved (in front of next lava source) in vanilla Java Edition, and the lava source can only be moved using buckets (potentially with (immovable) dispensers). So, in short, "no". You can't truly automate the process of gathering lava.
What you can do though is to automate transport. A minecart line, automatic loaders/unloaders, sending empty buckets back, even means of sending the carts through a portal to the overworld and keep the overworld part loaded. You'd only need to fill the buckets and put them in a chest of the loading station right next to the lava lake.
On the other hand, the Carpet Mod provides movable tile entities. That means you could build a flying machine that harvests a lake of lava through use of a moving dispenser.

A: I know that this isn´t a direct answer to your question, but it can solve your fuel
run problem. You can make a simple automatic observer piston farm with sugarcane or kelp (Because they grow fast) and let a water stream feed your plant material into hoppers into your furnaces or whatever you want. The only problem is that it has to be big enough and can be an eye sore.


text:
Q: Tailwind.css — How to implement the last-child using Tailwind? I have tried without success to implement the prefix last: as shown in the Tailwind.css documentation. Can anyone point out what I am doing wrong? I cannot make this work.
Thank you in advance.
React Component
{items.map((item, i) => {
            return (

                      {item}

{description[i]}

            )
          })}

A: Not sure if you're using Tailwind v2.X or v1.X but you need to activate the variant for  last. Here is a quote from the official v2 docs related page

By default, the last-child variant is not enabled for any core plugins.

I've tried to make an example for you on https://play.tailwindcss.com/ but it doesn't work there. Meanwhile, I spin a Vite VueJS repo with the latest version of TW and it's working perfectly.
So, this in your tailwind.config.js should do the trick
module.exports = {
  ...
  variants: {
    extend: {
      padding: ['last'],
    }
  },
  ...
}

v2's documentation is here and v1's is here.
Beware, the variants >> extend is only available in the v2. If you're using v1, you can still override the whole padding variant manually, not a big deal.
PS: Tailwind's team fixed the issue already, damn !

A: As of April 2022 (v 3.0.24)
According to Tailwind's doc:

Style an element when it is the first-child or last-child using the first and last modifiers

Just use last:${yourClassName} to target the last child in your case.
Source: https://tailwindcss.com/docs/hover-focus-and-other-states#last


text:
Q: Pentaho Report Output remote execution I have a pentaho BI server running on a CentOS machine (osapp), then the MySQL database with repository, staging and data wharehouse in another CentOS machine (osdb). I run Spoon from my Windows PC.
I created a transformation to run a Pentaho Report, export to PDF and send by email, automatically every 8 hours.
If I run the transformation in my Spoon, it runs as expected, but using the carte server I set on the BI server (osapp) gives an error in Pentaho Reporting Output step, with no log. I can't see the details of the error.
If I run it using Pan.sh, is the same, but I get an output like this:
sh pan.sh -rep=mitbirep -user=admin -pass=admin -trans="HighRisk Containers" -level=basic
INFO  02-01 18:56:06,187 - Pan - Logging is at level : Basic logging
INFO  02-01 18:56:06,188 - Pan - Start of run.
INFO  02-01 18:56:06,284 - RepositoriesMeta - Reading repositories XML file: /opt/pentaho/data-integration/repositories.xml
INFO  02-01 18:56:08,144 - HighRisk Containers - Dispatching started for transformation [HighRisk Containers]
INFO  02-01 18:56:08,241 - Data Grid - Finished processing (I=0, O=0, R=0, W=1, U=0, E=0)
INFO  02-01 18:56:08,594 - LibBase 1.2.2.13667 started.
INFO  02-01 18:56:08,840 - LibLoader 1.2.2.13667 started.
INFO  02-01 18:56:08,946 - LibFonts 1.2.3.13670 started.
INFO  02-01 18:56:09,008 - LibSerializer 1.2.2.13667 started.
INFO  02-01 18:56:09,169 - LibFormula 1.2.3.13667 started.
INFO  02-01 18:56:09,321 - LibFormat 1.2.3.13667 started.
INFO  02-01 18:56:09,384 - LibXML 1.2.2.13670 started.
INFO  02-01 18:56:09,439 - LibRepository 1.2.3.14252 started.
INFO  02-01 18:56:09,499 - LibDocBundle 1.2.3.14252 started.
WARN  02-01 18:56:10,312 - No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/opt/pentaho/data-integration/libext/reporting/ehcache-core-2.0.1.jar!/ehcache-failsafe.xml
INFO  02-01 18:56:12,674 - Completed font registration.
INFO  02-01 18:56:12,735 - Completed font registration.
INFO  02-01 18:56:12,797 - Completed font registration.
INFO  02-01 18:56:17,983 - Pentaho Reporting Engine Classic 3.8.2-GA.14313 started.
WARN  02-01 18:56:18,673 - Unknown tag <http://jfreereport.sourceforge.net/namespaces/datasources/sql:query-definitions>: Start to ignore this element and all of its childs.  [Location: Line=16 Column=27]
WARN  02-01 18:56:20,149 - No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/opt/pentaho/data-integration/libext/reporting/ehcache-core-2.0.1.jar!/ehcache-failsafe.xml
WARN  02-01 18:56:20,208 - Creating a new instance of CacheManager using the diskStorePath "/tmp" which is already used by an existing CacheManager.
The source of the configuration was net.sf.ehcache.config.generator.ConfigurationSource$DefaultConfigurationSource@463684dc.
The diskStore path for this CacheManager will be set to /tmp/ehcache_auto_created_1357170980208.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.
INFO  02-01 18:56:20,326 - RepositoriesMeta - Reading repositories XML file: /opt/pentaho/data-integration/repositories.xml
ERROR 02-01 18:56:20,337 - 2132298740: Report processing failed.
ERROR 02-01 18:56:20,340 - Writing PDF failed.
org.pentaho.reporting.engine.classic.core.ReportDataFactoryException: Unable to load Kettle-Transformation
    at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleTransFromFileProducer.loadTransformation(KettleTransFromFileProducer.java:145)
    at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.AbstractKettleTransformationProducer.performQuery(AbstractKettleTransformationProducer.java:313)
    at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleDataFactory.queryData(KettleDataFactory.java:134)
    at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:135)
    at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryInternal(CachingDataFactory.java:421)
    at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryStatic(CachingDataFactory.java:183)
    at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:130)
    at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryData(CompoundDataFactory.java:85)
    at org.pentaho.reporting.engine.classic.core.states.datarow.ReportDataRow.createDataRow(ReportDataRow.java:97)
    at org.pentaho.reporting.engine.classic.core.states.datarow.DefaultFlowController.performQuery(DefaultFlowController.java:188)
    at org.pentaho.reporting.engine.classic.core.states.process.ProcessState.initializeForMasterReport(ProcessState.java:287)
    at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.prepareReportProcessing(AbstractReportProcessor.java:469)
    at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.processReport(AbstractReportProcessor.java:1522)
    at org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil.createPDF(PdfReportUtil.java:122)
    at org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil.createPDF(PdfReportUtil.java:70)
    at org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil.createPDF(PdfReportUtil.java:154)
    at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.processReport(PentahoReportingOutput.java:219)
    at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.processRow(PentahoReportingOutput.java:108)
    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40)
    at java.lang.Thread.run(Thread.java:722)
ParentException:
org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException: Unable to create key: No loader was able to handle the given key data: C:\Users\mocando.PANAMA\Documents\Infrastructure\ktrs\High Risk Containers.ktr
    at org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend.createKey(DefaultResourceManagerBackend.java:76)
    at org.pentaho.reporting.libraries.docbundle.BundleResourceManagerBackend.createKey(BundleResourceManagerBackend.java:88)
    at org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey(ResourceManager.java:146)
    at org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey(ResourceManager.java:132)
    at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleTransFromFileProducer.createKey(KettleTransFromFileProducer.java:89)
    at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleTransFromFileProducer.loadTransformation(KettleTransFromFileProducer.java:124)
    at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.AbstractKettleTransformationProducer.performQuery(AbstractKettleTransformationProducer.java:313)
    at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleDataFactory.queryData(KettleDataFactory.java:134)
    at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:135)
    at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryInternal(CachingDataFactory.java:421)
    at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryStatic(CachingDataFactory.java:183)
    at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:130)
    at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryData(CompoundDataFactory.java:85)
    at org.pentaho.reporting.engine.classic.core.states.datarow.ReportDataRow.createDataRow(ReportDataRow.java:97)
    at org.pentaho.reporting.engine.classic.core.states.datarow.DefaultFlowController.performQuery(DefaultFlowController.java:188)
    at org.pentaho.reporting.engine.classic.core.states.process.ProcessState.initializeForMasterReport(ProcessState.java:287)
    at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.prepareReportProcessing(AbstractReportProcessor.java:469)
    at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.processReport(AbstractReportProcessor.java:1522)
    at org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil.createPDF(PdfReportUtil.java:122)
    at org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil.createPDF(PdfReportUtil.java:70)
    at org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil.createPDF(PdfReportUtil.java:154)
    at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.processReport(PentahoReportingOutput.java:219)
    at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.processRow(PentahoReportingOutput.java:108)
    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40)
    at java.lang.Thread.run(Thread.java:722)
log4j:WARN No appenders could be found for logger (org.pentaho.di).
log4j:WARN Please initialize the log4j system properly.
[root@mitosapp data-integration]#
[root@mitosapp data-integration]# sh pan.sh -rep=mitbirep -user=admin -pass=admin -trans="CMD Schedule" -level=basic
INFO  02-01 19:07:42,067 - Pan - Logging is at level : Basic logging
INFO  02-01 19:07:42,069 - Pan - Start of run.
INFO  02-01 19:07:42,196 - RepositoriesMeta - Reading repositories XML file: /opt/pentaho/data-integration/repositories.xml
INFO  02-01 19:07:44,686 - CMD Schedule - Dispatching started for transformation [CMD Schedule]
INFO  02-01 19:07:44,792 - Data Grid - Finished processing (I=0, O=0, R=0, W=1, U=0, E=0)
INFO  02-01 19:07:45,275 - LibBase 1.2.2.13667 started.
INFO  02-01 19:07:45,606 - LibLoader 1.2.2.13667 started.
INFO  02-01 19:07:45,730 - LibFonts 1.2.3.13670 started.
INFO  02-01 19:07:45,811 - LibSerializer 1.2.2.13667 started.
INFO  02-01 19:07:46,019 - LibFormula 1.2.3.13667 started.
INFO  02-01 19:07:46,221 - LibFormat 1.2.3.13667 started.
INFO  02-01 19:07:46,311 - LibXML 1.2.2.13670 started.
INFO  02-01 19:07:46,405 - LibRepository 1.2.3.14252 started.
INFO  02-01 19:07:46,494 - LibDocBundle 1.2.3.14252 started.
WARN  02-01 19:07:47,561 - No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/opt/pentaho/data-integration/libext/reporting/ehcache-core-2.0.1.jar!/ehcache-failsafe.xml
INFO  02-01 19:07:51,016 - Completed font registration.
INFO  02-01 19:07:51,114 - Completed font registration.
INFO  02-01 19:07:51,234 - Completed font registration.
INFO  02-01 19:07:53,342 - New update(s) found: 2.4.7 [http://www.terracotta.org/confluence/display/release/Release+Notes+Ehcache+Core+2.4]. Please check http://ehcache.org for the latest version.
INFO  02-01 19:07:59,056 - Pentaho Reporting Engine Classic 3.8.2-GA.14313 started.
ERROR 02-01 19:07:59,068 - Pentaho Reporting Output - Unexpected error
ERROR 02-01 19:07:59,079 - Pentaho Reporting Output - org.pentaho.di.core.exception.KettleException:
There was an unexpected error processing report '/var/lib/tomcat6/webapps/ROOT/CMD_schedule.prpt' to produce file '/var/lib/tomcat6/webapps/ROOT/cmd_schedule.pdf' with processor: PDF.
Failed to open URL connection

    at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.processReport(PentahoReportingOutput.java:239)
    at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.processRow(PentahoReportingOutput.java:108)
    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException: Failed to open URL connection
    at org.pentaho.reporting.libraries.resourceloader.loader.URLResourceData.getResourceAsStream(URLResourceData.java:128)
    at org.pentaho.reporting.libraries.resourceloader.loader.AbstractResourceData.getResource(AbstractResourceData.java:101)
    at org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader.loadBundle(ZipResourceBundleLoader.java:81)
    at org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend.loadResourceBundle(DefaultResourceManagerBackend.java:389)
    at org.pentaho.reporting.libraries.resourceloader.ResourceManager.loadResourceBundle(ResourceManager.java:262)
    at org.pentaho.reporting.libraries.resourceloader.ResourceManager.load(ResourceManager.java:284)
    at org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:405)
    at org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:370)
    at org.pentaho.reporting.libraries.resourceloader.ResourceManager.createDirectly(ResourceManager.java:207)
    at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.loadMasterReport(PentahoReportingOutput.java:144)
    at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.processReport(PentahoReportingOutput.java:160)
    ... 3 more

INFO  02-01 19:07:59,081 - Pentaho Reporting Output - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
INFO  02-01 19:07:59,081 - CMD Schedule - CMD Schedule
INFO  02-01 19:07:59,081 - CMD Schedule - CMD Schedule
INFO  02-01 19:07:59,162 - Pan - Finished!
INFO  02-01 19:07:59,163 - Pan - Start=2013/01/02 19:07:42.070, Stop=2013/01/02 19:07:59.162
INFO  02-01 19:07:59,163 - Pan - Processing ended after 17 seconds.

Any ideas how may I accomplish this?
Thanks

A: The problem appears to be that Pan is not finding your transform in the repository you've pointed it to. I'm not that familiar with this mechanism, but if you just need to get something working, you can instead launch Pan with a specified Kettle transform file like so
pan.sh -file='/path/to/my_transform.ktr'

This is normally how I execute transforms and it works perfectly.


text:
Q: How can I output a files random selection to a new command I'm trying to practice some coding and I am trying to make OpenVPN pick a random OVPN file for my Qubes OS laptop, and eventually for my Pop!_OS one. How do I output the commands from pick.sh into openvpn correctly
e.g.
openvpn --config (result from pick.sh)

the Pick.sh is as such
#!/bin/bash
# Reads a given directory and picks a random file.

# The directory you want to use. You could use "$1" instead if you
# wanted to parametrize it.
#DIR="./openvpn"
# DIR="$1"

# Internal Field Separator set to newline, so file names with
# spaces do not break our script.
IFS='
'

if [[ -d "${DIR}" ]]
then
  # Runs ls on the given dir, and dumps the output into a matrix,
  # it uses the new lines character as a field delimiter, as explained above.
  file_matrix=($(ls "${DIR}"))
  num_files=${#file_matrix[*]}
  # This is the command you want to run on a random file.
  # Change "ls -l" by anything you want, it's just an example.
  ls --file-type ovpn "${DIR}/${file_matrix[$((RANDOM%num_files))]}"
fi

exit 0

A: If you want to select a random file in a directory, just do:
ls -1 | sort -R | head -1

This will:

*

*list all the files in current directory as a column

*scramble the list (i.e. sort it randomly)

*select the first item in the list

-
So to put it together you could do something like this:
openvpn --config `ls -1 | sort -R | head -1`

This will run as a one-liner so you can type it directly into the terminal, or you could just have this line in your bash script.


text:
Q: Worksheet object not callable I created an excel workbook via openpyxl.
I tried to populate the workbook with some values.
So I wrote some codes to achieve this goal,but I encountered a program crash
and could not achieve my goal.
Below are the codes:
import openpyxl
wb=openpyxl.Workbook()
sheet=wb.active
sheet['A1']=200
sheet['A2']=300
sheet['A3']= '=SUM(A1:A2)'
wb.save('Formular.xlsx')

After running the code,I received an error message pointing to the third line
of the code and below is the error message.It seems I did something wrong.
PLEASE HOW CAN I FIX THIS?
TypeError: 'Worksheet' object is not callable

A: Try the below code, it will work:
import openpyxl
wb=openpyxl.Workbook()
sheet=wb.active
sheet['A1']=200
sheet['A2']=300
sheet['A3']= '=SUM(A1:A2)'
wb.save(filename = 'Formular.xlsx')


text:
Q: created databse in mysql but not showing in phpmyadmin Created database in cpanel > mysql database but when I am importing sql file in phpmyadmin I am getting this error
 Error

 SQL query:

 --
 -- Database: `alphanationalfire`
 --
 -- --------------------------------------------------------
 --
 -- Table structure for table `access`
 --
 CREATE TABLE IF NOT EXISTS `access` (
 `aid` int( 11 ) NOT NULL AUTO_INCREMENT ,
 `mask` varchar( 255 ) NOT NULL DEFAULT '',
 `type` varchar( 255 ) NOT NULL DEFAULT '',
 `status` tinyint( 4 ) NOT NULL DEFAULT '0',
  PRIMARY KEY ( `aid` )
  ) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =1;

  MySQL said: Documentation
   #1046 - No database selected

And there is no database to select. how to tackle this?

A: First of all create database in phpmyadmin. Then from the left panel select the database which you create. after opening the database then import your SQL file.

A: In order to add data to a database from a file you need to have created the databse first. In this case create alphanationalfire then select databse in phpmyadmin and import sql file.

A: Before creating table, we have to say in which database you are going to create that table. The message 'No Database selected shows' that 'u didnt select the database' so first select database using use databasename. Then create table.
show databases command will show the database list created in your mysql. Check whether the table 'alphanationalfire' exists.
In phpmyadmin, check whether it lists the 'alphanationalfire' db name. Then select it ,then try ur work


text:
Q: py2app: syntax error when running generated app I have an app which is running ok when started from Python. I would like to use pyapp for packaging it on MAC OS 10.6.8.
The app is a small embedded webapp running with bottle microframework. It has been packages successfully on windows with py2exe.
I have the following py2app script
The setup.py py2app seems to be ok. I've a generated app file and I can see that it contains the right code.
Hello,
I have an app which is running ok when started from Python. I would like to use pyapp for packaging it on MAC OS 10.6.8.
The app is a small embedded webapp running with bottle microframework. It has been packages successfully on windows with py2exe.
I have the following py2app script
The setup.py py2app seems to be ok. I've a generated app file and I can see that it contains the right code.
from setuptools import setup
import sys, os, os.path
wapp_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

sys.path.append(wapp_path)

DATA_FILES = []

setup(
    app = [
        'nsav_ws.py',
    ],
    options={
        "py2app":{
            'argv_emulation': True,
            "includes":["shelve", "dbhash", "sqlite3", "waitress", "runpy_imports", "bottle_sqlalchemy"],
            "packages": ["sqlalchemy.dialects.sqlite", "sqlalchemy", "nsav_wapp"],
        }
    },
   setup_requires=['py2app']
)

Unfortunately, the app fails on startup. Here is the traceback:
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]  argvemulator warning: fetching events failed
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]  Traceback (most recent call last):
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]    File "/Users/luc/Dev/nelly_signe_avec_vous/nsav/nsav_mac/dist/nsav_ws.app/Contents/Resources/__boot__.py", line 340, in <module>
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]      _run()
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]    File "/Users/luc/Dev/nelly_signe_avec_vous/nsav/nsav_mac/dist/nsav_ws.app/Contents/Resources/__boot__.py", line 311, in _run
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]      exec(compile(source, path, 'exec'), globals(), globals())
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]    File "/Users/luc/Dev/nelly_signe_avec_vous/nsav/nsav_mac/dist/nsav_ws.app/Contents/Resources/nsav_ws.py", line 2
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]      ^
25/10/12 16:55:53   [0x0-0x118118].org.pythonmac.unspecified.nsav_ws[5126]  SyntaxError: invalid syntax
25/10/12 16:55:53   nsav_ws[5126]   nsav_ws Error

I've entered an issue on py2app project page but I would appreciate if some of you have any ideas that may help to fix it.
here is the start of the program:
# -*- coding: utf-8 -*-

"""
    3 text
    lines
"""

from dewapp.utils import is_exe
import sys, os, os.path, shutil

A: The problem was caused by windows line ending in the python code. Turning it into unix line ending fixed the issue. See https://bitbucket.org/ronaldoussoren/py2app/issue/70/generated-app-fails-due-to-syntax-error


text:
Q: Rails: is it possible to share session between two apps with two different databases? I have Rails app 1, I want rails app 2 to authenticate through Rails app 1, I wonder if that is possible ?
I'm using devise on both:
The reason behind this is that I have the main network app, which is app 1, and then the nodes of the network which are the other apps, I want all the nodes to be able to authenticate through the main app.
I'm already establishing authentication on each app using 1 main User-table from the main app, but now I just need to figure out how to share the session.

I have looked at the following questions, but they are doing it inside the same database, not across apps:
Rails sessions current practices
Sharing session across rails apps on different subdomains
I want to do exactly what this fellow exactly wants to do:

Rails authentication strategy for noob

Navigate to rails app -->
redirect unauthenticated users to SSO server -->
login and authenticate via remote SSO server -->
callback/redirect to rails app -->
capture user info passed back from SSO server and load protected resources in rails app

UPDATE:
I think I can use this Rest-Client to authenticate through rails app 1 on rails app 2. No ? Yea ?

A: Maybe one of this articles will help you:
http://stderr.timfischbach.de/2013/09/14/rails-4-and-sinatra-session-sharing.html
http://robots.thoughtbot.com/how-to-share-a-session-between-sinatra-and-rails
They describe the session sharing between rack based apps (sinatra and rails) but it will also works with two rails apps.
The basic Authentication middleware is the Warden::Manager and you should only have one config.ru for both applications.
Additional hint:
Maybe you could use some other session store than a Database, like memcached, redis, couchbase or anything.


text:
Q: How can I make a variable borrow for 'static? In vulkano, to create a CPUAccessibleBuffer you need give it some data and the CPUAccessibleBuffer::from_data function requires the data to have the 'static lifetime.
I have some data in &[u8] array (created at runtime) that I would like to pass to that function.
However, it errors with this message
argument requires that `data` is borrowed for `'static`

So how can I make the lifetime of the data 'static ?

A: You should use CpuAccessibleBuffer::from_iter instead, it does the same thing but does not require the collection to be Copy or 'static:
let data: &[u8] = todo!();

let _ = CpuAccessibleBuffer::from_iter(
    device,
    usage,
    host_cached,
    data.iter().copied(), // <--- pass like so
);

Or if you actually have a Vec<u8>, you can pass it directly:
let data: Vec<u8> = todo!();

let _ = CpuAccessibleBuffer::from_iter(
    device,
    usage,
    host_cached,
    data, // <--- pass like so
);

A: If you really must create the data at runtime, and you really need to last for 'static, then you can use one of the memory leaking methods such as Box::leak or Vec::leak to deliberately leak a heap allocation and ensure it is never freed.
While leaking memory is normally something one avoids, in this case it's actually a sensible thing to do. If the data must live forever then leaking it is actually the correct thing to do, semantically speaking. You don't want the memory to be freed, not ever, which is exactly what happens when memory is leaked.
Example:
fn require_static_data(data: &'static [u8]) {
    unimplemented!()
}

fn main() {
    let data = vec![1, 2, 3, 4];
    require_static_data(data.leak());
}

Playground
That said, really think over the reallys I led with. Make sure you understand why the code you're calling wants 'static data and ask yourself why your data isn't already 'static.

*

*Is it possible to create the data at compile time? Rust has a powerful build time macro system. It's possible, for example, to use include_bytes! to read in a file and do some processing on it before it's embedded into your executable.

*Is there another API you can use, another function call you're not seeing that doesn't require 'static?
(These questions aren't for you specifically, but for anyone who comes across this Q&A in the future.)

A: If the data is created at runtime, it can't have a static lifetime. Static means that data is present for the whole lifetime of the program, which is necessary in some contexts, especially when threading is involved. One way for data to be static is, as Paul already answered, explicitly declaring it as such, i.e.:
static constant_value: i32 = 0;

However, there's no universally applicable way to make arbitrary data static. This type of inference is made at compile-time by the borrow checker, not by the programmer.
Usually if a function requires 'static (type) arguments (as in this case) it means that anything less could potentially be unsafe, and you need to reorganize the way data flows in and out of your program to provide this type of data safely. Unfortunately, that's not something SO can provide within the scope of this question.

A: Make a constant with static lifetime:
static NUM: i32 = 18;


text:
Q: How to get DLL missing error feedback for Visual C++ command line projects? I'm building a Visual C++ executable. The Release output folder contains the EXE and the dependent DLLs. However, if I rename one of the DLLs and run the EXE, the EXE will fail load with exit code -1073741515 (0xC0000135) which means STATUS_DLL_NOT_FOUND. This is expected, however the cause for the load failure is non-transparent to the user since the EXE will just silently "crash" and not generate a helpful error message such as The DLL xyz.dll was missing. Some end users might genuinely miss a DLL or a Visual C++ Redistributable installation which makes debugging the problem hard.
Is there any way to tell the Windows application loader to provide an error message pop-up with diagnostics as to why the EXE failed to run properly? I have full control over the Visual Studio project settings and the source code. My project is configured as a command line application though if that could be the cause for no graphical loading failure feedback.
Here is a related question for a similar issue when running an EXE from Java.


text:
Q: Is the paint on Captain America's shield also invulnerable? I always thought that the patriotic paint on Captain America's shield is normal human paint. But, when I see it unaffected after battles, I lose this faith.
Is the paint of Captain America's shield also of alien origin? If not, how did it remain intact after Thor hit it with his hammer in Avengers movie (there are countless examples)? I don't think the shield has some kind of protective aura.

A: Vibranium is technically not of alien origin. There are places on Earth where Vibranium can be found such as Wakanda.
As for the paint on the shield, its mentioned to be made of Titanium Dioxide, giving it a corrosion and erosion resistance. Perhaps the paint is preserved due to the "amazing" qualities of the Vibranium alloy to absorb impact strength?
Titanium Dioxide: http://www.azom.com/article.aspx?ArticleID=1336

A: No, the paint on Captain America's shield is merely a human-derived durable color paint that must be reapplied between missions. The shield is invulnerable, the paint is not.
With that said, Marvel does not make any efforts in the comics to explain why the shield can take incredible attacks of heat, cold, radiation and not lose its coloration during a battle.
Even in a battle with Thanos, the shield never lost its color. As readers, we are to suspend our belief in the paint on the shield and accept it will always be painted or repainted as soon as possible.

Note, even with the energy attack that ultimately destroys the shield, all the splinters STILL HAVE COLOR.

A: No, but it is sturdy stuff
From the wikia:

It was painted in its familiar red-white-and-blue pattern using titanium oxide paint (though it has been repainted since then).

Titanium isn't exactly vibranium, but it can take a beating.  General wear on the paint is probably fixed behind-scenes/between issues.  We see in its "cracked" version that the paint is definitely chipped:

In the Marvel Cinematic Universe, they seem more willing to chip the paint away:


text:
Q: Does New Relic real time monitoring assume a single user logged in to a web application? I wanted to know if I get different results in New Relic real time user monitoring when many users are logged into the application concurrentky? Or the only way to achieve that is to use a load testing tool?

A: You will likely see different results when more people are using your site at once.
The JavaScript injected for Real User Monitoring (RUM) collects timing information in the browser that contains details to identify the specific app and the web transaction processed on the backend, as well as how time was spent in the app for each request. When a page completes loading in an end user's browser, RUM sends the information back to New Relic asynchronously, so it doesn't affect page load time. RUM uses the IP address to resolve the geographic location of each request.
For more information on this see, how real user monitoring works, on the New Relic knowledge base.


text:
Q: How to get an Entity Framework class inherit a base class I have several classes that inherit from an abstract base class that holds some common utility code. I want to move to EF for data access but I'd still like the objects to inherit the common code in the base class. The EF classes already inherit from EntityObject so I can't have them inherit my base class. What's the right way to handle this?
My environment is Net 3.5/C#

A: Sorry if you saw my earlier post -- I missed something important in your question.
You can use partial classes.  Make your partial class have an internal field with an instance of the base class you want and implement all the methods and properties (unless they are already implemented in the entity).  If you are trying, then, to allow use of your entity class, you can use a public static implicit operator in your base class (or in the partial entity class) to allow the conversion without hassle.
If you have an abstract base class called MyBaseClass, you can do something like:
public partial class MyEntityClass
{
    private MyBaseClass _baseClass;

    private MyBaseClass BaseClass
    {
        get
        {
            if (_baseClass == null)
            {
                _baseClass = new MyBaseClass();
            }
            return _baseClass;
        }
    }

    public string BaseClassString
    {
        get
        {
            return BaseClass.BaseClassString;
        }
        set
        {
            BaseClass.BaseClassString = value;
        }
    }

    // etc.

    public static implicit operator MyBaseClass(MyEntityClass e)
    {
        return new MyBaseClass() {
            Property1 = e.Property1,
            Property2 = e.Property2 // etc.
        };
    }

    public static implicit operator MyEntityClass(MyBaseClass b)
    {
        return new MyEntityClass() {
            Property1 = b.Property1,
            Property2 = b.Property2 // etc.
        };
    }
}

A: If you're still using Visual Studio 2008, I'm not sure you're going to be able to accomplish this (although someone please feel free to correct me).
But if you're using VS2010 then you  can use the new T4 templating options (even while targeting .net 3.5).  What I would do is make your base class inherit from the EntityObject class, and then modify the t4 templates used to generate the classes to inherit from your base class.
If you're still in VS2008, you can probably still do the same thing, you'll just have to modify the generated CS files by hand (every time you change your model), which granted is going to be horrible.


text:
Q: Restrict types a generic subclass method can accept in c# I apologise if the title is ambiguous or if this is a duplicate. I've spent today reading a ton on generics and looking for a similar situation to no avail.
I'm writing a little game engine. One aspect of this is the ability for a 'unit' to carry resources. Some units can carry any resource, some are restricted to carrying certain specialised resources. To this end I have the following structure:
The Resource base class:
public abstract class Resource
{
    private int _count;

    public int Count
    {
        get { return _count; }
        set { _count = value; }
    }

    public Resource(int resourceCount)
    {
        _count = resourceCount;
    }
}

then a Resource specialisation Wood:
public class Wood : Resource
{
    public Wood(int resourceCount) : base(resourceCount)
    {
    }
}

I then have my generic ResourceStore:
public class ResourceStore<T> : IResourceStore where T : Resource
{
    private List<Resource> _store;

    public IEnumerable<Resource> Store { get { return _store; } }

    public void AddResource(Resource resource)
    {
        _store = new List<Resource>();
        _store.Add(resource);
    }
}

and finally a specialised store WoodStore where the AddResource method should only accept Wood:
public class WoodStore : ResourceStore<Wood>
{

}

For completeness the interface IResourceStore which is implemented by anything that can act as a Resource Store:
public interface IResourceStore
{
    void AddResource(Resource resource);
}

If I run a little console application and do the following I would have expected an error when trying to add Wheat to a WoodStore. But it doesn't and in fact the output shows that the WoodStore now contains Wood and Wheat. This is the console app:
class Program
{
    static void Main(string[] args)
    {
        WoodStore store = new WoodStore();
        store.AddResource(new Wood(10));
        store.AddResource(new Wheat(5));

        foreach (Resource resource in store.Store)
        {
            Console.WriteLine("{0} {1}", resource.GetType(), resource.Count);
        }

        Console.ReadLine();
    }
}

Finally here is Wheat just for completeness although there is nothing special about it:
public class Wheat : Resource
{
    public Wheat(int resourceCount) : base(resourceCount)
    {
    }
}

I'm obviously barking up the wrong tree on this one, and would appreciate any help as to how I would go about restricting WoodStore to only accept Wood. Ultimately there will be a lot of different stores that would have certain restrictions and I'm looking for a way to handle this generically.
Many thanks.

A: Your interface needs to be generic and you need to use T in the backing store, also the new List in AddResource is not what you want I bet:
public interface IResourceStore<T> where T : Resource
{
    void AddResource(T resource);
}

public class ResourceStore<T> : IResourceStore<T> where T : Resource
{
    private List<T> _store = new List<T>();

    public IEnumerable<T> Store { get { return _store; } }

    public void AddResource(T resource)
    {
        //_store = new List<T>(); //Do you really want to create a new list every time you call AddResource?
        _store.Add(resource);
    }
}

A: First of all, as you said in the beginning, the title is not so clear related to the question content.
The first, simple and basic answer to ha have multiple stores each with restrictions is to use the generic filter even in the methods which permit to operate on resources:
public class ResourceStore<T> : IResourceStore where T : Resource
{
         private List<T> _store;

    public IEnumerable<T> Store { get { return _store; } }

    public void AddResource(T resource)
    {
        _store = new List<T>();
        _store.Add(resource);
    }

    void IResourceStore.AddResource(Resource resource)
    {
        //possible excepion here for type mismach!
        AddResource(resource as T);
    }
}

if you note there's another method without explicit visibility application,
the method is the explicit IResourceStore interface implementation, this is needed,
but I can suggest is not a good design solution.
First of all if the concept of abstract store is generic, even the interface should be generic if not explicitly needed by your needs, so the interface should be as the same generic of the abstract class with generic restrictions:
public interface IResourceStore<T>
   where T : Resource
{
   void AddResource(T resource);
}

in the same way the enumerable support should be included in the interface so the abstract
class will support it. So the final code should be similar to this:
public class ResourceStore<T> : IResourceStore<T> where T : Resource
{
    private List<T> _store;

    public IEnumerable<T> Store { get { return _store; } }

    public void AddResource(T resource)
    {
        _store = new List<T> {resource};
    }

    public IEnumerator<T> GetEnumerator()
    {
        return Store.GetEnumerator();
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
        return GetEnumerator();
    }
}

public interface IResourceStore<T> : IEnumerable<T>
   where T : Resource
{
        void AddResource(T resource);
}

public abstract class Resource
{
    public int Count { get; set; }

    protected Resource(int resourceCount)
    {
        Count = resourceCount;
    }
}

Hope this helps.
I also applied some little code optimization.


text:
Q: Unable to connect web browser after installation apex 5.1 I installed Oracle Apex 5.1 in Oracle Database 11.2.0.1.0 with Operating System Oracle Linux 6.7. All Steps completed successfully
SELECT comp_name, version, status FROM dba_registry WHERE comp_id='APEX';

Oracle Application Express       5.1.0.00.45            VALID

select username,created from all_users where USERNAME like '%APEX%';

APEX_LISTENER                  04-SEP-19
APEX_PUBLIC_USER               04-SEP-19
APEX_050100                    04-SEP-19
APEX_INSTANCE_ADMIN_USER       04-SEP-19
APEX_REST_PUBLIC_USER          04-SEP-19

select dbms_xdb.gethttpport from dual;

GETHTTPPORT
-----------
   8181

When I try access on web browser then unable to connect
http://ipaddress:8181/apex/apex_admin

How to solve this problem?
Thanks


text:
Q: Help in a demonstration of a theorem in Hoffman and Kunze's linear algebra book (theorem 13 section 1.6) I'm trying to understand the final line of this demonstration of the theorem 13 (page 23) in Hoffman and Kunze's linear algebra book:

Using the previous theorem (theorem 12), I think we're done when the author proves that $R=I$. I didn't understand why the fact the system $AX=P^{-1}E$ has a solution has to do with $A$ being invertible.

A: You are trying to show that $R=I$. To show this, it suffices to show that the last row of $R$ is not identically $0$. As is mentioned in the part I guess you understand, to show that $R$ is not identically $0$, it suffices to show that $RX=E$ can be solved for $X$. Since $R=PA$, where $P$ is invertible, it follows that
$$
RX=E\iff (PA)X=E\iff P^{-1}(PA)X=P^{-1}E\iff AX=P^{-1}E.
$$
Now, by (iii), $AX=P^{-1}E$ has a solution in $X$, and, by the above, this same $X$ solves $RX=E$. This is precisely what was needed to show that $R=I$. Since $R=I$, it follows, by theorem 12, that $A$ is invertible.


text:
Q: run all test classes in xcode ui test i am completely new to xcode ui application test. i have the source of the ios app. But i have to test the app using xcode ui test. currently i am adding new test classes to my ui test by creating new file and adding test cases by recording.
I can run my test class individually. But i want to execute all my test classes at a time. How i can do this.
I am completely new in this domain. Any kind of help will be appreciated.
U can also give me a ui test project link or any link which can help me. I have gone through the apple.developers website.

A: Not sure that I understand, but what happens when you press cmd-U?
Make sure that the UI tests are enabled for the scheme.

A: To run all of your tests, you can use the following command in Terminal:
$ xcodebuild test

Alternatively, you can use Scan for a simpler interface.
To automate the running of your tests, you can create a shell script to run this command. If you want the shell script to run automatically, use Jenkins or similar continuous integration software to run the shell script at specified intervals.
You can set a job up to run your tests using xcodebuild or scan, and send an email when the job completes, or just when it fails. There's an excellent blog post on how to install Jenkins on OS X here: https://nickcharlton.net/posts/installing-jenkins-osx-yosemite.html and I've written a blog post with notes about some things that might catch you out with the configuration: http://qualitytesting.tumblr.com/post/142473883709/building-with-jenkins-and-xcode. The email feature is available by default so you just need to configure the email addresses you want to receive the notification when you configure your job.
To run all the tests inside Xcode, you can use cmd+U or go to the Test Navigator on the left-hand side and click the play button that appears when you hover over your test suite.

A: Fastlane is a great tool, but in case you would like to run all tests without installing Fastlane, here are some ways:
Testing with scheme:
xcodebuild test -scheme YourSchemeName  -destination 'platform=iOS Simulator,OS=15.2,name=iPhone 13'

Testing with scheme and Test Plan:
xcodebuild test -scheme YourSchemeName  -destination 'platform=iOS Simulator,OS=15.2,name=iPhone 13' -testPlan YourPlanName

Easiest Way: Running your tests from xcode directly, in the xcode menu:
Product -> Test (⌘ + U)


text:
Q: Trying to prevent arrow key input for kendoComboBox I have a kendoComboBox set up and I am trying to prevent the arrow keys from sending input.
In my example below if I remove the check for keyCode 38 and 40 which are the up and down arrows it will block all alpha numerical input but I but the arrow keys will still change the selection of the kendoComboBox.
Any suggestions or ideas?
JS Bin
$(document).ready(function() {

$("#products").kendoComboBox({
    placeholder: "Select product",
    dataTextField: "ProductName",
    dataValueField: "ProductID",
    filter: "contains",
    autoBind: false,
    minLength: 1,
    dataSource: {
        type: "odata",
        serverFiltering: true,
        transport: {
            read: {
                url: "http://demos.kendoui.com/service/Northwind.svc/Products"
            }
        }
    }
});

// Stop up/down arrow input
$('#products').closest('.k-widget').keydown(function(e){

    console.log(e.keyCode);

    // Up/down arrow
    if(e.keyCode == 38 || e.keyCode == 40)
        e.preventDefault();
});

});

A: What you tried won't work because it doesn't affect the event handler registered by the combobox. You can simply replace that handler with one that doesn't navigate using the arrow keys (although, as a user, I feel compelled to ask why you're doing this):
kendo.ui.ComboBox.fn._keydown = function(e) {
    var that = this,
        key = e.keyCode;

    that._last = key;

    clearTimeout(that._typing);

    if (key !== kendo.keys.TAB &&
        key !== kendo.keys.DOWN &&
        key !== kendo.keys.UP) {
        that._search();
    }
};

(add this code somewhere before you first create your combobox)
Demo here

A: You can capture the keydown event of all ComboBox controls using the following code:
kendo.ui.ComboBox.fn._keydown = function(e) {
    if (e.which == 13) {
        alert("key pressed!");
    }
};

This also works with the Kendo DropDownList - a widget that generally doesn't support the keypress events.

A: You have probably already solved your problem, however, I was having the same issue with preventing the value change on Kendo NumericTextBox.  I found an article that may help you: http://www.telerik.com/forums/is-there-an-easy-way-to-disable-the-spinners
What ended up working for me was to unbind the keydown event on that input.
It is important to note that you need to unbind the keydown event for the arrows AFTER the widget has been initialized...
My code was pretty simple after:
...InitializeWidgets();
   InitlializeEvents();

   $(numberQuestions).unbind("keydown");

All you need to do is choose the selector, and unbind that keydown event and it should work for you!


text:
Q: I want to make an autorole on discord.js So i want my discord.js bot to automaticly add a role to a newly joined user but i cant get it to work,
heres some code
//autorole
client.on('guildMemberAdd', member => {
    console.log('User @' + member.user.tag + ' has joined the server!');
    var role = member.guild.roles.cache.find('name', 'Newbie')
    member.addRole(role);
});

A: In Discord JS v12 you need to use GuildMember.roles.add(Role / Snowflake).
client.on('guildMemberAdd', member => {
    console.log('User @' + member.user.tag + ' has joined the server!');
    var role = member.guild.roles.cache.find(role => role.name == "Newbie")
    member.roles.add(role);
});


text:
Q: Volley Multiple Request :How to call more than 1 request in one Activity Questions Description:

*

*I Have four methode to get all the data of related things from server:

BankList();
 BranchList();
 StateDetails();
 DistrictDetails();

*In that I am fetching data From Server related with Bank Details one by one using Volley .and Storing into SQLite.

Quetions:

*

*Please Check below Code

*What is Correct way to call volley String Request one by one.

*How to call volley String request one by One on Priority or automatically.

*Code is Working Fine and its storing value into SQLite Also.

*But Loader Progress Dialog not working Properly . its freezing the app its  not working properly .it gives me output but application freeze for few second if network speed is slow like 3G then it took more time and then my application will freeze for more time . so please help me how to avoid that

*My Question is My way is correct or wrong. how to call methods one after another . on priority basis or automatically one by one
Please Check below Code
public class LoginPage extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login_page);

        BankList();
        BranchList();
        StateDetails();
        DistrictDetails();

   }

    public void BankList() {

        final ProgressDialog pDialog = new ProgressDialog(this);
        pDialog.setMessage("Fetching Data");
        pDialog.setCancelable(false);
        pDialog.show();

        StringRequest stringRequest = new StringRequest(Request.Method.POST,
                BankURL,
                new Response.Listener<String>() {

                    @Override
                    public void onResponse(String response) {
                        pDialog.hide();
                        result = response;
                        Log.e("Responce is ", result);

                        File dbtest = new File(Utils.DB_PATH + Utils.DB_NAME);

                        if (dbtest.exists()) {

                            Log.e("db create", "Databse is Created");

                            String myPath = DB_PATH + DB_NAME;
                            SQLiteDatabase db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);
                            db.delete("BankList", null, null);

                            try {

                                JSONArray jsonArray = new JSONArray(response);

                                for (int i = 0; i <= jsonArray.length(); i++) {

                                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                                    int BankID = jsonObject.getInt("BankID");
                                    String BankName = jsonObject.getString("BankName");
                                    Log.e("Bank ID", String.valueOf(BankID));
                                    Log.e("Bank Name", BankName);

                                    ContentValues cv = new ContentValues();
                                    cv.put("BankID", BankID);
                                    cv.put("BankName", BankName);
                                    db.insert("BankList", null, cv);

                                }
                            } catch (Exception e) {

                            }
                        } else {
                            Log.e("db Not created ", "Just Inserted Value");

                            SQLDatabase so = new SQLDatabase(getApplicationContext(), DB_NAME, null, 1);

                            try {
                                JSONArray jsonArray = new JSONArray(response);

                                for (int i = 0; i <= jsonArray.length(); i++) {

                                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                                    int BankID = jsonObject.getInt("BankID");
                                    String BankName = jsonObject.getString("BankName");
                                    Log.e("Bank ID", String.valueOf(BankID));
                                    Log.e("Bank Name", BankName);
                                    so.BankList(BankID, BankName);

                                }
                            } catch (Exception e) {

                            }

                        }

                    }
                }

                , new Response.ErrorListener()

        {

            @Override
            public void onErrorResponse(VolleyError error) {
                VolleyLog.d(TAG, "Error: " + error.getMessage());
                pDialog.hide();

            }
        }

        )

        {

            @Override
            protected Map<String, String> getParams() {
                Map<String, String> params = new HashMap<String, String>();
                params.put("getdata", "BankList");

                return params;
            }

        };

// Adding request to request queue
        VolleyAppController.getInstance().

                addToRequestQueue(stringRequest);

    }

    public void StateDetails() {

        final ProgressDialog pDialog = new ProgressDialog(this);
        pDialog.setMessage("Fetching Data");
        pDialog.setCancelable(false);
        pDialog.show();

        StringRequest stringRequest = new StringRequest(Request.Method.POST,
                BankURL,
                new Response.Listener<String>() {

                    @Override
                    public void onResponse(String response) {
                        pDialog.hide();
                        result = response;
                        Log.e("Responce is ", result);

                        File dbtest = new File(Utils.DB_PATH + Utils.DB_NAME);

                        if (dbtest.exists()) {

                            Log.e("db create", "Databse is Created");

                            String myPath = DB_PATH + DB_NAME;
                            SQLiteDatabase db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);
                            db.delete("StateList", null, null);

                            try {

                                JSONArray jsonArray = new JSONArray(response);

                                for (int i = 0; i <= jsonArray.length(); i++) {

                                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                                    int StateID = jsonObject.getInt("StateID");
                                    String StateName = jsonObject.getString("StateName");
                                    int Bank_id = jsonObject.getInt("Bank_id");

                                    ContentValues cv = new ContentValues();
                                    cv.put("StateID", StateID);
                                    cv.put("StateName", StateName);
                                    cv.put("Bank_id", Bank_id);

                                    db.insert("StateList", null, cv);

                                }
                            } catch (Exception e) {

                            }
                        } else {
                            Log.e("db Not created ", "Just Inserted Value");

                            SQLDatabase so = new SQLDatabase(getApplicationContext(), DB_NAME, null, 1);

                            try {
                                JSONArray jsonArray = new JSONArray(response);

                                for (int i = 0; i <= jsonArray.length(); i++) {

                                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                                    int stateId = jsonObject.getInt("StateID");
                                    String stateName = jsonObject.getString("StateName");
                                    int bankID = jsonObject.getInt("Bank_id");

                                    so.StateList(stateId, stateName, bankID);

                                }
                            } catch (Exception e) {

                            }

                        }

                    }
                }

                , new Response.ErrorListener()

        {

            @Override
            public void onErrorResponse(VolleyError error) {
                VolleyLog.d(TAG, "Error: " + error.getMessage());
                pDialog.hide();

            }
        }

        )

        {

            @Override
            protected Map<String, String> getParams() {
                Map<String, String> params = new HashMap<String, String>();
                params.put("getdata", "StateList");

                return params;
            }

        };

// Adding request to request queue
        VolleyAppController.getInstance().

                addToRequestQueue(stringRequest);

    }

    public void DistrictDetails() {

        final ProgressDialog pDialog = new ProgressDialog(this);
        pDialog.setMessage("Fetching Data");
        pDialog.setCancelable(false);
        pDialog.show();

        StringRequest stringRequest = new StringRequest(Request.Method.POST,
                BankURL,
                new Response.Listener<String>() {

                    @Override
                    public void onResponse(String response) {
                        pDialog.hide();
                        result = response;
                        Log.e("Responce is ", result);

                        File dbtest = new File(Utils.DB_PATH + Utils.DB_NAME);

                        if (dbtest.exists()) {

                            Log.e("db create", "Databse is Created");

                            String myPath = DB_PATH + DB_NAME;
                            SQLiteDatabase db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);
                            db.delete("DistrictList", null, null);

                            try {

                                JSONArray jsonArray = new JSONArray(response);

                                for (int i = 0; i <= jsonArray.length(); i++) {

                                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                                    int DistrictId = jsonObject.getInt("DistrictId");
                                    String DistrictName = jsonObject.getString("DistrictName");
                                    int StateID = jsonObject.getInt("StateID");

                                    ContentValues cv = new ContentValues();
                                    cv.put("DistrictId", DistrictId);
                                    cv.put("DistrictName", DistrictName);
                                    cv.put("StateID", StateID);

                                    db.insert("DistrictList", null, cv);

                                }
                            } catch (Exception e) {

                            }
                        } else {
                            Log.e("db Not created ", "Just Inserted Value");

                            SQLDatabase so = new SQLDatabase(getApplicationContext(), DB_NAME, null, 1);

                            try {
                                JSONArray jsonArray = new JSONArray(response);

                                for (int i = 0; i <= jsonArray.length(); i++) {

                                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                                    int DistrictId = jsonObject.getInt("DistrictId");
                                    String DistrictName = jsonObject.getString("DistrictName");
                                    int StateID = jsonObject.getInt("StateID");

                                    so.DistrictList(DistrictId, DistrictName, StateID);

                                }
                            } catch (Exception e) {

                            }

                        }

                    }
                }

                , new Response.ErrorListener()

        {

            @Override
            public void onErrorResponse(VolleyError error) {
                VolleyLog.d(TAG, "Error: " + error.getMessage());
                pDialog.hide();

            }
        }

        )

        {

            @Override
            protected Map<String, String> getParams() {
                Map<String, String> params = new HashMap<String, String>();
                params.put("getdata", "DistrictList");

                return params;
            }

        };

// Adding request to request queue
        VolleyAppController.getInstance().

                addToRequestQueue(stringRequest);

    }

    public void BranchList() {

        final ProgressDialog pDialog = new ProgressDialog(this);
        pDialog.setMessage("Fetching Data");
        pDialog.setCancelable(false);
        pDialog.show();

        StringRequest stringRequest = new StringRequest(Request.Method.POST,
                BankURL,
                new Response.Listener<String>() {

                    @Override
                    public void onResponse(String response) {
                        pDialog.hide();
                        result = response;
                        Log.e("Responce is ", result);

                        File dbtest = new File(Utils.DB_PATH + Utils.DB_NAME);

                        if (dbtest.exists()) {

                            Log.e("db create", "Databse is Created");

                            String myPath = DB_PATH + DB_NAME;
                            SQLiteDatabase db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);
                            db.delete("BranchList", null, null);

                            try {

                                JSONArray jsonArray = new JSONArray(response);

                                for (int i = 0; i <= jsonArray.length(); i++) {

                                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                                    int BranchID = jsonObject.getInt("BranchID");
                                    String BranchName = jsonObject.getString("BranchName");
                                    String IFSC_code = jsonObject.getString("IFSC_code");
                                    int District_id = jsonObject.getInt("District_id");

                                    ContentValues cv = new ContentValues();
                                    cv.put("BranchID", BranchID);
                                    cv.put("BranchName", BranchName);
                                    cv.put("IFSC_code", IFSC_code);
                                    cv.put("District_id", District_id);

                                    db.insert("BranchList", null, cv);

                                }
                            } catch (Exception e) {

                            }
                        } else {
                            Log.e("db Not created ", "Just Inserted Value");

                            SQLDatabase so = new SQLDatabase(getApplicationContext(), DB_NAME, null, 1);

                            try {
                                JSONArray jsonArray = new JSONArray(response);

                                for (int i = 0; i <= jsonArray.length(); i++) {

                                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                                    int BranchID = jsonObject.getInt("BranchID");
                                    String BranchName = jsonObject.getString("BranchName");
                                    String IFSC_code = jsonObject.getString("IFSC_code");
                                    int District_id = jsonObject.getInt("District_id");

                                    so.BranchList(BranchID, BranchName, IFSC_code, District_id);

                                }
                            } catch (Exception e) {

                            }

                        }

                    }
                }

                , new Response.ErrorListener()

        {

            @Override
            public void onErrorResponse(VolleyError error) {
                VolleyLog.d(TAG, "Error: " + error.getMessage());
                pDialog.hide();

            }
        }

        )

        {

            @Override
            protected Map<String, String> getParams() {
                Map<String, String> params = new HashMap<String, String>();
                params.put("getdata", "BranchList");

                return params;
            }

        };

// Adding request to request queue
        VolleyAppController.getInstance().addToRequestQueue(stringRequest);

    }

}

A: There is problem with your code. The volley onResponse() and onErrorResponse() methods are always invoked in the main UI thread. In your code you place the SQLite database write operation inside the volley onResponse() method. The database write operation may be a long running process depending on the size of the data.
In your code the main UI thread sleep and wait for the database write operation to finish, and this is why your application user interface freeze. Place the database write operation on a separate background thread will solve your problem.
Use AsyncTask for the write operation.