Search Results

Search found 2654 results on 107 pages for 'c sharp newbie'.

Page 8/107 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • opening an emergent window in WPF application

    - by Meli
    I want to open window2.xaml from the window1.xaml window as an emergent (floating) window. In winforms that was form2.show() , how do I do it in WPF for both WPF application and WPFbrowser application? (I assume it's different for WPF application and WPFbrowser application)

    Read the article

  • SQL Inner Join : DB stuck

    - by SurfingCat
    I postet this question a few days ago but I didn't explain exactly what I want. I ask the question better formulated again: To clarify my problem I added some new information: I got an MySQL DB with MyISAM tables. The two relevant tables are: * orders_products: orders_products_id, orders_id, product_id, product_name, product_price, product_name, product_model, final_price, ... * products: products_id, manufacturers_id, ... (for full information about the tables see screenshot products (Screenshot) and screenshot orders_products (Screenshot)) Now what I want is this: - Get all Orders who ordered products with manufacturers_id = 1. And the product name of the product of this order (with manufacturers_id = 1). Grouped by orders. What I did so far is this: SELECT op.orders_id, p.products_id, op.products_name, op.products_price, op.products_quantity FROM orders_products op , products p INNER JOIN products ON op.products_id = p.products_id WHERE p.manufacturers_id = 1 AND p.orders_id > 10000 p.orders_id 10000 for testing to get only a few order_id's. But thies query takes much time to get executed if it even works. Two times the sql server stucked. Where is the mistake?

    Read the article

  • Validating an integer or String without try-catch

    - by Phil
    Ok, I'm lost. I am required to figure out how to validate an integer and String, but for some stupid reason, I can't use the Try-Catch method. I know this is the easiest way and so all the solutions on the internet are using it. I'm writing in Java. The deal is this, I need someone to put in an numerical ID and String name. If either one of the two inputs are invalid I must tell them they made a mistake. Can someone help me?

    Read the article

  • Ruby -- looking for some sort of "Regexp unescape" method

    - by RubyNoobie
    I have a bunch of strings that appear to have been double-escaped -- eg, I have "\\014\"\\000\"\\016smoothing\"\\011mean\"\\022color\"\\011zero@\\016" but I want "\014"\000"\016smoothing"\011mean"\022color"\011zero@\016" Is there a method I can use to unescape them? I imagine that I could make a regex to remove 1 backslash from every consecutive n backslashes, but I don't have a lot of regex experience and it seems there ought to be a "more elegant" way to do it. For example, when I puts MyString it displays the output I'd like, but I don't know how I might capture that into a variable. Thanks! Edited to add context: I have this class that is being used to marshal / restore some stuff, but when I restore some old strings it spits out a type error which I've determined is because they weren't -- for some inexplicable reason -- stored as base64. They instead appear to be 'double-escaped', when I need them to be 'single-escaped' to get restored. require 'base64' class MarshaledStuff < ActiveRecord::Base validates_presence_of :marshaled_obj def contents obj = self.marshaled_obj return Marshal.restore(Base64.decode64(obj)) end def contents=(newcontents) self.marshaled_obj = Base64.encode64(Marshal.dump(newcontents)) end end

    Read the article

  • Python creating a dictionary and swapping these into another file

    - by satsurae
    Hi all, I have two tab delimited .csv file. From one.csv I have created a dictionary which looks like: 'EB2430': ' "\t"idnD "\t"yjgV "\t"b4267 "\n', 'EB3128': ' "\t"yagE "\t\t"b0268 "\n', 'EB3945': ' "\t"maeB "\t"ypfF "\t"b2463 "\n', 'EB3944': ' "\t"eutS "\t"ypfE "\t"b2462 "\n', I would like to insert the value of the dictionary into the second.csv file which looks like: "EB2430" 36.81 364 222 4 72 430 101 461 1.00E-063 237 "EB3128" 26.04 169 108 6 42 206 17 172 6.00E-006 45.8 "EB3945" 20.6 233 162 6 106 333 33 247 6.00E-005 42.4 "EB3944" 19.07 367 284 6 1 355 1 366 2.00E-023 103 With a resultant output tab delimited: 'EB2430' idnD yjgV b4267 36.81 364 222 4 72 430 101 461 1.00E-063 237 'EB3128' yagE b0268 26.04 169 108 6 42 206 17 172 6.00E-006 45.8 'EB3945' maeB ypfF b2463 20.6 233 162 6 106 333 33 247 6.00E-005 42.4 'EB3944' eutS ypfE b2462 19.07 367 284 6 1 355 1 366 2.00E-023 103 Here is my code for creating the dictionary: f = open ("one.csv", "r") g = open ("second.csv", "r") eb = [] desc = [] di = {} for line in f: for row in f: eb.append(row[1:7]) desc.append(row[7:]) di = dict(zip(eb,desc)) Sorry for it being so long-winded!! I've not been programming for long. Cheers! Sat

    Read the article

  • If I register a domain name using a service like A Small Orange, how can I know they are registering

    - by Sergio Tapia
    I have a great name for a website and it's available, but I don't really know how to register a domain name using a barebones website; that's why I want to use A Small Orange-like service. My question is, is it standard procedure to register the name on YOUR(the costumers) behalf, or do companies set it up on their name so they can profit from hits if in the future you stop paying for the hosting?

    Read the article

  • How to start creating iAds

    - by murze
    Hi, i'd like to learn how to create iAds. I already installed Xcode and the iAd Js. In which environment to I make iAd Bundles? In Xcode? Is there any guide on how to do this? Thanks!

    Read the article

  • Access denied when trying to access my database.

    - by Sergio Tapia
    Here's my code: <html> <head> </head> <body> <?php $user = mysql_real_escape_string($_GET["u"]); $pass = mysql_real_escape_string($_GET["p"]); $query = "SELECT * FROM usario WHERE username = '$user' AND password = '$pass'"; mysql_connect(localhost, "root", ""); @mysql_select_db("multas") or die( "Unable to select database"); $result=mysql_query($query); if(mysql_numrows($result) > 0){ echo 'si'; } ?> </body> </html> And here's the error I get when I try to run it Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\useraccess.php on line 7 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\useraccess.php on line 7 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\useraccess.php on line 8 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\useraccess.php on line 8 Warning: mysql_numrows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\useraccess.php on line 16

    Read the article

  • Why the "mutable default argument fix" syntax is so ugly, asks python newbie

    - by Cawas
    Now following my series of "python newbie questions" and based on another question. Go to http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables and scroll down to "Default Parameter Values". There you can find the following: def bad_append(new_item, a_list=[]): a_list.append(new_item) return a_list def good_append(new_item, a_list=None): if a_list is None: a_list = [] a_list.append(new_item) return a_list So, question here is: why is the "good" syntax over a known issue ugly like that in a programming language that promotes "elegant syntax" and "easy-to-use"? Why not just something in the definition itself, that the "argument" name is attached to a "localized" mutable object like: def better_append(new_item, a_list=[].local): a_list.append(new_item) return a_list I'm sure there would be a better way to do this syntax, but I'm also almost positive there's a good reason to why it hasn't been done. So, anyone happens to know why?

    Read the article

  • 'int' object is not callable

    - by Oscar Reyes
    I'm trying to define a simply Fraction class And I'm getting this error: python fraction.py Traceback (most recent call last): File "fraction.py", line 20, in <module> f.numerator(2) TypeError: 'int' object is not callable The code follows: class Fraction(object): def __init__( self, n=0, d=0 ): self.numerator = n self.denominator = d def get_numerator(self): return self.numerator def get_denominator(self): return self.denominator def numerator(self, n): self.numerator = n def denominator( self, d ): self.denominator = d def prints( self ): print "%d/%d" %(self.numerator, self.denominator) if __name__ == "__main__": f = Fraction() f.numerator(2) f.denominator(5) f.prints() I thought it was because I had numerator(self) and numerator(self, n) but now I know Python doesn't have method overloading ( function overloading ) so I renamed to get_numerator but that's not the problems. What could it be?

    Read the article

  • Why can't I install psycopg2? (Python 2.6.4, PostgreSQL 8.4, OS X 10.6)

    - by cojadate
    After running python setup.py install I get the following: Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension gcc-4.0 -arch ppc -arch i386 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 - DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o unable to execute gcc-4.0: No such file or directory error: command 'gcc-4.0' failed with exit status 1 There's probably something screamingly obvious there to anyone who knows the first thing about back-end web programming, but unfortunately it's all gobbledegook to me. The psycopg2 documentation was not helpful.

    Read the article

  • Using the value of a variable as another variables name in Ruby

    - by hrickards
    Hi, I'm just starting out in learning Ruby and I've written a program that generates some numbers and assigns them to variables @one, @two, @three etc. The user can then specify a variable to change by inputting it's name (e.g one). I then need to do something like '@[valueofinout] = asd'. How would I do this, and is there a better way as the way I'm thinking of seems to be discouraged? I've found x = "myvar" myvar = "hi" eval(x) -> "hi" but I don't completely understand why the second line is needed. In my case would I use something like @one = "21" input = "one" input = "@" + input changeto = "22" eval(input) -> changeto Thanks

    Read the article

  • How do I retrieve an automated report and save it to a database?

    - by Mason Wheeler
    I've got a web server that will take scripts in Python, PHP or Perl. I don't know much about any of those languages, but of the three, Python seems the least scary. It has a MySql database set up, and I know enough SQL to manage it and write queries for it. I also have a program that I want to add automated error reporting to. Something goes wrong, it sends a bug report to my server. What I don't know how to do is write a Python script that will sit on the web server and, when my program sends in a bug report, do the following: Receive the bug report. Parse it out into sections. Insert it into the database. Have the server send me an email. From what little I understand, this seems like it shouldn't be too difficult if I only knew what I was doing. Could someone point me to a site that explains the basic principles I'd need to create a script like this?

    Read the article

  • Does deleting a branch in git remove it from the history?

    - by Ken Liu
    Coming from svn, just starting to become familiar with git. When a branch is deleted in git, is it removed from the history? In svn, you can easily recover a branch by reverting the delete operation (reverse merge). Like all deletes in svn, the branch is never really deleted, it's just removed from the current tree. If the branch is actually deleted from the history in git, what happens to the changes that were merged from that branch? Are they retained?

    Read the article

  • Can someone exaplain me implicit parameters in Scala?

    - by Oscar Reyes
    And more specifically how does the BigInt works for convert int to BigInt? In the source code it reads: ... implicit def int2bigInt(i: Int): BigInt = apply(i) ... How is this code invoked? I can understand how this other sample: "Date literals" works. In. val christmas = 24 Dec 2010 Defined by: implicit def dateLiterals(date: Int) = new { import java.util.Date def Dec(year: Int) = new Date(year, 11, date) } When int get's passed the message Dec with an int as parameter, the system looks for another method that can handle the request, in this case Dec(year:Int) Q1. Am I right in my understanding of Date literals? Q2. How does it apply to BigInt? Thanks

    Read the article

  • iPhone Apps, Objective C, a Graph, and Functions vs. Objects (or something like that)

    - by BillEccles
    Gentleones, I've got a UIImageView that I have in a UIView. This particular UIImageView displays a PNG of a graph. It's important for this particular view controller and another view controller to know what the graph "looks like," i.e., the function described by the PNG graph. These other view controllers need to be able to call a "function" of some sort with the X value returning the Y value. Please ignore the fact (from an outsider's perspective) that I could probably generate the graph programmatically. So my questions are: 1 - Where should I put this function? Should it go in one view controller or the other, or should it go in its own class or main or...? 2 - Should it be an object in some way? Or should it be a straight function? (In either case, where's it belong?) Pardon the apparent n00b-iness of the question. It's 'cause I'm honestly a n00b! This OOP stuff is giving my head a spin having been a procedural programmer for 30 years. (And I choose to learn it by jumping into an iPhone app. Talk about baptism by fire!) Thanks in advance,Bill

    Read the article

  • When I run cxxtest I get this error that I dont underdstand?

    - by user299648
    ./cxxtest/cxxtestgen.py -o tests.cpp --error-printer DrawTestSuite.h g++ -I./cxxtest/ -c tests.cpp g++ -o tests tests.o Color.o tests.o: In function DrawTestSuite::testLinewidthOne()': tests.cpp:(.text._ZN13DrawTestSuite16t… undefined reference toLinewidth::Linewidth(double)' tests.cpp:(.text._ZN13DrawTestSuite16t… undefined reference to `Linewidth::draw(std::basic_ostream &)' collect2: ld returned 1 exit status make: * [tests] Error 1// DrawTestSuite.h DrawTestSuite.h contains the unit-test and The test function calls on Linewidth.h to execute the constructer and member function draw I have include "Linewidth.h" in DrawTestSuite.h

    Read the article

  • Django 1.1 template question

    - by Bovril
    Hi All, I'm a little stuck trying to get my head around a django template. I have 2 objects, a cluster and a node I would like a simple page that lists... [Cluster 1] [associated node 1] [associated node 2] [associated node 3] [Cluster 2] [associated node 4] [associated node 5] [associated node 6] I've been using Django for about 2 days so if i've missed the point, please be gentle :) Models - class Node(models.Model): name = models.CharField(max_length=30) description = models.TextField() cluster = models.ForeignKey(Cluster) def __unicode__(self): return self.name class Cluster(models.Model): name = models.CharField(max_length=30) description = models.TextField() def __unicode__(self): return self.name Views - def DSAList(request): clusterlist = Cluster.objects.all() nodelist = Node.objects.all() t = loader.get_template('dsalist.html') v = Context({ 'CLUSTERLIST' : clusterlist, 'NODELIST' : nodelist, }) return HttpResponse(t.render(v)) Template - <body> <TABLE> {% for cluster in CLUSTERLIST %} <tr> <TD>{{ cluster.name }}</TD> {% for node in NODELIST %} {% if node.cluster.id == cluster.id %} <tr> <TD>{{ node.name }}</TD> </tr> {% endif %} {% endfor %} </tr> {% endfor %} </TABLE> </body> Any ideas ?

    Read the article

  • is there a better way to write this frankenstein LINQ query that searches for values in a child tabl

    - by MRV
    I have a table of Users and a one to many UserSkills table. I need to be able to search for users based on skills. This query takes a list of desired skills and searches for users who have those skills. I want to sort the users based on the number of desired skills they posses. So if a users only has 1 of 3 desired skills he will be further down the list than the user who has 3 of 3 desired skills. I start with my comma separated list of skill IDs that are being searched for: List<short> searchedSkillsRaw = skills.Value.Split(',').Select(i => short.Parse(i)).ToList(); I then filter out only the types of users that are searchable: List<User> users = (from u in db.Users where u.Verified == true && u.Level > 0 && u.Type == 1 && (u.UserDetail.City == city.SelectedValue || u.UserDetail.City == null) select u).ToList(); and then comes the crazy part: var fUsers = from u in users select new { u.Id, u.FirstName, u.LastName, u.UserName, UserPhone = u.UserDetail.Phone, UserSkills = (from uskills in u.UserSkills join skillsJoin in configSkills on uskills.SkillId equals skillsJoin.ValueIdInt into tempSkills from skillsJoin in tempSkills.DefaultIfEmpty() where uskills.UserId == u.Id select new { SkillId = uskills.SkillId, SkillName = skillsJoin.Name, SkillNameFound = searchedSkillsRaw.Contains(uskills.SkillId) }), UserSkillsFound = (from uskills in u.UserSkills where uskills.UserId == u.Id && searchedSkillsRaw.Contains(uskills.SkillId) select uskills.UserId).Count() } into userResults where userResults.UserSkillsFound > 0 orderby userResults.UserSkillsFound descending select userResults; and this works! But it seems super bloated and inefficient to me. Especially the secondary part that counts the number of skills found. Thanks for any advice you can give. --r

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >