Search Results

Search found 896 results on 36 pages for 'mr bio'.

Page 4/36 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • bitwise OR on strings

    - by mr.bio
    How can i do a Bitwise OR on strings? A: 10001 01010 ------ 11011 Why on strings? The Bits can have length of 40-50.Maybe this could be problematic on int ? Any Ideas ?

    Read the article

  • convert bitset to string ??

    - by mr.bio
    Hi .. What is wrong with this code ? set<string> nk ; bitset<3> bs1(string("100")); nk.insert(bs1.to_string()); error: no matching function for call to `std::bitset<3u::to_string()' why?!

    Read the article

  • bitset to dynamic bitset

    - by mr.bio
    Hi.. I have a function where i use bitset.Now i need to convert it to a dynamic bitset.. but i don't know how. Can somebody help me ? set<string> generateCandidates(set<string> ck,unsigned int k){ set<string> nk ; for (set<string>::const_iterator p = ck.begin( );p != ck.end( ); ++p){ for (set<string>::const_iterator q = ck.begin( );q != ck.end( ); ++q){ bitset<4> bs1(*p); bitset<4> bs2(*q); bs1|= bs2 ; if(bs1.count() == k){ nk.insert(bs1.to_string<char,char_traits<char>,allocator<char> >()); } } } return nk; }

    Read the article

  • Where is the mistake ?

    - by mr.bio
    Hi ... i am implementing a simple linked list in c++. I have a mistake and i don't see it :( #include <stdexcept> #include <iostream> struct Node { Node(Node *next, int value): next(next), value(value) { } Node *next; int value; }; class List { Node *first; // Erstes Element , 0 falls die Liste leer ist int len; // Laenge der liste Node *nthNode(int index); // Hilfsfunktion : O( index ) public: // Default - Konstruktor ( Laenge 0): O (1) List():first(0),len(0){ } // Copy - Konstruktor : O(other.len) List(const List & other){ }; // Zuweisungs - Operator O(len +other.len) List &operator=(const List &other) { clear(); if(!other.len) return *this; Node *it = first = new Node(0,other.first->value); for (Node *n = other.first->next; n; n = n->next) { it = it->next = new Node(0, n->value); } len = other.len; return *this; } // Destruktor ( gibt den Speicher von allen Nodes frei ): O( len ) ~List(){ }; // Haengt der Liste ein Element hinten an: O( len ) void push_back(int value){ }; // Fuegt am Anfang der Liste ein Element ein : O (1) void push_front(int value){ Node* front = new Node(0,value); if(first){ first = front; front->next = 0; }else{ front->next = first; first = front; } len++; }; // gibt eine Referenz auf das index -te Element zurueck : O( index ) int &at(int index){ int count = 0 ; int ret ; Node *it = first; for (Node *n = first->next; n; n = n->next) { if(count==index) ret = n->value; count++; } return ret ; }; // Entfernt alle Elemente : O(len) void clear(){ }; // Zeigt alle Elemente an: hier : O( len * len ) void show() { std::cout << " List [" << len << " ]:{ "; for (int i = 0; i < len; ++i) { std::cout << at(i) << (i == len - 1 ? '}' : ','); } std::cout << std::endl; } }; /* * */ int main() { List l; // l. push_back(1); // l. push_back(2); l. push_front(7); l. push_front(8); l. push_front(9); l.show(); // List(l). show(); } it works ... but the output is : List [3 ]:{ 0,134520896,9484585}

    Read the article

  • Why are there so many Database Management Systems?

    - by mr.bio
    Why are there so many Database management systems? I am not an DB expert and I've never thought about using another Database other than mySQL. Programming languages offer different paradigms, so it makes sense to choose a specific language for your purpose. Question What are the factors in choosing a specific Database management system ?

    Read the article

  • Count subset of binary pattern ..

    - by mr.bio
    Hi there . I have a A=set of strings and a B=seperate string. I want to count the number of occurences in from B in A. Example : A: 10001 10011 11000 10010 10101 B: 10001 result would be 3.(10001 is a subset of 10001,10011,10101) So i need a function that takes a set and string and returns an int. int myfunc(set<string> , string){ int result; // My Brain is melting return result ; }

    Read the article

  • Why are there so many DB management Systems ?

    - by mr.bio
    Hi there , i always asked myself. Why are there so many DB management systems? I am not an DB expert and i never thought about using another DB than mysql. Programming languages offer different paradigms, so there it makes sense to choose a specific language for your purpose. What are factors to choose a specific DB management system ?

    Read the article

  • Webdevelopement : Login Specification

    - by mr.bio
    Hi there , i just started with PHP and i wanted to implement a Login. Rather than inventing the Wheel : is there any Online Specification for a Login System ? Things a should care about : detect Brute Force attacks implement password recovery maybe openID and/or with facebook account prevent SQL injection ..... So i think this has been done more than 1000 times. Where can i read about it ?

    Read the article

  • What is wrong with this C++ Code ?

    - by mr.bio
    Hi .. i am a beginner and i have a problem : this code doesnt compile : main.cpp: #include <stdlib.h> #include "readdir.h" #include "mysql.h" #include "readimage.h" int main(int argc, char** argv) { if (argc>1){ readdir(argv[1]); // test(); return (EXIT_SUCCESS); } std::cout << "Bitte Pfad angeben !" << std::endl ; return (EXIT_FAILURE); } readimage.cpp #include <Magick++.h> #include <iostream> #include <vector> using namespace Magick; using namespace std; void readImage(std::vector<string> &filenames) { for (unsigned int i = 0; i < filenames.size(); ++i) { try { Image img("binary/" + filenames.at(i)); for (unsigned int y = 1; y < img.rows(); y++) { for (unsigned int x = 1; x < img.columns(); x++) { ColorRGB rgb(img.pixelColor(x, y)); // cout << "x: " << x << " y: " << y << " : " << rgb.red() << endl; } } cout << "done " << i << endl; } catch (Magick::Exception & error) { cerr << "Caught Magick++ exception: " << error.what() << endl; } } } readimage.h #ifndef _READIMAGE_H #define _READIMAGE_H #include <Magick++.h> #include <iostream> #include <vector> #include <string> using namespace Magick; using namespace std; void readImage(vector<string> &filenames) #endif /* _READIMAGE_H */ If want to compile it with this code : g++ main.cpp Magick++-config --cflags --cppflags --ldflags --libs readimage.cpp i get this error message : main.cpp:5: error: expected initializer before ‘int’ i have no clue , why ? :( Can somebody help me ? :)

    Read the article

  • Filter Calendar view SharePoint WWS 3.0

    - by lerac
    Hi all, I have a SP site with a calendarview and would like to filter this on the basis of the current user. Don't be afraid I already figured out how do to this with a list customizing some excisting jScripts and working with Content Editor WebPart. Yet this jScript does not work in a Calendar. To paint a picture I have columns like: Judge1 Lawyer Clerk (example). Underneath these columns there are names ofcourse. However these are not shown in Calendar view, so it is hard to filter on something that is not displayed only the casenumbers. Now I've been thinking (not always wise) perhaps I can adjust the aspx page of calendar/list by adjusting a filter I applied in SharePoint. This would also solve the issue of displaying all the content before it filters with Java, since it should not be possible for users to see the entire listcontent (security). I went to Modify list view and created a filter where judge1 = Mr. J. Jenkins. Then I went to SharePoint Designer and opend the Calendar aspx page. To my expectation I found Mr. J. Jenkins with the following code: Since I can't display image because i'm new, not very handy discrimination I have to give you a url. Code can't be pasted either is completely messes it up even with codemode on. Hyperlink CODE IMAGE Keep in mind I just posted a very tiny part of the code (only the part I want to change). Now I have no idea what kind of code this is above this text (SP wss 3.0 uses for aspx pages), but I would like to change Mr. J. Jenkins into a jScript var/val. Since I already managed to get the current user that is logged in content. var user = jP.getUserProfile(); var userinfspvalue = user.Department; There is more code around that one 2 ofcourse, yet to give you a picture. The var userinfspvalue is what I would like to replace the text Mr. J. Jenkins into. This would mean the calendar would be dynamically filtered based upon the current user that is logged on. Have no idea what is possible, perhaps there is a better solution who knows... Do you know? Thank you so much ahead!

    Read the article

  • Run time error in vb.net

    - by Muhammed Yoosuf
    I get the following error message in vb.net when I try to run the program Any help is greatly appreciated. Thanks Error 1 Unable to copy file "C:\Users\Mr. M Yoosuf Hassan\Desktop\CD\Software (full version)\Airline Reservation System - Copy\Airline Reservation System\Airline2.mdb" to "bin\Debug\Airline2.mdb". Could not find file 'C:\Users\Mr. M Yoosuf Hassan\Desktop\CD\Software (full version)\Airline Reservation System - Copy\Airline Reservation System\Airline2.mdb'. Airline Reservation System

    Read the article

  • Align the values of the cells in JTable?

    - by Venkats
    I'm not aware of how to align the values of cells in JTable. For Ex,The Jtable shows, Name Salary Mr.X 100000.50 XXXX 234.34 YYYy 1205.50 I want to align the "Salaries" in the following format. Name Salary Mr.X 100000.50 XXXX 234.34 YYYy 1205.50 How to align as above the JTable

    Read the article

  • SQL help on a name dilemma

    - by Ardman
    I have a column which has surname and firstname plus salutation in. e.g. Bloggs,Joe,Mr I need to break this out into Bloggs Joe Mr as 3 seperate columns. Any ideas appreciated. How, the other thing is I won't know how many commas are in the initial column.

    Read the article

  • Tuple conversion to a string

    - by David542
    I have the following list: [('Steve Buscemi', 'Mr. Pink'), ('Chris Penn', 'Nice Guy Eddie'), ...] I need to convert it to a string in the following format: "(Steve Buscemi, Mr. Pink), (Chris Penn, Nice Guy Eddit), ..." I tried doing str = ', '.join(item for item in items) but run into the following error: TypeError: sequence item 0: expected string, tuple found How would I do the above formatting?

    Read the article

  • XCode can't find headers in /usr/include

    - by mindthief
    Hi all, I'm trying to use standard system header files in my C++ XCode project: #include <openssl/bio.h> #include <openssl/ssl.h> #include <openssl/err.h> The build fails and it complains: "Openssl/bio.h: No such file or directory" I added /usr/include to the "Header Search Paths" in Project settings, but that doesn't fix it. I COULD fix it by adding the whole path like: #include </usr/include/openssl/bio.h> -- but the project is full of similar includes and I don't want to change all of them this way. Also, I feel I shouldn't have to do this. Another way to fix it would be as another thread mentioned, which is to add /usr/include to User Header Search Paths. But if I do that, then I'd have to change all the angle brackets < to quotes "", which again seems like a hack. I mean, these are standard system header files so I feel it should be something simple, not requiring these kinds of hacks. Any ideas? Thanks!

    Read the article

  • Rails3 renders a js.erb template with a text/html content-type instead of text/javascript

    - by Yannis
    Hi, I'm building a new app with 3.0.0.beta3. I simply try to render a js.erb template to an Ajax request for the following action (in publications_controller.rb): def get_pubmed_data entry = Bio::PubMed.query(params[:pmid])# searches PubMed and get entry @publication = Bio::MEDLINE.new(entry) # creates Bio::MEDLINE object from entry text flash[:warning] = "No publication found."if @publication.title.blank? and @publication.authors.blank? and @publication.journal.blank? respond_to do |format| format.js end end Currently, my get_pubmed_data.js.erb template is simply alert('<%= @publication.title %>') The server is responding with the following alert('Evidence for a herpes simplex virus-specific factor controlling the transcription of deoxypyrimidine kinase.') which is perfectly fine except that nothing happen in the browser, probably because the content-type of the response is 'text/html' instead of 'text/javascript' as shown by the response header partially reproduced here: Status 200 Keep-Alive timeout=5, max=100 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html; charset=utf-8 Is this a bug or am I missing something? Thanks for your help!

    Read the article

  • openssl crypto library - base64 conversion

    - by Hassan Syed
    I'm using openssl BIO objects to convert a binary string into a base64 string. The code is as follows: void ToBase64(std::string & s_in) { BIO * b_s = BIO_new( BIO_s_mem() ); BIO * b64_f = BIO_new( BIO_f_base64() ); b_s = BIO_push( b64_f , b_s); std::cout << "IN::" << s_in.length(); BIO_write(b_s, s_in.c_str(), s_in.length()); char * pp; int sz = BIO_get_mem_data(b_s, &pp); std::cout << "OUT::" << sz << endl; s_in.assign(pp,sz); //std::cout << sz << " " << std::string(pp,sz) << std::endl; BIO_free (b64_f); // TODO ret error potential BIO_free (b_s); // } The in length is either 64 or 72. However the output is always 65, which is incorrect it should be much larger than that. The documentation isn't the best in the world, AFAIK the bio_s_mem object is supposed to grow dynamically. What am I doing wrong ?

    Read the article

  • Django forms I cannot save picture file

    - by dana
    i have the model: class OpenCv(models.Model): created_by = models.ForeignKey(User, blank=True) first_name = models.CharField(('first name'), max_length=30, blank=True) last_name = models.CharField(('last name'), max_length=30, blank=True) url = models.URLField(verify_exists=True) picture = models.ImageField(help_text=('Upload an image (max %s kilobytes)' %settings.MAX_PHOTO_UPLOAD_SIZE),upload_to='jakido/avatar',blank=True, null= True) bio = models.CharField(('bio'), max_length=180, blank=True) date_birth = models.DateField(blank=True,null=True) domain = models.CharField(('domain'), max_length=30, blank=True, choices = domain_choices) specialisation = models.CharField(('specialization'), max_length=30, blank=True) degree = models.CharField(('degree'), max_length=30, choices = degree_choices) year_last_degree = models.CharField(('year last degree'), max_length=30, blank=True,choices = year_last_degree_choices) lyceum = models.CharField(('lyceum'), max_length=30, blank=True) faculty = models.ForeignKey(Faculty, blank=True,null=True) references = models.CharField(('references'), max_length=30, blank=True) workplace = models.ForeignKey(Workplace, blank=True,null=True) objects = OpenCvManager() the form: class OpencvForm(ModelForm): class Meta: model = OpenCv fields = ['first_name','last_name','url','picture','bio','domain','specialisation','degree','year_last_degree','lyceum','references'] and the view: def save_opencv(request): if request.method == 'POST': form = OpencvForm(request.POST, request.FILES) # if 'picture' in request.FILES: file = request.FILES['picture'] filename = file['filename'] fd = open('%s/%s' % (MEDIA_ROOT, filename), 'wb') fd.write(file['content']) fd.close() if form.is_valid(): new_obj = form.save(commit=False) new_obj.picture = form.cleaned_data['picture'] new_obj.created_by = request.user new_obj.save() return HttpResponseRedirect('.') else: form = OpencvForm() return render_to_response('opencv/opencv_form.html', { 'form': form, }, context_instance=RequestContext(request)) but i don't seem to save the picture in my database... something is wrong, and i can't figure out what :(

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >