Posts

Showing posts from February, 2012

ios - how to get NULL from sqlite in xcode -

i want 1 application has sqlite db. in sqlite db exist 5 records record has 2 column. (name,id,key) 1 of id null , want this. (id integer variable) this code when run application crashed. do { sqlite3 *database2; if(sqlite3_open([[self datafilepath] utf8string], &database2) == sqlite_ok) { nsstring *sqlstatement_userinfo2 =[nsstring stringwithformat:@"select * table1 name = %@ , id = %@",p,p2]; sqlite3_stmt *compiledstatement2; if(sqlite3_prepare_v2(database2, [sqlstatement_userinfo2 utf8string], -1, &compiledstatement2, null) == sqlite_ok) { // loop through results , add them feeds array while(sqlite3_step(compiledstatement2) == sqlite_row) { nsmutabledictionary *_datadictionary=[[nsmutabledictionary alloc] init]; // init data dictionary ...

c# - Implicit conversion from type Char[] to string is not possible -

i want following error: implicit conversion type char[] string not possible. string pattern2 = (convert.todatetime(currmail.creationtime).tostring(" dd-mmm-yyyy hh-mm")).toarray(); does have idea on how deal this? remove .toarray() : string pattern2 = convert.todatetime(currmail.creationtime).tostring("dd-mmm-yyyy hh-mm");

php - Get entity by ID from multiple entities in Symfony2 -

suppose have set of entities: $entities = $em->getrepository('mybundle:entity')->findby(array('cat' => 1)); what best way pick single entity out of set id? of course can search loop or array_filter , e.g.: $entity = null; foreach ($entities $_entity) { if ($_entity->getid() == $id) { $entity = $_entity; break; } } but maybe there build in symfony/doctrine method that? hi can use filter method arraycollection class, it's not different looping entities you're doing $idtosearch = $n; $newcollection = $entities->filter( function($entity) use ($idtosearch) { return $entity->getid() == $idtosearch; } );

Common Language Runtime detected error in asp.net mvc views -

visual studio intellisense shows me error "common language runtime detected , invalid program when hover mouse on top of asp.net mvc view. here code of view. @model skillkindleweb.viewmodels.bankdetails.indexviewmodel @{ viewbag.title = "bank details"; layout = "~/views/shared/_trainerlayout.cshtml"; } @html.hidden("listurl", url.action("list","bankdetails")) <div id="content-header"> @html.partial("summarypartial", model.bankdetails) </div> @section scripts { @scripts.render("~/content/scripts/bankdetails") } if ignore , try run program same error. attached stack trace same. i have done failed. thanks in advance. > [invalidprogramexception: common language runtime detected invalid > program.] > system.web.razor.parser.syntaxtree.block..ctor(blockbuilder source) +0 > system.web.razor.parser.syntaxtree.b...

how to solve date matching in php mysql website? -

so here thing dates users select tags this: <select> <?php for($i=date('m'); $i>=0; $i--){ echo "<option>".$i."</option>"; } ?> </select> now give 05 first option 4,3,2,1 next options, want 04,03,02,01 options. how can that? also running sql query deletes rows matching dates. so date selected user comes 2013-5-18 (without zero) date in database 2013-05-18 (with zero), dates don't match , query unable delete row. also can change way date stored in database? i store date 2013-5-18 (without zero) , automatically gets stores 2013-05-18 (with zero). any other thing me match dates can run delete query? try: echo "< option>".sprintf("%02d", $i)."< /option>"; sprintf format number have preceding 0 when required. what you're seeing date('m') returning value 05 first month. when add 1 ( $i++ ) it's being cast integer, next v...

javascript - Is there a good indexing / search engine for Node.js? -

i'm looking open source (with lgpl or permissive license) indexing engine node.js application, lucene. i'm looking in-process indexing , search , not interested in indexing servers sphinx or solr. i not afraid create bindings c/c++ library either i'm open kind of suggestions well. so far i've found node-clucene doesn't seem actively maintained anymore (and has several open issues) i create own binding clucene seems quite sparsely maintained , current version quite behind java lucene apache lucy seems designed purpose of creating bindings dynamic languages, far don't have node bindings (nor c api) , haven't found docs creating bindings. didn't find benchmarks performance. node-search seems abandoned jsii seems still prototype , abandoned fullproof intended run in web broswer lunr.js seems allow serializing whole index, isn't scalable i "roll own", i'd prefer use existing solution. edit: why i'm not inter...

How to get text inside div tag in VB.NET -

i made program notify me if game server offline or online think there's simple version of program. btw. website associated in project http://stats.teamextrememc.com/iframe_status.php it returns n of 150 players, (online)wait, , offline displayed in page , in title. know how title of web document using document.title need number of players(n) not "of 150 players" , want play sound file if server online or offline(if server online, page returns "n of 150 players" (online)wait considered offline) this code: public class form1 private stat string private time integer private doctitle string private onetime boolean = false public sub playsoundfile(byval soundpath string) playsound.soundlocation = soundpath playsound.load() playsound.play() end sub private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load refresher.start() end sub private playsound new system.media.soundplayer private sub timer1_...

drupal - hook_preprocess_page() does not seem to use the suggested template file -

i suggesting template file in hook_preprocess_page() implementation done module, suggested template file doesn't seem used. the template file page--terminal-template.tpl.php, in directory containing module, , implementation of hook_preprocess_page() . function terminal_preprocess_page(&$variables) { if (arg(0) == "terminal") { $variables['theme_hook_suggestions'][] = "page__terminal_template"; } } could please me? preprocess , process functions can implemented modules. in fact, documentation theme() lists them when shows in order functions called. the fact drupal looks suggested template files in theme directory. have these alternatives: put template files module suggesting in directory containing theme used follow reported in load view template on module activation load template files module directory suggest template files want use in preprocess function implemented theme following reported in other question,...

google app engine - The PHP runtime cannot be run with the "Memcache" PECL extension installed -

i'm trying run sample php script on google app engine locally. on installing php sdk on linux google developer docs , skipped installing php since have on ubuntu system installing sudo apt-get install php5 , php 5-* . php-cgi @ /usr/bin/php-cgi python google_appengine/dev_appserver.py --php_executable_path=/usr/bin/php-cgi dropbox/webapps/helloworld/ info 2013-05-18 14:10:06,849 sdk_update_checker.py:244] checking updates sdk. info 2013-05-18 14:10:10,024 sdk_update_checker.py:260] update check failed: http error 404: not found warning 2013-05-18 14:10:10,554 simple_search_stub.py:962] not read search indexes /tmp/appengine.helloworld.epqrs-mango/search_indexes info 2013-05-18 14:10:10,557 api_server.py:153] starting api server at: http://localhost:42925 info 2013-05-18 14:10:10,590 dispatcher.py:164] starting server "default" running at: http://localhost:8080 info 2013-05-18 14:10:10,592 admin_server.py:117] starting admin server at: http:/...

Transform PHP array -

i have php array i'm trying transform different format, way can think lot longer seems should need. example data: array ( [0] => array ( [type] => [value] => 1 ) [1] => array ( [type] => [value] => 2 ) [2] => array ( [type] => [value] => 3 ) [3] => array ( [type] => b [value] => 1 ) [4] => array ( [type] => b [value] => 4 ) [5] => array ( [type] => f [value] => 2 ) ) into: array ( 'a' => array(1,2,3), 'b' => array(1,4), 'f' => array(2) ) foreach ($array $element) $newarray[$element["type"]][] = $element["value"]; seems trick rather nicely.

Selecting A Random Item From An Array iOS -

i'm trying use didfinishpickingmediawithinfo when user have picked photo. when have picked photo, want generate item array uilabel, this: -(void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { nsarray *myarray = [nsarray arraywithobjects:@"test1",@"test2",@"test3",@"test4",@"test5",@"test6", nil]; int numberofobjects = self.yourarrayofstrings.count; nsinteger randomnumberinrange = arc4random() % numberofobjects; nsstring *randomtext = [myarray objectatindex:randomnumberinrange]; self->_label.text = randomtext; } but error: "property 'yourarrayofstrings' not found on object of type 'fdviewcontroller *'" on line: "int numberofobjects = self.yourarrayofstrings.count;". i don't know should replace yourarrayofstrings with. ideas? nsinteger randomnumberinrange = arc4random() % [myarra...

Java generics capture inner class -

i have code: public class undirectedgraphimpl<n> { [...] public iterator<edge<n>> adj(n v) { return new adjiterator(v); } private class adjiterator implements iterator<edge<n>> { [...] } public static void main(string[]args) { graph<integer> g = new undirectedgraphimpl<integer>(); [...] iterator<edge<integer>> = g.adj(4); } } at compile time error: error: incompatible types iterator<edge<integer>> = g.adj(4); ^ required: iterator<edge<integer>> found: iterator<cap#1> cap#1 fresh type-variable: cap#1 extends edge<integer> capture of ? extends edge<integer> if replace line with iterator<edge<integer>> = (iterator<edge<integer>>)g.adj(4); then unchecked cast warning, don't understand why compiler capture "? extend...

Jquery Ui Dialog Does not open -

ive got asp.net page has link opens dialog window "edit appointment", works fine function editappointment(event) { $("#editappointment") .load("/schedule/edit/" + event.id, function() { $("#editappointment").dialog('open'); }); } function loadclient(clientid) { alert('hi'); $("#clienteditform") .load("/client/edit/", function() { $("#clienteditform").dialog('open'); }); } within page "/schedule/edit/" has link open dialog "loadclient" the function called ok, not show dialog window use work older version of jquery ui/jquery, using latest versions!, javascript error uncaught typeerror: object [object object] has no method 'dialog' schedule:346 (anonymous function) schedule:346 b.extend.each jquery.1.9.1....

parsing - trigger.io android 4.0+ not receiving pushing notifications -

i doing testing , realized android 4.0 devices not receiving push notifications. have received them in past , pars shows them being sent out not them. i have older devices android 2.3 getting them fine ios android 4.0+ not seem getting them. thanks. mike. so doing more testing , of sudden notifications started come in on android 4 + devices. now sure if slow network issue or not seems working now.. strange.

java - DatabaseMetaData interface does not work? -

i trying method of interface explained here in this tutorial: here go: databasemetadata dm = con.getmetadata(); system.err.println(dm.supportsresultsettype(resultset.type_scroll_sensitive)); i know supports type_scroll_sensitive type. using , works. method above reported returns false. have ever tried using method? if yes work properly? in advance. ps: same happens other 2 types of resultsets ( type_scroll_insensitive , type_forward_only ). considering type_forward_only default type it's little bit strange false in 3 cases. update: using jdbc-mysql drivers; the implementation in mysql connector/j 5.1.21 is: public boolean supportsresultsettype(int type) throws sqlexception { return (type == resultset.type_scroll_insensitive); } however quick @ rest of implementation suggests mysql supports other types.

JSON, REST, SOAP, WSDL, and SOA: How do they all link together -

currently doing exams , i'm struggling through concepts. these have been 'mentioned' in notes didn't understand how linked together. far understanding is: soa - solution make service consumers/providers communicate. (as far understand umbrella term else) wsdl - language describes provider service. soap - xml protocol 'wrapper' used services send messages. works in conjunction wsdl provide parameters? rest - design pattern similar soap in function avoids xml? (really not sure one) json - alternative xml uses javascript? (not sure 1 either) looking around in internet there doesn't seem clear definition of of these , how interlink. imagine developing web-application , decide decouple functionality presentation of application, because affords greater freedom. you create api , let others implement own front-ends on well. did here implement soa methodology, i.e. using web-services. web services make functional building-blocks acces...

sql - mysql select where in -

i have sub-query works perfectly: select group_concat(zone separator ', ') typeofru id in (5,7) /*this works good*/ the problem have 5 , 7 on varchar column ('5,7') , cannot make works select group_concat(zone separator ', ') typeofru id in ('5,7') /*this not working */ how can cast ('5,7') value type in order make works the final query need use this, not seems work: select name, (select group_concat(zone separator ', ') typeofru id in (typeofru_ids)) deviceru device_id=5 use find_in_set() where find_in_set(id, '5,7') > 0 mysql find_in_set() returns value in range of 1 n if string str in string list strlist consisting of n substrings . string list string composed of substrings separated “,” characters. if first argument constant string , second column of type set, the find_in_set() function optimized use bit arithmetic . returns 0 if str not in strlist or if strlist empty string. ...

php - SQL is only getting 1 row -

i'm making system in php , have code usernames of people liked post using post id , if haven't liked post show button post , if haven't show button says unlike post , if there's no "no 1 has liked post first". when add in, 1 user id though multiple people have liked post, how fixed this, here code: $fancy = $db->fetch("select * " . $prefix . "_fancy post_id = '" . $post_row['id'] . "' order id"); if ($fancy) { $name = $user->name($fancy['account_id']); if ($account['id'] !== $fancy['account_id']) { $fancytext = '<div>'.$name.' post.<!-- begin logged_in --> <a href="./?area=forum&amp;s=topic&amp;t='.$topic_id.'&amp;f='.$pid.'"><img src="./template/default/images/like.png" alt="" border="0"/></a><!-- end logged_in --> </div>'; } else { ...

c# - SyndicationFeed: How to access content:encoded? -

in windows 8 store app i'm reading xml data using syndicationfeed . few items of rss feeds contain example content:encoded (xmlns:content='...') elements. think there's no way content of these elements through syndicationitem?! that's why try inside foreach(syndicationitem item in feeditems) this: item.getxmldocument(feed.sourceformat).selectsinglenode("/item/*:encoded]").innertext; but doesn't work. , i'm note sure how use namespacemanager etc. in winrt. i'm accessing content:encoded via nextsibling method of other element, that's not clean way. so how can access content of element best? <?xml version="1.0" encoding="utf-8" ?> <rss version="2.0" xmlns:content="uri"> <channel> <.../> <item> <title>example entry</title> <description>here text containing interesting description.</description> <link>http://www.wikiped...

c# - Sending data from childwindow to parentwindow -

i did small library homedal have class functions connect,disconnect,add,delete,showbooks etc. manage database. now i'm doing client in wpf. in mainwindow , have variable of class homedal, , have button "add new record". clicking on button opens new window, have textbox es describe new record , button "make". clicking "make" button, close second window. i want use variable homedal in mainwindow run 1 of functions doesn't work, , application crashes. below function have in second window: private void btnokclicked(object sender, routedeventargs e) { mainwindow test = (mainwindow)this.parent; book newbook = new book() { tytul = tbtytul.text, autor = tbautor.text, cena = int32.parse(tbcena.text), przeczytane = tbprzeczytane.text }; test.sqlconn.insertbook(newbook); this.close(); } any tip why program crashes? since have dal layer in application, suggest following ba...

c++ - How to use Boost.Signals2 connect_extended? -

i have working boost.signals2 signal & slot combination in c++ project & set so; //declare signal signals2::signal<void (const en_data_stream, long, double, double, double, double, double)> signal; //connect dataupdate() of candidate instance signal.connect(bind(&candidate::dataupdate, candidateinstance, _1, _2, _3, _4, _5, _6, _7)); //fire signal signal(idatanumber, barnumber(), datetime(), open(), high(), low(), close()); i've been trying take further , use boost.signals2 connect_extended functionality i'd pass details of invoking signal slot slot may disconnect signal @ later time. syntax escaping me. please demonstrate how convert above code uses connect_extended pass connection information slot . p.s. i've been looking @ example provided @ boost website still none wiser how tailor requirements parameters use bind . boost.signals2 connect_extended example thanks the advantage of connect_extended allows slot rec...

Regex in Python for TR -

i wanted scrap website, contents in tr tags under tbody: http://www.cmegroup.com/trading/products/#sortfield=oi&sortasc=false&venues=3&page=1&cleared=1&group=1 under <tbody> tag there many <tr class = "- bandingon"> <tr class = "- bandingoff"> [...] tags i wanted information stored in each table row ( tr class) for have write regex definition tr class: findrows = re.compile('<tr class="-bandingon">(.*)</tr>') findrows = re.compile('<tr class="-bandingoff">(.*)</tr>') is there way combine 2 1 regex? don't use regex. use html parser : from bs4 import beautifulsoup soup = beautifulsoup(html) row in soup.select('tr.bandingon, tr.bandingoff'): print row.get_text() it's cleaner, easier work , more robust regex. also, before resorting scraping, apis. site has json api, easier use: http://www.cmegroup.com/cmews/mv...

How to limit my regex that is detecting too much? -

i have regex attempting detect title & link markup: [title](http://link.com) so far have: (\[)(.*?)(\])(\(((http[s]?)|ftp):\/\/)(.*?)(\)) which detecting when untitled link markup before it [http://google.com] [digg](http://digg.com) [internal page] random other text [digg](http://digg.com) how can limit regex titled link? full php titled & untitled links: // titled links // [digg](http://digg.com) // [google](http://google.com) $text = preg_replace_callback( '/(\[)(.*?)(\])(\(((http[s]?)|ftp):\/\/)(.*?)(\))/', function ($match) { $link = trim($match[7]); $ret = "<a target='_blank' href='" . strtolower($match[5]) . "://" . $link . "'>" . trim($match[2]) . "</a>"; if (strtolower($match[5]) == "http") { $ret .= "<img src='/images/link_http.png' class='link' />";...

Get list of Facebook applications installed and permissions? -

i've looked through documentation in fb graph api , can't find i'm looking for, might not exist, hoping has ideas. i'm looking user permission see facebook applications have installed , (if possible) permissions they've given these apps relates posting on wall. the idea would grant app permission view apps installed , see ones can post on behalf (including visibility), user aware of potentially spammy apps have installed. any ideas? thanks. there's no api tell if user has app (other own) installed, nor can see permissions have been granted app (again, other own) facebook provides functionality you're trying implement in own interface too, here: https://www.facebook.com/settings?tab=applications

php - adding some text into message in mail -

$contactname = $_post['contactname']; $email = $_post['email']; $message = $_post['message']; $subject = 'Ձեզ գրել են ձեր կայքից'; $to = 'stereoshoots@gmail.com'; $headers = "from: ".$email; mail($to,$sub,$message,$headers); i got $contactname (client name). task text : from : $contactname $message (the text client wrote). how should implant name text? you can costumise, below, from contact name in case, $from <?php $to = "someone@example.com"; $subject = "Ձեզ գրել են ձեր կայքից"; $message = "hello! simple email message."; $from = "someonelse@example.com"; $headers = "from:" . $from; if(mail($to,$subject,$message,$headers)){ echo "mail sent.";} else{ echo "mail not sent"; } ?>

javascript - Angular.js and ng-switch-when - emulating enum -

i wanted introduce enum controller logic type safety, example created this: var app = angular.module('myapp', []); var stateenum = object.freeze({"login":1, "logout":2}) function logincheckctrl($scope) { $scope.stateenum = stateenum $scope.logindata = stateenum.login $scope.login = function() { console.log($scope.logindata ? 'logged in' : 'not logged in'); $scope.logindata = stateenum.logout; }; $scope.logout = function() { console.log($scope.logindata ? 'logged in' : 'not logged in'); $scope.logindata = stateenum.login; }; } and in example page have this: <div ng-controller="logincheckctrl"> <div ng-switch on="logindata"> <div ng-switch-when="stateenum.login" ng-include="'login'"></div> <div ng-switch-when="stateenum.logout" ng-include="'logout'...

Why is WCF suddenly requiring DataContractAttributes? -

i built number of wcf services part of application. until recently, of classes used parameters of many operations in service did not had datacontract or datamember attributes applied them. now, i've made few changes in row , of sudden wcf complaining can't serialize classes. does knows if changes in configuration or in servicecontract, operationcontract etc. can cause wcf become picky classes can serialize? i'd rather not need attributes in classes (they should pure c# classes possible). also of note, if return previous version in source control, wcf goes "normal", believe it's not machine/environment thing. the ability create wcf data contracts without use of [datacontract] , [datamember] attributes feature added wcf in .net 3.5 sp1. since works when reverting code previous version, i'm assuming using @ least version. nevertheless, in order classes serializable wcf, class must meet several requirements listed here . main requirem...

javascript - onbeforeunload function empty fields -

i have function save needs called on onbeforeunload event. code: var data = new array(); window.onbeforeunload = save; function save(){ console.log(data); } function update(){ data.push('test'); } setinterval(update, 100); the data array empty when save method gets called. in field lots of 'test' elements. why empty? you need return test anything. function save(){ console.log(data); return "testing console output"; } this working fine me.

Creating Multiple Rectangle Objects at Once (Java) -

first off, clicking :) i'm amateur student coder, , i'm creating (horrible) version of pacman. i'm trying create rectangles each of dots on 1000x650 applet screen, can create if statement when packages hit box touches them, disappear. my problem is, want create class can create rectangles , have 1 if statement, , not 1 each dot rectangle (trying learn efficient :p) if didn't elaborate enough, i'll wary bring edits based on responses, , thanks!!! (edit 1: fixed run on sentence xd) if need fill rectangles on both x , y (matrix), need nested loops. let's consider want 5 * 5 rectangle every 100 pixels in width 50 pixels spacing in height: for(int x = 0;x<1000;x+= 100) { for(int y=0;y<650; y+= 50) { drawrectangle(x, y, 5, 5); // considering drawrectangle(x, y, width, height) } }

javascript - sending $.post to .aspx using jQuery -

i started jquery tutorial made phpacademy on thenewboston youtube channel. reached part have create email validation form but, not using php, using asp.net tutorial. so, thing though did said in tutorial, can't send variable .aspx page using $.post , when want retrieve variable .aspx page, retrieves me entire source code. the source code main page: <input type="text" id="email" /> <span id="emailfeed"></span> javascript file jquery code: function validate_email(email) { $.post('email.aspx', { email: email }, function (data) { $('#emailfeed').text(data); }); } $('#email').focusin(function () { if ($('#email').val() === '') { $('#emailfeed').text('enter email here'); } else { validate_email($('#email').val()); } }).blur(function () { $('#emailfeed').text(...

windows - Can't install psycopg2 -

i'm trying install psycopg2 can use postgresql in python , django. have run multiple errors in last few hours trying install it, , latest 1 can't seem solve. when run setup.py install on psycopg2 in command console attempts install it, gives me error when trying execute link.exe in visual studio 8 folder. doesn't make sense me, considering got executable work when launch windows explorer, , command console. made environment variable it. reason keeps telling me "error: command c:\program files(x86)\microsoft visual studio 9.0\vc\bin\link.exe" failed exit status 1120 i've looked extensively solution have tried didn't work. have suggestions or possible solutions? turns out 3 , half hour process i've been going through unecessary. exe installer of psycopg2 can downloaded here

mysql - How to free memory at end of PHP script to make my database insertion script faster for the next request? -

i have php script reads contents of xml file , creates object using $xml = new simplexmlelement($file_name, 0, true); it converts object workable array , loops through array , saves data database. i've noticed when using script on , on again, thought xml files same size script takes longer , longer. do need free memory, or there practices can when i've reached end of memory intensive script? first thing i'd check database structure. might need drop/add indexes in database tables. stuff slowing down because database slowing down, exposing weak spots in database. you need metric script. echo out time before , after database queries. check how time spent individually , in total , how on lines containing queries. so @ beginning , end of script , before , after query lines , do: echo microtime(), "<br />\n"; if not problem (and surprise me), can check if perhaps storing data (for example) session or so.

MYSQL server ip does not work the same way as localhost -

lets ip of our server 55.555.555.55. lets have mysql user 'user'@'localhost' so then, why return permission error $mysql_server = "55.555.555.55"; $mysql_user = ""; $mysql_password = ""; $mysql_db = ""; $mysqli = new mysqli($mysql_server, $mysql_user, $mysql_password, $mysql_db); if ($mysqli->connect_errno) { printf("connection failed: %s \n", $mysqli->connect_error); exit(); } $mysqli->set_charset("utf8"); but not $mysql_server = "localhost"; $mysql_user = ""; $mysql_password = ""; $mysql_db = ""; $mysqli = new mysqli($mysql_server, $mysql_user, $mysql_password, $mysql_db); if ($mysqli->connect_errno) { printf("connection failed: %s \n", $mysqli->connect_error); exit(); } $mysqli->set_charset("utf8"); isn't 55.555.555.55 , localhost same thing? shouldn't issue. no, localhost treated mysql bypass tcp/ip...

php - Using JavasScript Onclick function to toggle visibility twice -

my code: <div> <a href="/forms/login-form.php" onclick="toggle_visibility('login-div'); return false;">login</a> <div id="login-div"> <?php include($_server['document_root'].'/forms/login-form.php');?> </div> <a href="/forms/signup-form.php" onclick="toggle_visibility('signup-div'); return false;">sign up</a> <div id="signup-div"> <?php include($_server['document_root'].'/forms/signup-form.php');?> </div> <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getelementbyid(id); if(e.style.display == 'block') e.style.display = 'none'; else ...

php - jquery tooltip not working afer load ajax content -

i use tooltip script showen here: http://www.htmldrive.net/items/show/681/jquery-and-css3-simple-tooltip.html this use, same few changes: $(document).ready(function() { $("body").on("mouseover", ".tip_trigger", function(){ tip = $(this).find('.tip'); $(".tip").html('loding...'); tip.show(); //show tooltip }, function() { tip.hide(); //hide tooltip }).mousemove(function(e) { var mousex = e.pagex; //get x coodrinates var mousey = e.pagey; //get y coordinates var tipwidth = tip.width(); //find width of tooltip var tipheight = tip.height(); //find height of tooltip var x = $('.tip_trigger').offset().left; var y = $('.tip_trigger').offset().top; mousex = e.pagex - x+180; mousey = e.pagey - y+105; tip.css({ top: mousey, left: mousex }); ...

dart - Rikulo stream base folder -

is possible choose serve files specific folder using rikulo stream? i've tried new streamserver(urimapping: _mapping, homedir: 'my/web/webapp/app') but i'm not getting desired results it's still serving files under 'web' directory. when homedir specified relative path, assumed relative current directory (directory.current.path). think not expect. can use absolute path better control. after examining code, think relative path better base on root directory rather current directory. please follow issue 29 details. refer sample app here .

php - select duplicate records where one record must contain the exact value -

i have table below 3 columns amount, frequency & identifier. these records in same table in same database. amount frequency identifier 4.75 1 100 4.75 3 101 4.76 2 102 4.76 3 103 4.44 1 104 4.43 1 105 4.75 2 106 4.67 2 107 4.75 3 108 4.64 2 109 4.64 3 110 4.65 4 111 i'm after sql query should pickup duplicate records different frequency frequency of 1 of them must equal 1. output i'm expecting amount frequency identifier 4.75 1 100 4.75 3 101 4.75 2 106 4.75 3 108 note query executed every 2 seconds along 15 other queries lightweight. can processing in php too, prefer database query long not performance intensive. i'm trying different ...

java - readline() doesn't read from socket -

s = new socket(inetaddress.getbyname(address), port); thread.sleep(250); dataoutputstream outtoserver = new dataoutputstream(s.getoutputstream()); bufferedreader infromserver = new bufferedreader(new inputstreamreader(s.getinputstream())); outtoserver.writebytes("my_query"); string rs = infromserver.readline(); s.close(); nothing happens, if use .read() receive first character of string. i don't know message lenght i'll receive, in python use: sock.recv(1024) 1024 max lenght can receive. is there way same thing in java? according javadoc of readline(): reads line of text. line considered terminated 1 of line feed ('\n'), carriage return ('\r'), or carriage return followed linefeed. make sure string has correct structure.

c++ - "Unresolved external symbol" errors when creating a Qt GUI application with Visual Studio 2010 -

i trying make simple gui application, on top of c++ code wrote. problem simplifed following: #include <qtgui\qdialog> void setup(int argc, char **argv) { qdialog dlg; } int main(int argc, char **argv) { setup(argc, argv); } i configured qt library, , pretty sure libraries compatible visual studio 2010 (other projects worked fine), don't know if should create header file. receiving these errors: >main.obj : error lnk2001: unresolved external symbol "public: virtual __thiscall qdialog::~qdialog(void)" (??1qdialog@@uae@xz) 1>main.obj : error lnk2001: unresolved external symbol "public: __thiscall qdialog::qdialog(class qwid................. the errors got signals vs compiler cannot determine addresses of invocation external functions you've used, namely ctor , dtor qdialog class object. avoid such errors should specify location of libraries containing definitions of functions. in order achieve should use "project propertie...

CSS & HTML Square Background -

can guide me, how can create 'almost' square background in css? i want brown background , have text on error bullets , how create dotted yellow on top right in css? my working progress here: html: <body> <div id="contentcontainer"> <div id="setbackground"> <div id="header"> <span class="style1">this logo </span> <hr /> <div id="body_block"> <p class="intro">introduction</p> <h1> </h1> click here <h2> next </h2> click here <p>more web design:</p> <p>• bla bla bla... .</p> <p>contact:</p> <p>• bla bla bla...</p> <div id=...

javascript - imacros firefox use csv file to enter keywords into search box and extract results -

i'm using imacros free plugin firefox scrape data javascript search form on website. here breakdown of macro far. this portion of macro below automatically enters keyword "superman" search form. version build=8300326 recorder=fx tab t=1 url goto=http://www.example.com/pricelist frame f=1 tag pos=1 type=input:text form=action:/pricelistsearchform/ attr=id:keyphrase content=superman tag pos=1 type=input:submit form=action:/pricelistsearchform attr=name:searchbarcode&&value:get<sp>value a list of results loads , use following code loop through each of results , extract results: set !loop 3 tag xpath=id('searchform')/form/fieldset/table/tbody/tr[{{!loop}}]/td[1]/a tag xpath=id('results')/table/tbody/tr[2]/td[2] extract=txt tag xpath=id('results')/table/tbody/tr[2]/td[4] extract=txt i amend code use csv file automatically enter names search field 1 @ time , loop through , extract results normal. for example if have csv fi...

r - Error bars on stacked bar ggplot2 -

Image
i'm struggling put error bars correct place on stacked bar. read on earlier post used ddply in order stack error bars. changed order of stacking ordered factor. appears error bars correct on 1 set of bars not other. want graph looks below, standard error shown error bars. i'm listing dput of original data , ddply data data set. suz2$org <- factor(suz2$org, levels = c('fungi','bacteria'),ordered = true) library(plyr) plydat <- ddply(suz2,.(org, group, time),transform,ybegin = copy - se,yend = copy + se) colvec <-c("blue", "orange") ggplot(plydat, aes(time, copy)) + geom_bar(aes(fill = factor(org)), stat="identity", width = 0.7) + scale_fill_manual(values = colvec) + facet_wrap(~group,nrow = 1)+ geom_errorbar(aes(ymax=ybegin , ymin= yend ),width=.5) + theme(panel.background = element_rect(fill='white', colour='white'), panel.grid = element_line(color = na), panel.gr...

python - ImproperlyConfigured: Error loading MySQLdb module pycharm -

i'm getting error when trying launch project, think there mismatch in architecture of mysql python version? can't point out wrong, , how fix it. thank you improperlyconfigured: error loading mysqldb module: dlopen(/library/python/2.7/site-packages/mysql_python-1.2.4b4-py2.7-macosx-10.8-intel.egg/_mysql.so, 2): no suitable image found. did find: /library/python/2.7/site-packages/mysql_python-1.2.4b4-py2.7-macosx-10.8-intel.egg/_mysql.so: mach-o, wrong architecture process finished exit code 1 in pycharm, make sure point correct path mysql. if it's running in console not in pycharm; check environment variables. on top navigation, next green arrow, click on arrow pointing down / edit configuration in env variables add path mysql. in case: dyld_library_path ||| /usr/local/mysql/lib/ for mac users similar issues, tutorial great: http://gpiot.com/mac-os-x-lion-the-perfect-setup-for-python-django/

ios - How can i make clickable uiimage? -

i have 1 menubar uiimage. want make 5 menu on menubar clickable , link view. can tell me way can that? found people using uibutton on uiimage, fine me , how can separate menu bar 5 pieces. thanks both rmaddy , brent royal-gordon i decided use uiimage menubar background , add uibutton on it. try thing this: nsurl *url = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"movie" oftype:@"mp4"]]; mpmovieplayercontroller *movieplayer = [[mpmovieplayercontroller alloc] initwithcontenturl:url]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackdidfinish:) name:mpmovieplayerplaybackdidfinishnotification object:movieplayer]; movieplayer.controlstyle = mpmoviecontrolstylenone; movieplayer.repeatmode = mpmovierepeatmodeone; movieplayer.shouldautoplay =...

iphone - How do I utilize CoreData when moving from collection view to detail view -

i have ios app using restkit pull json formatted data server coredata entity. of attributes of entity populate collection view image , title each cell. i attempting move collection view detail view when cell selected. there "summary" attribute of coredata entity display in detail view along image. i know can pass data thru prepareforsegue method. i not sure how specify image , summary data want pass . maybe passing image , summary not proper way? should passing managedobjectcontext detail view controller , fetching results there? here how collectionview populated. - (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; mynewscollectionviewcell *cell = (mynewscollectionviewcell *)[collectionview dequeuereusablecellwithreuseidentifier:cellidentifier forindexpath:indexpath]; nsmanagedobject *object = [self.fetchedresultscontroller obje...

Conditional loop in python -

list=['a','a','x','c','e','e','f','f','f'] i=0 count = 0 while count < len(list)-2: if list[i] == list[i+1]: if list [i+1] != list [i+2]: print list[i] i+=1 count +=1 else:print "no" else: +=1 count += 1 i'm getting: else:print "no" ^ indentationerror: unexpected indent i'm trying print elts match following element, not element following that. i'm new python, , i'm not sure why isn't working. here fixed-up code (added count += 1 after else-clause make sure terminates): list=['a','a','x','c','e','e','f','f','f'] i=0 count = 0 while count < len(list)-2: if list[i] == list[i+1]: if list [i+1] != list [i+2]: print list[i] i+=1 count +=1 ...

Using Linux Grep command - need output to text file, cleaner output -

when using grep command find search string in set of files, there way dump results text file? there switch grep command provides cleaner results better readability, such line feed between each entry? perhaps there grep script outputs cleaner results thanks grep -n "your search string" * > output-file the -n print line number , > redirect grep-results output-file. if want "clean" results can filter them using pipe | example: grep -n "test" * | grep -v "mytest" > output-file match lines have string "test" except lines match string "mytest" (that's switch -v ) - , redirect result output file. a few grep-tips can found on post

ms access - Using DatePart() with date ranges crossing the datepart boundary -

i trying summarise data tables report. each record in table consists of date range, this: startdate enddate -------------------- 13/04/13 15/04/13 17/04/13 24/04/13 28/04/13 03/05/13 05/05/13 10/05/13 assuming date ranges signify days of leave, want able calculate total amount of days of leave per month. came across datepart function seems work apart 1 edge case: when date range crosses month boundary. since datepart function returns month 1 given date, no longer able use determine amount of days of leave edge case record (in example above record 3), since applies 2 separate months. ideally want final table like: month #ofdays -------------------- 4 11 (1st record - 2, 2nd record - 7, 3rd record - 2) 5 8 (3rd record - 3, 4th record - 5) i've considered messy options, such populating temporary table having each record signifying different day , doing query on that, not sure how ties in rep...

syntactic sugar - C/C++: Is there a specific reason why "void" was not simply defined as "typedef struct{} void" (i.e. an empty struct) with appropriate casting rules? -

as aside: such standard typedef have reduce number of reserved words in c/c++, , relegated void simple type declaration, e.g. in <stddef.h> . (c.f. srb in ab33/mar 1972 - pdf=7kb) that's pretty speculative. 1 reason because void not empty value; it's absence of value. instance, function signature of int f(void) takes 0 arguments, not one.

css - Difference between -moz-linear-gradient and -webkit-gradient -

what basic difference between -moz-linear-gradient , -webkit-gradient. know changes in parameters , -moz meant mozilla. why have different css property mozilla. webkit represents here ? most often, though, extensions used release , test browser features have been developed in preparation of w3c drafts have not yet reached candidate recommendation status—the extensions allow these new properties tested before become available standard css properties. http://reference.sitepoint.com/css/vendorspecific some of these properties have been included in draft css specification inclusion in final recommendation, still experimental. final standard property may different current prefix implementation. https://developer.mozilla.org/en-us/docs/web/css/reference/mozilla_extensions

sending email using templates in codeigniter -

i have send weekly reports users. using email template view. code in controller function sendweeklymail(){ if(!$this->session->userdata('some')) redirect('admin/admin','refresh'); $data=$this->admin_model->getuserdata(); foreach($data $u){ $this->email->clear(); $this->email->to($u->email); $this->email->from('your@example.com'); $this->email->subject('here info '.$name); $this->email->message('email/report',$data,'true'); $this->email->send(); } } } my question how send data can show user data in body of message. codeigniter takes data $data['user_data'] hi have following step send email using templates $data['name'] = "mike"; $data['email'] = 'mike@hissite.com'; $data['message_body'] = "any message body want send"; $mes...

mysql - can jsf/primefaces application be hosted out of AWS -

is possible use aws services host application build in following technologies jsf2/primefaces3 tomcat 6 mysql 5 apart these need email services, blog etc conventional java based package possible in aws. presently using 1 of hosting provider , domain registered them how can point domain point aws hosted website. possible i can answer of questions. yes it's possible host app technologies on aws. can host application on aws server, it's other server must configure yourself, unless using customized ami. i wouldn't recommend using aws send out email however, in experience, lot of spammers have abused aws system, if sending out email newsletters/etc... aws server, may treated more strictly other email server spam filters. it's best use third party solution sending out bulk email. as last question: "how can point domain point aws hosted website", way complicated answer here. suggest hiring experienced dns manage transition. recommend move d...

linux - Python program eating up RAM -

i wrote small program collect data on serial port using minimalmodbus. data dumped csv file. have read several posts on , other places. few things mentioned are: using lazy evaluation wherever possible (xrange instead of range) deleting large unused objects use child processes , upon death memory released os the script on github here . use script periodically upload these files server. both these scripts trivial. nothing else running on system, feel withing these 2 systems memory hogging taking place. best way tackle issue. not willing adopt subprocess route. some more information: data collection on raspberry pi (512 mb ram) python version: 2.7 it takes 3-4 days ram used after raspberrypi freezes i followed this guide find out top 20 programs eating ram. $ ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 20 12434 2.2 python 12338 1.2 python 2578 0.8 /usr/sbin/console-kit-daemon 30259 0.7 sshd: 30283 0.7 -bash 1772 0.6 /usr/sbin/rsyslogd 2645 ...