back soft

مطالب مرتبط با «adding» در back soft | نویسنده: استخدام کار

Why isn't act-as-taggable-on adding tags to posts?

Vote count: 0 Just set everything in acts-as-taggable-on but now it's not adding tags to posts. Here's the post model acts_as_taggable_on :tags in th user model acts_as_tagger in the posts controller def permit_post params.require(:post).permit(:image, :title, :long, :anonymous, :facenumber, :hidden, :granted, :tag_list => []); end . puts @tags #=>ActsAsTaggableOn::Tag Load (0.3ms) SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND "taggings"."context" = ? [["taggable_id", 26], ["taggable_type", "Post"], ["context", "tags"]] (0.3ms) SELECT COUNT(*) FROM "tags" INNER JOIN "taggings" O...

ادامه مطلب

Adding zig-zag to y-axis between zero and first tick to a ggplot

Vote count: 0 I want to add a zig-zag to the bottom of an y-axis to a ggplot2 plot. This should be doable by retrieving the axis grob and adding points to the horizontal line. Here's a toy example: library(ggplot2) data(airquality) data...

ادامه مطلب

After adding a SSD drive to my laptop, access to the original hard drive lags on Windows 10 OS

Vote count: 0 I recently added a Samsung SM951 nvme SSD drive to my laptop, and runs a Windows 10 OS on the new SSD drive, while keeping many other files on the original hard disk. My problem is that when I want to access the folds on the hard disk, there is an unusual waiting time before the fold is open, which happens from time to time. Is there a way to solve this problem through Windows settings or some software? asked 34 secs agoK. Chan Let's block ads! بخوانید...

ادامه مطلب

Adding custom HTTP header to SignalR Hub

Vote count: 0 Is it possible to add a custom HTTP header to SignalR Hub from JS client when the coection starts? My SignalR hub is shared both by my mobile and web client. I can pass a header from the mobile client but I'm not sure if this is possible to do this from the web client. This is what I'm trying to do var name = Context.Request.Headers["useame"]; how do I differentiate between the web and mobile client? asked 1 min agoAhmed Mujtaba Let's block ads! بخوانید...

ادامه مطلب

Optimize the Linq Query adding null just for filtering

Vote count: 0 Pasting the working version of code, try it on visual studio or Linqpad, Main question post code in the end void Main() { PGSSnapshotDataContract pgs = new PGSSnapshotDataContract(); ProductMovementActivityOutputData ob1 = new ProductMovementActivityOutputData(new DateTime(2016, 08, 10, 06, 57, 20), DateTime.Now, "17M00816A", "1155581", "InProgress"); ProductMovementActivityOutputData ob3 = new ProductMovementActivityOutputData(DateTime.Now, DateTime.Now, "17M00805B", "1158479", "InProgress"); ProductMovementActivityOutputData ob2 = new ProductMovementActivityOutputData(new DateTime(2016, 08, 10, 04, 40, 50), new DateTime(2016, 08, 10, 09, 57, 20), "M2", "1155581", "InProgress"...

ادامه مطلب

Yet another adding onclicklistener to listview

Vote count: 0 I am trying to add a onclicklistener and uncomment this line. Here is my modified code stolen from here @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_deviceitem_list, container, false); ToggleButton scan = (ToggleButton) view.findViewById(R.id.scan); // Set the adapter mListView = (AbsListView) view.findViewById(android.R.id.list); ((AdapterView) mListView).setAdapter(mAdapter); // Set OnItemClickListener so we can be notified on item clicks //mListView.setOnItemClickListener(this); mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void on...

ادامه مطلب

Adding Django form widgets

Vote count: 0 I'm new to django and am working with the Calendarium package, i needed to edit it most places to make it fit my need and this is the last problem i cant get round. I have never seen anything like the way this package is set up and cant figure it out i have tried many ways to try to get these widgets working but none have worked so far i tried: lass EventMixin(object): """Mixin to handle event-related functions.""" model = Event fields = '__all__' @method_decorator(permission_required('calendarium.add_event')) def dispatch(self, request, *args, **kwargs): retu super(EventMixin, self).dispatch(request, *args, **kwargs) class EventUpdateView(EventMixin, UpdateView): """View to up...

ادامه مطلب

Adding Attribute Labels to DynamicModel Yii

Vote count: 0 I have dynamic number of questions and answers. I use DynamicModel() for collecting these data. $attributes = [ "answer_1" => "Some Value 1", "answer_2" => "Some Value 2", "answer_3" => "Some Value 3", ..... ] $customFormModel = new DynamicModel($attributes); I also have $labels = [ "answer_1" => "Label 1", "answer_2" => "Label 2", "answer_3" => "Label 3", ..... ] I just can't get the $label array to be set as Label Attributes for my Dynamic Model. My $customFormModel->attributeLabels() is always empty. These results with the following issue. I get error messages like these Answer 1 can not be blank Answer 2 can not be blank Answer 3 can not be blank What I want instead Label 1...

ادامه مطلب

Java AES/CBC/PKCS5Padding stream encryption performance compared to no encryption

Vote count: 0 Am using the standard technique of using a RSA key/pair whose public key encrypts a 16 byte random key which encrypts my data using AES/CBC/PKCS5Padding. I am using bouncy castle for my needs to encrypt streams of usually large data (512MB+). On ruing performance tests to understand the overhead of encryption I am seeing that encryption is nearly 30-40% more expensive than un-encrypted data. Is this expected ? Sample code public InputStream encryptStream(InputStream streamToEncrypt, byte[] key, byte[] iv, byte[] encryptedKey // 256 bytes) { final Cipher cipher = getCipher(Cipher.ENCRYPT_MODE, key, iv); byte[] civ = cipher.getIV(); ... ByteArrayInputStream ivEncryptedKeyStream =...

ادامه مطلب

Adding view from UIViewController

Vote count: 0 I created my own freeform first view controller and placed a table view inside of it. I set its class properly and created an IBOutlet for this table. In my second view controller I want to display the view from first view controller as a slide in window, so I created and IBAction that will do this: - (IBAction)optionsButtonTapped:(id)sender { OptionsViewController *optionsVC = [[OptionsViewController alloc] init]; // Custom CGRect: CGFloat width = self.view.frame.size.width - 10.0; CGFloat height = [optionsVC.optionsTableView numberOfRowsInSection: 0] * 50.0; CGFloat x = self.view.frame.origin.x + ((self.view.frame.size.width - width) / 2); CGFloat y = self.view.frame.origin.y...

ادامه مطلب

MySQL, Adding two columns recursively after comparing them

Vote count: 0 This is my table data: ID val Coulmn1 Column2 1 1 0.4000 0 1 10 0.1250 0 1 18 0.1429 0 1 26 0.2500 0 2 13 0.0000 0 2 21 0.1429 0 2 29 0.2500 0 2 34 0.3333 0 3 6 0.3333 0 3 7 0.20 0 3 14 0.2500 0 3 22 0.1429 0 3 33 0.2500 0 4 8 0.2000 0 4 15 0.1250 0 4 23 0.1429 0 4 31 0.0000 0 I want to add to columns if column1 is greater than column2 in the same row and if the final value is max it should be applied to all the rows of the same id. I have following scenario. if (Column1 > Column1 ) then (Column1 + Column1 ) else (Column1 ) Output is Can be: ID val Coulmn1 Column2 1 1 0.4000 0.4000 1 10 0.1250 0.4000 1 18 0.1429 0.4000 1 26 0.2500 0.4000 2 13 0.0000 0.39285 2 21 0.1429 0.39285 ...

ادامه مطلب

adding a grid layout panel and a border layout panel to a frame in java

Vote count: 0 I was wondering how I could position my panels to be in the same jframe with my grid layout panel in the center and my border layout at the bottom. Like This: http://i.imgur.com/PfCgxr9.jpg?1 But it was tricky because i don't know how to position panels in a jframe. Here is my code: public GameWindow() { super("Game Window"); this.setSize(1500, 800); this.setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLayout(new BorderLayout()); label1 = new JLabel(""); label2 = new JLabel(""); label3 = new JLabel(""); label4 = new JLabel(""); label5 = new JLabel(""); int i = 15; int j = 20; JPanel[][] panel1 = new JPanel[i][j]; setLayout(new GridLayout(i,j)); for(int...

ادامه مطلب

Adding values to an array, sum or subtract depending on input

Vote count: 0 I have to create a new input text every time the user enters an integer and those integers should be add it to an array which at the end the program must sum or subtract depending on the values. For example, if the array is like this: [1, 5, 10] the final result is: 16 but if the array goes like this [2, 3, 7, -1, 5] the final result should be 7, why? it is because you sum up 2 + 3 + 7 and then subtract 5. The main problem I have right now is that there is something wrong with my code which is not doing the final calculation. A bit of code: var arrayOfNumbers = []; var column = 1; function logingValues (){ var values = $('input[name^=valuesToSum]').map(function(idx, elem) { new...

ادامه مطلب

Adding a Javascript popup link in a foreach loop laravel

Vote count: 0 I have a foreach loop and i want to add a javascript popup within it. I have to code for the loop and the popup box, im just struggling with how to write the link, please see below. '...

ادامه مطلب

Adding info from xml to string array, Android Studio

Vote count: 0 I got problems when I try to get info from XML to a string array. Is works fine if I only have one if statment withinf the: if (eventType == XmlPullParser.START_TAG) {...} The thing is tho, I want to diffrent things to my array, both "Allergen" and "Artikelbenamning". Not sure if the problem is in the doInBackground or in the onPostExecute. Any suggestions on what i've done wrong? The app dosen't crash it just never present the data. Code: protected ArrayList doInBackground(String[] params) { //holds info a 5 titles from xml rss file ArrayListtitles=new ArrayList(); try { //URL to rss feed to read //params[0]=("http://www.aftonbladet.se/rss.xml"; URL url = new URL(params[0]); /...

ادامه مطلب

How to insert columns with adding sequence column?

Vote count: 0 In an Oracle database (11gR2), I have a table my_table with columns (sequence, col1, col2, col3). I want to insert values into the table that are queried from other tables, i.e. insert into my_table select . The problem is that the primary key is the four columns, hence I need to add a sequence starting from 0 up till the count of the rows to be inserted (order is not a problem). I tried using a loop like this: DECLARE j NUMBER; r_count number; BEGIN select count(1) into r_count from ; FOR j IN 0 .. r_count LOOP INSERT INTO my_table select ; END LOOP; END; But it didn't work, actually looped r_count times trying to insert the entire rows every time, as logically it shall do. Ho...

ادامه مطلب

adding bootstrap class input-group-addon with TextBoxFor Html Helper

Vote count: 0 I am trying to add $ sign using bootstrap class 'input-group-addon' with mvc Razro TextboxFor but its not working. Below is my code. @Html.LabelFor(x => x.PaymentAmount, new { @class ="control-label col-sm-2" }) $ @Html.TextBoxFor(m => m.PaymentAmount, new { @class = "form-control col-sm-10" }) @Html.ValidationMessageFor(m => m.PaymentAmount, "", new { @class = "help-block" }) asked 1 min agomaxspan Let's block ads! بخوانید...

ادامه مطلب

Problems adding Ads. Incompatibility between android support v4 and v7?

Vote count: 0 I have an application that uses analytics and Theme.AppCompat.Dialog, so, I need Xamarin.Android.Support.v7.AppCompat The app is works. Now, I want to add google ads. The "package nuget : Xamarin.GooglePlayServices.Ads" includes Xamarin.Android.Support.v4 I did another test project and it works. But, when I add this to my real project, I can not build the app. I have this error: "java.exe" exited with code 1. In the output: 1>C:Program Files (x86)MSBuildXamarinAndroidXamarin.Android.Common.targets(2118,3): error MSB6006: "java.exe" exited with code 1. ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ========== I read everything I have seen in the forum related t...

ادامه مطلب

Adding data dynamically from SQLite to top of recyclerview

Vote count: 0 I Am trying to implement swipe to refresh in my app. When swipe to refresh is triggered first all the data is fetched from JSON and than store in database. after storing the data all the new data will be added to top of the recyclerview. I read few articles and only get the detail about adding only one item at the top of the list. But in the case of my app more than one items may be available to show then what should I do ? I am adding my codding part. Here is my code for database table : @Override public ArrayList getAllNewPost(int T) { SQLiteDatabase db = this.getReadableDatabase(); ArrayList postList = null; try { postList = new ArrayList(); String QUERY = "SELECT * FROM " +...

ادامه مطلب

CSS3 keyframes animation on click (with addClass). How to restart CSS3 animation with adding css class?

Vote count: 0 I have a problem. Im using Bounce.js to create nice menu animations (with some cool effects). Bounce.js using css keyframes animations which can be problematic to restart. I got menu and when I click a button and when .show class is added it should fire show animation. But when I press that button again hide class should be added with hide animation (which is just reverse version of previous animation). Js is working (classes are adding and removing properly) but animation is fired only once - and there is no hiding animation (menu element just disappears with out animating it self). asked 1 min agobo2fr4g 1 Answer Vote count: 0 You can do it in a serval ways. One way is to tri...

ادامه مطلب