Search Results

Search found 36 results on 2 pages for 'spawncxy'.

Page 1/2 | 1 2  | Next Page >

  • List of common ways those could shut down server unexpectedly ?

    - by SpawnCxy
    After running a bash fork bomb which made my webserver down, I think I should be more careful even not under root.I thought it would be totally fine while I'm not under root.So I ignored the warning and ran the bash fork bomb which is :() { :|:& }; : .(Please don't run it if u don't understand this code cuz it will make you system down).And I think I need a list of common ways those could cause a sever shutting down unexpectly even not under root. Any suggestion would be appreciated. Regards `

    Read the article

  • Problem with using APACHE-POI to convert PPT to Image

    - by SpawnCxy
    Hi all, I got a problem when I try to use Apache POI project to convert my PPT to Images.My code as follows: FileInputStream is = new FileInputStream("test.ppt"); SlideShow ppt = new SlideShow(is); is.close(); Dimension pgsize = ppt.getPageSize(); Slide[] slide = ppt.getSlides(); for (int i = 0; i < slide.length; i++) { BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); //clear the drawing area graphics.setPaint(Color.white); graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height)); //render slide[i].draw(graphics); //save the output FileOutputStream out = new FileOutputStream("slide-" + (i+1) + ".png"); javax.imageio.ImageIO.write(img, "png", out); out.close(); It works fine except that all Chinese words are converted to some squares.The png image I got is like following image: Then how can I fix this?Thanks in advance!

    Read the article

  • Start Python from Twisted

    - by SpawnCxy
    Hi all, I have learnt Python for about a month as a one year's PHPer.And I started from Twisted as I'm working in a corporation supplying webservice.I have finished some simple application such as data transferring service,page images-fetch service etc.But the problem is ,I don't understand the struture of codes I wrote in the programs quite well .Every time I have to write codes by watching an example.And my question is ,should I just try to remember the example code's strutures?Or try to understand them?Suggestions would be very appreciated. Regards

    Read the article

  • Which PHP version is required for str_split?

    - by SpawnCxy
    I relogin to my server in dreamhost and test some scripts.And I found I couldn't use str_split. Message of Undefined function was given.I checked the version in the server and its PHP Version is 5.2.12.And I just wonder which version is required?Thanks. Testcode: <?php $arr = str_split("lsdjflsdjflsdjflsdjfl"); print_r($arr); ?> Message: Fatal error: Call to undefined function: str_split() in /test.php on line 3

    Read the article

  • A question about the order of pagination

    - by SpawnCxy
    Currently I'm deal with a history message page using Cakephp.And I got a problem about records' order.In the controller,codes about pagination as follows $this->paginate['Msg'] = array('order'=>'Msg.created desc'); $msgs = $this->paginate('Msg'); $this->set('historymsgs',$msgs); Then I got a page of messges like this: tom:I'm eighteen. Jerry:How old are you? tom:Tom. Jerry:what's your name? tom:Hi nice to meet you too! Jerry:Hello,nice to meet you! But what I need is the reversed order of the messages.How can I append a condition of Msg.created asc here? Thanks in advance.

    Read the article

  • How can I control the action of onbeforeunload in IE?

    - by SpawnCxy
    Hi all I've got a problem about onbeforeunload recently that I need to pop up a voting page if the user try closes their IE browser.And I did it by using <body onbeforeunload="makevote()"> And the main structure of makevote() in javascript as follows: function makevote() { comet.distruct(); if(csid != null && isvote == null) { window.event.returnValue = false window.event.returnValue='press “cancel” to vote please!' showComDiv(popvote,"popiframe",400,120,'your vote here','dovote()'); } } For last three months this voting function performed so ugly that I got only less than 8,000 votes from more than 4,50,000 vistors.I think the problem is, when the users try to close their browsers,the onbeforeunload property pops up a comfirm box which covered my voting box while most users click the OK button,which means close comfirming is done,as a habit.So my question is how can I control the comfirming box made by onbeforeunload myself? So far I can only define the message it shows.For example if I click the "OK" ,I'll go to the voting box instead of closing my IE.And if there's any other better way to do this?Help would be greatly appreciated! Regards

    Read the article

  • Question about eval in PHP 5

    - by SpawnCxy
    Hi all, I have been doing PHP stuff for almost one year and I have never used the function eval() though I know the usage of it. But I found many questions about it in SO.So can someone show me a simple example in which it's necessary to use eval()?And is it a good or bad practice?

    Read the article

  • How to convert Word to images with win32com in python?

    - by SpawnCxy
    Hi all, I have googled an example for converting Word to Html. import win32com from win32com.client import Dispatch, constants w = win32com.client.Dispatch('Word.Application') w = win32com.client.DispatchEx('Word.Application') '''skip some code here''' wc = win32com.client.constants w.ActiveDocument.SaveAs( FileName = filenameout, FileFormat = wc.wdFormatHTML ) I tried looking for something like wc.wdFormatPNG as wc.wdFormatHTML in the example but failed.And I wonder does the attribute exist?Or any other better solutions?Suggestions would be appreciated.

    Read the article

  • List of common ways those could shut down server unexpectedly ?

    - by SpawnCxy
    After running a bash fork bomb which made my webserver down, I think I should be more careful even not under root.I thought it would be totally fine while I'm not under root.So I ignored the warning and ran the bash fork bomb which is :() { :|:& }; : .(Please don't run it if u don't understand this code cuz it will make you system down).And I think I need a list of common ways those could cause a sever shutting down unexpectly even not under root. Any suggestion would be appreciated. Regards `

    Read the article

  • A problem about in_array

    - by SpawnCxy
    Hi all, I have got a strange problem about in_array recently which I cannot understand. e.g. $a = array('a','b','c'); $b = array(1,2,3); if (in_array(0,$a)) { echo "a bingo!\n"; } else { echo "a miss!\n"; } if (in_array(0,$b)) { echo "b bingo!\n"; } else { echo "b miss!\n"; } I ran it on my lamp,and got a bingo! b miss! I read the manual and set the third parament $strict as true,then it worked as expected.But does that mean I always need to set the strict parament as true when using in_array?Suggestions would be appreciated. Regards

    Read the article

  • How to make the Rounded corners of the client app in WindowedApplication?

    - by SpawnCxy
    Hi all In my application,showFlexChrome is set as true in WindowedApplication,and the *-app.xml is setted as follows <systemChrome>none</systemChrome> <transparent>true</transparent> <visible>true</visible> I know how to make the top border rounded corners with follow codes: borderStyle="solid" cornerRadius="8" But I cannot find a method to make the bottom border of my app window rounded-corner. Suggestions would be appreciated! Regards

    Read the article

  • Connect to Mongodb in python

    - by SpawnCxy
    I'm a little confused by the document when I tried to connect to the Mongodb.And I find it's different from mysql.I want to create a new database named "mydb" and insert some posts into it.The follows is what I'm trying. from pymongo.connection import Connection import datetime host = 'localhost' port = 27017 user = 'ucenter' passwd = '123' connection = Connection(host,port) db = connection['mydb'] post = {'author':'mike', 'text':'my first blog post!', 'tags':['mongodb','python','pymongo'], 'date':datetime.datetime.utcnow()} posts = db.posts posts.insert(post) #print str(db.collection_names()) And I got an error as pymongo.errors.OperationFailure: database error: unauthorized.How can I do the authorizing part?Thanks.

    Read the article

  • select SUM in Cake

    - by SpawnCxy
    When I tried using follow code to get the sum of the column named Serviceinfo.services $conditions = array('fields'=>array('SUM(Serviceinfo.services) as servicecount'),'conditions'=>array('time_id BETWEEN ? AND ?'=>array($startid,$endtid))); $services = $this->Serviceinfo->find('all',$conditions); I had to fetch the sum data with services[0][0]['servicecount'] which seems a little weird.And What I expect is services['Serviceinfo']['servicecount'],or more simple one.Then how can I fix this?Thanks in advance!

    Read the article

  • Getting relative path from absolute path in PHP

    - by SpawnCxy
    I noticed that there're some similar questions about this problem when I typed the title,but they seem not be in PHP.So what's the solution to it with a PHP function? To be specified. $a="/home/apache/a/a.php"; $b="/home/root/b/b.php"; $relpath = getRelativePath($a,$b);//needed function,should return '../../root/b/b.php' Any good ideas?Thanks.

    Read the article

  • Help for server down.

    - by SpawnCxy
    Hi all, I wonder what the follow command does,but I was warned not to run it if I'm not an expert.But I have run it,and my Linux down. :() { :|:& }; : What does the code exactly do?Hope someone give an explaintion of it.And what should I do now? Thanks.

    Read the article

  • How to open new explorer when clicking links in webpages loaded by app of Flex/Air?

    - by SpawnCxy
    In my application I tried using following codes to do this: <mx:HTML x="0" y="0" width="100%" height="100%" location=“http://www.example.com”/> The page is loaded fine.But when I click the links I found sometimes there was no any response while I need a new explore window opened with the linking url.And also I tried: <mx:Script> <![CDATA[ private function init():void { var req:URLRequest = new URLRequest("http://www.baidu.com"); var a:HTMLLoader = new HTMLLoader(); a.width = 400; a.height = 300; a.load(req); htmlmc.addChild(a); } ]]> </mx:Script> <mx:HTML x="10" y="10" width="345" height="258" id="htmlmc"/> But still got nothing.Any good ideas? Thanks in advance!

    Read the article

  • Customize the datetime format in Cakephp

    - by SpawnCxy
    When I use the form helper to make a time input,usaually I write code as follows <?php $options = array( 'label' => '', 'type' => 'datetime', 'timeFormat'=>'24', 'separator'=>'-' ); echo $form->input('Service.endtime',$options); ?> But now I get a problem that I want to make a time input style such as month-day-hour Then how can do this with setting some parameters in the helper?Suggestions would be appreciated.

    Read the article

  • How to control a subthread process in python?

    - by SpawnCxy
    Code first: '''this is main structure of my program''' from twisted.web import http from twisted.protocols import basic import threading threadstop = False #thread trigger,to be done class MyThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.start() def run(self): while True: if threadstop: return dosomething() '''def some function''' if __name__ == '__main__': from twisted.internet import reactor t = MyThread() reactor.listenTCP(serverport,myHttpFactory()) reactor.run() As my first multithread program,I feel happy that it works as expected.But now I find I cannot control it.If I run it on front,Control+C can only stop the main process,and I can still find it in processlist;if I run it in background,I have to use kill -9 pid to stop it.And I wonder if there's a way to control the subthread process by a trigger variale,or a better way to stop the whole process other than kill -9.Thanks.

    Read the article

  • Can this be done by sed?

    - by SpawnCxy
    Hiall,I need to deal with a file which seems as follows: 1234 4343 5345345 53453 4343 And what I want to do is to execute follow command to the number of each line: grep $num1 ./somepath #get num1_res Then write $num1 and $num1_res to another file which will be: 1234 32 4343 234 5345345 349 53453 78 #...etc Any good solution by sed?Or some other simple way? Thanks.

    Read the article

  • some confusions to singleton pattern in PHP

    - by SpawnCxy
    Hi all, In my team I've been told to write resource class like this style: class MemcacheService { private static $instance = null; private function __construct() { } public static function getInstance($fortest = false) { if (self::$instance == null) { self::$instance = new Memcached(); if ($fortest) { self::$instance->addServer(MEMTEST_HOST, MEMTEST_PORT); } else { self::$instance->addServer(MEM_HOST, MEM_PORT); } } return self::$instance; } } But I think in PHP resource handles will be released and initialized again every time after a request over. That means MemcacheService::getInstance() is totally equal new Memcached() which cannot be called singleton pattern at all. Please correct me if I'm wrong. Regards

    Read the article

  • How does the bitwise operator '^' work?

    - by SpawnCxy
    I'm a little confused when I see the output of following code: $x = "a"; $y = "b"; $x ^= $y; $y ^= $x; $x ^= $y; echo $x; //got b echo $y; //got a And I wonder how does the operator ^ work here?Explanations with clarity would be greatly appreciated!

    Read the article

  • Problem with regular expression for some special parttern.

    - by SpawnCxy
    Hi all, I got a problem when I tried to find some characters with following code: preg_match_all('/[\w\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A]/',$str,$match); //line 5 print_r($match); And I got error as below: Warning: preg_match_all() [function.preg-match-all]: Compilation failed: PCRE does not support \L, \l, \N, \U, or \u at offset 4 in E:\mycake\app\webroot\re.php on line 5 I'm not so familiar with reg expression and have no idea about this error.How can I fix this?Thanks.

    Read the article

1 2  | Next Page >