w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Copy-item Files in Folders and subfolders in the same directory structure of source server using Powershell
This can be done just using Copy-Item. No need to use Get-Childitem. I think you are just overthinking it. Copy-Item -Path C:MyFolder -Destination \ServerMyFolder -recurse -Force I just tested it and it worked for me.

Categories : Powershell

How can I add an extra item to an existing item in a JTabbedPane?
Replace the line tabs.addTab("New Item", null, newItemPanel, "New item panel"); With JPanel selectedTab = (JPanel) tabs.getSelectedComponent(); selectedTab.add(newItemPanel); selectedTab.revalidate(); You'll still have to fix the layout and appearance of the new panel, but this will add it to the current tab.

Categories : Java

This item is unreachable because a previous item (item #1) is a more general match than this one
During each state change, the state list is traversed top to bottom and the first item that matches the current state is used—the selection is not based on the "best match," but simply the first item that meets the minimum criteria of the state. http://developer.android.com/guide/topics/resources/drawable-resource.html Your first item matches always, place it at the end instead

Categories : Android

Listbox item as Listbox should clear the selection of its item when other item's item is selected?
You can explicitly null the SelectedItem whenever the ListBox loses focus, i.e you have to handle the LostFocus event. You could add the event handler to the ListBox and handle the event in the code behind. XAML Change: <ListBox x:Name="lstMsgs" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Hidden" HorizontalContentAlignment="Stretch" ItemsSource="{Binding MessageList}" SelectedItem="{Binding DataContext.SelectedMessage,Mode=TwoWay,ElementName=me}" Background="Transparent" BorderThickness="0" LostFocus="lstMsgs_LostFocus"> Code Behind: private void lstMsgs_LostFocus(object sender, RoutedEventArgs e) { ListBox listBox = sender as ListBox; if (listBox != null) { listBox.SelectedItem = null; } }

Categories : C#

Cant put list item on the left of container
They are as far left as they can go, because each <li> is contained within a <ul>. Unordered lists contain a default padding, so you'll want to add: .sidemenu ul{ margin:0; padding:0; } to your css. Here's your example on JSfiddle: http://jsfiddle.net/5aFV8/

Categories : HTML

WPF Is there a way to get the container for an item on a selectionchanged event?
On the TreeView declaration: <TreeView Name="myTreeView" TreeViewItem.Selected="OnItemSelected" ItemsSource="{Binding Source={StaticResource myHierarchicalData}}"/> OnItemSelected handler: private void OnItemSelected(object sender, RoutedEventArgs e) { myTreeView.Tag = e.OriginalSource; } Here is the code to access TreeViewItem: if (myTreeView.SelectedItem != null) { TreeViewItem selectedTVI = myTreeView.Tag as TreeViewItem; // add your code here }

Categories : C#

Virtualized collections item container consistency
If you create a custom implementation of the virtualization, you could fix this problem. As it happens, I found a link to a book that I bought in a PDF online. This book has a great chapter on virtualisation (Chapter 8)... WPF Control Development Unleashed. Although I have implemented my own virtualisation panels using this information, I would have to say that it is rather complicated. However, if you do implement your own system, you could add another property to your view model objects: public bool IsRealized { get; set; } 'Realized' items are the items that are actually visible, as opposed to the 'virtualized' items that reside only in memory. So, with this property, you can adjust your IsSelected property to only react when the IsRealized property is true: public bool IsSelected

Categories : C#

how to write this query? (none existing item)
You can achieve this with a sub query as followed: # this is the outer select for every language not in the list returned from the inner query SELECT * FROM languages WHERE languages.id NOT IN ( # this is the inner select for every language spoken in country 3 SELECT languages.id FROM countries, countryLanguages, languages WHERE countries.id = countryLanguages.country_id AND languages.id = countryLanguages.language_id AND countries.id = 3 ); Please note that sub queries are not always the fastest way to do something and that you can usually come up with a cleaver join instead, but this should do what you are looking for.

Categories : Mysql

Uncheck a specific checkedistbox item in powershell gui
You would need to attach a function to the CheckedListBox.ItemChecked event. ## build a function to handle the ItemChecked event function Handle-ItemChecked($sender, $args) { ## do something here to change the state of the other ## checkbox. the box the user clicked is passed in ## through $args. (See [ItemCheckEventArgs][2] on MSDN) } ## listen for the event $form.checkedListBox1.add_ItemChecked({ Handle-ItemChecked }) If your handler code is not too complicated, you could probably put it inside the { } rather than declaring another function. However, I think the approach above is more readable.

Categories : Powershell

Sharepoint Powershell update every second list item
Well if you only need to update every second item, and you don't care about the items you are editing, (using your code) you can simply do this: $web = Get-SPWeb http://YourServer/ $list = $web.Lists["list name"] $i = 0 foreach ($item in $list.Items) { if($i % 2 -eq 0) { $item["column1"] = "New value"; $item["column2"] = "New value"; $item.Update(); } $i += 1 }

Categories : Sharepoint

How to copy an item from one LongListSelector to another?
When the user tap on an item in the list, in the SelectionChanged event, you'll get the selected item's object. Then, add this item to the list2 with a check that whether it is present in the list2 already or not. LongListSelectorSelectionChanged() - if(SelectedItem in LIST2) Display quantity in the textbox return - else Add the SelectedItem in the LIST2 return I hope your List2 is a ViewModel binded to the paranoma viewl so that the view will be changed as soon as an item is added to the List2.

Categories : C#

How to change item view container value according to collections in Marionette.CompositeView
You should override the appendHtml method. Something like this should work: statisticsView = Marionette.CompositeView.extend({ itemView : ResultView, template : StatisticsPanel, itemViewContainer : "...", // Make this a selector to a common parent of your div#a and div#b sub containers itemViewContainerA: null, // Cache container #a itemViewContainerB: null, // Cache container #b appendHtml: function(collectionView, itemView, index) { var container; if(itemView.model == a) { // Check if the current model goes to #a container = this.itemViewContainerA; } else if (itemView.model == b) { // Check if the current model goes to #b container = this.itemViewContainerB; } container.append(itemView.el); },

Categories : Javascript

Directory does not meet Test-Path $item -PathType Container
Which version of PowerShell are you using ? With PowerShell V3 you can try : Get-ChildItem $path -Directory Using PowerShell V2 I still use Get-ChildItem | where {$_.psIscontainer -eq $true} In your case if ($item.psIscontainer -eq $true) { "TRUE: " + $item.Name } else { "FALSE: " + $item.Name }

Categories : Powershell

Render list-item (li) from an xTemplate inside a ul container in extjs
the answer is to set the autoEl on the dataview. xtype: 'dataview', autoEl: { tag: 'ul' }, ... http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.view.View-cfg-autoEl

Categories : Extjs

ObservableList#contains() returns false for existing item
Make sure your Device class implements equals and hashCode methods correctly. E.g. if you create 2 Device objects with exactly same data they will not be considered the same by ObservableArrayList (or any List) unless Device have equals/hashCode implemented. See next example: public class ObsListTest { static class Device { int value; public Device(int value) { this.value = value; } } public static void main(String[] args) { ObservableList<Device> list = FXCollections.<Device>observableArrayList(); Device data1 = new Device(1); Device anotherData1 = new Device(1); list.add(data1); System.out.println(list.contains(data1)); // true System.out.println(list.contains(anotherData1));

Categories : Java

Powershell Function runs for each item in array (I don't want this to happen)
The switch statement fires for each element of the array. This behavior is documented (check Get-Help about_Switch): If the test value is a collection, such as an array, each item in the collection is evaluated in the order in which it appears. Use a regular conditional instead (since you have only 2 cases anyway): if ($attachArray -eq $null) { Send-MailMessage -SmtpServer "internalrelay.corp.local" ` -From "test@andylab.local" -To $toAddresses ` -Subject "There should really be something more informative here" ` -BodyAsHTML $SCRIPT:htmlBody } else { Send-MailMessage -SmtpServer "internalrelay.corp.local" ` -From "test@andylab.local" -To $toAddresses ` -Subject "There should really be something more informative here" ` -BodyAsHTML $SCRIPT:htmlBody -At

Categories : Powershell

Powershell pipeline both remove-item and call function
Does this work? Get-ChildItem . -Include bin,obj,Debug,ipch,Resources -Exclude "*.png","*.bmp","*.jpg","*.htm*","*.xml","*.fl*","*.css" -Recurse | foreach { Remove-Item $_.fullname -Force -Recurse; WriteToLog $msg -STATUS 'INFORMATION' }

Categories : Powershell

PowerShell Invoke-Sqlcmd with Array item as variable in WHERE
It is simply personal preference, but I build the string using the -format operator: $cmdStr = 'Select * FROM {0} WHERE FacilityID={1}' -f $table, $item Write-Host 'Executing: ' + $cmdStr Invoke-Sqlcmd $cmdStr

Categories : Arrays

How to use the Copy-Item cmdlet correctly?
You need to give the Copy-Item Cmdlet the full file path of the file and the destination to copy it to: Get-Childitem C:imscript -recurse -filter "*.zip" | %{ Copy-Item -Path $_.FullName -Destination F: empzip}

Categories : Powershell

Caroufredsel > Center Current Item to certain margin while carousel container width is 100%
This is the best I can. 1 - Added align center and responsive true to js $('#carousel').carouFredSel({ width: "100%", align: 'center', responsive : true, items: { visible: 3, minimum: 2, start: -1}, scroll: { items: 1, pauseOnHover: true, duration: 1000, timeoutDuration: 3000 ,onBefore: function(){ $('ul#carousel li') .animate({opacity:0.5}, 250); }, onAfter: function(){ $('ul#carousel li') .filter(':eq(1)') .animate({opacity:1}, 250); } }, auto: { play: true }, prev: { button: "#prev", key: "left" }, next: { button: "#next", key: "right" }, swipe: true }); 2 - Added on line 150 and 151 of css - Text align center and overflow hidden ul#carou

Categories : Jquery

Correct Amazon MWS flow for item with existing ASIN
The process of listing an item on Amazon is actually very similar for existing ASINs and new ones. Listing items can consist of these steps: Call SubmitFeed() to send a _POST_PRODUCT_DATA_ feed is mandatory in all cases. You can omit product details if you're adding your listing to an existing item. If you list new products, this feed must be successfully processed before sending any other feed for those same item(s), I'm not sure if the same is true for existing products. Call SubmitFeed() to send a _POST_PRODUCT_RELATIONSHIP_DATA_ feed This step can be skipped for existing products or products without variants or other parent/child relations Call SubmitFeed() to send a _POST_PRODUCT_IMAGE_DATA_ feed This step can be skipped for existing products. Amazon is currently in the p

Categories : Amazon

copy combobox selected item to the gridview
This answer shows you how to display the article content in a richtextbox control. Assign the article name or identifier to the display member property. Assign the article content to the value member property. Subscribe to the SelectedItemChanged event of the combobox. When the SelectedItem changes then set the text property of the richtextbox to the SelectedValue property of the combobox as a string. public void controlInit() { DataTable articleInfo = new DataTable(); articleInfo.Columns.Add(new DataColumn("Name")); articleInfo.Columns.Add(new DataColumn("Article")); DataRow dataRow1 = articleInfo.NewRow(); DataRow dataRow2 = articleInfo.NewRow(); dataRow1["Name"] = "Article 1"; dataRow1["Article"] = "Article 1 content"; dataRow2["Name"] = "Article 2";

Categories : C#

jQuery - Proper way to rebind existing function after new item added to DOM
There is no 'right' or 'wrong' way to do most things, though there are more efficient methods. The solution you need is delegated event handling, where the events are handled once they've propagated to the parent element, thereby getting rid of the need to rebind the handler for new child elements. Let's say all of your .droppable elements are contained in a .parent element, and new ones will be added there. Your handler would look like jQuery('.parent').on('mouseover.mine mouseout.mine', '.droppable', function (e) { if ($(this).is(".active")) { // etc... } } The jQuery Docs for on will be helpful in understanding this logic. Update As I note in my comment, the rest of your code will have to adjust for this change, since e.stopPropagation(); is by definition at odds

Categories : Jquery

Knockout cancel editable row functionality depending on new or existing item
I updated this fiddle in which I added a isNew property on MeasureItem. So with this property you can distinguish if the MeasureItem is a new one ot not. I also move the cancel function to the FoodItem class. JS: var MeasureItem = function (id, name) { this.id = ko.observable(id); this.name = ko.observable(name); this.isNew = false; }; function FoodItem(id, name, mItems) { var self = this; self.id = ko.observable(id); self.name = ko.observable(name); self.measures = ko.observableArray(mItems); self.cancel = function (item) { vm.selectedItem(null); if(this.isNew) self.measures.remove(item); }; } Edit template : <script id="measureEditTmpl" type="text/html"> <li> <input data-bind="value: food.name"

Categories : Knockout Js

SharePoint 2010 update every Socond list item using Powershell SP.Client
Okay, I've managed to solve it. We can simply add Update logic inside of C# block and then just call this function. It should looks something like this Add-Type -path C:Microsoft.SharePoint.Client.dll Add-Type -path C:Microsoft.SharePoint.Client.Runtime.dll $cSharp = @" using System; using System.Collections.Generic; using Microsoft.SharePoint.Client; using Microsoft.SharePoint; namespace SPClient { public class SharePointList { public static ListItemCollection GetList() { ClientContext clientContext = new ClientContext ("http://*****:****/*****"); List list = clientContext.Web.Lists.GetByTitle("CustomList"); CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = "<View/>"; ListItemCollection listItems = list.GetItems(camlQuery); clientContext.Lo

Categories : Powershell

Copy innerHTML from one item in a list to the content of an element
You have to pass the element to the function...so that it knows which <a> tag you clicked. So in your HTML you add this as a function parameter <a href="#" onclick="setText(this);"> And in your Javascript...(e) in this case, refers to that element now. function setText(e){ document.getElementById('selected').innerHTML = e.innerHTML; } DEMO Here it is using Jquery....just to show how much more compact it becomes... <a href="#"> . $('a').click(function(){$('#selected').html($(this).html());}); DEMO

Categories : Javascript

Maintain item maintenance for a items in a class created by developer using subclass per item
I think your problem is how to identify an "item" outside of the quote instance. And by using its array index you feel you are going to run into the problems. And you will, when you will try to delete an item. It would successfully invalidate any index already known/stored outside. The simplest patch to it is to give every item a unique ID and store them in the map instead of storing it as a vector. Also, in your solution item by itself cannot provide you with any helpful information how to access this item in your collection of items (a quote). public function createNewItem() { static $counter; $id = $counter++; return $this->item = $this->items[$id] = new item($id); } public function editItem($id) { return $this->item = $this->items[$id]; } public function removeIt

Categories : PHP

MongoDB with update queries, create and add item to list or increase item's counter
You need to do two things: Use the {upsert:1} flag on update to insert particular date document if it doesn't already exist. Use {$inc} operator to increment your item values. It turns out that if you increment a field that doesn't exist by 1 it will be created with value 1 (it's as if it existed with value 0). You may not be able to get the above accomplished with the schema you currently have. In order to increment a counter it has to be the name - i.e. "a":1, "b":17, etc. You currently have it as key:"name", counter:"value" which means you can only update them with positional operator. But positional operator requires that you match an element in order to successfully update it, so there goes the strategy to use $inc So it looks like if you want to do this in a single update st

Categories : Mongodb

Save "Title" item to ListView and click on item to load data to new activity
Well, are you required to do this way(inflate a new view into the container)? or you just simply go with ListView, just add new Item, refresh the view and it's there. You can take a look at this example: The MainActivity: public class MainActivity extends Activity { private Button add; private MyAdapter adapter; private ArrayList<String> data; private ListView lv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); add = (Button) findViewById(R.id.button1); lv = (ListView) findViewById(R.id.listView1); data = new ArrayList<String>(); adapter = new MyAdapter(data); lv.setAdapter(adapter); add.setOnClick

Categories : Android

Quick way of selecting a random item from a list - with varying probabilities based on item value?
You've already got the basic idea - sum the weights (which happen to be the same as your values here) and take a random number in that range - although I'd use 0 as the lower bound, and the sum as the exclusive upper bound. Then you just need to work through the list to find out which value that corresponds to... begin at the start of the list, and keep checking whether the random number is less than the current item's weight: if it is, that's the selected item. If it isn't, subtract the weight from the random number, and move on. That's an O(N) algorithm, admittedly. If you need to take a random number from the same list multiple times, you could build an accumulated weight list, and then do a binary search to find out which index corresponds with which random number... but I'd stick to

Categories : C#

Item Already Owned ERROR MESSAGE with Unmanaged Item on Google Play Store
Are you consuming the product that was purchased on each purchase success? http://developer.android.com/google/play/billing/api.html see section "Managing consumable purchases in your application"

Categories : Android

pyqt - combobox item enabling/disabling line_edit item based on state
create another function, and connect the combobox to it. Don't use activated though, use currentIndexChanged, as you don't need to do anything if the index isn't changed. def comboBoxIndexChanged(index): #Do something based on the index if somethingBasedOnTheIndex: self.line_edit_widget.setEnabled(true) else: self.line_edit_widget.setEnabled(false) The reason it's behaving as you have it is because the activated signal is sending the QComboBox index to the function. Which is then being cast to true or false. Python is then casting the 0 to false (enabling the QLineEdit), and every other index is being true.

Categories : Python

PHP/MYSQL, removing an item from a list from a joining query, without deleting the item from the table.?
Without seeing your db schema, very difficult to guess. But it might look something like this: DELETE FROM `order` WHERE orders.productID = 456 AND orders.orderID = 123

Categories : PHP

PHP drop-down list with main item as optgroup and child item as option
You are referencing to $rs_pa['ID'] on this line: $mysql_select_child = "SELECT * FROM $mysql_table_items WHERE `Parent` = '" . $rs_pa['ID'] . "' AND Active = 1 ORDER BY `Order` ASC"; Are you sure $rs_pa['ID'] is defined at that point? Something like this should work better: $mysql_table_items = "sys_menu_top"; $mysql_table_options = "sys_options"; // SQL QUERY $mysql_result_number = mysql_query("SELECT VALUE FROM $mysql_table_options WHERE Name LIKE 'nav_menu_elements_on_line_usr'") or die($myQuery . "<br/><br/>" . mysql_error()); $mysql_select_parent = "SELECT * FROM $mysql_table_items WHERE `Parent` = '0' AND Type LIKE 'top' AND Active = 1 ORDER BY `Order` ASC"; // SQL RESULT $mysql_result_number = mysql_fetch_array($mysql_result_number, MYSQL_ASS

Categories : PHP

How to change the colour of of a main menu item, when submenu item is hovered
I could be missing something here as I haven't actually seen your markup, (no offense but I'm not visiting your site to look for it) but you could update your CSS to something like this: nav li.active.parent > a, nav li:hover > a { background-image: url(http://horyzon.de/images/images/navbg.png); color: #FFF; }

Categories : HTML

Android ListView select item and show information about list item
For the information you can use this code for the dialog box and this can be called by showSettingsAlert(); wherever you want this dialog box to displayed. public void showSettingsAlert(){ AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); // Setting Dialog Title alertDialog.setTitle("Title here"); // Setting Dialog Message alertDialog.setMessage("here the information can be display"); alertDialog.setNegativeButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); // Showing Alert Message alertDialog.show(); } for the other thing look Contextual Action Mode. these li

Categories : Android

How to update item inside an embedded array without adding a new item in Parse
Before replace value of your array make sure you have NSMutableArray (mutable) ? Otherwise you get error: Yes i have NSMutableArray then follow my suggestion: (Here i give simple basic logic) For replace any value at specific Index of NSMutableArray, UsereplaceObjectAtIndex:withObject:. For Example [MyArrayName replaceObjectAtIndex:0 withObject:MyValues]; Apply this logic:

Categories : IOS

Editing list Item using drop down menu bootstrap when clicking on an item
Use this JavaScript code: $(function() { $('#changeEN').hide(); $('.newDropdownLanguage li').click(function(e) { e.preventDefault(); $('#current-language').text($(this).text()); $('.newDropdownLanguage li').show(); $('#changeEN').show(); // Actually it should work without this line, but I don't get why it is not working. $(this).hide(); }); }); Don't forget to add one <li> for English: <li><a id="changeEN" href="#">English</a></li>

Categories : Javascript

itemsingletap on list is not detected when 1 item is tapped followed by swiftly tapping a different item?
Check this its working for me. config : { refs : { navigationview : 'navigationview', }, control : { 'productTable dataview[id=productDataView]':{ itemsingletap : 'onProductItemTap' } } }, onProductItemTap: function (list, idx, target, record, evt) { Ext.Msg.alert('itemsingletap', record.data.Content); Ext.select('#resultID').elements[0].innerHTML = record.data.Content; },

Categories : Extjs

jquery mobile .listview() adding only last item to localstorage regardless of item clicked
You may try to add the click event to the link elements <a> before adding them to your listview (just after creating them): In your LOOP, do the following: new_markup = $('<li><a href="#fbfullpostviewpage" id="addPostToLocalStorage" data-rel="dialog" data-transition="pop" data-overlay-theme="e" data-inline="true"><img src="' + thumb_url + '">' +'<h4>' + name + '</h4><p>' +'posted this photo....</p><p>'+likes+'<img src="images/facebook-like-16.png"></p></a></li>'); // Add the click event to the link <a> : new_markup.children('a').click(function(){ localStorage.setItem("fbclickedPost", JSON.stringify(post)); console.log(post); alert("this post was added to local storage"); // showDetail

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.