Posts

Showing posts from June, 2010

PHP and SQL maths -

this part of php , sql totally new me need use maths update table. i have table avis_credits 1 row in table the table deducts credits user uses system qty_credits, want able add additional credits account per example: client has 10 credits left purchases 100 credits system must take current credits , add 100 giving me 110 credits. doing manual adding side , updating table expresion. "update avis_credits set credits='$qty_credit'"; what system looks current credits , adds new credits row. i have tried "update avis_credits set credits='<?php echo qty_credit?> + $qty_credit'"; but not working @ all. because trying many functions in 1 string? or because maths equation wrong have no idea how write it? on first query you're not doing math purely changing value of variable: "update avis_credits set credits='$qty_credit'"; so credits becomes value of $qty_credit . on second query <?php echo ...

iphone - iOS Nested Context slower on Device -

Image
i'm trying move 1 nsmanagedcontext multiple via nested context. i'm using article me : http://www.cocoanetics.com/2012/07/multi-context-coredata/ http://floriankugler.com/blog/2013/4/2/the-concurrent-core-data-stack actual system [myhttpclient getpath:path parameters:@{access_token & stuff} success:^(afhttprequestoperation *operation, id responseobject) { (nsdictionary *dictionary in responseobject) { // filling dic in nsmanagedobject } [mymaincontext save:&error]; }, failure:failureblock]; wanted system [myhttpclient getpath:path parameters:@{access_token & stuff} success:^(afhttprequestoperation *operation, id responseobject) { __block nsmanagedobjectcontext *managedobjectcontext = [(appdelegate *)[[uiapplication sharedapplication] delegate] managedobjectcontext]; __block nsmanagedobjectcontext *writerobjectcontext = [(appdelegate *)[[uiapplication sharedapplication] delegate] writermanagedobjectcontext];...

ios - Push view of storyboard in accessorybutton tapped -

Image
i have storyboard named "mainstoryboard_iphone.storyboard" , has 2 views. first view has table cell disclosure button. can drag drop table cell other view , show view, need programmatically when user click on accessory button without using segue. name of 2 views rootviewcontroller , providerlookupviewcontroller. have tried code doesnt work, throws error when click on accessory button on cell. commented lines other things tried -(void)tableview:(uitableview *)tableview accessorybuttontappedforrowwithindexpath:(nsindexpath *)indexpath { uistoryboard* sb = [uistoryboard storyboardwithname:@"mainstoryboard_iphone" bundle:nil]; // providerlookupviewcontroller* vc = [sb instantiateviewcontrollerwithidentifier:@"providerlookupviewcontroller"]; uiviewcontroller* vc = [sb instantiateviewcontrollerwithidentifier:@"providerlookupviewcontroller"]; [self presentmodalviewcontroller:vc ani...

gwt - Menu or MenuButton with separate click handler -

i'm looking widget this. http://ppt.cc/rpfl clicking "view" , triangle (drop down icon) need perform 2 different functions. clicking triangle opening menu. i tried creating 2 buttons emulate, 2 buttons have space in between them. how can eliminate space between buttons or, there convenient way accomplish this? thank all!! an iconmenubutton (which sub class of iconbutton ) provide need. menu menu = new menu(); menuitem newitem = new menuitem("new"); menuitem openitem = new menuitem("open"); menuitem saveitem = new menuitem("save"); menuitem saveasitem = new menuitem("save as"); menu.setitems(newitem, openitem, saveitem, saveasitem); iconmenubutton menubutton = new iconmenubutton("view", menu); also check smartgwt samples i've given in comment , ribbonbar sample .

mysql - Regrouping Multiple rows into one -

Image
let's have table using query i'm working on query can give here's i've tried far : select [first name], [last name], club, case when competition='la liga' wins end [la liga], case when competition='copa del rey' wins end [copa del rey], case when competition='supercopa de espana' wins end [supercopa de espana], case when competition='uefa champions league' wins end [uefa champions league], case when competition='uefa super cup' wins end [uefa super cup], case when competition='fifa club world cup' wins end [uefa super cup] dbo.table group [first name], [last name], club but i'm getting 'sql execution error' column 'dbo.wins' invalid in select list because not contained in either aggregate function or group clause. column 'dbo.competition' invalid in select list because not contained in either aggregate function or group clause. putting columns 'wins' , '...

regex - Inserting text below and above a matched pattern -

first of all, such wonderful community have!! have been benefited great knowledge shared here on stackoverflow. coming problem facing: i have bunch of files(about 200) in files wanted search pattern(multi-line) , if pattern matches, want add text above , below pattern. e.g file1.cpp #ifndef file1_h #define file1_h #ifndef parent1_h #include "parent1.h" #endif #ifndef sibling_h #include "sibling.h" #endif #ifndef parent2_h #include "parent2.h" #endif class file1 { }; #endif in file wanted add #ifndef noparent above #ifndef parent1_h , #endif below #endif right below parent1.h . i want same thing #ifndef parent2_h so output like: #ifndef file1_h #define file1_h #ifndef noparent #ifndef parent1_h #include "parent1.h" #endif #endif #ifndef sibling_h #include "sibling.h" #endif #ifndef noparent #ifndef parent2_h #include "parent2.h" #endif #endif class file1 { }; #endif i have list of ...

How do you access an Amazon SNS post body with Express / Node.js -

i'm in process of rebuilding php app in node.js on top of express framework. one part of application callback url amazon sns notification posted to. the post body sns read in following way in php (which works): $notification = json_decode(file_get_contents('php://input')); in express have tried following: app.post('/notification/url', function(req, res) { console.log(req.body); }); however, watching console, logs following when post made: {} so, repeat question: how access amazon sns post body express / node.js another approach fix content-type header. here middleware code this: exports.overridecontenttype = function(){ return function(req, res, next) { if (req.headers['x-amz-sns-message-type']) { req.headers['content-type'] = 'application/json;charset=utf-8'; } next(); }; } this assumes there file called util.js located in root project directory with: util = require('./...

multithreading - c# entity framework with threading -

i have run once off c# calculation on millions of rows of data , save results in table. haven't worked threading in c# in couple of years. i'm using .net v4.5 , ef v5. the original code along lines of: public static void main() { stopwatch sw = new stopwatch(); sw.start(); entities db = new entities(); docalc(db.clients.tolist()); sw.stop(); console.writeline(sw.elapsed); } private static void docalc(list<client> clients) { entities db = new entities(); foreach(var c in clients) { var transactions = db.gettransactions(c); var result = calulate(transactions); //the actual calc db.results.add(result); db.savechanges(); } } here attempt @ multi-threading: private static int numberofthreads = 15; public static void main() { stopwatch sw = new stopwatch(); sw.start(); entities db = new entities(); var splitupclients = splitupclients(db.clients()); task[] alltasks = new t...

Vim Taglist Yellow Highlight on Tags -

i have installed tag list plugin. working fine except when, tag list window, try press enter corresponding tag becomes yellow colored , hence not see anymore searched for. how change color more visible one? also searched tag position not fixed, not come in alignment tag in tag list window, there way solve this? the line trying copy/paste in .vimrc is highlight search ctermfg=red ctermbg=none cterm=bold,underline thanks in advance. to answer second question alignment, taglist afaik not supposed there's nothing "solve". if want feature, send feature request author.

operator overloading "+" & "++" in C# -

public class encryptval { private encryptval(t value) { set( value ); } // encrypt public bool set(t value) {} // decrypt & return (t)value; public t get() {} public static implicit operator encryptval<t>(t value) { //shuffle bits return new encryptval<t>(value); } public static implicit operator t(encryptval<t> value) { //unshuffle bits return value.get(); ///// error ... } } i couldnt overload + operator & ++ operator. how can this? usage: encryptval<int> e = 42; encryptval<int> f = 1; console.writeline("decrypt int count \t= {0:d}", f.get()); // ok console.writeline("decrypt int count \t= {0:d}", f); // error console.writeline("decrypt int count \t= {0:d}", e); //how? to overload + or ++ add + / ++ operators want... public static encryptval<t> operator ++(encryptval<t> value) { throw new notimplementedexception(); // implem...

iOS twitter checking if accounts are available -

am developing app (ios5+) posting on twitter. check if system has twitter account configured, may log in through twitter if account available otherwise presented webview log in (using unofficial-twitter-sdk) or sent settings add twitter account system (but don't way since cannot user app). the problem approach on simulator can check how many accounts there using acaccounttype *twitteraccounttype = [_accountstore accounttypewithaccounttypeidentifier:acaccounttypeidentifiertwitter]; // list of twitter accounts , checks nsarray *accountsarray = [_accountstore accountswithaccounttype:twitteraccounttype]; while same code not work on real devices, reporting array empty (since returns accounts gave permission app use twitter). the second approach using completion handler of -acaccountstore requestaccesstoaccountswithtype:withcompletionhandler: method, in particular // can user twitter ios accounts, use custom view post content [_accountstore requestaccesstoaccountswithtype:t...

asp.net - Predefine entity values on creation -

i have following model classes related one-to-many relationship. classes persisted sql server database via code first approach: public class topic { [key] public int id { get; set; } [inverseproperty("topic")] public virtual ilist<chapter> chapters { get; set; } //some other properties... } public class chapter : ivalidatableobject { [key] public int id { get; set; } [required] public string key { get; set } public virtual topic topic { get; set; } //some other properties... } each topic contains bunch of chapters . each chapter has key must unique within topic . i trying validate following method: public ienumerable<validationresult> validate(validationcontext validationcontext) { var chapterswithsamekey = topic.chapters.where(t => t.key == key); foreach (var item in chapterswithsamekey) { if (item.id != id) { yield return new validationresult("the k...

python - How to prevent super user deletion in Django admin? -

in django admin have 4 users , super user. have users staff status have limited access , cannot delete/view/edit users admin has authority on every other users , models. want superuser able access users data , edit/modify/delete them not want superuser able delete himself/herself. superuser can delete himself. there way disable superuser delete himself/herself in django?? grateful. thanks do not use has_delete_permission() override not being called on every object when perform delete action changelist. use signals it. add models.py from django.db.models.signals import pre_delete django.dispatch.dispatcher import receiver django.contrib.auth.models import user django.core.exceptions import permissiondenied @receiver(pre_delete, sender=user) def delete_user(sender, instance, **kwargs): if instance.is_superuser: raise permissiondenied the drawback of method nobody able delete super user. have set users attribute "is_superuser" false before can d...

Using phonegap and html5 video tag: caveats? -

i planning build javascript/html5 app, , wrap phonegap installed on android tablet. in it, want show video file. is matter of creating index.html file, , putting mymov.ogv file in same directory, , using: <video src="mymov.ogv"...> and work on android? i have read problems this, quest got me confused. what caveats, if any? ps: video should packaged within phonegap, such video shown when app not connected wifi. it's local file. pps: since it's internal use, able choose particular modern android version (if makes difference). there no need support old android versions whatsoever. according resource: http://caniuse.com/ogv there not support ogv format in android. remember phonegap applications display in rapped browser window-- if browser doesn't support it, can't use it. whether video on-board device or streamed, doesn't matter. you can embed tag, might want use associated javascript api provide control on video. ...

javascript - canvas position getting move after adding to fabric -

Image
i have created canvas on screen. when wrap fabric.js below line getting moved position. please suggest reason. html:: <canvas id="design_text" style="border:1px solid #000000; "> browser not support html5 canvas tag. </canvas> css:: #middle_panel { padding: 5px; margin-left: auto; margin-right: auto; padding-top:15px; border: solid 1px red; text-align: center; background-color: #d0d0d0; height: 500px; width: 48%; margin-left: 27%; } js :: $(document).ready(function() { var canvas = new fabric.canvas('design_text');

c# - How to refrence Excel in .Net application? -

it's showing me error @ below highlight area using excel = microsoft.office.interop.excel; tried add reference there 2 references like microsoft office 5.0 object library 1.0 c:\program file\microsoft office\office\xl5en32.olb microsoft office 9.0 object library 1.3 c:\program file\microsoft office\office\xxcel9.olb i added reference excel .exe throwed error i'e., refrence 'c:...\excel.exe' cannot added.please make sure file acessible , tha valid assmbly or com component.' please suggest if need add references or needs done....

Android autoLink cause render error -

i've got problems autolink="phone" option of textview. ui: <?xml version="1.0" encoding="utf-8"?> <tablelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/tablelayout1" android:layout_width="match_parent" android:layout_height="match_parent"> <textview android:id="@+id/personphone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:autolink="phone" android:text="test" /> </tablelayout> when switching graphical layout (in adt) im getting following error: exception raised during rendering: com/android/i18n/phonenumbers/phonenumberutil exception details logged in window > show view > error log following classes not fou...

c# - Any difference is there Invoke Method (Delegate) and direct call? -

this question has answer here: difference between delegate.invoke , delegate() 2 answers may question asked earlier ,i did googling didnt answer. delegate prototype delegate void method1(string str); adding callback methods method1 objdel2; objdel2 = new method1(testmethod1); objdel2("test"); objdel2.invoke("invoke"); in above coding objdel2("test"); , objdel2.invoke("invoke"); doing same task.which 1 or both same . they 100% identical - pure compiler sugar (see below). preferred: neither / both. static class program { static void main() { method1 objdel2; objdel2 = new method1(testmethod1); objdel2("test"); objdel2.invoke("invoke"); } delegate void method1(string val); static void testmethod1(string val) { ...

Excel VBA executing SQL Server stored procedure - result set throwing error 3704 -

i trying execute sql server stored procedure excel vba. procedure returns rows result set object. however, while running code, throws error: 3704 operation not allowed when object closed note: there no problem database connection because select query running on same connection object working fine. here code: dim cn adodb.connection dim rs adodb.recordset dim cmd adodb.command dim prm adodb.parameter dim rst new adodb.recordset set cn = new adodb.connection set cmd = new adodb.command thisworkbook.initialize cn.provider = "sqloledb" cn.properties("data source").value = thisworkbook.server cn.properties("initial catalog").value = thisworkbook.db cn.properties("user id").value = "xxxxx" cn.properties("password").value = "xxxxx" cn.open set cmd = new adodb.command cmd.commandtext = "generate_kpi_process_quality_check_runtime" cmd.commandtype = adcmdstoredproc cmd.activeconnection = cn set p...

linux - Building gvim 7.4 on CentOS 6.4 -

am trying build gvim7.4 source on box running centos 6.4. followed instructions mentioned here build vim locally. executable 'vim' gets built fine, 'gvim' seen. tried find on google doesn't seem helping. should 'gvim' built using other method (other usual configure/make way)? or there obscure trick build executable gvim? my os: centos 6.4. has x/devel stuff that's required. command used is: ./configure --prefix=/usr --with-compiledby="megazoe" \ --with-features=huge --enable-rubyinterp \ --enable-pythoninterp --enable-python3interp \ --enable-gui=gnome2 --enable-luainterp \ --enable-perlinterp --enable-cscope the stdout configure has below stuff related x: checking if x11 header files can found... yes checking _xdmcpauthdoit in -lxdmcp... no checking iceopenconnection in -lice... yes checking xpmcreatepixmapfromdata in -lxpm... yes checking if x11 header files implicitly de...

c# - How to get table/view name (i.e. remove schema prefix) -

given 1 of following strings (which represent table/view name in sql server): var x = "[my-table.request]"; var x = "[dbo].[my-table.request]"; var x = "dbo.[my-table.request]"; i table name (by c# code): my-table.request any ideas? have missed possible representations here? quite via parsename in tsql: parsename(@x, 1) with edit want in c#, you'd have write scratch in c#, tokenizing . , [ , ] . afaik there no pre-canned implementation you.

xampp - I'm trying to make a dynamic CSS (using php header) but I have problems in client -

i renamed stylesheet full.css.php , on beginning of file wrote code: <?php header("content-type: text/css; charset: utf-8"); //here want set css variables $font_color = '#ccf'; ?> //here starts css body{ color: <?php echo $font_color?>; } the browser giving me this: resource interpreted script transferred mime type text/css: "http://localhost/root/_viewer/css/full.css.php". . and error: "uncaught syntaxerror: unexpected token {" (this first brace body css declaration). if in source, find file sent application/javascript file, not text/css : <script type='application/javascript' src='_viewer/css/full.css.php'></script> i know dynamic css won't cached, it's fine me. it's more important have settings easy access. need fix this. btw: i'm running under xampp ! -i forgot mention: i'm doing similar 1 of js files , it's working fine ( header("content-...

java - How can I make Joda DateTime parser to only accept strings of form yyyyMMdd? -

i use joda-time parse dates in format yyyymmdd (so date should have 8 digits). defined date formatter follows datetimeformatter formatter = datetimeformat.forpattern("yyyymmdd").withzoneutc(); // valid eight-digit date string datevalid = "20130814"; datetime datejoda = formatter.parsedatetime(datevalid); system.out.println(datejoda.tostring()); // invalid 7 digit date string dateinvalid = "2013081"; datejoda = formatter.parsedatetime(dateinvalid); system.out.println(datejoda.tostring()); i expected see exception when parsing second invalid date. output of code 2013-08-14t00:00:00.000z 2013-08-01t00:00:00.000z why joda parser accept invalid date 7 digits? how have change formatter not accept dates don't have 8 digits? the option know of create own datetimeformatter using datetimeformatterbuilder , use fixed decimals each field. in case be: datetimeformatter formatter = new datetimeformatterbuilder() .appendfixeddecimal(d...

c# - How to create an event receiver change permisions on file added sharepoint 2013 -

i have library ("documents") want add event receiver remove permisions on item added. tryed multiple ways i'm not experimented , can't figure i'm wrong. following code managed breakinheritance, didn't managed remove assignmets , add 1 new. public override void itemadded(spitemeventproperties properties) { base.itemadded(properties); if (properties.listtitle.equals("documents")) need on one.{ using (spsite site = new spsite(properties.weburl)) { site.allowunsafeupdates = true; using (spweb web = site.openweb()) { spuser user = web.currentuser; spsecurity.runwithelevatedprivileges(delegate() { try { web.allowunsafeupdates = true; splistitem li = properties.listitem; ...

c# - Dispose DataContext in local database -

i work local database in windows phone. required calling dispose() release resources , how best it? using (datacontext context = new datacontext(dbconnectionstring)) { // context.submitchanges(); context.dispose(); } the using here calls dispose() (no matter whether leaves or via exception ). don't have to.

android - How to ignore mistakenly committed files -

i have android project, , mistakenly added bin folder stage , committed it. how can ignore bin folder , ignore ever? added bin/ .gitignore file, nothing changes , see files in folder in working copy in sourcetree. i using sourcetree git client. along ignoring folder, need git rm it. git ignores files aren't under control. be aware, though: doing cause git remove folder else pulls changes. you'd better sure folder output building, or can otherwise reconstructed. if haven't published changes yet (that is, if you've never pushed them anywhere , no one's pulled them you), have option of rewriting history. can git reset --soft the_commit_before_you_added_bin (of course, you'll need actual commit id, or name it, head~3 etc) "uncommit" right before added it. working copy still have latest versions of files, git forget committed them. (this means lose intermediate changes.) can redo commit(s), being careful avoid bin time. ...

analytic functions - Partition using Lead in Oracle -

i stuck on problem implement lead/lag partition. below example , expected result create table trd( key number, book number, prd_key number, direction varchar2(2), trdtime date, price number) insert trd values(1234,115,133864,'b','17-07-2013 18:18:00',108.859); insert trd values(1235,115,133864,'s','17-07-2013 18:18:00',108.859); insert trd values(1245,115,133864,'s','17-07-2013 18:18:00',108.859); insert trd values(1236,115,133864,'b','15-07-2013 18:18:00',108.872); insert trd values(1237,115,133864,'s','15-07-2013 18:18:00',108.866); insert trd values(1247,115,133864,'s','15-07-2013 18:18:00',108.866); insert trd values(1238,115,133864,'s','14-07-2013 18:18:00',107.86); insert trd values(1239,115,133864,'s','14-07-2013 18:17:00',108.86); insert trd values(1240,115,133864,'b','14-07-2013 18:12:00',109.8...

php - Codeigniter not loading view -

i have code grabs webpage , saves ci application/views folder. plan make changes dynamically , redisplay page. when try load page blank page. can see 'newpage.php' created expected in views folder. here's code: $returned_content = get_data('http://www.yahoo.com'); // uses curl file_put_contents(apppath."views/newpage.php", $returned_content); $this->load->view('newpage'); what doing wrong? addendum: in case povilas correct preloading of views added view named 'html_template' code <?php echo $htmlstring; ?> i changed code $returned_content = get_data('http://www.yahoo.com'); // uses curl $data=array('htmlstring'=>$returned_content); $this->load->view('html_template', $data); thanks help it might codeigniter "preloads" views in beginning, cannot create on fly? another theory - loading view executed earlier file creation operation finishes? couldn't c...

PHP another HTML code after click a Button -

i have following code: <form action="" method="post"> <input type="submit" name="ok" value="Ók"> </form> <?php if (isset($_post['ok'])) { printf "ok"; } ?> i want there html code appear after button pressed i have no idea how it do this: <form action="" method="post"> <input type="submit" name="ok" value="Ók"> </form> <?php if (isset($_post['ok'])) { ?> <div> <p>your html-code here</p> </div> <?php } ?>

c# - Destructor never gets called -

this question has answer here: why destructor never run? 6 answers i have class class creates thread in it's constructor. thread runs while(true) loop reading non-critical data netstream . thread aborted destructor: ~class() { _thread.abort(); _thread = null; } when program wants end use of class 's instance - classinstance , calls: classinstance = null; gc.collect; i thought means ~class() caller automatically @ point - it's not. this thread keeps running after application.exit() , returning main() . the crucial bit of code not included; how thread started , method running. if had make guess started thread passing instance method of class . class instance still rooted running of thread. attempt stop thread in finalizer, finalizer never run because instance still rooted leading catch-22 situation. also, mentioned thread runnin...

Converting Signed byte array content to decimal with shifting in java -

i had byte array hex decimal values , converted array decimal values, using following code byte[] content = message.getfieldvalue( "_decoder message" ).data(); int[] deccontent = new int[ content.length ]; int = 0; ( byte b : content ) deccontent[ i++ ] = b & 0xff; now array looks deccontent = [01 00 05 00 00 00] ; the first 2 indexes of array converted , saved int value below int traceidlow = deccontent[ 0 ] & 0xff; int traceidhigh = deccontent[ 1 ] & 0xff; int traceid = traceidlow | ( traceidhigh << 8 ); the last 4 indexes needs converted int confused shifting whether should 8 or 16 . how can convert last 4 indexes int value according above example value becomes 00 00 00 05 = 5 in decimal. any ideas? thanks something this: int val = deccontent[ 2 ] | (deccontent[ 3 ] << 8) | (deccontent[ 4 ] << 16) | (deccontent[ 5 ] << 24); note integer signed in java. if value unsigned , can larger integer....

java - Jackson configure own json -

i start playing around jackson json stuck @ point. json returned: [ { "id": "1", "groups": [ { "id": "1", "name": "group99", "students": [ { "studentid": "1" }, { "studentid": "2" }, { "studentid": "3" } ], "schoolid": 10 }, { "id": "2", "name": "group100", "students": [ { "studentid": "1" }, { ...

c# - Data travel from DAL to MVC View -

asp.net mvc4 i have business layer dll communicates dal , retrieves classes like: public class productionparameter { public string companycode { get; set; } public string unitcode { get; set; } public string itemdescriptionlocal { get; set; } public string itemdescriptionenglish { get; set; } public string consumeditemdescriptionlocal { get; set; } public string consumeditemdescriptionenglish { get; set; } public string lotcategory1description { get; set; } public string lotcategory2description { get; set; } public string lotcategory3description { get; set; } public string lotcategory1code { get; set; } public string lotcategory2code { get; set; } public string lotcategory3code { get; set; } public string linecode { get; set; } public string linecodedisplay { get; set; } public list<pallet> palletsproduced { get; set; } } my controller gets a...

java - File Upload With Jersey Not Working -

i can't jersey file upload work. using jersey 1.9. inputstream null when gets service. i've tried normal form submission , ajax submission using jquery form plugin, same result either way. there no exceptions logged either, making more frustrating. html form <form id="doccategoryform" name="doccategoryform" action="someaction" method="post" enctype="multipart/form-data"> document <input type="file" name="fileupload_name" id="fileupload_name" > <button id="submitbutton" type="submit" title="select search">submit</button> </form> pom <dependency> <groupid>com.sun.jersey</groupid> <artifactid>jersey-json</artifactid> <version>1.9</version> <scope>provided</scope> </dependency> <dependency> <groupid>com.sun.jersey.contribs</groupid> ...

java - GWT AnnotatedTimeLine exception "AnnotatedTimeLine is not a constructor" -

i'm getting exception when trying create annotatedtimeline object: com.google.gwt.core.client.javascriptexception: (typeerror) @com.google.gwt.visualization.client.visualizations.annotatedtimeline::createjso(lcom/google/gwt/dom/client/element;)([javascript object(1575)]): $wnd.google.visualization.annotatedtimeline not constructor it's being fired right "new annotatedtimeline" line. doing wrong? know library hasn't been updated in while. annotatedtimeline still work? i'm using pie chart it's not problem gwt viz setup. i'm using gwt 2.5.1 , jar gwt-visualization 1.1.2. visualizationutils.loadvisualizationapi(new runnable() { @override public void run() { datatable tabledata = datatable.create(); tabledata.addcolumn(columntype.date, "date"); tabledata.addcolumn(columntype.number, "i"); tabledata.addrows(5); (int = 0; < 5; i++) { ...

ruby on rails - Which record is causing NOTICE: word is too long to be indexed -

using postgres in rails app (with pg_search gem), have enabled search tsvector. in database on 35,000 records several messages saying notice: word long indexed detail: words longer 2047 characters ignored. am correct in assuming "word" not include whitespace? how can determine records causing message? here's sql generated migration introduces indexes == addindexforfulltextsearch: migrating ====================================== -- add_column(:posts, :tsv, :tsvector) -> 0.0344s -- execute(" create index index_posts_tsv on posts using gin(tsv);\n") -> 0.1694s -- execute(" update posts set tsv = (to_tsvector('english', coalesce(title, '')) || \n to_tsvector('english', coalesce(intro, '')) || \n to_tsvector('english', coalesce(body, '')));\n") notice: word long indexed detail: words longer 2047 characters ignored. noti...

sql server - if exists else query not working sql -

if exists (select @item table_restaurantstransaction mobile=@mobile , orderplaced=0 , restaurant=@restaurantname ) begin update table_restaurantstransaction set quantity+=@quantity item=@item , mobile=@mobile , orderplaced=0 , restaurant=@restaurantname end else begin insert table_restaurantstransaction(mobile,transactionid,item,price,decisionstatus,orderplaced,transactiondate,restaurant,quantity) values(@mobile,@transactionid,@item,@price,1,0,getdate(),@restaurantname,@quantity) end end in above query, insert query executed first time when add item. update query getting executed if add same item. if try add new item, insert query not getting executed in else clause. kindly tell mistake. i think want test existence of item in if clause: if exists (select 1 table_restaurantstransaction item = @item , mobile=@mobile , orderplaced=0 , restaurant=@restaurantname ) . . . however, should learn merge statement in 1 statement. ...

javascript - Bootstrap popover without title -

i using bootstrap popovers.there many popovers on page , in 1 of popover , dont want display title,when dont give title, still shows area title have been. found answer on how disable title in twitter bootstrap's popover plugin? but cant give css : display:none popover-title class since hide title other popovers also. what should correct way this? in advance. thanks.. got worked overriding template showpopover=function(message,context){ var popover_message="<div>"+message+"</div>"; //$(a).hide(); $popover=$(context).popover({ placement:"bottom",trigger:"hover",template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><div class="popover-content"><p></p></div></div></div>',content:popover_message}).popover('show'); }; how called function here: html = html +...

popup - Creating a pop up without using javascript alert and URL -

i trying create pop on alink have definition of linked topic. don't want use javascript alert becoz of warning icon. used window.createpopup doesn't works in other browsers ie. there other function in javascript or jquery creating pop information text have in page <script type="text/javascript" src="/javascript/jquery/jquery-ui- 1.8.17.custom.min.js"></script> <script type="text/javascript" src="/javascript/jquery/jquery-ui-1.10.3.custom.min.js"></script> <script type="text/javascript" src="/javascript/jquery/jquery-ui-1.10.3.custom.js"></script> <script type="text/javascript" src="/javascript/jquery/jquery-ui.js"></script> <script type="text/javascript" src="/javascript/jq...

html - Chrome Table Division Handling different than IE -

i new css. when run following code in ie lines spans expected, fixing there widths 100px , padding sides space necessary depending on window size. <table id="tblrecordcount" style="width:100%"> <tr> <td /> <td style="width:100px"> <span id="lbl1" runat="server">records1</span> </td> <td style="width:100px"> <span id="lbl2" runat="server">records2</span> </td> <td style="width:100px"> <span id="lbl3" runat="server">records3</span> </td> <td /> </tr> </table> when run in chrome browser either sets first td width 0px , fills in last one, or sets first , last 0 , stretches middle ones fill space. any css tricks tell chrome behave? can see behavior in jsfiddle...

html5 - Multiples sounds (audio and video) in Samsung SmartTV App -

i'm writing smart hub app project (novosga.org - support system), objective create display show customer ticket number. in app i've video (with sound) , play sounds (beeb , voice) when call next customer. works fine in emulator. however when install app in tv second audio play muted. if video start after beeb, beeb dont work, , vice-versa. samsung smart tv have issue multiples sounds? tests html5: tag audio + tag video samsung-infolink-player (video) + html5 (audio) samsung-infolink-player (video) + swf (audio) multiple swf single swf [update] i've resolved issue using same pluginplayer spliting in video time , audio time. samsung smart tv not support parallel playback of several media files. you can workaround playing sound , video in 1 swf. flash player mix audio , able hear on tv

xamarin - How to resolve IMvxApplication (which inheritor is defined in separate assembly (not Core one))? -

i have usual myapp.core project . however, have general.core project includes general code apps , services shared through different projects (different mobile applications). in general.core project have: public abstract class app : mvxapplication and service defined on general.core. i have public abstract class somethingapp : app in myapp.core (and in every of touch, droid - further inheritance). however, when try app service of general.core project (the same app) that: mvx.resolve<imvxapplication>() i ' cannot resolve ' exception. sure that's because of types names , different assemlies, don't know , how should register (if should) app, because it's not common service. thank you!

PHP file() error, invalid argument -

i have should straightforward operation, gives me error doesn't seem helpful. code this: <?php $strlines = file('//tardis/htdocs/apps/freespace/freespace-servers.txt'); . . . ?> but in php-errors.log, this: [28-aug-2013 16:31:30] php warning: file(//tardis/htdocs/apps/freespace/freespace-servers.txt) [function.file]: failed open stream: invalid argument in c:\program files (x86)\apache software foundation\apache2.2\htdocs\apps\freespace\freespace.php on line 2 the txt file there. ideas else "invalid argument" might suggest? documentation doesn't seem hint @ of else. or, should doing different way? goal read file in array of things. appreciated. if you're using unc, address should file('\\\\tardis\\htdocs\\apps\\freespace\\freespace-servers.txt'); you may need check php configuration allows open remote files.

java - Operating JCalendar in a different time zone -

i work on legacy application makes use of jcalendar . possible operate jcalendar in different time zone? internals of package seem assume local time zone. our application assumes gmt dates , times handled , rendered in gmt com.toedter.calendar.jtextfielddateeditor , com.toedter.calendar.jspinnerdateeditor classes. for expedience, might set default timezone in program. timezone.setdefault(timezone.gettimezone("utc"));

jsp - Can cookies expire before session expires? -

if defined custom cookie age 10 min , keep session open 15 min, custom cookie expire? yes. cookies stored @ client side , session managed @ server side both different session management techniques. if have set cookies expiry time 10 mins , session expiry time 15 mins cookies expire first , session. cookies session cookie example session example better if try example on own. thanks.

python - Django form replicates data -

i trying data form, form reproduced number of times based on list. 1 form each item. form consists of checkbox , textfield. if checkbox checked need accompanying textfield data well. i asked related question here: django validation error u"'' value must decimal number." which solved have new issue. view: item in request.post.getlist('item_list'): item_id = int(item) item = item.objects.get(id=item_id) item_name = item.name print item_name list = list(name = item_name, created_on = now, edited_on = now) price in request.post.getlist('price'): if not price: continue print price list_item.price = decimal(price) list_item.save() item.delete() its not shown above now = timezone.now() . template: <form action="" method...