Search Results

Search found 21430 results on 858 pages for 'message digest'.

Page 59/858 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • How to define an n-m relation in doctrine?

    - by murze
    If got a table "Article" and a table "Tags". Articles can have multiple tags and tags can hang to multiple articles. The class BaseArticle looks like this: abstract class BaseArticle extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('article'); $this->hasColumn('article_id', 'integer', 8, array( 'type' => 'integer', 'length' => 8, 'fixed' => false, 'unsigned' => false, 'primary' => true, 'autoincrement' => true, )); $this->hasColumn('title', 'string', null, array( 'type' => 'string', 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => false, 'autoincrement' => false, )); $this->hasColumn('text', 'string', null, array( 'type' => 'string', 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => false, 'autoincrement' => false, $this->hasColumn('url', 'string', 255, array( 'type' => 'string', 'length' => 255, 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => false, 'autoincrement' => false, )); } public function setUp() { parent::setUp(); $this->hasMany('Tag as Tags', array( 'local' => 'article_id', 'foreign'=>'tag_id', 'refClass'=>'Articletag') ); } } The BaseTag-class like this: abstract class BaseTag extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('tag'); $this->hasColumn('tag_id', 'integer', 4, array( 'type' => 'integer', 'length' => 4, 'fixed' => false, 'unsigned' => false, 'primary' => true, 'autoincrement' => true, )); $this->hasColumn('name', 'string', null, array( 'type' => 'string', 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => false, 'autoincrement' => false, )); } public function setUp() { parent::setUp(); $this->hasMany('Article as Articles', array( 'local' => 'tag_id', 'foreign'=>'article_id', 'refClass'=>'Articletag') ); } } And the relationship class like this: abstract class BaseArticletag extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('articletag'); $this->hasColumn('article_id', 'integer', 8, array( 'type' => 'integer', 'length' => 8, 'fixed' => false, 'unsigned' => false, 'primary' => true, 'autoincrement' => false, )); $this->hasColumn('tag_id', 'integer', 4, array( 'type' => 'integer', 'length' => 4, 'fixed' => false, 'unsigned' => false, 'primary' => true, 'autoincrement' => false, )); } public function setUp() { parent::setUp(); } } When I try to get a property from the article all goes well by using: $article = Doctrine_Query::create()->from('Article a') ->where('id = ?' , 1) ->fetchOne(); echo $article->title; //gives me the title But when I try this: foreach($article->Tags as $tag) { echo($tag->name) } I get an error: Unknown record property / related component "Tags" on "Article"

    Read the article

  • Dimension Mismatch MatLab; cant figure out why it is mismatching

    - by Abid
    I think it may be a syntax issue, here is the code. load ([ 'C:\Users\Abid\Desktop\Inquiry Runs\dtS' ]) dtS((dtS==0))=nan; for j=2:9; maxS=max(dtS(j,:)); minS=min(dtS(j,:)); maxval(j,:)=dtS((dtS>(maxS-.1*maxS))); minval(j,:)=dtS((dtS<(minS+.1*minS))); avmax(j)=mean(maxval(j,:)); avmin(j)=mean(minval(j,:)); avs(j,:)=[avmax(j) avmin(j)] end So I know the the row matrices are different sizes every loop. For example maxval(j,:) will change depending one row it is looking through for certain values. I did this manually and I see that on the first loop the matrices are size (1,1), however, if I set the loop to run for only j=2, the row length is 13. Usually if a matrix is changing size on the loop, I only get a warning, but this time I think it is due to a reason I don't understand.

    Read the article

  • Intrinsics program (SSE) - g++ - help needed

    - by Sriram
    Hi all, This is the first time I am posting a question on stackoverflow, so please try and overlook any errors I may have made in formatting my question/code. But please do point the same out to me so I may be more careful. I was trying to write some simple intrinsics routines for the addition of two 128-bit (containing 4 float variables) numbers. I found some code on the net and was trying to get it to run on my system. The code is as follows: //this is a sample Intrinsics program to add two vectors. #include <iostream> #include <iomanip> #include <xmmintrin.h> #include <stdio.h> using namespace std; struct vector4 { float x, y, z, w; }; //functions to operate on them. vector4 set_vector(float x, float y, float z, float w = 0) { vector4 temp; temp.x = x; temp.y = y; temp.z = z; temp.w = w; return temp; } void print_vector(const vector4& v) { cout << " This is the contents of vector: " << endl; cout << " > vector.x = " << v.x << endl; cout << " vector.y = " << v.y << endl; cout << " vector.z = " << v.z << endl; cout << " vector.w = " << v.w << endl; } vector4 sse_vector4_add(const vector4&a, const vector4& b) { vector4 result; asm volatile ( "movl $a, %eax" //move operands into registers. "\n\tmovl $b, %ebx" "\n\tmovups (%eax), xmm0" //move register contents into SSE registers. "\n\tmovups (%ebx), xmm1" "\n\taddps xmm0, xmm1" //add the elements. addps operates on single-precision vectors. "\n\t movups xmm0, result" //move result into vector4 type data. ); return result; } int main() { vector4 a, b, result; a = set_vector(1.1, 2.1, 3.2, 4.5); b = set_vector(2.2, 4.2, 5.6); result = sse_vector4_add(a, b); print_vector(a); print_vector(b); print_vector(result); return 0; } The g++ parameters I use are: g++ -Wall -pedantic -g -march=i386 -msse intrinsics_SSE_example.C -o h The errors I get are as follows: intrinsics_SSE_example.C: Assembler messages: intrinsics_SSE_example.C:45: Error: too many memory references for movups intrinsics_SSE_example.C:46: Error: too many memory references for movups intrinsics_SSE_example.C:47: Error: too many memory references for addps intrinsics_SSE_example.C:48: Error: too many memory references for movups I have spent a lot of time on trying to debug these errors, googled them and so on. I am a complete noob to Intrinsics and so may have overlooked some important things. Any help is appreciated, Thanks, Sriram.

    Read the article

  • PHP, is_array() generating an "Undefined property: stdClass::$crit " error

    - by Brook Julias
    is_array($src2->crit) is generating an "Undefined property: stdClass::$crit" error. The line throwing the error is: if(is_array($src2->crit) && count($src->crit) > 0){ $src2->crit is initialized here. $src2->crit = array(); $src2->crit[0] = new dataSet(); $src2->crit[0]->tblName = $tbl2; $src2->crit[0]->colName = "ID"; $src2->crit[0]->val = $elm->editID; When testing $src2->crit with this code. print("\$src->crit is a ".$src->crit."<br />"); print_r($src->crit); print("<br />"); This is returned. $src2->crit is a Array Array ( [0] => dataSet Object ( [tblName] => sExam [colName] => ID [val] => 10 ) ) What am I not seeing/understanding correctly? If print("\$src2->crit is a ".$src->crit."<br />") returns that it is an array then why is is_array($src2->$crit) generating an error?

    Read the article

  • sending SMS with VBA

    - by I__
    does anyone know if this is possible? i was able to succesfully run hyperterminal and use it to send texts through my phone which is attached by USB. anyone know how to do it in VBA?

    Read the article

  • java gui changing picture causes heapspace error

    - by pie154
    I have a java programme than when a button is clicked it updates the image on screen to the according image. this will work for the first 15 or so clicks then it causes a java heapspace error. I think it is because of the way I am updating the jpanel that contains the bufferedimage but not sure what the reason is. My code to get make the JPanel contain the new image is, public class extraScreenPanel { static JPanel screenPanel = new JPanel(new BorderLayout()); public static JPanel extraScreenPanel(int dispNum) { JLabel label = new JLabel("" + dispNum + ""); label.setPreferredSize(new Dimension(800, 600)); //label.setUI( new VerticalLabelUI(true) ); label.setVerticalAlignment( SwingConstants.TOP ); screenPanel = imgDisp(dispNum); label.setForeground(Color.white); label.setFont(new Font("Serif", Font.BOLD, 200)); screenPanel.add(label, BorderLayout.PAGE_END ); return screenPanel; } public static JPanel imgDisp(int picNum) { /* String url[] = new String[5000]; String part1; url[0] = "C:/PiPhotoPic/pic16.jpg"; for(Integer i=1;i<5000;i++){ if(i<10){part1 = "C:/temp/new0000000";} else if(i<100){part1 = "C:/temp/new000000";} else if(i<1000){part1 = "C:/temp/new00000";} else {part1 = "C:/temp/new00000";} String num = Integer.toString(i); url[i]= part1 + num + ".jpg"; } if(picNum<0){picNum=0;} String ref = url[picNum];*/ //this code is just to get specific ref for image location BufferedImage loadImg = loadImage(ref); JImagePanel panel = new JImagePanel(loadImg, 0, 0); panel.setPreferredSize(new Dimension(800, 600)); return panel; } public static class JImagePanel extends JPanel{ private BufferedImage image; int x, y; public JImagePanel(BufferedImage image, int x, int y) { super(); this.image = image; this.x = x; this.y = y; } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g.drawImage(image, x, y, null); } } public static BufferedImage loadImage(String ref) { BufferedImage bimg = null; try { bimg = javax.imageio.ImageIO.read(new File(ref)); } catch (Exception e) { e.printStackTrace(); } BufferedImage bimg2 = resize(bimg,800,600); return bimg2; } public static BufferedImage resize(BufferedImage img, int newW, int newH) { int w = img.getWidth(); int h = img.getHeight(); BufferedImage dimg = dimg = new BufferedImage(newW, newH, img.getType()); Graphics2D g = dimg.createGraphics(); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); g.drawImage(img, 0, 0, newW, newH, 0, 0, w, h, null); g.dispose(); return dimg; } } And the code that updates my gui is, it works by removing the panel from its containg panel and then readding it to it. picPanel = imgDisp.imgDisp(num); repaintPicPanel(); public static void repaintPicPanel() { picPanel.removeAll(); menuPanel.remove(picPanel);; menuPanel.add(picPanel, BorderLayout.LINE_START); }

    Read the article

  • Haskell Type error

    - by Jon
    I am getting a Couldn't match expected type error on this code and am not sure why. Would appreciate it if someone could point me in the right direction as to fixing it. import qualified Data.ByteString.Lazy as S import Data.Binary.Get import Data.Word getBinary :: Get Word16 getBinary = do a <- getWord16be "Test.class" return (a) main :: IO () main = do contents <- S.getContents print getBinary contents Specifically it cannot match expected type 'S.ByteString - IO ()' to inferred type 'IO ()'

    Read the article

  • MIME/IMF error codes?

    - by hack.augusto
    I need to write php code to identify common e-mail errors, like "inbox full" or specially "invalid email name" from email messages, because we need to clear our databases from nonexistent emails. I'm looking the MIME and IMF formats but I didn't find any kind of standard error code, does it exist?

    Read the article

  • Best Work Queue service for distributed clusters

    - by onewheelgood
    Hi there. I require a simple work queue type system for asynchronous task management. I have looked at both beanstalkd and gearman. However, both these seem to assume that the client and the queue server are on the same network, and therefore that there will always be a reliable network between them. I need one that can support the client and server being in different places in the world, and be able to manage temporary loss of network connection between clusters. Ideally, this would work in such a way where I post a job to a local proxy that attempts to send it to the main queue server. If there is no network connection, it would try again later, however it would not lose the job or delay the client. Any recommendations?

    Read the article

  • C++ Operator overloading - 'recreating the Vector'

    - by Wallter
    I am currently in a collage second level programing course... We are working on operator overloading... to do this we are to rebuild the vector class... I was building the class and found that most of it is based on the [] operator. When I was trying to implement the + operator I run into a weird error that my professor has not seen before (apparently since the class switched IDE's from MinGW to VS express...) (I am using Visual Studio Express 2008 C++ edition...) Vector.h #include <string> #include <iostream> using namespace std; #ifndef _VECTOR_H #define _VECTOR_H const int DEFAULT_VECTOR_SIZE = 5; class Vector { private: int * data; int size; int comp; public: inline Vector (int Comp = 5,int Size = 0) : comp(Comp), size(Size) { if (comp > 0) { data = new int [comp]; } else { data = new int [DEFAULT_VECTOR_SIZE]; comp = DEFAULT_VECTOR_SIZE; } } int size_ () const { return size; } int comp_ () const { return comp; } bool push_back (int); bool push_front (int); void expand (); void expand (int); void clear (); const string at (int); int operator[ ](int); Vector& operator+ (Vector&); Vector& operator- (const Vector&); bool operator== (const Vector&); bool operator!= (const Vector&); ~Vector() { delete [] data; } }; ostream& operator<< (ostream&, const Vector&); #endif Vector.cpp #include <iostream> #include <string> #include "Vector.h" using namespace std; const string Vector::at(int i) { this[i]; } void Vector::expand() { expand(size); } void Vector::expand(int n ) { int * newdata = new int [comp * 2]; if (*data != NULL) { for (int i = 0; i <= (comp); i++) { newdata[i] = data[i]; } newdata -= comp; comp += n; delete [] data; *data = *newdata; } else if ( *data == NULL || comp == 0) { data = new int [DEFAULT_VECTOR_SIZE]; comp = DEFAULT_VECTOR_SIZE; size = 0; } } bool Vector::push_back(int n) { if (comp = 0) { expand(); } for (int k = 0; k != 2; k++) { if ( size != comp ){ data[size] = n; size++; return true; } else { expand(); } } return false; } void Vector::clear() { delete [] data; comp = 0; size = 0; } int Vector::operator[] (int place) { return (data[place]); } Vector& Vector::operator+ (Vector& n) { int temp_int = 0; if (size > n.size_() || size == n.size_()) { temp_int = size; } else if (size < n.size_()) { temp_int = n.size_(); } Vector newone(temp_int); int temp_2_int = 0; for ( int j = 0; j <= temp_int && j <= n.size_() && j <= size; j++) { temp_2_int = n[j] + data[j]; newone[j] = temp_2_int; } //////////////////////////////////////////////////////////// return newone; //////////////////////////////////////////////////////////// } ostream& operator<< (ostream& out, const Vector& n) { for (int i = 0; i <= n.size_(); i++) { //////////////////////////////////////////////////////////// out << n[i] << " "; //////////////////////////////////////////////////////////// } return out; } Errors: out << n[i] << " "; error C2678: binary '[' : no operator found which takes a left-hand operand of type 'const Vector' (or there is no acceptable conversion) return newone; error C2106: '=' : left operand must be l-value As stated above, I am a student going into Computer Science as my selected major I would appreciate tips, pointers, and better ways to do stuff :D

    Read the article

  • What is the suggested way to show exception messages on UI which were produced in Business Layer?

    - by burak ozdogan
    Hi, Is there a pattern OR 'a best practice' on creating user's friendly messages in the presentation layer by using exceptions which were thrown from the Business Layer? Actually in many cases I prefer to throw Application Exceptions and this is forcing me to catch them on UI (aspx.cs pages). And if the process is complex which may produce many different types of exceptions I have to have many catch blocks to produce specific error messages. Is there a better way coming to your mind? A pattern maybe for similar cases? thanks

    Read the article

  • Build custom error messages in model files (example: using the 'pluralize' method)

    - by user502052
    I am using Ruby on Rails 3.0.7 and I would like to use the pluralize method in a my model file in order to properly build custom error messages. For example, I would like to do something like the following: NAME_MIN_LENGHT = 2 # Is 2 but I plan to change that (maybe dynamically... if it is possible) in future development validates :name, :length => { :minimum => NAME_MIN_LENGHT, :too_short => "is too short (minimum is #{pluralize(NAME_MIN_LENGHT, "character")})", }, How can I do that? Is it advisable? Why?

    Read the article

  • Android: Quitting the Looper?

    - by stormin986
    I have a thread I use to periodically update the data in my Activity. I create the thread and start a looper for using a handler with postDelay(). In onDestroy() for my activity, I call removeCallbacks() on my handler. Should I then call handler.getLooper().quit()? Or not worry about it and let the OS deal with it? Or would it just run forever then, consuming CPU cycles?

    Read the article

  • Is there a better tool than postcat for viewing postfix mail queue files?

    - by Geekman
    So I got a call early this morning about a client needing to see what email they have waiting to be delivered sitting in our secondary mail server. Their link for the main server had (still is) been down for two days and they needed to see their email. So I wrote up a quick Perl script to use mailq in combination with postcat to dump each email for their address into separate files, tar'd it up and sent it off. Horrible code, I know, but it was urgent. My solution works OK in that it at least gives a raw view, but I thought tonight it would be nice if I had a solution where I could provide their email attachments and maybe remove some "garbage" header text as well. Most of the important emails seem to have a PDF or similar attached. I've been looking around but the only method of viewing queue files I can see is the postcat command, and I really don't want to write my own parser - so I was wondering if any of you have already done so, or know of a better command to use? Here's the code for my current solution: #!/usr/bin/perl $qCmd="mailq | grep -B 2 \"someemailaddress@isp\" | cut -d \" \" -f 1"; @data = split(/\n/, `$qCmd`); $i = 0; foreach $line (@data) { $i++; $remainder = $i % 2; if ($remainder == 0) { next; } if ($line =~ /\(/ || $line =~ /\n/ || $line eq "") { next; } print "Processing: " . $line . "\n"; `postcat -q $line > $line.email.txt`; $subject=`cat $line.email.txt | grep "Subject:"`; #print "SUB" . $subject; #`cat $line.email.txt > \"$subject.$line.email.txt\"`; } Any advice appreciated.

    Read the article

  • Another Call to a member function get_segment() on a non-object question

    - by hogofwar
    I get the above error when calling this code: <? class Test1 extends Core { function home(){ ?> This is the INDEX of test1 <? } function test2(){ echo $this->uri->get_segment(1); //this is where the error comes from ?> This is the test2 of test1 testing URI <? } } ?> I get the error where commentated. This class extends this class: <?php class Core { public function start() { require("funk/funks/libraries/uri.php"); $this->uri = new uri(); require("funk/core/loader.php"); $this->load = new loader(); if($this->uri->get_segment(1) != "" and file_exists("funk/pages/".$this->uri->get_segment(1).".php")){ include("funk/pages/". $this->uri->get_segment(1).".php"); $var = $this->uri->get_segment(2); if ($var != ""){ $home= $this->uri->get_segment(1); $Index= new $home(); $Index->$var(); }else{ $home= $this->uri->get_segment(1); $Index = new $home(); $Index->home(); } }elseif($this->uri->get_segment(1) and ! file_exists("funk/pages/".$this->uri->get_segment(1).".php")){ echo "404 Error"; }else{ include("funk/pages/index.php"); $Index = new Index(); $Index->home(); //$this->Index->index(); echo "<!--This page was created with FunkyPHP!-->"; } } } ?> And here is the contents of uri.php: <?php class uri { private $server_path_info = ''; private $segment = array(); private $segments = 0; public function __construct() { $segment_temp = array(); $this->server_path_info = preg_replace("/\?/", "", $_SERVER["PATH_INFO"]); $segment_temp = explode("/", $this->server_path_info); foreach ($segment_temp as $key => $seg) { if (!preg_match("/([a-zA-Z0-9\.\_\-]+)/", $seg) || empty($seg)) unset($segment_temp[$key]); } foreach ($segment_temp as $k => $value) { $this->segment[] = $value; } unset($segment_temp); $this->segments = count($this->segment); } public function segment_exists($id = 0) { $id = (int)$id; if (isset($this->segment[$id])) return true; else return false; } public function get_segment($id = 0) { $id--; $id = (int)$id; if ($this->segment_exists($id) === true) return $this->segment[$id]; else return false; } } ?> i have asked a similar question to this before but the answer does not apply here. I have rewritten my code 3 times to KILL and Delimb this godforsaken error! but nooooooo....

    Read the article

  • Pyjamas & JavaScript: Too much recursion

    - by Wraith
    I'm doing a Pyjamas example and get this error: TodoApp InternalError: too much recursion Has anyone else encountered this? Some articles around the web recommend adjusting the C++ code of your browser to fix it, but that doesn't seem safe to me.

    Read the article

  • How can I correct a Text Box Watermark error thrown by javascript on submit

    - by Middletone
    I've got this verry funny javascript error showing up in an aspx page. load page. CLick a link to enable editing (does not do any page validation). Click the Save button (does do validation) The following error occurs. Error: AjaxControlToolkit.TextBoxWatermarkBehavior._originalWebForm_OnSubmit is not a function Source File: http://.../Resources/View.aspx?_TSM_HiddenField_=ctl00_ScriptManager1_HiddenField&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d3.0.30512.18716%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a2a687836-1af9-40c8-ba86-15fd1828383c%3a865923e8%3a91bd373d%3aff62b0be%3a596d588c%3a411fea1c%3ae7c87f07%3abbfda34c%3a30a78ec5%3a42b7c466%3a58ebc1c5%3abc528fec%3a3510d9fc%3a8e72a662%3aacd642d2%3a77c58d20%3a14b56adc%3a269a19ae Line: 10 Can anyone shed some light on this for me please? I've got a search box at the very top of the page with a watermark extender and a second box below that also with a different watermark extender.

    Read the article

  • 400 error when submitting tumblr post (ruby on rails)

    - by Matenia Rossides
    I am having a bit of an issue with getting tumblr working within a rails app. This is the snippet of code which results in a 400 error (meaning that there was an incorrect parameter) @postcontent = @post.content.gsub(/<\/?[^>]*>/, "") post = Tumblr::Post.create(:email => 'valid@email', :password => 'mypassword', :type => 'video', :embed = @post.video_html, :caption = @postcontent) I have checked the API docs and checked my code and code content being rendered, and it still does not want to work. The funny thing is that it worked previously. It was working about a week ago. Has something changed with tumblr?

    Read the article

  • Good error flagging | PHP

    - by Wayne
    For everyone that was thinking of the error_reporting() function, then it isn't, what I need is whenever a MySQL query has been done, and the statement has like if($result) { echo "Yes, it was fine... bla bla"; } else { echo "Obviously, the echo'ing will show in a white page with the text ONLY..."; } Whenever statements have been true or false, I want the error to be appeared when redirected with the header() function and echo the error reporting in a div somewhere on the page. Basically something like this: $error = ''; This part appears inside the div tags <div><?php echo $error; ?></div> So the error part will be echoed when redirected with the header() if($result) { $error = "Yes, it was fine... bla bla"; header("Location: url"); } else { $error = "Something wrong happened..."; header("Location: url"); } But that just doesn't work :(

    Read the article

  • How do you access the Source Error, Source File and Line Number of an exception to use in a custom e

    - by Iain Fraser
    Basically I want to take the following: And make it match the styling of the rest of the application. I am creating a custom error page in my C# based project and I want it to be able to show the same information that is displayed in the ASP.NET default error page. From fiddling with reflector I can see that this is generated through HttpException.GetHtmlErrorMessage() but when I try to use this in my exception it returns null.

    Read the article

  • How to show / debug PEAR::DB errors in webpage?

    - by Markus Ossi
    I am connecting to MySQL database on my webpage and have this copy-pasted code for errors: if(DB::isError($db)) die($db->getMessage()); I have the connection code in an outside file called connection.inc that I include at the beginning of my page before the DOCTYPE and html tags. For debugging purposes, how can I print the database errors on my webpage? I thought I could do something like this: echo 'Could not connect to database. The error was:' . $db->getMessage(); but this returns: Fatal error: Call to undefined method DB_mysql::getMessage()

    Read the article

  • Has the `message-passing/shared-state' dilemma (concurrency & distribution) taken form of a `Holywar

    - by Bubba88
    I'm not too well-informed about the state of the discussion about which model is better, so I would like to ask a pretty straight question: Does it look like two opposing views having really heatened dispute? E.g. like prototype/class based OOP or dynamic vs. static typing (though these are really not much fitting examples, I just do not know how to express my question more clearly)

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >