Theres a problem. I can't set value of BorderBrush fros C#-code (not in XAML):
((Border)((Image)sender).Parent).BorderBrush = "#FFBCC7D8";
How to solve this problem?
i have question from programming pearls
problem is following
show how to use lomuto's partitioning scheme to sort varying length bit strings in time proportional to the sum oof their length
and algorithm is following
each record in x[0..n-1] has an integer length and pointer to the array bit[0..length-1]
code
void bsort(l,u,depth){
if (l>=u)
return;
for (int i=l;i<u;i++)
if (x[i].length<depth)
swap(i,l++);
m=l;
if (x[i].bit[depth] ==0)
swap(i,m++);
bsort(l,m-1,depth+1);
bsort(m,u,depth+1);
please help me
i need following things
1. how this algorith works
2.how implement in java?
What I have is a C# windows app that reads a bunch of SQL tables and creates a bunch of queries based on the results. What I'm having a small issue with is the final "," on my query
This is what I have
ColumnX,
from
I need to read the entire file, write out exactly what is in the file and just replace the last , before the from with nothing.
I tried .replace(@",\n\nfrom),(@"\n\nfrom) but it's not finding it. Any help is appreciated.
Example:
ColumnX,
from
Result:
ColumnX
from
What is the basic setup on the subject?
Let say I have a QByteArray, and I need to encrypt it with simple password.
And then decrypt it in another piece of code
Just a very simple setup
E.g.
Declare @str varchar2(20)
Set @str = 'A Student'
Select Reverse(@str)
Output:
tnedutS A
Expected being:
Student A
The output(using Reverse) is as expected. But my requirement is the one described.
Help needed with SET BASED.
I am using SQL SERVER 2005
I see extra characters like â showing because of encoding issues as I found out here -
HTML encoding issues - "Â" character showing up instead of " "
I understand that if I set the browser meta encoding to UTF-8, these will not affect anything but I need to strip these extra characters from the database for other purposes.
For eg. :
Text: ↑ should be become Text: ?
But if I run it through utf8_decode it gives me Text: ???
For every other occurrence of the â character, it converts properly to a blank space. Any help will be appreciated.
I am currently trying to build a very basic serial shell with my arduino.
I am able to get an output from the device using Serial.read() and can get the character it has outputted, but I cannot work out how to then add that character to a longer to form the full command.
I tried the logical thing but it doesn't work:
char Command[];
void loop(){
if(Serial.available() > 0){
int clinput = Serial.read();
Command = Command + char(clinput);
}
Can anybody help? Thank You.
function SimpleSymbols(str) {
var letter =['a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
var newstr = "";
for (var i = 0; i<str.length; i++){
if (str.charAt(i).toLowerCase() in letter){
newstr += "M";
}
else{
newstr += "X";
}
}
return newstr;
}
If str is "Argument goes here" it returns XXXXXXXXX. WHy doesn't it return MMMMMMMMMM?
Hi,
having a FileStream that I read with a StreamReader (it is a very large file), how can I set the Seek position of the FileStream to the first occurrence of a certain substring so that I can start reading this large file from a given point?
Thanks
I am using a tableview with a search function and is populated by a plist. I want to pass 2 strings through to a DetailView. But I can only get the sting used to populate the cell to pass over. I have tried many variations but can't figure it out. Any help would be greatly appreciated.
DetailView *nextLevel = [DetailView alloc];
NSString *valueString;
NSString *selectedTitle;
if (arraySearch == nil) {
NSString *key = [arrayDataKeys objectAtIndex:indexPath.section];
NSArray *nameSection = [dictAllData objectForKey:key];
NSDictionary *dict = [nameSection objectAtIndex:indexPath.row];
valueString = [dict objectForKey:@"name"];
selectedTitle = [dict objectForKey:@"word"];
} else {
valueString = [arraySearch objectAtIndex:indexPath.row];
**selectedTitle = [arraySearch objectAtIndex:indexPath.row];** //Obviously this is wrong but this is the line I need help with
}
nextLevel.title = valueString;
nextLevel.itemname = valueString;
nextLevel.itemWord = selectedTitle;
I stored some html contents in a local resource file.
So it has html tags in it such as p, br, div, etc.
I used GetLocalResourceObject("myContent")
to display the content on the page,
but the page doesnt render it as HTML.
Hi,
I'm using joomla and acesef as a plugin and I need to get the full querystring as is. The problem is when I use $_SERVEr['QUERY_STRING'] it contains the joomla QS isntead of my custom parameters.
A javascript or PHP solution would do. thanks
I want to send
www.mydomain.com/approve/SomeFunkyVariable to
www.mydomain.com/home/index.php?option=com_content&task=view&id=574&Itemid=85&approve=someFunkyVariable
What is the rule for this?
I have this kind of array, i will make it very simple to understand
$picture = ( 'artist2-1_thumb.jpg',
'artist2-2.jpg' ,
'artist2-3_thumb.jpg',
'artist2-4.jpg',
'artist2-5_thumb.jpg');
Now i want use substr to get new array that only have thumb, to have new array like this
$picturethumbs = ( 'artist2-1_thumb.jpg',
'artist2-3_thumb.jpg',
'artist2-5_thumb.jpg');
Can some substr but where to start?
I'm writing a code for a voting machine that will allow user to read in custom XML ballots and then vote on them, however in the current build I have in QtCreator, I don't see an easy way to edit buttons in my GUI directly. In the code snippet below, I assign an element to pull out the names and type of ballot being read in, but I need to append a label on the GUI as well as change buttons to the names of candidates read in. Any ideas on how to do this?
while(!n.isNull()){
QDomNode x = n.firstChildElement();
QDomElement e = n.toElement();
QMessageBox::information(0,
tr( "Loading Element" ),
tr( "Our element is %1" ).arg(e.tagName()) );
QDomElement p = x.firstChildElement();//p finds Races
QMessageBox::information(0,tr("Foo"),tr("p = %1").arg(p.text()));//finds Race and Ballot types
n = n.nextSibling();
}
}
Hello.
I have a file input in a form that uploads a mp3 file, but I´d like to detect conflictive characters to my system in the filename, like ! @ or any other.
All codes I´ve found replace these characters, but I just want to detect them to alert the user. I think it will be easy with regular expressions, but I dont know about them.
I´m using jquery/javascript.
Thanks in advance for your help
Edit to improve my problem description:
I´m working in a CodeIgniter application that allows user to upload mp3 files to the server.
I use jQuery to manage client side forms. The CI upload class converts spaces in the file name to underscores and everything works.
But testing the application I uploaded a mp3 file with a (!) in the name, and I got troubles with it.
I just want to insert a javascript conditional before the file is uploaded to evaluate if the user´s filename contains a (!) (or any other I´d like to add later) to ask for the file to be renamed if it does.
"8,5,,1,4,7,,,,7,,1,9,3,6,,,8,6,3,9,,2,5,4,,,,,3,2,,,7,4,1,1,,4,,6,9,,5,,,,5,,,1,,6,3,,,6,5,,,,7,4,,1,7,6,,,,8,,5,,,7,1,,3,9,"
I'm doing a programming challenge where i need to parse this sequence into my sudoku script.
Need to get the above sequence into 8,5,0,1,4,7,0,0,0,7,0,1,9,3,6,0,0,8.........
I tried re but without success, help is appreciated, thanks.
I know this should be easier if I could only use optgroups. But I am trying to avoid hacking core of my CMS, so jQuery should come to rescue again, hopefully.
I have a select with options in a hierarchy sometimes, and I want to put attributes disabled to any of options containing text NOT starting with a dash.
I want to code like:
Set disabled attributes to selectors with options text NOT starting with a dash ("-").
<select id="options">
<option value="" selected="selected">- Please choose -</option>
<option value="1">Parent1</option>
<option value="2">-child1</option>
<option value="3">-child2</option>
<option value="4">-child3</option>
<option value="5">-child4</option>
<option value="6">Parent2</option>
<option value="7">-child5</option>
<option value="8">-child6</option>
<option value="9">-child7</option>
<option value="10">-child8</option>
</select>
The closest solution is here http://stackoverflow.com/questions/2012299/contain-start-by,
$.extend($.expr[':'], {
startsWith: function(elem,match) {
return (elem.textContent || elem.innerText || "").indexOf(match[3]) == 0;
}
});
But I can't seem to do it right this far.
Any help would be very much appreciated. Thank you very much.
#include "stdio.h"
#include "conio.h"
#include <iostream>
using namespace std;
int main (void)
{
char my_char[] = "happy birthday";
int i;
bool j=false;
char my_char_temp[1];
do
{
for (i=0;i<sizeof(my_char)-2;i++)
{
j=false;
if (my_char[i+1] < my_char[i])
{
my_char_temp[0]=my_char[i+1];
my_char[i+1] = my_char[i];
my_char[i] = my_char_temp[0];
j=true;
}
}
}while (j);
cout << my_char;
}
what am i doing wrong?
im just trying to sort the letters within the char
the output i get is completely wrong
Hi,
I have a text box where the value the result of a calculation carried out in jQuery. What I would like to do, using jQuery, is to display brackets around the number in the text box if the number is negative.
The number may be used again later so I would then have to remove the brackets so further calculations could be carried out.
Any ideas as to how I could implement this?
Thanks
Zaps
There are the following two classes.
public class Employee
{
int EmployeeId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Street { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
}
public class Company
{
int CompanyId { get; set; }
public string Name { get; set; }
public string Street { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
}
In a DDD seminar, the speaker said the better design should be,
class PersonName
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
class Address
{
public string Street { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
}
public class Employee
{
int EmployeeId { get; set; }
public PersonName Name { get; set; }
[ForeignKey("EmployerAddress")]
public int EmployerAddressId { get; set; }
public virtual Address EmployerAddress { get; set; }
}
public class Company
{
int CompanyId { get; set; }
public string Name { get; set; }
[ForeignKey("CompanyAddress")]
public int CompanyAddressId { get; set; }
public virtual Address CompanyAddress { get; set; }
}
Is it the optimized design? How the code first generate the PersonName table and link it to Employee?
Hello, I just want to write some few simple lines to a text file in C++, but I want them to be encoded in UTF-8. What is the easiest and simple way to do so?
Thanks