[Solved] binding an List of objects to a Listbox

The Error you are getting is probably: Items collection must be empty before using ItemsSource. There is probably no problem with binding…. your bigest problem is invalid xaml. I am not sure what you are trying to achieve, but I guess you want to have listbox with horizonatal Stackpanel as ItemsPanel. Then it should be … Read more

[Solved] merging two vba functions

Function findimage(Path As String, ImageList As String) Dim results Dim x As Long Dim dc ‘double comma Dim extension As String results = Split(ImageList, “,”) If Not Right(Path, 1) = “\” Then Path = Path & “\” For x = 0 To UBound(results) If Len(Dir(Path & results(x))) > 0 Then results(x) = True Else extension … Read more

[Solved] C Style Strings Difference : C/C++ [duplicate]

“Consider All declared in main().” Then 1) Yes. 2) Yes. 3) Yes, and no (it’s stored neither on the stack nor in the heap in common implementations). “i.e. allocates 6 bytes” — you seem to have forgotten about the memory required for the pointer. Also, there’s an erroneous claim in the comments and in another … Read more

[Solved] encrypt file with SHA256 using C/C++

SHA 256 stands for Secure Hash Algorithm ! It will only produce the hash of a given file . You can’t retrieve the original file from a given hash otherwise hash functions are useless. If you want to do encryption/decryption AES would be a better solution. Everything you need is in OpenSSL. solved encrypt file … Read more

[Solved] How to calculate width and height of element in JQuery [closed]

you should use this code since you are using jQuery so that it can do its magic for browser compatibility: $(‘#submit’).click(function(){ var width = $(ddbar).width(); var height = $(ddbar).height(); alert(width); alert(height); }); Of course, jQuery approach will be slower: http://jsperf.com/jq-width-vs-client-width solved How to calculate width and height of element in JQuery [closed]

[Solved] Need Regular Expression for Format -xx-xxx-x- [closed]

<?php $url = “http://<hostname>/p/Brand-Product-Name-6118-161-1-gallery.jpg”; preg_match_all(‘#(\d+)-(\d+)-\d+-gallery\.jpg$#’,$url,$matches); // Depends on how accurate you want to be. You can go with many choices like: // preg_match_all(‘#http\://.*?/p/.*?(\d+)-(\d+)-\d+-.*\.jpg#’,$url,$matches); var_dump($matches); /* array(3) { [0]=> array(1) { [0]=> string(22) “6118-161-1-gallery.jpg” } [1]=> array(1) { [0]=> string(4) “6118” } [2]=> array(1) { [0]=> string(3) “161” } } */ 1 solved Need Regular Expression … Read more

[Solved] I can not make the array global

The usual pattern would be: public static final. That is a globally accessible and unmodifiable array reference: public class GravityV1 { public static final String[] PLANETS = { “Mercury”, “Venus”, “Earth”, “Mars”, “Jupiter”, “Saturn”, “Uranus”, “Pluto”}; public static final int[] DIAMETERS = { 4876, 12107, 12755, 6794, 142983, 120536, 51117, 49527, 2390}; public static final … Read more

[Solved] select a web form and load it [closed]

It is a rather broad question, but I’ll try to answer it. The following approach enables you to put all the forms in one .html file and just give them different ID. (Say #form1, #form2, #formN.) If a user selects one, you should just figure out the right ID and then do: $(‘#elementYouWantTheLoadedFormIn’).load(‘ajax/fileWithTheForms.html #’ + … Read more

[Solved] How to write an if(or switch) statement to check all the values of an array in one go in php [closed]

You can compare them like this: $testing = Array(true, true, true); if($testing == array(true, true, true)){ //do something }else if ($testing == array(true, true, false)){ //do something else } You don’t need to use the same variable $testing again. Just create a new array to compare it with. 1 solved How to write an if(or … Read more

[Solved] how to open an html page using html5 [closed]

On a button click? I would suggest HTML: <input type = “button” onclick = “openpage()” value = “open page”> JavaScript: function openpage() { window.location.assign(“http://www.yoursite.com/main.html”); } But why not just use a link? <a href = “https://stackoverflow.com/questions/16855551/main.html”>Main page</a> Your question was hard to understand. I think this is what you want. 3 solved how to open … Read more